Skip to content

Commit

Permalink
Merge pull request #105 from openinfradev/bugfix-form-section
Browse files Browse the repository at this point in the history
Bugfix. Trivial bugfix regarding FormSection
  • Loading branch information
Siyeop authored May 14, 2024
2 parents 7bf1565 + d882bf2 commit f31e393
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 862 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tksui-components",
"version": "0.6.22",
"version": "0.7.0",
"private": false,
"type": "module",
"module": "lib/esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface TFormSectionProps extends TBaseProps {

export interface TFormSectionRowProps extends TBaseProps {
children: ReactNode,
formRowVerticalAlign?: RowVerticalAlign,
verticalAlign?: RowVerticalAlign,
}

export interface TFormSectionItemProps extends TBaseProps {
Expand Down
13 changes: 11 additions & 2 deletions src/components/data-container/form-section/TFormSectionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,17 @@ const TFormSectionItem = (props: TFormSectionItemProps) => {

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

return props.contentStyle ? {...props.contentStyle} : {};
}, [props.contentStyle]);
const style: CSSProperties = {...props.contentStyle};

if (rowVerticalAlign === 'middle') {
style.alignItems = 'center';
}
if (rowVerticalAlign === 'top') {
style.alignItems = 'flex-start';
}

return style;
}, [props.contentStyle, rowVerticalAlign]);

// endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const TFormSectionRow = (props: TFormSectionRowProps) => {
<div className={`t-form-section-row ${rootClass}`} style={rootStyle}>
<TFormSectionContext.Provider value={{
...formContext,
rowVerticalAlign: props.formRowVerticalAlign,
rowVerticalAlign: props.verticalAlign,
}}>
{props.children}
</TFormSectionContext.Provider>
Expand All @@ -44,4 +44,8 @@ const TFormSectionRow = (props: TFormSectionRowProps) => {

TFormSectionRow.displayName = 'TFormSectionRow';

TFormSectionRow.defaultProps = {
verticalAlign: 'middle',
};

export default TFormSectionRow;
4 changes: 2 additions & 2 deletions src/components/data-container/form-section/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export {default as TFormSection} from './TFormSection';
export {default as TFormRow} from './TFormSectionRow';
export {default as TFormItem} from './TFormSectionItem';
export {default as TFormSectionRow} from './TFormSectionRow';
export {default as TFormSectionItem} from './TFormSectionItem';

export * from './TFormSection.interface';
33 changes: 0 additions & 33 deletions src/components/data-container/search-box/TSearchBox.interface.ts

This file was deleted.

120 changes: 0 additions & 120 deletions src/components/data-container/search-box/TSearchBox.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/data-container/search-box/TSearchBoxContext.ts

This file was deleted.

70 changes: 0 additions & 70 deletions src/components/data-container/search-box/TSearchBoxItem.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions src/components/data-container/search-box/TSearchBoxRow.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/components/data-container/search-box/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export * from './data-container/form-section';
export * from './data-container/action-bar';
export * from './data-container/highlight-text';
export * from './data-container/pagination';
export * from './data-container/search-box';
export * from './data-container/tab-box';
export * from './data-container/step-box';
export * from './data-container/card';
Expand Down
1 change: 0 additions & 1 deletion src/styles/component/Components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@import 'button/icon-button/TIconButton';

// data-container
@import 'data-container/search-box/TSearchBox.scss';
@import 'data-container/data-grid/TDataGrid.scss';
@import 'data-container/highlight-text/THighlightText.scss';
@import 'data-container/drop-holder/TDropHolder.scss';
Expand Down
Loading

0 comments on commit f31e393

Please sign in to comment.