@mailstep/design-system 0.8.51 → 0.9.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 +22 -6
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +1 -1
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +0 -1
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +2 -2
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +6 -7
- 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/Elements/DropdownMenu/components/MenuItem.js +16 -29
- package/ui/Elements/DropdownMenu/types.d.ts +0 -2
- 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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
//#region packages/ui/Modules/Dashboard/errors/ErrorMessage.tsx
|
|
5
|
+
const ErrorContainer = styled.div`
|
|
6
|
+
color: red;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
`;
|
|
10
|
+
const ErrorMessage = ({ children }) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ErrorContainer, { children }) });
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ErrorMessage as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region packages/ui/Modules/Dashboard/errors/WidgetError.ts
|
|
2
|
+
const WIDGET_ERROR_NAME = "WidgetError";
|
|
3
|
+
var WidgetError = class extends Error {
|
|
4
|
+
constructor(message = "Something went wrong with the Widget!") {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = WIDGET_ERROR_NAME;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { WIDGET_ERROR_NAME, WidgetError as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
//#region packages/ui/Modules/Dashboard/hooks/usePrevious.ts
|
|
3
|
+
/**
|
|
4
|
+
* https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
5
|
+
*/
|
|
6
|
+
const usePrevious = (value) => {
|
|
7
|
+
const ref = useRef(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
ref.current = value;
|
|
10
|
+
});
|
|
11
|
+
return ref.current;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { usePrevious as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback, useRef, useState } from "react";
|
|
2
|
+
//#region packages/ui/Modules/Dashboard/hooks/useRefWithCallback.ts
|
|
3
|
+
const useRefWithCallback = () => {
|
|
4
|
+
const ref = useRef(null);
|
|
5
|
+
const [toggle, setToggle] = useState(false);
|
|
6
|
+
return [
|
|
7
|
+
toggle,
|
|
8
|
+
useCallback((node) => {
|
|
9
|
+
ref.current = node;
|
|
10
|
+
setToggle((val) => !val);
|
|
11
|
+
}, []),
|
|
12
|
+
ref
|
|
13
|
+
];
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useRefWithCallback };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
//#region packages/ui/Modules/Dashboard/hooks/useResize.ts
|
|
3
|
+
const useResize = (myRef) => {
|
|
4
|
+
const [width, setWidth] = useState(0);
|
|
5
|
+
const [height, setHeight] = useState(0);
|
|
6
|
+
const handleResize = useCallback(() => {
|
|
7
|
+
setWidth(myRef?.current.offsetWidth);
|
|
8
|
+
setHeight(myRef?.current.clientHeight);
|
|
9
|
+
}, [myRef]);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
myRef?.current && handleResize();
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
width,
|
|
15
|
+
height
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useResize };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconLabelCell_exports } from "./components/Widgets/Table/components/IconLabelCell.js";
|
|
2
|
+
import { BarChart, ColorBox, HorizontalBar, NoWidget, NumberBox, PieChart, Table, TextBox } from "./components/Widgets/index.js";
|
|
3
|
+
import Dashboard_default$1 from "./components/Dashboard/index.js";
|
|
4
|
+
import dashboardReducer from "./store/reducers/index.js";
|
|
5
|
+
import { withConfig } from "./Hoc/withConfig.js";
|
|
6
|
+
import { withFetch } from "./Hoc/withFetch.js";
|
|
7
|
+
import { withProps, withPropsWDefinition } from "./Hoc/withProps.js";
|
|
8
|
+
import "./Hoc/index.js";
|
|
9
|
+
//#region packages/ui/Modules/Dashboard/index.tsx
|
|
10
|
+
var Dashboard_default = Dashboard_default$1;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { BarChart, ColorBox, HorizontalBar, NoWidget, NumberBox, PieChart, Table, TextBox, IconLabelCell_exports as WidgetTableComponents, Dashboard_default as default, dashboardReducer as reducer, withConfig, withFetch, withProps, withPropsWDefinition };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'buttons.addWidget': string;
|
|
3
|
+
'buttons.removeWidget': string;
|
|
4
|
+
'buttons.save': string;
|
|
5
|
+
'buttons.cancel': string;
|
|
6
|
+
'layout.nowidget': string;
|
|
7
|
+
'layout.nowidget.addWidget': string;
|
|
8
|
+
'picker.header': string;
|
|
9
|
+
'dashboard.title': string;
|
|
10
|
+
'widgets.selectAll': string;
|
|
11
|
+
'widgets.selectSource': string;
|
|
12
|
+
'widgets.selectUnit': string;
|
|
13
|
+
'widgets.source': string;
|
|
14
|
+
'widgets.none': string;
|
|
15
|
+
'widgets.noData': string;
|
|
16
|
+
'widgets.name': string;
|
|
17
|
+
'widgets.color': string;
|
|
18
|
+
'widgets.clear': string;
|
|
19
|
+
'widgets.conditions': string;
|
|
20
|
+
'widgets.allColumns': string;
|
|
21
|
+
'widgets.column': string;
|
|
22
|
+
'widgets.condition': string;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region packages/ui/Modules/Dashboard/locale/cs.ts
|
|
2
|
+
var cs_default = {
|
|
3
|
+
"buttons.addWidget": "Přidat widget",
|
|
4
|
+
"buttons.removeWidget": "Odebrat",
|
|
5
|
+
"buttons.save": "Uložit",
|
|
6
|
+
"buttons.cancel": "Zrušit",
|
|
7
|
+
"layout.nowidget": "Váš dashboard je prázdný.",
|
|
8
|
+
"layout.nowidget.addWidget": "Přidat nový widget.",
|
|
9
|
+
"picker.header": "Přidat widget",
|
|
10
|
+
"dashboard.title": "Váš přehled",
|
|
11
|
+
"widgets.selectAll": "Vybrat vše",
|
|
12
|
+
"widgets.selectSource": "Vyberte zdroj",
|
|
13
|
+
"widgets.selectUnit": "Vyberte jednotku",
|
|
14
|
+
"widgets.source": "Zdroj",
|
|
15
|
+
"widgets.none": "Nevybráno",
|
|
16
|
+
"widgets.noData": "Žádná data k zobrazení",
|
|
17
|
+
"widgets.name": "Název",
|
|
18
|
+
"widgets.color": "Barva",
|
|
19
|
+
"widgets.clear": "Vyčistit",
|
|
20
|
+
"widgets.conditions": "Podmínky",
|
|
21
|
+
"widgets.allColumns": "Všechny sloupce",
|
|
22
|
+
"widgets.column": "Sloupec",
|
|
23
|
+
"widgets.condition": "Podmínka"
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { cs_default as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'buttons.addWidget': string;
|
|
3
|
+
'buttons.removeWidget': string;
|
|
4
|
+
'buttons.save': string;
|
|
5
|
+
'buttons.cancel': string;
|
|
6
|
+
'layout.nowidget': string;
|
|
7
|
+
'layout.nowidget.addWidget': string;
|
|
8
|
+
'picker.header': string;
|
|
9
|
+
'dashboard.title': string;
|
|
10
|
+
'widgets.selectAll': string;
|
|
11
|
+
'widgets.selectSource': string;
|
|
12
|
+
'widgets.selectUnit': string;
|
|
13
|
+
'widgets.source': string;
|
|
14
|
+
'widgets.none': string;
|
|
15
|
+
'widgets.noData': string;
|
|
16
|
+
'widgets.name': string;
|
|
17
|
+
'widgets.color': string;
|
|
18
|
+
'widgets.clear': string;
|
|
19
|
+
'widgets.conditions': string;
|
|
20
|
+
'widgets.allColumns': string;
|
|
21
|
+
'widgets.column': string;
|
|
22
|
+
'widgets.condition': string;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region packages/ui/Modules/Dashboard/locale/en.ts
|
|
2
|
+
var en_default = {
|
|
3
|
+
"buttons.addWidget": "Add widget",
|
|
4
|
+
"buttons.removeWidget": "Remove",
|
|
5
|
+
"buttons.save": "Save",
|
|
6
|
+
"buttons.cancel": "Cancel",
|
|
7
|
+
"layout.nowidget": "Your list of widgets is empty.",
|
|
8
|
+
"layout.nowidget.addWidget": "Add a new widget.",
|
|
9
|
+
"picker.header": "Add a widget",
|
|
10
|
+
"dashboard.title": "Your dashboard",
|
|
11
|
+
"widgets.selectAll": "Select all",
|
|
12
|
+
"widgets.selectSource": "Select source",
|
|
13
|
+
"widgets.selectUnit": "Select unit",
|
|
14
|
+
"widgets.source": "Source",
|
|
15
|
+
"widgets.none": "Not selected",
|
|
16
|
+
"widgets.noData": "No data to view",
|
|
17
|
+
"widgets.name": "Name",
|
|
18
|
+
"widgets.color": "Color",
|
|
19
|
+
"widgets.clear": "Clear",
|
|
20
|
+
"widgets.conditions": "Conditions",
|
|
21
|
+
"widgets.allColumns": "All columns",
|
|
22
|
+
"widgets.column": "Column",
|
|
23
|
+
"widgets.condition": "Condition"
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { en_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import en_default from "./en.js";
|
|
2
|
+
import cs_default from "./cs.js";
|
|
3
|
+
import uk_default from "./uk.js";
|
|
4
|
+
import it_default from "./it.js";
|
|
5
|
+
//#region packages/ui/Modules/Dashboard/locale/index.ts
|
|
6
|
+
const translations = {
|
|
7
|
+
en: en_default,
|
|
8
|
+
cs: cs_default,
|
|
9
|
+
uk: uk_default,
|
|
10
|
+
it: it_default
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { translations as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'buttons.addWidget': string;
|
|
3
|
+
'buttons.removeWidget': string;
|
|
4
|
+
'buttons.save': string;
|
|
5
|
+
'buttons.cancel': string;
|
|
6
|
+
'layout.nowidget': string;
|
|
7
|
+
'layout.nowidget.addWidget': string;
|
|
8
|
+
'picker.header': string;
|
|
9
|
+
'dashboard.title': string;
|
|
10
|
+
'widgets.selectAll': string;
|
|
11
|
+
'widgets.selectSource': string;
|
|
12
|
+
'widgets.selectUnit': string;
|
|
13
|
+
'widgets.source': string;
|
|
14
|
+
'widgets.none': string;
|
|
15
|
+
'widgets.noData': string;
|
|
16
|
+
'widgets.name': string;
|
|
17
|
+
'widgets.color': string;
|
|
18
|
+
'widgets.clear': string;
|
|
19
|
+
'widgets.conditions': string;
|
|
20
|
+
'widgets.allColumns': string;
|
|
21
|
+
'widgets.column': string;
|
|
22
|
+
'widgets.condition': string;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region packages/ui/Modules/Dashboard/locale/it.ts
|
|
2
|
+
var it_default = {
|
|
3
|
+
"buttons.addWidget": "Aggiungi widget",
|
|
4
|
+
"buttons.removeWidget": "Rimuovi",
|
|
5
|
+
"buttons.save": "Salva",
|
|
6
|
+
"buttons.cancel": "Annulla",
|
|
7
|
+
"layout.nowidget": "Il tuo elenco di widget è vuoto.",
|
|
8
|
+
"layout.nowidget.addWidget": "Aggiungi un nuovo widget.",
|
|
9
|
+
"picker.header": "Aggiungi un widget",
|
|
10
|
+
"dashboard.title": "La tua dashboard",
|
|
11
|
+
"widgets.selectAll": "Seleziona tutto",
|
|
12
|
+
"widgets.selectSource": "Seleziona sorgente",
|
|
13
|
+
"widgets.selectUnit": "Seleziona unità",
|
|
14
|
+
"widgets.source": "Sorgente",
|
|
15
|
+
"widgets.none": "Non selezionato",
|
|
16
|
+
"widgets.noData": "Nessun dato da visualizzare",
|
|
17
|
+
"widgets.name": "Nome",
|
|
18
|
+
"widgets.color": "Colore",
|
|
19
|
+
"widgets.clear": "Cancella",
|
|
20
|
+
"widgets.conditions": "Condizioni",
|
|
21
|
+
"widgets.allColumns": "Tutte le colonne",
|
|
22
|
+
"widgets.column": "Colonna",
|
|
23
|
+
"widgets.condition": "Condizione"
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { it_default as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'buttons.addWidget': string;
|
|
3
|
+
'buttons.removeWidget': string;
|
|
4
|
+
'buttons.save': string;
|
|
5
|
+
'buttons.cancel': string;
|
|
6
|
+
'layout.nowidget': string;
|
|
7
|
+
'layout.nowidget.addWidget': string;
|
|
8
|
+
'picker.header': string;
|
|
9
|
+
'dashboard.title': string;
|
|
10
|
+
'widgets.selectAll': string;
|
|
11
|
+
'widgets.selectSource': string;
|
|
12
|
+
'widgets.selectUnit': string;
|
|
13
|
+
'widgets.source': string;
|
|
14
|
+
'widgets.none': string;
|
|
15
|
+
'widgets.noData': string;
|
|
16
|
+
'widgets.name': string;
|
|
17
|
+
'widgets.color': string;
|
|
18
|
+
'widgets.clear': string;
|
|
19
|
+
'widgets.conditions': string;
|
|
20
|
+
'widgets.allColumns': string;
|
|
21
|
+
'widgets.column': string;
|
|
22
|
+
'widgets.condition': string;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region packages/ui/Modules/Dashboard/locale/uk.ts
|
|
2
|
+
var uk_default = {
|
|
3
|
+
"buttons.addWidget": "Додати віджет",
|
|
4
|
+
"buttons.removeWidget": "видалити",
|
|
5
|
+
"buttons.save": "зберегти",
|
|
6
|
+
"buttons.cancel": "Скасувати",
|
|
7
|
+
"layout.nowidget": "Ваш список віджетів порожній.",
|
|
8
|
+
"layout.nowidget.addWidget": "Додайте новий віджет.",
|
|
9
|
+
"picker.header": "Додайте віджет",
|
|
10
|
+
"dashboard.title": "Ваша інформаційна панель",
|
|
11
|
+
"widgets.selectAll": "Вибрати все",
|
|
12
|
+
"widgets.selectSource": "Виберіть джерело",
|
|
13
|
+
"widgets.selectUnit": "Виберіть одиницю",
|
|
14
|
+
"widgets.source": "Джерело",
|
|
15
|
+
"widgets.none": "Не вибрано",
|
|
16
|
+
"widgets.noData": "Немає даних для перегляду",
|
|
17
|
+
"widgets.name": "Імя",
|
|
18
|
+
"widgets.color": "колір",
|
|
19
|
+
"widgets.clear": "ясно",
|
|
20
|
+
"widgets.conditions": "Умови",
|
|
21
|
+
"widgets.allColumns": "Всі колонки",
|
|
22
|
+
"widgets.column": "Колонка",
|
|
23
|
+
"widgets.condition": "Хвороба"
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { uk_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const dashboardReducer: import("redux").Reducer<{
|
|
2
|
+
widgets: import("./widgetListReducer").LayoutWidgetsState;
|
|
3
|
+
}, {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
type: string;
|
|
6
|
+
}, Partial<{
|
|
7
|
+
widgets: import("./widgetListReducer").LayoutWidgetsState | undefined;
|
|
8
|
+
}>>;
|
|
9
|
+
export default dashboardReducer;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import widgetListReducer from "./widgetListReducer.js";
|
|
2
|
+
import { combineReducers } from "redux";
|
|
3
|
+
//#region packages/ui/Modules/Dashboard/store/reducers/index.ts
|
|
4
|
+
const dashboardReducer = combineReducers({ widgets: widgetListReducer });
|
|
5
|
+
//#endregion
|
|
6
|
+
export { dashboardReducer as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Layout } from 'react-grid-layout';
|
|
2
|
+
import { WidgetConfig, LayoutWidgetItem } from '../../types';
|
|
3
|
+
export type LayoutWidgetsState = LayoutWidgetItem[] | null;
|
|
4
|
+
type Action = {
|
|
5
|
+
type: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
export declare const actionTypes: {
|
|
9
|
+
initWidgets: string;
|
|
10
|
+
addWidget: string;
|
|
11
|
+
removeWidget: string;
|
|
12
|
+
setWidgetsLayout: string;
|
|
13
|
+
setWidgetsConfig: string;
|
|
14
|
+
};
|
|
15
|
+
declare const widgetListReducer: (state: LayoutWidgetsState | undefined, action: Action) => LayoutWidgetsState;
|
|
16
|
+
export declare const actions: {
|
|
17
|
+
/**
|
|
18
|
+
* set all widgets in batch (from server etc)
|
|
19
|
+
*/
|
|
20
|
+
initWidgets: (widgets: LayoutWidgetsState) => Action;
|
|
21
|
+
/**
|
|
22
|
+
* add widget to list
|
|
23
|
+
*/
|
|
24
|
+
addWidget: (code: string, id: string, layout: Partial<Layout>, config: WidgetConfig | null) => Action;
|
|
25
|
+
/**
|
|
26
|
+
* remove selected widget from list
|
|
27
|
+
*/
|
|
28
|
+
removeWidget: (id: string) => Action;
|
|
29
|
+
/**
|
|
30
|
+
* set matrix of selected widget
|
|
31
|
+
*/
|
|
32
|
+
setWidgetsLayout: (layouts: Layout[]) => Action;
|
|
33
|
+
/**
|
|
34
|
+
* set config of selected widget
|
|
35
|
+
*/
|
|
36
|
+
setWidgetsConfig: (id: string, config: WidgetConfig) => Action;
|
|
37
|
+
};
|
|
38
|
+
export declare const selectors: {
|
|
39
|
+
getWidgets: (state: any) => LayoutWidgetsState;
|
|
40
|
+
};
|
|
41
|
+
export default widgetListReducer;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//#region packages/ui/Modules/Dashboard/store/reducers/widgetListReducer.ts
|
|
2
|
+
const initialState = null;
|
|
3
|
+
const actionTypes = {
|
|
4
|
+
initWidgets: "@Dashboard/WIDGETS_INIT",
|
|
5
|
+
addWidget: "@Dashboard/WIDGETS_ADD",
|
|
6
|
+
removeWidget: "@Dashboard/WIDGETS_REMOVE",
|
|
7
|
+
setWidgetsLayout: "@Dashboard/WIDGETS_SET_LAYOUT",
|
|
8
|
+
setWidgetsConfig: "@Dashboard/WIDGETS_SET_CONFIG"
|
|
9
|
+
};
|
|
10
|
+
const widgetListReducer = (state = initialState, action) => {
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
/**
|
|
13
|
+
* set full state of widget
|
|
14
|
+
*/
|
|
15
|
+
case actionTypes.initWidgets: return action.payload;
|
|
16
|
+
/**
|
|
17
|
+
* add widget to list
|
|
18
|
+
*/
|
|
19
|
+
case actionTypes.addWidget: return [...state || [], { ...action.payload }];
|
|
20
|
+
/**
|
|
21
|
+
* remove widget by ID from list
|
|
22
|
+
*/
|
|
23
|
+
case actionTypes.removeWidget: return (state || []).filter((widget) => widget.id !== action.payload);
|
|
24
|
+
/**
|
|
25
|
+
* set matrix by ID for one specified widget
|
|
26
|
+
*/
|
|
27
|
+
case actionTypes.setWidgetsLayout: return (state || []).map((widget) => {
|
|
28
|
+
const layout = action.payload.find((changedLayout) => changedLayout.i === widget.id);
|
|
29
|
+
return {
|
|
30
|
+
...widget,
|
|
31
|
+
layout
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* set matrix by ID for one specified widget
|
|
36
|
+
*/
|
|
37
|
+
case actionTypes.setWidgetsConfig: return (state || []).map((widget) => widget.id === action.payload.id ? {
|
|
38
|
+
...widget,
|
|
39
|
+
config: action.payload.config
|
|
40
|
+
} : widget);
|
|
41
|
+
default: return state;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const actions = {
|
|
45
|
+
initWidgets: (widgets) => ({
|
|
46
|
+
type: actionTypes.initWidgets,
|
|
47
|
+
payload: widgets
|
|
48
|
+
}),
|
|
49
|
+
addWidget: (code, id, layout, config) => ({
|
|
50
|
+
type: actionTypes.addWidget,
|
|
51
|
+
payload: {
|
|
52
|
+
code,
|
|
53
|
+
id,
|
|
54
|
+
layout,
|
|
55
|
+
config
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
removeWidget: (id) => ({
|
|
59
|
+
type: actionTypes.removeWidget,
|
|
60
|
+
payload: id
|
|
61
|
+
}),
|
|
62
|
+
setWidgetsLayout: (layouts) => ({
|
|
63
|
+
type: actionTypes.setWidgetsLayout,
|
|
64
|
+
payload: layouts
|
|
65
|
+
}),
|
|
66
|
+
setWidgetsConfig: (id, config) => ({
|
|
67
|
+
type: actionTypes.setWidgetsConfig,
|
|
68
|
+
payload: {
|
|
69
|
+
id,
|
|
70
|
+
config
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
};
|
|
74
|
+
const selectors = { getWidgets: (state) => state?.dashboard?.widgets };
|
|
75
|
+
//#endregion
|
|
76
|
+
export { actionTypes, actions, widgetListReducer as default, selectors };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LayoutWidgetItem, WidgetConfig, WidgetDefinition } from '..';
|
|
2
|
+
export { tableColumns } from '../components/Widgets/Table/storybook.sample';
|
|
3
|
+
export { horizontalBarData } from '../components/Widgets/HorizontalBar/storybook.sample';
|
|
4
|
+
export declare const initialWidgets: LayoutWidgetItem[];
|
|
5
|
+
export declare const withDropdownConfig: (definition: WidgetDefinition) => WidgetDefinition;
|
|
6
|
+
/**
|
|
7
|
+
* You can define your own widget here
|
|
8
|
+
*/
|
|
9
|
+
export declare const customWidgets: WidgetDefinition[];
|
|
10
|
+
/**
|
|
11
|
+
* You can define data for pie chart here
|
|
12
|
+
*/
|
|
13
|
+
export declare const dataForPieChart: {
|
|
14
|
+
source1: {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
value: number;
|
|
18
|
+
}[];
|
|
19
|
+
source2: {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
value: number;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export declare const pieChartTexts: {
|
|
26
|
+
title: string;
|
|
27
|
+
subtitle: string;
|
|
28
|
+
description: string;
|
|
29
|
+
text: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const barChartTexts: {
|
|
32
|
+
title: string;
|
|
33
|
+
subtitle: string;
|
|
34
|
+
description: string;
|
|
35
|
+
text: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* You can define data for number box widget here
|
|
39
|
+
*/
|
|
40
|
+
export declare const dataForNumberBox: {
|
|
41
|
+
source0: number;
|
|
42
|
+
source1: number;
|
|
43
|
+
source2: number;
|
|
44
|
+
source3: number;
|
|
45
|
+
};
|
|
46
|
+
export declare const onChange: (state: LayoutWidgetItem[]) => void;
|
|
47
|
+
export declare const fetchDataForPieChart: (config?: WidgetConfig) => Promise<unknown>;
|
|
48
|
+
export declare const fetchDataForNumberBox: (config?: WidgetConfig) => Promise<unknown>;
|
|
49
|
+
export declare const fetchDataForBarChart: (config?: WidgetConfig) => Promise<unknown>;
|
|
50
|
+
export declare const fetchDataForTable: () => Promise<unknown>;
|