Skip to content

Commit f31e393

Browse files
authored
Merge pull request #105 from openinfradev/bugfix-form-section
Bugfix. Trivial bugfix regarding FormSection
2 parents 7bf1565 + d882bf2 commit f31e393

File tree

21 files changed

+27
-862
lines changed

21 files changed

+27
-862
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.6.22",
3+
"version": "0.7.0",
44
"private": false,
55
"type": "module",
66
"module": "lib/esm/index.js",

src/components/data-container/form-section/TFormSection.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface TFormSectionProps extends TBaseProps {
2626

2727
export interface TFormSectionRowProps extends TBaseProps {
2828
children: ReactNode,
29-
formRowVerticalAlign?: RowVerticalAlign,
29+
verticalAlign?: RowVerticalAlign,
3030
}
3131

3232
export interface TFormSectionItemProps extends TBaseProps {

src/components/data-container/form-section/TFormSectionItem.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,17 @@ const TFormSectionItem = (props: TFormSectionItemProps) => {
8080

8181
const contentStyle = useMemo((): CSSProperties => {
8282

83-
return props.contentStyle ? {...props.contentStyle} : {};
84-
}, [props.contentStyle]);
83+
const style: CSSProperties = {...props.contentStyle};
84+
85+
if (rowVerticalAlign === 'middle') {
86+
style.alignItems = 'center';
87+
}
88+
if (rowVerticalAlign === 'top') {
89+
style.alignItems = 'flex-start';
90+
}
91+
92+
return style;
93+
}, [props.contentStyle, rowVerticalAlign]);
8594

8695
// endregion
8796

src/components/data-container/form-section/TFormSectionRow.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const TFormSectionRow = (props: TFormSectionRowProps) => {
3333
<div className={`t-form-section-row ${rootClass}`} style={rootStyle}>
3434
<TFormSectionContext.Provider value={{
3535
...formContext,
36-
rowVerticalAlign: props.formRowVerticalAlign,
36+
rowVerticalAlign: props.verticalAlign,
3737
}}>
3838
{props.children}
3939
</TFormSectionContext.Provider>
@@ -44,4 +44,8 @@ const TFormSectionRow = (props: TFormSectionRowProps) => {
4444

4545
TFormSectionRow.displayName = 'TFormSectionRow';
4646

47+
TFormSectionRow.defaultProps = {
48+
verticalAlign: 'middle',
49+
};
50+
4751
export default TFormSectionRow;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export {default as TFormSection} from './TFormSection';
2-
export {default as TFormRow} from './TFormSectionRow';
3-
export {default as TFormItem} from './TFormSectionItem';
2+
export {default as TFormSectionRow} from './TFormSectionRow';
3+
export {default as TFormSectionItem} from './TFormSectionItem';
44

55
export * from './TFormSection.interface';

src/components/data-container/search-box/TSearchBox.interface.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/components/data-container/search-box/TSearchBox.tsx

Lines changed: 0 additions & 120 deletions
This file was deleted.

src/components/data-container/search-box/TSearchBoxContext.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/components/data-container/search-box/TSearchBoxItem.tsx

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/components/data-container/search-box/TSearchBoxRow.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/components/data-container/search-box/index.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export * from './data-container/form-section';
1414
export * from './data-container/action-bar';
1515
export * from './data-container/highlight-text';
1616
export * from './data-container/pagination';
17-
export * from './data-container/search-box';
1817
export * from './data-container/tab-box';
1918
export * from './data-container/step-box';
2019
export * from './data-container/card';

src/styles/component/Components.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
@import 'button/icon-button/TIconButton';
55

66
// data-container
7-
@import 'data-container/search-box/TSearchBox.scss';
87
@import 'data-container/data-grid/TDataGrid.scss';
98
@import 'data-container/highlight-text/THighlightText.scss';
109
@import 'data-container/drop-holder/TDropHolder.scss';

0 commit comments

Comments
 (0)