@mailstep/design-system 0.5.1-beta.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +40 -20
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +5 -2
- package/ui/Blocks/CommonGrid/CommonGrid.js +12 -22
- package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +66 -0
- package/ui/Blocks/CommonGrid/StandardButtons.d.ts +4 -0
- package/ui/Blocks/CommonGrid/StandardButtons.js +36 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +50 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +18 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +45 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +37 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +13 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +32 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +1 -1
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +58 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +20 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/DataRow.js +4 -4
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +113 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +3 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +43 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/FilterRow.js +2 -3
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +46 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.d.ts +10 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +19 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/HeadCell.js +1 -4
- package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +18 -0
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +29 -0
- package/ui/Blocks/CommonGrid/components/IconList/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +20 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +47 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.d.ts +3 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +76 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/types.d.ts +17 -0
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -0
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +1 -4
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +26 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/Table.d.ts +0 -6
- package/ui/Blocks/CommonGrid/components/Table.js +0 -5
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +32 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +89 -0
- package/ui/Blocks/CommonGrid/components/TextRange/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/TextRange/types.d.ts +21 -0
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -0
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +22 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/{icons/ArrowSimple.js → gridCells/ButtonInCell.js} +4 -2
- package/ui/Blocks/CommonGrid/components/gridCells/Date.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +8 -0
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -0
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +33 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +18 -0
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +23 -0
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +8 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.d.ts +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +24 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +30 -0
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +16 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +30 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +14 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +14 -0
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +4 -0
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +14 -0
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +15 -0
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +70 -0
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.d.ts +3 -0
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +13 -0
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.d.ts +7 -0
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -0
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.d.ts +8 -0
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +25 -0
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +19 -0
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +34 -0
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +8 -0
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +15 -0
- package/ui/Blocks/CommonGrid/index.d.ts +7 -71
- package/ui/Blocks/CommonGrid/index.js +7 -15
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +4 -4
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +3 -2
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +3 -2
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +2 -2
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +2 -1
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.d.ts +1 -0
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +8 -0
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +1 -17
- package/ui/Blocks/CommonGrid/styles.d.ts +14 -0
- package/ui/Blocks/CommonGrid/styles.js +33 -0
- package/ui/Blocks/CommonGrid/translations.d.ts +1 -0
- package/ui/Blocks/CommonGrid/translations.js +6 -0
- package/ui/Blocks/CommonGrid/types.d.ts +29 -15
- package/ui/Blocks/CommonGrid/utils/index.d.ts +4 -1
- package/ui/Blocks/CommonGrid/utils/index.js +19 -0
- package/ui/Blocks/HidePrint/HidePrint.d.ts +6 -0
- package/ui/Blocks/HidePrint/HidePrint.js +13 -0
- package/ui/Blocks/Popover/index.d.ts +12 -0
- package/ui/Blocks/Popover/index.js +21 -0
- package/ui/Elements/DatePicker/DatePicker.d.ts +20 -0
- package/ui/Elements/DatePicker/DatePicker.js +65 -0
- package/ui/Elements/DatePicker/Datetime/DateTime.d.ts +95 -0
- package/ui/Elements/DatePicker/Datetime/DateTime.js +516 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +8 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +57 -0
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.d.ts +9 -0
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +16 -0
- package/ui/Elements/DatePicker/Datetime/types.d.ts +61 -0
- package/ui/Elements/DatePicker/Datetime/types.js +7 -0
- package/ui/Elements/DatePicker/Datetime/views/DaysView.d.ts +14 -0
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +145 -0
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.d.ts +10 -0
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +111 -0
- package/ui/Elements/DatePicker/Datetime/views/YearsView.d.ts +15 -0
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +117 -0
- package/ui/Elements/DatePicker/index.d.ts +2 -0
- package/ui/Elements/DatePicker/index.js +2 -0
- package/ui/Elements/DatePicker/styles.d.ts +2 -0
- package/ui/Elements/DatePicker/styles.js +8 -0
- package/ui/Elements/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/ui/Elements/DropdownMenu/DropdownMenu.js +36 -0
- package/ui/Elements/DropdownMenu/components/DefaultItem.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +16 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.js +51 -0
- package/ui/Elements/DropdownMenu/components/MenuList.d.ts +3 -0
- package/ui/Elements/DropdownMenu/components/MenuList.js +10 -0
- package/ui/Elements/DropdownMenu/index.d.ts +1 -0
- package/ui/Elements/DropdownMenu/index.js +1 -0
- package/ui/Elements/DropdownMenu/types.d.ts +41 -0
- package/ui/Elements/DropdownMenu/types.js +1 -0
- package/ui/Elements/DropdownSelect/DropdownSelect.d.ts +21 -0
- package/ui/Elements/DropdownSelect/DropdownSelect.js +47 -0
- package/ui/Elements/DropdownSelect/index.d.ts +4 -0
- package/ui/Elements/DropdownSelect/index.js +3 -0
- package/ui/Elements/HighlightBox/HighlightBox.d.ts +50 -0
- package/ui/Elements/HighlightBox/HighlightBox.js +65 -0
- package/ui/Elements/HighlightBox/index.d.ts +2 -0
- package/ui/Elements/HighlightBox/index.js +2 -0
- package/ui/Elements/Icon/icons/Company.d.ts +3 -0
- package/ui/Elements/Icon/icons/Company.js +13 -0
- package/ui/Elements/Icon/icons/Integrations.d.ts +3 -0
- package/ui/Elements/Icon/icons/Integrations.js +13 -0
- package/ui/Elements/Icon/icons/ShoppingBag.d.ts +3 -0
- package/ui/Elements/Icon/icons/ShoppingBag.js +13 -0
- package/ui/Elements/Icon/icons/Truck.d.ts +3 -0
- package/ui/Elements/Icon/icons/Truck.js +13 -0
- package/ui/Elements/Icon/icons/TwoUsers.d.ts +3 -0
- package/ui/Elements/Icon/icons/TwoUsers.js +13 -0
- package/ui/Elements/Icon/icons/index.d.ts +5 -0
- package/ui/Elements/Icon/icons/index.js +5 -0
- package/ui/Elements/MultiSelect/MultiSelect.d.ts +6 -0
- package/ui/Elements/MultiSelect/MultiSelect.js +29 -0
- package/ui/Elements/MultiSelect/index.d.ts +2 -0
- package/ui/Elements/MultiSelect/index.js +2 -0
- package/ui/Elements/Pagination/Pagination.d.ts +4 -3
- package/ui/Elements/Pagination/Pagination.js +11 -3
- package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +1 -1
- package/ui/Elements/Pagination/styled.js +6 -6
- package/ui/Elements/Select/Select.d.ts +3 -0
- package/ui/Elements/Select/Select.js +69 -0
- package/ui/Elements/Select/index.d.ts +2 -0
- package/ui/Elements/Select/index.js +2 -0
- package/ui/Elements/Select/styles.d.ts +5 -0
- package/ui/Elements/Select/styles.js +12 -0
- package/ui/Elements/Select/themes/CustomComponents.d.ts +8 -0
- package/ui/Elements/Select/themes/CustomComponents.js +125 -0
- package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
- package/ui/Elements/Select/themes/baseStyles.js +87 -0
- package/ui/Elements/Select/themes/formStyles.d.ts +24 -0
- package/ui/Elements/Select/themes/formStyles.js +102 -0
- package/ui/Elements/Select/themes/index.d.ts +3 -0
- package/ui/Elements/Select/themes/index.js +43 -0
- package/ui/Elements/Select/types.d.ts +55 -0
- package/ui/Elements/Select/types.js +1 -0
- package/ui/Elements/SingleSelect/SingleSelect.d.ts +20 -0
- package/ui/Elements/SingleSelect/SingleSelect.js +197 -0
- package/ui/Elements/SingleSelect/index.d.ts +2 -0
- package/ui/Elements/SingleSelect/index.js +2 -0
- package/ui/Elements/Toggle/Toggle.d.ts +1 -1
- package/ui/Elements/Toggle/Toggle.js +2 -2
- package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +1 -1
- package/ui/Elements/Toggle/types.d.ts +1 -0
- package/ui/Forms/Input/types.d.ts +2 -2
- package/ui/Forms/TextArea/TextArea.d.ts +20 -0
- package/ui/Forms/TextArea/TextArea.js +34 -0
- package/ui/Forms/TextArea/index.d.ts +2 -0
- package/ui/Forms/TextArea/index.js +2 -0
- package/ui/Forms/TextArea/styles.d.ts +12 -0
- package/ui/Forms/TextArea/styles.js +31 -0
- package/ui/ThemeProvider/ThemeProvider.d.ts +3 -1
- package/ui/ThemeProvider/ThemeProvider.js +4 -2
- package/ui/ThemeProvider/types.d.ts +1 -0
- package/ui/index.d.ts +17 -1
- package/ui/index.es.js +42462 -8524
- package/ui/index.js +17 -1
- package/ui/index.umd.js +1647 -270
- package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +0 -12
- package/ui/Blocks/CommonGrid/CommonGridContext.js +0 -45
- package/ui/Blocks/CommonGrid/components/ActionColumnHead.d.ts +0 -4
- package/ui/Blocks/CommonGrid/components/ActionColumnHead.js +0 -16
- package/ui/Blocks/CommonGrid/components/ButtonStrip.d.ts +0 -7
- package/ui/Blocks/CommonGrid/components/ButtonStrip.js +0 -35
- package/ui/Blocks/CommonGrid/components/ConfigForm.d.ts +0 -9
- package/ui/Blocks/CommonGrid/components/ConfigForm.js +0 -58
- package/ui/Blocks/CommonGrid/components/DefaultPaginator.d.ts +0 -3
- package/ui/Blocks/CommonGrid/components/DefaultPaginator.js +0 -11
- package/ui/Blocks/CommonGrid/components/Dialog.d.ts +0 -11
- package/ui/Blocks/CommonGrid/components/Dialog.js +0 -19
- package/ui/Blocks/CommonGrid/components/DropdownMenu.d.ts +0 -21
- package/ui/Blocks/CommonGrid/components/DropdownMenu.js +0 -59
- package/ui/Blocks/CommonGrid/components/DropdownSelect.d.ts +0 -15
- package/ui/Blocks/CommonGrid/components/DropdownSelect.js +0 -35
- package/ui/Blocks/CommonGrid/components/FloatingButton.d.ts +0 -6
- package/ui/Blocks/CommonGrid/components/FloatingButton.js +0 -13
- package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +0 -2
- package/ui/Blocks/CommonGrid/hooks/useControlButtons.d.ts +0 -10
- package/ui/Blocks/CommonGrid/hooks/useControlButtons.js +0 -64
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +0 -13
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +0 -49
- package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +0 -2
- package/ui/Blocks/CommonGrid/storybook/utils/filters.js +0 -23
- package/ui/Blocks/CommonGrid/utils/public.d.ts +0 -16
- package/ui/Blocks/CommonGrid/utils/public.js +0 -52
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import styled from '@xstyled/styled-components';
|
|
8
|
+
import { th } from '@xstyled/system';
|
|
9
|
+
import Icon from '../../../../Elements/Icon/Icon';
|
|
10
|
+
export var List = styled.ul(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: white;\n box-shadow: dropShadow;\n border-radius: 10px;\n padding: 2;\n min-width: 130px;\n"], ["\n background-color: white;\n box-shadow: dropShadow;\n border-radius: 10px;\n padding: 2;\n min-width: 130px;\n"])));
|
|
11
|
+
export var ListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-bottom: 1px solid ", ";\n padding: 1 0;\n cursor: pointer;\n\n &:hover > span {\n background-color: bgLightGray1;\n }\n"], ["\n border-bottom: 1px solid ", ";\n padding: 1 0;\n cursor: pointer;\n\n &:hover > span {\n background-color: bgLightGray1;\n }\n"])), th('colors.bgLightGray1'));
|
|
12
|
+
export var ListItemContent = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 8px 10px;\n border-radius: 6px;\n font-size: 14px;\n font-weight: ", ";\n color: ", ";\n background-color: ", ";\n &:hover {\n font-weight: bold;\n }\n"], ["\n display: flex;\n align-items: center;\n padding: 8px 10px;\n border-radius: 6px;\n font-size: 14px;\n font-weight: ", ";\n color: ", ";\n background-color: ", ";\n &:hover {\n font-weight: bold;\n }\n"])), function (_a) {
|
|
13
|
+
var selected = _a.selected;
|
|
14
|
+
return (selected ? 'bold' : 'normal');
|
|
15
|
+
}, function (_a) {
|
|
16
|
+
var selected = _a.selected;
|
|
17
|
+
return (selected ? 'red1' : 'auto');
|
|
18
|
+
}, function (_a) {
|
|
19
|
+
var selected = _a.selected;
|
|
20
|
+
return (selected ? 'white' : 'transparent');
|
|
21
|
+
});
|
|
22
|
+
export var ListItemIcon = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n border: 1px solid;\n border-color: blue2;\n border-radius: 2px;\n margin-right: 2;\n width: 12px;\n height: 12px;\n line-height: 6px;\n padding-top: 1px;\n"], ["\n display: inline-block;\n border: 1px solid;\n border-color: blue2;\n border-radius: 2px;\n margin-right: 2;\n width: 12px;\n height: 12px;\n line-height: 6px;\n padding-top: 1px;\n"])));
|
|
23
|
+
var IconList = function (_a) {
|
|
24
|
+
var list = _a.list, selected = _a.selected, onClick = _a.onClick;
|
|
25
|
+
var handleClick = React.useCallback(function (item) { return function () { return onClick(item); }; }, [onClick]);
|
|
26
|
+
return (_jsx(List, { className: "ignore-element-for-closing-hook", children: list.map(function (item) { return (_jsx(ListItem, { onClick: handleClick(item), children: _jsxs(ListItemContent, { selected: selected === item.value, children: [_jsx(ListItemIcon, { children: _jsx(Icon, { icon: item.icon, fill: "red1", size: "8px" }) }), item.label] }) }, item.value)); }) }));
|
|
27
|
+
};
|
|
28
|
+
export default IconList;
|
|
29
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ColumnConfig, CommonGridProps } from '../../types';
|
|
3
|
+
type ManageColumnProps = {
|
|
4
|
+
columns?: CommonGridProps['columnsDefinitions'];
|
|
5
|
+
columnsConfigValues?: string[];
|
|
6
|
+
setColumnsConfigOptions: (value: React.SetStateAction<{
|
|
7
|
+
[x: string]: ColumnConfig | {};
|
|
8
|
+
}>) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const ManageColumnForm: ({ columns, columnsConfigValues, setColumnsConfigOptions }: ManageColumnProps) => JSX.Element;
|
|
11
|
+
export default ManageColumnForm;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { x } from '@xstyled/styled-components';
|
|
4
|
+
import { ActionRow } from './components/ActionRow';
|
|
5
|
+
import { Input } from '../../../../Forms/Input/Input';
|
|
6
|
+
import { i18n } from '@lingui/core';
|
|
7
|
+
var ManageColumnForm = function (_a) {
|
|
8
|
+
var columns = _a.columns, columnsConfigValues = _a.columnsConfigValues, setColumnsConfigOptions = _a.setColumnsConfigOptions;
|
|
9
|
+
var _b = useState(''), searchedValue = _b[0], setSearchedValue = _b[1];
|
|
10
|
+
var onChangeInputValue = useCallback(function (e) {
|
|
11
|
+
setSearchedValue(e.target.value);
|
|
12
|
+
}, [setSearchedValue]);
|
|
13
|
+
var clear = useCallback(function () {
|
|
14
|
+
setSearchedValue('');
|
|
15
|
+
}, [setSearchedValue]);
|
|
16
|
+
return (_jsxs(x.div, { children: [_jsx(Input, { icon: "search", type: "text", value: searchedValue, placeholder: i18n._({ id: 'manageColumn.searchPlaceholder', message: 'Find column...' }), onChange: onChangeInputValue, onClear: clear, variant: "gray" }), _jsx(x.div, { h: "400px", overflowY: "scroll", mt: "20px", children: columns === null || columns === void 0 ? void 0 : columns.map(function (column, index) {
|
|
17
|
+
return (_jsx(ActionRow, { column: column, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions, searchedValue: searchedValue }, index));
|
|
18
|
+
}) })] }));
|
|
19
|
+
};
|
|
20
|
+
export default ManageColumnForm;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ColumnConfig, ColumnDefinition } from '../../../types';
|
|
3
|
+
type ActionRowProps = {
|
|
4
|
+
column: ColumnDefinition;
|
|
5
|
+
columnsConfigValues: string[] | undefined;
|
|
6
|
+
setColumnsConfigOptions: (value: React.SetStateAction<{
|
|
7
|
+
[x: string]: ColumnConfig | {};
|
|
8
|
+
}>) => void;
|
|
9
|
+
searchedValue: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const ActionRow: ({ column, columnsConfigValues, setColumnsConfigOptions, searchedValue }: ActionRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { useCallback, useState } from 'react';
|
|
18
|
+
import { x, th } from '@xstyled/styled-components';
|
|
19
|
+
import styled from 'styled-components';
|
|
20
|
+
import Toggle from '../../../../../Elements/Toggle/Toggle';
|
|
21
|
+
import { Group } from '../../../../../Elements/Icon/icons/Group';
|
|
22
|
+
import { isObject } from 'lodash';
|
|
23
|
+
import { H6 } from '../../../../../Elements/Typography/Typography';
|
|
24
|
+
import { i18n } from '@lingui/core';
|
|
25
|
+
var RowLayout = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n align-items: center;\n justify-content: space-between;\n padding: 16px;\n height: 52px;\n border: 1px solid ", ";\n border-radius: 8px;\n margin-bottom: 15px;\n"], ["\n display: ", ";\n align-items: center;\n justify-content: space-between;\n padding: 16px;\n height: 52px;\n border: 1px solid ", ";\n border-radius: 8px;\n margin-bottom: 15px;\n"])), function (_a) {
|
|
26
|
+
var $isVisible = _a.$isVisible;
|
|
27
|
+
return ($isVisible ? 'flex' : 'none');
|
|
28
|
+
}, th.color('lightGray6'));
|
|
29
|
+
export var ActionRow = function (_a) {
|
|
30
|
+
var _b, _c, _d, _e, _f;
|
|
31
|
+
var column = _a.column, columnsConfigValues = _a.columnsConfigValues, setColumnsConfigOptions = _a.setColumnsConfigOptions, searchedValue = _a.searchedValue;
|
|
32
|
+
var _g = useState((_b = columnsConfigValues === null || columnsConfigValues === void 0 ? void 0 : columnsConfigValues.includes(column.name)) !== null && _b !== void 0 ? _b : false), isSelected = _g[0], setIsSelected = _g[1];
|
|
33
|
+
var translatedValue = isObject(column === null || column === void 0 ? void 0 : column.title) &&
|
|
34
|
+
'props' in column.title &&
|
|
35
|
+
((_c = column.title) === null || _c === void 0 ? void 0 : _c.props) &&
|
|
36
|
+
i18n._({ id: (_e = (_d = column.title) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.id, message: (_f = column.title) === null || _f === void 0 ? void 0 : _f.props.message });
|
|
37
|
+
var isVisible = translatedValue && translatedValue.toLocaleLowerCase().includes(searchedValue.toLocaleLowerCase());
|
|
38
|
+
var handleToggleChange = useCallback(function () {
|
|
39
|
+
setColumnsConfigOptions(function (prevOptions) {
|
|
40
|
+
var _a;
|
|
41
|
+
return __assign(__assign({}, prevOptions), (_a = {}, _a[column.name] = !isSelected ? {} : { isHidden: true }, _a));
|
|
42
|
+
});
|
|
43
|
+
setIsSelected(!isSelected);
|
|
44
|
+
}, [setColumnsConfigOptions, isSelected, column.name]);
|
|
45
|
+
return (_jsxs(RowLayout, { "$isVisible": isVisible, children: [_jsxs(x.div, { display: "flex", alignItems: "center", children: [_jsx(x.div, { w: "28px", children: _jsx(Toggle, { name: "", variant: "grid", onChange: handleToggleChange, spaceAround: false, checked: isSelected }) }), _jsx(H6, { variant: "medium", ml: "8px", children: translatedValue })] }), _jsx(Group, {})] }));
|
|
46
|
+
};
|
|
47
|
+
var templateObject_1;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { useCallback, useState } from 'react';
|
|
25
|
+
import { useClickOutside } from '../../../Modal/hooks/useClickOutside';
|
|
26
|
+
import { Input } from '../../../../Forms/Input/Input';
|
|
27
|
+
import IconList from '../IconList';
|
|
28
|
+
import { i18n } from '@lingui/core';
|
|
29
|
+
var OverlayComponentDefault = function (_a) {
|
|
30
|
+
var children = _a.children;
|
|
31
|
+
return _jsx("div", { children: children });
|
|
32
|
+
};
|
|
33
|
+
var createNumberComparators = function () { return [
|
|
34
|
+
{ label: i18n._({ id: 'dataGrid.comparator.equals', message: 'Equals' }), value: 'eq', icon: 'equals' },
|
|
35
|
+
{ label: i18n._({ id: 'dataGrid.comparator.notEquals', message: 'Not equal' }), value: 'neq', icon: 'notEqual' },
|
|
36
|
+
{ label: i18n._({ id: 'dataGrid.comparator.lessThan', message: 'Less than' }), value: 'lt', icon: 'lessThen' },
|
|
37
|
+
{
|
|
38
|
+
label: i18n._({ id: 'dataGrid.comparator.lessThanOrEquals', message: 'Less than or equals' }),
|
|
39
|
+
value: 'lte',
|
|
40
|
+
icon: 'lessThanEqual',
|
|
41
|
+
},
|
|
42
|
+
{ label: i18n._({ id: 'dataGrid.comparator.greaterThan', message: 'Greater than' }), value: 'gt', icon: 'greaterThan' },
|
|
43
|
+
{
|
|
44
|
+
label: i18n._({ id: 'dataGrid.comparator.greaterThanOrEquals', message: 'Greater than or equal' }),
|
|
45
|
+
value: 'gte',
|
|
46
|
+
icon: 'greaterThanEqual',
|
|
47
|
+
},
|
|
48
|
+
]; };
|
|
49
|
+
var createEqualComparators = [
|
|
50
|
+
{ label: i18n._({ id: 'dataGrid.comparator.equals', message: 'Equals' }), value: 'eq', icon: 'equals' },
|
|
51
|
+
{ label: i18n._({ id: 'dataGrid.comparator.notEquals', message: 'Not equal' }), value: 'neq', icon: 'notEqual' },
|
|
52
|
+
];
|
|
53
|
+
var NumberRange = function (props) {
|
|
54
|
+
var numberComparators = createNumberComparators();
|
|
55
|
+
var name = props.name, _a = props.value, value = _a === void 0 ? {} : _a, label = props.label, onChange = props.onChange, decimals = props.decimals, className = props.className, _b = props.OverlayComponent, OverlayComponent = _b === void 0 ? OverlayComponentDefault : _b, isEqual = props.isEqual, rest = __rest(props, ["name", "value", "label", "onChange", "decimals", "className", "OverlayComponent", "isEqual"]);
|
|
56
|
+
var _c = useState(false), isOpen = _c[0], setOpen = _c[1];
|
|
57
|
+
var comparator = (value === null || value === void 0 ? void 0 : value.comparator) || numberComparators[0].value;
|
|
58
|
+
var renderedComparator = isEqual ? createEqualComparators : numberComparators;
|
|
59
|
+
var fieldValue = (value === null || value === void 0 ? void 0 : value.value) || (value === null || value === void 0 ? void 0 : value.value) === 0 ? value.value : '';
|
|
60
|
+
var onClose = useCallback(function () { return setOpen(false); }, []);
|
|
61
|
+
var pickerRef = useClickOutside({ onClose: onClose });
|
|
62
|
+
var togglePicker = useCallback(function () { return setOpen(!isOpen); }, [isOpen, setOpen]);
|
|
63
|
+
var onChangeTextInput = useCallback(function (event) {
|
|
64
|
+
var fieldValue = event.target.value.replace(',', '.');
|
|
65
|
+
var number = !decimals
|
|
66
|
+
? parseInt(fieldValue)
|
|
67
|
+
: (parseFloat(fieldValue) || 0).toFixed(decimals).substr(0, fieldValue.length);
|
|
68
|
+
var isValid = number || number === 0;
|
|
69
|
+
onChange({ comparator: comparator, value: isValid ? number : '' });
|
|
70
|
+
}, [onChange, comparator, decimals, value]);
|
|
71
|
+
var onChangeComparator = useCallback(function (option) {
|
|
72
|
+
onChange({ comparator: option.value, value: fieldValue });
|
|
73
|
+
}, []);
|
|
74
|
+
return (_jsxs("div", { ref: pickerRef, children: [_jsx(Input, __assign({ name: name, value: fieldValue, label: label, "data-cy": "".concat(name, "Inp"), onChange: onChangeTextInput, iconOnClick: togglePicker, appearance: "grid", icon: "ellipsisVertical", iconPlacement: "right", type: "text", className: className, autoComplete: "off" }, rest)), isOpen && (_jsx(OverlayComponent, { children: _jsx(IconList, { list: renderedComparator, selected: comparator, onClick: onChangeComparator }) }))] }));
|
|
75
|
+
};
|
|
76
|
+
export default NumberRange;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FilterComponentProps } from '../../types';
|
|
2
|
+
export type ComparatorValue = 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte';
|
|
3
|
+
export type NumberRangeValue = {
|
|
4
|
+
comparator?: ComparatorValue;
|
|
5
|
+
value?: string | number;
|
|
6
|
+
};
|
|
7
|
+
export type Comparator = {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
};
|
|
12
|
+
export type NumberRangeProps = FilterComponentProps<NumberRangeValue> & {
|
|
13
|
+
decimals?: number;
|
|
14
|
+
label?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
isEqual?: boolean;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,10 +14,7 @@ var ScrollSizer = styled.div(templateObject_4 || (templateObject_4 = __makeTempl
|
|
|
14
14
|
var FloatPosition = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: sticky;\n left: 0;\n"], ["\n position: sticky;\n left: 0;\n"])));
|
|
15
15
|
var OversizedScroll = function (_a, ref) {
|
|
16
16
|
var columnLayout = _a.columnLayout, isLoading = _a.isLoading, children = _a.children, floatingChildren = _a.floatingChildren, totalColumnsWidth = _a.totalColumnsWidth;
|
|
17
|
-
return (
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
_jsxs(ScrollWrapper, { columnLayout: columnLayout, isLoading: isLoading, className: "gridWrapper", ref: ref, children: [_jsx(ScrollSizer, { columnLayout: columnLayout, totalColumnsWidth: totalColumnsWidth, children: children }), floatingChildren && _jsx(FloatPosition, { children: floatingChildren })] }));
|
|
17
|
+
return (_jsxs(ScrollWrapper, { columnLayout: columnLayout, isLoading: isLoading, className: "gridWrapper", ref: ref, children: [_jsx(ScrollSizer, { columnLayout: columnLayout, totalColumnsWidth: totalColumnsWidth, children: children }), floatingChildren && _jsx(FloatPosition, { children: floatingChildren })] }));
|
|
21
18
|
};
|
|
22
19
|
var forwardedWrapper = React.forwardRef(OversizedScroll);
|
|
23
20
|
export default forwardedWrapper;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DataCellProps, ActionColumn } from '../../types';
|
|
2
|
+
type Props = DataCellProps<{
|
|
3
|
+
id: string;
|
|
4
|
+
}>;
|
|
5
|
+
declare const getReadEditButtonCell: (actionColumn?: ActionColumn) => ({ rowData, onRowAction }: Props) => JSX.Element | null;
|
|
6
|
+
export default getReadEditButtonCell;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import { isFunction } from 'lodash/fp';
|
|
4
|
+
import { RowActionsCell } from '../gridCells';
|
|
5
|
+
var getReadEditButtonCell = function (actionColumn) {
|
|
6
|
+
return function ReadEditButtonCell(_a) {
|
|
7
|
+
var rowData = _a.rowData, onRowAction = _a.onRowAction;
|
|
8
|
+
var canEdit = isFunction(actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowEdit) ? actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowEdit(rowData) : actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowEdit;
|
|
9
|
+
var canRead = isFunction(actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowRead) ? actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowRead(rowData) : actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowRead;
|
|
10
|
+
// if canEdit and canRead are both true, canEdit supersedes canRead
|
|
11
|
+
var handleOnClick = useCallback(function () {
|
|
12
|
+
var action = canEdit ? 'row_edit' : 'row_read';
|
|
13
|
+
if (onRowAction)
|
|
14
|
+
onRowAction(rowData === null || rowData === void 0 ? void 0 : rowData.id, action, rowData);
|
|
15
|
+
}, [canEdit, onRowAction, rowData]);
|
|
16
|
+
var linkTo = useMemo(function () {
|
|
17
|
+
var _a;
|
|
18
|
+
var mode = canEdit ? 'edit' : 'read';
|
|
19
|
+
return (_a = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.createLink) === null || _a === void 0 ? void 0 : _a.call(actionColumn, { mode: mode, id: rowData === null || rowData === void 0 ? void 0 : rowData.id });
|
|
20
|
+
}, [canEdit, rowData === null || rowData === void 0 ? void 0 : rowData.id]);
|
|
21
|
+
if (!canEdit && !canRead)
|
|
22
|
+
return null;
|
|
23
|
+
return _jsx(RowActionsCell, { canEdit: !!canEdit, onClick: handleOnClick, linkTo: linkTo });
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default getReadEditButtonCell;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type TableProps = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
};
|
|
5
|
-
export declare const Body: ({ children }: TableProps) => JSX.Element;
|
|
6
1
|
export declare const StyledRow: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
7
2
|
hasRowClick: boolean;
|
|
8
3
|
}, never>;
|
|
@@ -13,4 +8,3 @@ export declare const StyledDataRow: import("styled-components").StyledComponent<
|
|
|
13
8
|
export declare const Cell: (props: any) => JSX.Element;
|
|
14
9
|
export declare const TextCell: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
|
|
15
10
|
export declare const MessageCell: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
|
|
16
|
-
export {};
|
|
@@ -14,12 +14,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
// @ts-ignore
|
|
18
17
|
import styled, { system, th } from '@xstyled/styled-components';
|
|
19
|
-
export var Body = function (_a) {
|
|
20
|
-
var children = _a.children;
|
|
21
|
-
return _jsx("div", { children: children });
|
|
22
|
-
};
|
|
23
18
|
export var StyledRow = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n display: flex;\n min-height: 32px;\n border-bottom: 1px solid rgb(228, 231, 235);\n cursor: ", ";\n"], ["\n ", ";\n display: flex;\n min-height: 32px;\n border-bottom: 1px solid rgb(228, 231, 235);\n cursor: ", ";\n"])), system, function (props) { return (props.hasRowClick ? 'pointer' : 'cursor'); });
|
|
24
19
|
export var Row = function (props) { return _jsx(StyledRow, __assign({ ref: props.innerRef }, props)); };
|
|
25
20
|
var StyledCell = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: ", ";\n"], ["\n ", ";\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: ", ";\n"])), system, function (props) { return props.align; });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GridActionsType, GridSelectorsType } from '../../types';
|
|
2
|
+
type Props = {
|
|
3
|
+
gridActions: GridActionsType;
|
|
4
|
+
gridSelectors: GridSelectorsType;
|
|
5
|
+
customPaginationHandler?: (page: number, rows: number) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const TablePagination: ({ gridActions, gridSelectors, customPaginationHandler }: Props) => JSX.Element;
|
|
8
|
+
export default TablePagination;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import styled, { x } from '@xstyled/styled-components';
|
|
7
|
+
import { Trans } from '@lingui/react';
|
|
8
|
+
import { useCallback, useMemo } from 'react';
|
|
9
|
+
import Select from '../../../../Elements/Select/Select';
|
|
10
|
+
import { Paragraph4 } from '../../../../Elements/Typography/Typography';
|
|
11
|
+
var Wrapper = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n & > :nth-child(2) {\n display: none;\n @media (min-width: 1024px) {\n display: block;\n }\n }\n"], ["\n display: flex;\n align-items: center;\n & > :nth-child(2) {\n display: none;\n @media (min-width: 1024px) {\n display: block;\n }\n }\n"])));
|
|
12
|
+
var StyledSelect = styled(x.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-right: 15px;\n @media (min-width: 1024px) {\n margin-right: 8px;\n }\n"], ["\n margin-right: 15px;\n @media (min-width: 1024px) {\n margin-right: 8px;\n }\n"])));
|
|
13
|
+
var rowsPerPageOptionValues = [10, 20, 50, 100];
|
|
14
|
+
var LABEL_VALUE = '_label_';
|
|
15
|
+
var filterRowsOption = function (option) { return option.value !== LABEL_VALUE; };
|
|
16
|
+
var TablePagination = function (_a) {
|
|
17
|
+
var gridActions = _a.gridActions, gridSelectors = _a.gridSelectors, customPaginationHandler = _a.customPaginationHandler;
|
|
18
|
+
var setRowsPerPage = gridActions.setRowsPerPage;
|
|
19
|
+
var page = gridSelectors.page;
|
|
20
|
+
var onSetRowsPerPage = useCallback(function (option) {
|
|
21
|
+
if (option && 'value' in option) {
|
|
22
|
+
setRowsPerPage === null || setRowsPerPage === void 0 ? void 0 : setRowsPerPage(Number(option.value));
|
|
23
|
+
customPaginationHandler === null || customPaginationHandler === void 0 ? void 0 : customPaginationHandler(page !== null && page !== void 0 ? page : 1, Number(option.value));
|
|
24
|
+
}
|
|
25
|
+
}, [setRowsPerPage, page, customPaginationHandler]);
|
|
26
|
+
var rowsPerPageOptions = useMemo(function () {
|
|
27
|
+
return rowsPerPageOptionValues.map(function (value) { return ({ value: value, label: value }); });
|
|
28
|
+
}, []);
|
|
29
|
+
return (_jsxs(Wrapper, { children: [_jsx(StyledSelect, { minWidth: "80px", children: _jsx(Select, { name: "rowsPerPage", menuPlacement: "auto", style: "gridFilter", placeholder: "".concat(gridSelectors.rowsPerPage), options: rowsPerPageOptions, value: gridSelectors.rowsPerPage, filterOption: filterRowsOption, isDarkPlaceholderText: true, onChange: onSetRowsPerPage }) }), _jsx(Paragraph4, { variant: "normal", mr: "20px", children: _jsx(Trans, { id: "dataGrid.resultsPerPage", message: "Results per page" }) })] }));
|
|
30
|
+
};
|
|
31
|
+
export default TablePagination;
|
|
32
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { useCallback, useState } from 'react';
|
|
25
|
+
import { Trans } from '@lingui/react';
|
|
26
|
+
import { useClickOutside } from '../../../Modal/hooks/useClickOutside';
|
|
27
|
+
import { Input } from '../../../../Forms/Input/Input';
|
|
28
|
+
import IconList from '../IconList/IconList';
|
|
29
|
+
import { i18n } from '@lingui/core';
|
|
30
|
+
var OverlayComponentDefault = function (_a) {
|
|
31
|
+
var children = _a.children;
|
|
32
|
+
return _jsx("div", { children: children });
|
|
33
|
+
};
|
|
34
|
+
export var ipv4 = /^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/;
|
|
35
|
+
var createTextComparators = function () { return [
|
|
36
|
+
{ label: i18n._({ id: 'dataGrid.comparator.contains', message: 'Contains' }), value: 'like', icon: 'check' },
|
|
37
|
+
{ label: i18n._({ id: 'dataGrid.comparator.notContains', message: 'Not contains' }), value: 'notLike', icon: 'false' },
|
|
38
|
+
{ label: i18n._({ id: 'dataGrid.comparator.equals', message: 'Equals' }), value: 'eq', icon: 'equals' },
|
|
39
|
+
{ label: i18n._({ id: 'dataGrid.comparator.notEquals', message: 'Not equal' }), value: 'neq', icon: 'notEqual' },
|
|
40
|
+
{ label: i18n._({ id: 'dataGrid.comparator.startsWith', message: 'Starts with' }), value: 'startsWith', icon: 'startsWith' },
|
|
41
|
+
{ label: i18n._({ id: 'dataGrid.comparator.endsWith', message: 'Ends with' }), value: 'endsWith', icon: 'endsWith' },
|
|
42
|
+
]; };
|
|
43
|
+
var createPresentTextComparators = function () { return [
|
|
44
|
+
{ label: i18n._({ id: 'dataGrid.comparator.contains', message: 'Contains' }), value: 'like', icon: 'check' },
|
|
45
|
+
{ label: i18n._({ id: 'dataGrid.comparator.equals', message: 'Equals' }), value: 'in', icon: 'equals' },
|
|
46
|
+
]; };
|
|
47
|
+
var createEqualComparators = function () { return [
|
|
48
|
+
{ label: i18n._({ id: 'dataGrid.comparator.equals', message: 'Equals' }), value: 'eq', icon: 'equals' },
|
|
49
|
+
{ label: i18n._({ id: 'dataGrid.comparator.notEquals', message: 'Not equal' }), value: 'neq', icon: 'notEqual' },
|
|
50
|
+
]; };
|
|
51
|
+
var validations = {
|
|
52
|
+
ip: {
|
|
53
|
+
check: function (value) { return ipv4.test(value.trim()); },
|
|
54
|
+
errorMsg: _jsx(Trans, { id: "dataGrid.errors.ipValidationError", message: "Value is not valid ip" }),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
var TextRange = function (props) {
|
|
58
|
+
var name = props.name, _a = props.value, value = _a === void 0 ? {} : _a, label = props.label, onChange = props.onChange, className = props.className, _b = props.OverlayComponent, OverlayComponent = _b === void 0 ? OverlayComponentDefault : _b, eqOnly = props.eqOnly, isPresent = props.isPresent, isEqual = props.isEqual, defaultComparator = props.defaultComparator, validationKey = props.validation, rest = __rest(props, ["name", "value", "label", "onChange", "className", "OverlayComponent", "eqOnly", "isPresent", "isEqual", "defaultComparator", "validation"]);
|
|
59
|
+
var eqOnlyTxt = i18n._({ id: 'dataGrid.filterTxtEqWarning', message: 'This filter can only do exact match' });
|
|
60
|
+
var _c = useState(false), isOpen = _c[0], setOpen = _c[1];
|
|
61
|
+
var textComparators = createTextComparators();
|
|
62
|
+
var presentTextComparators = createPresentTextComparators();
|
|
63
|
+
var equalComparators = createEqualComparators();
|
|
64
|
+
var fallbackComparator = defaultComparator || textComparators[0].value;
|
|
65
|
+
var comparator = eqOnly ? 'eq' : (value === null || value === void 0 ? void 0 : value.comparator) || fallbackComparator;
|
|
66
|
+
var renderedComparator = isEqual ? equalComparators : isPresent ? presentTextComparators : textComparators;
|
|
67
|
+
var fieldValue = (value === null || value === void 0 ? void 0 : value.value) || '';
|
|
68
|
+
var onClose = useCallback(function () {
|
|
69
|
+
setOpen(false);
|
|
70
|
+
}, []);
|
|
71
|
+
var pickerRef = useClickOutside({ onClose: onClose });
|
|
72
|
+
var togglePicker = useCallback(function () { return setOpen(!isOpen); }, [isOpen, setOpen]);
|
|
73
|
+
var validation = !!validationKey && validations[validationKey];
|
|
74
|
+
var isInvalid = validation && Boolean(fieldValue && !validation.check(String(fieldValue)));
|
|
75
|
+
var onChangeTextInput = useCallback(function (event) {
|
|
76
|
+
var txtValue = event.target.value;
|
|
77
|
+
if (txtValue) {
|
|
78
|
+
onChange({ comparator: comparator, value: txtValue, isInvalid: validation && !validation.check(txtValue) });
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
onChange(null);
|
|
82
|
+
}
|
|
83
|
+
}, [onChange, comparator, validation]);
|
|
84
|
+
var onChangeComparator = useCallback(function (option) {
|
|
85
|
+
onChange({ comparator: option.value, value: fieldValue, isInvalid: isInvalid });
|
|
86
|
+
}, []);
|
|
87
|
+
return (_jsxs("div", { ref: pickerRef, children: [_jsx(Input, __assign({ name: name, "data-test": name, "data-cy": "".concat(name, "Inp"), value: fieldValue, label: label, onChange: onChangeTextInput, iconOnClick: !eqOnly ? togglePicker : undefined, appearance: "grid", icon: !eqOnly ? 'ellipsisVertical' : 'warning', iconPlacement: "right", iconTooltip: eqOnly ? eqOnlyTxt : undefined, type: "text", className: className, error: (!!validation && isInvalid && validation.errorMsg) || '', errorAppearance: 'tooltip', autoComplete: "off" }, rest)), isOpen && (_jsx(OverlayComponent, { children: _jsx(IconList, { list: renderedComparator, selected: comparator, onClick: onChangeComparator }) }))] }));
|
|
88
|
+
};
|
|
89
|
+
export default TextRange;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FilterComponentProps } from '../../types';
|
|
2
|
+
export type TextRangeComparator = 'like' | 'notLike' | 'eq' | 'neq' | 'startsWith' | 'endsWith';
|
|
3
|
+
export type TextRangeValue = {
|
|
4
|
+
comparator?: TextRangeComparator;
|
|
5
|
+
value?: string | number;
|
|
6
|
+
isInvalid?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type Comparator = {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
};
|
|
13
|
+
export type Props = FilterComponentProps<TextRangeValue> & {
|
|
14
|
+
eqOnly?: boolean;
|
|
15
|
+
isPresent?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
defaultComparator?: TextRangeValue['comparator'] & 'in';
|
|
18
|
+
validation?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
isEqual?: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import styled, { useTheme } from '@xstyled/styled-components';
|
|
8
|
+
import { th } from '@xstyled/system';
|
|
9
|
+
import get from 'lodash/fp/get';
|
|
10
|
+
import Icon from '../../../../Elements/Icon/Icon';
|
|
11
|
+
var Center = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n width: 100%;\n"], ["\n display: flex;\n justify-content: center;\n width: 100%;\n"])));
|
|
12
|
+
var BoolIcon = function (_a) {
|
|
13
|
+
var rowData = _a.rowData, column = _a.column;
|
|
14
|
+
var theme = useTheme();
|
|
15
|
+
var value = get(column.name, rowData);
|
|
16
|
+
var icon = value ? 'check' : 'false';
|
|
17
|
+
var colorName = value ? 'green' : 'lightGray3';
|
|
18
|
+
var themeColor = th.color(colorName)({ theme: theme });
|
|
19
|
+
return (_jsx(Center, { children: _jsx(Icon, { icon: icon, fill: themeColor, size: "14px" }) }));
|
|
20
|
+
};
|
|
21
|
+
export var BoolIconCell = React.memo(BoolIcon);
|
|
22
|
+
var templateObject_1;
|
|
@@ -10,5 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
|
|
14
|
-
export
|
|
13
|
+
import Button from '../../../../Elements/Button/Button';
|
|
14
|
+
export var ButtonInCell = function (props) {
|
|
15
|
+
return _jsx(Button, __assign({}, props, { appearance: "secondaryLg", sizing: "grid" }));
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import get from 'lodash/fp/get';
|
|
3
|
+
import { DateTime } from 'luxon';
|
|
4
|
+
export var DateCell = function (_a) {
|
|
5
|
+
var rowData = _a.rowData, column = _a.column;
|
|
6
|
+
var value = get(column.name, rowData);
|
|
7
|
+
return value ? _jsx("span", { className: "cell", children: DateTime.fromISO(value).toFormat('dd. MM. yyyy') }) : null;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import get from 'lodash/fp/get';
|
|
3
|
+
import { DateTime } from 'luxon';
|
|
4
|
+
var defaultProps = {
|
|
5
|
+
dateTimeFormat: 'dd. MM. yyyy HH:mm',
|
|
6
|
+
};
|
|
7
|
+
export var DateTimeCell = function (_a) {
|
|
8
|
+
var _b;
|
|
9
|
+
var rowData = _a.rowData, column = _a.column;
|
|
10
|
+
var value = get(column.name, rowData);
|
|
11
|
+
var dateTimeFormat = ((_b = column === null || column === void 0 ? void 0 : column.passProps) !== null && _b !== void 0 ? _b : defaultProps).dateTimeFormat;
|
|
12
|
+
return value ? _jsx("span", { className: "cell", children: DateTime.fromISO(value, { setZone: true }).toFormat(dateTimeFormat) }) : null;
|
|
13
|
+
};
|