@mailstep/design-system 0.8.52 → 0.9.1
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 +22 -6
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +1 -1
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +1 -1
- package/ui/Blocks/Header/components/UserMenu/index.js +1 -1
- package/ui/Blocks/Header/styles.js +1 -1
- package/ui/Elements/Avatar/Avatar.js +1 -1
- package/ui/Elements/Avatar/styles.js +1 -1
- package/ui/Elements/Button/styles.js +1 -1
- package/ui/Modules/Dashboard/Hoc/LoadingBoundary.d.ts +8 -0
- package/ui/Modules/Dashboard/Hoc/LoadingBoundary.js +11 -0
- package/ui/Modules/Dashboard/Hoc/index.d.ts +3 -0
- package/ui/Modules/Dashboard/Hoc/index.js +4 -0
- package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.d.ts +4 -0
- package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.js +14 -0
- package/ui/Modules/Dashboard/Hoc/withConfig.d.ts +7 -0
- package/ui/Modules/Dashboard/Hoc/withConfig.js +22 -0
- package/ui/Modules/Dashboard/Hoc/withFetch.d.ts +26 -0
- package/ui/Modules/Dashboard/Hoc/withFetch.js +50 -0
- package/ui/Modules/Dashboard/Hoc/withProps.d.ts +4 -0
- package/ui/Modules/Dashboard/Hoc/withProps.js +25 -0
- package/ui/Modules/Dashboard/assets/BarChartPreview.png +0 -0
- package/ui/Modules/Dashboard/assets/ColorBoxPreview.png +0 -0
- package/ui/Modules/Dashboard/assets/HorizontalBarPreview.png +0 -0
- package/ui/Modules/Dashboard/assets/NumberBoxPreview.png +0 -0
- package/ui/Modules/Dashboard/assets/PieChartPreview.png +0 -0
- package/ui/Modules/Dashboard/assets/TablePreview.png +0 -0
- package/ui/Modules/Dashboard/assets/TextBoxPreview.png +0 -0
- package/ui/Modules/Dashboard/assets/move.svg +18 -0
- package/ui/Modules/Dashboard/components/Config/MultiConfig.d.ts +6 -0
- package/ui/Modules/Dashboard/components/Config/MultiConfig.js +51 -0
- package/ui/Modules/Dashboard/components/Config/components/CommonConfig.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Config/components/CommonConfig.js +20 -0
- package/ui/Modules/Dashboard/components/Config/components/InputConfig.d.ts +5 -0
- package/ui/Modules/Dashboard/components/Config/components/InputConfig.js +104 -0
- package/ui/Modules/Dashboard/components/Config/types.d.ts +1 -0
- package/ui/Modules/Dashboard/components/Config/types.js +1 -0
- package/ui/Modules/Dashboard/components/Dashboard/Dashboard.d.ts +9 -0
- package/ui/Modules/Dashboard/components/Dashboard/Dashboard.js +16 -0
- package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.js +31 -0
- package/ui/Modules/Dashboard/components/Dashboard/components/Body.d.ts +7 -0
- package/ui/Modules/Dashboard/components/Dashboard/components/Body.js +7 -0
- package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.d.ts +6 -0
- package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.js +25 -0
- package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.d.ts +13 -0
- package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.js +19 -0
- package/ui/Modules/Dashboard/components/Dashboard/dashboard2.css +124 -0
- package/ui/Modules/Dashboard/components/Dashboard/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Dashboard/index.js +5 -0
- package/ui/Modules/Dashboard/components/Header/Header.d.ts +8 -0
- package/ui/Modules/Dashboard/components/Header/Header.js +9 -0
- package/ui/Modules/Dashboard/components/Header/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Header/index.js +5 -0
- package/ui/Modules/Dashboard/components/Layout/Layout.d.ts +18 -0
- package/ui/Modules/Dashboard/components/Layout/Layout.js +39 -0
- package/ui/Modules/Dashboard/components/Layout/LayoutContainer.d.ts +7 -0
- package/ui/Modules/Dashboard/components/Layout/LayoutContainer.js +40 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/Item.d.ts +18 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/Item.js +79 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.d.ts +11 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.js +64 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.d.ts +14 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.js +28 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Layout/components/Item/index.js +5 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.d.ts +13 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.js +18 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.d.ts +8 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.js +31 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.js +5 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.d.ts +12 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.js +27 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.js +5 -0
- package/ui/Modules/Dashboard/components/Layout/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Layout/index.js +5 -0
- package/ui/Modules/Dashboard/components/NoData/NoData.d.ts +2 -0
- package/ui/Modules/Dashboard/components/NoData/NoData.js +14 -0
- package/ui/Modules/Dashboard/components/NoData/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/NoData/index.js +5 -0
- package/ui/Modules/Dashboard/components/Picker/Picker.d.ts +8 -0
- package/ui/Modules/Dashboard/components/Picker/Picker.js +38 -0
- package/ui/Modules/Dashboard/components/Picker/PickerContainer.d.ts +7 -0
- package/ui/Modules/Dashboard/components/Picker/PickerContainer.js +38 -0
- package/ui/Modules/Dashboard/components/Picker/components/PickerItem.d.ts +8 -0
- package/ui/Modules/Dashboard/components/Picker/components/PickerItem.js +25 -0
- package/ui/Modules/Dashboard/components/Picker/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Picker/index.js +5 -0
- package/ui/Modules/Dashboard/components/Text/Text.d.ts +7 -0
- package/ui/Modules/Dashboard/components/Text/Text.js +14 -0
- package/ui/Modules/Dashboard/components/Text/index.d.ts +1 -0
- package/ui/Modules/Dashboard/components/Text/index.js +2 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.d.ts +19 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.js +52 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.d.ts +1 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.js +5 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/index.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/index.js +6 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.d.ts +12 -0
- package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.js +39 -0
- package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.d.ts +7 -0
- package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.js +21 -0
- package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.d.ts +3 -0
- package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.js +23 -0
- package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.js +6 -0
- package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.d.ts +7 -0
- package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.js +10 -0
- package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.js +5 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.d.ts +1 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.js +5 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.js +38 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.d.ts +8 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.js +14 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.d.ts +7 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.js +14 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.js +6 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.d.ts +2 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.js +33 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.d.ts +18 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.js +58 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.d.ts +13 -0
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.js +1 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.js +38 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.d.ts +5 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.js +38 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.js +6 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.js +25 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.d.ts +1 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.js +5 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.d.ts +21 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.js +59 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.d.ts +10 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.js +24 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/index.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/index.js +6 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.d.ts +14 -0
- package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.js +47 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/Config.d.ts +9 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/Config.js +87 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/Table.d.ts +4 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/Table.js +93 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.d.ts +8 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.js +19 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.d.ts +9 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.js +31 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.d.ts +8 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.js +15 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.d.ts +6 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.js +33 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.d.ts +10 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.js +27 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.d.ts +17 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.js +27 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.d.ts +10 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.js +31 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/index.d.ts +5 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/index.js +7 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.d.ts +73 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.js +211 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/styles.d.ts +23 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/styles.js +69 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/types.d.ts +52 -0
- package/ui/Modules/Dashboard/components/Widgets/Table/types.js +1 -0
- package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.d.ts +10 -0
- package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.js +12 -0
- package/ui/Modules/Dashboard/components/Widgets/TextBox/index.d.ts +3 -0
- package/ui/Modules/Dashboard/components/Widgets/TextBox/index.js +5 -0
- package/ui/Modules/Dashboard/components/Widgets/index.d.ts +11 -0
- package/ui/Modules/Dashboard/components/Widgets/index.js +108 -0
- package/ui/Modules/Dashboard/components/Widgets/utils/generic.d.ts +5 -0
- package/ui/Modules/Dashboard/components/Widgets/utils/generic.js +20 -0
- package/ui/Modules/Dashboard/components/Widgets/utils/helpers.d.ts +3 -0
- package/ui/Modules/Dashboard/components/Widgets/utils/helpers.js +25 -0
- package/ui/Modules/Dashboard/components/Widgets/utils/legends.d.ts +20 -0
- package/ui/Modules/Dashboard/components/Widgets/utils/legends.js +57 -0
- package/ui/Modules/Dashboard/context/ComponentContext.d.ts +5 -0
- package/ui/Modules/Dashboard/context/ComponentContext.js +15 -0
- package/ui/Modules/Dashboard/context/LangContext.d.ts +3 -0
- package/ui/Modules/Dashboard/context/LangContext.js +5 -0
- package/ui/Modules/Dashboard/errors/ErrorMessage.d.ts +7 -0
- package/ui/Modules/Dashboard/errors/ErrorMessage.js +12 -0
- package/ui/Modules/Dashboard/errors/WidgetError.d.ts +5 -0
- package/ui/Modules/Dashboard/errors/WidgetError.js +10 -0
- package/ui/Modules/Dashboard/hooks/usePrevious.d.ts +5 -0
- package/ui/Modules/Dashboard/hooks/usePrevious.js +14 -0
- package/ui/Modules/Dashboard/hooks/useRefWithCallback.d.ts +2 -0
- package/ui/Modules/Dashboard/hooks/useRefWithCallback.js +16 -0
- package/ui/Modules/Dashboard/hooks/useResize.d.ts +6 -0
- package/ui/Modules/Dashboard/hooks/useResize.js +19 -0
- package/ui/Modules/Dashboard/index.d.ts +7 -0
- package/ui/Modules/Dashboard/index.js +12 -0
- package/ui/Modules/Dashboard/locale/cs.d.ts +24 -0
- package/ui/Modules/Dashboard/locale/cs.js +26 -0
- package/ui/Modules/Dashboard/locale/en.d.ts +24 -0
- package/ui/Modules/Dashboard/locale/en.js +26 -0
- package/ui/Modules/Dashboard/locale/index.d.ts +4 -0
- package/ui/Modules/Dashboard/locale/index.js +13 -0
- package/ui/Modules/Dashboard/locale/it.d.ts +24 -0
- package/ui/Modules/Dashboard/locale/it.js +26 -0
- package/ui/Modules/Dashboard/locale/uk.d.ts +24 -0
- package/ui/Modules/Dashboard/locale/uk.js +26 -0
- package/ui/Modules/Dashboard/store/reducers/index.d.ts +9 -0
- package/ui/Modules/Dashboard/store/reducers/index.js +6 -0
- package/ui/Modules/Dashboard/store/reducers/widgetListReducer.d.ts +41 -0
- package/ui/Modules/Dashboard/store/reducers/widgetListReducer.js +76 -0
- package/ui/Modules/Dashboard/stories/storybook.sample.d.ts +50 -0
- package/ui/Modules/Dashboard/stories/storybook.sample.js +237 -0
- package/ui/Modules/Dashboard/styles.d.ts +63 -0
- package/ui/Modules/Dashboard/styles.js +358 -0
- package/ui/Modules/Dashboard/types.d.ts +185 -0
- package/ui/Modules/Dashboard/types.js +1 -0
- package/ui/Modules/index.d.ts +1 -0
- package/ui/Modules/index.js +8 -0
- package/ui/ThemeProvider/themes/index.d.ts +224 -0
- package/ui/ThemeProvider/themes/index.js +3 -1
- package/ui/ThemeProvider/themes/mailwiseDark.d.ts +225 -0
- package/ui/ThemeProvider/themes/mailwiseDark.js +16 -0
- package/ui/ThemeProvider/types.d.ts +1 -1
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +0 -41
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +0 -6
- package/ui/Blocks/CommonGrid/storybook/stories/gridStates.stories.d.ts +0 -8
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +0 -10
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +0 -10
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +0 -6
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +0 -10
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +0 -14
- package/ui/Blocks/CommonGrid/storybook/stories/withQuickFilter.stories.d.ts +0 -11
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.d.ts +0 -13
- package/ui/Blocks/Header/stories/Header.stories.d.ts +0 -52
- package/ui/Blocks/HidePrint/stories/HidePrint.stories.d.ts +0 -12
- package/ui/Blocks/ImageList/stories/ImageList.stories.d.ts +0 -14
- package/ui/Blocks/LanguageSwitch/stories/LanguageSwith.stories.d.ts +0 -10
- package/ui/Blocks/LightBox/stories/LightBox.stories.d.ts +0 -10
- package/ui/Blocks/LoginPage/stories/LoginPage.stories.d.ts +0 -10
- package/ui/Blocks/Modal/stories/Modal.stories.d.ts +0 -28
- package/ui/Blocks/Popover/stories/Popover.stories.d.ts +0 -16
- package/ui/Blocks/Scheduler/stories/Scheduler.stories.d.ts +0 -7
- package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +0 -11
- package/ui/Blocks/Stepper/stories/Stepper.stories.d.ts +0 -9
- package/ui/Blocks/Table/stories/Table.stories.d.ts +0 -12
- package/ui/Blocks/Tabs/stories/Tabs.stories.d.ts +0 -12
- package/ui/Elements/Alert/stories/Alert.stories.d.ts +0 -17
- package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +0 -10
- package/ui/Elements/Avatar/stories/Avatar.stories.d.ts +0 -11
- package/ui/Elements/Badge/stories/Badge.stories.d.ts +0 -12
- package/ui/Elements/BarChartSymbol/stories/BarChartSymbol.stories.d.ts +0 -12
- package/ui/Elements/BorderedBox/stories/BorderedBox.stories.d.ts +0 -10
- package/ui/Elements/Button/stories/Button.stories.d.ts +0 -28
- package/ui/Elements/Card/stories/Card.stories.d.ts +0 -13
- package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +0 -16
- package/ui/Elements/DatePicker/stories/DatePicker.stories.d.ts +0 -11
- package/ui/Elements/Dropdown/stories/Dropdown.stories.d.ts +0 -10
- package/ui/Elements/DropdownMenu/stories/DropdownMenu.stories.d.ts +0 -10
- package/ui/Elements/DropdownSelect/stories/DropdownSelect.stories.d.ts +0 -22
- package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.d.ts +0 -11
- package/ui/Elements/HighlightBox/stories/HighlightBox.stories.d.ts +0 -31
- package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +0 -28
- package/ui/Elements/Icon/stories/Icon.stories.d.ts +0 -15
- package/ui/Elements/Image/stories/Image.stories.d.ts +0 -13
- package/ui/Elements/Label/stories/Label.stories.d.ts +0 -13
- package/ui/Elements/Line/stories/Line.stories.d.ts +0 -16
- package/ui/Elements/Link/stories/Link.stories.d.ts +0 -30
- package/ui/Elements/Logo/stories/Logo.stories.d.ts +0 -37
- package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +0 -13
- package/ui/Elements/Portal/stories/Portal.stories.d.ts +0 -11
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +0 -18
- package/ui/Elements/Select/stories/Select.stories.d.ts +0 -9
- package/ui/Elements/SimpleLink/stories/SimpleLink.stories.d.ts +0 -13
- package/ui/Elements/SingleSelect/stories/SingleSelect.stories.d.ts +0 -10
- package/ui/Elements/SpaceAround/stories/SpaceAround.stories.d.ts +0 -11
- package/ui/Elements/Spinner/stories/Spinner.stories.d.ts +0 -19
- package/ui/Elements/Table/stories/Table.stories.d.ts +0 -8
- package/ui/Elements/Tag/stories/Tag.stories.d.ts +0 -19
- package/ui/Elements/Text/stories/Text.stories.d.ts +0 -15
- package/ui/Elements/Toast/stories/Toast.stories.d.ts +0 -13
- package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +0 -16
- package/ui/Elements/Tooltip/stories/Tooltip.stories.d.ts +0 -10
- package/ui/Elements/Typography/stories/Typography.stories.d.ts +0 -20
- package/ui/Forms/Checkbox/stories/Checkbox.stories.d.ts +0 -13
- package/ui/Forms/Input/stories/Input.stories.d.ts +0 -18
- package/ui/Forms/RadioButton/stories/RadioButton.stories.d.ts +0 -13
- package/ui/utils/KeyPress/KeyPress.stories.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -39,14 +39,20 @@
|
|
|
39
39
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
40
40
|
"@lingui/core": "^5.0.0",
|
|
41
41
|
"@lingui/react": "^5.0.0",
|
|
42
|
+
"@nivo/bar": "^0.79.1",
|
|
43
|
+
"@nivo/colors": "^0.73.0",
|
|
44
|
+
"@nivo/core": "^0.73.0",
|
|
45
|
+
"@nivo/legends": "^0.73.0",
|
|
46
|
+
"@nivo/pie": "^0.73.0",
|
|
42
47
|
"@popperjs/core": "^2.11.8",
|
|
43
48
|
"@storybook/addon-designs": "^11.1.3",
|
|
44
|
-
"@storybook/addon-docs": "10.4.
|
|
45
|
-
"@storybook/addon-links": "10.4.
|
|
46
|
-
"@storybook/react-webpack5": "10.4.
|
|
49
|
+
"@storybook/addon-docs": "10.4.6",
|
|
50
|
+
"@storybook/addon-links": "10.4.6",
|
|
51
|
+
"@storybook/react-webpack5": "10.4.6",
|
|
47
52
|
"@svgr/rollup": "^8.0.1",
|
|
48
53
|
"@swc/core": "^1.15.30",
|
|
49
54
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
55
|
+
"@tsdown/css": "^0.22.3",
|
|
50
56
|
"@types/faker": "^4.1.11",
|
|
51
57
|
"@types/lodash": "^4.17.13",
|
|
52
58
|
"@types/luxon": "^3.4.2",
|
|
@@ -54,6 +60,7 @@
|
|
|
54
60
|
"@types/react": "^19.2.2",
|
|
55
61
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
56
62
|
"@types/react-dom": "^19.2.2",
|
|
63
|
+
"@types/react-grid-layout": "^1",
|
|
57
64
|
"@types/react-helmet": "^6.1.11",
|
|
58
65
|
"@types/react-router": "^5.1.20",
|
|
59
66
|
"@types/react-router-dom": "^5.3.3",
|
|
@@ -73,7 +80,7 @@
|
|
|
73
80
|
"eslint-plugin-react": "^7.35.0",
|
|
74
81
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
75
82
|
"eslint-plugin-react-perf": "^3.3.2",
|
|
76
|
-
"eslint-plugin-storybook": "10.4.
|
|
83
|
+
"eslint-plugin-storybook": "10.4.6",
|
|
77
84
|
"faker": "^5.1.0",
|
|
78
85
|
"husky": "^9.1.7",
|
|
79
86
|
"immer": "^9.0.19",
|
|
@@ -84,11 +91,13 @@
|
|
|
84
91
|
"prettier": "2.8.8",
|
|
85
92
|
"react": "^19.2.0",
|
|
86
93
|
"react-dom": "^19.2.0",
|
|
94
|
+
"react-grid-layout": "^1.2.5",
|
|
87
95
|
"react-helmet": "^6.1.0",
|
|
88
96
|
"react-image": "^4.1.0",
|
|
89
97
|
"react-onclickoutside": "^6.13.0",
|
|
90
98
|
"react-popper": "^2.3.0",
|
|
91
99
|
"react-redux": "*",
|
|
100
|
+
"react-resizable": "^3.0.4",
|
|
92
101
|
"react-router": "^5.1.2",
|
|
93
102
|
"react-router-dom": "^5.1.2",
|
|
94
103
|
"react-script": "^2.0.5",
|
|
@@ -96,7 +105,7 @@
|
|
|
96
105
|
"react-use-draggable-scroll": "^0.4.7",
|
|
97
106
|
"redux": ">=4.0.5",
|
|
98
107
|
"reselect": "5.0.0-alpha.2",
|
|
99
|
-
"storybook": "10.4.
|
|
108
|
+
"storybook": "10.4.6",
|
|
100
109
|
"string-width": "6.1.0",
|
|
101
110
|
"styled-components": "^5.3.10",
|
|
102
111
|
"swiper": "^11.0.3",
|
|
@@ -118,6 +127,11 @@
|
|
|
118
127
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
119
128
|
"@lingui/core": "^5.0.0",
|
|
120
129
|
"@lingui/react": "^5.0.0",
|
|
130
|
+
"@nivo/bar": "^0.79.1",
|
|
131
|
+
"@nivo/colors": "^0.73.0",
|
|
132
|
+
"@nivo/core": "^0.73.0",
|
|
133
|
+
"@nivo/legends": "^0.73.0",
|
|
134
|
+
"@nivo/pie": "^0.73.0",
|
|
121
135
|
"@popperjs/core": "^2.11.8",
|
|
122
136
|
"@xstyled/styled-components": "^3.8.0",
|
|
123
137
|
"@xstyled/system": "^3.8.0",
|
|
@@ -127,11 +141,13 @@
|
|
|
127
141
|
"moment": "^2.30.1",
|
|
128
142
|
"react": "^19.2.0",
|
|
129
143
|
"react-dom": "^19.2.0",
|
|
144
|
+
"react-grid-layout": "^1.2.5",
|
|
130
145
|
"react-helmet": "^6.1.0",
|
|
131
146
|
"react-image": "^4.1.0",
|
|
132
147
|
"react-onclickoutside": "^6.13.0",
|
|
133
148
|
"react-popper": "^2.3.0",
|
|
134
149
|
"react-redux": ">=4.0.5",
|
|
150
|
+
"react-resizable": "^3.0.4",
|
|
135
151
|
"react-router": "^5.1.2",
|
|
136
152
|
"react-router-dom": "^5.1.2",
|
|
137
153
|
"react-select": "^5.10.0",
|
|
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
|
|
|
4
4
|
const useManageColumn = ({ columns, gridSelectors, gridActions, onClose }) => {
|
|
5
5
|
const { resetGrid, setColumnConfig, setColumnsOrder } = gridActions;
|
|
6
6
|
const { columnConfig, columnsOrder } = gridSelectors;
|
|
7
|
-
const initialColumnsOrder = useMemo(() => columns?.map((col) => col.name), [columns]);
|
|
7
|
+
const initialColumnsOrder = useMemo(() => columns?.map?.((col) => col.name), [columns]);
|
|
8
8
|
const columnsOrderValue = columnsOrder?.length ? columnsOrder : initialColumnsOrder;
|
|
9
9
|
const [columnsConfigOptions, setColumnsConfigOptions] = useState({ ...columnConfig ?? {} });
|
|
10
10
|
const [updatedColumnsOrder, setUpdatedColumnsOrder] = useState(columnsOrderValue);
|
|
@@ -23,7 +23,7 @@ const UserMenu = ({ user, onLogout, hasUserMenu, userMenuOverride, withInitials,
|
|
|
23
23
|
ref: parentRef,
|
|
24
24
|
children: [/* @__PURE__ */ jsx(Avatar_default, {
|
|
25
25
|
user,
|
|
26
|
-
colorFront: withInitials ?
|
|
26
|
+
colorFront: withInitials ? "#ffffff" : th.color("blue2")({ theme }),
|
|
27
27
|
colorBack: withInitials ? th.color("red1")({ theme }) : isDropdownOpen ? th.color("lightGray7")({ theme }) : th.color("neutral20")({ theme }),
|
|
28
28
|
hoverColorBack: withInitials ? "" : th.color("lightGray7")({ theme }),
|
|
29
29
|
size: 34,
|
|
@@ -32,7 +32,7 @@ const Avatar = ({ user, src, size = 34, colorFront, colorBack, className, hoverC
|
|
|
32
32
|
/* @__PURE__ */ jsxs("div", { children: [withName && user?.username, children] }),
|
|
33
33
|
withChevron && /* @__PURE__ */ jsx(Chevron, { children: /* @__PURE__ */ jsx(Icon, {
|
|
34
34
|
icon: "goDown",
|
|
35
|
-
fill: "
|
|
35
|
+
fill: "#ffffff",
|
|
36
36
|
size: 10
|
|
37
37
|
}) })
|
|
38
38
|
]
|
|
@@ -19,7 +19,7 @@ const StyledAvatarWrap = styled$1.div`
|
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
font-size: 14px;
|
|
21
21
|
white-space: nowrap;
|
|
22
|
-
color: ${(props) => props.$colorFront ? th.color(props.$colorFront) : th.color("
|
|
22
|
+
color: ${(props) => props.$colorFront ? th.color(props.$colorFront) : th.color("typoPrimary")};
|
|
23
23
|
background-color: ${(props) => props.$colorBack ? th.color(props.$colorBack) : ""};
|
|
24
24
|
width: ${(props) => `${props.size}px`};
|
|
25
25
|
height: ${(props) => `${props.size}px`};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Spinner_default from "../../../Elements/Spinner/index.js";
|
|
2
|
+
import ErrorMessage from "../errors/ErrorMessage.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region packages/ui/Modules/Dashboard/Hoc/LoadingBoundary.tsx
|
|
5
|
+
const LoadingBoundary = ({ error, isLoading, children }) => {
|
|
6
|
+
if (isLoading) return /* @__PURE__ */ jsx(Spinner_default, {});
|
|
7
|
+
if (error) return /* @__PURE__ */ jsx(ErrorMessage, { children: "An error occured while loading." });
|
|
8
|
+
return children;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { LoadingBoundary as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import dashboardReducer from "../../store/reducers/index.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Provider } from "react-redux";
|
|
5
|
+
import { combineReducers, createStore } from "redux";
|
|
6
|
+
//#region packages/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.tsx
|
|
7
|
+
const withProvider = (initialState = {}) => (Story) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(Provider, {
|
|
9
|
+
store: createStore(combineReducers({ dashboard: dashboardReducer }), initialState),
|
|
10
|
+
children: /* @__PURE__ */ jsx(Story, {})
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { withProvider as default, withProvider };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WidgetConfig, WidgetDefinition } from '../types';
|
|
2
|
+
type ConfigHOC = (config?: WidgetConfig) => (widget: WidgetDefinition) => WidgetDefinition;
|
|
3
|
+
/**
|
|
4
|
+
* Add to widget config component additional props
|
|
5
|
+
*/
|
|
6
|
+
export declare const withConfig: ConfigHOC;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/ui/Modules/Dashboard/Hoc/withConfig.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Add to widget config component additional props
|
|
6
|
+
*/
|
|
7
|
+
const withConfig = (config) => (widget) => {
|
|
8
|
+
const WithConfigComponent = (props) => {
|
|
9
|
+
if (!widget.configComponent) return null;
|
|
10
|
+
const Configcomponent = widget.configComponent;
|
|
11
|
+
return /* @__PURE__ */ jsx(Configcomponent, {
|
|
12
|
+
...props,
|
|
13
|
+
...config
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
...widget,
|
|
18
|
+
configComponent: WithConfigComponent
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { withConfig };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { WidgetConfig, WidgetDefinition } from '../types';
|
|
2
|
+
type FetchHOC = (fetch: (config?: WidgetConfig) => Promise<any>) => (widget: WidgetDefinition) => WidgetDefinition;
|
|
3
|
+
/**
|
|
4
|
+
* Replaces the origin component with an enhanced one
|
|
5
|
+
* ~ having data, loading state, fetch errors & optionally other custom props.
|
|
6
|
+
*
|
|
7
|
+
* Lifecycle:
|
|
8
|
+
* ~ Data is fetched on mount and then on every widget config change
|
|
9
|
+
*
|
|
10
|
+
* Note:
|
|
11
|
+
* Passed fetch function should return a promise
|
|
12
|
+
* ~ The data payload can either be:
|
|
13
|
+
* 1) Raw widget data - will result in a passed prop - data={data}
|
|
14
|
+
* Example:
|
|
15
|
+
* [
|
|
16
|
+
* { id: 1, label: 'Delivered', value: 206 },
|
|
17
|
+
* { id: 2, label: 'Returned', value: 64 },
|
|
18
|
+
* ]
|
|
19
|
+
*
|
|
20
|
+
* 2) Object with explicitely named data property
|
|
21
|
+
* This method allows you to pass other custom fetched props
|
|
22
|
+
* Example:
|
|
23
|
+
* { data: [YOUR_DATA], fetchedProp1: 'whatever', fetchedProp2: 23123 }
|
|
24
|
+
*/
|
|
25
|
+
export declare const withFetch: FetchHOC;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/ui/Modules/Dashboard/Hoc/withFetch.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Replaces the origin component with an enhanced one
|
|
6
|
+
* ~ having data, loading state, fetch errors & optionally other custom props.
|
|
7
|
+
*
|
|
8
|
+
* Lifecycle:
|
|
9
|
+
* ~ Data is fetched on mount and then on every widget config change
|
|
10
|
+
*
|
|
11
|
+
* Note:
|
|
12
|
+
* Passed fetch function should return a promise
|
|
13
|
+
* ~ The data payload can either be:
|
|
14
|
+
* 1) Raw widget data - will result in a passed prop - data={data}
|
|
15
|
+
* Example:
|
|
16
|
+
* [
|
|
17
|
+
* { id: 1, label: 'Delivered', value: 206 },
|
|
18
|
+
* { id: 2, label: 'Returned', value: 64 },
|
|
19
|
+
* ]
|
|
20
|
+
*
|
|
21
|
+
* 2) Object with explicitely named data property
|
|
22
|
+
* This method allows you to pass other custom fetched props
|
|
23
|
+
* Example:
|
|
24
|
+
* { data: [YOUR_DATA], fetchedProp1: 'whatever', fetchedProp2: 23123 }
|
|
25
|
+
*/
|
|
26
|
+
const withFetch = (fetch) => (widget) => {
|
|
27
|
+
const WithDataComponent = (props) => {
|
|
28
|
+
const [data, setData] = React.useState([]);
|
|
29
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
30
|
+
const [error, setError] = React.useState(false);
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
setIsLoading(true);
|
|
33
|
+
fetch(props.config).then(setData).then(() => setIsLoading(false)).catch(setError);
|
|
34
|
+
}, [JSON.stringify(props.config)]);
|
|
35
|
+
const dataProps = React.useMemo(() => data?.data ? { ...data } : { data }, [data]);
|
|
36
|
+
const Component = widget.component;
|
|
37
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
38
|
+
...props,
|
|
39
|
+
...dataProps,
|
|
40
|
+
isLoading,
|
|
41
|
+
error
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
...widget,
|
|
46
|
+
component: WithDataComponent
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { withFetch };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WidgetDefinition } from '../types';
|
|
3
|
+
export declare const withProps: (extraProps: any) => <P extends object>(Component: React.ComponentType<P>) => React.ComponentType<P>;
|
|
4
|
+
export declare const withPropsWDefinition: (extraProps: any) => (widget: WidgetDefinition) => WidgetDefinition;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/ui/Modules/Dashboard/Hoc/withProps.tsx
|
|
4
|
+
const withProps = (extraProps) => (Component) => function ComponentWithProps(props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
6
|
+
...props,
|
|
7
|
+
...extraProps
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const withPropsWDefinition = (extraProps) => (widget) => {
|
|
11
|
+
const Component = widget.component;
|
|
12
|
+
function ComponentWithProps(props) {
|
|
13
|
+
const additional = typeof extraProps === "function" ? extraProps(props) : extraProps;
|
|
14
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
15
|
+
...props,
|
|
16
|
+
...additional
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
...widget,
|
|
21
|
+
component: ComponentWithProps
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { withProps, withPropsWDefinition };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 512.006 512.006" style="enable-background:new 0 0 512.006 512.006;" xml:space="preserve">
|
|
5
|
+
<g>
|
|
6
|
+
<g>
|
|
7
|
+
<path d="M508.247,246.756l-72.457-72.465c-5.009-5.009-13.107-5.009-18.116,0c-5.009,5.009-5.009,13.107,0,18.116l50.594,50.594
|
|
8
|
+
H268.811V43.748l50.594,50.594c5.009,5.009,13.107,5.009,18.116,0c5.009-5.009,5.009-13.107,0-18.116L265.056,3.761
|
|
9
|
+
c-5.001-5.009-13.107-5.009-18.116,0l-72.457,72.457c-5.009,5.009-5.009,13.107,0,18.116c5.001,5.009,13.107,5.009,18.116,0
|
|
10
|
+
l50.594-50.594v199.27H43.744l50.594-50.594c5.009-5.009,5.009-13.107,0-18.116c-5.009-5.009-13.107-5.009-18.116,0L3.757,246.756
|
|
11
|
+
c-5.009,5.001-5.009,13.107,0,18.116l72.465,72.457c5.009,5.009,13.107,5.009,18.116,0c5.009-5.001,5.009-13.107,0-18.116
|
|
12
|
+
l-50.594-50.594h199.458v199.646l-50.594-50.594c-5.009-5.001-13.107-5.001-18.116,0c-5.009,5.009-5.009,13.107,0,18.116
|
|
13
|
+
l72.457,72.465c5,5,13.107,5,18.116,0l72.465-72.457c5.009-5.009,5.009-13.107,0-18.116c-5.009-5-13.107-5-18.116,0
|
|
14
|
+
l-50.594,50.594V268.627h199.458l-50.594,50.594c-5.009,5.009-5.009,13.107,0,18.116s13.107,5.009,18.116,0l72.465-72.457
|
|
15
|
+
C513.257,259.872,513.257,251.765,508.247,246.756z"/>
|
|
16
|
+
</g>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useText } from "../Text/Text.js";
|
|
2
|
+
import CommonConfig from "./components/CommonConfig.js";
|
|
3
|
+
import InputConfig from "./components/InputConfig.js";
|
|
4
|
+
import { useCallback, useMemo } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { omit } from "lodash";
|
|
7
|
+
//#region packages/ui/Modules/Dashboard/components/Config/MultiConfig.tsx
|
|
8
|
+
const defaultSources = [];
|
|
9
|
+
const MultiConfig = ({ onChange, config, sources = defaultSources }) => {
|
|
10
|
+
const labelSelectSource = useText("widgets.selectSource");
|
|
11
|
+
const filters = useMemo(() => sources.find((source) => source.value === config?.source), [sources, config])?.filters || [];
|
|
12
|
+
const hasFilters = filters.length !== 0;
|
|
13
|
+
const onChangeInput = useCallback((updatedConfig) => onChange(updatedConfig), [onChange]);
|
|
14
|
+
const onSourceInput = useCallback((processed) => {
|
|
15
|
+
const filterNames = filters.map((filter) => filter.name);
|
|
16
|
+
const filterLabels = filterNames.map((name) => `${name}Label`);
|
|
17
|
+
return onChange(omit(processed, [
|
|
18
|
+
...filterNames,
|
|
19
|
+
...filterLabels,
|
|
20
|
+
"sort"
|
|
21
|
+
]));
|
|
22
|
+
}, [filters, onChange]);
|
|
23
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(CommonConfig, {
|
|
25
|
+
onChange: onChangeInput,
|
|
26
|
+
config
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ jsx(InputConfig, {
|
|
29
|
+
label: labelSelectSource,
|
|
30
|
+
name: "source",
|
|
31
|
+
onChange: onSourceInput,
|
|
32
|
+
config,
|
|
33
|
+
options: sources
|
|
34
|
+
}),
|
|
35
|
+
hasFilters && filters.map((filter) => {
|
|
36
|
+
const { name, label, placeholder, input, options, isMulti } = filter;
|
|
37
|
+
return /* @__PURE__ */ jsx(InputConfig, {
|
|
38
|
+
name,
|
|
39
|
+
label,
|
|
40
|
+
placeholder,
|
|
41
|
+
input,
|
|
42
|
+
options,
|
|
43
|
+
isMulti,
|
|
44
|
+
onChange,
|
|
45
|
+
config
|
|
46
|
+
}, name);
|
|
47
|
+
})
|
|
48
|
+
] });
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { MultiConfig };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styles_default from "../../../styles.js";
|
|
2
|
+
import Text from "../../Text/Text.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region packages/ui/Modules/Dashboard/components/Config/components/CommonConfig.tsx
|
|
6
|
+
const CommonConfig = ({ onChange, config }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(styles_default.ConfigRow, { children: [/* @__PURE__ */ jsxs(styles_default.ConfigLabel, { children: [
|
|
7
|
+
/* @__PURE__ */ jsx(Text, { code: "widgets.name" }),
|
|
8
|
+
":",
|
|
9
|
+
" "
|
|
10
|
+
] }), /* @__PURE__ */ jsx(styles_default.ConfigInput, { children: /* @__PURE__ */ jsx(styles_default.Input, {
|
|
11
|
+
name: "name",
|
|
12
|
+
onChange: (e) => onChange({
|
|
13
|
+
...config,
|
|
14
|
+
[e.target.name]: e.target.value
|
|
15
|
+
}),
|
|
16
|
+
defaultValue: config?.name || "",
|
|
17
|
+
type: "text"
|
|
18
|
+
}) })] }) });
|
|
19
|
+
//#endregion
|
|
20
|
+
export { CommonConfig as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { ConfigProps, LayoutWidgetFilter } from '../../../types';
|
|
3
|
+
type InputConfigProps = ConfigProps & LayoutWidgetFilter;
|
|
4
|
+
declare const InputConfig: ({ onChange, config, label, name, input, isMulti, options, placeholder }: InputConfigProps) => JSX.Element;
|
|
5
|
+
export default InputConfig;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import Button_default from "../../../../../Elements/Button/index.js";
|
|
2
|
+
import styles_default from "../../../styles.js";
|
|
3
|
+
import { useText } from "../../Text/Text.js";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import omit from "lodash/omit";
|
|
7
|
+
//#region packages/ui/Modules/Dashboard/components/Config/components/InputConfig.tsx
|
|
8
|
+
const getSelectValue = (currentValue, targetValue, isMulti, isChecked = false) => {
|
|
9
|
+
if (isMulti) {
|
|
10
|
+
const asserted = currentValue ?? [];
|
|
11
|
+
if (isChecked) return asserted.concat(targetValue);
|
|
12
|
+
return asserted.filter((val) => val !== targetValue);
|
|
13
|
+
}
|
|
14
|
+
return targetValue;
|
|
15
|
+
};
|
|
16
|
+
const createConfigField = (fieldName, value, label) => ({
|
|
17
|
+
[fieldName]: value,
|
|
18
|
+
...label && { [`${fieldName}Label`]: label }
|
|
19
|
+
});
|
|
20
|
+
const InputConfig = ({ onChange, config, label, name, input, isMulti = false, options = [], placeholder }) => {
|
|
21
|
+
const none = useText("widgets.none");
|
|
22
|
+
const clear = useText("widgets.clear");
|
|
23
|
+
const selectAll = useText("widgets.selectAll");
|
|
24
|
+
const value = config?.[name];
|
|
25
|
+
const handleChange = useCallback((e) => {
|
|
26
|
+
const selectOption = options.find((option) => option.value === e.target.value);
|
|
27
|
+
const selectValue = getSelectValue(value, selectOption?.value || "", isMulti, e.target.checked);
|
|
28
|
+
const configField = createConfigField(name, input ? e.target.value : selectValue, input ? void 0 : selectOption?.label);
|
|
29
|
+
onChange({
|
|
30
|
+
...config,
|
|
31
|
+
...configField
|
|
32
|
+
});
|
|
33
|
+
}, [
|
|
34
|
+
name,
|
|
35
|
+
options,
|
|
36
|
+
onChange,
|
|
37
|
+
value,
|
|
38
|
+
isMulti,
|
|
39
|
+
config,
|
|
40
|
+
input
|
|
41
|
+
]);
|
|
42
|
+
const handleSelectAll = useCallback(() => {
|
|
43
|
+
const configFields = createConfigField(name, options.map((opt) => opt.value));
|
|
44
|
+
onChange({
|
|
45
|
+
...config,
|
|
46
|
+
...configFields
|
|
47
|
+
});
|
|
48
|
+
}, [
|
|
49
|
+
name,
|
|
50
|
+
options,
|
|
51
|
+
config,
|
|
52
|
+
onChange
|
|
53
|
+
]);
|
|
54
|
+
const handleRemoveAll = useCallback(() => {
|
|
55
|
+
onChange({ ...omit(config, name) });
|
|
56
|
+
}, [
|
|
57
|
+
name,
|
|
58
|
+
config,
|
|
59
|
+
onChange
|
|
60
|
+
]);
|
|
61
|
+
return /* @__PURE__ */ jsxs(styles_default.ConfigRow, {
|
|
62
|
+
isBlock: isMulti,
|
|
63
|
+
children: [/* @__PURE__ */ jsxs(styles_default.ConfigLabel, { children: [label, ": "] }), /* @__PURE__ */ jsx(styles_default.ConfigInput, { children: input ? /* @__PURE__ */ jsx(styles_default.Input, {
|
|
64
|
+
type: input,
|
|
65
|
+
defaultValue: value || "",
|
|
66
|
+
onChange: handleChange
|
|
67
|
+
}) : isMulti ? /* @__PURE__ */ jsxs(styles_default.CheckboxContent, { children: [/* @__PURE__ */ jsxs(styles_default.CheckboxControls, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Button_default, {
|
|
69
|
+
onClick: handleSelectAll,
|
|
70
|
+
children: selectAll
|
|
71
|
+
}),
|
|
72
|
+
" ",
|
|
73
|
+
/* @__PURE__ */ jsx(Button_default, {
|
|
74
|
+
appearance: "secondary",
|
|
75
|
+
onClick: handleRemoveAll,
|
|
76
|
+
children: clear
|
|
77
|
+
})
|
|
78
|
+
] }), options.map((option) => {
|
|
79
|
+
const isChecked = (value || []).includes(option.value);
|
|
80
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("input", {
|
|
81
|
+
id: option.value,
|
|
82
|
+
type: "checkbox",
|
|
83
|
+
value: option.value,
|
|
84
|
+
onChange: handleChange,
|
|
85
|
+
checked: isChecked
|
|
86
|
+
}), /* @__PURE__ */ jsx("label", {
|
|
87
|
+
htmlFor: option.value,
|
|
88
|
+
children: option.label
|
|
89
|
+
})] }, option.value);
|
|
90
|
+
})] }) : /* @__PURE__ */ jsxs(styles_default.Select, {
|
|
91
|
+
onChange: handleChange,
|
|
92
|
+
value: value || "",
|
|
93
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
94
|
+
value: "",
|
|
95
|
+
children: placeholder || none
|
|
96
|
+
}), options.map((option) => /* @__PURE__ */ jsx("option", {
|
|
97
|
+
value: option.value,
|
|
98
|
+
children: option.label
|
|
99
|
+
}, option.value))]
|
|
100
|
+
}) })]
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { InputConfig as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { MultiConfigProps } from './MultiConfig';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { DashboardProps } from '../../types';
|
|
3
|
+
import './dashboard.css';
|
|
4
|
+
type Props = {
|
|
5
|
+
title?: DashboardProps['title'];
|
|
6
|
+
widgetDefinitions: DashboardProps['widgetDefinitions'];
|
|
7
|
+
};
|
|
8
|
+
declare const DashboardComponent: ({ title, widgetDefinitions }: Props) => JSX.Element;
|
|
9
|
+
export default DashboardComponent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styles_default from "../../styles.js";
|
|
2
|
+
import Header_default from "../Header/index.js";
|
|
3
|
+
import Layout_default from "../Layout/index.js";
|
|
4
|
+
import DashboardBody from "./components/Body.js";
|
|
5
|
+
import LayoutErrorBoundary from "./components/LayoutErrorBoundary.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region packages/ui/Modules/Dashboard/components/Dashboard/Dashboard.tsx
|
|
10
|
+
const emptyWidgetDefinitions = [];
|
|
11
|
+
const DashboardComponent = ({ title, widgetDefinitions = emptyWidgetDefinitions }) => /* @__PURE__ */ jsxs(styles_default.Wrapper, { children: [/* @__PURE__ */ jsx(Header_default, {
|
|
12
|
+
title,
|
|
13
|
+
widgetDefinitions
|
|
14
|
+
}), /* @__PURE__ */ jsx(DashboardBody, { children: /* @__PURE__ */ jsx(LayoutErrorBoundary, { children: /* @__PURE__ */ jsx(Layout_default, { widgetDefinitions }) }) })] });
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DashboardComponent as default };
|