@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,14 @@
|
|
|
1
|
+
import { DefaultRawDatum, PieLayer } from '@nivo/pie';
|
|
2
|
+
export declare const margin: {
|
|
3
|
+
top: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
right: number;
|
|
6
|
+
left: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const layers: (centeredMetric?: ({ dataWithArc, centerX, centerY }: import("./components/CenteredMetric").CenteredMetricProps) => import("react").JSX.Element) => PieLayer<DefaultRawDatum>[];
|
|
9
|
+
export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const Subtitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const OtherText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
+
export declare const WrapperText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import CenteredMetric from "./components/CenteredMetric.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/PieChart/styles.ts
|
|
4
|
+
const margin = {
|
|
5
|
+
top: 20,
|
|
6
|
+
bottom: 120,
|
|
7
|
+
right: 20,
|
|
8
|
+
left: 100
|
|
9
|
+
};
|
|
10
|
+
const layers = (centeredMetric = CenteredMetric) => [
|
|
11
|
+
"arcs",
|
|
12
|
+
"arcLabels",
|
|
13
|
+
"arcLinkLabels",
|
|
14
|
+
"legends",
|
|
15
|
+
centeredMetric
|
|
16
|
+
];
|
|
17
|
+
const Title = styled.div`
|
|
18
|
+
font-size: 30px;
|
|
19
|
+
color: #333;
|
|
20
|
+
margin-bottom: 35px;
|
|
21
|
+
`;
|
|
22
|
+
const Subtitle = styled.div`
|
|
23
|
+
font-size: 20px;
|
|
24
|
+
color: #999;
|
|
25
|
+
margin-bottom: 5px;
|
|
26
|
+
`;
|
|
27
|
+
const Description = styled.div`
|
|
28
|
+
font-size: 22px;
|
|
29
|
+
color: #333;
|
|
30
|
+
margin-bottom: 15px;
|
|
31
|
+
`;
|
|
32
|
+
const OtherText = styled.div`
|
|
33
|
+
font-size: 15px;
|
|
34
|
+
color: #aaa;
|
|
35
|
+
`;
|
|
36
|
+
const Wrapper = styled.div`
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
display: flex;
|
|
40
|
+
`;
|
|
41
|
+
const WrapperText = styled.div`
|
|
42
|
+
margin-right: 20px;
|
|
43
|
+
padding-left: 30px;
|
|
44
|
+
padding-top: 30px;
|
|
45
|
+
`;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Description, OtherText, Subtitle, Title, Wrapper, WrapperText, layers, margin };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { MultiConfigProps } from '../../Config/MultiConfig';
|
|
3
|
+
import { Source } from '../../../types';
|
|
4
|
+
import { TableColumn } from './types';
|
|
5
|
+
export type TableConfigProps = MultiConfigProps & {
|
|
6
|
+
columns?: TableColumn[];
|
|
7
|
+
sources?: Source[];
|
|
8
|
+
};
|
|
9
|
+
export declare const Config: ({ onChange, config, columns, sources }: TableConfigProps) => JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import Button_default from "../../../../../Elements/Button/index.js";
|
|
2
|
+
import styles_default from "../../../styles.js";
|
|
3
|
+
import Text, { useText } from "../../Text/Text.js";
|
|
4
|
+
import { MultiConfig } from "../../Config/MultiConfig.js";
|
|
5
|
+
import useCondition from "./hooks/useCondition.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/Config.tsx
|
|
8
|
+
const Config = ({ onChange, config, columns, sources }) => {
|
|
9
|
+
const [add, remove, change] = useCondition(onChange, config);
|
|
10
|
+
const textAllColumns = useText("widgets.allColumns");
|
|
11
|
+
const textColumn = useText("widgets.column");
|
|
12
|
+
const textCondition = useText("widgets.condition");
|
|
13
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MultiConfig, {
|
|
14
|
+
onChange,
|
|
15
|
+
config,
|
|
16
|
+
sources
|
|
17
|
+
}), /* @__PURE__ */ jsxs(styles_default.ConfigRow, {
|
|
18
|
+
isBlock: true,
|
|
19
|
+
children: [/* @__PURE__ */ jsxs(styles_default.ConfigLabel, { children: [/* @__PURE__ */ jsx(Text, { code: "widgets.conditions" }), ":"] }), /* @__PURE__ */ jsxs(styles_default.ConfigInput, { children: [config?.conditions?.map((cond, key) => /* @__PURE__ */ jsxs(styles_default.ConfigRow, { children: [
|
|
20
|
+
/* @__PURE__ */ jsxs(styles_default.Select, {
|
|
21
|
+
onChange: change(key, "column"),
|
|
22
|
+
value: cond.column || "",
|
|
23
|
+
width: "100px",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx("option", {
|
|
26
|
+
value: "",
|
|
27
|
+
disabled: true,
|
|
28
|
+
children: textColumn
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ jsx("option", {
|
|
31
|
+
value: "all",
|
|
32
|
+
children: textAllColumns
|
|
33
|
+
}),
|
|
34
|
+
columns?.map?.((column, index) => /* @__PURE__ */ jsx("option", {
|
|
35
|
+
value: column.key,
|
|
36
|
+
children: column.label
|
|
37
|
+
}, `${column.key}-${index}`))
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ jsxs(styles_default.Select, {
|
|
41
|
+
onChange: change(key, "comparator"),
|
|
42
|
+
value: cond.comparator || "",
|
|
43
|
+
width: "100px",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx("option", {
|
|
46
|
+
value: "",
|
|
47
|
+
disabled: true,
|
|
48
|
+
children: textCondition
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ jsx("option", {
|
|
51
|
+
value: "<",
|
|
52
|
+
children: "<"
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsx("option", {
|
|
55
|
+
value: ">",
|
|
56
|
+
children: ">"
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ jsx("option", {
|
|
59
|
+
value: "=",
|
|
60
|
+
children: "="
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx(styles_default.Input, {
|
|
65
|
+
onChange: change(key, "value"),
|
|
66
|
+
defaultValue: cond.value || "",
|
|
67
|
+
type: "text",
|
|
68
|
+
placeholder: "value",
|
|
69
|
+
width: "100px"
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsx(styles_default.Input, {
|
|
72
|
+
onChange: change(key, "color"),
|
|
73
|
+
defaultValue: cond.color || "",
|
|
74
|
+
type: "color"
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx(Button_default, {
|
|
77
|
+
onClick: remove(key),
|
|
78
|
+
children: "🗑"
|
|
79
|
+
})
|
|
80
|
+
] }, key)), /* @__PURE__ */ jsx(Button_default, {
|
|
81
|
+
onClick: add,
|
|
82
|
+
children: "+"
|
|
83
|
+
})] })]
|
|
84
|
+
})] });
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Config };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { TableProps } from './types';
|
|
3
|
+
declare const Table: ({ data, columns, isLoading, error, onValueClick, onChange, onSaveConfigProps, config, hasPages, hasServerPages, hasSorting, hasServerSorting, innerRef, returnWidgetWithPaginationHeight, minRows, serverTotal, components, }: TableProps) => JSX.Element;
|
|
4
|
+
export default Table;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import styles_default from "../../../styles.js";
|
|
2
|
+
import LoadingBoundary from "../../../Hoc/LoadingBoundary.js";
|
|
3
|
+
import NoData_default from "../../NoData/index.js";
|
|
4
|
+
import PaginatorLocation from "./components/PaginatorLocation.js";
|
|
5
|
+
import styles_default$1 from "./styles.js";
|
|
6
|
+
import PaginatorList from "./components/PaginatorList.js";
|
|
7
|
+
import TableCell, { getColor } from "./components/TableCell.js";
|
|
8
|
+
import { usePages } from "./hooks/usePages.js";
|
|
9
|
+
import { useSort } from "./hooks/useSort.js";
|
|
10
|
+
import React, { useCallback, useRef } from "react";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/Table.tsx
|
|
13
|
+
const Table = ({ data = [], columns = [], isLoading, error, onValueClick, onChange, onSaveConfigProps, config = {}, hasPages = true, hasServerPages = false, hasSorting = true, hasServerSorting = false, innerRef, returnWidgetWithPaginationHeight, minRows, serverTotal, components }) => {
|
|
14
|
+
const onClick = useCallback((row, columnName) => () => onValueClick?.(row, columnName, config), [onValueClick, config]);
|
|
15
|
+
const { toggleSort, sort, sortedData } = useSort(data, !hasServerSorting, config?.sort);
|
|
16
|
+
const [tableRowRef, tHeadRef, paginatorRef] = [
|
|
17
|
+
useRef(null),
|
|
18
|
+
useRef(null),
|
|
19
|
+
useRef(null)
|
|
20
|
+
];
|
|
21
|
+
const { slicedData, page, from, to, perPage, setPage, pages, totalHeight } = usePages(sortedData, hasPages, innerRef, tHeadRef, paginatorRef, tableRowRef, minRows, hasServerPages, serverTotal);
|
|
22
|
+
const CustomPagination = components?.pagination;
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
onChange?.(sort, {
|
|
25
|
+
page,
|
|
26
|
+
from,
|
|
27
|
+
to,
|
|
28
|
+
perPage
|
|
29
|
+
});
|
|
30
|
+
}, [
|
|
31
|
+
sort,
|
|
32
|
+
pages,
|
|
33
|
+
page,
|
|
34
|
+
from,
|
|
35
|
+
to,
|
|
36
|
+
perPage
|
|
37
|
+
]);
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
returnWidgetWithPaginationHeight?.(totalHeight);
|
|
40
|
+
}, [totalHeight]);
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
if (perPage > 0) onSaveConfigProps?.({
|
|
43
|
+
perPage,
|
|
44
|
+
...Object.keys(sort || {}).length > 0 ? { sort } : {}
|
|
45
|
+
});
|
|
46
|
+
}, [perPage, sort]);
|
|
47
|
+
return /* @__PURE__ */ jsx(LoadingBoundary, {
|
|
48
|
+
isLoading,
|
|
49
|
+
error,
|
|
50
|
+
children: /* @__PURE__ */ jsxs(styles_default.ItemContent, {
|
|
51
|
+
ref: innerRef,
|
|
52
|
+
children: [
|
|
53
|
+
(!data || data.length === 0) && /* @__PURE__ */ jsx(NoData_default, {}),
|
|
54
|
+
/* @__PURE__ */ jsxs(styles_default$1.Table, {
|
|
55
|
+
cellSpacing: "0",
|
|
56
|
+
cellPadding: "0",
|
|
57
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", {
|
|
58
|
+
ref: tHeadRef,
|
|
59
|
+
children: columns?.map?.((column, i) => /* @__PURE__ */ jsx(styles_default$1.Th, {
|
|
60
|
+
onClick: hasSorting ? toggleSort(column.key) : void 0,
|
|
61
|
+
sort: sort?.[column.key],
|
|
62
|
+
children: column.label
|
|
63
|
+
}, `column-${column.key}-${i}`))
|
|
64
|
+
}) }), /* @__PURE__ */ jsx("tbody", { children: slicedData.map((row) => /* @__PURE__ */ jsx(styles_default$1.Tr, {
|
|
65
|
+
ref: tableRowRef,
|
|
66
|
+
children: columns?.map?.((column) => /* @__PURE__ */ jsx(styles_default$1.Td, {
|
|
67
|
+
onClick: onValueClick && onClick(row, column.key),
|
|
68
|
+
color: getColor(config, column.key, row[column.key]),
|
|
69
|
+
children: /* @__PURE__ */ jsx(TableCell, {
|
|
70
|
+
data: row[column.key],
|
|
71
|
+
component: column.component
|
|
72
|
+
})
|
|
73
|
+
}, `row-${row.id}-column-${column.label}`))
|
|
74
|
+
}, `row-${row.id}`)) })]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsxs(styles_default$1.Paginator, {
|
|
77
|
+
ref: paginatorRef,
|
|
78
|
+
children: [hasPages && perPage > 0 && !components?.pagination && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PaginatorLocation, {
|
|
79
|
+
from,
|
|
80
|
+
to,
|
|
81
|
+
total: serverTotal || data.length
|
|
82
|
+
}), /* @__PURE__ */ jsx(PaginatorList, {
|
|
83
|
+
total: pages,
|
|
84
|
+
page,
|
|
85
|
+
onChange: setPage
|
|
86
|
+
})] }), hasPages && perPage > 0 && components?.pagination && /* @__PURE__ */ jsx(CustomPagination, { perPage })]
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { Table as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __exportAll } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import styles_default from "../styles.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.tsx
|
|
6
|
+
var IconLabelCell_exports = /* @__PURE__ */ __exportAll({ IconLabelCell: () => IconLabelCell });
|
|
7
|
+
const IconLabelCell = ({ icon, label, text, iconRight = false }) => /* @__PURE__ */ jsxs(styles_default.IconLabelCell, { children: [
|
|
8
|
+
icon && !iconRight && /* @__PURE__ */ jsx(styles_default.CellIcon, {
|
|
9
|
+
iconRight,
|
|
10
|
+
children: icon
|
|
11
|
+
}),
|
|
12
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(styles_default.CellLabel, { children: label }), /* @__PURE__ */ jsx(styles_default.CellText, { children: text })] }),
|
|
13
|
+
icon && iconRight && /* @__PURE__ */ jsx(styles_default.CellIcon, {
|
|
14
|
+
iconRight,
|
|
15
|
+
children: icon
|
|
16
|
+
})
|
|
17
|
+
] });
|
|
18
|
+
//#endregion
|
|
19
|
+
export { IconLabelCell, IconLabelCell_exports };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
interface PaginatorListProps {
|
|
3
|
+
total: number;
|
|
4
|
+
page: number;
|
|
5
|
+
pagins?: number;
|
|
6
|
+
onChange: (page: number) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const PaginatorList: ({ total, pagins, onChange, page }: PaginatorListProps) => JSX.Element | null;
|
|
9
|
+
export default PaginatorList;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import styles_default from "../styles.js";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.tsx
|
|
5
|
+
const PaginatorList = ({ total, pagins = 7, onChange, page }) => {
|
|
6
|
+
const max = Math.min(page + pagins + 1, total);
|
|
7
|
+
const min = Math.round(Math.max(page - pagins / 2, 0));
|
|
8
|
+
const pages = Math.min(max - min, pagins);
|
|
9
|
+
const items = new Array(pages).fill(1).map((_, i) => i + min);
|
|
10
|
+
const onClick = useCallback((index) => () => onChange(index), [onChange]);
|
|
11
|
+
const onPreviousClick = useCallback(() => onChange(items[0] - 1), [items, onChange]);
|
|
12
|
+
const onNextClick = useCallback(() => onChange(page + 1), [page, onChange]);
|
|
13
|
+
if (total <= 1) return null;
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
15
|
+
items[0] > 0 && /* @__PURE__ */ jsx(styles_default.PaginatorItem, {
|
|
16
|
+
onClick: onPreviousClick,
|
|
17
|
+
children: "❮ "
|
|
18
|
+
}),
|
|
19
|
+
items.map((value) => /* @__PURE__ */ jsxs(styles_default.PaginatorItem, {
|
|
20
|
+
onClick: onClick(value),
|
|
21
|
+
selected: value === page,
|
|
22
|
+
children: [value + 1, " "]
|
|
23
|
+
}, value)),
|
|
24
|
+
page + 1 < total && /* @__PURE__ */ jsx(styles_default.PaginatorItem, {
|
|
25
|
+
onClick: onNextClick,
|
|
26
|
+
children: "❯"
|
|
27
|
+
})
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { PaginatorList as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.tsx
|
|
4
|
+
const PaginatorLocation = ({ from, to, total }) => /* @__PURE__ */ jsxs("span", { children: [
|
|
5
|
+
/* @__PURE__ */ jsxs("b", { children: [
|
|
6
|
+
from + 1,
|
|
7
|
+
"–",
|
|
8
|
+
to
|
|
9
|
+
] }),
|
|
10
|
+
" ",
|
|
11
|
+
"of ",
|
|
12
|
+
total
|
|
13
|
+
] });
|
|
14
|
+
//#endregion
|
|
15
|
+
export { PaginatorLocation as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { WidgetConfig } from '../../../../types';
|
|
3
|
+
import { TableCellProps } from '../types';
|
|
4
|
+
declare const TableCell: ({ component: Cell, data }: TableCellProps) => JSX.Element;
|
|
5
|
+
export declare const getColor: (config: WidgetConfig, columnKey: string, columnValue: any) => string;
|
|
6
|
+
export default TableCell;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IconLabelCell } from "./IconLabelCell.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.tsx
|
|
5
|
+
const TableCell = ({ component: Cell = IconLabelCell, data }) => /* @__PURE__ */ jsx(Cell, { ...data });
|
|
6
|
+
const getColor = (config, columnKey, columnValue) => {
|
|
7
|
+
const isAllColumns = config?.conditions?.[0]?.column === "all";
|
|
8
|
+
const conditions = config?.conditions?.filter((c) => c.column === columnKey);
|
|
9
|
+
const value = columnValue !== void 0 && "value" in columnValue ? columnValue.value : columnValue;
|
|
10
|
+
let color = "";
|
|
11
|
+
const setColor = (condition) => {
|
|
12
|
+
const isNumberComparison = !Number.isNaN(Number(value)) && !Number.isNaN(Number(condition.value));
|
|
13
|
+
switch (condition.comparator) {
|
|
14
|
+
case ">":
|
|
15
|
+
if (isNumberComparison && value > condition.value) color = condition.color;
|
|
16
|
+
break;
|
|
17
|
+
case "<":
|
|
18
|
+
if (isNumberComparison && value < condition.value) color = condition.color;
|
|
19
|
+
break;
|
|
20
|
+
case "=":
|
|
21
|
+
if (String(value) === String(condition.value)) color = condition.color;
|
|
22
|
+
break;
|
|
23
|
+
default: break;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
conditions?.forEach((condition) => {
|
|
27
|
+
setColor(condition);
|
|
28
|
+
});
|
|
29
|
+
if (isAllColumns) setColor(config.conditions[0]);
|
|
30
|
+
return color;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TableCell as default, getColor };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConfigProps } from '../../../../types';
|
|
2
|
+
interface UseCondition {
|
|
3
|
+
(onChange: ConfigProps['onChange'], config: ConfigProps['config']): [
|
|
4
|
+
(e: React.MouseEvent<HTMLElement>) => void,
|
|
5
|
+
(index: number) => (e: React.MouseEvent<HTMLElement>) => void,
|
|
6
|
+
(index: number, name: string) => (e: React.ChangeEvent<HTMLSelectElement | HTMLInputElement>) => void
|
|
7
|
+
];
|
|
8
|
+
}
|
|
9
|
+
declare const useCondition: UseCondition;
|
|
10
|
+
export default useCondition;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.ts
|
|
3
|
+
const useCondition = (onChange, config) => {
|
|
4
|
+
return [
|
|
5
|
+
useCallback(() => onChange({
|
|
6
|
+
...config,
|
|
7
|
+
conditions: [...config?.conditions || [], {}]
|
|
8
|
+
}), [onChange, config]),
|
|
9
|
+
useCallback((index) => () => onChange({
|
|
10
|
+
...config,
|
|
11
|
+
conditions: config.conditions.filter((_, i) => i !== index)
|
|
12
|
+
}), [onChange, config]),
|
|
13
|
+
useCallback((index, name) => (e) => {
|
|
14
|
+
const newConditions = [...config.conditions];
|
|
15
|
+
newConditions[index] = {
|
|
16
|
+
...newConditions[index],
|
|
17
|
+
[name]: e.target.value
|
|
18
|
+
};
|
|
19
|
+
onChange({
|
|
20
|
+
...config,
|
|
21
|
+
conditions: newConditions
|
|
22
|
+
});
|
|
23
|
+
}, [config])
|
|
24
|
+
];
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { useCondition as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { TableRow } from '../types';
|
|
3
|
+
interface UsePagesProps {
|
|
4
|
+
(data: TableRow[], enabled: boolean, wrapperRef: RefObject<HTMLDivElement> | ((node: HTMLDivElement) => void) | undefined, tHeadRef: RefObject<HTMLTableRowElement | null>, paginatorRef: RefObject<HTMLDivElement | null>, tableRowRef: RefObject<HTMLTableRowElement | null>, minRows?: number, useServer?: boolean, serverTotal?: number): Paginator;
|
|
5
|
+
}
|
|
6
|
+
type Paginator = {
|
|
7
|
+
slicedData: TableRow[];
|
|
8
|
+
pages: number;
|
|
9
|
+
page: number;
|
|
10
|
+
from: number;
|
|
11
|
+
to: number;
|
|
12
|
+
perPage: number;
|
|
13
|
+
setPage: (page: number) => void;
|
|
14
|
+
totalHeight: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const usePages: UsePagesProps;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useResize } from "../../../../hooks/useResize.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.ts
|
|
4
|
+
const usePages = (data, enabled, wrapperRef, tHeadRef, paginatorRef, tableRowRef, minRows = 1, useServer, serverTotal) => {
|
|
5
|
+
const { height: wrapperHeight } = useResize(wrapperRef);
|
|
6
|
+
const { height: tableHeadHeight } = useResize(tHeadRef);
|
|
7
|
+
const { height: paginatorHeight } = useResize(paginatorRef);
|
|
8
|
+
const { height: rowHeight } = useResize(tableRowRef);
|
|
9
|
+
const [page, setPage] = useState(0);
|
|
10
|
+
const total = useServer ? serverTotal || 0 : data.length;
|
|
11
|
+
const space = Math.max(wrapperHeight - tableHeadHeight - paginatorHeight - 8, 0);
|
|
12
|
+
const perPage = rowHeight ? Math.floor(space / (rowHeight || 1)) || minRows : 0;
|
|
13
|
+
const from = page * perPage;
|
|
14
|
+
const to = Math.min(from + perPage, total);
|
|
15
|
+
return {
|
|
16
|
+
slicedData: enabled && perPage > 0 && !useServer ? data.slice(from, to) : data,
|
|
17
|
+
pages: Math.ceil(total / perPage),
|
|
18
|
+
page,
|
|
19
|
+
from,
|
|
20
|
+
to,
|
|
21
|
+
perPage,
|
|
22
|
+
setPage,
|
|
23
|
+
totalHeight: tableHeadHeight + paginatorHeight + (to - from) * rowHeight
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { usePages };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TableRow, WidgetSort } from '../types';
|
|
2
|
+
interface UseSort {
|
|
3
|
+
(data: TableRow[], enabled: boolean, initialSort: WidgetSort | undefined): {
|
|
4
|
+
toggleSort: (column: string) => () => void;
|
|
5
|
+
sort: WidgetSort | null;
|
|
6
|
+
sortedData: TableRow[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const useSort: UseSort;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import omit from "lodash/omit";
|
|
3
|
+
import orderBy from "lodash/orderBy";
|
|
4
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.ts
|
|
5
|
+
const initialSortValue = {};
|
|
6
|
+
const useSort = (data, enabled, initialSort = initialSortValue) => {
|
|
7
|
+
const [sort, setSort] = React.useState(initialSort);
|
|
8
|
+
const toggleSort = React.useCallback((column) => () => {
|
|
9
|
+
if (sort[column] === "desc") setSort(omit(sort, [column]));
|
|
10
|
+
else if (sort[column] === "asc") setSort({
|
|
11
|
+
...sort,
|
|
12
|
+
[column]: "desc"
|
|
13
|
+
});
|
|
14
|
+
else setSort({ [column]: "asc" });
|
|
15
|
+
}, [sort]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setSort(initialSort);
|
|
18
|
+
}, [initialSort]);
|
|
19
|
+
if (enabled) return {
|
|
20
|
+
toggleSort,
|
|
21
|
+
sort,
|
|
22
|
+
sortedData: orderBy(data, Object.keys(sort).map((column) => `${column}.value`), Object.values(sort))
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
toggleSort,
|
|
26
|
+
sort,
|
|
27
|
+
sortedData: data
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { useSort };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IconLabelCell_exports } from "./components/IconLabelCell.js";
|
|
2
|
+
import Table from "./Table.js";
|
|
3
|
+
import { Config } from "./Config.js";
|
|
4
|
+
//#region packages/ui/Modules/Dashboard/components/Widgets/Table/index.tsx
|
|
5
|
+
var Table_default = Table;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Config, IconLabelCell_exports as components, Table_default as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { components } from '.';
|
|
2
|
+
export declare const tableData: {
|
|
3
|
+
id: string;
|
|
4
|
+
company: {
|
|
5
|
+
icon: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
category: {
|
|
11
|
+
icon: string;
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
views: {
|
|
16
|
+
label: string;
|
|
17
|
+
value: number;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
revenue: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: number;
|
|
23
|
+
};
|
|
24
|
+
sales: {
|
|
25
|
+
icon: string;
|
|
26
|
+
label: string;
|
|
27
|
+
value: number;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
export declare const tableBigData: {
|
|
31
|
+
id: number;
|
|
32
|
+
readableId: {
|
|
33
|
+
text: number;
|
|
34
|
+
};
|
|
35
|
+
company: {
|
|
36
|
+
icon: string;
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
text: string;
|
|
40
|
+
};
|
|
41
|
+
category: {
|
|
42
|
+
icon: string;
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
};
|
|
46
|
+
views: {
|
|
47
|
+
label: number;
|
|
48
|
+
value: number;
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
revenue: {
|
|
52
|
+
label: string;
|
|
53
|
+
value: number;
|
|
54
|
+
};
|
|
55
|
+
sales: {
|
|
56
|
+
icon: string;
|
|
57
|
+
label: string;
|
|
58
|
+
value: number;
|
|
59
|
+
};
|
|
60
|
+
}[];
|
|
61
|
+
export declare const tableColumns: ({
|
|
62
|
+
key: string;
|
|
63
|
+
label: string;
|
|
64
|
+
component?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
key: string;
|
|
67
|
+
label: string;
|
|
68
|
+
component: ({ icon, label, text, iconRight }: components.IconLabelCellProps) => import("react").JSX.Element;
|
|
69
|
+
} | {
|
|
70
|
+
key: string;
|
|
71
|
+
label: string;
|
|
72
|
+
component: import("react").ComponentType<components.IconLabelCellProps>;
|
|
73
|
+
})[];
|