@mailstep/design-system 0.6.2-beta.3 → 0.6.2-beta.5
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 +19551 -23227
- package/ui/index.js +85 -146
- package/ui/index.umd.js +484 -510
- 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
|
@@ -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,29 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
12
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
13
|
var t = {};
|
|
38
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -44,50 +20,46 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
44
20
|
}
|
|
45
21
|
return t;
|
|
46
22
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
52
|
-
var moment_1 = __importDefault(require("moment"));
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import moment from 'moment';
|
|
53
25
|
// @TODO each language has 62kb gziped, please replace moment with different lib
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
26
|
+
import 'moment/dist/locale/cs';
|
|
27
|
+
import 'moment/dist/locale/ru';
|
|
28
|
+
import 'moment/dist/locale/sk';
|
|
29
|
+
import 'moment/dist/locale/it';
|
|
30
|
+
import 'moment/dist/locale/el';
|
|
31
|
+
import React, { useCallback, useContext } from 'react';
|
|
32
|
+
import DatetimePicker from './Datetime/DateTime.js';
|
|
33
|
+
import { x } from '@xstyled/styled-components';
|
|
34
|
+
import { DatePickerBase } from './styles.js';
|
|
35
|
+
import SpaceAroundWrap from '../SpaceAround/index.js';
|
|
36
|
+
import Input from '../../Forms/Input/index.js';
|
|
37
|
+
import { LanguageContext } from '../../ThemeProvider/ThemeProvider.js';
|
|
66
38
|
var defaultDateFormat = 'DD.MM.YYYY';
|
|
67
39
|
var DatePicker = function (_a) {
|
|
68
40
|
var name = _a.name, value = _a.value, initialViewDate = _a.initialViewDate, error = _a.error, label = _a.label, disabled = _a.disabled, isValidDate = _a.isValidDate, onChange = _a.onChange, _b = _a.dateFormat, dateFormat = _b === void 0 ? defaultDateFormat : _b, _c = _a.timeFormat, timeFormat = _c === void 0 ? false : _c, open = _a.open, _d = _a.secondValue, secondValue = _d === void 0 ? null : _d, input = _a.input, _e = _a.icon, icon = _e === void 0 ? true : _e, _f = _a.showInputLabel, showInputLabel = _f === void 0 ? false : _f, _g = _a.showCalendarLabel, showCalendarLabel = _g === void 0 ? true : _g, _h = _a.spaceAround, spaceAround = _h === void 0 ? false : _h, className = _a.className, onClear = _a.onClear, passProps = __rest(_a, ["name", "value", "initialViewDate", "error", "label", "disabled", "isValidDate", "onChange", "dateFormat", "timeFormat", "open", "secondValue", "input", "icon", "showInputLabel", "showCalendarLabel", "spaceAround", "className", "onClear"]);
|
|
69
41
|
var format = "".concat(dateFormat).concat(timeFormat ? " ".concat(timeFormat) : "");
|
|
70
|
-
var isValid = !!value && (
|
|
71
|
-
var stringValue = isValid ? (
|
|
72
|
-
var locale =
|
|
73
|
-
var handleRenderInput =
|
|
74
|
-
return ((
|
|
42
|
+
var isValid = !!value && moment(value, format).isValid();
|
|
43
|
+
var stringValue = isValid ? moment(value, format).format(format) : value;
|
|
44
|
+
var locale = useContext(LanguageContext);
|
|
45
|
+
var handleRenderInput = useCallback(function (_, openCalendar) {
|
|
46
|
+
return (_jsx(Input, { type: "text", icon: icon ? 'calendar' : undefined, name: name, error: error, disabled: disabled, isInvalid: !!error, label: showInputLabel ? label : undefined, value: stringValue, onFocus: openCalendar, iconOnClick: openCalendar, onClear: onClear }));
|
|
75
47
|
}, [name, stringValue, error, label, showInputLabel, isValid, disabled]);
|
|
76
|
-
var handleRenderView =
|
|
48
|
+
var handleRenderView = useCallback(function (_, renderCalendar) {
|
|
77
49
|
if (label && !showInputLabel) {
|
|
78
|
-
return ((
|
|
50
|
+
return (_jsx(x.div, { display: "flex", flexDirection: "column", children: renderCalendar() }));
|
|
79
51
|
}
|
|
80
52
|
return renderCalendar();
|
|
81
53
|
}, [label, showInputLabel]);
|
|
82
|
-
var handleChange =
|
|
54
|
+
var handleChange = useCallback(function (value) {
|
|
83
55
|
var parsed = typeof value === 'string' ? value : value.toDate();
|
|
84
56
|
onChange === null || onChange === void 0 ? void 0 : onChange(parsed);
|
|
85
57
|
}, [onChange]);
|
|
86
|
-
var handleIsValid =
|
|
58
|
+
var handleIsValid = useCallback(function (current, selected) {
|
|
87
59
|
var _a, _b;
|
|
88
60
|
var parsed = [(_a = current === null || current === void 0 ? void 0 : current.toDate) === null || _a === void 0 ? void 0 : _a.call(current), (_b = selected === null || selected === void 0 ? void 0 : selected.toDate) === null || _b === void 0 ? void 0 : _b.call(selected)];
|
|
89
61
|
return isValidDate ? isValidDate.apply(void 0, parsed) : true;
|
|
90
62
|
}, [isValidDate]);
|
|
91
|
-
return ((
|
|
63
|
+
return (_jsx(SpaceAroundWrap, { spaceAround: spaceAround, children: _jsx(DatePickerBase, { className: className, children: _jsx(DatetimePicker, __assign({ value: value, dateFormat: dateFormat, timeFormat: timeFormat, secondValue: secondValue, open: open, input: input, label: showCalendarLabel ? label : undefined, onChange: handleChange, isValidDate: handleIsValid, renderView: handleRenderView, renderInput: handleRenderInput, initialViewDate: initialViewDate, locale: locale }, passProps)) }) }));
|
|
92
64
|
};
|
|
93
|
-
|
|
65
|
+
export default React.memo(DatePicker);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __extends = (this && this.__extends) || (function () {
|
|
3
2
|
var extendStatics = function (d, b) {
|
|
4
3
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -25,18 +24,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
24
|
};
|
|
26
25
|
return __assign.apply(this, arguments);
|
|
27
26
|
};
|
|
28
|
-
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
28
|
// @ts-nocheck
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
import moment from 'moment';
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import DaysView from './views/DaysView.js';
|
|
32
|
+
import MonthsView from './views/MonthsView.js';
|
|
33
|
+
import YearsView from './views/YearsView.js';
|
|
34
|
+
import onClickOutside from 'react-onclickoutside';
|
|
40
35
|
var viewModes = {
|
|
41
36
|
YEARS: 'years',
|
|
42
37
|
MONTHS: 'months',
|
|
@@ -59,7 +54,7 @@ var Datetime = /** @class */ (function (_super) {
|
|
|
59
54
|
isValidDate: props.isValidDate,
|
|
60
55
|
updateDate: _this._updateDate,
|
|
61
56
|
navigate: _this._viewNavigate,
|
|
62
|
-
moment:
|
|
57
|
+
moment: moment,
|
|
63
58
|
showView: _this._showView,
|
|
64
59
|
};
|
|
65
60
|
// Probably updateOn, updateSelectedDate and setDate can be merged in the same method
|
|
@@ -69,11 +64,11 @@ var Datetime = /** @class */ (function (_super) {
|
|
|
69
64
|
// Used viewProps
|
|
70
65
|
// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }
|
|
71
66
|
viewProps.renderYear = props.renderYear;
|
|
72
|
-
return (
|
|
67
|
+
return _jsx(YearsView, __assign({}, viewProps));
|
|
73
68
|
case viewModes.MONTHS:
|
|
74
69
|
// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }
|
|
75
70
|
viewProps.renderMonth = props.renderMonth;
|
|
76
|
-
return (
|
|
71
|
+
return _jsx(MonthsView, __assign({}, viewProps));
|
|
77
72
|
case viewModes.DAYS:
|
|
78
73
|
// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat
|
|
79
74
|
viewProps.renderDay = props.renderDay;
|
|
@@ -81,13 +76,13 @@ var Datetime = /** @class */ (function (_super) {
|
|
|
81
76
|
viewProps.setTime = _this._setTime;
|
|
82
77
|
viewProps.value = _this.props.value;
|
|
83
78
|
viewProps.disabled = _this.props.disabled;
|
|
84
|
-
return (
|
|
79
|
+
return _jsx(DaysView, __assign({}, viewProps));
|
|
85
80
|
default:
|
|
86
81
|
viewProps.renderDay = props.renderDay;
|
|
87
82
|
viewProps.timeFormat = _this.getFormat('time');
|
|
88
83
|
viewProps.setTime = _this._setTime;
|
|
89
84
|
viewProps.value = _this.props.value;
|
|
90
|
-
return (
|
|
85
|
+
return _jsx(DaysView, __assign({}, viewProps));
|
|
91
86
|
}
|
|
92
87
|
};
|
|
93
88
|
_this._showView = function (view, date) {
|
|
@@ -209,16 +204,16 @@ var Datetime = /** @class */ (function (_super) {
|
|
|
209
204
|
return _this;
|
|
210
205
|
}
|
|
211
206
|
Datetime.prototype.render = function () {
|
|
212
|
-
return ((
|
|
207
|
+
return (_jsxs(ClickableWrapper, { className: this.getClassName(), onClickOut: this._handleClickOutside, children: [this.renderInput(), _jsx("div", { className: "rdtPicker", children: this.renderView() })] }));
|
|
213
208
|
};
|
|
214
209
|
Datetime.prototype.renderInput = function () {
|
|
215
210
|
if (!this.props.input)
|
|
216
211
|
return;
|
|
217
212
|
var finalInputProps = __assign(__assign({ type: 'text', className: 'form-control', value: this.getInputValue() }, this.props.inputProps), { onFocus: this._onInputFocus, onChange: this._onInputChange, onKeyDown: this._onInputKeyDown, onClick: this._onInputClick });
|
|
218
213
|
if (this.props.renderInput) {
|
|
219
|
-
return (
|
|
214
|
+
return _jsx("div", { children: this.props.renderInput(finalInputProps, this._openCalendar, this._closeCalendar) });
|
|
220
215
|
}
|
|
221
|
-
return (
|
|
216
|
+
return _jsx("input", __assign({}, finalInputProps));
|
|
222
217
|
};
|
|
223
218
|
Datetime.prototype.renderView = function () {
|
|
224
219
|
return this.props.renderView(this.state.currentView, this._renderCalendar);
|
|
@@ -350,13 +345,13 @@ var Datetime = /** @class */ (function (_super) {
|
|
|
350
345
|
props = props || this.props;
|
|
351
346
|
var m = null;
|
|
352
347
|
if (props.utc) {
|
|
353
|
-
m =
|
|
348
|
+
m = moment.utc(date, format, props.strictParsing);
|
|
354
349
|
}
|
|
355
350
|
else if (props.displayTimeZone) {
|
|
356
|
-
m =
|
|
351
|
+
m = moment.tz(date, format, props.displayTimeZone);
|
|
357
352
|
}
|
|
358
353
|
else {
|
|
359
|
-
m = (
|
|
354
|
+
m = moment(date, format, props.strictParsing);
|
|
360
355
|
}
|
|
361
356
|
if (props.locale)
|
|
362
357
|
m.locale(props.locale);
|
|
@@ -364,7 +359,7 @@ var Datetime = /** @class */ (function (_super) {
|
|
|
364
359
|
};
|
|
365
360
|
Datetime.prototype.checkTZ = function () {
|
|
366
361
|
var displayTimeZone = this.props.displayTimeZone;
|
|
367
|
-
if (displayTimeZone && !this.tzWarning && !
|
|
362
|
+
if (displayTimeZone && !this.tzWarning && !moment.tz) {
|
|
368
363
|
this.tzWarning = true;
|
|
369
364
|
}
|
|
370
365
|
};
|
|
@@ -496,19 +491,19 @@ var Datetime = /** @class */ (function (_super) {
|
|
|
496
491
|
renderView: function (_, renderFunc) { return renderFunc(); },
|
|
497
492
|
};
|
|
498
493
|
// Make moment accessible through the Datetime class
|
|
499
|
-
Datetime.moment =
|
|
494
|
+
Datetime.moment = moment;
|
|
500
495
|
return Datetime;
|
|
501
|
-
}(
|
|
502
|
-
|
|
496
|
+
}(React.Component));
|
|
497
|
+
export default Datetime;
|
|
503
498
|
var ClickOutBase = /** @class */ (function (_super) {
|
|
504
499
|
__extends(ClickOutBase, _super);
|
|
505
500
|
function ClickOutBase() {
|
|
506
501
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
507
|
-
_this.container =
|
|
502
|
+
_this.container = React.createRef();
|
|
508
503
|
return _this;
|
|
509
504
|
}
|
|
510
505
|
ClickOutBase.prototype.render = function () {
|
|
511
|
-
return ((
|
|
506
|
+
return (_jsx("div", { className: this.props.className, ref: this.container, children: this.props.children }));
|
|
512
507
|
};
|
|
513
508
|
ClickOutBase.prototype.handleClickOutside = function (e) {
|
|
514
509
|
this.props.onClickOut(e);
|
|
@@ -517,5 +512,5 @@ var ClickOutBase = /** @class */ (function (_super) {
|
|
|
517
512
|
return this.container.current;
|
|
518
513
|
};
|
|
519
514
|
return ClickOutBase;
|
|
520
|
-
}(
|
|
521
|
-
var ClickableWrapper = (
|
|
515
|
+
}(React.Component));
|
|
516
|
+
var ClickableWrapper = onClickOutside(ClickOutBase);
|
|
@@ -1,62 +1,36 @@
|
|
|
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
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.Timepicker = void 0;
|
|
31
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
32
|
-
var react_1 = require("react");
|
|
33
|
-
var styled_components_1 = __importStar(require("@xstyled/styled-components"));
|
|
34
|
-
var system_1 = require("@xstyled/system");
|
|
35
|
-
var Btn = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transform: rotate(90deg);\n font-size: 24px;\n margin: -4px 0;\n background-color: transparent !important;\n border: none;\n color: ", ";\n &:disabled:hover {\n color: ", ";\n cursor: default;\n }\n &:hover {\n color: ", ";\n background-color: transparent !important;\n }\n"], ["\n transform: rotate(90deg);\n font-size: 24px;\n margin: -4px 0;\n background-color: transparent !important;\n border: none;\n color: ", ";\n &:disabled:hover {\n color: ", ";\n cursor: default;\n }\n &:hover {\n color: ", ";\n background-color: transparent !important;\n }\n"])), (0, system_1.th)('colors.lightGray4'), (0, system_1.th)('colors.lightGray4'), (0, system_1.th)('colors.red2'));
|
|
36
|
-
var TimeWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: baseline;\n justify-content: center;\n border: 1px solid ", ";\n border-radius: 0.7rem;\n padding: 4px 10px;\n margin: 0 10px;\n"], ["\n display: flex;\n align-items: baseline;\n justify-content: center;\n border: 1px solid ", ";\n border-radius: 0.7rem;\n padding: 4px 10px;\n margin: 0 10px;\n"])), (0, system_1.th)('colors.lightGray2'));
|
|
37
|
-
var Hours = styled_components_1.default.input(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 22px;\n font-weight: 700;\n width: 24px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"], ["\n font-size: 22px;\n font-weight: 700;\n width: 24px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"])));
|
|
38
|
-
var Minutes = styled_components_1.default.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-weight: 700;\n font-size: 16px;\n width: 20px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"], ["\n font-weight: 700;\n font-size: 16px;\n width: 20px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"])));
|
|
39
|
-
var Timepicker = function (_a) {
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
7
|
+
import styled, { x } from '@xstyled/styled-components';
|
|
8
|
+
import { th } from '@xstyled/system';
|
|
9
|
+
var Btn = styled.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transform: rotate(90deg);\n font-size: 24px;\n margin: -4px 0;\n background-color: transparent !important;\n border: none;\n color: ", ";\n &:disabled:hover {\n color: ", ";\n cursor: default;\n }\n &:hover {\n color: ", ";\n background-color: transparent !important;\n }\n"], ["\n transform: rotate(90deg);\n font-size: 24px;\n margin: -4px 0;\n background-color: transparent !important;\n border: none;\n color: ", ";\n &:disabled:hover {\n color: ", ";\n cursor: default;\n }\n &:hover {\n color: ", ";\n background-color: transparent !important;\n }\n"])), th('colors.lightGray4'), th('colors.lightGray4'), th('colors.red2'));
|
|
10
|
+
var TimeWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: baseline;\n justify-content: center;\n border: 1px solid ", ";\n border-radius: 0.7rem;\n padding: 4px 10px;\n margin: 0 10px;\n"], ["\n display: flex;\n align-items: baseline;\n justify-content: center;\n border: 1px solid ", ";\n border-radius: 0.7rem;\n padding: 4px 10px;\n margin: 0 10px;\n"])), th('colors.lightGray2'));
|
|
11
|
+
var Hours = styled.input(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 22px;\n font-weight: 700;\n width: 24px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"], ["\n font-size: 22px;\n font-weight: 700;\n width: 24px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"])));
|
|
12
|
+
var Minutes = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-weight: 700;\n font-size: 16px;\n width: 20px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"], ["\n font-weight: 700;\n font-size: 16px;\n width: 20px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n &:disabled {\n opacity: 0.5;\n }\n"])));
|
|
13
|
+
export var Timepicker = function (_a) {
|
|
40
14
|
var _b, _c, _d, _e;
|
|
41
15
|
var setTime = _a.setTime, value = _a.value, disabled = _a.disabled;
|
|
42
16
|
var initialHours = (_c = (_b = value === null || value === void 0 ? void 0 : value.getHours) === null || _b === void 0 ? void 0 : _b.call(value)) !== null && _c !== void 0 ? _c : 0;
|
|
43
17
|
var initialMinutes = (_e = (_d = value === null || value === void 0 ? void 0 : value.getMinutes) === null || _d === void 0 ? void 0 : _d.call(value)) !== null && _e !== void 0 ? _e : 0;
|
|
44
18
|
var regExp = '^[0-9]*$';
|
|
45
|
-
var _f =
|
|
46
|
-
var _g =
|
|
47
|
-
var increaseHour =
|
|
19
|
+
var _f = useState(initialHours), hours = _f[0], setHours = _f[1];
|
|
20
|
+
var _g = useState(initialMinutes), minutes = _g[0], setMinutes = _g[1];
|
|
21
|
+
var increaseHour = useCallback(function () {
|
|
48
22
|
hours === 23 ? setHours(0) : setHours(hours + 1);
|
|
49
23
|
}, [hours]);
|
|
50
|
-
var decreaseHour =
|
|
24
|
+
var decreaseHour = useCallback(function () {
|
|
51
25
|
hours === 0 ? setHours(23) : setHours(hours - 1);
|
|
52
26
|
}, [hours]);
|
|
53
|
-
var increaseMinutes =
|
|
27
|
+
var increaseMinutes = useCallback(function () {
|
|
54
28
|
minutes >= 55 ? setMinutes(minutes - 55) : setMinutes(minutes + 5);
|
|
55
29
|
}, [minutes]);
|
|
56
|
-
var decreaseMinutes =
|
|
30
|
+
var decreaseMinutes = useCallback(function () {
|
|
57
31
|
minutes <= 5 ? setMinutes(minutes + 55) : setMinutes(minutes - 5);
|
|
58
32
|
}, [minutes]);
|
|
59
|
-
var onHoursChange =
|
|
33
|
+
var onHoursChange = useCallback(function (e) {
|
|
60
34
|
if (e.target.value.match(regExp) && Number(e.target.value) <= 23) {
|
|
61
35
|
setHours(Number(e.target.value));
|
|
62
36
|
}
|
|
@@ -64,7 +38,7 @@ var Timepicker = function (_a) {
|
|
|
64
38
|
setHours(0);
|
|
65
39
|
}
|
|
66
40
|
}, []);
|
|
67
|
-
var onMinutesChange =
|
|
41
|
+
var onMinutesChange = useCallback(function (e) {
|
|
68
42
|
if (e.target.value.match(regExp) && Number(e.target.value) <= 59) {
|
|
69
43
|
setMinutes(Number(e.target.value));
|
|
70
44
|
}
|
|
@@ -72,13 +46,12 @@ var Timepicker = function (_a) {
|
|
|
72
46
|
setMinutes(0);
|
|
73
47
|
}
|
|
74
48
|
}, []);
|
|
75
|
-
|
|
49
|
+
useEffect(function () {
|
|
76
50
|
!!value && setTime('hours', hours);
|
|
77
51
|
}, [hours]);
|
|
78
|
-
|
|
52
|
+
useEffect(function () {
|
|
79
53
|
!!value && setTime('minutes', minutes);
|
|
80
54
|
}, [minutes]);
|
|
81
|
-
return ((
|
|
55
|
+
return (_jsx("td", { colSpan: 7, children: _jsx(x.div, { display: "flex", flexDirection: "column", alignItems: "flex-start", pt: "1rem", w: "fit-content", children: _jsxs(x.div, { display: "flex", alignItems: "center", children: [_jsxs(x.div, { display: "flex", flexDirection: "column", children: [_jsx(Btn, { disabled: disabled, onClick: increaseHour, children: "\u2039" }), _jsx(Btn, { disabled: disabled, onClick: decreaseHour, children: "\u203A" })] }), _jsxs(TimeWrapper, { children: [_jsx(Hours, { value: hours < 10 ? "0".concat(hours) : hours, disabled: disabled, onChange: onHoursChange }), _jsx(x.div, { mx: "7px", color: "lightGray4", children: "|" }), _jsx(Minutes, { value: minutes < 10 ? "0".concat(minutes) : minutes, disabled: disabled, onChange: onMinutesChange })] }), _jsxs(x.div, { display: "flex", flexDirection: "column", children: [_jsx(Btn, { disabled: disabled, onClick: increaseMinutes, children: "\u2039" }), _jsx(Btn, { disabled: disabled, onClick: decreaseMinutes, children: "\u203A" })] })] }) }) }));
|
|
82
56
|
};
|
|
83
|
-
exports.Timepicker = Timepicker;
|
|
84
57
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -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,10 +9,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function ViewNavigation(_a) {
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export default function ViewNavigation(_a) {
|
|
16
14
|
var onClickPrev = _a.onClickPrev, onClickSwitch = _a.onClickSwitch, onClickNext = _a.onClickNext, switchContent = _a.switchContent, switchColSpan = _a.switchColSpan, switchProps = _a.switchProps, label = _a.label;
|
|
17
|
-
return ((
|
|
15
|
+
return (_jsxs("tr", { children: [_jsx("th", { className: "rdtPrev", onClick: onClickPrev, children: _jsx("span", { children: "\u2039" }) }), _jsx("th", __assign({ className: "rdtSwitch", colSpan: switchColSpan, onClick: onClickSwitch }, switchProps, { children: switchContent })), _jsx("th", { className: "rdtNext", onClick: onClickNext, children: _jsx("span", { children: "\u203A" }) }), _jsx("th", { colSpan: 2, className: "rdtLabel", children: label && label })] }));
|
|
18
16
|
}
|
|
19
|
-
exports.default = ViewNavigation;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Type definitions for react-datetime
|
|
3
2
|
// Project: https://github.com/arqex/react-datetime
|
|
4
3
|
// Definitions by: Ivan Verevkin <vereva@x-root.org>
|
|
5
4
|
// Updates by: Aaron Spaulding <aaron@sachimp.com>,
|
|
6
5
|
// Karol Janyst <http://github.com/LKay>,
|
|
7
6
|
// Javier Marquez <javi@arqex.com>
|
|
8
|
-
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __extends = (this && this.__extends) || (function () {
|
|
3
2
|
var extendStatics = function (d, b) {
|
|
4
3
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -25,15 +24,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
24
|
};
|
|
26
25
|
return __assign.apply(this, arguments);
|
|
27
26
|
};
|
|
28
|
-
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
28
|
// @ts-nocheck
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import { Timepicker } from '../components/Timepicker.js';
|
|
31
|
+
import ViewNavigation from '../components/ViewNavigation.js';
|
|
37
32
|
var DaysView = /** @class */ (function (_super) {
|
|
38
33
|
__extends(DaysView, _super);
|
|
39
34
|
function DaysView() {
|
|
@@ -44,19 +39,19 @@ var DaysView = /** @class */ (function (_super) {
|
|
|
44
39
|
return _this;
|
|
45
40
|
}
|
|
46
41
|
DaysView.prototype.render = function () {
|
|
47
|
-
return ((
|
|
42
|
+
return (_jsx("div", { className: "rdtDays", children: _jsxs("table", { children: [_jsxs("thead", { children: [this.renderNavigation(), this.renderDayHeaders()] }), _jsx("tbody", { children: this.renderDays() }), this.renderFooter()] }) }));
|
|
48
43
|
};
|
|
49
44
|
DaysView.prototype.renderNavigation = function () {
|
|
50
45
|
var _this = this;
|
|
51
46
|
var date = this.props.viewDate;
|
|
52
47
|
var locale = date.localeData();
|
|
53
48
|
var label = this.props.label;
|
|
54
|
-
return ((
|
|
49
|
+
return (_jsx(ViewNavigation, { onClickPrev: function () { return _this.props.navigate(-1, 'months'); }, onClickSwitch: function () { return _this.props.showView('months'); }, onClickNext: function () { return _this.props.navigate(1, 'months'); }, switchContent: locale.months(date, 'DD[]MMMM') + ' ' + date.year(), switchColSpan: 3, label: label, switchProps: { 'data-value': this.props.viewDate.month() } }));
|
|
55
50
|
};
|
|
56
51
|
DaysView.prototype.renderDayHeaders = function () {
|
|
57
52
|
var locale = this.props.viewDate.localeData();
|
|
58
|
-
var dayItems = getDaysOfWeek(locale).map(function (day, index) { return ((
|
|
59
|
-
return (
|
|
53
|
+
var dayItems = getDaysOfWeek(locale).map(function (day, index) { return (_jsx("th", { className: "dow", children: day }, day + index)); });
|
|
54
|
+
return _jsx("tr", { children: dayItems });
|
|
60
55
|
};
|
|
61
56
|
DaysView.prototype.renderDays = function () {
|
|
62
57
|
var date = this.props.viewDate;
|
|
@@ -74,7 +69,7 @@ var DaysView = /** @class */ (function (_super) {
|
|
|
74
69
|
row.push(this.renderDay(startDate, startOfMonth, endOfMonth));
|
|
75
70
|
startDate.add(1, 'd');
|
|
76
71
|
}
|
|
77
|
-
return rows.map(function (r, i) { return (
|
|
72
|
+
return rows.map(function (r, i) { return _jsx("tr", { children: r }, "".concat(endDate.month(), "_").concat(i)); });
|
|
78
73
|
};
|
|
79
74
|
DaysView.prototype.renderDay = function (date, startOfMonth, endOfMonth) {
|
|
80
75
|
var selectedDate = this.props.selectedDate;
|
|
@@ -122,15 +117,15 @@ var DaysView = /** @class */ (function (_super) {
|
|
|
122
117
|
var setTime = this.props.setTime;
|
|
123
118
|
var value = this.props.value;
|
|
124
119
|
var disabled = this.props.disabled;
|
|
125
|
-
return ((
|
|
120
|
+
return (_jsx("tfoot", { children: _jsx("tr", { children: _jsx(Timepicker, { setTime: setTime, value: value, disabled: disabled }) }) }));
|
|
126
121
|
};
|
|
127
122
|
DaysView.defaultProps = {
|
|
128
123
|
isValidDate: function () { return true; },
|
|
129
|
-
renderDay: function (props, date) { return (
|
|
124
|
+
renderDay: function (props, date) { return _jsx("td", __assign({}, props, { children: date.date() })); },
|
|
130
125
|
};
|
|
131
126
|
return DaysView;
|
|
132
|
-
}(
|
|
133
|
-
|
|
127
|
+
}(React.Component));
|
|
128
|
+
export default DaysView;
|
|
134
129
|
function getRow(rows, day) {
|
|
135
130
|
return rows[Math.floor(day / 7)];
|
|
136
131
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __extends = (this && this.__extends) || (function () {
|
|
3
2
|
var extendStatics = function (d, b) {
|
|
4
3
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -25,14 +24,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
24
|
};
|
|
26
25
|
return __assign.apply(this, arguments);
|
|
27
26
|
};
|
|
28
|
-
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
28
|
// @ts-nocheck
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import ViewNavigation from '../components/ViewNavigation.js';
|
|
36
31
|
var MonthsView = /** @class */ (function (_super) {
|
|
37
32
|
__extends(MonthsView, _super);
|
|
38
33
|
function MonthsView() {
|
|
@@ -43,12 +38,12 @@ var MonthsView = /** @class */ (function (_super) {
|
|
|
43
38
|
return _this;
|
|
44
39
|
}
|
|
45
40
|
MonthsView.prototype.render = function () {
|
|
46
|
-
return ((
|
|
41
|
+
return (_jsxs("div", { className: "rdtMonths", children: [_jsx("table", { children: _jsx("thead", { children: this.renderNavigation() }) }), _jsx("table", { children: _jsx("tbody", { children: this.renderMonths() }) })] }));
|
|
47
42
|
};
|
|
48
43
|
MonthsView.prototype.renderNavigation = function () {
|
|
49
44
|
var _this = this;
|
|
50
45
|
var year = this.props.viewDate.year();
|
|
51
|
-
return ((
|
|
46
|
+
return (_jsx(ViewNavigation, { onClickPrev: function () { return _this.props.navigate(-1, 'years'); }, onClickSwitch: function () { return _this.props.showView('years'); }, onClickNext: function () { return _this.props.navigate(1, 'years'); }, switchContent: year, switchColSpan: "2" }));
|
|
52
47
|
};
|
|
53
48
|
MonthsView.prototype.renderMonths = function () {
|
|
54
49
|
// 12 months in 3 rows for every view
|
|
@@ -57,7 +52,7 @@ var MonthsView = /** @class */ (function (_super) {
|
|
|
57
52
|
var row = getRow(rows, month);
|
|
58
53
|
row.push(this.renderMonth(month));
|
|
59
54
|
}
|
|
60
|
-
return rows.map(function (months, i) { return (
|
|
55
|
+
return rows.map(function (months, i) { return _jsx("tr", { children: months }, i); });
|
|
61
56
|
};
|
|
62
57
|
MonthsView.prototype.renderMonth = function (month) {
|
|
63
58
|
var selectedDate = this.props.selectedDate;
|
|
@@ -76,7 +71,7 @@ var MonthsView = /** @class */ (function (_super) {
|
|
|
76
71
|
if (this.props.renderMonth) {
|
|
77
72
|
return this.props.renderMonth(props, month, this.props.viewDate.year(), this.props.selectedDate && this.props.selectedDate.clone());
|
|
78
73
|
}
|
|
79
|
-
return (
|
|
74
|
+
return _jsx("td", __assign({}, props, { children: this.getMonthText(month) }));
|
|
80
75
|
};
|
|
81
76
|
MonthsView.prototype.isDisabledMonth = function (month) {
|
|
82
77
|
var isValidDate = this.props.isValidDate;
|
|
@@ -100,8 +95,8 @@ var MonthsView = /** @class */ (function (_super) {
|
|
|
100
95
|
return capitalize(monthStr.substring(0, 3));
|
|
101
96
|
};
|
|
102
97
|
return MonthsView;
|
|
103
|
-
}(
|
|
104
|
-
|
|
98
|
+
}(React.Component));
|
|
99
|
+
export default MonthsView;
|
|
105
100
|
function getRow(rows, year) {
|
|
106
101
|
if (year < 4) {
|
|
107
102
|
return rows[0];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __extends = (this && this.__extends) || (function () {
|
|
3
2
|
var extendStatics = function (d, b) {
|
|
4
3
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -25,14 +24,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
24
|
};
|
|
26
25
|
return __assign.apply(this, arguments);
|
|
27
26
|
};
|
|
28
|
-
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
28
|
// @ts-nocheck
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import ViewNavigation from '../components/ViewNavigation.js';
|
|
36
31
|
var YearsView = /** @class */ (function (_super) {
|
|
37
32
|
__extends(YearsView, _super);
|
|
38
33
|
function YearsView() {
|
|
@@ -44,12 +39,12 @@ var YearsView = /** @class */ (function (_super) {
|
|
|
44
39
|
return _this;
|
|
45
40
|
}
|
|
46
41
|
YearsView.prototype.render = function () {
|
|
47
|
-
return ((
|
|
42
|
+
return (_jsxs("div", { className: "rdtYears", children: [_jsx("table", { children: _jsx("thead", { children: this.renderNavigation() }) }), _jsx("table", { children: _jsx("tbody", { children: this.renderYears() }) })] }));
|
|
48
43
|
};
|
|
49
44
|
YearsView.prototype.renderNavigation = function () {
|
|
50
45
|
var _this = this;
|
|
51
46
|
var viewYear = this.getViewYear();
|
|
52
|
-
return ((
|
|
47
|
+
return (_jsx(ViewNavigation, { onClickPrev: function () { return _this.props.navigate(-10, 'years'); }, onClickSwitch: function () { return _this.props.showView('years'); }, onClickNext: function () { return _this.props.navigate(10, 'years'); }, switchContent: "".concat(viewYear, "-").concat(viewYear + 9) }));
|
|
53
48
|
};
|
|
54
49
|
YearsView.prototype.renderYears = function () {
|
|
55
50
|
var viewYear = this.getViewYear();
|
|
@@ -59,7 +54,7 @@ var YearsView = /** @class */ (function (_super) {
|
|
|
59
54
|
var row = getRow(rows, year - viewYear);
|
|
60
55
|
row.push(this.renderYear(year));
|
|
61
56
|
}
|
|
62
|
-
return rows.map(function (years, i) { return (
|
|
57
|
+
return rows.map(function (years, i) { return _jsx("tr", { children: years }, i); });
|
|
63
58
|
};
|
|
64
59
|
YearsView.prototype.renderYear = function (year) {
|
|
65
60
|
var selectedYear = this.getSelectedYear();
|
|
@@ -106,11 +101,11 @@ var YearsView = /** @class */ (function (_super) {
|
|
|
106
101
|
return true;
|
|
107
102
|
};
|
|
108
103
|
YearsView.defaultProps = {
|
|
109
|
-
renderYear: function (props, year) { return (
|
|
104
|
+
renderYear: function (props, year) { return _jsx("td", __assign({}, props, { children: year })); },
|
|
110
105
|
};
|
|
111
106
|
return YearsView;
|
|
112
|
-
}(
|
|
113
|
-
|
|
107
|
+
}(React.Component));
|
|
108
|
+
export default YearsView;
|
|
114
109
|
function getRow(rows, year) {
|
|
115
110
|
if (year < 3) {
|
|
116
111
|
return rows[0];
|