@mailstep/design-system 0.4.21 → 0.5.0-beta.10
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 +33 -2
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +3 -0
- package/ui/Blocks/CommonGrid/CommonGrid.js +106 -0
- package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +67 -0
- package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +9 -0
- package/ui/Blocks/CommonGrid/CommonGridContext.js +32 -0
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.d.ts +2 -0
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +36 -0
- package/ui/Blocks/CommonGrid/StandardButtons.d.ts +6 -0
- package/ui/Blocks/CommonGrid/StandardButtons.js +50 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +53 -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 +35 -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.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +41 -0
- 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/ColumnTitle.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +20 -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/DataCell.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/DataCell.js +52 -0
- package/ui/Blocks/CommonGrid/components/DataRow.d.ts +21 -0
- package/ui/Blocks/CommonGrid/components/DataRow.js +110 -0
- 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/DropdownSelect/DropdownSelect.d.ts +21 -0
- package/ui/Blocks/CommonGrid/components/DropdownSelect/DropdownSelect.js +47 -0
- package/ui/Blocks/CommonGrid/components/DropdownSelect/index.d.ts +4 -0
- package/ui/Blocks/CommonGrid/components/DropdownSelect/index.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/FilterDropdown.d.ts +3 -0
- package/ui/Blocks/CommonGrid/components/FilterDropdown.js +36 -0
- package/ui/Blocks/CommonGrid/components/FilterRow.d.ts +15 -0
- package/ui/Blocks/CommonGrid/components/FilterRow.js +34 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +45 -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/GroupRow.d.ts +9 -0
- package/ui/Blocks/CommonGrid/components/GroupRow.js +27 -0
- package/ui/Blocks/CommonGrid/components/HeadCell.d.ts +27 -0
- package/ui/Blocks/CommonGrid/components/HeadCell.js +40 -0
- package/ui/Blocks/CommonGrid/components/HeadRow.d.ts +15 -0
- package/ui/Blocks/CommonGrid/components/HeadRow.js +69 -0
- package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.d.ts +6 -0
- package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.js +13 -0
- 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.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +21 -0
- 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/Resize.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/Resize.js +33 -0
- package/ui/Blocks/CommonGrid/components/Table.d.ts +10 -0
- package/ui/Blocks/CommonGrid/components/Table.js +25 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +7 -0
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +31 -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/gridCells/ButtonInCell.js +16 -0
- 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 +5 -0
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +19 -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/index.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +12 -0
- package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.js +14 -0
- package/ui/Blocks/CommonGrid/components/icons/Edit.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/Edit.js +14 -0
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +14 -0
- package/ui/Blocks/CommonGrid/components/icons/Sorting.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/icons/Sorting.js +14 -0
- package/ui/Blocks/CommonGrid/components/utils.d.ts +8 -0
- package/ui/Blocks/CommonGrid/components/utils.js +22 -0
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.d.ts +12 -0
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +83 -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/useGetGridHeight.d.ts +7 -0
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -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/useRowsKeyControls.d.ts +4 -0
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +21 -0
- package/ui/Blocks/CommonGrid/hooks/useUxReset.d.ts +3 -0
- package/ui/Blocks/CommonGrid/hooks/useUxReset.js +15 -0
- package/ui/Blocks/CommonGrid/index.d.ts +7 -0
- package/ui/Blocks/CommonGrid/index.js +7 -0
- package/ui/Blocks/CommonGrid/store/index.d.ts +58 -0
- package/ui/Blocks/CommonGrid/store/index.js +230 -0
- package/ui/Blocks/CommonGrid/store/migrateState.d.ts +3 -0
- package/ui/Blocks/CommonGrid/store/migrateState.js +14 -0
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +11 -0
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +31 -0
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +13 -0
- package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +49 -0
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +6 -0
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +14 -0
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +11 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +12 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +12 -0
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +6 -0
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +15 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +15 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +14 -0
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +24 -0
- package/ui/Blocks/CommonGrid/storybook/utils/actions.d.ts +4 -0
- package/ui/Blocks/CommonGrid/storybook/utils/actions.js +6 -0
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.d.ts +10 -0
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +97 -0
- package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/filters.js +23 -0
- package/ui/Blocks/CommonGrid/storybook/utils/utils.d.ts +17 -0
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +66 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +12 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +4 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +18 -0
- package/ui/Blocks/CommonGrid/styles.d.ts +12 -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 +313 -0
- package/ui/Blocks/CommonGrid/types.js +8 -0
- package/ui/Blocks/CommonGrid/utils/index.d.ts +19 -0
- package/ui/Blocks/CommonGrid/utils/index.js +78 -0
- package/ui/Blocks/CommonGrid/utils/public.d.ts +16 -0
- package/ui/Blocks/CommonGrid/utils/public.js +52 -0
- package/ui/Blocks/Popover/index.d.ts +10 -0
- package/ui/Blocks/Popover/index.js +19 -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/DatePicker/utils/getLanguage.d.ts +1 -0
- package/ui/Elements/DatePicker/utils/getLanguage.js +10 -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/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/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 +1 -1
- package/ui/Elements/Pagination/Pagination.js +6 -2
- 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 +9 -0
- package/ui/Elements/Select/themes/CustomComponents.js +131 -0
- package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
- package/ui/Elements/Select/themes/baseStyles.js +70 -0
- package/ui/Elements/Select/themes/formStyles.d.ts +23 -0
- package/ui/Elements/Select/themes/formStyles.js +104 -0
- package/ui/Elements/Select/themes/headingStyles.d.ts +17 -0
- package/ui/Elements/Select/themes/headingStyles.js +99 -0
- package/ui/Elements/Select/themes/index.d.ts +3 -0
- package/ui/Elements/Select/themes/index.js +61 -0
- package/ui/Elements/Select/themes/leftMenuStyles.d.ts +18 -0
- package/ui/Elements/Select/themes/leftMenuStyles.js +57 -0
- package/ui/Elements/Select/types.d.ts +54 -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/Forms/Input/types.d.ts +2 -2
- package/ui/index.es.js +868 -1104
- package/ui/index.umd.js +8 -5
|
@@ -0,0 +1,69 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import React, { useEffect, useState } from 'react';
|
|
23
|
+
import { DragDropContext, Droppable, Draggable, } from 'react-beautiful-dnd';
|
|
24
|
+
import { Row, Cell } from './Table';
|
|
25
|
+
import HeadCell from './HeadCell';
|
|
26
|
+
import { getActionCellSizeProps, getCellSizeProps, getSortName } from '../utils';
|
|
27
|
+
var getStickyComponent = function (columns, stickyTo, displayColumnsWidth) {
|
|
28
|
+
var _a;
|
|
29
|
+
return (_a = columns === null || columns === void 0 ? void 0 : columns.filter(function (item) { return item.sticky && item.stickTo === stickyTo; })) === null || _a === void 0 ? void 0 : _a.map(function (column) { return (_jsx(HeadCell, __assign({ name: column.name, systemName: column.systemName, isSortable: false, hasResize: false, isDragging: false, sortValue: null }, getCellSizeProps(column, displayColumnsWidth[column.name]), { title: column.title, sticky: column.sticky, stickTo: column.stickTo }), column.name)); });
|
|
30
|
+
};
|
|
31
|
+
var HeadRow = function (_a) {
|
|
32
|
+
var _b;
|
|
33
|
+
var columns = _a.columns, actionColumn = _a.actionColumn, onAddSort = _a.onAddSort, setColumnsOrder = _a.setColumnsOrder, columnsOrder = _a.columnsOrder, _c = _a.sortingValues, sortingValues = _c === void 0 ? [] : _c, displayColumnsWidth = _a.displayColumnsWidth, columnLayout = _a.columnLayout, handleResizeDrag = _a.handleResizeDrag, groups = _a.groups;
|
|
34
|
+
var _d = useState(false), showUIElements = _d[0], setShowUIElements = _d[1];
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
setShowUIElements(true);
|
|
37
|
+
}, []);
|
|
38
|
+
var handleDragEnd = React.useCallback(function (item) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
var to = (_a = item.destination) === null || _a === void 0 ? void 0 : _a.index;
|
|
41
|
+
var from = (_b = item.source) === null || _b === void 0 ? void 0 : _b.index;
|
|
42
|
+
if (to === from || !item.destination) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
var newOrderColumns = __spreadArray([], (columnsOrder || []), true);
|
|
46
|
+
var fromIndex = newOrderColumns.findIndex(function (column) { return columns[from].name === column; });
|
|
47
|
+
var toIndex = newOrderColumns.findIndex(function (column) { return to && columns[to].name === column; });
|
|
48
|
+
// move column from a position to the new position
|
|
49
|
+
var column = newOrderColumns[fromIndex];
|
|
50
|
+
newOrderColumns.splice(fromIndex, 1);
|
|
51
|
+
newOrderColumns.splice(toIndex, 0, column);
|
|
52
|
+
setColumnsOrder(newOrderColumns);
|
|
53
|
+
}, [setColumnsOrder, columnsOrder, columns]);
|
|
54
|
+
var _e = useState(false), isDragDisabled = _e[0], setIsDragDisabled = _e[1];
|
|
55
|
+
var onResizeOver = React.useCallback(function () {
|
|
56
|
+
setIsDragDisabled(true);
|
|
57
|
+
}, [setIsDragDisabled]);
|
|
58
|
+
var onResizeOut = React.useCallback(function () {
|
|
59
|
+
setIsDragDisabled(false);
|
|
60
|
+
}, [setIsDragDisabled]);
|
|
61
|
+
var displayReadEditCell = ((_b = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _b === void 0 ? void 0 : _b.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowEdit) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowRead) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes);
|
|
62
|
+
return (_jsx(_Fragment, { children: showUIElements && (_jsx(DragDropContext, { onDragEnd: handleDragEnd, children: _jsx(Droppable, { droppableId: "droppable", direction: "horizontal", isDropDisabled: isDragDisabled, children: function (droppableProvided) { return (_jsxs(Row, __assign({ className: "headRow", accountForScrollbar: false, innerRef: droppableProvided.innerRef }, droppableProvided.droppableProps, { children: [actionColumn && (_jsxs(_Fragment, { children: [displayReadEditCell && (_jsx(Cell, { className: "cell", style: Object.assign(__assign({}, getActionCellSizeProps(actionColumn))) })), (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbers) && (_jsx(Cell, { className: "cell", style: Object.assign(__assign({}, getActionCellSizeProps(actionColumn))) }))] })), getStickyComponent(columns, 'left', displayColumnsWidth), columns
|
|
63
|
+
.filter(function (item) { return !item.sticky; })
|
|
64
|
+
.map(function (column, key) { return (_jsx(Draggable, { draggableId: column.name, index: key, isDragDisabled: isDragDisabled || column.sticky, children: function (draggableProvided, snapshot) {
|
|
65
|
+
var _a;
|
|
66
|
+
return (_jsx(HeadCell, __assign({ name: column.name, systemName: column.systemName, onAddSort: onAddSort, isSortable: !!column.sorting, sortValue: ((_a = sortingValues.find(function (sorting) { return sorting.column == getSortName(column); })) === null || _a === void 0 ? void 0 : _a.direction) || null, innerRef: draggableProvided.innerRef, handleResizeDrag: handleResizeDrag, hasResize: columnLayout == 'normal' || !!columns[key + 1], draggableProps: draggableProvided.draggableProps, dragHandleProps: draggableProvided.dragHandleProps, isDragging: snapshot.isDragging, onResizeOver: onResizeOver, onResizeOut: onResizeOut }, getCellSizeProps(column, displayColumnsWidth[column.name]), { group: groups[key], title: column.title, sticky: column.sticky, stickTo: column.stickTo })));
|
|
67
|
+
} }, column.name)); }), getStickyComponent(columns, 'right', displayColumnsWidth), droppableProvided.placeholder] }))); } }) })) }));
|
|
68
|
+
};
|
|
69
|
+
export default HeadRow;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
var HideWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: content;\n @media print {\n display: none;\n }\n"], ["\n display: content;\n @media print {\n display: none;\n }\n"])));
|
|
8
|
+
var HidePrint = function (_a) {
|
|
9
|
+
var children = _a.children;
|
|
10
|
+
return _jsx(HideWrapper, { children: children });
|
|
11
|
+
};
|
|
12
|
+
export default HidePrint;
|
|
13
|
+
var templateObject_1;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const List: import("styled-components").StyledComponent<"ul", import("@xstyled/system").Theme, {}, never>;
|
|
2
|
+
export declare const ListItem: import("styled-components").StyledComponent<"li", import("@xstyled/system").Theme, {}, never>;
|
|
3
|
+
export declare const ListItemContent: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {
|
|
4
|
+
selected?: boolean | undefined;
|
|
5
|
+
}, never>;
|
|
6
|
+
export declare const ListItemIcon: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {}, never>;
|
|
7
|
+
type Item = {
|
|
8
|
+
value: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
type IconListProps = {
|
|
13
|
+
list: Item[];
|
|
14
|
+
selected: string;
|
|
15
|
+
onClick: (item: Item) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const IconList: ({ list, selected, onClick }: IconListProps) => JSX.Element;
|
|
18
|
+
export default IconList;
|
|
@@ -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 { t } from '@lingui/macro';
|
|
4
|
+
import { x } from '@xstyled/styled-components';
|
|
5
|
+
import { ActionRow } from './components/ActionRow';
|
|
6
|
+
import { Input } from '../../../../Forms/Input/Input';
|
|
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: t({ 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 { t } from '@lingui/macro';
|
|
20
|
+
import styled from 'styled-components';
|
|
21
|
+
import Toggle from '../../../../../Elements/Toggle/Toggle';
|
|
22
|
+
import { Group } from '../../../../../Elements/Icon/icons/Group';
|
|
23
|
+
import { isObject } from 'lodash';
|
|
24
|
+
import { H6 } from '../../../../../Elements/Typography/Typography';
|
|
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
|
+
t({ 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 { t } from '@lingui/macro';
|
|
26
|
+
import { useClickOutside } from '../../../Modal/hooks/useClickOutside';
|
|
27
|
+
import { Input } from '../../../../Forms/Input/Input';
|
|
28
|
+
import IconList from '../IconList';
|
|
29
|
+
var OverlayComponentDefault = function (_a) {
|
|
30
|
+
var children = _a.children;
|
|
31
|
+
return _jsx("div", { children: children });
|
|
32
|
+
};
|
|
33
|
+
var createNumberComparators = function () { return [
|
|
34
|
+
{ label: t({ id: 'dataGrid.comparator.equals', message: 'Equals' }), value: 'eq', icon: 'equals' },
|
|
35
|
+
{ label: t({ id: 'dataGrid.comparator.notEquals', message: 'Not equal' }), value: 'neq', icon: 'notEqual' },
|
|
36
|
+
{ label: t({ id: 'dataGrid.comparator.lessThan', message: 'Less than' }), value: 'lt', icon: 'lessThen' },
|
|
37
|
+
{
|
|
38
|
+
label: t({ id: 'dataGrid.comparator.lessThanOrEquals', message: 'Less than or equals' }),
|
|
39
|
+
value: 'lte',
|
|
40
|
+
icon: 'lessThanEqual',
|
|
41
|
+
},
|
|
42
|
+
{ label: t({ id: 'dataGrid.comparator.greaterThan', message: 'Greater than' }), value: 'gt', icon: 'greaterThan' },
|
|
43
|
+
{
|
|
44
|
+
label: t({ id: 'dataGrid.comparator.greaterThanOrEquals', message: 'Greater than or equal' }),
|
|
45
|
+
value: 'gte',
|
|
46
|
+
icon: 'greaterThanEqual',
|
|
47
|
+
},
|
|
48
|
+
]; };
|
|
49
|
+
var createEqualComparators = [
|
|
50
|
+
{ label: t({ id: 'dataGrid.comparator.equals', message: 'Equals' }), value: 'eq', icon: 'equals' },
|
|
51
|
+
{ label: t({ 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 {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonGridProps } from '../types';
|
|
3
|
+
type OversizedScrollProps = {
|
|
4
|
+
columnLayout: Required<CommonGridProps>['columnLayout'];
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
floatingChildren?: React.ReactNode;
|
|
8
|
+
totalColumnsWidth: number;
|
|
9
|
+
};
|
|
10
|
+
declare const forwardedWrapper: React.ForwardRefExoticComponent<OversizedScrollProps & React.RefAttributes<any>>;
|
|
11
|
+
export default forwardedWrapper;
|
|
@@ -0,0 +1,21 @@
|
|
|
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, { css } from '@xstyled/styled-components';
|
|
8
|
+
var ScrollWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n\n min-height: ", ";\n"], ["\n ", ";\n\n min-height: ", ";\n"])), function (props) {
|
|
9
|
+
return props.columnLayout != 'no-scroll' && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow-x: ", ";\n position: relative;\n @media (min-width: 1024px) {\n overflow-x: auto;\n }\n "], ["\n overflow-x: ", ";\n position: relative;\n @media (min-width: 1024px) {\n overflow-x: auto;\n }\n "])), props.columnLayout == 'sticky' ? 'inherit' : 'auto');
|
|
10
|
+
}, function (props) { return (props.columnLayout == 'normal' ? '360px' : '0'); });
|
|
11
|
+
var ScrollSizer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (props) {
|
|
12
|
+
return props.columnLayout != 'no-scroll' && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", "px;\n "], ["\n width: ", "px;\n "])), props.totalColumnsWidth);
|
|
13
|
+
});
|
|
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
|
+
var OversizedScroll = function (_a, ref) {
|
|
16
|
+
var columnLayout = _a.columnLayout, isLoading = _a.isLoading, children = _a.children, floatingChildren = _a.floatingChildren, totalColumnsWidth = _a.totalColumnsWidth;
|
|
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 })] }));
|
|
18
|
+
};
|
|
19
|
+
var forwardedWrapper = React.forwardRef(OversizedScroll);
|
|
20
|
+
export default forwardedWrapper;
|
|
21
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { useCallback } from 'react';
|
|
7
|
+
import styled from '@xstyled/styled-components';
|
|
8
|
+
var Resizer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 7px;\n cursor: col-resize;\n position: absolute;\n z-index: 2;\n right: 0px;\n top: 0px;\n border-left: 1px dotted;\n border-right: 1px dotted;\n border-left-color: primary;\n border-right-color: primary;\n opacity: 0;\n transition: opacity 0.6s;\n &:hover {\n opacity: 1;\n }\n"], ["\n height: 100%;\n width: 7px;\n cursor: col-resize;\n position: absolute;\n z-index: 2;\n right: 0px;\n top: 0px;\n border-left: 1px dotted;\n border-right: 1px dotted;\n border-left-color: primary;\n border-right-color: primary;\n opacity: 0;\n transition: opacity 0.6s;\n &:hover {\n opacity: 1;\n }\n"])));
|
|
9
|
+
var Resize = function (_a) {
|
|
10
|
+
var onResize = _a.onResize, onResizeOver = _a.onResizeOver, onResizeOut = _a.onResizeOut;
|
|
11
|
+
var handleMouseDown = useCallback(function (downEvent) {
|
|
12
|
+
if ((downEvent === null || downEvent === void 0 ? void 0 : downEvent.button) !== 0) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
var initialPosX = downEvent === null || downEvent === void 0 ? void 0 : downEvent.pageX;
|
|
16
|
+
var handleMouseMove = function (moveEvent) {
|
|
17
|
+
onResize(moveEvent.pageX - initialPosX);
|
|
18
|
+
};
|
|
19
|
+
var handleMouseUp = function (upEvent) {
|
|
20
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
21
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
22
|
+
upEvent.stopPropagation();
|
|
23
|
+
upEvent.preventDefault();
|
|
24
|
+
};
|
|
25
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
26
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
27
|
+
downEvent.stopPropagation();
|
|
28
|
+
downEvent.preventDefault();
|
|
29
|
+
}, [onResize]);
|
|
30
|
+
return _jsx(Resizer, { className: "resizer", onMouseDown: handleMouseDown, onMouseOver: onResizeOver, onMouseOut: onResizeOut });
|
|
31
|
+
};
|
|
32
|
+
export default Resize;
|
|
33
|
+
var templateObject_1;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const StyledRow: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
2
|
+
hasRowClick: boolean;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const Row: (props: any) => JSX.Element;
|
|
5
|
+
export declare const StyledDataRow: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {
|
|
6
|
+
isEven: boolean;
|
|
7
|
+
}, never>;
|
|
8
|
+
export declare const Cell: (props: any) => JSX.Element;
|
|
9
|
+
export declare const TextCell: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
|
|
10
|
+
export declare const MessageCell: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
17
|
+
import styled, { system, th } from '@xstyled/styled-components';
|
|
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'); });
|
|
19
|
+
export var Row = function (props) { return _jsx(StyledRow, __assign({ ref: props.innerRef }, props)); };
|
|
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; });
|
|
21
|
+
export var StyledDataRow = styled(Row)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (props) { return (props.isEven ? th('colors.bgLightGray') : 'white'); });
|
|
22
|
+
export var Cell = function (props) { return _jsx(StyledCell, __assign({ ref: props.innerRef }, props)); };
|
|
23
|
+
export var TextCell = styled(Cell)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n text-overflow: ellipsis;\n white-space: nowrap;\n"], ["\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
24
|
+
export var MessageCell = styled(Cell)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
|
|
25
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GridActionsType, GridSelectorsType } from '../../types';
|
|
2
|
+
type Props = {
|
|
3
|
+
gridActions: GridActionsType;
|
|
4
|
+
gridSelectors: GridSelectorsType;
|
|
5
|
+
};
|
|
6
|
+
declare const TablePagination: ({ gridActions, gridSelectors }: Props) => JSX.Element;
|
|
7
|
+
export default TablePagination;
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|
|
18
|
+
var setRowsPerPage = gridActions.setRowsPerPage, setPage = gridActions.setPage;
|
|
19
|
+
var onSetRowsPerPage = useCallback(function (option) {
|
|
20
|
+
if (option && 'value' in option) {
|
|
21
|
+
setRowsPerPage === null || setRowsPerPage === void 0 ? void 0 : setRowsPerPage(Number(option.value));
|
|
22
|
+
setPage === null || setPage === void 0 ? void 0 : setPage(gridSelectors.page);
|
|
23
|
+
}
|
|
24
|
+
}, [gridSelectors.page, setPage, setRowsPerPage]);
|
|
25
|
+
var rowsPerPageOptions = useMemo(function () {
|
|
26
|
+
return rowsPerPageOptionValues.map(function (value) { return ({ value: value, label: value }); });
|
|
27
|
+
}, []);
|
|
28
|
+
return (_jsxs(Wrapper, { children: [_jsx(StyledSelect, { minWidth: "80px", children: _jsx(Select, { name: "rowsPerPage", 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" }) })] }));
|
|
29
|
+
};
|
|
30
|
+
export default TablePagination;
|
|
31
|
+
var templateObject_1, templateObject_2;
|