@mailstep/design-system 0.6.2-beta.2 → 0.6.2-beta.3
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 +1 -1
- package/ui/Blocks/CommonGrid/CommonGrid.js +38 -33
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +33 -28
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +10 -8
- package/ui/Blocks/CommonGrid/StandardButtons.js +20 -11
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +26 -21
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +13 -8
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +48 -20
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +15 -10
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +19 -14
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +22 -17
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +50 -22
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +13 -8
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +38 -9
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/DataCell.js +18 -13
- package/ui/Blocks/CommonGrid/components/DataRow.js +35 -30
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +59 -31
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +5 -1
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +41 -12
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/FilterDropdown.js +13 -8
- package/ui/Blocks/CommonGrid/components/FilterRow.js +20 -15
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +23 -17
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +15 -10
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/GroupRow.js +15 -10
- package/ui/Blocks/CommonGrid/components/HeadCell.js +19 -14
- package/ui/Blocks/CommonGrid/components/HeadRow.js +45 -17
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +18 -12
- package/ui/Blocks/CommonGrid/components/IconList/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +14 -12
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +24 -17
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +28 -23
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +2 -1
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +39 -11
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +12 -10
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/Resize.js +12 -7
- package/ui/Blocks/CommonGrid/components/Table.js +37 -9
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +40 -12
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +36 -30
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +2 -1
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +41 -12
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +11 -4
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +13 -6
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -6
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +16 -9
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +15 -8
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -8
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +16 -9
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +9 -3
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +18 -11
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +20 -13
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +12 -5
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +11 -4
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +40 -10
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +31 -14
- package/ui/Blocks/CommonGrid/components/icons/Edit.js +5 -3
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +5 -3
- package/ui/Blocks/CommonGrid/components/icons/Sorting.js +8 -3
- package/ui/Blocks/CommonGrid/components/utils.js +7 -3
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +10 -6
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +18 -13
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +12 -7
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +5 -3
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +11 -9
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +14 -7
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +8 -6
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +8 -3
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +8 -4
- package/ui/Blocks/CommonGrid/hooks/useUxReset.js +9 -4
- package/ui/Blocks/CommonGrid/index.js +51 -10
- package/ui/Blocks/CommonGrid/store/index.js +86 -77
- package/ui/Blocks/CommonGrid/store/migrateState.js +3 -1
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +24 -17
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +17 -10
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/utils/actions.js +11 -4
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +17 -11
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +10 -6
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +35 -26
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +17 -10
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +6 -4
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +3 -1
- package/ui/Blocks/CommonGrid/styles.js +39 -10
- package/ui/Blocks/CommonGrid/translations.js +5 -3
- package/ui/Blocks/CommonGrid/types.js +6 -3
- package/ui/Blocks/CommonGrid/utils/index.js +40 -23
- package/ui/Blocks/CornerDialog/CornerDialog.js +15 -11
- package/ui/Blocks/CornerDialog/index.js +4 -2
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.js +10 -7
- package/ui/Blocks/CornerDialog/styles.js +35 -9
- package/ui/Blocks/CornerDialog/types.js +2 -1
- package/ui/Blocks/CornerDialog/utils.js +5 -2
- package/ui/Blocks/HidePrint/HidePrint.js +10 -5
- package/ui/Blocks/ImageList/ImageList.js +42 -15
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +11 -7
- package/ui/Blocks/ImageList/components/AddPhoto/styles.js +29 -3
- package/ui/Blocks/ImageList/components/CloseButton/index.js +9 -5
- package/ui/Blocks/ImageList/components/CloseButton/styles.js +29 -3
- package/ui/Blocks/ImageList/components/ImageElement/index.js +11 -7
- package/ui/Blocks/ImageList/components/ImageElement/styles.js +29 -3
- package/ui/Blocks/ImageList/components/ImageTag/index.js +12 -5
- package/ui/Blocks/ImageList/components/ImageTag/styles.js +8 -2
- package/ui/Blocks/ImageList/index.js +4 -2
- package/ui/Blocks/ImageList/stories/ImageList.stories.js +9 -6
- package/ui/Blocks/ImageList/styles.js +8 -2
- package/ui/Blocks/ImageList/types.js +2 -1
- package/ui/Blocks/LightBox/LightBox.js +15 -8
- package/ui/Blocks/LightBox/hooks/useLightBox.js +9 -5
- package/ui/Blocks/LightBox/index.js +7 -3
- package/ui/Blocks/LightBox/stories/LightBox.stories.js +7 -4
- package/ui/Blocks/LightBox/styles.js +11 -5
- package/ui/Blocks/LightBox/types.js +2 -1
- package/ui/Blocks/Modal/Modal.js +20 -17
- package/ui/Blocks/Modal/hooks/useClickOutside.js +10 -6
- package/ui/Blocks/Modal/hooks/useModal.js +10 -6
- package/ui/Blocks/Modal/index.js +9 -4
- package/ui/Blocks/Modal/stories/Modal.stories.js +48 -42
- package/ui/Blocks/Modal/styles.js +46 -20
- package/ui/Blocks/Modal/types.js +2 -1
- package/ui/Blocks/Modal/utils.js +4 -1
- package/ui/Blocks/Popover/index.js +15 -10
- package/ui/Blocks/Tabs/TabContent.js +5 -1
- package/ui/Blocks/Tabs/Tabs.js +14 -10
- package/ui/Blocks/Tabs/hooks/useTabs.js +8 -4
- package/ui/Blocks/Tabs/index.js +9 -4
- package/ui/Blocks/Tabs/stories/Tabs.stories.js +9 -6
- package/ui/Blocks/Tabs/styles.js +34 -8
- package/ui/Blocks/Tabs/types.js +2 -1
- package/ui/Elements/Alert/Alert.js +12 -10
- package/ui/Elements/Alert/index.js +9 -3
- package/ui/Elements/Alert/stories/Alert.stories.js +14 -11
- package/ui/Elements/Alert/styles.js +20 -14
- package/ui/Elements/Alert/types.js +2 -1
- package/ui/Elements/Avatar/Avatar.js +14 -7
- package/ui/Elements/Avatar/index.js +7 -3
- package/ui/Elements/Avatar/stories/Avatar.stories.js +8 -5
- package/ui/Elements/Avatar/types.js +2 -1
- package/ui/Elements/Badge/Badge.js +38 -13
- package/ui/Elements/Badge/index.js +9 -3
- package/ui/Elements/Badge/stories/Badge.stories.js +11 -5
- package/ui/Elements/BorderedBox/BorderedBox.js +30 -5
- package/ui/Elements/BorderedBox/index.js +9 -3
- package/ui/Elements/BorderedBox/stories/BorderedBox.stories.js +7 -4
- package/ui/Elements/BorderedBox/types.js +2 -1
- package/ui/Elements/Button/Button.js +7 -5
- package/ui/Elements/Button/index.js +9 -3
- package/ui/Elements/Button/stories/Button.stories.js +16 -13
- package/ui/Elements/Button/styles.js +14 -8
- package/ui/Elements/Button/types.js +2 -1
- package/ui/Elements/Card/Card.js +20 -14
- package/ui/Elements/Card/index.js +12 -3
- package/ui/Elements/Card/stories/Card.stories.js +11 -8
- package/ui/Elements/Card/stories/CardComponent.stories.js +12 -6
- package/ui/Elements/Card/styles.js +38 -12
- package/ui/Elements/Card/types.js +2 -1
- package/ui/Elements/DatePicker/DatePicker.js +53 -25
- package/ui/Elements/DatePicker/Datetime/DateTime.js +31 -26
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +47 -20
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +6 -3
- package/ui/Elements/DatePicker/Datetime/types.js +2 -1
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +18 -13
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +14 -9
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +14 -9
- package/ui/Elements/DatePicker/index.js +7 -2
- package/ui/Elements/DatePicker/styles.js +29 -3
- package/ui/Elements/Dropdown/Dropdown.js +15 -10
- package/ui/Elements/Dropdown/index.js +9 -3
- package/ui/Elements/Dropdown/stories/Dropdown.stories.js +10 -4
- package/ui/Elements/Dropdown/types.js +2 -1
- package/ui/Elements/DropdownMenu/DropdownMenu.js +15 -8
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +32 -7
- package/ui/Elements/DropdownMenu/components/MenuItem.js +15 -10
- package/ui/Elements/DropdownMenu/components/MenuList.js +10 -5
- package/ui/Elements/DropdownMenu/index.js +5 -1
- package/ui/Elements/DropdownMenu/types.js +2 -1
- package/ui/Elements/DropdownSelect/DropdownSelect.js +50 -21
- package/ui/Elements/DropdownSelect/index.js +10 -3
- package/ui/Elements/ErrorMessage/ErrorMessage.js +34 -9
- package/ui/Elements/ErrorMessage/index.js +9 -3
- package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.js +11 -5
- package/ui/Elements/ErrorMessage/types.js +2 -1
- package/ui/Elements/HighlightBox/HighlightBox.js +38 -12
- package/ui/Elements/HighlightBox/index.js +7 -2
- package/ui/Elements/Icon/BadgeIcon.js +17 -10
- package/ui/Elements/Icon/Icon.js +245 -216
- package/ui/Elements/Icon/icons/AddPhoto.js +6 -2
- package/ui/Elements/Icon/icons/BarcodeScan.js +6 -2
- package/ui/Elements/Icon/icons/Box.js +6 -2
- package/ui/Elements/Icon/icons/Calendar.js +6 -2
- package/ui/Elements/Icon/icons/Cancel.js +6 -2
- package/ui/Elements/Icon/icons/CheckedBox.js +6 -2
- package/ui/Elements/Icon/icons/Company.js +6 -2
- package/ui/Elements/Icon/icons/Complaint.js +6 -2
- package/ui/Elements/Icon/icons/Consolidation.js +6 -2
- package/ui/Elements/Icon/icons/Dispatch.js +6 -2
- package/ui/Elements/Icon/icons/EmptyRack.js +6 -2
- package/ui/Elements/Icon/icons/Expeditions.js +6 -2
- package/ui/Elements/Icon/icons/FlagCZ.js +6 -2
- package/ui/Elements/Icon/icons/FlagEL.js +6 -2
- package/ui/Elements/Icon/icons/FlagESP.js +6 -2
- package/ui/Elements/Icon/icons/FlagITA.js +6 -2
- package/ui/Elements/Icon/icons/FlagRUS.js +6 -2
- package/ui/Elements/Icon/icons/FlagSVK.js +6 -2
- package/ui/Elements/Icon/icons/FlagUSA.js +6 -2
- package/ui/Elements/Icon/icons/Gift.js +6 -2
- package/ui/Elements/Icon/icons/Group.js +6 -2
- package/ui/Elements/Icon/icons/HamburgerMenu.js +6 -2
- package/ui/Elements/Icon/icons/HelpCircle1.js +6 -2
- package/ui/Elements/Icon/icons/ImagePlaceholder.js +6 -2
- package/ui/Elements/Icon/icons/Income.js +6 -2
- package/ui/Elements/Icon/icons/Info.js +6 -2
- package/ui/Elements/Icon/icons/Integrations.js +6 -2
- package/ui/Elements/Icon/icons/Inventory.js +6 -2
- package/ui/Elements/Icon/icons/Inventory2.js +6 -2
- package/ui/Elements/Icon/icons/Link.js +6 -2
- package/ui/Elements/Icon/icons/Location.js +6 -2
- package/ui/Elements/Icon/icons/Logout1.js +6 -2
- package/ui/Elements/Icon/icons/MakePhoto.js +6 -2
- package/ui/Elements/Icon/icons/MenuItems.js +6 -2
- package/ui/Elements/Icon/icons/MobileCancel.js +6 -2
- package/ui/Elements/Icon/icons/Notification2.js +6 -2
- package/ui/Elements/Icon/icons/OpenBox.js +6 -2
- package/ui/Elements/Icon/icons/Plus1.js +6 -2
- package/ui/Elements/Icon/icons/Print.js +6 -2
- package/ui/Elements/Icon/icons/Product.js +6 -2
- package/ui/Elements/Icon/icons/Products.js +6 -2
- package/ui/Elements/Icon/icons/Profile.js +6 -2
- package/ui/Elements/Icon/icons/Puzzle1.js +6 -2
- package/ui/Elements/Icon/icons/QRCode.js +6 -2
- package/ui/Elements/Icon/icons/Rack.js +6 -2
- package/ui/Elements/Icon/icons/Return.js +6 -2
- package/ui/Elements/Icon/icons/Rows.js +6 -2
- package/ui/Elements/Icon/icons/Settings2.js +6 -2
- package/ui/Elements/Icon/icons/ShoppingBag.js +6 -2
- package/ui/Elements/Icon/icons/ThreeDots.js +6 -2
- package/ui/Elements/Icon/icons/Transfer.js +6 -2
- package/ui/Elements/Icon/icons/Truck.js +6 -2
- package/ui/Elements/Icon/icons/TwoBoxes.js +6 -2
- package/ui/Elements/Icon/icons/TwoCheckedBoxes.js +6 -2
- package/ui/Elements/Icon/icons/TwoUsers.js +6 -2
- package/ui/Elements/Icon/icons/index.js +114 -55
- package/ui/Elements/Icon/index.js +26 -5
- package/ui/Elements/Icon/stories/BadgeIcon.stories.js +12 -6
- package/ui/Elements/Icon/stories/Icon.stories.js +12 -9
- package/ui/Elements/Icon/types.js +2 -1
- package/ui/Elements/Image/Image.js +6 -4
- package/ui/Elements/Image/index.js +9 -3
- package/ui/Elements/Image/stories/Image.stories.js +15 -9
- package/ui/Elements/Image/types.js +2 -1
- package/ui/Elements/Label/Label.js +35 -9
- package/ui/Elements/Label/index.js +8 -3
- package/ui/Elements/Label/stories/Label.stories.js +8 -5
- package/ui/Elements/Line/Line.js +10 -5
- package/ui/Elements/Line/index.js +9 -3
- package/ui/Elements/Line/stories/Line.stories.js +16 -10
- package/ui/Elements/Line/types.js +2 -1
- package/ui/Elements/Link/Link.js +39 -14
- package/ui/Elements/Link/index.js +9 -3
- package/ui/Elements/Link/stories/Link.stories.js +13 -10
- package/ui/Elements/Logo/Logo.js +30 -25
- package/ui/Elements/Logo/index.js +9 -3
- package/ui/Elements/Logo/stories/Logo.stories.js +24 -18
- package/ui/Elements/Logo/types.js +2 -1
- package/ui/Elements/MultiSelect/MultiSelect.js +9 -4
- package/ui/Elements/MultiSelect/index.js +7 -2
- package/ui/Elements/Pagination/Pagination.js +9 -7
- package/ui/Elements/Pagination/index.js +9 -3
- package/ui/Elements/Pagination/stories/Pagination.stories.js +8 -5
- package/ui/Elements/Pagination/styled.js +41 -12
- package/ui/Elements/Portal/index.js +14 -7
- package/ui/Elements/ProgressBar/ProgressBar.js +6 -4
- package/ui/Elements/ProgressBar/index.js +9 -3
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.js +12 -6
- package/ui/Elements/ProgressBar/styles.js +38 -12
- package/ui/Elements/Select/Select.js +25 -20
- package/ui/Elements/Select/index.js +7 -2
- package/ui/Elements/Select/styles.js +13 -7
- package/ui/Elements/Select/themes/CustomComponents.js +72 -37
- package/ui/Elements/Select/themes/baseStyles.js +12 -6
- package/ui/Elements/Select/themes/formStyles.js +27 -23
- package/ui/Elements/Select/themes/index.js +20 -16
- package/ui/Elements/Select/types.js +2 -1
- package/ui/Elements/SimpleLink/SimpleLink.js +31 -6
- package/ui/Elements/SimpleLink/index.js +9 -3
- package/ui/Elements/SingleSelect/SingleSelect.js +32 -27
- package/ui/Elements/SingleSelect/index.js +7 -2
- package/ui/Elements/SpaceAround/SpaceAround.js +36 -11
- package/ui/Elements/SpaceAround/index.js +9 -3
- package/ui/Elements/SpaceAround/stories/SpaceAround.stories.js +8 -5
- package/ui/Elements/SpaceAround/types.js +2 -1
- package/ui/Elements/Spinner/Spinner.js +12 -8
- package/ui/Elements/Spinner/index.js +9 -3
- package/ui/Elements/Spinner/stories/Spinner.stories.js +16 -13
- package/ui/Elements/Spinner/styles.js +33 -7
- package/ui/Elements/Spinner/types.js +2 -1
- package/ui/Elements/Tag/Tag.js +31 -6
- package/ui/Elements/Tag/index.js +10 -3
- package/ui/Elements/Tag/palletes.js +4 -1
- package/ui/Elements/Tag/stories/Tag.stories.js +21 -15
- package/ui/Elements/Tag/stories/components/predefinedTags.js +11 -6
- package/ui/Elements/Tag/types.js +2 -1
- package/ui/Elements/Text/Text.js +6 -4
- package/ui/Elements/Text/index.js +8 -2
- package/ui/Elements/Text/stories/Text.stories.js +15 -9
- package/ui/Elements/Text/types.js +2 -1
- package/ui/Elements/Toast/Toast.js +15 -10
- package/ui/Elements/Toast/index.js +9 -3
- package/ui/Elements/Toggle/Toggle.js +38 -13
- package/ui/Elements/Toggle/index.js +9 -3
- package/ui/Elements/Toggle/stories/Toggle.stories.js +13 -7
- package/ui/Elements/Toggle/types.js +2 -1
- package/ui/Elements/Typography/Typography.js +44 -28
- package/ui/Elements/Typography/index.js +19 -3
- package/ui/Elements/Typography/stories/Typography.stories.js +18 -15
- package/ui/Forms/Checkbox/Checkbox.js +11 -9
- package/ui/Forms/Checkbox/index.js +9 -3
- package/ui/Forms/Checkbox/stories/Checkbox.stories.js +13 -7
- package/ui/Forms/Checkbox/styles.js +32 -6
- package/ui/Forms/Checkbox/types.js +2 -1
- package/ui/Forms/Input/Input.js +20 -16
- package/ui/Forms/Input/index.js +6 -3
- package/ui/Forms/Input/stories/Input.stories.js +14 -11
- package/ui/Forms/Input/styles.js +46 -20
- package/ui/Forms/Input/types.js +2 -1
- package/ui/Forms/RadioButton/RadioButton.js +8 -6
- package/ui/Forms/RadioButton/index.js +9 -3
- package/ui/Forms/RadioButton/stories/RadioButton.stories.js +13 -7
- package/ui/Forms/RadioButton/styles.js +13 -7
- package/ui/Forms/RadioButton/types.js +2 -1
- package/ui/Forms/TextArea/TextArea.js +13 -8
- package/ui/Forms/TextArea/index.js +7 -2
- package/ui/Forms/TextArea/styles.js +39 -13
- package/ui/System/Fonts/index.js +14 -9
- package/ui/ThemeProvider/ThemeProvider.js +13 -7
- package/ui/ThemeProvider/index.js +25 -5
- package/ui/ThemeProvider/themes/default.js +3 -1
- package/ui/ThemeProvider/themes/index.js +12 -7
- package/ui/ThemeProvider/themes/light.js +3 -1
- package/ui/ThemeProvider/themes/mailwise.js +3 -1
- package/ui/ThemeProvider/types.js +2 -1
- package/ui/index.js +146 -85
- package/ui/index.umd.js +3878 -0
- package/ui/utils/CreateRgba/createRgba.js +12 -5
- package/ui/utils/CreateRgba/types.js +2 -1
- package/ui/utils/KeyPress/KeyPress.js +6 -4
- package/ui/utils/KeyPress/KeyPress.stories.js +12 -6
- package/ui/utils/KeyPress/index.js +7 -2
- package/ui/utils/KeyPress/types.js +2 -1
- package/ui/utils/index.js +13 -6
- package/ui/index.cjs.js +0 -3878
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __assign = (this && this.__assign) || function () {
|
|
2
3
|
__assign = Object.assign || function(t) {
|
|
3
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -9,26 +10,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
10
|
};
|
|
10
11
|
return __assign.apply(this, arguments);
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var react_1 = require("react");
|
|
13
15
|
var useManageColumn = function (_a) {
|
|
14
16
|
var columns = _a.columns, gridSelectors = _a.gridSelectors, gridActions = _a.gridActions, onClose = _a.onClose;
|
|
15
17
|
var resetGrid = gridActions.resetGrid, setColumnConfig = gridActions.setColumnConfig;
|
|
16
18
|
var columnConfig = gridSelectors.columnConfig;
|
|
17
|
-
var _b = useState(__assign({}, columnConfig)), columnsConfigOptions = _b[0], setColumnsConfigOptions = _b[1];
|
|
18
|
-
var columnsConfigValues = useMemo(function () {
|
|
19
|
+
var _b = (0, react_1.useState)(__assign({}, columnConfig)), columnsConfigOptions = _b[0], setColumnsConfigOptions = _b[1];
|
|
20
|
+
var columnsConfigValues = (0, react_1.useMemo)(function () {
|
|
19
21
|
return columns === null || columns === void 0 ? void 0 : columns.filter(function (column) {
|
|
20
22
|
var _a;
|
|
21
23
|
var isHidden = (_a = columnConfig === null || columnConfig === void 0 ? void 0 : columnConfig[column.name]) === null || _a === void 0 ? void 0 : _a.isHidden;
|
|
22
24
|
return (column === null || column === void 0 ? void 0 : column.alwaysOn) || typeof isHidden === 'boolean' ? !isHidden : !(column === null || column === void 0 ? void 0 : column.defaultHidden);
|
|
23
25
|
}).map(function (column) { return column.name; });
|
|
24
26
|
}, [columnConfig, columns]);
|
|
25
|
-
var onConfirmForm = useCallback(function () {
|
|
27
|
+
var onConfirmForm = (0, react_1.useCallback)(function () {
|
|
26
28
|
(setColumnConfig === null || setColumnConfig === void 0 ? void 0 : setColumnConfig(columnsConfigOptions)) && (onClose === null || onClose === void 0 ? void 0 : onClose());
|
|
27
29
|
}, [columnsConfigOptions, onClose, setColumnConfig]);
|
|
28
|
-
var resetColumnConfig = useCallback(function () {
|
|
30
|
+
var resetColumnConfig = (0, react_1.useCallback)(function () {
|
|
29
31
|
(resetGrid === null || resetGrid === void 0 ? void 0 : resetGrid()) && (onClose === null || onClose === void 0 ? void 0 : onClose());
|
|
30
32
|
setColumnsConfigOptions(columnConfig || {});
|
|
31
33
|
}, [onClose, resetGrid]);
|
|
32
34
|
return { columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions, onConfirmForm: onConfirmForm, resetColumnConfig: resetColumnConfig };
|
|
33
35
|
};
|
|
34
|
-
|
|
36
|
+
exports.default = useManageColumn;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
2
7
|
var useRowsKeyControls = function (rowsData, uxState, onUxChange) {
|
|
3
|
-
return
|
|
8
|
+
return react_1.default.useCallback(function (e) {
|
|
4
9
|
var _a, _b;
|
|
5
10
|
var selectedRowId = uxState.selectedRow;
|
|
6
11
|
if (!selectedRowId)
|
|
@@ -18,4 +23,4 @@ var useRowsKeyControls = function (rowsData, uxState, onUxChange) {
|
|
|
18
23
|
onUxChange === null || onUxChange === void 0 ? void 0 : onUxChange('selectedRow', null);
|
|
19
24
|
}, [uxState, rowsData, onUxChange]);
|
|
20
25
|
};
|
|
21
|
-
|
|
26
|
+
exports.default = useRowsKeyControls;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useToggleAllCheckbox = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var useToggleAllCheckbox = function (rowsData, uxState, handleUxChange) {
|
|
6
|
+
var allChecked = (0, react_1.useMemo)(function () { return (rowsData || []).length >= 1 && rowsData.every(function (row) { var _a; return (_a = uxState.checkedRows) === null || _a === void 0 ? void 0 : _a[row.id]; }); }, [rowsData, uxState.checkedRows]);
|
|
7
|
+
var toggleAllHandler = (0, react_1.useCallback)(function () {
|
|
5
8
|
var checkedRows = {};
|
|
6
9
|
// if check all is not check, we check all
|
|
7
10
|
if (!allChecked && rowsData) {
|
|
@@ -13,3 +16,4 @@ export var useToggleAllCheckbox = function (rowsData, uxState, handleUxChange) {
|
|
|
13
16
|
}, [handleUxChange, rowsData, allChecked]);
|
|
14
17
|
return [allChecked, toggleAllHandler];
|
|
15
18
|
};
|
|
19
|
+
exports.useToggleAllCheckbox = useToggleAllCheckbox;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
2
7
|
var useUxReset = function (rowsData, uxState, clearUxState) {
|
|
3
|
-
var _a =
|
|
4
|
-
|
|
8
|
+
var _a = react_1.default.useState('|'), previous = _a[0], setPrevious = _a[1];
|
|
9
|
+
react_1.default.useEffect(function () {
|
|
5
10
|
var ids = (rowsData || []).map(function (row) { return row.id; }).join('|');
|
|
6
11
|
// clear uxState if listed rows change and uxState is not clear already
|
|
7
12
|
if (ids !== previous) {
|
|
@@ -12,4 +17,4 @@ var useUxReset = function (rowsData, uxState, clearUxState) {
|
|
|
12
17
|
setPrevious(ids);
|
|
13
18
|
}, [rowsData]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
14
19
|
};
|
|
15
|
-
|
|
20
|
+
exports.default = useUxReset;
|
|
@@ -1,10 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.useAddFilter = exports.useFloatingButton = exports.Types = exports.createFullSelector = exports.createSelectors = exports.createActions = exports.actionTypes = exports.actionPrefix = exports.reducer = exports.withReduxActions = void 0;
|
|
33
|
+
var CommonGridContainer_1 = __importDefault(require("./CommonGridContainer"));
|
|
34
|
+
var withReduxActions_1 = __importDefault(require("./HoC/withReduxActions"));
|
|
35
|
+
exports.withReduxActions = withReduxActions_1.default;
|
|
36
|
+
var store_1 = __importStar(require("./store"));
|
|
37
|
+
exports.reducer = store_1.default;
|
|
38
|
+
Object.defineProperty(exports, "actionPrefix", { enumerable: true, get: function () { return store_1.actionPrefix; } });
|
|
39
|
+
Object.defineProperty(exports, "createActions", { enumerable: true, get: function () { return store_1.createActions; } });
|
|
40
|
+
Object.defineProperty(exports, "createSelectors", { enumerable: true, get: function () { return store_1.createSelectors; } });
|
|
41
|
+
Object.defineProperty(exports, "createFullSelector", { enumerable: true, get: function () { return store_1.createFullSelector; } });
|
|
42
|
+
Object.defineProperty(exports, "actionTypes", { enumerable: true, get: function () { return store_1.actionTypes; } });
|
|
43
|
+
var useFloatingButton_1 = __importDefault(require("./hooks/useFloatingButton"));
|
|
44
|
+
exports.useFloatingButton = useFloatingButton_1.default;
|
|
45
|
+
var Types = __importStar(require("./types"));
|
|
46
|
+
exports.Types = Types;
|
|
47
|
+
__exportStar(require("./StandardButtons"), exports);
|
|
48
|
+
__exportStar(require("./components/gridCells"), exports);
|
|
49
|
+
var useAddFilter_1 = require("./hooks/useAddFilter");
|
|
50
|
+
Object.defineProperty(exports, "useAddFilter", { enumerable: true, get: function () { return useAddFilter_1.useAddFilter; } });
|
|
51
|
+
exports.default = CommonGridContainer_1.default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __assign = (this && this.__assign) || function () {
|
|
2
3
|
__assign = Object.assign || function(t) {
|
|
3
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -9,11 +10,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
10
|
};
|
|
10
11
|
return __assign.apply(this, arguments);
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.createFullSelector = exports.createSelectors = exports.createActions = exports.actionTypes = exports.actionPrefix = exports.initialState = void 0;
|
|
18
|
+
var immer_1 = __importDefault(require("immer"));
|
|
19
|
+
var getOr_1 = __importDefault(require("lodash/fp/getOr"));
|
|
20
|
+
var migrateState_1 = __importDefault(require("./migrateState"));
|
|
21
|
+
var reselect_1 = require("reselect");
|
|
22
|
+
exports.initialState = {
|
|
17
23
|
page: 1,
|
|
18
24
|
rowsPerPage: 10,
|
|
19
25
|
sorting: [],
|
|
@@ -28,33 +34,33 @@ export var initialState = {
|
|
|
28
34
|
columnsOrder: [],
|
|
29
35
|
defaultSorting: [],
|
|
30
36
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
init: "".concat(actionPrefix, "/init"),
|
|
34
|
-
clearUxState: "".concat(actionPrefix, "/clearUxState"),
|
|
35
|
-
handleUxChange: "".concat(actionPrefix, "/handleUxChange"),
|
|
36
|
-
openConfigForm: "".concat(actionPrefix, "/openConfigForm"),
|
|
37
|
-
closeConfigForm: "".concat(actionPrefix, "/closeConfigForm"),
|
|
38
|
-
setColumnConfig: "".concat(actionPrefix, "/setColumnConfig"),
|
|
39
|
-
setPage: "".concat(actionPrefix, "/setPage"),
|
|
40
|
-
setRowsPerPage: "".concat(actionPrefix, "/setRowsPerPage"),
|
|
41
|
-
resetFilters: "".concat(actionPrefix, "/resetFilters"),
|
|
42
|
-
addFilter: "".concat(actionPrefix, "/addFilter"),
|
|
43
|
-
addSorting: "".concat(actionPrefix, "/addSorting"),
|
|
44
|
-
clearSettings: "".concat(actionPrefix, "/clearSettings"),
|
|
45
|
-
resetGrid: "".concat(actionPrefix, "/resetGrid"),
|
|
46
|
-
setColumnWidth: "".concat(actionPrefix, "/setColumnWidth"),
|
|
47
|
-
setColumnsOrder: "".concat(actionPrefix, "/setColumnsOrder"),
|
|
37
|
+
exports.actionPrefix = '@store/CommonGrid';
|
|
38
|
+
exports.actionTypes = {
|
|
39
|
+
init: "".concat(exports.actionPrefix, "/init"),
|
|
40
|
+
clearUxState: "".concat(exports.actionPrefix, "/clearUxState"),
|
|
41
|
+
handleUxChange: "".concat(exports.actionPrefix, "/handleUxChange"),
|
|
42
|
+
openConfigForm: "".concat(exports.actionPrefix, "/openConfigForm"),
|
|
43
|
+
closeConfigForm: "".concat(exports.actionPrefix, "/closeConfigForm"),
|
|
44
|
+
setColumnConfig: "".concat(exports.actionPrefix, "/setColumnConfig"),
|
|
45
|
+
setPage: "".concat(exports.actionPrefix, "/setPage"),
|
|
46
|
+
setRowsPerPage: "".concat(exports.actionPrefix, "/setRowsPerPage"),
|
|
47
|
+
resetFilters: "".concat(exports.actionPrefix, "/resetFilters"),
|
|
48
|
+
addFilter: "".concat(exports.actionPrefix, "/addFilter"),
|
|
49
|
+
addSorting: "".concat(exports.actionPrefix, "/addSorting"),
|
|
50
|
+
clearSettings: "".concat(exports.actionPrefix, "/clearSettings"),
|
|
51
|
+
resetGrid: "".concat(exports.actionPrefix, "/resetGrid"),
|
|
52
|
+
setColumnWidth: "".concat(exports.actionPrefix, "/setColumnWidth"),
|
|
53
|
+
setColumnsOrder: "".concat(exports.actionPrefix, "/setColumnsOrder"),
|
|
48
54
|
};
|
|
49
55
|
var migrationChecked = false;
|
|
50
|
-
|
|
56
|
+
exports.default = (function (state, action) {
|
|
51
57
|
if (state === void 0) { state = {}; }
|
|
52
|
-
return
|
|
58
|
+
return (0, immer_1.default)(state, function (draft) {
|
|
53
59
|
var _a, _b;
|
|
54
60
|
var _c, _d, _e, _f, _g;
|
|
55
61
|
// version migrations
|
|
56
62
|
if (!migrationChecked && state && Object.keys(state).length > 0) {
|
|
57
|
-
draft =
|
|
63
|
+
draft = (0, migrateState_1.default)(draft);
|
|
58
64
|
migrationChecked = true;
|
|
59
65
|
}
|
|
60
66
|
var gridName = action.gridName;
|
|
@@ -62,9 +68,9 @@ export default (function (state, action) {
|
|
|
62
68
|
return draft; // action does not contains gridName, skip immediatelly
|
|
63
69
|
if (!draft[gridName]) {
|
|
64
70
|
// if this grid is not yet in store, initialize
|
|
65
|
-
draft[gridName] = __assign({}, initialState);
|
|
71
|
+
draft[gridName] = __assign({}, exports.initialState);
|
|
66
72
|
}
|
|
67
|
-
if (action.type === actionTypes.init) {
|
|
73
|
+
if (action.type === exports.actionTypes.init) {
|
|
68
74
|
var defaultSorting = action.initProps.defaultSorting;
|
|
69
75
|
draft[gridName].page = 1;
|
|
70
76
|
if (defaultSorting) {
|
|
@@ -72,34 +78,34 @@ export default (function (state, action) {
|
|
|
72
78
|
draft[gridName].sorting = ((_c = draft[gridName].sorting) === null || _c === void 0 ? void 0 : _c.length) ? draft[gridName].sorting : defaultSorting;
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
|
-
else if (action.type === actionTypes.clearUxState) {
|
|
76
|
-
draft[gridName].uxState = initialState.uxState;
|
|
81
|
+
else if (action.type === exports.actionTypes.clearUxState) {
|
|
82
|
+
draft[gridName].uxState = exports.initialState.uxState;
|
|
77
83
|
}
|
|
78
|
-
else if (action.type === actionTypes.handleUxChange) {
|
|
84
|
+
else if (action.type === exports.actionTypes.handleUxChange) {
|
|
79
85
|
// for a specific row id (action.id) append uxState from action
|
|
80
86
|
draft[gridName].uxState = __assign(__assign({}, draft[gridName].uxState), (_a = {}, _a[action.uxKey] = action.uxValue, _a));
|
|
81
87
|
}
|
|
82
|
-
else if (action.type === actionTypes.openConfigForm) {
|
|
88
|
+
else if (action.type === exports.actionTypes.openConfigForm) {
|
|
83
89
|
draft[gridName].isConfigFormOpen = true;
|
|
84
90
|
}
|
|
85
|
-
else if (action.type === actionTypes.closeConfigForm) {
|
|
91
|
+
else if (action.type === exports.actionTypes.closeConfigForm) {
|
|
86
92
|
draft[gridName].isConfigFormOpen = false;
|
|
87
93
|
}
|
|
88
|
-
else if (action.type === actionTypes.setColumnConfig) {
|
|
94
|
+
else if (action.type === exports.actionTypes.setColumnConfig) {
|
|
89
95
|
draft[gridName].columnConfig = action.columnConfig;
|
|
90
96
|
draft[gridName].isConfigFormOpen = false;
|
|
91
97
|
}
|
|
92
|
-
else if (action.type === actionTypes.resetFilters) {
|
|
98
|
+
else if (action.type === exports.actionTypes.resetFilters) {
|
|
93
99
|
draft[gridName].filter = {};
|
|
94
100
|
}
|
|
95
|
-
else if (action.type === actionTypes.addFilter) {
|
|
101
|
+
else if (action.type === exports.actionTypes.addFilter) {
|
|
96
102
|
// append desired filter for specific column to existing filters
|
|
97
103
|
var column = action.column, value = action.value, filterProps = action.filterProps;
|
|
98
104
|
var currentFilterState = (_b = {}, _b[column] = { value: value, filterProps: filterProps }, _b);
|
|
99
105
|
draft[gridName].filter = __assign(__assign({}, draft[gridName].filter), currentFilterState);
|
|
100
106
|
draft[gridName].page = 1;
|
|
101
107
|
}
|
|
102
|
-
else if (action.type === actionTypes.addSorting) {
|
|
108
|
+
else if (action.type === exports.actionTypes.addSorting) {
|
|
103
109
|
// append desired sorting for specific column to existing sortings
|
|
104
110
|
var direction = action.direction;
|
|
105
111
|
var column = action.column;
|
|
@@ -113,109 +119,111 @@ export default (function (state, action) {
|
|
|
113
119
|
}
|
|
114
120
|
draft[gridName].sorting = sorting;
|
|
115
121
|
}
|
|
116
|
-
else if (action.type === actionTypes.clearSettings) {
|
|
122
|
+
else if (action.type === exports.actionTypes.clearSettings) {
|
|
117
123
|
// clear grid for reuse
|
|
118
|
-
draft[gridName].page = initialState.page;
|
|
119
|
-
draft[gridName].filter = initialState.filter;
|
|
120
|
-
draft[gridName].uxState = initialState.uxState;
|
|
124
|
+
draft[gridName].page = exports.initialState.page;
|
|
125
|
+
draft[gridName].filter = exports.initialState.filter;
|
|
126
|
+
draft[gridName].uxState = exports.initialState.uxState;
|
|
121
127
|
}
|
|
122
|
-
else if (action.type === actionTypes.setPage) {
|
|
128
|
+
else if (action.type === exports.actionTypes.setPage) {
|
|
123
129
|
draft[gridName].page = action.page;
|
|
124
130
|
}
|
|
125
|
-
else if (action.type === actionTypes.setRowsPerPage) {
|
|
131
|
+
else if (action.type === exports.actionTypes.setRowsPerPage) {
|
|
126
132
|
draft[gridName].rowsPerPage = action.rowsPerPage;
|
|
127
133
|
}
|
|
128
|
-
else if (action.type === actionTypes.resetGrid) {
|
|
129
|
-
draft[gridName] = __assign(__assign({}, initialState), { rowsPerPage: draft[gridName].rowsPerPage });
|
|
134
|
+
else if (action.type === exports.actionTypes.resetGrid) {
|
|
135
|
+
draft[gridName] = __assign(__assign({}, exports.initialState), { rowsPerPage: draft[gridName].rowsPerPage });
|
|
130
136
|
}
|
|
131
|
-
else if (action.type === actionTypes.setColumnWidth) {
|
|
137
|
+
else if (action.type === exports.actionTypes.setColumnWidth) {
|
|
132
138
|
if (action.columnsWidth === null) {
|
|
133
|
-
draft[gridName].columnsWidth = initialState.columnsWidth;
|
|
139
|
+
draft[gridName].columnsWidth = exports.initialState.columnsWidth;
|
|
134
140
|
}
|
|
135
141
|
else {
|
|
136
142
|
draft[gridName].columnsWidth = __assign(__assign({}, draft[gridName].columnsWidth), action.columnsWidth);
|
|
137
143
|
}
|
|
138
144
|
draft[gridName].columnsWidthVariant = action.columnLayout;
|
|
139
145
|
}
|
|
140
|
-
else if (action.type === actionTypes.setColumnsOrder) {
|
|
146
|
+
else if (action.type === exports.actionTypes.setColumnsOrder) {
|
|
141
147
|
draft[gridName].columnsOrder = action.columnsOrder;
|
|
142
148
|
}
|
|
143
149
|
return draft;
|
|
144
150
|
});
|
|
145
151
|
});
|
|
146
|
-
|
|
147
|
-
init: function (initProps) { return ({ gridName: gridName, type: actionTypes.init, initProps: initProps }); },
|
|
148
|
-
clearUxState: function () { return ({ gridName: gridName, type: actionTypes.clearUxState }); },
|
|
152
|
+
var createActions = function (gridName) { return ({
|
|
153
|
+
init: function (initProps) { return ({ gridName: gridName, type: exports.actionTypes.init, initProps: initProps }); },
|
|
154
|
+
clearUxState: function () { return ({ gridName: gridName, type: exports.actionTypes.clearUxState }); },
|
|
149
155
|
handleUxChange: function (uxKey, uxValue) { return ({
|
|
150
156
|
gridName: gridName,
|
|
151
|
-
type: actionTypes.handleUxChange,
|
|
157
|
+
type: exports.actionTypes.handleUxChange,
|
|
152
158
|
uxKey: uxKey,
|
|
153
159
|
uxValue: uxValue,
|
|
154
160
|
}); },
|
|
155
|
-
openConfigForm: function () { return ({ gridName: gridName, type: actionTypes.openConfigForm }); },
|
|
156
|
-
closeConfigForm: function () { return ({ gridName: gridName, type: actionTypes.closeConfigForm }); },
|
|
157
|
-
setColumnConfig: function (columnConfig) { return ({ gridName: gridName, type: actionTypes.setColumnConfig, columnConfig: columnConfig }); },
|
|
158
|
-
setPage: function (page) { return ({ gridName: gridName, type: actionTypes.setPage, page: page }); },
|
|
161
|
+
openConfigForm: function () { return ({ gridName: gridName, type: exports.actionTypes.openConfigForm }); },
|
|
162
|
+
closeConfigForm: function () { return ({ gridName: gridName, type: exports.actionTypes.closeConfigForm }); },
|
|
163
|
+
setColumnConfig: function (columnConfig) { return ({ gridName: gridName, type: exports.actionTypes.setColumnConfig, columnConfig: columnConfig }); },
|
|
164
|
+
setPage: function (page) { return ({ gridName: gridName, type: exports.actionTypes.setPage, page: page }); },
|
|
159
165
|
setColumnWidth: function (columnsWidth, columnLayout) { return ({
|
|
160
166
|
gridName: gridName,
|
|
161
|
-
type: actionTypes.setColumnWidth,
|
|
167
|
+
type: exports.actionTypes.setColumnWidth,
|
|
162
168
|
columnsWidth: columnsWidth,
|
|
163
169
|
columnLayout: columnLayout,
|
|
164
170
|
}); },
|
|
165
|
-
resetGrid: function () { return ({ gridName: gridName, type: actionTypes.resetGrid }); },
|
|
171
|
+
resetGrid: function () { return ({ gridName: gridName, type: exports.actionTypes.resetGrid }); },
|
|
166
172
|
setColumnsOrder: function (columnsOrder) { return ({
|
|
167
173
|
gridName: gridName,
|
|
168
|
-
type: actionTypes.setColumnsOrder,
|
|
174
|
+
type: exports.actionTypes.setColumnsOrder,
|
|
169
175
|
columnsOrder: columnsOrder,
|
|
170
176
|
}); },
|
|
171
|
-
setRowsPerPage: function (rowsPerPage) { return ({ gridName: gridName, type: actionTypes.setRowsPerPage, rowsPerPage: rowsPerPage }); },
|
|
172
|
-
resetFilters: function () { return ({ gridName: gridName, type: actionTypes.resetFilters }); },
|
|
177
|
+
setRowsPerPage: function (rowsPerPage) { return ({ gridName: gridName, type: exports.actionTypes.setRowsPerPage, rowsPerPage: rowsPerPage }); },
|
|
178
|
+
resetFilters: function () { return ({ gridName: gridName, type: exports.actionTypes.resetFilters }); },
|
|
173
179
|
addFilter: function (column, value, filterProps) { return ({
|
|
174
180
|
gridName: gridName,
|
|
175
|
-
type: actionTypes.addFilter,
|
|
181
|
+
type: exports.actionTypes.addFilter,
|
|
176
182
|
column: column,
|
|
177
183
|
value: value,
|
|
178
184
|
filterProps: filterProps,
|
|
179
185
|
}); },
|
|
180
186
|
addSorting: function (column, direction) { return ({
|
|
181
187
|
gridName: gridName,
|
|
182
|
-
type: actionTypes.addSorting,
|
|
188
|
+
type: exports.actionTypes.addSorting,
|
|
183
189
|
column: column,
|
|
184
190
|
direction: direction,
|
|
185
191
|
}); },
|
|
186
|
-
clearSettings: function () { return ({ gridName: gridName, type: actionTypes.clearSettings }); },
|
|
192
|
+
clearSettings: function () { return ({ gridName: gridName, type: exports.actionTypes.clearSettings }); },
|
|
187
193
|
}); };
|
|
188
|
-
|
|
194
|
+
exports.createActions = createActions;
|
|
195
|
+
var createSelectors = function (gridName) { return ({
|
|
189
196
|
getUxState: function (state) {
|
|
190
|
-
return
|
|
197
|
+
return (0, getOr_1.default)(exports.initialState.uxState, "commonGrid.".concat(gridName, ".uxState"), state);
|
|
191
198
|
},
|
|
192
199
|
isConfigFormOpen: function (state) {
|
|
193
|
-
return
|
|
200
|
+
return (0, getOr_1.default)(exports.initialState.isConfigFormOpen, "commonGrid.".concat(gridName, ".isConfigFormOpen"), state);
|
|
194
201
|
},
|
|
195
202
|
getColumnConfig: function (state) {
|
|
196
|
-
return
|
|
203
|
+
return (0, getOr_1.default)(exports.initialState.columnConfig, "commonGrid.".concat(gridName, ".columnConfig"), state);
|
|
197
204
|
},
|
|
198
|
-
getPage: function (state) { return
|
|
205
|
+
getPage: function (state) { return (0, getOr_1.default)(exports.initialState.page, "commonGrid.".concat(gridName, ".page"), state); },
|
|
199
206
|
getRowsPerPage: function (state) {
|
|
200
|
-
return
|
|
207
|
+
return (0, getOr_1.default)(exports.initialState.rowsPerPage, "commonGrid.".concat(gridName, ".rowsPerPage"), state);
|
|
201
208
|
},
|
|
202
|
-
getFilter: function (state) { return
|
|
209
|
+
getFilter: function (state) { return (0, getOr_1.default)(exports.initialState.filter, "commonGrid.".concat(gridName, ".filter"), state); },
|
|
203
210
|
getSorting: function (state) {
|
|
204
|
-
return
|
|
211
|
+
return (0, getOr_1.default)(exports.initialState.sorting, "commonGrid.".concat(gridName, ".sorting"), state);
|
|
205
212
|
},
|
|
206
213
|
getColumnsWidth: function (state) {
|
|
207
|
-
return
|
|
214
|
+
return (0, getOr_1.default)(null, "commonGrid.".concat(gridName, ".columnsWidth"), state);
|
|
208
215
|
},
|
|
209
216
|
getColumnsWidthVariant: function (state) {
|
|
210
|
-
return
|
|
217
|
+
return (0, getOr_1.default)(undefined, "commonGrid.".concat(gridName, ".columnsWidthVariant"), state);
|
|
211
218
|
},
|
|
212
219
|
getColumnsOrder: function (state) {
|
|
213
|
-
return
|
|
220
|
+
return (0, getOr_1.default)([], "commonGrid.".concat(gridName, ".columnsOrder"), state);
|
|
214
221
|
},
|
|
215
222
|
}); };
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
exports.createSelectors = createSelectors;
|
|
224
|
+
var createFullSelector = function (gridName) {
|
|
225
|
+
var selectors = (0, exports.createSelectors)(gridName);
|
|
226
|
+
return (0, reselect_1.createSelector)(function (state) { return selectors.getUxState(state); }, function (state) { return selectors.isConfigFormOpen(state); }, function (state) { return selectors.getColumnConfig(state); }, function (state) { return selectors.getPage(state); }, function (state) { return selectors.getRowsPerPage(state); }, function (state) { return selectors.getFilter(state); }, function (state) { return selectors.getSorting(state); }, function (state) { return selectors.getColumnsWidth(state); }, function (state) { return selectors.getColumnsWidthVariant(state); }, function (state) { return selectors.getColumnsOrder(state); }, function (uxState, isConfigFormOpen, columnConfig, page, rowsPerPage, filter, sorting, columnsWidth, columnsWidthVariant, columnsOrder) { return ({
|
|
219
227
|
uxState: uxState,
|
|
220
228
|
isConfigFormOpen: isConfigFormOpen,
|
|
221
229
|
columnConfig: columnConfig,
|
|
@@ -228,3 +236,4 @@ export var createFullSelector = function (gridName) {
|
|
|
228
236
|
columnsOrder: columnsOrder,
|
|
229
237
|
}); });
|
|
230
238
|
};
|
|
239
|
+
exports.createFullSelector = createFullSelector;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
// v1 to v2
|
|
2
4
|
var v2 = function (draft) {
|
|
3
5
|
Object.keys(draft).forEach(function (gridName) {
|
|
@@ -8,7 +10,7 @@ var v2 = function (draft) {
|
|
|
8
10
|
return draft;
|
|
9
11
|
};
|
|
10
12
|
// migration management
|
|
11
|
-
|
|
13
|
+
exports.default = (function (draft) {
|
|
12
14
|
draft = v2(draft);
|
|
13
15
|
return draft;
|
|
14
16
|
});
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ComplexWithPaginationAndRedux = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
var utils_1 = require("../utils/utils");
|
|
10
|
+
var actions_1 = require("../utils/actions");
|
|
11
|
+
var useAddFilter_1 = require("../../hooks/useAddFilter");
|
|
12
|
+
var withReduxActions_1 = __importDefault(require("../../HoC/withReduxActions"));
|
|
13
|
+
var columnDefinition_1 = require("../utils/columnDefinition");
|
|
14
|
+
var withRedux_1 = __importDefault(require("../utils/withRedux"));
|
|
15
|
+
var linguiContainer_1 = require("../utils/linguiContainer");
|
|
10
16
|
var ActionColumnButtons = {
|
|
11
17
|
flexBasis: 160,
|
|
12
18
|
canRowRead: true,
|
|
@@ -14,18 +20,19 @@ var ActionColumnButtons = {
|
|
|
14
20
|
};
|
|
15
21
|
var FilterSetter = function (_a) {
|
|
16
22
|
var gridActions = _a.gridActions;
|
|
17
|
-
var handleAddFilter = useAddFilter(gridActions === null || gridActions === void 0 ? void 0 : gridActions.addFilter);
|
|
18
|
-
|
|
19
|
-
handleAddFilter(enumValues[1], enumColumn);
|
|
23
|
+
var handleAddFilter = (0, useAddFilter_1.useAddFilter)(gridActions === null || gridActions === void 0 ? void 0 : gridActions.addFilter);
|
|
24
|
+
react_1.default.useEffect(function () {
|
|
25
|
+
handleAddFilter(utils_1.enumValues[1], columnDefinition_1.enumColumn);
|
|
20
26
|
}, []);
|
|
21
27
|
return null;
|
|
22
28
|
};
|
|
23
|
-
var ConnectedFilterSetter =
|
|
24
|
-
|
|
29
|
+
var ConnectedFilterSetter = (0, withReduxActions_1.default)('testGrid')(FilterSetter);
|
|
30
|
+
exports.default = {
|
|
25
31
|
title: '@Blocks/CommonGrid',
|
|
26
|
-
decorators: [
|
|
32
|
+
decorators: [withRedux_1.default],
|
|
27
33
|
};
|
|
28
|
-
|
|
29
|
-
ComplexWithPaginationAndRedux
|
|
34
|
+
var ComplexWithPaginationAndRedux = function () { return ((0, jsx_runtime_1.jsxs)(linguiContainer_1.LinguiContainer, { children: [(0, jsx_runtime_1.jsx)(ConnectedFilterSetter, { gridActions: utils_1.gridDummyActions }), (0, jsx_runtime_1.jsx)(utils_1.ReduxGrid, { columnsDefinitions: columnDefinition_1.columnDefinitions, actionColumnDefinition: ActionColumnButtons, rowsData: (0, utils_1.createRandomData)(10), onRowAction: actions_1.onRowAction, onRowReadClick: actions_1.onRowReadClick, onRowEditClick: actions_1.onRowEditClick, totalRowsCount: 200, onBatchAction: actions_1.onBatchAction, confirmOnReset: function () { return window.confirm('Are you sure you want to reset grid?'); } })] })); };
|
|
35
|
+
exports.ComplexWithPaginationAndRedux = ComplexWithPaginationAndRedux;
|
|
36
|
+
exports.ComplexWithPaginationAndRedux.story = {
|
|
30
37
|
name: 'Complex, with pagination and redux',
|
|
31
38
|
};
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Default = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var CommonGridContainer_1 = __importDefault(require("../../CommonGridContainer"));
|
|
9
|
+
var utils_1 = require("../utils/utils");
|
|
10
|
+
var columnDefinition_1 = require("../utils/columnDefinition");
|
|
11
|
+
var withTheme_1 = __importDefault(require("../utils/withTheme"));
|
|
12
|
+
var withRouter_1 = __importDefault(require("../utils/withRouter"));
|
|
13
|
+
var withRedux_1 = __importDefault(require("../utils/withRedux"));
|
|
14
|
+
var linguiContainer_1 = require("../utils/linguiContainer");
|
|
15
|
+
exports.default = {
|
|
10
16
|
title: '@Blocks/CommonGrid',
|
|
11
|
-
decorators: [
|
|
17
|
+
decorators: [withTheme_1.default, withRouter_1.default, withRedux_1.default],
|
|
12
18
|
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
19
|
+
var Default = function () {
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(linguiContainer_1.LinguiContainer, { children: (0, jsx_runtime_1.jsx)(CommonGridContainer_1.default, { columnsDefinitions: columnDefinition_1.columnDefinitions, rowsData: (0, utils_1.createRandomData)(10), gridActions: utils_1.gridDummyActions, gridSelectors: utils_1.gridSelectors }) }));
|
|
15
21
|
};
|
|
22
|
+
exports.Default = Default;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LoadingState = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var CommonGridContainer_1 = __importDefault(require("../../CommonGridContainer"));
|
|
9
|
+
var utils_1 = require("../utils/utils");
|
|
10
|
+
var columnDefinition_1 = require("../utils/columnDefinition");
|
|
11
|
+
var linguiContainer_1 = require("../utils/linguiContainer");
|
|
12
|
+
exports.default = {
|
|
7
13
|
title: '@Blocks/CommonGrid',
|
|
8
14
|
};
|
|
9
|
-
|
|
10
|
-
LoadingState
|
|
15
|
+
var LoadingState = function () { return ((0, jsx_runtime_1.jsx)(linguiContainer_1.LinguiContainer, { children: (0, jsx_runtime_1.jsx)(CommonGridContainer_1.default, { columnsDefinitions: columnDefinition_1.columnDefinitions, rowsData: (0, utils_1.createRandomData)(10), gridSelectors: utils_1.gridSelectors, gridActions: utils_1.gridDummyActions, isLoading: true, hideColumnConfig: true }) })); };
|
|
16
|
+
exports.LoadingState = LoadingState;
|
|
17
|
+
exports.LoadingState.story = {
|
|
11
18
|
name: 'Loading state',
|
|
12
19
|
};
|