@oliasoft-open-source/react-ui-library 3.12.0-beta-19 → 3.12.0-beta-21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common-enum.d.ts +73 -0
- package/dist/common-enum.js +81 -0
- package/dist/components/accordion/accordion.d.ts +4 -0
- package/dist/components/accordion/accordion.interface.d.ts +17 -0
- package/dist/components/accordion/accordion.interface.js +1 -0
- package/dist/components/accordion/accordion.js +17 -0
- package/dist/components/accordion/accordion.stories.d.ts +11 -0
- package/dist/components/accordion/accordion.stories.js +140 -0
- package/dist/components/accordion/chevron/chevron.d.ts +5 -0
- package/dist/components/accordion/chevron/chevron.js +8 -0
- package/dist/components/accordion/enum.d.ts +4 -0
- package/dist/components/accordion/enum.js +5 -0
- package/dist/components/accordion/helpers/accordion-with-default-toggle.d.ts +12 -0
- package/dist/components/accordion/helpers/accordion-with-default-toggle.js +35 -0
- package/dist/components/actions/actions.d.ts +14 -0
- package/dist/components/actions/actions.interface.d.ts +25 -0
- package/dist/components/actions/actions.interface.js +1 -0
- package/dist/components/actions/actions.js +66 -0
- package/dist/components/actions/actions.stories.d.ts +25 -0
- package/dist/components/actions/actions.stories.js +67 -0
- package/dist/components/badge/badge.d.ts +10 -0
- package/dist/components/badge/badge.js +21 -0
- package/dist/components/badge/badge.stories.d.ts +7 -0
- package/dist/components/badge/badge.stories.js +21 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +6 -0
- package/dist/components/breadcrumb/breadcrumb.js +11 -0
- package/dist/components/breadcrumb/breadcrumb.stories.d.ts +5 -0
- package/dist/components/breadcrumb/breadcrumb.stories.js +36 -0
- package/dist/components/breadcrumb/enum.d.ts +5 -0
- package/dist/components/breadcrumb/enum.js +6 -0
- package/dist/components/breadcrumb/link.d.ts +12 -0
- package/dist/components/breadcrumb/link.js +12 -0
- package/dist/components/button/button.d.ts +31 -0
- package/dist/components/button/button.js +52 -0
- package/dist/components/button/button.stories.d.ts +13 -0
- package/dist/components/button/button.stories.js +63 -0
- package/dist/components/button/enum.d.ts +5 -0
- package/dist/components/button/enum.js +6 -0
- package/dist/components/button-group/button-group.d.ts +38 -0
- package/dist/components/button-group/button-group.js +83 -0
- package/dist/components/button-group/button-group.stories-data.d.ts +6 -0
- package/dist/components/button-group/button-group.stories-data.js +61 -0
- package/dist/components/button-group/button-group.stories.d.ts +9 -0
- package/dist/components/button-group/button-group.stories.js +51 -0
- package/dist/components/card/card.d.ts +10 -0
- package/dist/components/card/card.js +6 -0
- package/dist/components/card/card.stories.d.ts +8 -0
- package/dist/components/card/card.stories.js +27 -0
- package/dist/components/check-box/check-box.d.ts +19 -0
- package/dist/components/check-box/check-box.js +19 -0
- package/dist/components/check-box/check-box.stories.d.ts +6 -0
- package/dist/components/check-box/check-box.stories.js +29 -0
- package/dist/components/color/color.stories-data.d.ts +9 -0
- package/dist/components/color/color.stories-data.js +55 -0
- package/dist/components/dialog/dialog.d.ts +17 -0
- package/dist/components/dialog/dialog.js +18 -0
- package/dist/components/divider/divider.d.ts +9 -0
- package/dist/components/divider/divider.js +19 -0
- package/dist/components/divider/divider.stories.d.ts +7 -0
- package/dist/components/divider/divider.stories.js +41 -0
- package/dist/components/drawer/drawer-resize-wrapper.d.ts +2 -0
- package/dist/components/drawer/drawer-resize-wrapper.js +33 -0
- package/dist/components/drawer/drawer-tabs.d.ts +2 -0
- package/dist/components/drawer/drawer-tabs.js +15 -0
- package/dist/components/drawer/drawer.constants.d.ts +2 -0
- package/dist/components/drawer/drawer.constants.js +2 -0
- package/dist/components/drawer/drawer.d.ts +2 -0
- package/dist/components/drawer/drawer.interface.d.ts +55 -0
- package/dist/components/drawer/drawer.interface.js +1 -0
- package/dist/components/drawer/drawer.js +80 -0
- package/dist/components/drawer/drawer.stories.d.ts +40 -0
- package/dist/components/drawer/drawer.stories.js +176 -0
- package/dist/components/empty/empty.d.ts +8 -0
- package/dist/components/empty/empty.js +6 -0
- package/dist/components/empty/empty.stories.d.ts +5 -0
- package/dist/components/empty/empty.stories.js +19 -0
- package/dist/components/file-input/enum.d.ts +6 -0
- package/dist/components/file-input/enum.js +7 -0
- package/dist/components/file-input/file-input.d.ts +18 -0
- package/dist/components/file-input/file-input.js +47 -0
- package/dist/components/file-input/file-input.stories.d.ts +7 -0
- package/dist/components/file-input/file-input.stories.js +65 -0
- package/dist/components/form/field.d.ts +16 -0
- package/dist/components/form/field.js +13 -0
- package/dist/components/form/field.stories.d.ts +12 -0
- package/dist/components/form/field.stories.js +51 -0
- package/dist/components/form/form.stories.d.ts +27 -0
- package/dist/components/form/form.stories.js +76 -0
- package/dist/components/heading/heading.d.ts +19 -0
- package/dist/components/heading/heading.js +9 -0
- package/dist/components/heading/heading.stories.d.ts +10 -0
- package/dist/components/heading/heading.stories.js +46 -0
- package/dist/components/help-icon/help-icon.d.ts +10 -0
- package/dist/components/help-icon/help-icon.js +19 -0
- package/dist/components/help-icon/help-icon.stories.d.ts +10 -0
- package/dist/components/help-icon/help-icon.stories.js +37 -0
- package/dist/components/icon/icon.d.ts +16 -0
- package/dist/components/icon/icon.js +31 -0
- package/dist/components/icon/icon.stories.d.ts +25 -0
- package/dist/components/icon/icon.stories.js +37 -0
- package/dist/components/icon/named-icon.d.ts +6 -0
- package/dist/components/icon/named-icon.js +418 -0
- package/dist/components/input/input.d.ts +26 -0
- package/dist/components/input/input.js +40 -0
- package/dist/components/input/input.stories.d.ts +5 -0
- package/dist/components/input/input.stories.js +22 -0
- package/dist/components/input-group/input-group-addon/input-group-addon.d.ts +8 -0
- package/dist/components/input-group/input-group-addon/input-group-addon.js +20 -0
- package/dist/components/input-group/input-group.d.ts +7 -0
- package/dist/components/input-group/input-group.js +27 -0
- package/dist/components/input-group/input-group.stories.d.ts +8 -0
- package/dist/components/input-group/input-group.stories.js +65 -0
- package/dist/components/label/label.d.ts +24 -0
- package/dist/components/label/label.js +14 -0
- package/dist/components/label/label.stories.d.ts +10 -0
- package/dist/components/label/label.stories.js +42 -0
- package/dist/components/layout/column/column.d.ts +18 -0
- package/dist/components/layout/column/column.js +13 -0
- package/dist/components/layout/column/styles.d.ts +15 -0
- package/dist/components/layout/column/styles.js +41 -0
- package/dist/components/layout/column.stories.d.ts +20 -0
- package/dist/components/layout/column.stories.js +53 -0
- package/dist/components/layout/flex/flex.d.ts +11 -0
- package/dist/components/layout/flex/flex.js +18 -0
- package/dist/components/layout/flex/flex.stories.d.ts +10 -0
- package/dist/components/layout/flex/flex.stories.js +52 -0
- package/dist/components/layout/form-row/form-row.d.ts +5 -0
- package/dist/components/layout/form-row/form-row.js +5 -0
- package/dist/components/layout/grid/grid.d.ts +11 -0
- package/dist/components/layout/grid/grid.js +41 -0
- package/dist/components/layout/grid/grid.stories.d.ts +9 -0
- package/dist/components/layout/grid/grid.stories.js +48 -0
- package/dist/components/layout/page/page.d.ts +9 -0
- package/dist/components/layout/page/page.js +11 -0
- package/dist/components/layout/page.stories.d.ts +9 -0
- package/dist/components/layout/page.stories.js +32 -0
- package/dist/components/layout/placeholder.d.ts +1 -0
- package/dist/components/layout/placeholder.js +1 -0
- package/dist/components/layout/print-header/print-header.d.ts +7 -0
- package/dist/components/layout/print-header/print-header.js +3 -0
- package/dist/components/layout/row/row.d.ts +15 -0
- package/dist/components/layout/row/row.js +24 -0
- package/dist/components/layout/spacer/spacer.d.ts +6 -0
- package/dist/components/layout/spacer/spacer.js +8 -0
- package/dist/components/list/list-row/item-content.d.ts +2 -0
- package/dist/components/list/list-row/item-content.js +9 -0
- package/dist/components/list/list-row/label.d.ts +2 -0
- package/dist/components/list/list-row/label.js +6 -0
- package/dist/components/list/list-row/list-heading.d.ts +3 -0
- package/dist/components/list/list-row/list-heading.js +10 -0
- package/dist/components/list/list-row/list-row.d.ts +3 -0
- package/dist/components/list/list-row/list-row.interface.d.ts +105 -0
- package/dist/components/list/list-row/list-row.interface.js +1 -0
- package/dist/components/list/list-row/list-row.js +56 -0
- package/dist/components/list/list-row/list-subheading.d.ts +3 -0
- package/dist/components/list/list-row/list-subheading.js +27 -0
- package/dist/components/list/list-row/meta-content.d.ts +2 -0
- package/dist/components/list/list-row/meta-content.js +12 -0
- package/dist/components/list/list-row/meta-count.d.ts +2 -0
- package/dist/components/list/list-row/meta-count.js +5 -0
- package/dist/components/list/list-row/name.d.ts +3 -0
- package/dist/components/list/list-row/name.js +12 -0
- package/dist/components/list/list.d.ts +2 -0
- package/dist/components/list/list.interface.d.ts +55 -0
- package/dist/components/list/list.interface.js +1 -0
- package/dist/components/list/list.js +86 -0
- package/dist/components/list/list.stories-data.d.ts +310 -0
- package/dist/components/list/list.stories-data.js +270 -0
- package/dist/components/list/list.stories.d.ts +22 -0
- package/dist/components/list/list.stories.js +411 -0
- package/dist/components/list/toggle-narrow.d.ts +2 -0
- package/dist/components/list/toggle-narrow.js +7 -0
- package/dist/components/loader/loader.d.ts +14 -0
- package/dist/components/loader/loader.js +15 -0
- package/dist/components/loader/loader.stories.d.ts +32 -0
- package/dist/components/loader/loader.stories.js +92 -0
- package/dist/components/menu/enum.d.ts +11 -0
- package/dist/components/menu/enum.js +13 -0
- package/dist/components/menu/index.d.ts +4 -0
- package/dist/components/menu/index.js +8 -0
- package/dist/components/menu/layer/divider.d.ts +1 -0
- package/dist/components/menu/layer/divider.js +3 -0
- package/dist/components/menu/layer/heading.d.ts +8 -0
- package/dist/components/menu/layer/heading.js +3 -0
- package/dist/components/menu/layer/layer.d.ts +15 -0
- package/dist/components/menu/layer/layer.js +47 -0
- package/dist/components/menu/layer/option.d.ts +19 -0
- package/dist/components/menu/layer/option.js +22 -0
- package/dist/components/menu/layer/path.d.ts +5 -0
- package/dist/components/menu/layer/path.js +30 -0
- package/dist/components/menu/layer/placementOptions.d.ts +3 -0
- package/dist/components/menu/layer/placementOptions.js +6 -0
- package/dist/components/menu/layer/section.d.ts +10 -0
- package/dist/components/menu/layer/section.js +23 -0
- package/dist/components/menu/menu.d.ts +3 -0
- package/dist/components/menu/menu.interface.d.ts +82 -0
- package/dist/components/menu/menu.interface.js +1 -0
- package/dist/components/menu/menu.js +92 -0
- package/dist/components/menu/menu.stories-data.d.ts +101 -0
- package/dist/components/menu/menu.stories-data.js +182 -0
- package/dist/components/menu/menu.stories.d.ts +31 -0
- package/dist/components/menu/menu.stories.js +104 -0
- package/dist/components/menu/menu.test.d.ts +1 -0
- package/dist/components/menu/menu.test.js +46 -0
- package/dist/components/menu/trigger/button.d.ts +14 -0
- package/dist/components/menu/trigger/button.js +13 -0
- package/dist/components/menu/trigger/component.d.ts +8 -0
- package/dist/components/menu/trigger/component.js +6 -0
- package/dist/components/menu/trigger/text.d.ts +10 -0
- package/dist/components/menu/trigger/text.js +9 -0
- package/dist/components/menu/trigger/trigger.d.ts +27 -0
- package/dist/components/menu/trigger/trigger.js +35 -0
- package/dist/components/message/dismiss.d.ts +8 -0
- package/dist/components/message/dismiss.js +17 -0
- package/dist/components/message/enum.d.ts +9 -0
- package/dist/components/message/enum.js +11 -0
- package/dist/components/message/message.d.ts +19 -0
- package/dist/components/message/message.js +49 -0
- package/dist/components/message/message.stories.d.ts +11 -0
- package/dist/components/message/message.stories.js +82 -0
- package/dist/components/modal/modal.d.ts +8 -0
- package/dist/components/modal/modal.js +7 -0
- package/dist/components/modal/modal.stories.d.ts +12 -0
- package/dist/components/modal/modal.stories.js +107 -0
- package/dist/components/number-input/number-input.d.ts +26 -0
- package/dist/components/number-input/number-input.js +66 -0
- package/dist/components/number-input/number-input.stories.d.ts +13 -0
- package/dist/components/number-input/number-input.stories.js +43 -0
- package/dist/components/option-dropdown/enum.d.ts +5 -0
- package/dist/components/option-dropdown/enum.js +6 -0
- package/dist/components/option-dropdown/heading.d.ts +4 -0
- package/dist/components/option-dropdown/heading.js +3 -0
- package/dist/components/option-dropdown/layer.d.ts +16 -0
- package/dist/components/option-dropdown/layer.js +43 -0
- package/dist/components/option-dropdown/option-dropdown.d.ts +19 -0
- package/dist/components/option-dropdown/option-dropdown.js +17 -0
- package/dist/components/option-dropdown/option-dropdown.stories.d.ts +5 -0
- package/dist/components/option-dropdown/option-dropdown.stories.js +35 -0
- package/dist/components/option-dropdown/option.d.ts +10 -0
- package/dist/components/option-dropdown/option.js +7 -0
- package/dist/components/pagination/pagination.d.ts +13 -0
- package/dist/components/pagination/pagination.interface.d.ts +15 -0
- package/dist/components/pagination/pagination.interface.js +1 -0
- package/dist/components/pagination/pagination.js +33 -0
- package/dist/components/pagination/pagination.stories.d.ts +7 -0
- package/dist/components/pagination/pagination.stories.js +62 -0
- package/dist/components/pagination/pagination.test.d.ts +1 -0
- package/dist/components/pagination/pagination.test.js +84 -0
- package/dist/components/pagination/pagination.viewdata.d.ts +17 -0
- package/dist/components/pagination/pagination.viewdata.js +53 -0
- package/dist/components/pop-confirm/content.d.ts +9 -0
- package/dist/components/pop-confirm/content.js +5 -0
- package/dist/components/pop-confirm/pop-confirm.d.ts +14 -0
- package/dist/components/pop-confirm/pop-confirm.js +7 -0
- package/dist/components/pop-confirm/pop-confirm.stories.d.ts +4 -0
- package/dist/components/pop-confirm/pop-confirm.stories.js +43 -0
- package/dist/components/popover/popover.d.ts +14 -0
- package/dist/components/popover/popover.js +39 -0
- package/dist/components/popover/popover.stories.d.ts +7 -0
- package/dist/components/popover/popover.stories.js +43 -0
- package/dist/components/portal/portal.d.ts +6 -0
- package/dist/components/portal/portal.js +11 -0
- package/dist/components/portal/portal.stories.d.ts +7 -0
- package/dist/components/portal/portal.stories.js +51 -0
- package/dist/components/progress-bar/progress-bar.d.ts +9 -0
- package/dist/components/progress-bar/progress-bar.js +21 -0
- package/dist/components/progress-bar/progress-bar.stories.d.ts +4 -0
- package/dist/components/progress-bar/progress-bar.stories.js +16 -0
- package/dist/components/radio-button/radio-button.d.ts +27 -0
- package/dist/components/radio-button/radio-button.js +45 -0
- package/dist/components/radio-button/radio-button.stories.d.ts +5 -0
- package/dist/components/radio-button/radio-button.stories.js +45 -0
- package/dist/components/radio-button/radio-input.d.ts +16 -0
- package/dist/components/radio-button/radio-input.js +9 -0
- package/dist/components/rich-text-input/rich-text-input.d.ts +10 -0
- package/dist/components/rich-text-input/rich-text-input.js +35 -0
- package/dist/components/rich-text-input/rich-text-input.stories.d.ts +9 -0
- package/dist/components/rich-text-input/rich-text-input.stories.js +60 -0
- package/dist/components/rich-text-input/rich-text-toolbar/enum.d.ts +7 -0
- package/dist/components/rich-text-input/rich-text-toolbar/enum.js +8 -0
- package/dist/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.d.ts +7 -0
- package/dist/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.js +42 -0
- package/dist/components/select/custom-select/custom-select.d.ts +2 -0
- package/dist/components/select/custom-select/custom-select.interface.d.ts +47 -0
- package/dist/components/select/custom-select/custom-select.interface.js +1 -0
- package/dist/components/select/custom-select/custom-select.js +51 -0
- package/dist/components/select/custom-select/custom-select.reducer.d.ts +6 -0
- package/dist/components/select/custom-select/custom-select.reducer.js +140 -0
- package/dist/components/select/custom-select/enum.d.ts +11 -0
- package/dist/components/select/custom-select/enum.js +12 -0
- package/dist/components/select/custom-select/helper.d.ts +3 -0
- package/dist/components/select/custom-select/helper.js +55 -0
- package/dist/components/select/custom-select/hooks/enum.d.ts +20 -0
- package/dist/components/select/custom-select/hooks/enum.js +22 -0
- package/dist/components/select/custom-select/hooks/use-custom-select-logic.d.ts +39 -0
- package/dist/components/select/custom-select/hooks/use-custom-select-logic.js +222 -0
- package/dist/components/select/custom-select/layer/heading.d.ts +3 -0
- package/dist/components/select/custom-select/layer/heading.js +5 -0
- package/dist/components/select/custom-select/layer/layer.d.ts +17 -0
- package/dist/components/select/custom-select/layer/layer.js +25 -0
- package/dist/components/select/custom-select/layer/option.d.ts +15 -0
- package/dist/components/select/custom-select/layer/option.js +10 -0
- package/dist/components/select/custom-select/layer/placementOptions.d.ts +10 -0
- package/dist/components/select/custom-select/layer/placementOptions.js +7 -0
- package/dist/components/select/custom-select/layer/section.d.ts +15 -0
- package/dist/components/select/custom-select/layer/section.js +16 -0
- package/dist/components/select/custom-select/reducer.interface.d.ts +34 -0
- package/dist/components/select/custom-select/reducer.interface.js +1 -0
- package/dist/components/select/custom-select/trigger/input.d.ts +14 -0
- package/dist/components/select/custom-select/trigger/input.js +21 -0
- package/dist/components/select/custom-select/trigger/multi-selected-options.d.ts +8 -0
- package/dist/components/select/custom-select/trigger/multi-selected-options.js +41 -0
- package/dist/components/select/custom-select/trigger/trigger.d.ts +34 -0
- package/dist/components/select/custom-select/trigger/trigger.js +53 -0
- package/dist/components/select/native-select/native-select.d.ts +29 -0
- package/dist/components/select/native-select/native-select.js +61 -0
- package/dist/components/select/select.d.ts +2 -0
- package/dist/components/select/select.input.d.ts +21 -0
- package/dist/components/select/select.input.js +114 -0
- package/dist/components/select/select.interface.d.ts +39 -0
- package/dist/components/select/select.interface.js +1 -0
- package/dist/components/select/select.js +61 -0
- package/dist/components/select/select.stories-data.d.ts +25 -0
- package/dist/components/select/select.stories-data.js +113 -0
- package/dist/components/select/select.stories.d.ts +30 -0
- package/dist/components/select/select.stories.js +93 -0
- package/dist/components/select/select.test.d.ts +1 -0
- package/dist/components/select/select.test.js +303 -0
- package/dist/components/side-bar/link.d.ts +17 -0
- package/dist/components/side-bar/link.js +20 -0
- package/dist/components/side-bar/sections.d.ts +21 -0
- package/dist/components/side-bar/sections.js +7 -0
- package/dist/components/side-bar/side-bar.d.ts +26 -0
- package/dist/components/side-bar/side-bar.js +28 -0
- package/dist/components/side-bar/side-bar.stories.d.ts +5 -0
- package/dist/components/side-bar/side-bar.stories.js +90 -0
- package/dist/components/slider/slider-tooltip.d.ts +5 -0
- package/dist/components/slider/slider-tooltip.js +13 -0
- package/dist/components/slider/slider.d.ts +37 -0
- package/dist/components/slider/slider.js +57 -0
- package/dist/components/slider/slider.stories.d.ts +16 -0
- package/dist/components/slider/slider.stories.js +85 -0
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +6 -0
- package/dist/components/spinner/spinner.stories.d.ts +4 -0
- package/dist/components/spinner/spinner.stories.js +14 -0
- package/dist/components/table/cell/cell-types/action-cell.d.ts +5 -0
- package/dist/components/table/cell/cell-types/action-cell.js +5 -0
- package/dist/components/table/cell/cell-types/cell-help-icon.d.ts +5 -0
- package/dist/components/table/cell/cell-types/cell-help-icon.js +7 -0
- package/dist/components/table/cell/cell-types/cell-library-icon.d.ts +5 -0
- package/dist/components/table/cell/cell-types/cell-library-icon.js +8 -0
- package/dist/components/table/cell/cell-types/cell-types.interface.d.ts +150 -0
- package/dist/components/table/cell/cell-types/cell-types.interface.js +1 -0
- package/dist/components/table/cell/cell-types/check-box-cell.d.ts +7 -0
- package/dist/components/table/cell/cell-types/check-box-cell.js +5 -0
- package/dist/components/table/cell/cell-types/icon-cell.d.ts +5 -0
- package/dist/components/table/cell/cell-types/icon-cell.js +9 -0
- package/dist/components/table/cell/cell-types/input-cell.d.ts +8 -0
- package/dist/components/table/cell/cell-types/input-cell.js +6 -0
- package/dist/components/table/cell/cell-types/link-cell.d.ts +7 -0
- package/dist/components/table/cell/cell-types/link-cell.js +23 -0
- package/dist/components/table/cell/cell-types/number-input-cell.d.ts +7 -0
- package/dist/components/table/cell/cell-types/number-input-cell.js +5 -0
- package/dist/components/table/cell/cell-types/popover-cell.d.ts +6 -0
- package/dist/components/table/cell/cell-types/popover-cell.js +8 -0
- package/dist/components/table/cell/cell-types/select-cell.d.ts +8 -0
- package/dist/components/table/cell/cell-types/select-cell.js +6 -0
- package/dist/components/table/cell/cell-types/slider-cell.d.ts +6 -0
- package/dist/components/table/cell/cell-types/slider-cell.js +6 -0
- package/dist/components/table/cell/cell-types/sort-cell.d.ts +5 -0
- package/dist/components/table/cell/cell-types/sort-cell.js +9 -0
- package/dist/components/table/cell/cell-types/static-cell.d.ts +7 -0
- package/dist/components/table/cell/cell-types/static-cell.js +16 -0
- package/dist/components/table/cell/cell-wrapper.d.ts +8 -0
- package/dist/components/table/cell/cell-wrapper.js +33 -0
- package/dist/components/table/cell/cell.d.ts +12 -0
- package/dist/components/table/cell/cell.js +45 -0
- package/dist/components/table/cell/cell.stories.d.ts +21 -0
- package/dist/components/table/cell/cell.stories.js +209 -0
- package/dist/components/table/cell/input-cell-wrapper.d.ts +7 -0
- package/dist/components/table/cell/input-cell-wrapper.js +8 -0
- package/dist/components/table/enum.d.ts +9 -0
- package/dist/components/table/enum.js +10 -0
- package/dist/components/table/footer/footer.d.ts +10 -0
- package/dist/components/table/footer/footer.js +18 -0
- package/dist/components/table/footer/footer.stories.d.ts +3 -0
- package/dist/components/table/footer/footer.stories.js +19 -0
- package/dist/components/table/helper.d.ts +22 -0
- package/dist/components/table/helper.js +49 -0
- package/dist/components/table/helper.test.d.ts +1 -0
- package/dist/components/table/helper.test.js +127 -0
- package/dist/components/table/row/expanded-content-row.d.ts +7 -0
- package/dist/components/table/row/expanded-content-row.js +6 -0
- package/dist/components/table/row/row.d.ts +37 -0
- package/dist/components/table/row/row.js +46 -0
- package/dist/components/table/row/row.stories.d.ts +9 -0
- package/dist/components/table/row/row.stories.js +132 -0
- package/dist/components/table/table-scroll-wrapper.d.ts +13 -0
- package/dist/components/table/table-scroll-wrapper.js +24 -0
- package/dist/components/table/table.d.ts +34 -0
- package/dist/components/table/table.js +91 -0
- package/dist/components/table/table.stories-data.d.ts +1970 -0
- package/dist/components/table/table.stories-data.js +996 -0
- package/dist/components/table/table.stories.d.ts +17 -0
- package/dist/components/table/table.stories.js +521 -0
- package/dist/components/table/table.test.d.ts +1 -0
- package/dist/components/table/table.test.js +27 -0
- package/dist/components/table/table.viewdata.d.ts +16 -0
- package/dist/components/table/table.viewdata.js +17 -0
- package/dist/components/table/title/title.d.ts +8 -0
- package/dist/components/table/title/title.js +22 -0
- package/dist/components/table/title/title.stories.d.ts +11 -0
- package/dist/components/table/title/title.stories.js +53 -0
- package/dist/components/tabs/content.d.ts +7 -0
- package/dist/components/tabs/content.js +6 -0
- package/dist/components/tabs/label.d.ts +14 -0
- package/dist/components/tabs/label.js +8 -0
- package/dist/components/tabs/tabs.d.ts +33 -0
- package/dist/components/tabs/tabs.js +64 -0
- package/dist/components/tabs/tabs.stories.d.ts +10 -0
- package/dist/components/tabs/tabs.stories.js +86 -0
- package/dist/components/text/text.d.ts +15 -0
- package/dist/components/text/text.js +6 -0
- package/dist/components/text/text.stories.d.ts +6 -0
- package/dist/components/text/text.stories.js +22 -0
- package/dist/components/text-link/text-link.d.ts +9 -0
- package/dist/components/text-link/text-link.js +5 -0
- package/dist/components/text-link/text-link.stories.d.ts +5 -0
- package/dist/components/text-link/text-link.stories.js +17 -0
- package/dist/components/textarea/textarea.d.ts +22 -0
- package/dist/components/textarea/textarea.js +15 -0
- package/dist/components/textarea/textarea.stories.d.ts +4 -0
- package/dist/components/textarea/textarea.stories.js +18 -0
- package/dist/components/toaster/toaster.d.ts +19 -0
- package/dist/components/toaster/toaster.js +51 -0
- package/dist/components/toaster/toaster.stories.d.ts +15 -0
- package/dist/components/toaster/toaster.stories.js +84 -0
- package/dist/components/toggle/toggle.d.ts +14 -0
- package/dist/components/toggle/toggle.js +17 -0
- package/dist/components/toggle/toggle.stories.d.ts +10 -0
- package/dist/components/toggle/toggle.stories.js +41 -0
- package/dist/components/tooltip/tooltip-layer.d.ts +16 -0
- package/dist/components/tooltip/tooltip-layer.js +19 -0
- package/dist/components/tooltip/tooltip.d.ts +19 -0
- package/dist/components/tooltip/tooltip.js +31 -0
- package/dist/components/tooltip/tooltip.stories.d.ts +11 -0
- package/dist/components/tooltip/tooltip.stories.js +50 -0
- package/dist/components/tooltip/tooltip.test-case.stories.d.ts +4 -0
- package/dist/components/tooltip/tooltip.test-case.stories.js +20 -0
- package/dist/components/top-bar/element/element.d.ts +32 -0
- package/dist/components/top-bar/element/element.js +28 -0
- package/dist/components/top-bar/element/enum.d.ts +6 -0
- package/dist/components/top-bar/element/enum.js +7 -0
- package/dist/components/top-bar/element/link.d.ts +11 -0
- package/dist/components/top-bar/element/link.js +15 -0
- package/dist/components/top-bar/title.d.ts +9 -0
- package/dist/components/top-bar/title.js +7 -0
- package/dist/components/top-bar/top-bar.d.ts +11 -0
- package/dist/components/top-bar/top-bar.js +19 -0
- package/dist/components/top-bar/top-bar.stories.d.ts +6 -0
- package/dist/components/top-bar/top-bar.stories.js +124 -0
- package/dist/components/top-bar/top-bar.testcase.stories.d.ts +5 -0
- package/dist/components/top-bar/top-bar.testcase.stories.js +53 -0
- package/dist/components/top-bar/warning.d.ts +5 -0
- package/dist/components/top-bar/warning.js +5 -0
- package/dist/components/tree/tree-item.d.ts +10 -0
- package/dist/components/tree/tree-item.js +27 -0
- package/dist/components/tree/tree-placeholder.d.ts +4 -0
- package/dist/components/tree/tree-placeholder.js +3 -0
- package/dist/components/tree/tree.d.ts +42 -0
- package/dist/components/tree/tree.js +50 -0
- package/dist/components/tree/tree.stories-data.d.ts +126 -0
- package/dist/components/tree/tree.stories-data.js +83 -0
- package/dist/components/tree/tree.stories.d.ts +11 -0
- package/dist/components/tree/tree.stories.js +98 -0
- package/dist/helpers/disabled-context.d.ts +2 -0
- package/dist/helpers/disabled-context.js +2 -0
- package/dist/helpers/text.d.ts +1 -0
- package/dist/helpers/text.js +9 -0
- package/dist/helpers/types.d.ts +3 -0
- package/dist/helpers/types.js +8 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/use-focus.d.ts +4 -0
- package/dist/hooks/use-focus.js +10 -0
- package/dist/hooks/use-fonts-ready.d.ts +1 -0
- package/dist/hooks/use-fonts-ready.js +13 -0
- package/dist/hooks/use-keyboard-event.d.ts +2 -0
- package/dist/hooks/use-keyboard-event.js +14 -0
- package/dist/hooks/use-window-width.d.ts +1 -0
- package/dist/hooks/use-window-width.js +16 -0
- package/dist/index.d.ts +79 -1466
- package/dist/index.js +86 -72363
- package/dist/my-dummy.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import cx from "classnames";
|
|
4
|
+
import styles from "./cell.module.less";
|
|
5
|
+
import { getCellAlignment } from "../helper";
|
|
6
|
+
import { CellWrapper } from "./cell-wrapper";
|
|
7
|
+
import { Align } from "../../../common-enum";
|
|
8
|
+
import { CellType } from "../enum";
|
|
9
|
+
export const Cell = ({ cell, isHeader, columnHeaderAlignment = Align.RIGHT, columnAlignment, width: columnWidthProp, snapshot, testId, }) => {
|
|
10
|
+
const { style: styleProp, colSpan, rowSpan, width: cellWidthProp, type, } = cell;
|
|
11
|
+
const ref = useRef(null);
|
|
12
|
+
const alignment = {
|
|
13
|
+
bodyAlignment: columnAlignment,
|
|
14
|
+
headerAlignment: columnHeaderAlignment,
|
|
15
|
+
isHeader,
|
|
16
|
+
};
|
|
17
|
+
const cellAlignmentStyle = getCellAlignment(alignment, styles);
|
|
18
|
+
const cellAlignmentText = getCellAlignment(alignment, styles, true);
|
|
19
|
+
const cellTypeClassName = cell.type === CellType.INPUT ||
|
|
20
|
+
cell.type === CellType.NUMBER_INPUT ||
|
|
21
|
+
cell.type === CellType.SELECT ||
|
|
22
|
+
cell.type === CellType.POPOVER
|
|
23
|
+
? styles.inputCell
|
|
24
|
+
: cell.type === CellType.SLIDER
|
|
25
|
+
? styles.sliderCell
|
|
26
|
+
: cell.type === CellType.CHECKBOX
|
|
27
|
+
? styles.checkBoxCell
|
|
28
|
+
: cell.type === CellType.ACTIONS
|
|
29
|
+
? styles.actionsCell
|
|
30
|
+
: styles.staticCell;
|
|
31
|
+
const className = cx(styles.cell, cellTypeClassName, cell.hasSort ? styles.sortingCell : null, cellAlignmentStyle, cell.breakWord ? styles.breakWord : '');
|
|
32
|
+
// Width defined in following precedence:
|
|
33
|
+
// 1. Width defined in cell
|
|
34
|
+
// 2. Width defined in columnWidths
|
|
35
|
+
// 3. Width defined in snapshot (dragging)
|
|
36
|
+
const width = cellWidthProp ??
|
|
37
|
+
columnWidthProp ??
|
|
38
|
+
(snapshot?.isDragging && ref.current && ref.current.offsetWidth) ??
|
|
39
|
+
undefined;
|
|
40
|
+
// Cells cannot be smaller than width, but they may exceed it (if table width exceeds sum of cell widths)
|
|
41
|
+
// Style prop takes precedence
|
|
42
|
+
const style = { width, minWidth: width, ...styleProp };
|
|
43
|
+
const Element = isHeader ? 'th' : 'td';
|
|
44
|
+
return (_jsx(Element, { ref: ref, className: className, style: style, colSpan: colSpan, rowSpan: rowSpan, children: _jsx(CellWrapper, { cell: cell, columnAlignment: cellAlignmentText, isHeader: isHeader, testId: testId }) }));
|
|
45
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
2
|
+
export default _default;
|
|
3
|
+
export declare const Editable: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
4
|
+
export declare const Disabled: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
5
|
+
export declare const Colspan: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
6
|
+
export declare const ColspanWithWidths: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
7
|
+
export declare const CellWidths: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
8
|
+
export declare const CellStyleProp: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
9
|
+
export declare const Rowspan: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
10
|
+
export declare const Checkboxes: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
11
|
+
export declare const Icons: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
12
|
+
export declare const Links: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
13
|
+
export declare const Actions: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
14
|
+
export declare const Menus: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
15
|
+
export declare const JSXContent: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
16
|
+
export declare const StaticCellTooltips: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
17
|
+
export declare const WordbreakLongContent: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
18
|
+
export declare const Popover: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const SinglePopoverAtOnce: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const OverflowingCells: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
21
|
+
export declare const TestScrolling: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Table } from '../table';
|
|
4
|
+
import { Field } from '../../form/field';
|
|
5
|
+
import { Button } from '../../button/button';
|
|
6
|
+
import { Input } from '../../input/input';
|
|
7
|
+
import { Flex } from '../../layout/flex/flex';
|
|
8
|
+
import * as storyData from '../table.stories-data';
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Basic/Table/Cell',
|
|
11
|
+
component: Table,
|
|
12
|
+
args: {
|
|
13
|
+
table: {
|
|
14
|
+
...storyData.table,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const Template = (args) => {
|
|
19
|
+
return (_jsx(Table
|
|
20
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
21
|
+
, { ...args }));
|
|
22
|
+
};
|
|
23
|
+
export const Editable = Template.bind({});
|
|
24
|
+
Editable.args = {
|
|
25
|
+
table: storyData.tableEditable,
|
|
26
|
+
};
|
|
27
|
+
export const Disabled = Template.bind({});
|
|
28
|
+
Disabled.args = {
|
|
29
|
+
table: storyData.tableDisabled,
|
|
30
|
+
};
|
|
31
|
+
export const Colspan = Template.bind({});
|
|
32
|
+
Colspan.args = {
|
|
33
|
+
table: storyData.tableColspan,
|
|
34
|
+
};
|
|
35
|
+
export const ColspanWithWidths = Template.bind({});
|
|
36
|
+
ColspanWithWidths.args = { table: storyData.tableColspanWidths };
|
|
37
|
+
export const CellWidths = Template.bind({});
|
|
38
|
+
CellWidths.args = { table: storyData.tableCellWidths };
|
|
39
|
+
export const CellStyleProp = Template.bind({});
|
|
40
|
+
CellStyleProp.args = { table: storyData.tableCellStyleProp };
|
|
41
|
+
export const Rowspan = Template.bind({});
|
|
42
|
+
Rowspan.args = {
|
|
43
|
+
table: storyData.tableRowspan,
|
|
44
|
+
};
|
|
45
|
+
export const Checkboxes = Template.bind({});
|
|
46
|
+
Checkboxes.args = {
|
|
47
|
+
table: storyData.tableCheckboxes,
|
|
48
|
+
};
|
|
49
|
+
export const Icons = Template.bind({});
|
|
50
|
+
Icons.args = {
|
|
51
|
+
table: storyData.tableIcons,
|
|
52
|
+
};
|
|
53
|
+
export const Links = Template.bind({});
|
|
54
|
+
Links.args = {
|
|
55
|
+
table: storyData.tableLinks,
|
|
56
|
+
};
|
|
57
|
+
export const Actions = Template.bind({});
|
|
58
|
+
Actions.args = {
|
|
59
|
+
table: storyData.tableActions,
|
|
60
|
+
};
|
|
61
|
+
export const Menus = Template.bind({});
|
|
62
|
+
Menus.args = {
|
|
63
|
+
table: storyData.tableWithSubActions,
|
|
64
|
+
};
|
|
65
|
+
export const JSXContent = Template.bind({});
|
|
66
|
+
JSXContent.args = {
|
|
67
|
+
table: storyData.tableJsxContent,
|
|
68
|
+
};
|
|
69
|
+
export const StaticCellTooltips = Template.bind({});
|
|
70
|
+
StaticCellTooltips.args = {
|
|
71
|
+
table: storyData.tableStaticTooltips,
|
|
72
|
+
};
|
|
73
|
+
export const WordbreakLongContent = Template.bind({});
|
|
74
|
+
WordbreakLongContent.args = {
|
|
75
|
+
table: storyData.tableBreakLongContent,
|
|
76
|
+
};
|
|
77
|
+
WordbreakLongContent.parameters = {
|
|
78
|
+
docs: {
|
|
79
|
+
description: {
|
|
80
|
+
story: 'Setting `breakWord: true` on a cell will allow very long text strings to break',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
export const Popover = () => {
|
|
85
|
+
const headings = ['Section', 'Width', 'Height'];
|
|
86
|
+
let units = ['', 'm', 'm'];
|
|
87
|
+
let data = [...Array(10).keys()].map((c, i) => [i, i * 2, i * 2]);
|
|
88
|
+
/*
|
|
89
|
+
Mock table data store (real apps should use Redux or similar)
|
|
90
|
+
*/
|
|
91
|
+
const PopoverTable = () => {
|
|
92
|
+
const CellInputForm = ({ close, value }) => (_jsxs(_Fragment, { children: [_jsx(Field, { label: "Input", children: _jsx(Input, { value: value, width: "100%" }) }), _jsxs(Flex, { gap: true, children: [_jsx(Button, { colored: true, label: "Save", onClick: () => { } }), _jsx(Button, { label: "Cancel", onClick: close })] })] }));
|
|
93
|
+
const table = {
|
|
94
|
+
fixedWidth: '100%',
|
|
95
|
+
headers: [
|
|
96
|
+
{
|
|
97
|
+
cells: headings.map((h) => ({ value: h })),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
cells: [
|
|
101
|
+
{},
|
|
102
|
+
{
|
|
103
|
+
menu: [
|
|
104
|
+
{ label: 'm', value: 'm' },
|
|
105
|
+
{ label: 'ft', value: 'ft' },
|
|
106
|
+
],
|
|
107
|
+
value: units[1],
|
|
108
|
+
type: 'Unit',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
menu: [
|
|
112
|
+
{ label: 'm', value: 'm' },
|
|
113
|
+
{ label: 'ft', value: 'ft' },
|
|
114
|
+
],
|
|
115
|
+
value: units[2],
|
|
116
|
+
type: 'Unit',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
rows: data.map((row, i) => {
|
|
122
|
+
return {
|
|
123
|
+
cells: [...Array(3).keys()].map((c, i) => ({
|
|
124
|
+
//https://stackoverflow.com/a/33352604
|
|
125
|
+
value: row[i],
|
|
126
|
+
type: 'Popover',
|
|
127
|
+
content: _jsx(CellInputForm, { value: row[i] }),
|
|
128
|
+
})),
|
|
129
|
+
};
|
|
130
|
+
}),
|
|
131
|
+
};
|
|
132
|
+
return _jsx(Table, { table: table });
|
|
133
|
+
};
|
|
134
|
+
return _jsx(PopoverTable, {});
|
|
135
|
+
};
|
|
136
|
+
export const SinglePopoverAtOnce = () => {
|
|
137
|
+
const headings = ['Section', 'Width', 'Height'];
|
|
138
|
+
let units = ['', 'm', 'm'];
|
|
139
|
+
let data = [...Array(10).keys()].map((c, i) => [i, i * 2, i * 2]);
|
|
140
|
+
/*
|
|
141
|
+
Mock table data store (real apps should use Redux or similar)
|
|
142
|
+
*/
|
|
143
|
+
const SinglePopoverOpenedTable = () => {
|
|
144
|
+
const [isPopOverCellOpened, setIsPopOverCellOpened] = useState(false);
|
|
145
|
+
const CellInputForm = ({ close, value }) => {
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (!isPopOverCellOpened) {
|
|
148
|
+
setIsPopOverCellOpened(true);
|
|
149
|
+
}
|
|
150
|
+
}, []);
|
|
151
|
+
const onClosePopOver = () => {
|
|
152
|
+
setIsPopOverCellOpened(false);
|
|
153
|
+
close();
|
|
154
|
+
};
|
|
155
|
+
return (_jsxs(_Fragment, { children: [_jsx(Field, { label: "Input", children: _jsx(Input, { value: value, width: "100%" }) }), _jsxs(Flex, { gap: true, children: [_jsx(Button, { colored: true, label: "Save", onClick: onClosePopOver }), _jsx(Button, { label: "Cancel", onClick: onClosePopOver })] })] }));
|
|
156
|
+
};
|
|
157
|
+
const table = {
|
|
158
|
+
headers: [
|
|
159
|
+
{
|
|
160
|
+
cells: headings.map((h) => ({ value: h })),
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
cells: [
|
|
164
|
+
{},
|
|
165
|
+
{
|
|
166
|
+
menu: [
|
|
167
|
+
{ label: 'm', value: 'm' },
|
|
168
|
+
{ label: 'ft', value: 'ft' },
|
|
169
|
+
],
|
|
170
|
+
value: units[1],
|
|
171
|
+
type: 'Unit',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
menu: [
|
|
175
|
+
{ label: 'm', value: 'm' },
|
|
176
|
+
{ label: 'ft', value: 'ft' },
|
|
177
|
+
],
|
|
178
|
+
value: units[2],
|
|
179
|
+
type: 'Unit',
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
rows: data.map((row, i) => {
|
|
185
|
+
return {
|
|
186
|
+
cells: [...Array(3).keys()].map((c, i) => ({
|
|
187
|
+
//https://stackoverflow.com/a/33352604
|
|
188
|
+
value: row[i],
|
|
189
|
+
type: 'Popover',
|
|
190
|
+
disabled: isPopOverCellOpened,
|
|
191
|
+
closeOnOutsideClick: false,
|
|
192
|
+
content: _jsx(CellInputForm, { value: row[i] }),
|
|
193
|
+
})),
|
|
194
|
+
};
|
|
195
|
+
}),
|
|
196
|
+
};
|
|
197
|
+
return _jsx(Table, { table: table });
|
|
198
|
+
};
|
|
199
|
+
return _jsx(SinglePopoverOpenedTable, {});
|
|
200
|
+
};
|
|
201
|
+
export const OverflowingCells = Template.bind({});
|
|
202
|
+
OverflowingCells.args = { table: storyData.tableOverflowing };
|
|
203
|
+
export const TestScrolling = Template.bind({});
|
|
204
|
+
TestScrolling.args = {
|
|
205
|
+
table: { ...storyData.tableActions, name: 'Food' },
|
|
206
|
+
};
|
|
207
|
+
TestScrolling.decorators = [
|
|
208
|
+
(Story) => (_jsx("div", { style: { width: 180, height: 180, overflow: 'hidden', resize: 'both' }, children: _jsx(Story, {}) })),
|
|
209
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Align } from "../../../common-enum";
|
|
2
|
+
export interface IInputCellWrapperProps {
|
|
3
|
+
cell: any;
|
|
4
|
+
columnAlignment: Align.LEFT | Align.RIGHT;
|
|
5
|
+
testId?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const InputCellWrapper: ({ cell, columnAlignment, testId, }: IInputCellWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from "./cell.module.less";
|
|
3
|
+
import { InputCell } from "./cell-types/input-cell";
|
|
4
|
+
import { NumberInputCell } from "./cell-types/number-input-cell";
|
|
5
|
+
import { SelectCell } from "./cell-types/select-cell";
|
|
6
|
+
export const InputCellWrapper = ({ cell, columnAlignment, testId, }) => {
|
|
7
|
+
return (_jsx("div", { className: styles.inputWrapper, children: cell.type === 'Input' ? (_jsx(InputCell, { cell: cell, columnAlignment: columnAlignment, testId: testId })) : cell.type === 'NumberInput' ? (_jsx(NumberInputCell, { cell: cell, testId: testId })) : cell.type === 'Select' ? (_jsx(SelectCell, { cell: cell, columnAlignment: columnAlignment, testId: testId })) : null }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var CellType;
|
|
2
|
+
(function (CellType) {
|
|
3
|
+
CellType["INPUT"] = "Input";
|
|
4
|
+
CellType["NUMBER_INPUT"] = "NumberInput";
|
|
5
|
+
CellType["SELECT"] = "Select";
|
|
6
|
+
CellType["POPOVER"] = "Popover";
|
|
7
|
+
CellType["SLIDER"] = "Slider";
|
|
8
|
+
CellType["CHECKBOX"] = "CheckBox";
|
|
9
|
+
CellType["ACTIONS"] = "Actions";
|
|
10
|
+
})(CellType || (CellType = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { IPagination } from '../../pagination/pagination';
|
|
3
|
+
import { IAction } from '../../actions/actions.interface';
|
|
4
|
+
export interface IFooterProps {
|
|
5
|
+
colSpan?: number;
|
|
6
|
+
pagination: IPagination;
|
|
7
|
+
actions?: IAction[];
|
|
8
|
+
content?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const Footer: ({ colSpan, pagination, actions, content, }: IFooterProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './footer.module.less';
|
|
3
|
+
import { Pagination } from '../../pagination/pagination';
|
|
4
|
+
import { Actions } from '../../actions/actions';
|
|
5
|
+
export const Footer = ({ colSpan, pagination, actions, content, }) => {
|
|
6
|
+
const hasActions = actions && actions.length;
|
|
7
|
+
const hasContent = content != null;
|
|
8
|
+
const hasPagination = () => {
|
|
9
|
+
if (pagination) {
|
|
10
|
+
const { rowCount, rowsPerPage } = pagination;
|
|
11
|
+
const minRows = Number(rowsPerPage?.options?.[0]?.value);
|
|
12
|
+
return rowCount > minRows;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
16
|
+
const showFooter = hasActions || hasContent || hasPagination();
|
|
17
|
+
return showFooter ? (_jsxs("div", { className: styles.footer, children: [hasContent ? (_jsx("div", { className: styles.section, children: _jsx("div", { children: content }) })) : null, hasActions || hasPagination() ? (_jsxs("div", { className: styles.section, children: [hasPagination() ? _jsx(Pagination, { pagination: pagination }) : _jsx("div", {}), hasActions && (_jsx("div", { children: _jsx(Actions, { actions: actions }) }))] })) : null] })) : null;
|
|
18
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
2
|
+
export default _default;
|
|
3
|
+
export declare const Footer: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Table } from '../table';
|
|
3
|
+
import * as storyData from '../table.stories-data';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Basic/Table/Footer',
|
|
6
|
+
component: Table,
|
|
7
|
+
args: {
|
|
8
|
+
table: {
|
|
9
|
+
...storyData.table,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
const Template = (args) => {
|
|
14
|
+
return _jsx(Table, { ...args });
|
|
15
|
+
};
|
|
16
|
+
export const Footer = Template.bind({});
|
|
17
|
+
Footer.args = {
|
|
18
|
+
table: storyData.tableFooter,
|
|
19
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface IAlignmentProps {
|
|
2
|
+
bodyAlignment?: string;
|
|
3
|
+
headerAlignment?: string;
|
|
4
|
+
isHeader: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* getCellAlignment - returns string or class name
|
|
8
|
+
* @param {IAlignmentProps} alignment - body cell alignment
|
|
9
|
+
* @param {Record<string, string>} styles - styles object
|
|
10
|
+
* @param {boolean} isGetText - get text for example ('left', 'right' or 'center') or class name. Default value false.
|
|
11
|
+
* @returns {string|null}
|
|
12
|
+
*/
|
|
13
|
+
export declare const getCellAlignment: (alignment?: IAlignmentProps, styles?: Record<string, string>, isGetText?: boolean) => string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Returns alignments or empty array
|
|
16
|
+
* @param {Array<string | string[]>} alignments can be array of arrays or array of strings
|
|
17
|
+
* @param {boolean} isHeader
|
|
18
|
+
* @param {number} rowIndex
|
|
19
|
+
* @returns {Array<string>}
|
|
20
|
+
*/
|
|
21
|
+
export declare const getHeaderAlignment: (alignments?: Array<string | string[]>, isHeader?: boolean, rowIndex?: number) => string[];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Align } from "../../common-enum";
|
|
2
|
+
/**
|
|
3
|
+
* getCellAlignment - returns string or class name
|
|
4
|
+
* @param {IAlignmentProps} alignment - body cell alignment
|
|
5
|
+
* @param {Record<string, string>} styles - styles object
|
|
6
|
+
* @param {boolean} isGetText - get text for example ('left', 'right' or 'center') or class name. Default value false.
|
|
7
|
+
* @returns {string|null}
|
|
8
|
+
*/
|
|
9
|
+
export const getCellAlignment = (alignment, styles = { leftAligned: '', rightAligned: '', centerAligned: '' }, isGetText = false) => {
|
|
10
|
+
if (!alignment)
|
|
11
|
+
return null;
|
|
12
|
+
const { bodyAlignment, headerAlignment, isHeader } = alignment;
|
|
13
|
+
const cellAlignment = isHeader && headerAlignment ? headerAlignment : bodyAlignment;
|
|
14
|
+
switch (cellAlignment) {
|
|
15
|
+
case Align.LEFT:
|
|
16
|
+
return isGetText ? Align.LEFT : styles.leftAligned;
|
|
17
|
+
case Align.RIGHT:
|
|
18
|
+
return isGetText ? Align.RIGHT : styles.rightAligned;
|
|
19
|
+
case Align.CENTER:
|
|
20
|
+
return isGetText ? Align.CENTER : styles.centerAligned;
|
|
21
|
+
default:
|
|
22
|
+
return isGetText ? Align.LEFT : styles.leftAligned;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Returns alignments or empty array
|
|
27
|
+
* @param {Array<string | string[]>} alignments can be array of arrays or array of strings
|
|
28
|
+
* @param {boolean} isHeader
|
|
29
|
+
* @param {number} rowIndex
|
|
30
|
+
* @returns {Array<string>}
|
|
31
|
+
*/
|
|
32
|
+
export const getHeaderAlignment = (alignments, isHeader = false, rowIndex = 0) => {
|
|
33
|
+
if (!alignments || alignments.length === 0) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
const isArrays = alignments.every(alignment => Array.isArray(alignment));
|
|
37
|
+
const isStrings = alignments.every(alignment => typeof alignment === 'string');
|
|
38
|
+
if (isArrays && isHeader) {
|
|
39
|
+
const alignmentRow = alignments[rowIndex];
|
|
40
|
+
return alignmentRow || [];
|
|
41
|
+
}
|
|
42
|
+
else if (isStrings) {
|
|
43
|
+
return alignments;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.warn('getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array.');
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { getCellAlignment, getHeaderAlignment } from './helper';
|
|
2
|
+
const styles = {
|
|
3
|
+
leftAligned: 'cell-module-leftAligned-eBFS4',
|
|
4
|
+
rightAligned: 'cell-module-rightAligned-ahWpT',
|
|
5
|
+
centerAligned: 'cell-module-centerAligned-_ktBT',
|
|
6
|
+
};
|
|
7
|
+
describe('helper', () => {
|
|
8
|
+
describe('getCellAlignment', () => {
|
|
9
|
+
test('should return style alignment for header row', () => {
|
|
10
|
+
const alignment = {
|
|
11
|
+
bodyAlignment: undefined,
|
|
12
|
+
headerAlignment: 'right',
|
|
13
|
+
isHeader: true,
|
|
14
|
+
};
|
|
15
|
+
const result = getCellAlignment(alignment, styles);
|
|
16
|
+
expect(result).toBe('cell-module-rightAligned-ahWpT');
|
|
17
|
+
});
|
|
18
|
+
test('should return text alignment for header row', () => {
|
|
19
|
+
const alignment = {
|
|
20
|
+
bodyAlignment: undefined,
|
|
21
|
+
headerAlignment: 'right',
|
|
22
|
+
isHeader: true,
|
|
23
|
+
};
|
|
24
|
+
const result = getCellAlignment(alignment, styles, true);
|
|
25
|
+
expect(result).toBe('right');
|
|
26
|
+
});
|
|
27
|
+
test('should return default text alignment', () => {
|
|
28
|
+
const alignment = {
|
|
29
|
+
bodyAlignment: undefined,
|
|
30
|
+
headerAlignment: undefined,
|
|
31
|
+
isHeader: false,
|
|
32
|
+
};
|
|
33
|
+
const result = getCellAlignment(alignment, styles, true);
|
|
34
|
+
expect(result).toBe('left');
|
|
35
|
+
});
|
|
36
|
+
test('should return default style alignment', () => {
|
|
37
|
+
const alignment = {
|
|
38
|
+
bodyAlignment: undefined,
|
|
39
|
+
headerAlignment: undefined,
|
|
40
|
+
isHeader: false,
|
|
41
|
+
};
|
|
42
|
+
const result = getCellAlignment(alignment, styles);
|
|
43
|
+
expect(result).toBe('cell-module-leftAligned-eBFS4');
|
|
44
|
+
});
|
|
45
|
+
test('should return style alignment for body row', () => {
|
|
46
|
+
const alignment = {
|
|
47
|
+
bodyAlignment: 'center',
|
|
48
|
+
headerAlignment: undefined,
|
|
49
|
+
isHeader: false,
|
|
50
|
+
};
|
|
51
|
+
const result = getCellAlignment(alignment, styles);
|
|
52
|
+
expect(result).toBe('cell-module-centerAligned-_ktBT');
|
|
53
|
+
});
|
|
54
|
+
test('should return default style alignment for header row', () => {
|
|
55
|
+
const alignment = {
|
|
56
|
+
bodyAlignment: undefined,
|
|
57
|
+
headerAlignment: undefined,
|
|
58
|
+
isHeader: true,
|
|
59
|
+
};
|
|
60
|
+
const result = getCellAlignment(alignment, styles);
|
|
61
|
+
expect(result).toBe('cell-module-leftAligned-eBFS4');
|
|
62
|
+
});
|
|
63
|
+
test('should return null when set no arguments', () => {
|
|
64
|
+
const result = getCellAlignment();
|
|
65
|
+
expect(result).toBeNull();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe('getHeaderAlignment', () => {
|
|
69
|
+
test('should return array of alignments when was set array of arrays', () => {
|
|
70
|
+
const aligments = [
|
|
71
|
+
['right', 'center', 'right'],
|
|
72
|
+
['right', 'center', 'left', 'left', 'left', 'left', 'left', 'left'],
|
|
73
|
+
['right', 'center', 'left', 'left', 'right', 'left', 'left', 'left'],
|
|
74
|
+
];
|
|
75
|
+
const result = getHeaderAlignment(aligments, true, 2);
|
|
76
|
+
expect(result).toEqual([
|
|
77
|
+
'right',
|
|
78
|
+
'center',
|
|
79
|
+
'left',
|
|
80
|
+
'left',
|
|
81
|
+
'right',
|
|
82
|
+
'left',
|
|
83
|
+
'left',
|
|
84
|
+
'left',
|
|
85
|
+
]);
|
|
86
|
+
});
|
|
87
|
+
test('should return array of alignments when was set array of strings', () => {
|
|
88
|
+
const aligments = [
|
|
89
|
+
'center',
|
|
90
|
+
'center',
|
|
91
|
+
'center',
|
|
92
|
+
'left',
|
|
93
|
+
'left',
|
|
94
|
+
'left',
|
|
95
|
+
'right',
|
|
96
|
+
'left',
|
|
97
|
+
];
|
|
98
|
+
const result = getHeaderAlignment(aligments);
|
|
99
|
+
expect(result).toEqual([
|
|
100
|
+
'center',
|
|
101
|
+
'center',
|
|
102
|
+
'center',
|
|
103
|
+
'left',
|
|
104
|
+
'left',
|
|
105
|
+
'left',
|
|
106
|
+
'right',
|
|
107
|
+
'left',
|
|
108
|
+
]);
|
|
109
|
+
});
|
|
110
|
+
test('should return empty array when was set empty array', () => {
|
|
111
|
+
const result = getHeaderAlignment([]);
|
|
112
|
+
expect(result).toEqual([]);
|
|
113
|
+
});
|
|
114
|
+
test('should return empty array when set falsy values or set no arguments', () => {
|
|
115
|
+
const result1 = getHeaderAlignment(null);
|
|
116
|
+
expect(result1).toEqual([]);
|
|
117
|
+
const result2 = getHeaderAlignment(undefined);
|
|
118
|
+
expect(result2).toEqual([]);
|
|
119
|
+
const result3 = getHeaderAlignment(false);
|
|
120
|
+
expect(result3).toEqual([]);
|
|
121
|
+
const result4 = getHeaderAlignment('');
|
|
122
|
+
expect(result4).toEqual([]);
|
|
123
|
+
const result5 = getHeaderAlignment();
|
|
124
|
+
expect(result5).toEqual([]);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface IExpandedContentRowProps {
|
|
3
|
+
colSpan: number;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
flush?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ExpandedContentRow: ({ colSpan, children, flush, }: IExpandedContentRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import styles from './row.module.less';
|
|
4
|
+
export const ExpandedContentRow = ({ colSpan, children, flush, }) => {
|
|
5
|
+
return (_jsx("tr", { children: _jsx("td", { colSpan: colSpan, className: cx(styles.expandableRow, flush ? styles.flush : ''), children: children }) }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ICellProps } from '../cell/cell';
|
|
3
|
+
interface IOnRowClickFunction {
|
|
4
|
+
(): any;
|
|
5
|
+
noStyle?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface IRowProps {
|
|
8
|
+
row: {
|
|
9
|
+
active?: boolean;
|
|
10
|
+
cells: ICellProps['cell'][];
|
|
11
|
+
noDrag?: boolean;
|
|
12
|
+
onRowClick?: IOnRowClickFunction;
|
|
13
|
+
onRowFocus?: IOnRowClickFunction;
|
|
14
|
+
onRowMouseEnter?: IOnRowClickFunction;
|
|
15
|
+
onRowMouseLeave?: IOnRowClickFunction;
|
|
16
|
+
expandedContent?: {
|
|
17
|
+
content: ReactNode;
|
|
18
|
+
flush?: boolean;
|
|
19
|
+
};
|
|
20
|
+
actions?: any[];
|
|
21
|
+
};
|
|
22
|
+
rowIndex: number;
|
|
23
|
+
isHeader?: boolean;
|
|
24
|
+
columnCount: number;
|
|
25
|
+
colSpan: number;
|
|
26
|
+
columnHeaderAlignments?: string[] | string[][];
|
|
27
|
+
columnAlignment?: string[];
|
|
28
|
+
hasRowActions: boolean;
|
|
29
|
+
draggableTable?: boolean;
|
|
30
|
+
snapshot?: any;
|
|
31
|
+
provided?: any;
|
|
32
|
+
width?: string | number;
|
|
33
|
+
columnWidths?: string[];
|
|
34
|
+
testId?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const Row: ({ row, rowIndex, isHeader, columnCount, colSpan, columnHeaderAlignments, columnAlignment, hasRowActions, draggableTable, snapshot, provided, width, columnWidths, testId, }: IRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|