Skip to content

Commit d47bb58

Browse files
authored
Merge pull request #123 from openinfradev/feature-add-gaia-icons
0.9.17 ~ 0.9.19: Add icons for gaia project
2 parents 7e529a0 + 64881e8 commit d47bb58

File tree

5 files changed

+355
-373
lines changed

5 files changed

+355
-373
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tksui-components",
3-
"version": "0.9.16",
3+
"version": "0.9.19",
44
"private": false,
55
"type": "module",
66
"module": "lib/esm/index.js",

src/components/data-container/drop-holder/TDropHolder.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ const TDropHolder = ({
125125

126126
// region [Events]
127127

128-
const onClickRoot = (): void => {
128+
const onClickRoot = (event: MouseEvent): void => {
129+
event.stopPropagation();
129130
if (isOpened) {
130131
close();
131132
} else {

src/components/data-container/section/TSection.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ export interface TSectionProps extends TBaseProps {
1212
rightAction?: ReactElement;
1313

1414
contentClassName?: string;
15+
width?: string;
1516
}

src/components/data-container/section/TSection.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@ function TSection(props: TSectionProps) {
77
// region [Styles]
88

99
const rootClass: string = useMemo((): string => {
10-
const clazz: string[] = [];
11-
12-
if (props.className) {
13-
clazz.push(props.className);
14-
}
15-
16-
return clazz.join(' ');
10+
return ['t-section', props.className].filter(Boolean).join(' ');
1711
}, [props.className]);
1812

13+
const contentClassName: string = useMemo((): string => {
14+
return ['t-section__content', props.contentClassName].filter(Boolean).join(' ');
15+
}, [props.contentClassName]);
16+
1917
const rootStyle = useMemo((): CSSProperties => {
20-
return props.style || {};
21-
}, [props.style]);
18+
return {
19+
...props.style,
20+
...(props.width && {width: props.width}),
21+
};
22+
}, [props.style, props.width]);
2223

2324
// endregion
2425

2526
return (
26-
<section className={`t-section ${rootClass}`} style={rootStyle} id={props.id} data-testid={'t-section-root'}>
27+
<section className={rootClass} style={rootStyle} id={props.id} data-testid={'t-section-root'}>
2728
{(props.label || props.customLabel || props.leftAction || props.rightAction) && (
2829
<header className={'t-section__header'}>
2930
{(props.label || props.customLabel) && (
@@ -43,7 +44,7 @@ function TSection(props: TSectionProps) {
4344
)}
4445
</header>
4546
)}
46-
<div className={`t-section__content ${props.contentClassName}`}>{props.children}</div>
47+
<div className={contentClassName}>{props.children}</div>
4748
</section>
4849
);
4950
}

0 commit comments

Comments
 (0)