@mailstep/design-system 0.5.1-beta.1 → 0.6.0
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 +40 -20
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +5 -2
- package/ui/Blocks/CommonGrid/CommonGrid.js +12 -22
- package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +66 -0
- package/ui/Blocks/CommonGrid/StandardButtons.d.ts +4 -0
- package/ui/Blocks/CommonGrid/StandardButtons.js +36 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +50 -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 +37 -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.js +1 -1
- 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/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/DataRow.js +4 -4
- 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/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/FilterRow.js +2 -3
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +46 -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/HeadCell.js +1 -4
- 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.js +1 -4
- 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/Table.d.ts +0 -6
- package/ui/Blocks/CommonGrid/components/Table.js +0 -5
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +32 -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/{icons/ArrowSimple.js → gridCells/ButtonInCell.js} +4 -2
- 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 +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +18 -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/ToggleCell.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +30 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +14 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +14 -0
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +4 -0
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +14 -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/useFloatingButton.d.ts +3 -0
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +13 -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/useGridActionTrigger.d.ts +8 -0
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +25 -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/useToggleAllCheckbox.d.ts +8 -0
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +15 -0
- package/ui/Blocks/CommonGrid/index.d.ts +8 -6
- package/ui/Blocks/CommonGrid/index.js +8 -8
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +4 -4
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +3 -2
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +3 -2
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +2 -2
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +2 -1
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.d.ts +1 -0
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +8 -0
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +1 -17
- package/ui/Blocks/CommonGrid/styles.d.ts +14 -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 +29 -15
- package/ui/Blocks/CommonGrid/utils/index.d.ts +4 -1
- package/ui/Blocks/CommonGrid/utils/index.js +19 -0
- package/ui/Blocks/HidePrint/HidePrint.d.ts +6 -0
- package/ui/Blocks/HidePrint/HidePrint.js +13 -0
- package/ui/Blocks/Popover/index.d.ts +12 -0
- package/ui/Blocks/Popover/index.js +21 -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/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/DropdownSelect/DropdownSelect.d.ts +21 -0
- package/ui/Elements/DropdownSelect/DropdownSelect.js +47 -0
- package/ui/Elements/DropdownSelect/index.d.ts +4 -0
- package/ui/Elements/DropdownSelect/index.js +3 -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/Icon/icons/Company.d.ts +3 -0
- package/ui/Elements/Icon/icons/Company.js +13 -0
- package/ui/Elements/Icon/icons/Integrations.d.ts +3 -0
- package/ui/Elements/Icon/icons/Integrations.js +13 -0
- package/ui/Elements/Icon/icons/ShoppingBag.d.ts +3 -0
- package/ui/Elements/Icon/icons/ShoppingBag.js +13 -0
- package/ui/Elements/Icon/icons/Truck.d.ts +3 -0
- package/ui/Elements/Icon/icons/Truck.js +13 -0
- package/ui/Elements/Icon/icons/TwoUsers.d.ts +3 -0
- package/ui/Elements/Icon/icons/TwoUsers.js +13 -0
- package/ui/Elements/Icon/icons/index.d.ts +5 -0
- package/ui/Elements/Icon/icons/index.js +5 -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 +4 -3
- package/ui/Elements/Pagination/Pagination.js +11 -3
- package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +1 -1
- 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 +8 -0
- package/ui/Elements/Select/themes/CustomComponents.js +125 -0
- package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
- package/ui/Elements/Select/themes/baseStyles.js +87 -0
- package/ui/Elements/Select/themes/formStyles.d.ts +24 -0
- package/ui/Elements/Select/themes/formStyles.js +102 -0
- package/ui/Elements/Select/themes/index.d.ts +3 -0
- package/ui/Elements/Select/themes/index.js +43 -0
- package/ui/Elements/Select/types.d.ts +55 -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/Elements/Toggle/Toggle.d.ts +1 -1
- package/ui/Elements/Toggle/Toggle.js +2 -2
- package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +1 -1
- package/ui/Elements/Toggle/types.d.ts +1 -0
- package/ui/Forms/Input/types.d.ts +2 -2
- package/ui/Forms/TextArea/TextArea.d.ts +20 -0
- package/ui/Forms/TextArea/TextArea.js +34 -0
- package/ui/Forms/TextArea/index.d.ts +2 -0
- package/ui/Forms/TextArea/index.js +2 -0
- package/ui/Forms/TextArea/styles.d.ts +12 -0
- package/ui/Forms/TextArea/styles.js +31 -0
- package/ui/ThemeProvider/ThemeProvider.d.ts +3 -1
- package/ui/ThemeProvider/ThemeProvider.js +4 -2
- package/ui/ThemeProvider/types.d.ts +1 -0
- package/ui/index.d.ts +17 -1
- package/ui/index.es.js +42462 -8524
- package/ui/index.js +17 -1
- package/ui/index.umd.js +1647 -270
- package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +0 -12
- package/ui/Blocks/CommonGrid/CommonGridContext.js +0 -45
- package/ui/Blocks/CommonGrid/components/ActionColumnHead.d.ts +0 -4
- package/ui/Blocks/CommonGrid/components/ActionColumnHead.js +0 -16
- package/ui/Blocks/CommonGrid/components/ButtonStrip.d.ts +0 -7
- package/ui/Blocks/CommonGrid/components/ButtonStrip.js +0 -35
- package/ui/Blocks/CommonGrid/components/ConfigForm.d.ts +0 -9
- package/ui/Blocks/CommonGrid/components/ConfigForm.js +0 -58
- package/ui/Blocks/CommonGrid/components/DefaultPaginator.d.ts +0 -3
- package/ui/Blocks/CommonGrid/components/DefaultPaginator.js +0 -11
- package/ui/Blocks/CommonGrid/components/Dialog.d.ts +0 -11
- package/ui/Blocks/CommonGrid/components/Dialog.js +0 -19
- package/ui/Blocks/CommonGrid/components/DropdownMenu.d.ts +0 -21
- package/ui/Blocks/CommonGrid/components/DropdownMenu.js +0 -59
- package/ui/Blocks/CommonGrid/components/DropdownSelect.d.ts +0 -15
- package/ui/Blocks/CommonGrid/components/DropdownSelect.js +0 -35
- package/ui/Blocks/CommonGrid/components/FloatingButton.d.ts +0 -6
- package/ui/Blocks/CommonGrid/components/FloatingButton.js +0 -13
- package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +0 -2
- package/ui/Blocks/CommonGrid/hooks/useControlButtons.d.ts +0 -10
- package/ui/Blocks/CommonGrid/hooks/useControlButtons.js +0 -64
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +0 -13
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +0 -49
- package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +0 -2
- package/ui/Blocks/CommonGrid/storybook/utils/filters.js +0 -23
- package/ui/Blocks/CommonGrid/utils/public.d.ts +0 -16
- package/ui/Blocks/CommonGrid/utils/public.js +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -14,14 +14,15 @@
|
|
|
14
14
|
"storybook": "storybook dev -p 6006",
|
|
15
15
|
"build": "rm -rf ./build && tsc && vite build && cp package.json build && cp README.md build",
|
|
16
16
|
"build-storybook": "storybook build",
|
|
17
|
-
"deploy": "npm publish ./build",
|
|
17
|
+
"deploy": "npm run build && npm publish ./build",
|
|
18
18
|
"dev": "yarn storybook",
|
|
19
19
|
"test": "echo \"The tests are still waiting to be written, but it seems like they're really good at procrastinating!\""
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@babel/core": "^7.20.12",
|
|
22
23
|
"@babel/preset-env": "^7.22.4",
|
|
23
24
|
"@babel/preset-react": "^7.22.3",
|
|
24
|
-
"@babel/preset-typescript": "^7.
|
|
25
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
25
26
|
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
|
26
27
|
"@fortawesome/free-brands-svg-icons": "^6.1.1",
|
|
27
28
|
"@fortawesome/pro-duotone-svg-icons": "^6.0.0",
|
|
@@ -29,6 +30,9 @@
|
|
|
29
30
|
"@fortawesome/pro-regular-svg-icons": "^6.0.0",
|
|
30
31
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
31
32
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
33
|
+
"@lingui/react": "3.17.2",
|
|
34
|
+
"@lingui/core": "3.17.2",
|
|
35
|
+
"@popperjs/core": "^2.11.8",
|
|
32
36
|
"@storybook/addon-controls": "7.6.8",
|
|
33
37
|
"@storybook/addon-essentials": "7.6.8",
|
|
34
38
|
"@storybook/addon-interactions": "7.6.8",
|
|
@@ -38,8 +42,11 @@
|
|
|
38
42
|
"@storybook/react-webpack5": "7.6.8",
|
|
39
43
|
"@storybook/testing-library": "0.2.2",
|
|
40
44
|
"@svgr/rollup": "^8.0.1",
|
|
45
|
+
"@types/faker": "^4.1.11",
|
|
46
|
+
"@types/luxon": "^3.4.2",
|
|
41
47
|
"@types/node": "^20.1.7",
|
|
42
48
|
"@types/react": "^18.2.6",
|
|
49
|
+
"@types/react-beautiful-dnd": "^13.1.2",
|
|
43
50
|
"@types/react-dom": "^18.2.4",
|
|
44
51
|
"@types/react-helmet": "^6.1.11",
|
|
45
52
|
"@types/react-router": "^5.1.20",
|
|
@@ -47,19 +54,31 @@
|
|
|
47
54
|
"@types/styled-components": "^5.1.26",
|
|
48
55
|
"@vitejs/plugin-react": "^4.2.1",
|
|
49
56
|
"@xstyled/styled-components": "^3.8.0",
|
|
50
|
-
"babel-loader": "^9.1.
|
|
57
|
+
"babel-loader": "^9.1.3",
|
|
58
|
+
"babel-plugin-macros": "^3.1.0",
|
|
51
59
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
52
60
|
"eslint-plugin-storybook": "0.6.15",
|
|
61
|
+
"faker": "^5.1.0",
|
|
62
|
+
"immer": "9.0.7",
|
|
53
63
|
"lodash": "^4.17.21",
|
|
64
|
+
"luxon": "^3.4.4",
|
|
65
|
+
"moment": "^2.30.1",
|
|
54
66
|
"react": "^18.2.0",
|
|
55
|
-
"react-
|
|
67
|
+
"react-beautiful-dnd": "^13.0.0",
|
|
56
68
|
"react-dom": "^18.2.0",
|
|
69
|
+
"react-helmet": "^6.1.0",
|
|
57
70
|
"react-image": "^4.1.0",
|
|
71
|
+
"react-onclickoutside": "^6.13.0",
|
|
72
|
+
"react-popper": "^2.3.0",
|
|
73
|
+
"react-redux": "*",
|
|
58
74
|
"react-router": "^5.1.2",
|
|
59
75
|
"react-router-dom": "^5.1.2",
|
|
60
76
|
"react-script": "^2.0.5",
|
|
77
|
+
"react-select": "^5.8.0",
|
|
61
78
|
"react-toastify": "^9.1.3",
|
|
62
79
|
"react-use-draggable-scroll": "^0.4.7",
|
|
80
|
+
"redux": ">=4.0.5",
|
|
81
|
+
"reselect": "5.0.0-alpha.2",
|
|
63
82
|
"storybook": "7.6.8",
|
|
64
83
|
"string-width": "6.1.0",
|
|
65
84
|
"styled-components": "^5.3.10",
|
|
@@ -69,15 +88,7 @@
|
|
|
69
88
|
"vite": "^5.0.10",
|
|
70
89
|
"vite-plugin-dts": "^3.6.4",
|
|
71
90
|
"vite-plugin-static-copy": "^1.0.0",
|
|
72
|
-
"webpack": "^5.82.1"
|
|
73
|
-
"immer": "9.0.7",
|
|
74
|
-
"react-beautiful-dnd": "^13.0.0",
|
|
75
|
-
"@types/react-beautiful-dnd": "^13.1.2",
|
|
76
|
-
"react-redux": "*",
|
|
77
|
-
"redux": ">=4.0.5",
|
|
78
|
-
"reselect": "5.0.0-alpha.2",
|
|
79
|
-
"@types/faker": "^4.1.11",
|
|
80
|
-
"faker": "^5.1.0"
|
|
91
|
+
"webpack": "^5.82.1"
|
|
81
92
|
},
|
|
82
93
|
"peerDependencies": {
|
|
83
94
|
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
|
@@ -87,25 +98,34 @@
|
|
|
87
98
|
"@fortawesome/pro-regular-svg-icons": "^6.0.0",
|
|
88
99
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
89
100
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
101
|
+
"@lingui/react": "3.17.2",
|
|
102
|
+
"@lingui/core": "3.17.2",
|
|
103
|
+
"@popperjs/core": "^2.11.8",
|
|
90
104
|
"@xstyled/styled-components": "^3.8.0",
|
|
105
|
+
"babel-plugin-macros": "^3.1.0",
|
|
106
|
+
"immer": "9.0.7",
|
|
91
107
|
"lodash": "^4.17.21",
|
|
108
|
+
"luxon": "^3.4.4",
|
|
109
|
+
"moment": "^2.30.1",
|
|
92
110
|
"react": "^18.2.0",
|
|
111
|
+
"react-beautiful-dnd": "^13.0.0",
|
|
93
112
|
"react-dom": "^18.2.0",
|
|
94
113
|
"react-helmet": "^6.1.0",
|
|
95
114
|
"react-image": "^4.1.0",
|
|
115
|
+
"react-onclickoutside": "^6.13.0",
|
|
116
|
+
"react-popper": "^2.3.0",
|
|
117
|
+
"react-redux": ">=4.0.5",
|
|
96
118
|
"react-router": "^5.1.2",
|
|
97
119
|
"react-router-dom": "^5.1.2",
|
|
120
|
+
"react-select": "^5.8.0",
|
|
98
121
|
"react-toastify": "^9.1.3",
|
|
99
122
|
"react-use-draggable-scroll": "^0.4.7",
|
|
123
|
+
"redux": ">=4.0.5",
|
|
124
|
+
"reselect": "5.0.0-alpha.2",
|
|
100
125
|
"styled-components": "^5.3.10",
|
|
101
126
|
"swiper": "^11.0.3",
|
|
102
127
|
"tslib": "^2.6.2",
|
|
103
|
-
"typescript": "^5.0.4"
|
|
104
|
-
"immer": "9.0.7",
|
|
105
|
-
"react-beautiful-dnd": "^13.0.0",
|
|
106
|
-
"react-redux": ">=4.0.5",
|
|
107
|
-
"redux": ">=4.0.5",
|
|
108
|
-
"reselect": "5.0.0-alpha.2"
|
|
128
|
+
"typescript": "^5.0.4"
|
|
109
129
|
},
|
|
110
130
|
"resolutions": {
|
|
111
131
|
"jackspeak": "2.1.1"
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { CommonGridProps } from './types';
|
|
2
|
-
|
|
1
|
+
import { CommonGridProps, FiltersConfig } from './types';
|
|
2
|
+
type Props = CommonGridProps & {
|
|
3
|
+
filters?: FiltersConfig;
|
|
4
|
+
};
|
|
5
|
+
declare const CommonGrid: ({ filters, gridSelectors, gridActions, isLoading, rowsData, hasColouredRows, columnsDefinitions, actionColumnDefinition, allowRowSelect, allowRowSelectOnAction, onRowAction, onRowEditClick, onRowReadClick, onRowClick, columnLayout, hideColumnConfig, className, gridRef, minColumnWidth, errorMessage, floatingButtonProps, }: Props) => JSX.Element;
|
|
3
6
|
export default CommonGrid;
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { x } from '@xstyled/styled-components';
|
|
15
15
|
import { Row, MessageCell } from './components/Table';
|
|
@@ -18,17 +18,13 @@ import GroupRow from './components/GroupRow';
|
|
|
18
18
|
import FilterRow from './components/FilterRow';
|
|
19
19
|
import DataRow from './components/DataRow';
|
|
20
20
|
import HeadRow from './components/HeadRow';
|
|
21
|
-
import ConfigForm from './components/ConfigForm';
|
|
22
21
|
import useUxReset from './hooks/useUxReset';
|
|
23
|
-
import useControlButtons from './hooks/useControlButtons';
|
|
24
22
|
import useRowsKeyControls from './hooks/useRowsKeyControls';
|
|
25
23
|
import useColumnSizes from './hooks/useColumnSizes';
|
|
26
|
-
import ActionColumnHead from './components/ActionColumnHead';
|
|
27
|
-
import { Provider as ContextProvider, defaultComponents } from './CommonGridContext';
|
|
28
24
|
import { isColumnOn, getGroups } from './utils';
|
|
29
25
|
import { initialState } from './store';
|
|
30
|
-
import
|
|
31
|
-
import FloatingButton from './components/FloatingButton';
|
|
26
|
+
import { Trans } from '@lingui/react';
|
|
27
|
+
import FloatingButton from './components/FloatingButton/FloatingButton';
|
|
32
28
|
var rowsStyles = { outline: 'none' };
|
|
33
29
|
var defaultVoidFunction = function () {
|
|
34
30
|
var args = [];
|
|
@@ -41,17 +37,13 @@ var defaultUxState = initialState.uxState;
|
|
|
41
37
|
var defaultColumnsWidth = {};
|
|
42
38
|
var defaultPerPageOptions = [10, 20, 50, 100];
|
|
43
39
|
var CommonGrid = function (_a) {
|
|
44
|
-
var
|
|
40
|
+
var filters = _a.filters,
|
|
45
41
|
// redux props
|
|
46
42
|
gridSelectors = _a.gridSelectors, gridActions = _a.gridActions,
|
|
47
43
|
// input props
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
}, [components]);
|
|
52
|
-
var Translator = usedComponents.Translator, Paginator = usedComponents.Paginator;
|
|
53
|
-
var _e = gridSelectors.uxState, uxState = _e === void 0 ? defaultUxState : _e, isConfigFormOpen = gridSelectors.isConfigFormOpen, columnConfig = gridSelectors.columnConfig, _f = gridSelectors.columnsWidth, columnsWidth = _f === void 0 ? defaultColumnsWidth : _f, columnsWidthVariant = gridSelectors.columnsWidthVariant, _g = gridSelectors.page, page = _g === void 0 ? 1 : _g, filter = gridSelectors.filter, sorting = gridSelectors.sorting, _h = gridSelectors.rowsPerPage, rowsPerPage = _h === void 0 ? 10 : _h;
|
|
54
|
-
var clearUxState = gridActions.clearUxState, handleUxChange = gridActions.handleUxChange, _j = gridActions.openConfigForm, openConfigForm = _j === void 0 ? defaultVoidFunction : _j, closeConfigForm = gridActions.closeConfigForm, _k = gridActions.setColumnConfig, setColumnConfig = _k === void 0 ? defaultVoidFunction : _k, _l = gridActions.setPage, setPage = _l === void 0 ? defaultVoidFunction : _l, _m = gridActions.setRowsPerPage, setRowsPerPage = _m === void 0 ? defaultVoidFunction : _m, _o = gridActions.addFilter, addFilter = _o === void 0 ? defaultVoidFunction : _o, _p = gridActions.resetFilters, resetFilters = _p === void 0 ? defaultVoidFunction : _p, _q = gridActions.addSorting, addSorting = _q === void 0 ? defaultVoidFunction : _q, _r = gridActions.resetGrid, resetGrid = _r === void 0 ? defaultVoidFunction : _r, _s = gridActions.setColumnWidth, setColumnWidth = _s === void 0 ? defaultVoidFunction : _s, _t = gridActions.setColumnsOrder, setColumnsOrder = _t === void 0 ? defaultVoidFunction : _t;
|
|
44
|
+
isLoading = _a.isLoading, rowsData = _a.rowsData, hasColouredRows = _a.hasColouredRows, columnsDefinitions = _a.columnsDefinitions, actionColumnDefinition = _a.actionColumnDefinition, allowRowSelect = _a.allowRowSelect, allowRowSelectOnAction = _a.allowRowSelectOnAction, onRowAction = _a.onRowAction, onRowEditClick = _a.onRowEditClick, onRowReadClick = _a.onRowReadClick, onRowClick = _a.onRowClick, _b = _a.columnLayout, columnLayout = _b === void 0 ? 'normal' : _b, hideColumnConfig = _a.hideColumnConfig, className = _a.className, gridRef = _a.gridRef, minColumnWidth = _a.minColumnWidth, errorMessage = _a.errorMessage, floatingButtonProps = _a.floatingButtonProps;
|
|
45
|
+
var _c = gridSelectors.uxState, uxState = _c === void 0 ? defaultUxState : _c, columnConfig = gridSelectors.columnConfig, _d = gridSelectors.columnsWidth, columnsWidth = _d === void 0 ? defaultColumnsWidth : _d, columnsWidthVariant = gridSelectors.columnsWidthVariant, _e = gridSelectors.page, page = _e === void 0 ? 1 : _e, filter = gridSelectors.filter, sorting = gridSelectors.sorting, _f = gridSelectors.rowsPerPage, rowsPerPage = _f === void 0 ? 10 : _f;
|
|
46
|
+
var clearUxState = gridActions.clearUxState, handleUxChange = gridActions.handleUxChange, _g = gridActions.addFilter, addFilter = _g === void 0 ? defaultVoidFunction : _g, _h = gridActions.addSorting, addSorting = _h === void 0 ? defaultVoidFunction : _h, _j = gridActions.setColumnWidth, setColumnWidth = _j === void 0 ? defaultVoidFunction : _j, _k = gridActions.setColumnsOrder, setColumnsOrder = _k === void 0 ? defaultVoidFunction : _k;
|
|
55
47
|
var handleRowsKeyDown = useRowsKeyControls(rowsData, uxState, handleUxChange);
|
|
56
48
|
useUxReset(rowsData, uxState, clearUxState);
|
|
57
49
|
var checksColumnsOrder = React.useCallback(function (colsOrder) {
|
|
@@ -87,16 +79,14 @@ var CommonGrid = function (_a) {
|
|
|
87
79
|
var GridMessage;
|
|
88
80
|
var messageClass = 'info';
|
|
89
81
|
if (isLoading)
|
|
90
|
-
GridMessage = _jsx(
|
|
82
|
+
GridMessage = _jsx(Trans, { id: "dataGrid.status.loadingData", message: "... loading data ..." });
|
|
91
83
|
if (!isLoading && (!rowsData || rowsData.length < 1))
|
|
92
|
-
GridMessage = _jsx(
|
|
84
|
+
GridMessage = _jsx(Trans, { id: "dataGrid.status.noDataFound", message: "No data found." });
|
|
93
85
|
if (!isLoading && errorMessage) {
|
|
94
86
|
GridMessage = errorMessage;
|
|
95
87
|
messageClass = 'error';
|
|
96
88
|
}
|
|
97
|
-
var
|
|
98
|
-
var _u = useControlButtons(hideColumnConfig, openConfigForm, resetGrid, columnsDefinitions, resetFilters, setRowsPerPage, rowsSeenTxt, extraControlButtons, Translator, confirmOnReset, perPageOptions), topLeftButtons = _u.topLeftButtons, topRightButtons = _u.topRightButtons, bottomRightButtons = _u.bottomRightButtons, bottomLeftButtons = _u.bottomLeftButtons;
|
|
99
|
-
var _v = useColumnSizes(displayColumnsDefinitions, columnsWidth, columnsWidthVariant, setColumnWidth, columnLayout, minColumnWidth), displayColumnsWidth = _v.displayColumnsWidth, totalColumnsWidth = _v.totalColumnsWidth, gridBoxRef = _v.gridBoxRef, handleResizeDrag = _v.handleResizeDrag;
|
|
89
|
+
var _l = useColumnSizes(displayColumnsDefinitions, columnsWidth, columnsWidthVariant, setColumnWidth, columnLayout, minColumnWidth), displayColumnsWidth = _l.displayColumnsWidth, totalColumnsWidth = _l.totalColumnsWidth, gridBoxRef = _l.gridBoxRef, handleResizeDrag = _l.handleResizeDrag;
|
|
100
90
|
var groups = React.useMemo(function () {
|
|
101
91
|
return getGroups(displayColumnsDefinitions);
|
|
102
92
|
}, [displayColumnsDefinitions]);
|
|
@@ -104,12 +94,12 @@ var CommonGrid = function (_a) {
|
|
|
104
94
|
gridBoxRef.current = node;
|
|
105
95
|
!!gridRef && (gridRef.current = node);
|
|
106
96
|
}, []);
|
|
107
|
-
return (
|
|
97
|
+
return (_jsxs(_Fragment, { children: [_jsx(x.div, { className: className || '', children: _jsxs(OversizedScroll, { columnLayout: columnLayout, isLoading: isLoading, totalColumnsWidth: totalColumnsWidth, floatingChildren: GridMessage && (_jsx(Row, { className: "dataRow", align: "center", children: _jsx(MessageCell, { align: "center", className: "gridMessage ".concat(messageClass), children: GridMessage }) })), ref: commonGridRef, children: [_jsxs("div", { className: "gridHead", children: [columnsDefinitions.find(function (col) { return col.group; }) && (_jsx(GroupRow, { actionColumn: actionColumnDefinition, columns: displayColumnsDefinitions, displayColumnsWidth: displayColumnsWidth, groups: groups })), _jsx(HeadRow, { columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onAddSort: addSorting, columnLayout: columnLayout, setColumnsOrder: setColumnsOrder, columnsOrder: columnsOrder, sortingValues: sorting, displayColumnsWidth: displayColumnsWidth, handleResizeDrag: handleResizeDrag, groups: groups }), columnsDefinitions.find(function (col) { return col.filtering; }) && (_jsx(FilterRow, { filters: filters, columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onChange: addFilter, filterValues: filter, displayColumnsWidth: displayColumnsWidth, groups: groups, rowsData: rowsData, uxState: uxState, handleUxChange: handleUxChange }))] }), _jsx("div", { className: "body flx_1", style: rowsStyles, tabIndex: -1, onKeyDown: handleRowsKeyDown, children: !isLoading &&
|
|
108
98
|
rowsData &&
|
|
109
99
|
displayColumnsDefinitions &&
|
|
110
100
|
rowsData.map(function (row, index) {
|
|
111
101
|
var rowIndex = rowsPerPage * page + (index + 1) - rowsPerPage;
|
|
112
102
|
return (_jsx(DataRow, { rowData: row, rowIndex: rowIndex, uxState: uxState, isEven: hasColouredRows && (index + 1) % 2 === 0, allowRowSelect: allowRowSelect, allowRowSelectOnAction: allowRowSelectOnAction, onRowAction: onRowAction, onUxChange: handleUxChange, onRowEditClick: onRowEditClick, onRowReadClick: onRowReadClick, onRowClick: onRowClick, columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, displayColumnsWidth: displayColumnsWidth, groups: groups }, row.id));
|
|
113
|
-
}) })] })
|
|
103
|
+
}) })] }) }), floatingButtonProps && _jsx(FloatingButton, __assign({}, floatingButtonProps))] }));
|
|
114
104
|
};
|
|
115
105
|
export default CommonGrid;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import useGetGridHeight from './hooks/useGetGridHeight';
|
|
25
|
+
import { useEffect, useMemo } from 'react';
|
|
26
|
+
import { getFilters, GRID_MIN_ROWS, rowHeight } from './utils';
|
|
27
|
+
import useEditReadAsColumn from './hooks/useEditReadAsColumn';
|
|
28
|
+
import { useModal } from '../Modal/hooks/useModal';
|
|
29
|
+
import useManageColumn from './hooks/useManageColumn';
|
|
30
|
+
import { CommonGridWithStyles, BottomWrapper, CommonGridWrap, ContentContainer, StyledButtonStrip, StyledColumnButton, } from './styles';
|
|
31
|
+
import { H6 } from '../../Elements/Typography';
|
|
32
|
+
import HidePrint from '../HidePrint/HidePrint';
|
|
33
|
+
import ControlButtons from './components/ControlButtons';
|
|
34
|
+
import { x } from '@xstyled/styled-components';
|
|
35
|
+
import ActionHead from './components/ActionHead';
|
|
36
|
+
import { Pagination } from '../../Elements/Pagination';
|
|
37
|
+
import TablePagination from './components/TablePagination';
|
|
38
|
+
import Modal from '../Modal';
|
|
39
|
+
import ManageColumnForm from './components/ManageColumnForm';
|
|
40
|
+
import { Trans } from '@lingui/react';
|
|
41
|
+
import { Settings2 } from '../../Elements/Icon/icons/Settings2';
|
|
42
|
+
var StyledCommonGrid = function (props) {
|
|
43
|
+
var _a = props.optimizeFilters, optimizeFilters = _a === void 0 ? false : _a, extraControlButtons = props.extraControlButtons, eshopSelect = props.eshopSelect, onBatchAction = props.onBatchAction, processCheckedValues = props.processCheckedValues, processCheckedValuesTitle = props.processCheckedValuesTitle, hideControlButtons = props.hideControlButtons, floatingButtonProps = props.floatingButtonProps, queryRowsParam = props.queryRowsParam, customPaginationHandler = props.customPaginationHandler, passDownProps = __rest(props, ["optimizeFilters", "extraControlButtons", "eshopSelect", "onBatchAction", "processCheckedValues", "processCheckedValuesTitle", "hideControlButtons", "floatingButtonProps", "queryRowsParam", "customPaginationHandler"]);
|
|
44
|
+
var gridActions = passDownProps.gridActions, gridSelectors = passDownProps.gridSelectors, rowsData = passDownProps.rowsData, actionColumnDefinition = passDownProps.actionColumnDefinition;
|
|
45
|
+
var _b = useGetGridHeight(), gridHeight = _b.gridHeight, gridRef = _b.gridRef, paginationRef = _b.paginationRef;
|
|
46
|
+
useEffect(function () {
|
|
47
|
+
var _a;
|
|
48
|
+
if (!queryRowsParam && gridHeight && gridHeight > 0) {
|
|
49
|
+
// Only main grids (without form grids on new pages)
|
|
50
|
+
var numberOfRows = Math.max(Math.floor(gridHeight / rowHeight - 2), GRID_MIN_ROWS);
|
|
51
|
+
numberOfRows && ((_a = gridActions.setRowsPerPage) === null || _a === void 0 ? void 0 : _a.call(gridActions, numberOfRows));
|
|
52
|
+
}
|
|
53
|
+
}, [gridHeight, gridActions, queryRowsParam]);
|
|
54
|
+
var modifiedPassDownProps = useEditReadAsColumn(passDownProps);
|
|
55
|
+
var filters = useMemo(function () { return getFilters(optimizeFilters); }, [optimizeFilters]);
|
|
56
|
+
var columns = modifiedPassDownProps.columnsDefinitions;
|
|
57
|
+
var _c = useModal(), openManageColumnForm = _c.onOpen, manageColumnFormVisible = _c.isOpen, onClose = _c.onClose;
|
|
58
|
+
var _d = useManageColumn({
|
|
59
|
+
columns: columns,
|
|
60
|
+
gridActions: gridActions,
|
|
61
|
+
gridSelectors: gridSelectors,
|
|
62
|
+
onClose: onClose,
|
|
63
|
+
}), columnsConfigValues = _d.columnsConfigValues, setColumnsConfigOptions = _d.setColumnsConfigOptions, onConfirmForm = _d.onConfirmForm, resetColumnConfig = _d.resetColumnConfig;
|
|
64
|
+
return (_jsxs(ContentContainer, { children: [_jsxs(CommonGridWrap, { children: [_jsx(HidePrint, { children: _jsxs(StyledButtonStrip, { className: "buttonsStrip", children: [!hideControlButtons && (_jsx(ControlButtons, { extraControlButtons: extraControlButtons, gridActions: gridActions, gridSelectors: gridSelectors, eshopSelect: eshopSelect })), _jsx(StyledColumnButton, { type: "button", sizing: "iconLg", appearance: "ghost", icon: _jsx(Settings2, {}), onClick: openManageColumnForm, children: _jsx(H6, { variant: "semiBold", children: _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }) }) })] }) }), _jsx(CommonGridWithStyles, __assign({}, passDownProps, modifiedPassDownProps, { filters: filters, gridRef: gridRef, height: gridHeight, floatingButtonProps: floatingButtonProps, hasColouredRows: true }))] }), _jsx(HidePrint, { children: _jsxs(BottomWrapper, { ref: paginationRef, isFixed: !!gridHeight, children: [processCheckedValues && (_jsx(ActionHead, { rowsData: rowsData, onBatchAction: onBatchAction, gridActions: gridActions, gridSelectors: gridSelectors, actionColumn: actionColumnDefinition, processCheckedValues: processCheckedValues, processCheckedValuesTitle: processCheckedValuesTitle })), _jsxs(x.div, { display: "flex", justifyContent: "center", alignItems: "center", className: "paginatorWrapper", w: "100%", h: window.innerWidth > 1204 ? '60px' : '32px', children: [_jsx(Pagination, { page: gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.page, itemCount: passDownProps === null || passDownProps === void 0 ? void 0 : passDownProps.totalRowsCount, itemPerPage: (gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.rowsPerPage) || 10, onPageChange: gridActions === null || gridActions === void 0 ? void 0 : gridActions.setPage, customPaginationHandler: customPaginationHandler }), _jsx(TablePagination, { gridActions: gridActions, gridSelectors: gridSelectors, customPaginationHandler: customPaginationHandler })] })] }) }), manageColumnFormVisible && (_jsx(Modal, { title: _jsx(Trans, { id: "manageColumn.title", message: "Manage columns" }), onClose: onClose, onCancel: onClose, onExtraAction: resetColumnConfig, onConfirm: onConfirmForm, width: "auto", minWidth: "350px", hasFooter: true, extraActionLabel: _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), cancelLabel: _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), confirmLabel: _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), children: _jsx(ManageColumnForm, { columns: columns, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions }) }))] }));
|
|
65
|
+
};
|
|
66
|
+
export default StyledCommonGrid;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ExtraControlButton } from './types';
|
|
2
|
+
export declare const getCreateButton: (onCreate: () => void, canCreate: boolean, disabled?: boolean) => ExtraControlButton;
|
|
3
|
+
export declare const getImportButton: (onImport: () => void, canImport: boolean, disabled?: boolean) => ExtraControlButton;
|
|
4
|
+
export declare const getMoreButton: (onExport: () => void, onImport?: () => void, canImport?: boolean) => ExtraControlButton;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Trans } from '@lingui/react';
|
|
3
|
+
import ButtonMore from './components/ButtonMore/ButtonMore';
|
|
4
|
+
export var getCreateButton = function (onCreate, canCreate, disabled) { return ({
|
|
5
|
+
label: _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }),
|
|
6
|
+
style: 'primary',
|
|
7
|
+
onClick: onCreate,
|
|
8
|
+
hide: !canCreate,
|
|
9
|
+
disabled: disabled,
|
|
10
|
+
}); };
|
|
11
|
+
export var getImportButton = function (onImport, canImport, disabled) { return ({
|
|
12
|
+
label: _jsx(Trans, { id: "form.buttonImport", message: "Import" }),
|
|
13
|
+
onClick: onImport,
|
|
14
|
+
hide: !canImport,
|
|
15
|
+
disabled: disabled,
|
|
16
|
+
}); };
|
|
17
|
+
export var getMoreButton = function (onExport, onImport, canImport) {
|
|
18
|
+
var items = [];
|
|
19
|
+
if (onImport && canImport) {
|
|
20
|
+
items.push({
|
|
21
|
+
title: _jsx(Trans, { id: "form.buttonImport", message: "Import" }),
|
|
22
|
+
onClick: onImport,
|
|
23
|
+
link: '#',
|
|
24
|
+
name: 'moreActionImportBtn',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
items.push({
|
|
28
|
+
title: _jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" }),
|
|
29
|
+
onClick: onExport,
|
|
30
|
+
link: '#',
|
|
31
|
+
name: 'moreActionExportBtn',
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
node: _jsx(ButtonMore, { items: items }),
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GridActionsType, GridSelectorsType, OnBatchActionFn, RowProps, ActionColumn } from '../../types';
|
|
2
|
+
type Props = {
|
|
3
|
+
gridActions: GridActionsType;
|
|
4
|
+
gridSelectors: GridSelectorsType;
|
|
5
|
+
actionColumn?: ActionColumn;
|
|
6
|
+
onBatchAction?: OnBatchActionFn;
|
|
7
|
+
rowsData: RowProps[];
|
|
8
|
+
processCheckedValues?: () => void;
|
|
9
|
+
processCheckedValuesTitle?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const ActionHead: ({ gridActions, gridSelectors, actionColumn, onBatchAction, rowsData, processCheckedValues, processCheckedValuesTitle, }: Props) => JSX.Element;
|
|
12
|
+
export default ActionHead;
|
|
@@ -0,0 +1,50 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useCallback, useMemo } from 'react';
|
|
7
|
+
import styled from '@xstyled/styled-components';
|
|
8
|
+
import { Trans } from '@lingui/react';
|
|
9
|
+
import { Button } from '../../../../Elements/Button';
|
|
10
|
+
import ButtonMore from '../ButtonMore/ButtonMore';
|
|
11
|
+
import { i18n } from '@lingui/core';
|
|
12
|
+
import { useToggleAllCheckbox } from '../../hooks/useToggleAllCheckbox';
|
|
13
|
+
import { useGridActionTrigger } from '../../hooks/useGridActionTrigger';
|
|
14
|
+
var Wrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n margin-right: 2;\n gap: 24px;\n background-color: red;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n width: 100%;\n margin-right: 2;\n gap: 24px;\n background-color: red;\n position: relative;\n"])));
|
|
15
|
+
var ActionsWrap = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n bottom: 32px;\n left: 50%;\n transform: translate(-50%);\n width: 596px;\n padding: 12px 24px;\n border-radius: 10px;\n background-color: #fff;\n box-shadow: dropShadow;\n z-index: 2;\n"], ["\n position: absolute;\n bottom: 32px;\n left: 50%;\n transform: translate(-50%);\n width: 596px;\n padding: 12px 24px;\n border-radius: 10px;\n background-color: #fff;\n box-shadow: dropShadow;\n z-index: 2;\n"])));
|
|
16
|
+
var StyledText = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 18px;\n color: blue2;\n font-weight: 600;\n"], ["\n font-size: 14px;\n line-height: 18px;\n color: blue2;\n font-weight: 600;\n"])));
|
|
17
|
+
var ContentWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
18
|
+
var ButtonsWrap = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: 10px;\n\n & > * {\n margin-left: 10px;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-left: 10px;\n\n & > * {\n margin-left: 10px;\n }\n"])));
|
|
19
|
+
var ActionHead = function (_a) {
|
|
20
|
+
var _b;
|
|
21
|
+
var gridActions = _a.gridActions, gridSelectors = _a.gridSelectors, actionColumn = _a.actionColumn, onBatchAction = _a.onBatchAction, rowsData = _a.rowsData, processCheckedValues = _a.processCheckedValues, processCheckedValuesTitle = _a.processCheckedValuesTitle;
|
|
22
|
+
var handleUxChange = (gridActions || {}).handleUxChange;
|
|
23
|
+
var _c = (gridSelectors || {}).uxState, uxState = _c === void 0 ? {} : _c;
|
|
24
|
+
var _d = useToggleAllCheckbox(rowsData, uxState, handleUxChange), checked = _d[0], toggleCheckbox = _d[1];
|
|
25
|
+
var _e = useGridActionTrigger(rowsData, uxState, actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions, onBatchAction), enabledActions = _e[0], onSubmit = _e[1];
|
|
26
|
+
var checkedRowsCount = Object.keys((uxState === null || uxState === void 0 ? void 0 : uxState.checkedRows) || []).length;
|
|
27
|
+
var checkAll = useCallback(function () {
|
|
28
|
+
if (!checked) {
|
|
29
|
+
toggleCheckbox();
|
|
30
|
+
}
|
|
31
|
+
}, [checked, toggleCheckbox]);
|
|
32
|
+
var actionsOptions = useMemo(function () {
|
|
33
|
+
var _a;
|
|
34
|
+
if ((_a = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
35
|
+
return actionColumn.actionOptions.map(function (option) { return ({
|
|
36
|
+
title: option.label,
|
|
37
|
+
onClick: function () { return onSubmit(option.value); },
|
|
38
|
+
link: '#',
|
|
39
|
+
}); });
|
|
40
|
+
}
|
|
41
|
+
return [];
|
|
42
|
+
}, [actionColumn, onSubmit]);
|
|
43
|
+
return (_jsx(Wrap, { children: checkedRowsCount > 0 && (_jsx(ActionsWrap, { children: _jsxs(ContentWrap, { children: [_jsx(StyledText, { children: i18n._({
|
|
44
|
+
id: 'dataGrid.checkedRowsCount',
|
|
45
|
+
message: "Selected {checkedRowsCount} items",
|
|
46
|
+
values: { checkedRowsCount: checkedRowsCount },
|
|
47
|
+
}) }), _jsxs(ButtonsWrap, { children: [_jsx(Button, { type: "button", onClick: checkAll, appearance: "secondaryLg", "data-cy": "checkAllBtn", disabled: checked, children: _jsx(Trans, { id: "dataGrid.checkAll", message: "Check all" }) }), processCheckedValues && (_jsx(Button, { type: "button", onClick: processCheckedValues, appearance: "primary", "data-cy": "exportBtn", disabled: !rowsData.length, children: processCheckedValuesTitle ? (processCheckedValuesTitle) : (_jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" })) })), ((_b = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _b === void 0 ? void 0 : _b.length) && (_jsx(ButtonMore, { items: actionsOptions, disabled: !enabledActions.length || !rowsData.length, dropdownPosition: "top" }))] })] }) })) }));
|
|
48
|
+
};
|
|
49
|
+
export default ActionHead;
|
|
50
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
type ItemType = {
|
|
3
|
+
title: string | JSX.Element;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
link: string;
|
|
6
|
+
};
|
|
7
|
+
type DropdownMenuProps = {
|
|
8
|
+
items: ItemType[];
|
|
9
|
+
};
|
|
10
|
+
declare const ActionDropdownMenu: FC<DropdownMenuProps>;
|
|
11
|
+
export default ActionDropdownMenu;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 { th } from '@xstyled/system';
|
|
8
|
+
var StyledDropdownWrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n left: 0;\n top: 3px;\n display: flex;\n flex-direction: column;\n padding: 2;\n width: 100%;\n background-color: ", ";\n box-shadow: ", ";\n min-width: 8.9rem;\n font-size: 12px;\n font-weight: normal;\n border-radius: 10px;\n z-index: 1;\n"], ["\n position: relative;\n left: 0;\n top: 3px;\n display: flex;\n flex-direction: column;\n padding: 2;\n width: 100%;\n background-color: ", ";\n box-shadow: ", ";\n min-width: 8.9rem;\n font-size: 12px;\n font-weight: normal;\n border-radius: 10px;\n z-index: 1;\n"])), th.color('white'), th.shadow('dropShadow'));
|
|
9
|
+
var StyledDropdownItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 2 2;\n border-radius: 6px;\n cursor: pointer;\n &:hover {\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n }\n"], ["\n padding: 2 2;\n border-radius: 6px;\n cursor: pointer;\n &:hover {\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n }\n"])), th.color('bgLightGray1'), th.color('typoPrimary'));
|
|
10
|
+
var ActionDropdownMenu = function (_a) {
|
|
11
|
+
var items = _a.items;
|
|
12
|
+
return (_jsx(StyledDropdownWrap, { children: items.map(function (item, index) {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_jsx(StyledDropdownItem, { onClick: (_a = item.onClick) !== null && _a !== void 0 ? _a : undefined, children: item.title }, index));
|
|
15
|
+
}) }));
|
|
16
|
+
};
|
|
17
|
+
export default ActionDropdownMenu;
|
|
18
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Item = {
|
|
3
|
+
label: string | JSX.Element;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
type DropdownSelectProps = {
|
|
7
|
+
options: Item[];
|
|
8
|
+
onSelect: (value: Item['value']) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ options, onSelect, disabled }: DropdownSelectProps) => JSX.Element>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
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, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
|
+
import React, { memo, useRef } from 'react';
|
|
7
|
+
import styled from '@xstyled/styled-components';
|
|
8
|
+
import { th } from '@xstyled/system';
|
|
9
|
+
import { Trans } from '@lingui/react';
|
|
10
|
+
import ActionDropdownMenu from './ActionDropdownMenu';
|
|
11
|
+
import Popover from '../../../../Popover';
|
|
12
|
+
import Icon from '../../../../../Elements/Icon/Icon';
|
|
13
|
+
var Content = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n padding: 1 2;\n min-width: 9rem;\n height: 28px;\n background-color: ", ";\n color: ", ";\n border: slim;\n border-color: ", ";\n font-size: 12px;\n font-weight: 600;\n border-radius: 6px;\n cursor: ", ";\n transition: 0.2s;\n &:not(:disabled):hover {\n color: ", ";\n border-color: ", ";\n }\n p {\n margin: 0;\n margin-right: auto;\n padding-right: 36px;\n }\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n padding: 1 2;\n min-width: 9rem;\n height: 28px;\n background-color: ", ";\n color: ", ";\n border: slim;\n border-color: ", ";\n font-size: 12px;\n font-weight: 600;\n border-radius: 6px;\n cursor: ", ";\n transition: 0.2s;\n &:not(:disabled):hover {\n color: ", ";\n border-color: ", ";\n }\n p {\n margin: 0;\n margin-right: auto;\n padding-right: 36px;\n }\n"])), th.color('white'), function (_a) {
|
|
14
|
+
var $isDisabled = _a.$isDisabled;
|
|
15
|
+
return ($isDisabled ? th.color('lightGray7') : th.color('lightGray5'));
|
|
16
|
+
}, function (_a) {
|
|
17
|
+
var $isDisabled = _a.$isDisabled, $isOpened = _a.$isOpened;
|
|
18
|
+
return $isDisabled ? th.color('lightGray7') : $isOpened ? th.color('blue2') : th.color('lightGray5');
|
|
19
|
+
}, function (_a) {
|
|
20
|
+
var $isDisabled = _a.$isDisabled;
|
|
21
|
+
return ($isDisabled ? 'not-allowed' : 'pointer');
|
|
22
|
+
}, th.color('gray1'), th.color('gray1'));
|
|
23
|
+
var IconWrap = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n font-size: 0.8rem;\n font-weight: 1000;\n transform: rotate(", ");\n"], ["\n color: ", ";\n font-size: 0.8rem;\n font-weight: 1000;\n transform: rotate(", ");\n"])), function (_a) {
|
|
24
|
+
var $isDisabled = _a.$isDisabled, $isOpened = _a.$isOpened;
|
|
25
|
+
return $isDisabled ? th.color('lightGray6') : $isOpened ? th.color('blue2') : th.color('gray1');
|
|
26
|
+
}, function (_a) {
|
|
27
|
+
var $isOpened = _a.$isOpened;
|
|
28
|
+
return ($isOpened ? '180deg' : 0);
|
|
29
|
+
});
|
|
30
|
+
var ActionDropdownSelect = function (_a) {
|
|
31
|
+
var options = _a.options, onSelect = _a.onSelect, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
32
|
+
var _c = React.useState(false), showDropdownMenu = _c[0], setShowDropdownMenu = _c[1];
|
|
33
|
+
var toggleDropdownMenu = React.useCallback(function () {
|
|
34
|
+
setShowDropdownMenu(function (prev) { return !prev; });
|
|
35
|
+
}, []);
|
|
36
|
+
var handleSelectItem = React.useCallback(function (item) {
|
|
37
|
+
setShowDropdownMenu(false);
|
|
38
|
+
onSelect(item.value);
|
|
39
|
+
}, [onSelect]);
|
|
40
|
+
var items = options.map(function (item) { return ({ title: item.label, onClick: function () { return handleSelectItem(item); }, link: '#' }); });
|
|
41
|
+
var ref = useRef(null);
|
|
42
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Content, { "$isDisabled": disabled, "$isOpened": showDropdownMenu, onClick: toggleDropdownMenu, ref: ref, children: [_jsx("p", { children: _jsx(Trans, { id: "dataGrid.buttonActions", message: "Actions" }) }), _jsx(IconWrap, { "$isDisabled": disabled, "$isOpened": showDropdownMenu, children: _jsx(Icon, { icon: "goDown" }) })] }), showDropdownMenu && !disabled && (items === null || items === void 0 ? void 0 : items.length) > 0 && (_jsx(Popover, { parentRef: ref, onClose: toggleDropdownMenu, placement: "bottom-start", children: _jsx(ActionDropdownMenu, { items: items }) }))] }));
|
|
43
|
+
};
|
|
44
|
+
export default memo(ActionDropdownSelect);
|
|
45
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { useMemo } from 'react';
|
|
25
|
+
import GridSelect from '../GridSelect';
|
|
26
|
+
import { i18n } from '@lingui/core';
|
|
27
|
+
var getFlagOptions = function () { return [
|
|
28
|
+
{ value: '', label: i18n._({ id: 'dataGrid.columnActive.filterOptions.all', message: 'All' }) },
|
|
29
|
+
{ value: '1', label: i18n._({ id: 'dataGrid.columnActive.filterOptions.yes', message: 'Yes' }) },
|
|
30
|
+
{ value: '0', label: i18n._({ id: 'dataGrid.columnActive.filterOptions.no', message: 'No' }) },
|
|
31
|
+
]; };
|
|
32
|
+
var SelectFilter = function (_a) {
|
|
33
|
+
var restProps = __rest(_a, []);
|
|
34
|
+
var options = useMemo(function () { return getFlagOptions(); }, []);
|
|
35
|
+
return _jsx(GridSelect, __assign({ options: options }, restProps));
|
|
36
|
+
};
|
|
37
|
+
export default SelectFilter;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ItemType = {
|
|
3
|
+
title: string | React.ReactElement;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
link?: string;
|
|
6
|
+
};
|
|
7
|
+
export type Props = {
|
|
8
|
+
items: ItemType[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
dropdownPosition?: 'top' | 'bottom';
|
|
11
|
+
};
|
|
12
|
+
declare const ButtonMore: ({ items, disabled, dropdownPosition }: Props) => JSX.Element;
|
|
13
|
+
export default ButtonMore;
|