@mailstep/design-system 0.6.2-beta.8 → 0.6.2-beta.9
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 +5 -4
- package/ui/Blocks/CommonGrid/CommonGrid.js +33 -38
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +28 -33
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +8 -10
- package/ui/Blocks/CommonGrid/StandardButtons.js +11 -20
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +21 -26
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +8 -13
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +20 -48
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +10 -15
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +14 -19
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +17 -22
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +22 -50
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +8 -13
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +9 -38
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/DataCell.js +13 -18
- package/ui/Blocks/CommonGrid/components/DataRow.js +30 -35
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +31 -59
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +1 -5
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +12 -41
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/FilterDropdown.js +8 -13
- package/ui/Blocks/CommonGrid/components/FilterRow.js +15 -20
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +17 -23
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +10 -15
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/GroupRow.js +10 -15
- package/ui/Blocks/CommonGrid/components/HeadCell.js +14 -19
- package/ui/Blocks/CommonGrid/components/HeadRow.js +17 -45
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +12 -18
- package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +12 -14
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +17 -24
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +23 -28
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -2
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +11 -39
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +10 -12
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/Resize.js +7 -12
- package/ui/Blocks/CommonGrid/components/Table.js +9 -37
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +12 -40
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +30 -36
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -2
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +12 -41
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +4 -11
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +6 -13
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +6 -13
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +9 -16
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +8 -15
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +8 -15
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +9 -16
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +3 -9
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +11 -18
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +13 -20
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +5 -12
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +4 -11
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +10 -40
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +14 -31
- package/ui/Blocks/CommonGrid/components/icons/Edit.js +3 -5
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +3 -5
- package/ui/Blocks/CommonGrid/components/icons/Sorting.js +3 -8
- package/ui/Blocks/CommonGrid/components/utils.js +3 -7
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +6 -10
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +13 -18
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +7 -12
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +3 -5
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +9 -11
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +7 -14
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +6 -8
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +3 -8
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +4 -8
- package/ui/Blocks/CommonGrid/hooks/useUxReset.js +4 -9
- package/ui/Blocks/CommonGrid/index.js +10 -51
- package/ui/Blocks/CommonGrid/store/index.js +77 -86
- package/ui/Blocks/CommonGrid/store/migrateState.js +1 -3
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +17 -24
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +12 -19
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +8 -15
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +8 -15
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +8 -15
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +12 -19
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +10 -17
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +12 -19
- package/ui/Blocks/CommonGrid/storybook/utils/actions.js +4 -11
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +11 -17
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +6 -10
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +26 -35
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +10 -17
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +4 -6
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +1 -3
- package/ui/Blocks/CommonGrid/styles.js +10 -39
- package/ui/Blocks/CommonGrid/translations.js +3 -5
- package/ui/Blocks/CommonGrid/types.js +3 -6
- package/ui/Blocks/CommonGrid/utils/index.js +23 -40
- package/ui/Blocks/CornerDialog/CornerDialog.js +11 -15
- package/ui/Blocks/CornerDialog/index.js +2 -4
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.js +7 -10
- package/ui/Blocks/CornerDialog/styles.js +9 -35
- package/ui/Blocks/CornerDialog/types.js +1 -2
- package/ui/Blocks/CornerDialog/utils.js +2 -5
- package/ui/Blocks/HidePrint/HidePrint.js +5 -10
- package/ui/Blocks/ImageList/ImageList.js +15 -42
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +7 -11
- package/ui/Blocks/ImageList/components/AddPhoto/styles.js +3 -29
- package/ui/Blocks/ImageList/components/CloseButton/index.js +5 -9
- package/ui/Blocks/ImageList/components/CloseButton/styles.js +3 -29
- package/ui/Blocks/ImageList/components/ImageElement/index.js +7 -11
- package/ui/Blocks/ImageList/components/ImageElement/styles.js +3 -29
- package/ui/Blocks/ImageList/components/ImageTag/index.js +5 -12
- package/ui/Blocks/ImageList/components/ImageTag/styles.js +2 -8
- package/ui/Blocks/ImageList/index.js +2 -4
- package/ui/Blocks/ImageList/stories/ImageList.stories.js +6 -9
- package/ui/Blocks/ImageList/styles.js +2 -8
- package/ui/Blocks/ImageList/types.js +1 -2
- package/ui/Blocks/LightBox/LightBox.js +8 -15
- package/ui/Blocks/LightBox/hooks/useLightBox.js +5 -9
- package/ui/Blocks/LightBox/index.js +3 -7
- package/ui/Blocks/LightBox/stories/LightBox.stories.js +4 -7
- package/ui/Blocks/LightBox/styles.js +5 -11
- package/ui/Blocks/LightBox/types.js +1 -2
- package/ui/Blocks/Modal/Modal.js +17 -20
- package/ui/Blocks/Modal/hooks/useClickOutside.js +6 -10
- package/ui/Blocks/Modal/hooks/useModal.js +6 -10
- package/ui/Blocks/Modal/index.js +4 -9
- package/ui/Blocks/Modal/stories/Modal.stories.js +42 -48
- package/ui/Blocks/Modal/styles.js +20 -46
- package/ui/Blocks/Modal/types.js +1 -2
- package/ui/Blocks/Modal/utils.js +1 -4
- package/ui/Blocks/Popover/index.js +10 -15
- package/ui/Blocks/Tabs/TabContent.js +1 -5
- package/ui/Blocks/Tabs/Tabs.js +10 -14
- package/ui/Blocks/Tabs/hooks/useTabs.js +4 -8
- package/ui/Blocks/Tabs/index.js +4 -9
- package/ui/Blocks/Tabs/stories/Tabs.stories.js +6 -9
- package/ui/Blocks/Tabs/styles.js +8 -34
- package/ui/Blocks/Tabs/types.js +1 -2
- package/ui/Elements/Alert/Alert.js +10 -12
- package/ui/Elements/Alert/index.js +3 -9
- package/ui/Elements/Alert/stories/Alert.stories.js +11 -14
- package/ui/Elements/Alert/styles.js +14 -20
- package/ui/Elements/Alert/types.js +1 -2
- package/ui/Elements/Avatar/Avatar.js +7 -14
- package/ui/Elements/Avatar/index.js +3 -7
- package/ui/Elements/Avatar/stories/Avatar.stories.js +5 -8
- package/ui/Elements/Avatar/types.js +1 -2
- package/ui/Elements/Badge/Badge.js +13 -38
- package/ui/Elements/Badge/index.js +3 -9
- package/ui/Elements/Badge/stories/Badge.stories.js +5 -11
- package/ui/Elements/BorderedBox/BorderedBox.js +5 -30
- package/ui/Elements/BorderedBox/index.js +3 -9
- package/ui/Elements/BorderedBox/stories/BorderedBox.stories.js +4 -7
- package/ui/Elements/BorderedBox/types.js +1 -2
- package/ui/Elements/Button/Button.js +5 -7
- package/ui/Elements/Button/index.js +3 -9
- package/ui/Elements/Button/stories/Button.stories.js +13 -16
- package/ui/Elements/Button/styles.js +8 -14
- package/ui/Elements/Button/types.js +1 -2
- package/ui/Elements/Card/Card.js +14 -20
- package/ui/Elements/Card/index.js +3 -12
- package/ui/Elements/Card/stories/Card.stories.js +8 -11
- package/ui/Elements/Card/stories/CardComponent.stories.js +6 -12
- package/ui/Elements/Card/styles.js +12 -38
- package/ui/Elements/Card/types.js +1 -2
- package/ui/Elements/DatePicker/DatePicker.js +25 -53
- package/ui/Elements/DatePicker/Datetime/DateTime.js +26 -31
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +20 -47
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +3 -6
- package/ui/Elements/DatePicker/Datetime/types.js +1 -2
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +13 -18
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +9 -14
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +9 -14
- package/ui/Elements/DatePicker/index.js +2 -7
- package/ui/Elements/DatePicker/styles.js +3 -29
- package/ui/Elements/Dropdown/Dropdown.js +10 -15
- package/ui/Elements/Dropdown/index.js +3 -9
- package/ui/Elements/Dropdown/stories/Dropdown.stories.js +4 -10
- package/ui/Elements/Dropdown/types.js +1 -2
- package/ui/Elements/DropdownMenu/DropdownMenu.js +8 -15
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +7 -32
- package/ui/Elements/DropdownMenu/components/MenuItem.js +10 -15
- package/ui/Elements/DropdownMenu/components/MenuList.js +5 -10
- package/ui/Elements/DropdownMenu/index.js +1 -5
- package/ui/Elements/DropdownMenu/types.js +1 -2
- package/ui/Elements/DropdownSelect/DropdownSelect.js +21 -50
- package/ui/Elements/DropdownSelect/index.js +3 -10
- package/ui/Elements/ErrorMessage/ErrorMessage.js +9 -34
- package/ui/Elements/ErrorMessage/index.js +3 -9
- package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.js +5 -11
- package/ui/Elements/ErrorMessage/types.js +1 -2
- package/ui/Elements/HighlightBox/HighlightBox.js +12 -38
- package/ui/Elements/HighlightBox/index.js +2 -7
- package/ui/Elements/Icon/BadgeIcon.js +10 -17
- package/ui/Elements/Icon/Icon.js +216 -245
- package/ui/Elements/Icon/icons/AddPhoto.js +2 -6
- package/ui/Elements/Icon/icons/BarcodeScan.js +2 -6
- package/ui/Elements/Icon/icons/Box.js +2 -6
- package/ui/Elements/Icon/icons/Calendar.js +2 -6
- package/ui/Elements/Icon/icons/Cancel.js +2 -6
- package/ui/Elements/Icon/icons/CheckedBox.js +2 -6
- package/ui/Elements/Icon/icons/Company.js +2 -6
- package/ui/Elements/Icon/icons/Complaint.js +2 -6
- package/ui/Elements/Icon/icons/Consolidation.js +2 -6
- package/ui/Elements/Icon/icons/Dispatch.js +2 -6
- package/ui/Elements/Icon/icons/EmptyRack.js +2 -6
- package/ui/Elements/Icon/icons/Expeditions.js +2 -6
- package/ui/Elements/Icon/icons/FlagCZ.js +2 -6
- package/ui/Elements/Icon/icons/FlagEL.js +2 -6
- package/ui/Elements/Icon/icons/FlagESP.js +2 -6
- package/ui/Elements/Icon/icons/FlagITA.js +2 -6
- package/ui/Elements/Icon/icons/FlagRUS.js +2 -6
- package/ui/Elements/Icon/icons/FlagSVK.js +2 -6
- package/ui/Elements/Icon/icons/FlagUSA.js +2 -6
- package/ui/Elements/Icon/icons/Gift.js +2 -6
- package/ui/Elements/Icon/icons/Group.js +2 -6
- package/ui/Elements/Icon/icons/HamburgerMenu.js +2 -6
- package/ui/Elements/Icon/icons/HelpCircle1.js +2 -6
- package/ui/Elements/Icon/icons/ImagePlaceholder.js +2 -6
- package/ui/Elements/Icon/icons/Income.js +2 -6
- package/ui/Elements/Icon/icons/Info.js +2 -6
- package/ui/Elements/Icon/icons/Integrations.js +2 -6
- package/ui/Elements/Icon/icons/Inventory.js +2 -6
- package/ui/Elements/Icon/icons/Inventory2.js +2 -6
- package/ui/Elements/Icon/icons/Link.js +2 -6
- package/ui/Elements/Icon/icons/Location.js +2 -6
- package/ui/Elements/Icon/icons/Logout1.js +2 -6
- package/ui/Elements/Icon/icons/MakePhoto.js +2 -6
- package/ui/Elements/Icon/icons/MenuItems.js +2 -6
- package/ui/Elements/Icon/icons/MobileCancel.js +2 -6
- package/ui/Elements/Icon/icons/Notification2.js +2 -6
- package/ui/Elements/Icon/icons/OpenBox.js +2 -6
- package/ui/Elements/Icon/icons/Plus1.js +2 -6
- package/ui/Elements/Icon/icons/Print.js +2 -6
- package/ui/Elements/Icon/icons/Product.js +2 -6
- package/ui/Elements/Icon/icons/Products.js +2 -6
- package/ui/Elements/Icon/icons/Profile.js +2 -6
- package/ui/Elements/Icon/icons/Puzzle1.js +2 -6
- package/ui/Elements/Icon/icons/QRCode.js +2 -6
- package/ui/Elements/Icon/icons/Rack.js +2 -6
- package/ui/Elements/Icon/icons/Return.js +2 -6
- package/ui/Elements/Icon/icons/Rows.js +2 -6
- package/ui/Elements/Icon/icons/Settings2.js +2 -6
- package/ui/Elements/Icon/icons/ShoppingBag.js +2 -6
- package/ui/Elements/Icon/icons/ThreeDots.js +2 -6
- package/ui/Elements/Icon/icons/Transfer.js +2 -6
- package/ui/Elements/Icon/icons/Truck.js +2 -6
- package/ui/Elements/Icon/icons/TwoBoxes.js +2 -6
- package/ui/Elements/Icon/icons/TwoCheckedBoxes.js +2 -6
- package/ui/Elements/Icon/icons/TwoUsers.js +2 -6
- package/ui/Elements/Icon/icons/index.js +55 -114
- package/ui/Elements/Icon/index.js +5 -26
- package/ui/Elements/Icon/stories/BadgeIcon.stories.js +6 -12
- package/ui/Elements/Icon/stories/Icon.stories.js +9 -12
- package/ui/Elements/Icon/types.js +1 -2
- package/ui/Elements/Image/Image.js +4 -6
- package/ui/Elements/Image/index.js +3 -9
- package/ui/Elements/Image/stories/Image.stories.js +9 -15
- package/ui/Elements/Image/types.js +1 -2
- package/ui/Elements/Label/Label.js +9 -35
- package/ui/Elements/Label/index.js +3 -8
- package/ui/Elements/Label/stories/Label.stories.js +5 -8
- package/ui/Elements/Line/Line.js +5 -10
- package/ui/Elements/Line/index.js +3 -9
- package/ui/Elements/Line/stories/Line.stories.js +10 -16
- package/ui/Elements/Line/types.js +1 -2
- package/ui/Elements/Link/Link.js +14 -39
- package/ui/Elements/Link/index.js +3 -9
- package/ui/Elements/Link/stories/Link.stories.js +10 -13
- package/ui/Elements/Logo/Logo.js +25 -30
- package/ui/Elements/Logo/index.js +3 -9
- package/ui/Elements/Logo/stories/Logo.stories.js +18 -24
- package/ui/Elements/Logo/types.js +1 -2
- package/ui/Elements/MultiSelect/MultiSelect.js +4 -9
- package/ui/Elements/MultiSelect/index.js +2 -7
- package/ui/Elements/Pagination/Pagination.js +7 -9
- package/ui/Elements/Pagination/index.js +3 -9
- package/ui/Elements/Pagination/stories/Pagination.stories.js +5 -8
- package/ui/Elements/Pagination/styled.js +12 -41
- package/ui/Elements/Portal/index.js +7 -14
- package/ui/Elements/ProgressBar/ProgressBar.js +4 -6
- package/ui/Elements/ProgressBar/index.js +3 -9
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.js +6 -12
- package/ui/Elements/ProgressBar/styles.js +12 -38
- package/ui/Elements/Select/Select.js +20 -25
- package/ui/Elements/Select/index.js +2 -7
- package/ui/Elements/Select/styles.js +7 -13
- package/ui/Elements/Select/themes/CustomComponents.js +37 -72
- package/ui/Elements/Select/themes/baseStyles.js +6 -12
- package/ui/Elements/Select/themes/formStyles.js +23 -27
- package/ui/Elements/Select/themes/index.js +16 -20
- package/ui/Elements/Select/types.js +1 -2
- package/ui/Elements/SimpleLink/SimpleLink.js +6 -31
- package/ui/Elements/SimpleLink/index.js +3 -9
- package/ui/Elements/SingleSelect/SingleSelect.js +27 -32
- package/ui/Elements/SingleSelect/index.js +2 -7
- package/ui/Elements/SpaceAround/SpaceAround.js +11 -36
- package/ui/Elements/SpaceAround/index.js +3 -9
- package/ui/Elements/SpaceAround/stories/SpaceAround.stories.js +5 -8
- package/ui/Elements/SpaceAround/types.js +1 -2
- package/ui/Elements/Spinner/Spinner.js +8 -12
- package/ui/Elements/Spinner/index.js +3 -9
- package/ui/Elements/Spinner/stories/Spinner.stories.js +13 -16
- package/ui/Elements/Spinner/styles.js +7 -33
- package/ui/Elements/Spinner/types.js +1 -2
- package/ui/Elements/Tag/Tag.js +6 -31
- package/ui/Elements/Tag/index.js +3 -10
- package/ui/Elements/Tag/palletes.js +1 -4
- package/ui/Elements/Tag/stories/Tag.stories.js +15 -21
- package/ui/Elements/Tag/stories/components/predefinedTags.js +6 -11
- package/ui/Elements/Tag/types.js +1 -2
- package/ui/Elements/Text/Text.js +4 -6
- package/ui/Elements/Text/index.js +2 -8
- package/ui/Elements/Text/stories/Text.stories.js +9 -15
- package/ui/Elements/Text/types.js +1 -2
- package/ui/Elements/Toast/Toast.js +10 -15
- package/ui/Elements/Toast/index.js +3 -9
- package/ui/Elements/Toggle/Toggle.js +13 -38
- package/ui/Elements/Toggle/index.js +3 -9
- package/ui/Elements/Toggle/stories/Toggle.stories.js +7 -13
- package/ui/Elements/Toggle/types.js +1 -2
- package/ui/Elements/Typography/Typography.js +28 -44
- package/ui/Elements/Typography/index.js +3 -19
- package/ui/Elements/Typography/stories/Typography.stories.js +15 -18
- package/ui/Forms/Checkbox/Checkbox.js +9 -11
- package/ui/Forms/Checkbox/index.js +3 -9
- package/ui/Forms/Checkbox/stories/Checkbox.stories.js +7 -13
- package/ui/Forms/Checkbox/styles.js +6 -32
- package/ui/Forms/Checkbox/types.js +1 -2
- package/ui/Forms/Input/Input.js +16 -20
- package/ui/Forms/Input/index.js +3 -6
- package/ui/Forms/Input/stories/Input.stories.js +11 -14
- package/ui/Forms/Input/styles.js +20 -46
- package/ui/Forms/Input/types.js +1 -2
- package/ui/Forms/RadioButton/RadioButton.js +6 -8
- package/ui/Forms/RadioButton/index.js +3 -9
- package/ui/Forms/RadioButton/stories/RadioButton.stories.js +7 -13
- package/ui/Forms/RadioButton/styles.js +7 -13
- package/ui/Forms/RadioButton/types.js +1 -2
- package/ui/Forms/TextArea/TextArea.js +8 -13
- package/ui/Forms/TextArea/index.js +2 -7
- package/ui/Forms/TextArea/styles.js +13 -39
- package/ui/System/Fonts/index.js +9 -14
- package/ui/ThemeProvider/ThemeProvider.js +7 -13
- package/ui/ThemeProvider/index.js +5 -25
- package/ui/ThemeProvider/themes/default.js +1 -3
- package/ui/ThemeProvider/themes/index.js +7 -12
- package/ui/ThemeProvider/themes/light.js +1 -3
- package/ui/ThemeProvider/themes/mailwise.js +1 -3
- package/ui/ThemeProvider/types.js +1 -2
- package/ui/index.es.js +6718 -6711
- package/ui/index.js +85 -146
- package/ui/index.umd.js +315 -315
- package/ui/utils/CreateRgba/createRgba.js +5 -12
- package/ui/utils/CreateRgba/types.js +1 -2
- package/ui/utils/KeyPress/KeyPress.js +4 -6
- package/ui/utils/KeyPress/KeyPress.stories.js +6 -12
- package/ui/utils/KeyPress/index.js +2 -7
- package/ui/utils/KeyPress/types.js +1 -2
- package/ui/utils/index.js +6 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.6.2-beta.
|
|
3
|
+
"version": "0.6.2-beta.9",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"storybook": "storybook dev -p 6006",
|
|
15
|
-
"build": "rm -rf ./build && tsc && vite build && cp package.json build && cp README.md build",
|
|
15
|
+
"build": "rm -rf ./build && tsc && tsc-alias && vite build && cp package.json build && cp README.md build",
|
|
16
16
|
"build-storybook": "storybook build",
|
|
17
17
|
"deploy": "npm run build && npm publish ./build",
|
|
18
18
|
"dev": "yarn storybook",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@fortawesome/pro-regular-svg-icons": "^6.0.0",
|
|
31
31
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
32
32
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
33
|
-
"@lingui/react": "3.17.2",
|
|
34
33
|
"@lingui/core": "3.17.2",
|
|
34
|
+
"@lingui/react": "3.17.2",
|
|
35
35
|
"@popperjs/core": "^2.11.8",
|
|
36
36
|
"@storybook/addon-controls": "7.6.8",
|
|
37
37
|
"@storybook/addon-essentials": "7.6.8",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"string-width": "6.1.0",
|
|
84
84
|
"styled-components": "^5.3.10",
|
|
85
85
|
"swiper": "^11.0.3",
|
|
86
|
+
"tsc-alias": "^1.8.8",
|
|
86
87
|
"tslib": "^2.6.2",
|
|
87
88
|
"typescript": "^5.0.4",
|
|
88
89
|
"vite": "^5.0.10",
|
|
@@ -98,8 +99,8 @@
|
|
|
98
99
|
"@fortawesome/pro-regular-svg-icons": "^6.0.0",
|
|
99
100
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
100
101
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
101
|
-
"@lingui/react": "3.17.2",
|
|
102
102
|
"@lingui/core": "3.17.2",
|
|
103
|
+
"@lingui/react": "3.17.2",
|
|
103
104
|
"@popperjs/core": "^2.11.8",
|
|
104
105
|
"@xstyled/styled-components": "^3.8.0",
|
|
105
106
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,26 +9,22 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var utils_1 = require("./utils");
|
|
30
|
-
var store_1 = require("./store");
|
|
31
|
-
var react_2 = require("@lingui/react");
|
|
32
|
-
var FloatingButton_1 = __importDefault(require("./components/FloatingButton/FloatingButton"));
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { x } from '@xstyled/styled-components';
|
|
15
|
+
import { Row, MessageCell } from './components/Table.js';
|
|
16
|
+
import OversizedScroll from './components/OversizedScroll.js';
|
|
17
|
+
import GroupRow from './components/GroupRow.js';
|
|
18
|
+
import FilterRow from './components/FilterRow.js';
|
|
19
|
+
import DataRow from './components/DataRow.js';
|
|
20
|
+
import HeadRow from './components/HeadRow.js';
|
|
21
|
+
import useUxReset from './hooks/useUxReset.js';
|
|
22
|
+
import useRowsKeyControls from './hooks/useRowsKeyControls.js';
|
|
23
|
+
import useColumnSizes from './hooks/useColumnSizes.js';
|
|
24
|
+
import { isColumnOn, getGroups } from './utils/index.js';
|
|
25
|
+
import { initialState } from './store/index.js';
|
|
26
|
+
import { Trans } from '@lingui/react';
|
|
27
|
+
import FloatingButton from './components/FloatingButton/FloatingButton.js';
|
|
33
28
|
var rowsStyles = { outline: 'none' };
|
|
34
29
|
var defaultVoidFunction = function () {
|
|
35
30
|
var args = [];
|
|
@@ -38,7 +33,7 @@ var defaultVoidFunction = function () {
|
|
|
38
33
|
}
|
|
39
34
|
return null;
|
|
40
35
|
};
|
|
41
|
-
var defaultUxState =
|
|
36
|
+
var defaultUxState = initialState.uxState;
|
|
42
37
|
var defaultColumnsWidth = {};
|
|
43
38
|
var defaultPerPageOptions = [10, 20, 50, 100];
|
|
44
39
|
var CommonGrid = function (_a) {
|
|
@@ -49,9 +44,9 @@ var CommonGrid = function (_a) {
|
|
|
49
44
|
isLoading = _a.isLoading, rowsData = _a.rowsData, hasColouredRows = _a.hasColouredRows, columnsDefinitions = _a.columnsDefinitions, actionColumnDefinition = _a.actionColumnDefinition, allowRowSelect = _a.allowRowSelect, allowRowSelectOnAction = _a.allowRowSelectOnAction, onRowAction = _a.onRowAction, onRowEditClick = _a.onRowEditClick, onRowReadClick = _a.onRowReadClick, onRowClick = _a.onRowClick, _b = _a.columnLayout, columnLayout = _b === void 0 ? 'normal' : _b, hideColumnConfig = _a.hideColumnConfig, className = _a.className, gridRef = _a.gridRef, minColumnWidth = _a.minColumnWidth, errorMessage = _a.errorMessage, floatingButtonProps = _a.floatingButtonProps;
|
|
50
45
|
var _c = gridSelectors.uxState, uxState = _c === void 0 ? defaultUxState : _c, columnConfig = gridSelectors.columnConfig, _d = gridSelectors.columnsWidth, columnsWidth = _d === void 0 ? defaultColumnsWidth : _d, columnsWidthVariant = gridSelectors.columnsWidthVariant, _e = gridSelectors.page, page = _e === void 0 ? 1 : _e, filter = gridSelectors.filter, sorting = gridSelectors.sorting, _f = gridSelectors.rowsPerPage, rowsPerPage = _f === void 0 ? 10 : _f;
|
|
51
46
|
var clearUxState = gridActions.clearUxState, handleUxChange = gridActions.handleUxChange, _g = gridActions.addFilter, addFilter = _g === void 0 ? defaultVoidFunction : _g, _h = gridActions.addSorting, addSorting = _h === void 0 ? defaultVoidFunction : _h, _j = gridActions.setColumnWidth, setColumnWidth = _j === void 0 ? defaultVoidFunction : _j, _k = gridActions.setColumnsOrder, setColumnsOrder = _k === void 0 ? defaultVoidFunction : _k;
|
|
52
|
-
var handleRowsKeyDown = (
|
|
53
|
-
(
|
|
54
|
-
var checksColumnsOrder =
|
|
47
|
+
var handleRowsKeyDown = useRowsKeyControls(rowsData, uxState, handleUxChange);
|
|
48
|
+
useUxReset(rowsData, uxState, clearUxState);
|
|
49
|
+
var checksColumnsOrder = React.useCallback(function (colsOrder) {
|
|
55
50
|
var stickyRightColls = columnsDefinitions.filter(function (col) { return col.sticky === true && col.stickTo === 'right'; });
|
|
56
51
|
var stickyLeftColls = columnsDefinitions.filter(function (col) { return col.sticky === true && col.stickTo !== 'right'; });
|
|
57
52
|
if (stickyLeftColls.length > 1 || stickyRightColls.length > 1) {
|
|
@@ -65,7 +60,7 @@ var CommonGrid = function (_a) {
|
|
|
65
60
|
}
|
|
66
61
|
}, [columnsDefinitions]);
|
|
67
62
|
// todo refactor as part of definitions
|
|
68
|
-
var columnsOrder =
|
|
63
|
+
var columnsOrder = React.useMemo(function () {
|
|
69
64
|
var _a;
|
|
70
65
|
var order = ((_a = gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.columnsOrder) === null || _a === void 0 ? void 0 : _a.length)
|
|
71
66
|
? gridSelectors.columnsOrder
|
|
@@ -74,8 +69,8 @@ var CommonGrid = function (_a) {
|
|
|
74
69
|
return order;
|
|
75
70
|
}, [columnsDefinitions, gridSelectors.columnsOrder]);
|
|
76
71
|
// filtered and ordered columns definition, relevant columns definition to iterate over and render
|
|
77
|
-
var displayColumnsDefinitions =
|
|
78
|
-
return (!hideColumnConfig ? columnsDefinitions.filter(function (column) { return
|
|
72
|
+
var displayColumnsDefinitions = React.useMemo(function () {
|
|
73
|
+
return (!hideColumnConfig ? columnsDefinitions.filter(function (column) { return isColumnOn(column, columnConfig); }) : columnsDefinitions).sort(function (col1, col2) {
|
|
79
74
|
var i = (columnsOrder || []).indexOf(col1.name);
|
|
80
75
|
var j = (columnsOrder || []).indexOf(col2.name);
|
|
81
76
|
return i > j ? 1 : i < j ? -1 : 0;
|
|
@@ -84,27 +79,27 @@ var CommonGrid = function (_a) {
|
|
|
84
79
|
var GridMessage;
|
|
85
80
|
var messageClass = 'info';
|
|
86
81
|
if (isLoading)
|
|
87
|
-
GridMessage = (
|
|
82
|
+
GridMessage = _jsx(Trans, { id: "dataGrid.status.loadingData", message: "... loading data ..." });
|
|
88
83
|
if (!isLoading && (!rowsData || rowsData.length < 1))
|
|
89
|
-
GridMessage = (
|
|
84
|
+
GridMessage = _jsx(Trans, { id: "dataGrid.status.noDataFound", message: "No data found." });
|
|
90
85
|
if (!isLoading && errorMessage) {
|
|
91
86
|
GridMessage = errorMessage;
|
|
92
87
|
messageClass = 'error';
|
|
93
88
|
}
|
|
94
|
-
var _l = (
|
|
95
|
-
var groups =
|
|
96
|
-
return
|
|
89
|
+
var _l = useColumnSizes(displayColumnsDefinitions, columnsWidth, columnsWidthVariant, setColumnWidth, columnLayout, minColumnWidth), displayColumnsWidth = _l.displayColumnsWidth, totalColumnsWidth = _l.totalColumnsWidth, gridBoxRef = _l.gridBoxRef, handleResizeDrag = _l.handleResizeDrag;
|
|
90
|
+
var groups = React.useMemo(function () {
|
|
91
|
+
return getGroups(displayColumnsDefinitions);
|
|
97
92
|
}, [displayColumnsDefinitions]);
|
|
98
|
-
var commonGridRef =
|
|
93
|
+
var commonGridRef = React.useCallback(function (node) {
|
|
99
94
|
gridBoxRef.current = node;
|
|
100
95
|
!!gridRef && (gridRef.current = node);
|
|
101
96
|
}, []);
|
|
102
|
-
return ((
|
|
97
|
+
return (_jsxs(_Fragment, { children: [_jsx(x.div, { className: className || '', children: _jsxs(OversizedScroll, { columnLayout: columnLayout, isLoading: isLoading, totalColumnsWidth: totalColumnsWidth, floatingChildren: GridMessage && (_jsx(Row, { className: "dataRow", align: "center", children: _jsx(MessageCell, { align: "center", className: "gridMessage ".concat(messageClass), children: GridMessage }) })), ref: commonGridRef, children: [_jsxs("div", { className: "gridHead", children: [columnsDefinitions.find(function (col) { return col.group; }) && (_jsx(GroupRow, { actionColumn: actionColumnDefinition, columns: displayColumnsDefinitions, displayColumnsWidth: displayColumnsWidth, groups: groups })), _jsx(HeadRow, { columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onAddSort: addSorting, columnLayout: columnLayout, setColumnsOrder: setColumnsOrder, columnsOrder: columnsOrder, sortingValues: sorting, displayColumnsWidth: displayColumnsWidth, handleResizeDrag: handleResizeDrag, groups: groups }), columnsDefinitions.find(function (col) { return col.filtering; }) && (_jsx(FilterRow, { filters: filters, columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onChange: addFilter, filterValues: filter, displayColumnsWidth: displayColumnsWidth, groups: groups, rowsData: rowsData, uxState: uxState, handleUxChange: handleUxChange }))] }), _jsx("div", { className: "body flx_1", style: rowsStyles, tabIndex: -1, onKeyDown: handleRowsKeyDown, children: !isLoading &&
|
|
103
98
|
rowsData &&
|
|
104
99
|
displayColumnsDefinitions &&
|
|
105
100
|
rowsData.map(function (row, index) {
|
|
106
101
|
var rowIndex = rowsPerPage * page + (index + 1) - rowsPerPage;
|
|
107
|
-
return ((
|
|
108
|
-
}) })] }) }), floatingButtonProps && (
|
|
102
|
+
return (_jsx(DataRow, { rowData: row, rowIndex: rowIndex, uxState: uxState, isEven: hasColouredRows && (index + 1) % 2 === 0, allowRowSelect: allowRowSelect, allowRowSelectOnAction: allowRowSelectOnAction, onRowAction: onRowAction, onUxChange: handleUxChange, onRowEditClick: onRowEditClick, onRowReadClick: onRowReadClick, onRowClick: onRowClick, columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, displayColumnsWidth: displayColumnsWidth, groups: groups }, row.id));
|
|
103
|
+
}) })] }) }), floatingButtonProps && _jsx(FloatingButton, __assign({}, floatingButtonProps))] }));
|
|
109
104
|
};
|
|
110
|
-
|
|
105
|
+
export default CommonGrid;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -21,51 +20,47 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
20
|
}
|
|
22
21
|
return t;
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var Modal_1 = __importDefault(require("../Modal"));
|
|
44
|
-
var ManageColumnForm_1 = __importDefault(require("./components/ManageColumnForm"));
|
|
45
|
-
var react_2 = require("@lingui/react");
|
|
46
|
-
var Settings2_1 = require("../../Elements/Icon/icons/Settings2");
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import useGetGridHeight from './hooks/useGetGridHeight.js';
|
|
25
|
+
import { useEffect, useMemo } from 'react';
|
|
26
|
+
import { getFilters, GRID_MIN_ROWS, rowHeight } from './utils/index.js';
|
|
27
|
+
import useEditReadAsColumn from './hooks/useEditReadAsColumn.js';
|
|
28
|
+
import { useModal } from '../Modal/hooks/useModal.js';
|
|
29
|
+
import useManageColumn from './hooks/useManageColumn.js';
|
|
30
|
+
import { CommonGridWithStyles, BottomWrapper, CommonGridWrap, ContentContainer, StyledButtonStrip, StyledColumnButton, } from './styles.js';
|
|
31
|
+
import { H6 } from '../../Elements/Typography/index.js';
|
|
32
|
+
import HidePrint from '../HidePrint/HidePrint.js';
|
|
33
|
+
import ControlButtons from './components/ControlButtons/index.js';
|
|
34
|
+
import { x } from '@xstyled/styled-components';
|
|
35
|
+
import ActionHead from './components/ActionHead/index.js';
|
|
36
|
+
import { Pagination } from '../../Elements/Pagination/index.js';
|
|
37
|
+
import TablePagination from './components/TablePagination/index.js';
|
|
38
|
+
import Modal from '../Modal/index.js';
|
|
39
|
+
import ManageColumnForm from './components/ManageColumnForm/index.js';
|
|
40
|
+
import { Trans } from '@lingui/react';
|
|
41
|
+
import { Settings2 } from '../../Elements/Icon/icons/Settings2.js';
|
|
47
42
|
var StyledCommonGrid = function (props) {
|
|
48
43
|
var _a = props.optimizeFilters, optimizeFilters = _a === void 0 ? false : _a, extraControlButtons = props.extraControlButtons, eshopSelect = props.eshopSelect, onBatchAction = props.onBatchAction, processCheckedValues = props.processCheckedValues, processCheckedValuesTitle = props.processCheckedValuesTitle, hideControlButtons = props.hideControlButtons, floatingButtonProps = props.floatingButtonProps, queryRowsParam = props.queryRowsParam, customPaginationHandler = props.customPaginationHandler, passDownProps = __rest(props, ["optimizeFilters", "extraControlButtons", "eshopSelect", "onBatchAction", "processCheckedValues", "processCheckedValuesTitle", "hideControlButtons", "floatingButtonProps", "queryRowsParam", "customPaginationHandler"]);
|
|
49
44
|
var gridActions = passDownProps.gridActions, gridSelectors = passDownProps.gridSelectors, rowsData = passDownProps.rowsData, actionColumnDefinition = passDownProps.actionColumnDefinition;
|
|
50
|
-
var _b = (
|
|
51
|
-
|
|
45
|
+
var _b = useGetGridHeight(), gridHeight = _b.gridHeight, gridRef = _b.gridRef, paginationRef = _b.paginationRef;
|
|
46
|
+
useEffect(function () {
|
|
52
47
|
var _a;
|
|
53
48
|
if (!queryRowsParam && gridHeight && gridHeight > 0) {
|
|
54
49
|
// Only main grids (without form grids on new pages)
|
|
55
|
-
var numberOfRows = Math.max(Math.floor(gridHeight /
|
|
50
|
+
var numberOfRows = Math.max(Math.floor(gridHeight / rowHeight - 2), GRID_MIN_ROWS);
|
|
56
51
|
numberOfRows && ((_a = gridActions.setRowsPerPage) === null || _a === void 0 ? void 0 : _a.call(gridActions, numberOfRows));
|
|
57
52
|
}
|
|
58
53
|
}, [gridHeight, gridActions, queryRowsParam]);
|
|
59
|
-
var modifiedPassDownProps = (
|
|
60
|
-
var filters =
|
|
54
|
+
var modifiedPassDownProps = useEditReadAsColumn(passDownProps);
|
|
55
|
+
var filters = useMemo(function () { return getFilters(optimizeFilters); }, [optimizeFilters]);
|
|
61
56
|
var columns = modifiedPassDownProps.columnsDefinitions;
|
|
62
|
-
var _c =
|
|
63
|
-
var _d = (
|
|
57
|
+
var _c = useModal(), openManageColumnForm = _c.onOpen, manageColumnFormVisible = _c.isOpen, onClose = _c.onClose;
|
|
58
|
+
var _d = useManageColumn({
|
|
64
59
|
columns: columns,
|
|
65
60
|
gridActions: gridActions,
|
|
66
61
|
gridSelectors: gridSelectors,
|
|
67
62
|
onClose: onClose,
|
|
68
63
|
}), columnsConfigValues = _d.columnsConfigValues, setColumnsConfigOptions = _d.setColumnsConfigOptions, onConfirmForm = _d.onConfirmForm, resetColumnConfig = _d.resetColumnConfig;
|
|
69
|
-
return ((
|
|
64
|
+
return (_jsxs(ContentContainer, { children: [_jsxs(CommonGridWrap, { children: [_jsx(HidePrint, { children: _jsxs(StyledButtonStrip, { className: "buttonsStrip", children: [!hideControlButtons && (_jsx(ControlButtons, { extraControlButtons: extraControlButtons, gridActions: gridActions, gridSelectors: gridSelectors, eshopSelect: eshopSelect })), _jsx(StyledColumnButton, { type: "button", sizing: "iconLg", appearance: "ghost", icon: _jsx(Settings2, {}), onClick: openManageColumnForm, children: _jsx(H6, { variant: "semiBold", children: _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }) }) })] }) }), _jsx(CommonGridWithStyles, __assign({}, passDownProps, modifiedPassDownProps, { filters: filters, gridRef: gridRef, height: gridHeight, floatingButtonProps: floatingButtonProps, hasColouredRows: true }))] }), _jsx(HidePrint, { children: _jsxs(BottomWrapper, { ref: paginationRef, isFixed: !!gridHeight, children: [processCheckedValues && (_jsx(ActionHead, { rowsData: rowsData, onBatchAction: onBatchAction, gridActions: gridActions, gridSelectors: gridSelectors, actionColumn: actionColumnDefinition, processCheckedValues: processCheckedValues, processCheckedValuesTitle: processCheckedValuesTitle })), _jsxs(x.div, { display: "flex", justifyContent: "center", alignItems: "center", className: "paginatorWrapper", w: "100%", h: window.innerWidth > 1204 ? '60px' : '32px', children: [_jsx(Pagination, { page: gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.page, itemCount: passDownProps === null || passDownProps === void 0 ? void 0 : passDownProps.totalRowsCount, itemPerPage: (gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.rowsPerPage) || 10, onPageChange: gridActions === null || gridActions === void 0 ? void 0 : gridActions.setPage, customPaginationHandler: customPaginationHandler }), _jsx(TablePagination, { gridActions: gridActions, gridSelectors: gridSelectors, customPaginationHandler: customPaginationHandler })] })] }) }), manageColumnFormVisible && (_jsx(Modal, { title: _jsx(Trans, { id: "manageColumn.title", message: "Manage columns" }), onClose: onClose, onCancel: onClose, onExtraAction: resetColumnConfig, onConfirm: onConfirmForm, width: "auto", minWidth: "350px", hasFooter: true, extraActionLabel: _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), cancelLabel: _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), confirmLabel: _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), children: _jsx(ManageColumnForm, { columns: columns, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions }) }))] }));
|
|
70
65
|
};
|
|
71
|
-
|
|
66
|
+
export default StyledCommonGrid;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var redux_1 = require("redux");
|
|
5
|
-
var store_1 = require("../store");
|
|
1
|
+
import { connect } from 'react-redux';
|
|
2
|
+
import { bindActionCreators } from 'redux';
|
|
3
|
+
import { createActions, createFullSelector } from '../store/index.js';
|
|
6
4
|
var withReduxActions = function (gridName, prefix) {
|
|
7
5
|
if (prefix === void 0) { prefix = 'grid'; }
|
|
8
|
-
var actions =
|
|
9
|
-
var selectors =
|
|
10
|
-
return
|
|
6
|
+
var actions = createActions(gridName);
|
|
7
|
+
var selectors = createFullSelector(gridName);
|
|
8
|
+
return connect(function (state) {
|
|
11
9
|
var _a;
|
|
12
10
|
return (_a = {},
|
|
13
11
|
_a["".concat(prefix, "Selectors")] = selectors(state),
|
|
@@ -15,7 +13,7 @@ var withReduxActions = function (gridName, prefix) {
|
|
|
15
13
|
}, function (dispatch) {
|
|
16
14
|
var _a;
|
|
17
15
|
return (_a = {},
|
|
18
|
-
_a["".concat(prefix, "Actions")] =
|
|
16
|
+
_a["".concat(prefix, "Actions")] = bindActionCreators({
|
|
19
17
|
init: actions.init,
|
|
20
18
|
clearUxState: actions.clearUxState,
|
|
21
19
|
handleUxChange: actions.handleUxChange,
|
|
@@ -35,4 +33,4 @@ var withReduxActions = function (gridName, prefix) {
|
|
|
35
33
|
_a);
|
|
36
34
|
});
|
|
37
35
|
};
|
|
38
|
-
|
|
36
|
+
export default withReduxActions;
|
|
@@ -1,45 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.getMoreButton = exports.getImportButton = exports.getCreateButton = void 0;
|
|
7
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
var react_1 = require("@lingui/react");
|
|
9
|
-
var ButtonMore_1 = __importDefault(require("./components/ButtonMore/ButtonMore"));
|
|
10
|
-
var getCreateButton = function (onCreate, canCreate, disabled) { return ({
|
|
11
|
-
label: (0, jsx_runtime_1.jsx)(react_1.Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }),
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Trans } from '@lingui/react';
|
|
3
|
+
import ButtonMore from './components/ButtonMore/ButtonMore.js';
|
|
4
|
+
export var getCreateButton = function (onCreate, canCreate, disabled) { return ({
|
|
5
|
+
label: _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }),
|
|
12
6
|
style: 'primary',
|
|
13
7
|
onClick: onCreate,
|
|
14
8
|
hide: !canCreate,
|
|
15
9
|
disabled: disabled,
|
|
16
10
|
}); };
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
label: (0, jsx_runtime_1.jsx)(react_1.Trans, { id: "form.buttonImport", message: "Import" }),
|
|
11
|
+
export var getImportButton = function (onImport, canImport, disabled) { return ({
|
|
12
|
+
label: _jsx(Trans, { id: "form.buttonImport", message: "Import" }),
|
|
20
13
|
onClick: onImport,
|
|
21
14
|
hide: !canImport,
|
|
22
15
|
disabled: disabled,
|
|
23
16
|
}); };
|
|
24
|
-
|
|
25
|
-
var getMoreButton = function (onExport, onImport, canImport) {
|
|
17
|
+
export var getMoreButton = function (onExport, onImport, canImport) {
|
|
26
18
|
var items = [];
|
|
27
19
|
if (onImport && canImport) {
|
|
28
20
|
items.push({
|
|
29
|
-
title: (
|
|
21
|
+
title: _jsx(Trans, { id: "form.buttonImport", message: "Import" }),
|
|
30
22
|
onClick: onImport,
|
|
31
23
|
link: '#',
|
|
32
24
|
name: 'moreActionImportBtn',
|
|
33
25
|
});
|
|
34
26
|
}
|
|
35
27
|
items.push({
|
|
36
|
-
title: (
|
|
28
|
+
title: _jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" }),
|
|
37
29
|
onClick: onExport,
|
|
38
30
|
link: '#',
|
|
39
31
|
name: 'moreActionExportBtn',
|
|
40
32
|
});
|
|
41
33
|
return {
|
|
42
|
-
node: (
|
|
34
|
+
node: _jsx(ButtonMore, { items: items }),
|
|
43
35
|
};
|
|
44
36
|
};
|
|
45
|
-
exports.getMoreButton = getMoreButton;
|
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
3
|
return cooked;
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var ActionsWrap = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n bottom: 32px;\n left: 50%;\n transform: translate(-50%);\n width: 596px;\n padding: 12px 24px;\n border-radius: 10px;\n background-color: #fff;\n box-shadow: dropShadow;\n z-index: 2;\n"], ["\n position: absolute;\n bottom: 32px;\n left: 50%;\n transform: translate(-50%);\n width: 596px;\n padding: 12px 24px;\n border-radius: 10px;\n background-color: #fff;\n box-shadow: dropShadow;\n z-index: 2;\n"])));
|
|
21
|
-
var StyledText = styled_components_1.default.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 18px;\n color: blue2;\n font-weight: 600;\n"], ["\n font-size: 14px;\n line-height: 18px;\n color: blue2;\n font-weight: 600;\n"])));
|
|
22
|
-
var ContentWrap = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
23
|
-
var ButtonsWrap = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: 10px;\n\n & > * {\n margin-left: 10px;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-left: 10px;\n\n & > * {\n margin-left: 10px;\n }\n"])));
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useCallback, useMemo } from 'react';
|
|
7
|
+
import styled from '@xstyled/styled-components';
|
|
8
|
+
import { Trans } from '@lingui/react';
|
|
9
|
+
import { Button } from '../../../../Elements/Button/index.js';
|
|
10
|
+
import ButtonMore from '../ButtonMore/ButtonMore.js';
|
|
11
|
+
import { i18n } from '@lingui/core';
|
|
12
|
+
import { useToggleAllCheckbox } from '../../hooks/useToggleAllCheckbox.js';
|
|
13
|
+
import { useGridActionTrigger } from '../../hooks/useGridActionTrigger.js';
|
|
14
|
+
var Wrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n margin-right: 2;\n gap: 24px;\n background-color: red;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n width: 100%;\n margin-right: 2;\n gap: 24px;\n background-color: red;\n position: relative;\n"])));
|
|
15
|
+
var ActionsWrap = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n bottom: 32px;\n left: 50%;\n transform: translate(-50%);\n width: 596px;\n padding: 12px 24px;\n border-radius: 10px;\n background-color: #fff;\n box-shadow: dropShadow;\n z-index: 2;\n"], ["\n position: absolute;\n bottom: 32px;\n left: 50%;\n transform: translate(-50%);\n width: 596px;\n padding: 12px 24px;\n border-radius: 10px;\n background-color: #fff;\n box-shadow: dropShadow;\n z-index: 2;\n"])));
|
|
16
|
+
var StyledText = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 18px;\n color: blue2;\n font-weight: 600;\n"], ["\n font-size: 14px;\n line-height: 18px;\n color: blue2;\n font-weight: 600;\n"])));
|
|
17
|
+
var ContentWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
18
|
+
var ButtonsWrap = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: 10px;\n\n & > * {\n margin-left: 10px;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-left: 10px;\n\n & > * {\n margin-left: 10px;\n }\n"])));
|
|
24
19
|
var ActionHead = function (_a) {
|
|
25
20
|
var _b;
|
|
26
21
|
var gridActions = _a.gridActions, gridSelectors = _a.gridSelectors, actionColumn = _a.actionColumn, onBatchAction = _a.onBatchAction, rowsData = _a.rowsData, processCheckedValues = _a.processCheckedValues, processCheckedValuesTitle = _a.processCheckedValuesTitle;
|
|
27
22
|
var handleUxChange = (gridActions || {}).handleUxChange;
|
|
28
23
|
var _c = (gridSelectors || {}).uxState, uxState = _c === void 0 ? {} : _c;
|
|
29
|
-
var _d =
|
|
30
|
-
var _e =
|
|
24
|
+
var _d = useToggleAllCheckbox(rowsData, uxState, handleUxChange), checked = _d[0], toggleCheckbox = _d[1];
|
|
25
|
+
var _e = useGridActionTrigger(rowsData, uxState, actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions, onBatchAction), enabledActions = _e[0], onSubmit = _e[1];
|
|
31
26
|
var checkedRowsCount = Object.keys((uxState === null || uxState === void 0 ? void 0 : uxState.checkedRows) || []).length;
|
|
32
|
-
var checkAll =
|
|
27
|
+
var checkAll = useCallback(function () {
|
|
33
28
|
if (!checked) {
|
|
34
29
|
toggleCheckbox();
|
|
35
30
|
}
|
|
36
31
|
}, [checked, toggleCheckbox]);
|
|
37
|
-
var actionsOptions =
|
|
32
|
+
var actionsOptions = useMemo(function () {
|
|
38
33
|
var _a;
|
|
39
34
|
if ((_a = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
40
35
|
return actionColumn.actionOptions.map(function (option) { return ({
|
|
@@ -45,11 +40,11 @@ var ActionHead = function (_a) {
|
|
|
45
40
|
}
|
|
46
41
|
return [];
|
|
47
42
|
}, [actionColumn, onSubmit]);
|
|
48
|
-
return ((
|
|
43
|
+
return (_jsx(Wrap, { children: checkedRowsCount > 0 && (_jsx(ActionsWrap, { children: _jsxs(ContentWrap, { children: [_jsx(StyledText, { children: i18n._({
|
|
49
44
|
id: 'dataGrid.checkedRowsCount',
|
|
50
45
|
message: "Selected {checkedRowsCount} items",
|
|
51
46
|
values: { checkedRowsCount: checkedRowsCount },
|
|
52
|
-
}) }), (
|
|
47
|
+
}) }), _jsxs(ButtonsWrap, { children: [_jsx(Button, { type: "button", onClick: checkAll, appearance: "secondaryLg", "data-cy": "checkAllBtn", disabled: checked, children: _jsx(Trans, { id: "dataGrid.checkAll", message: "Check all" }) }), processCheckedValues && (_jsx(Button, { type: "button", onClick: processCheckedValues, appearance: "primary", "data-cy": "exportBtn", disabled: !rowsData.length, children: processCheckedValuesTitle ? (processCheckedValuesTitle) : (_jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" })) })), ((_b = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _b === void 0 ? void 0 : _b.length) && (_jsx(ButtonMore, { items: actionsOptions, disabled: !enabledActions.length || !rowsData.length, dropdownPosition: "top" }))] })] }) })) }));
|
|
53
48
|
};
|
|
54
|
-
|
|
49
|
+
export default ActionHead;
|
|
55
50
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
3
|
return cooked;
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
var styled_components_1 = __importDefault(require("@xstyled/styled-components"));
|
|
12
|
-
var system_1 = require("@xstyled/system");
|
|
13
|
-
var StyledDropdownWrap = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n left: 0;\n top: 3px;\n display: flex;\n flex-direction: column;\n padding: 2;\n width: 100%;\n background-color: ", ";\n box-shadow: ", ";\n min-width: 8.9rem;\n font-size: 12px;\n font-weight: normal;\n border-radius: 10px;\n z-index: 1;\n"], ["\n position: relative;\n left: 0;\n top: 3px;\n display: flex;\n flex-direction: column;\n padding: 2;\n width: 100%;\n background-color: ", ";\n box-shadow: ", ";\n min-width: 8.9rem;\n font-size: 12px;\n font-weight: normal;\n border-radius: 10px;\n z-index: 1;\n"])), system_1.th.color('white'), system_1.th.shadow('dropShadow'));
|
|
14
|
-
var StyledDropdownItem = styled_components_1.default.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 2 2;\n border-radius: 6px;\n cursor: pointer;\n &:hover {\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n }\n"], ["\n padding: 2 2;\n border-radius: 6px;\n cursor: pointer;\n &:hover {\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n }\n"])), system_1.th.color('bgLightGray1'), system_1.th.color('typoPrimary'));
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import styled from '@xstyled/styled-components';
|
|
7
|
+
import { th } from '@xstyled/system';
|
|
8
|
+
var StyledDropdownWrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n left: 0;\n top: 3px;\n display: flex;\n flex-direction: column;\n padding: 2;\n width: 100%;\n background-color: ", ";\n box-shadow: ", ";\n min-width: 8.9rem;\n font-size: 12px;\n font-weight: normal;\n border-radius: 10px;\n z-index: 1;\n"], ["\n position: relative;\n left: 0;\n top: 3px;\n display: flex;\n flex-direction: column;\n padding: 2;\n width: 100%;\n background-color: ", ";\n box-shadow: ", ";\n min-width: 8.9rem;\n font-size: 12px;\n font-weight: normal;\n border-radius: 10px;\n z-index: 1;\n"])), th.color('white'), th.shadow('dropShadow'));
|
|
9
|
+
var StyledDropdownItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 2 2;\n border-radius: 6px;\n cursor: pointer;\n &:hover {\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n }\n"], ["\n padding: 2 2;\n border-radius: 6px;\n cursor: pointer;\n &:hover {\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n }\n"])), th.color('bgLightGray1'), th.color('typoPrimary'));
|
|
15
10
|
var ActionDropdownMenu = function (_a) {
|
|
16
11
|
var items = _a.items;
|
|
17
|
-
return ((
|
|
12
|
+
return (_jsx(StyledDropdownWrap, { children: items.map(function (item, index) {
|
|
18
13
|
var _a;
|
|
19
|
-
return ((
|
|
14
|
+
return (_jsx(StyledDropdownItem, { onClick: (_a = item.onClick) !== null && _a !== void 0 ? _a : undefined, children: item.title }, index));
|
|
20
15
|
}) }));
|
|
21
16
|
};
|
|
22
|
-
|
|
17
|
+
export default ActionDropdownMenu;
|
|
23
18
|
var templateObject_1, templateObject_2;
|