@mailstep/design-system 0.4.21 → 0.5.0-beta.10
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/package.json +33 -2
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +3 -0
- package/ui/Blocks/CommonGrid/CommonGrid.js +106 -0
- package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +67 -0
- package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +9 -0
- package/ui/Blocks/CommonGrid/CommonGridContext.js +32 -0
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.d.ts +2 -0
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +36 -0
- package/ui/Blocks/CommonGrid/StandardButtons.d.ts +6 -0
- package/ui/Blocks/CommonGrid/StandardButtons.js +50 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +53 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +18 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +45 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +35 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +13 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +32 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +41 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +58 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +20 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +20 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/DataCell.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/DataCell.js +52 -0
- package/ui/Blocks/CommonGrid/components/DataRow.d.ts +21 -0
- package/ui/Blocks/CommonGrid/components/DataRow.js +110 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +113 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +3 -0
- package/ui/Blocks/CommonGrid/components/DropdownSelect/DropdownSelect.d.ts +21 -0
- package/ui/Blocks/CommonGrid/components/DropdownSelect/DropdownSelect.js +47 -0
- package/ui/Blocks/CommonGrid/components/DropdownSelect/index.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/DropdownSelect/index.js +3 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +43 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/FilterDropdown.d.ts +3 -0
- package/ui/Blocks/CommonGrid/components/FilterDropdown.js +36 -0
- package/ui/Blocks/CommonGrid/components/FilterRow.d.ts +15 -0
- package/ui/Blocks/CommonGrid/components/FilterRow.js +34 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +45 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.d.ts +10 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +19 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/GroupRow.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/GroupRow.js +27 -0
- package/ui/Blocks/CommonGrid/components/HeadCell.d.ts +27 -0
- package/ui/Blocks/CommonGrid/components/HeadCell.js +40 -0
- package/ui/Blocks/CommonGrid/components/HeadRow.d.ts +15 -0
- package/ui/Blocks/CommonGrid/components/HeadRow.js +69 -0
- package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.js +13 -0
- package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +18 -0
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +29 -0
- package/ui/Blocks/CommonGrid/components/IconList/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +20 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +47 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.d.ts +3 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +76 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/types.d.ts +17 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -0
- package/ui/Blocks/CommonGrid/components/OversizedScroll.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +21 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +26 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/Resize.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/Resize.js +33 -0
- package/ui/Blocks/CommonGrid/components/Table.d.ts +10 -0
- package/ui/Blocks/CommonGrid/components/Table.js +25 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +31 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +89 -0
- package/ui/Blocks/CommonGrid/components/TextRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/types.d.ts +21 -0
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -0
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +22 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +16 -0
- package/ui/Blocks/CommonGrid/components/gridCells/Date.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +8 -0
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -0
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +33 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +19 -0
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +23 -0
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +8 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +24 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +30 -0
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +16 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +12 -0
- package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.js +14 -0
- package/ui/Blocks/CommonGrid/components/icons/Edit.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/Edit.js +14 -0
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +14 -0
- package/ui/Blocks/CommonGrid/components/icons/Sorting.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/Sorting.js +14 -0
- package/ui/Blocks/CommonGrid/components/utils.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/utils.js +22 -0
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.d.ts +12 -0
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +83 -0
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +15 -0
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +70 -0
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.d.ts +7 -0
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -0
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +19 -0
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +34 -0
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.d.ts +4 -0
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +21 -0
- package/ui/Blocks/CommonGrid/hooks/useUxReset.d.ts +3 -0
- package/ui/Blocks/CommonGrid/hooks/useUxReset.js +15 -0
- package/ui/Blocks/CommonGrid/index.d.ts +7 -0
- package/ui/Blocks/CommonGrid/index.js +7 -0
- package/ui/Blocks/CommonGrid/store/index.d.ts +58 -0
- package/ui/Blocks/CommonGrid/store/index.js +230 -0
- package/ui/Blocks/CommonGrid/store/migrateState.d.ts +3 -0
- package/ui/Blocks/CommonGrid/store/migrateState.js +14 -0
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +11 -0
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +31 -0
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +13 -0
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +49 -0
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +6 -0
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +14 -0
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +11 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +12 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +12 -0
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +6 -0
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +15 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +15 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +14 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +24 -0
- package/ui/Blocks/CommonGrid/storybook/utils/actions.d.ts +4 -0
- package/ui/Blocks/CommonGrid/storybook/utils/actions.js +6 -0
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +97 -0
- package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/filters.js +23 -0
- package/ui/Blocks/CommonGrid/storybook/utils/utils.d.ts +17 -0
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +66 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +12 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +4 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +18 -0
- package/ui/Blocks/CommonGrid/styles.d.ts +12 -0
- package/ui/Blocks/CommonGrid/styles.js +33 -0
- package/ui/Blocks/CommonGrid/translations.d.ts +1 -0
- package/ui/Blocks/CommonGrid/translations.js +6 -0
- package/ui/Blocks/CommonGrid/types.d.ts +313 -0
- package/ui/Blocks/CommonGrid/types.js +8 -0
- package/ui/Blocks/CommonGrid/utils/index.d.ts +19 -0
- package/ui/Blocks/CommonGrid/utils/index.js +78 -0
- package/ui/Blocks/CommonGrid/utils/public.d.ts +16 -0
- package/ui/Blocks/CommonGrid/utils/public.js +52 -0
- package/ui/Blocks/Popover/index.d.ts +10 -0
- package/ui/Blocks/Popover/index.js +19 -0
- package/ui/Elements/DatePicker/DatePicker.d.ts +20 -0
- package/ui/Elements/DatePicker/DatePicker.js +65 -0
- package/ui/Elements/DatePicker/Datetime/DateTime.d.ts +95 -0
- package/ui/Elements/DatePicker/Datetime/DateTime.js +516 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +8 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +57 -0
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.d.ts +9 -0
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +16 -0
- package/ui/Elements/DatePicker/Datetime/types.d.ts +61 -0
- package/ui/Elements/DatePicker/Datetime/types.js +7 -0
- package/ui/Elements/DatePicker/Datetime/views/DaysView.d.ts +14 -0
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +145 -0
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.d.ts +10 -0
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +111 -0
- package/ui/Elements/DatePicker/Datetime/views/YearsView.d.ts +15 -0
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +117 -0
- package/ui/Elements/DatePicker/index.d.ts +2 -0
- package/ui/Elements/DatePicker/index.js +2 -0
- package/ui/Elements/DatePicker/styles.d.ts +2 -0
- package/ui/Elements/DatePicker/styles.js +8 -0
- package/ui/Elements/DatePicker/utils/getLanguage.d.ts +1 -0
- package/ui/Elements/DatePicker/utils/getLanguage.js +10 -0
- package/ui/Elements/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/ui/Elements/DropdownMenu/DropdownMenu.js +36 -0
- package/ui/Elements/DropdownMenu/components/DefaultItem.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +16 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.js +51 -0
- package/ui/Elements/DropdownMenu/components/MenuList.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/MenuList.js +10 -0
- package/ui/Elements/DropdownMenu/index.d.ts +1 -0
- package/ui/Elements/DropdownMenu/index.js +1 -0
- package/ui/Elements/DropdownMenu/types.d.ts +41 -0
- package/ui/Elements/DropdownMenu/types.js +1 -0
- package/ui/Elements/HighlightBox/HighlightBox.d.ts +50 -0
- package/ui/Elements/HighlightBox/HighlightBox.js +65 -0
- package/ui/Elements/HighlightBox/index.d.ts +2 -0
- package/ui/Elements/HighlightBox/index.js +2 -0
- package/ui/Elements/MultiSelect/MultiSelect.d.ts +6 -0
- package/ui/Elements/MultiSelect/MultiSelect.js +29 -0
- package/ui/Elements/MultiSelect/index.d.ts +2 -0
- package/ui/Elements/MultiSelect/index.js +2 -0
- package/ui/Elements/Pagination/Pagination.d.ts +1 -1
- package/ui/Elements/Pagination/Pagination.js +6 -2
- package/ui/Elements/Pagination/styled.js +6 -6
- package/ui/Elements/Select/Select.d.ts +3 -0
- package/ui/Elements/Select/Select.js +69 -0
- package/ui/Elements/Select/index.d.ts +2 -0
- package/ui/Elements/Select/index.js +2 -0
- package/ui/Elements/Select/styles.d.ts +5 -0
- package/ui/Elements/Select/styles.js +12 -0
- package/ui/Elements/Select/themes/CustomComponents.d.ts +9 -0
- package/ui/Elements/Select/themes/CustomComponents.js +131 -0
- package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
- package/ui/Elements/Select/themes/baseStyles.js +70 -0
- package/ui/Elements/Select/themes/formStyles.d.ts +23 -0
- package/ui/Elements/Select/themes/formStyles.js +104 -0
- package/ui/Elements/Select/themes/headingStyles.d.ts +17 -0
- package/ui/Elements/Select/themes/headingStyles.js +99 -0
- package/ui/Elements/Select/themes/index.d.ts +3 -0
- package/ui/Elements/Select/themes/index.js +61 -0
- package/ui/Elements/Select/themes/leftMenuStyles.d.ts +18 -0
- package/ui/Elements/Select/themes/leftMenuStyles.js +57 -0
- package/ui/Elements/Select/types.d.ts +54 -0
- package/ui/Elements/Select/types.js +1 -0
- package/ui/Elements/SingleSelect/SingleSelect.d.ts +20 -0
- package/ui/Elements/SingleSelect/SingleSelect.js +197 -0
- package/ui/Elements/SingleSelect/index.d.ts +2 -0
- package/ui/Elements/SingleSelect/index.js +2 -0
- package/ui/Forms/Input/types.d.ts +2 -2
- package/ui/index.es.js +868 -1104
- package/ui/index.umd.js +8 -5
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import styled, { x } from '@xstyled/styled-components';
|
|
6
|
+
import { th } from '@xstyled/system';
|
|
7
|
+
import { Button } from '../../Elements/Button';
|
|
8
|
+
import CommonGrid from './CommonGrid';
|
|
9
|
+
export var BottomWrapper = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: 11px;\n padding-top: 10px;\n position: ", ";\n bottom: 0;\n left: 0;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n position: relative;\n padding-bottom: 11px;\n margin-bottom: 0;\n }\n & > * {\n @media (min-width: 1024px) {\n justify-content: flex-end;\n }\n }\n"], ["\n margin-bottom: 11px;\n padding-top: 10px;\n position: ", ";\n bottom: 0;\n left: 0;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n position: relative;\n padding-bottom: 11px;\n margin-bottom: 0;\n }\n & > * {\n @media (min-width: 1024px) {\n justify-content: flex-end;\n }\n }\n"])), function (_a) {
|
|
10
|
+
var isAbsolute = _a.isAbsolute;
|
|
11
|
+
return (isAbsolute ? 'absolute' : 'relative');
|
|
12
|
+
}, function (_a) {
|
|
13
|
+
var isAbsolute = _a.isAbsolute, theme = _a.theme;
|
|
14
|
+
return (isAbsolute ? theme.colors.bgLightGray : 'transparent');
|
|
15
|
+
});
|
|
16
|
+
export var ContentContainer = styled(x.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n justify-content: space-between;\n background-color: white;\n box-shadow: gridShadow;\n border-radius: 8px;\n"], ["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n justify-content: space-between;\n background-color: white;\n box-shadow: gridShadow;\n border-radius: 8px;\n"])));
|
|
17
|
+
export var CommonGridWrap = styled(x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
|
|
18
|
+
export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n border-bottom: 0.5px solid ", ";\n"], ["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n border-bottom: 0.5px solid ", ";\n"])), th('colors.lightGray6'));
|
|
19
|
+
export var StyledColumnButton = styled(Button)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"], ["\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"])));
|
|
20
|
+
export var CommonGridWithStyles = styled(CommonGrid)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: 40px;\n }\n & .gridHead {\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 1;\n padding-left: 20px;\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n position: relative;\n }\n & .sticky {\n background-color: #fafbfc;\n }\n }\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n & .sticky {\n background-color: #fafbfc;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n & .body {\n margin: 0 1px 1px 1px; // matching margin with .gridHead\n padding-left: 20px;\n flex-grow: 1;\n }\n & .gridWrapper {\n background-color: ", ";\n width: ", ";\n padding-bottom: ", ";\n\n @media (min-width: 1024px) {\n height: ", ";\n width: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 2px;\n padding-right: 2px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n & .sticky {\n background-color: #fff;\n :hover {\n background-color: #fdf4f3;\n }\n }\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &.selected,\n &.selected > .sticky {\n background-color: #fdf4f3;\n }\n\n :hover {\n background-color: #fdf4f3;\n\n .sticky {\n background-color: #fdf4f3;\n }\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n max-width: 88px;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: 40px;\n }\n & .gridHead {\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 1;\n padding-left: 20px;\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n position: relative;\n }\n & .sticky {\n background-color: #fafbfc;\n }\n }\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n & .sticky {\n background-color: #fafbfc;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n & .body {\n margin: 0 1px 1px 1px; // matching margin with .gridHead\n padding-left: 20px;\n flex-grow: 1;\n }\n & .gridWrapper {\n background-color: ", ";\n width: ", ";\n padding-bottom: ", ";\n\n @media (min-width: 1024px) {\n height: ", ";\n width: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 2px;\n padding-right: 2px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n & .sticky {\n background-color: #fff;\n :hover {\n background-color: #fdf4f3;\n }\n }\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &.selected,\n &.selected > .sticky {\n background-color: #fdf4f3;\n }\n\n :hover {\n background-color: #fdf4f3;\n\n .sticky {\n background-color: #fdf4f3;\n }\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n max-width: 88px;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), th('fonts.primary'), th('fonts.primary'), function (_a) {
|
|
21
|
+
var theme = _a.theme;
|
|
22
|
+
return theme.colors.white;
|
|
23
|
+
}, function (_a) {
|
|
24
|
+
var height = _a.height;
|
|
25
|
+
return (height ? 'fit-content' : 'auto');
|
|
26
|
+
}, function (_a) {
|
|
27
|
+
var height = _a.height;
|
|
28
|
+
return (height ? '35px' : '0');
|
|
29
|
+
}, function (_a) {
|
|
30
|
+
var height = _a.height;
|
|
31
|
+
return (height ? "".concat(height, "px") : '475px');
|
|
32
|
+
});
|
|
33
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Trans } from '@lingui/react';
|
|
3
|
+
/** catalog for lungui to track commonGrid translations - DO NOT REMOVE */
|
|
4
|
+
var NonsensCop = function () {
|
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx(Trans, { id: "dataGrid.status.loadingData", message: "... loading data ..." }), _jsx(Trans, { id: "dataGrid.status.noDataFound", message: "No data found." }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), _jsx(Trans, { id: "dataGrid.buttonGridConfig", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.title", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.buttonReset", message: "Reset all" })] }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const rowClassSymbol: unique symbol;
|
|
3
|
+
type Option = {
|
|
4
|
+
value: string | number;
|
|
5
|
+
label: string | number;
|
|
6
|
+
};
|
|
7
|
+
type ButtonPublicInterfaceProps = {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
type?: 'button' | 'submit' | 'reset';
|
|
10
|
+
appearance?: string;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
margin?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
onClick?: (arg?: any) => void;
|
|
16
|
+
};
|
|
17
|
+
type CheckboxPublicInterfaceProps = {
|
|
18
|
+
name?: string;
|
|
19
|
+
label?: string | JSX.Element;
|
|
20
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
checked?: boolean;
|
|
22
|
+
};
|
|
23
|
+
type SwitchPublicInterfaceProps = {
|
|
24
|
+
onChange?: (event: React.ChangeEvent) => void;
|
|
25
|
+
label?: string;
|
|
26
|
+
name: string;
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type PaginatorProps = {
|
|
30
|
+
page: number;
|
|
31
|
+
itemCount: number;
|
|
32
|
+
itemPerPage: number;
|
|
33
|
+
onPageChange: (number: number) => void;
|
|
34
|
+
};
|
|
35
|
+
export type FilterComponentProps<VT> = {
|
|
36
|
+
name: string;
|
|
37
|
+
onChange: (value: VT | {
|
|
38
|
+
event: {
|
|
39
|
+
target: VT;
|
|
40
|
+
};
|
|
41
|
+
} | null) => void;
|
|
42
|
+
value: VT | null;
|
|
43
|
+
OverlayComponent?: React.FunctionComponent;
|
|
44
|
+
} & Record<string, any>;
|
|
45
|
+
export type ColumnTitleComponentType = React.ComponentType<{
|
|
46
|
+
title?: string | JSX.Element;
|
|
47
|
+
isSortable: boolean;
|
|
48
|
+
onSetSort: (value: SortingValueType) => void;
|
|
49
|
+
sortValue: SortingValueType;
|
|
50
|
+
}>;
|
|
51
|
+
export type ComponentsProps = {
|
|
52
|
+
Translator: React.ComponentType<any>;
|
|
53
|
+
Checkbox: React.ComponentType<CheckboxPublicInterfaceProps>;
|
|
54
|
+
Button: React.ComponentType<ButtonPublicInterfaceProps>;
|
|
55
|
+
Switch: React.ComponentType<SwitchPublicInterfaceProps>;
|
|
56
|
+
Paginator: React.ComponentType<PaginatorProps>;
|
|
57
|
+
ColumnTitle?: ColumnTitleComponentType;
|
|
58
|
+
};
|
|
59
|
+
export type FiltersConfig = {
|
|
60
|
+
[name: string]: {
|
|
61
|
+
CellComponent: React.ComponentType<FilterComponentProps<any>>;
|
|
62
|
+
defaultExtraProps?: {
|
|
63
|
+
[name: string]: any;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
type Filtering = {
|
|
68
|
+
[column: string]: {
|
|
69
|
+
value: any;
|
|
70
|
+
filterProps: FilterProps;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
type Sorting = {
|
|
74
|
+
column: string;
|
|
75
|
+
direction: SortingValueType;
|
|
76
|
+
}[];
|
|
77
|
+
export type Settings = {
|
|
78
|
+
filter: Filtering;
|
|
79
|
+
sorting: Sorting;
|
|
80
|
+
offset: number;
|
|
81
|
+
limit: number;
|
|
82
|
+
};
|
|
83
|
+
export interface SelectMenuItem {
|
|
84
|
+
label: string;
|
|
85
|
+
value: string | number;
|
|
86
|
+
labelInList?: string;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
}
|
|
89
|
+
export type RowProps = {
|
|
90
|
+
id: string;
|
|
91
|
+
[rowClassSymbol]?: string;
|
|
92
|
+
};
|
|
93
|
+
type ColumnBaseProps = {
|
|
94
|
+
flexBasis: number;
|
|
95
|
+
};
|
|
96
|
+
export type RowValueType = string | JSX.Element | number | void;
|
|
97
|
+
export type ColumnDefinition<ColumnName extends string = string> = ColumnBaseProps & {
|
|
98
|
+
name: ColumnName;
|
|
99
|
+
group?: Group['name'];
|
|
100
|
+
systemName?: string;
|
|
101
|
+
systemFilter?: string;
|
|
102
|
+
title?: string | JSX.Element;
|
|
103
|
+
filtering?: boolean;
|
|
104
|
+
filteringType?: 'number' | 'text' | 'date' | 'flag';
|
|
105
|
+
disableRowTouch?: boolean;
|
|
106
|
+
filterExtraProps?: {
|
|
107
|
+
isMulti?: boolean;
|
|
108
|
+
comparators?: any;
|
|
109
|
+
filterTime?: boolean;
|
|
110
|
+
decimals?: number;
|
|
111
|
+
isFloat?: boolean;
|
|
112
|
+
isBigInt?: boolean;
|
|
113
|
+
isUuid?: boolean;
|
|
114
|
+
defaultComparator?: string;
|
|
115
|
+
};
|
|
116
|
+
getFilterCriteria?: (value: string) => {
|
|
117
|
+
[column: string]: any;
|
|
118
|
+
} | null;
|
|
119
|
+
filterOptions?: Option[];
|
|
120
|
+
sorting?: boolean;
|
|
121
|
+
formatRowValue?: (row: any) => RowValueType;
|
|
122
|
+
cellComponent?: React.ComponentType<DataCellProps<any>>;
|
|
123
|
+
flexGrow?: number;
|
|
124
|
+
flexShrink?: number;
|
|
125
|
+
fixedSize?: boolean;
|
|
126
|
+
alwaysOn?: boolean;
|
|
127
|
+
defaultHidden?: boolean;
|
|
128
|
+
sticky?: boolean;
|
|
129
|
+
stickTo?: StickTo;
|
|
130
|
+
passProps?: any;
|
|
131
|
+
};
|
|
132
|
+
export type StickTo = 'left' | 'right';
|
|
133
|
+
type batchAction = {
|
|
134
|
+
value: string;
|
|
135
|
+
label: string;
|
|
136
|
+
isEnabled?: (checkedRows: any[]) => boolean;
|
|
137
|
+
};
|
|
138
|
+
export type OnBatchActionFn<T = RowProps> = (action: batchAction, affectedRows: T[]) => void;
|
|
139
|
+
export type ActionColumn = ColumnBaseProps & {
|
|
140
|
+
actionOptions?: batchAction[];
|
|
141
|
+
canRowEdit?: boolean | ((row: any) => boolean);
|
|
142
|
+
canRowRead?: boolean | ((row: any) => boolean);
|
|
143
|
+
createLink?: (params?: object) => string;
|
|
144
|
+
forceCheckboxes?: boolean;
|
|
145
|
+
checkAllPosition?: 'top' | 'bottom';
|
|
146
|
+
addRowNumbers?: boolean;
|
|
147
|
+
addRowNumbersLabel?: string;
|
|
148
|
+
};
|
|
149
|
+
export type ActionColumnHeadProps = {
|
|
150
|
+
actionColumn: ActionColumn;
|
|
151
|
+
onBatchAction?: OnBatchActionFn;
|
|
152
|
+
handleUxChange?: GridActionsType['handleUxChange'];
|
|
153
|
+
rowsData: RowProps[];
|
|
154
|
+
uxState: UxState;
|
|
155
|
+
};
|
|
156
|
+
export type DataCellProps<T> = {
|
|
157
|
+
rowData: T;
|
|
158
|
+
onRowAction?: (id: string, field: string, value: any) => void | Promise<any>;
|
|
159
|
+
column: ColumnDefinition;
|
|
160
|
+
};
|
|
161
|
+
type SingleColumnConfig = {
|
|
162
|
+
isHidden?: boolean;
|
|
163
|
+
};
|
|
164
|
+
export type ColumnConfig = {
|
|
165
|
+
[key: string]: SingleColumnConfig;
|
|
166
|
+
};
|
|
167
|
+
export type SortingValueType = 'asc' | 'desc' | null;
|
|
168
|
+
export type InitProps = {
|
|
169
|
+
defaultSorting?: Settings['sorting'];
|
|
170
|
+
};
|
|
171
|
+
export type FilterProps = {
|
|
172
|
+
type: Required<ColumnDefinition>['filteringType'] | 'options';
|
|
173
|
+
filterExtraProps: ColumnDefinition['filterExtraProps'];
|
|
174
|
+
computedValue?: any;
|
|
175
|
+
};
|
|
176
|
+
export type UxState = {
|
|
177
|
+
checkedRows?: {
|
|
178
|
+
[key: string]: boolean;
|
|
179
|
+
};
|
|
180
|
+
selectedRow?: string | null;
|
|
181
|
+
};
|
|
182
|
+
export type ColumnLayout = 'normal' | 'no-scroll' | 'sticky';
|
|
183
|
+
export type GridState = {
|
|
184
|
+
page: number;
|
|
185
|
+
rowsPerPage: number;
|
|
186
|
+
filter: Settings['filter'];
|
|
187
|
+
sorting: Settings['sorting'];
|
|
188
|
+
defaultSorting: Settings['sorting'];
|
|
189
|
+
isConfigFormOpen: boolean;
|
|
190
|
+
uxState: UxState;
|
|
191
|
+
columnConfig: ColumnConfig;
|
|
192
|
+
columnsOrder: string[];
|
|
193
|
+
columnsWidth: {
|
|
194
|
+
[anyKey: string]: number;
|
|
195
|
+
};
|
|
196
|
+
columnsWidthVariant?: string;
|
|
197
|
+
};
|
|
198
|
+
export type GridSelectorsType = {
|
|
199
|
+
uxState?: UxState;
|
|
200
|
+
columnConfig?: ColumnConfig;
|
|
201
|
+
page?: number;
|
|
202
|
+
rowsPerPage?: number;
|
|
203
|
+
filter?: Settings['filter'];
|
|
204
|
+
sorting?: Settings['sorting'];
|
|
205
|
+
isConfigFormOpen?: boolean;
|
|
206
|
+
columnsWidth?: {
|
|
207
|
+
[anyColumn: string]: number;
|
|
208
|
+
};
|
|
209
|
+
columnsWidthVariant?: string;
|
|
210
|
+
columnsOrder?: string[];
|
|
211
|
+
};
|
|
212
|
+
export type RowsPerPageType = {
|
|
213
|
+
gridName: string;
|
|
214
|
+
rowsPerPage: number;
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
export type GridActionsType = {
|
|
218
|
+
init?: (params?: InitProps) => void;
|
|
219
|
+
clearUxState?: () => void;
|
|
220
|
+
handleUxChange?: (uxKey: keyof UxState, uxValue: any) => void;
|
|
221
|
+
setColumnConfig?: (columnConfig: ColumnConfig) => void | Promise<any>;
|
|
222
|
+
setPage?: (number: number) => void;
|
|
223
|
+
setRowsPerPage?: (number: number) => RowsPerPageType | null;
|
|
224
|
+
addFilter?: (column: string, value: any, filterProps: FilterProps) => void;
|
|
225
|
+
resetFilters?: () => void;
|
|
226
|
+
addSorting?: (column: string, direction: SortingValueType) => void;
|
|
227
|
+
openConfigForm?: () => void;
|
|
228
|
+
closeConfigForm?: () => void;
|
|
229
|
+
clearSettings?: () => void;
|
|
230
|
+
resetGrid?: () => void;
|
|
231
|
+
setColumnWidth?: (columnsWidth: null | {
|
|
232
|
+
[anyColumn: string]: number;
|
|
233
|
+
}, columnLayout: ColumnLayout) => void;
|
|
234
|
+
setColumnsOrder?: (columnsOrder: string[]) => void;
|
|
235
|
+
};
|
|
236
|
+
export type AsyncFilters = {
|
|
237
|
+
[anyColumn: string]: Option[];
|
|
238
|
+
};
|
|
239
|
+
export type CommonGridProps<TData extends RowProps = RowProps> = {
|
|
240
|
+
components?: ComponentsProps;
|
|
241
|
+
filters?: FiltersConfig;
|
|
242
|
+
gridSelectors: GridSelectorsType;
|
|
243
|
+
gridActions: GridActionsType;
|
|
244
|
+
isLoading?: boolean;
|
|
245
|
+
rowsData: TData[];
|
|
246
|
+
hasColouredRows?: boolean;
|
|
247
|
+
columnsDefinitions: ColumnDefinition[];
|
|
248
|
+
actionColumnDefinition?: ActionColumn;
|
|
249
|
+
totalRowsCount?: number;
|
|
250
|
+
allowRowSelect?: boolean;
|
|
251
|
+
allowRowSelectOnAction?: boolean;
|
|
252
|
+
onRowAction?: (id: string, field: string, value: any) => void;
|
|
253
|
+
onRowEditClick?: (id: string, props: TData) => void;
|
|
254
|
+
onRowReadClick?: (id: string, props: TData) => void;
|
|
255
|
+
onRowClick?: (id: string, props: TData) => void;
|
|
256
|
+
onBatchAction?: OnBatchActionFn;
|
|
257
|
+
columnLayout?: ColumnLayout;
|
|
258
|
+
confirmOnReset?: () => boolean;
|
|
259
|
+
hideColumnConfig?: boolean;
|
|
260
|
+
hideAllControls?: boolean;
|
|
261
|
+
className?: string;
|
|
262
|
+
gridRef?: React.MutableRefObject<HTMLElement>;
|
|
263
|
+
minColumnWidth?: number;
|
|
264
|
+
errorMessage?: string;
|
|
265
|
+
extraControlButtons?: ExtraControlButton[];
|
|
266
|
+
perPageOptions?: number[];
|
|
267
|
+
floatingButtonProps?: FloatingButtonProps;
|
|
268
|
+
};
|
|
269
|
+
export declare enum ExtraControlButtonPosition {
|
|
270
|
+
TopLeft = "top-left",
|
|
271
|
+
TopRight = "top-right",
|
|
272
|
+
BottomLeft = "bottom-left",
|
|
273
|
+
BottomRight = "bottom-right"
|
|
274
|
+
}
|
|
275
|
+
export type ExtraControlButton = {
|
|
276
|
+
node?: React.ReactNode;
|
|
277
|
+
onClick?: () => void;
|
|
278
|
+
onSelect?: (value: string) => void;
|
|
279
|
+
label?: string | JSX.Element;
|
|
280
|
+
style?: 'primary' | 'secondary';
|
|
281
|
+
options?: {
|
|
282
|
+
label: string;
|
|
283
|
+
value: string;
|
|
284
|
+
}[];
|
|
285
|
+
position?: ExtraControlButtonPosition;
|
|
286
|
+
hide?: boolean;
|
|
287
|
+
hideChevron?: boolean;
|
|
288
|
+
disabled?: boolean;
|
|
289
|
+
};
|
|
290
|
+
export type Group = {
|
|
291
|
+
name?: string;
|
|
292
|
+
start: boolean;
|
|
293
|
+
end: boolean;
|
|
294
|
+
};
|
|
295
|
+
export type GridProps = Omit<CommonGridProps, 'components' | 'filters'> & {
|
|
296
|
+
optimizeFilters?: boolean;
|
|
297
|
+
allowRowSelectOnAction?: boolean;
|
|
298
|
+
eshopSelect: CommonGridProps['extraControlButtons'];
|
|
299
|
+
onExport: (range: 'filtered' | 'selected', format: string) => void;
|
|
300
|
+
hideControlButtons?: boolean;
|
|
301
|
+
};
|
|
302
|
+
export type PageGridProps = Omit<GridProps, 'rowsData' | 'totalRowsCount' | 'columnsDefinitions' | 'actionColumnDefinition' | 'hideColumnConfig' | 'minColumnWidth' | 'columnLayout'>;
|
|
303
|
+
export type Item = {
|
|
304
|
+
label: string | JSX.Element;
|
|
305
|
+
value: string;
|
|
306
|
+
name: string;
|
|
307
|
+
};
|
|
308
|
+
export type FloatingButtonProps = {
|
|
309
|
+
options?: Item[];
|
|
310
|
+
onSelect?: (value: Item['value']) => void;
|
|
311
|
+
onClick?: () => void;
|
|
312
|
+
};
|
|
313
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var rowClassSymbol = Symbol();
|
|
2
|
+
export var ExtraControlButtonPosition;
|
|
3
|
+
(function (ExtraControlButtonPosition) {
|
|
4
|
+
ExtraControlButtonPosition["TopLeft"] = "top-left";
|
|
5
|
+
ExtraControlButtonPosition["TopRight"] = "top-right";
|
|
6
|
+
ExtraControlButtonPosition["BottomLeft"] = "bottom-left";
|
|
7
|
+
ExtraControlButtonPosition["BottomRight"] = "bottom-right";
|
|
8
|
+
})(ExtraControlButtonPosition || (ExtraControlButtonPosition = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ColumnDefinition, ActionColumn, ColumnConfig, FilterProps, Group, StickTo, FiltersConfig } from '../types';
|
|
2
|
+
export declare const getActionCellSizeProps: (column: ActionColumn) => object;
|
|
3
|
+
export declare const getCellSizeProps: (column: ColumnDefinition, columnWidth: number) => object;
|
|
4
|
+
export declare const getSortName: (column: ColumnDefinition) => string;
|
|
5
|
+
export declare const getFilterName: (column: ColumnDefinition) => string;
|
|
6
|
+
export declare const isColumnOn: (column: ColumnDefinition, columnConfig?: ColumnConfig) => boolean;
|
|
7
|
+
export declare const calculatePaginator: (page: number, rowsPerPage: number) => {
|
|
8
|
+
offset: number;
|
|
9
|
+
limit: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const createFilterType: (columnDefinition: {
|
|
12
|
+
filterOptions?: ColumnDefinition['filterOptions'];
|
|
13
|
+
filteringType?: ColumnDefinition['filteringType'];
|
|
14
|
+
}) => FilterProps['type'];
|
|
15
|
+
export declare const getGroups: (columns: ColumnDefinition[]) => Group[];
|
|
16
|
+
export declare const getGroupClassNames: (group?: Group) => string;
|
|
17
|
+
export declare const getStickyCollClassNames: (sticky: boolean, stickTo?: StickTo) => string;
|
|
18
|
+
export declare const GRID_MIN_ROWS = 6;
|
|
19
|
+
export declare const getFilters: (optimizeFilters: boolean) => FiltersConfig;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import NumberRange from '../components/NumberRange';
|
|
2
|
+
import TextRange from '../components/TextRange';
|
|
3
|
+
import DatePickerRange from '../components/DatePickerRange';
|
|
4
|
+
import BooleanSelect from '../components/BooleanSelect';
|
|
5
|
+
import GridSelect from '../components/GridSelect';
|
|
6
|
+
var isDefined = function (val) { return typeof val !== 'undefined'; };
|
|
7
|
+
export var getActionCellSizeProps = function (column) {
|
|
8
|
+
return {
|
|
9
|
+
flexBasis: column.flexBasis,
|
|
10
|
+
flexGrow: 0,
|
|
11
|
+
flexShrink: 0,
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export var getCellSizeProps = function (column, columnWidth) {
|
|
15
|
+
if (!column)
|
|
16
|
+
return {};
|
|
17
|
+
var fixedSize = column.fixedSize, flexGrow = column.flexGrow, flexShrink = column.flexShrink, sticky = column.sticky;
|
|
18
|
+
return {
|
|
19
|
+
flexBasis: columnWidth,
|
|
20
|
+
flexGrow: fixedSize ? 0 : isDefined(flexGrow) ? flexGrow : 1,
|
|
21
|
+
flexShrink: isDefined(flexShrink) ? flexShrink : 1,
|
|
22
|
+
maxWidth: sticky ? columnWidth : 'auto',
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export var getSortName = function (column) {
|
|
26
|
+
return column.systemName || column.name;
|
|
27
|
+
};
|
|
28
|
+
export var getFilterName = function (column) {
|
|
29
|
+
return column.systemFilter || column.systemName || column.name;
|
|
30
|
+
};
|
|
31
|
+
export var isColumnOn = function (column, columnConfig) {
|
|
32
|
+
var _a;
|
|
33
|
+
if (column.alwaysOn)
|
|
34
|
+
return true;
|
|
35
|
+
var isHidden = (_a = columnConfig === null || columnConfig === void 0 ? void 0 : columnConfig[column.name]) === null || _a === void 0 ? void 0 : _a.isHidden;
|
|
36
|
+
if (typeof isHidden === 'boolean')
|
|
37
|
+
return !isHidden; // isHidden is defined/stored => use user value
|
|
38
|
+
return !column.defaultHidden; // isHidden is undefined => use default value
|
|
39
|
+
};
|
|
40
|
+
export var calculatePaginator = function (page, rowsPerPage) { return ({
|
|
41
|
+
offset: rowsPerPage ? rowsPerPage * (page - 1) : rowsPerPage,
|
|
42
|
+
limit: rowsPerPage,
|
|
43
|
+
}); };
|
|
44
|
+
export var createFilterType = function (columnDefinition) {
|
|
45
|
+
if (columnDefinition.filterOptions)
|
|
46
|
+
return 'options';
|
|
47
|
+
else
|
|
48
|
+
return columnDefinition.filteringType || 'text';
|
|
49
|
+
};
|
|
50
|
+
export var getGroups = function (columns) {
|
|
51
|
+
return columns.map(function (column, key) {
|
|
52
|
+
var previousGroup = key > 0 && columns[key - 1].group;
|
|
53
|
+
return {
|
|
54
|
+
name: column.group,
|
|
55
|
+
start: !!(column.group && (!previousGroup || (previousGroup && previousGroup !== column.group))),
|
|
56
|
+
end: !!(column.group && (!columns[key + 1] || columns[key + 1].group !== column.group)),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export var getGroupClassNames = function (group) {
|
|
61
|
+
return "".concat((group === null || group === void 0 ? void 0 : group.start) ? 'group-start' : '', " ").concat((group === null || group === void 0 ? void 0 : group.end) ? 'group-end' : '');
|
|
62
|
+
};
|
|
63
|
+
export var getStickyCollClassNames = function (sticky, stickTo) {
|
|
64
|
+
return !sticky ? '' : "".concat(stickTo ? " sticky sticky-".concat(stickTo) : ' sticky sticky-left');
|
|
65
|
+
};
|
|
66
|
+
export var GRID_MIN_ROWS = 6;
|
|
67
|
+
export var getFilters = function (optimizeFilters) {
|
|
68
|
+
var filters = {
|
|
69
|
+
number: { CellComponent: NumberRange },
|
|
70
|
+
text: { CellComponent: TextRange },
|
|
71
|
+
date: { CellComponent: DatePickerRange },
|
|
72
|
+
flag: { CellComponent: BooleanSelect },
|
|
73
|
+
options: { CellComponent: GridSelect },
|
|
74
|
+
};
|
|
75
|
+
if (optimizeFilters)
|
|
76
|
+
filters.text.defaultExtraProps = { defaultComparator: 'eq' };
|
|
77
|
+
return filters;
|
|
78
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RowProps, GridActionsType, ColumnDefinition, UxState, ActionColumn, OnBatchActionFn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* hook for checkbox that select and unselects all row
|
|
4
|
+
* returns [checked state, toggleAllHandler()] for checkbox
|
|
5
|
+
*/
|
|
6
|
+
type ToggleAllCheckboxRet = [boolean, () => void];
|
|
7
|
+
export declare const useToggleAllCheckbox: (rowsData: RowProps[], uxState: UxState, handleUxChange?: GridActionsType['handleUxChange']) => ToggleAllCheckboxRet;
|
|
8
|
+
/**
|
|
9
|
+
* hook for action selection and trigger
|
|
10
|
+
* returns [subset of actions that are enabled, onSelect(value) - param1: selected action value]
|
|
11
|
+
*/
|
|
12
|
+
type GridActionTriggerRet = [Required<ActionColumn>['actionOptions'], (value: any) => void];
|
|
13
|
+
export declare const useGridActionTrigger: (rowsData: RowProps[], uxState: UxState, actionOptions?: ActionColumn['actionOptions'], onBatchAction?: OnBatchActionFn) => GridActionTriggerRet;
|
|
14
|
+
type AddFilterRet = (value: any, column: ColumnDefinition) => void;
|
|
15
|
+
export declare const useAddFilter: (onChange: Required<GridActionsType>['addFilter']) => AddFilterRet;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useMemo, useCallback } from 'react';
|
|
2
|
+
import { getFilterName, createFilterType } from './';
|
|
3
|
+
import find from 'lodash/find';
|
|
4
|
+
export var useToggleAllCheckbox = function (rowsData, uxState, handleUxChange) {
|
|
5
|
+
var allChecked = useMemo(function () { return (rowsData || []).length >= 1 && rowsData.every(function (row) { var _a; return (_a = uxState.checkedRows) === null || _a === void 0 ? void 0 : _a[row.id]; }); }, [rowsData, uxState.checkedRows]);
|
|
6
|
+
var toggleAllHandler = useCallback(function () {
|
|
7
|
+
var checkedRows = {};
|
|
8
|
+
// if check all is not check, we check all
|
|
9
|
+
if (!allChecked && rowsData) {
|
|
10
|
+
rowsData.forEach(function (row) {
|
|
11
|
+
checkedRows[row.id] = true;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
handleUxChange && handleUxChange('checkedRows', checkedRows);
|
|
15
|
+
}, [handleUxChange, rowsData, allChecked]);
|
|
16
|
+
return [allChecked, toggleAllHandler];
|
|
17
|
+
};
|
|
18
|
+
export var useGridActionTrigger = function (rowsData, uxState, actionOptions, onBatchAction) {
|
|
19
|
+
if (actionOptions === void 0) { actionOptions = []; }
|
|
20
|
+
var actionRows = useMemo(function () {
|
|
21
|
+
return (rowsData || []).filter(function (row) { var _a; return (_a = uxState.checkedRows) === null || _a === void 0 ? void 0 : _a[row.id]; });
|
|
22
|
+
}, [uxState, rowsData]);
|
|
23
|
+
var enabledActions = useMemo(function () {
|
|
24
|
+
var actionsOptions = actionOptions || [];
|
|
25
|
+
return actionsOptions.filter(function (action) {
|
|
26
|
+
if (action.isEnabled) {
|
|
27
|
+
return action.isEnabled(actionRows);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return uxState.checkedRows && find(uxState.checkedRows, Boolean);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}, [uxState, actionRows, actionOptions]);
|
|
34
|
+
var handleBatchAction = useCallback(function (value) {
|
|
35
|
+
var actionsOptions = actionOptions || [];
|
|
36
|
+
var action = actionsOptions.find(function (option) { return option.value == value; });
|
|
37
|
+
action && onBatchAction && onBatchAction(action, actionRows);
|
|
38
|
+
}, [actionOptions, onBatchAction, actionRows]);
|
|
39
|
+
return [enabledActions, handleBatchAction];
|
|
40
|
+
};
|
|
41
|
+
export var useAddFilter = function (onChange) {
|
|
42
|
+
return useCallback(function (value, column) {
|
|
43
|
+
if (onChange) {
|
|
44
|
+
var filterProps = {
|
|
45
|
+
type: createFilterType(column),
|
|
46
|
+
filterExtraProps: column.filterExtraProps || {},
|
|
47
|
+
computedValue: column.getFilterCriteria ? column.getFilterCriteria(value) : null,
|
|
48
|
+
};
|
|
49
|
+
onChange(getFilterName(column), value, filterProps);
|
|
50
|
+
}
|
|
51
|
+
}, [onChange]);
|
|
52
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { Placement } from '@popperjs/core';
|
|
3
|
+
type DropdownMenuProps = {
|
|
4
|
+
parentRef: React.MutableRefObject<HTMLDivElement | null | undefined>;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
children: React.ReactChild;
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
};
|
|
9
|
+
export declare const Popover: FC<DropdownMenuProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import styled from '@xstyled/styled-components';
|
|
7
|
+
import { Popper } from 'react-popper';
|
|
8
|
+
import { useClickOutside } from '../Modal/hooks/useClickOutside';
|
|
9
|
+
import Portal from '../../Elements/Portal';
|
|
10
|
+
var PopoverWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n z-index: 5;\n"], ["\n z-index: 5;\n"])));
|
|
11
|
+
export var Popover = function (_a) {
|
|
12
|
+
var placement = _a.placement, children = _a.children, onClose = _a.onClose, parentRef = _a.parentRef;
|
|
13
|
+
var popperRef = useClickOutside({ onClose: onClose, parentRef: parentRef });
|
|
14
|
+
return (_jsx(Portal, { children: _jsx("div", { ref: popperRef, children: _jsx(Popper, { innerRef: popperRef, referenceElement: parentRef.current, placement: placement, children: function (_a) {
|
|
15
|
+
var ref = _a.ref, style = _a.style;
|
|
16
|
+
return (_jsx(PopoverWrapper, { ref: ref, style: style, children: children }));
|
|
17
|
+
} }) }) }));
|
|
18
|
+
};
|
|
19
|
+
var templateObject_1;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpaceAround } from '../SpaceAround';
|
|
3
|
+
import { DatetimepickerProps } from './Datetime/types';
|
|
4
|
+
export type DatePickerType = DatetimepickerProps & {
|
|
5
|
+
onChange: (value: string | Date) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
initialViewDate?: Date | null;
|
|
10
|
+
secondValue?: Date | null;
|
|
11
|
+
className?: string;
|
|
12
|
+
spaceAround?: SpaceAround;
|
|
13
|
+
showInputLabel?: boolean;
|
|
14
|
+
showCalendarLabel?: boolean;
|
|
15
|
+
error?: string;
|
|
16
|
+
icon?: boolean;
|
|
17
|
+
onClear?: () => void;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: React.MemoExoticComponent<({ name, value, initialViewDate, error, label, disabled, isValidDate, onChange, dateFormat, timeFormat, open, secondValue, input, icon, showInputLabel, showCalendarLabel, spaceAround, className, onClear, ...passProps }: DatePickerType) => JSX.Element>;
|
|
20
|
+
export default _default;
|