linear-react-components-ui 0.4.77-beta.9 → 1.0.0-rc.2
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/.eslintrc.json +99 -0
- package/.gitlab-ci.yml +19 -0
- package/.husky/pre-push +4 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +5 -2
- package/babel.config.json +11 -0
- package/config/getHttpsConfig.js +56 -0
- package/config/paths.js +140 -0
- package/config/webpackDevServer.config.js +128 -0
- package/jest.config.js +3 -3
- package/lib/@types/Align.d.ts +3 -0
- package/lib/@types/Align.js +5 -0
- package/lib/@types/ButtonTypes.d.ts +3 -0
- package/lib/@types/ButtonTypes.js +5 -0
- package/lib/@types/ColorStyles.d.ts +3 -0
- package/lib/@types/ColorStyles.js +5 -0
- package/lib/@types/DataCombo.d.ts +3 -0
- package/lib/@types/DataCombo.js +5 -0
- package/lib/@types/Icon.d.ts +5 -0
- package/lib/@types/Icon.js +5 -0
- package/lib/@types/LabelStyles.d.ts +3 -0
- package/lib/@types/Period.d.ts +6 -0
- package/lib/@types/Period.js +5 -0
- package/lib/@types/PermissionAttr.d.ts +14 -0
- package/lib/@types/PointerEvents.d.ts +3 -0
- package/lib/@types/Position.d.ts +3 -0
- package/lib/@types/PositionAlert.d.ts +3 -0
- package/lib/@types/PositionAlert.js +5 -0
- package/lib/@types/Size.d.ts +3 -0
- package/lib/@types/SizePixels.d.ts +3 -0
- package/lib/@types/StorageMock.d.ts +5 -0
- package/lib/@types/StorageMock.js +5 -0
- package/lib/alerts/AlertContainer.d.ts +16 -0
- package/lib/alerts/AlertContainer.js +16 -21
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +13 -18
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/BaseAlert.js +8 -11
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/Message.js +41 -50
- package/lib/alerts/helpers.d.ts +7 -0
- package/lib/alerts/helpers.js +4 -7
- package/lib/alerts/index.d.ts +6 -0
- package/lib/alerts/index.js +5 -5
- package/lib/alerts/types.d.ts +48 -0
- package/lib/alerts/types.js +5 -0
- package/lib/alerts/withAlert.d.ts +7 -0
- package/lib/alerts/withAlert.js +8 -8
- package/lib/assets/styles/commons.scss +0 -10
- package/lib/assets/styles/dropdown.scss +0 -1
- package/lib/assets/styles/list.scss +0 -8
- package/lib/assets/styles/sidenav.scss +42 -93
- package/lib/assets/styles/table.scss +7 -2
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/index.js +21 -66
- package/lib/avatar/types.d.ts +31 -0
- package/lib/avatar/types.js +5 -0
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/index.js +11 -27
- package/lib/badge/types.d.ts +13 -0
- package/lib/badge/types.js +5 -0
- package/lib/buttons/ActivateButton.d.ts +9 -0
- package/lib/buttons/ActivateButton.js +6 -6
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/AddButton.js +6 -6
- package/lib/buttons/Button.d.ts +12 -0
- package/lib/buttons/Button.js +22 -14
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/ButtonGroups.js +4 -9
- package/lib/buttons/CancelButton.d.ts +9 -0
- package/lib/buttons/CancelButton.js +19 -6
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DangerButton.js +16 -21
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +73 -135
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/DestroyButton.js +16 -7
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/EditButton.js +6 -6
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.js +6 -6
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/InfoButton.js +16 -21
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.js +16 -21
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.js +6 -6
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SaveButton.js +18 -5
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/SuccessButton.js +15 -20
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/WarningButton.js +15 -20
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/button_container/index.js +10 -23
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/index.js +18 -18
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +18 -35
- package/lib/buttons/types.d.ts +44 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/DangerCalendar.js +15 -6
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.js +15 -6
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.js +15 -6
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.js +15 -6
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.js +15 -6
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Day.js +8 -14
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Month.js +5 -10
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/Week.js +5 -11
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +9 -9
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/base/index.js +44 -47
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/index.js +9 -9
- package/lib/calendar/types.d.ts +25 -0
- package/lib/calendar/types.js +5 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/Label.js +7 -17
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +52 -89
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Alert.js +9 -14
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +26 -34
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Error.js +7 -12
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Information.js +7 -12
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Question.js +14 -25
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/Warning.js +7 -12
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Content.js +4 -13
- package/lib/dialog/base/Footer.d.ts +6 -0
- package/lib/dialog/base/Footer.js +6 -12
- package/lib/dialog/base/Header.d.ts +6 -0
- package/lib/dialog/base/Header.js +17 -31
- package/lib/dialog/base/index.d.ts +6 -0
- package/lib/dialog/base/index.js +13 -35
- package/lib/dialog/base/style.js +2 -2
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/form/index.js +34 -44
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/index.js +10 -10
- package/lib/dialog/types.d.ts +68 -0
- package/lib/dialog/types.js +5 -0
- package/lib/drawer/Content.d.ts +7 -0
- package/lib/drawer/Content.js +7 -16
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +36 -57
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/Header.js +28 -47
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/helpers.js +4 -4
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/index.js +6 -6
- package/lib/drawer/types.d.ts +34 -0
- package/lib/drawer/types.js +5 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +36 -20
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/helper.js +2 -2
- package/lib/dropdown/types.d.ts +43 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +22 -47
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +19 -50
- package/lib/fieldset/types.d.ts +28 -0
- package/lib/fieldset/types.js +5 -0
- package/lib/form/Field.d.ts +6 -0
- package/lib/form/Field.js +22 -49
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +27 -57
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +10 -32
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +29 -51
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +11 -17
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +68 -103
- package/lib/form/types.d.ts +167 -0
- package/lib/form/types.js +5 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +45 -125
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +20 -41
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridCol.js +7 -22
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/GridRow.js +8 -28
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/index.js +5 -5
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/gridlayout/types.js +5 -0
- package/lib/icons/helper.d.ts +560 -0
- package/lib/icons/helper.js +560 -563
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/index.js +28 -45
- package/lib/icons/types.d.ts +28 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +10 -10
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +54 -163
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +9 -9
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/base/types.js +5 -0
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/index.js +40 -38
- package/lib/inputs/color/types.d.ts +14 -0
- package/lib/inputs/color/types.js +5 -0
- package/lib/inputs/date/Dialog.d.ts +10 -0
- package/lib/inputs/date/Dialog.js +4 -11
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/Dropdown.js +21 -73
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/helpers.js +4 -4
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/index.js +259 -415
- package/lib/inputs/date/types.d.ts +53 -0
- package/lib/inputs/date/types.js +5 -0
- package/lib/inputs/inputHOC.d.ts +11 -0
- package/lib/inputs/inputHOC.js +48 -100
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/BaseMask.js +6 -20
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +17 -24
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +18 -26
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/Phone.js +5 -13
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.js +5 -5
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/helpers.js +21 -36
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +188 -257
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/index.js +8 -8
- package/lib/inputs/mask/types.d.ts +66 -0
- package/lib/inputs/mask/types.js +5 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +10 -0
- package/lib/inputs/multiSelect/ActionButtons.js +9 -21
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.js +60 -87
- package/lib/inputs/multiSelect/helper.d.ts +9 -0
- package/lib/inputs/multiSelect/helper.js +2 -2
- package/lib/inputs/multiSelect/index.d.ts +10 -0
- package/lib/inputs/multiSelect/index.js +67 -90
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/multiSelect/types.js +5 -0
- package/lib/inputs/number/BaseNumber.d.ts +9 -0
- package/lib/inputs/number/BaseNumber.js +15 -27
- package/lib/inputs/number/Currency.d.ts +9 -0
- package/lib/inputs/number/Currency.js +8 -18
- package/lib/inputs/number/Decimal.d.ts +9 -0
- package/lib/inputs/number/Decimal.js +4 -4
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/index.d.ts +11 -0
- package/lib/inputs/number/index.js +14 -20
- package/lib/inputs/number/types.d.ts +27 -0
- package/lib/inputs/number/types.js +5 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dialog.js +4 -11
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/Dropdown.js +19 -73
- package/lib/inputs/period/PeriodList.d.ts +11 -0
- package/lib/inputs/period/PeriodList.js +12 -25
- package/lib/inputs/period/helper.d.ts +19 -0
- package/lib/inputs/period/helper.js +33 -74
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +136 -186
- package/lib/inputs/period/types.d.ts +58 -0
- package/lib/inputs/period/types.js +5 -0
- package/lib/inputs/search/index.d.ts +11 -0
- package/lib/inputs/search/index.js +133 -265
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/ActionButtons.js +19 -25
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/Dropdown.js +42 -75
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/helper.js +18 -14
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +15 -16
- package/lib/inputs/select/multiple/Selecteds.d.ts +10 -0
- package/lib/inputs/select/multiple/Selecteds.js +9 -17
- package/lib/inputs/select/multiple/index.d.ts +10 -0
- package/lib/inputs/select/multiple/index.js +293 -418
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.js +310 -463
- package/lib/inputs/select/types.d.ts +97 -0
- package/lib/inputs/select/types.js +5 -0
- package/lib/inputs/text/index.d.ts +9 -0
- package/lib/inputs/text/index.js +5 -4
- package/lib/inputs/text/types.d.ts +22 -0
- package/lib/inputs/text/types.js +5 -0
- package/lib/inputs/textarea/index.d.ts +5 -0
- package/lib/inputs/textarea/index.js +9 -19
- package/lib/inputs/textarea/types.d.ts +8 -0
- package/lib/inputs/textarea/types.js +5 -0
- package/lib/inputs/types.d.ts +146 -0
- package/lib/inputs/types.js +5 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/colorStyles.js +2 -2
- package/lib/internals/constants.d.ts +11 -0
- package/lib/internals/types.d.ts +21 -0
- package/lib/internals/withTooltip.d.ts +11 -0
- package/lib/internals/withTooltip.js +32 -40
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/index.js +34 -52
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DangerLabel.js +16 -7
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +31 -63
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/InfoLabel.js +16 -7
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.js +16 -7
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.js +16 -7
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.js +16 -7
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/index.js +10 -10
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/label_container/index.js +7 -17
- package/lib/labels/types.d.ts +24 -0
- package/lib/labels/types.js +5 -0
- package/lib/list/Header.d.ts +7 -0
- package/lib/list/Header.js +5 -18
- package/lib/list/Item.d.ts +7 -0
- package/lib/list/Item.js +39 -77
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/Separator.js +4 -4
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +2 -2
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +47 -66
- package/lib/list/types.d.ts +64 -0
- package/lib/list/types.js +5 -0
- package/lib/menus/float/MenuItem.d.ts +7 -0
- package/lib/menus/float/MenuItem.js +17 -37
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/helpers.js +4 -4
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/index.js +17 -37
- package/lib/menus/float/types.d.ts +27 -0
- package/lib/menus/float/types.js +5 -0
- package/lib/menus/index.d.ts +6 -0
- package/lib/menus/index.js +4 -4
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/ExpandMenu.js +6 -18
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/MenuLink.js +5 -19
- package/lib/menus/sidenav/NavMenuGroup.d.ts +10 -0
- package/lib/menus/sidenav/NavMenuGroup.js +6 -17
- package/lib/menus/sidenav/NavMenuItem.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuItem.js +30 -56
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +10 -21
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/helpers.js +5 -5
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/index.js +39 -69
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +9 -18
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.js +25 -24
- package/lib/menus/sidenav/types.d.ts +82 -0
- package/lib/menus/sidenav/types.js +5 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/noPermission/index.js +7 -7
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/Content.js +14 -26
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/DangerPanel.js +6 -6
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +25 -52
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/Header.js +18 -40
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/InfoPanel.js +6 -6
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.js +6 -6
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.js +6 -6
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/ToolBar.js +4 -9
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/WarningPanel.js +6 -6
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/helpers.js +9 -5
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/index.js +11 -11
- package/lib/panel/types.d.ts +4 -0
- package/lib/panel/types.js +5 -0
- package/lib/permissionValidations.d.ts +14 -0
- package/lib/permissionValidations.js +14 -12
- package/lib/popover/PopoverText.d.ts +8 -0
- package/lib/popover/PopoverText.js +4 -9
- package/lib/popover/PopoverTitle.d.ts +8 -0
- package/lib/popover/PopoverTitle.js +4 -9
- package/lib/popover/index.d.ts +13 -0
- package/lib/popover/index.js +35 -49
- package/lib/popover/types.d.ts +21 -0
- package/lib/popover/types.js +5 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/Bar.js +42 -52
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/index.js +14 -24
- package/lib/progress/types.d.ts +37 -0
- package/lib/progress/types.js +5 -0
- package/lib/radio/index.d.ts +12 -0
- package/lib/radio/index.js +28 -52
- package/lib/radio/types.d.ts +18 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +4 -17
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +13 -32
- package/lib/skeleton/types.d.ts +21 -0
- package/lib/skeleton/types.js +5 -0
- package/lib/spinner/SpinnerLoading.d.ts +7 -0
- package/lib/spinner/SpinnerLoading.js +45 -53
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/index.js +28 -33
- package/lib/spinner/types.d.ts +20 -0
- package/lib/spinner/types.js +5 -0
- package/lib/split/Split.d.ts +6 -0
- package/lib/split/Split.js +52 -69
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/SplitSide.js +7 -27
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/helpers.js +4 -4
- package/lib/split/index.d.ts +5 -0
- package/lib/split/index.js +5 -5
- package/lib/split/types.d.ts +34 -0
- package/lib/split/types.js +5 -0
- package/lib/table/Body.d.ts +6 -0
- package/lib/table/Body.js +21 -28
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +51 -30
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +13 -27
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +13 -34
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +18 -36
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/helpers.js +5 -5
- package/lib/table/index.d.ts +11 -0
- package/lib/table/index.js +19 -57
- package/lib/table/types.d.ts +84 -0
- package/lib/table/types.js +5 -0
- package/lib/tabs/DropdownItems.d.ts +9 -0
- package/lib/tabs/DropdownItems.js +20 -30
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/Menu.js +21 -25
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +33 -47
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +24 -57
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/index.js +89 -83
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/tabHelpers.js +10 -9
- package/lib/tabs/types.d.ts +63 -0
- package/lib/tabs/types.js +5 -0
- package/lib/toolbar/ButtonBar.d.ts +10 -0
- package/lib/toolbar/ButtonBar.js +51 -32
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +42 -29
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/Separator.js +4 -4
- package/lib/toolbar/ToolBarGroup.d.ts +10 -0
- package/lib/toolbar/ToolBarGroup.js +10 -16
- package/lib/toolbar/helpers.d.ts +10 -0
- package/lib/toolbar/helpers.js +3 -3
- package/lib/toolbar/index.d.ts +14 -0
- package/lib/toolbar/index.js +26 -34
- package/lib/toolbar/types.d.ts +43 -0
- package/lib/toolbar/types.js +5 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/index.js +34 -43
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/tooltip/types.js +5 -0
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Header.js +5 -17
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +265 -391
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +2 -3
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +369 -554
- package/lib/treeview/types.d.ts +104 -0
- package/lib/treeview/types.js +5 -0
- package/lib/treeview_old/Header.js +7 -7
- package/lib/treeview_old/Node.js +18 -18
- package/lib/treeview_old/index.js +9 -9
- package/lib/types-3c6f1c20.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/index.d.ts +6 -0
- package/lib/uitour/index.js +28 -45
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/package.json +57 -18
- package/scripts/start.js +135 -0
- package/tsconfig.json +32 -0
- package/tsup.config.ts +10 -0
- package/.eslintrc.js +0 -26
- package/.husky/pre-commit +0 -4
- package/lib/alerts/alert.spec.js +0 -133
- package/lib/avatar/avatar.spec.js +0 -190
- package/lib/badge/badge.spec.js +0 -127
- package/lib/buttons/SpinnerLoading.js +0 -230
- package/lib/buttons/buttons.spec.js +0 -504
- package/lib/calendar/calendar.spec.js +0 -171
- package/lib/checkbox/checkbox.spec.js +0 -215
- package/lib/dialog/dialog.spec.js +0 -488
- package/lib/drawer/Drawer.spec.js +0 -258
- package/lib/dropdown/dropdown.spec.js +0 -168
- package/lib/fieldset/fieldset.spec.js +0 -329
- package/lib/form/form.spec.js +0 -293
- package/lib/gridlayout/gridLayout.spec.js +0 -169
- package/lib/icons/icons.spec.js +0 -86
- package/lib/inputs/base/base.spec.js +0 -690
- package/lib/inputs/base/index.js +0 -1
- package/lib/inputs/color/color_input.spec.js +0 -174
- package/lib/inputs/date/date.spec.js +0 -354
- package/lib/inputs/mask/input_mask.spec.js +0 -607
- package/lib/inputs/number/numberfield.spec.js +0 -215
- package/lib/inputs/search/search_input.spec.js +0 -209
- package/lib/inputs/select/select.spec.js +0 -391
- package/lib/inputs/text/textfield.spec.js +0 -215
- package/lib/inputs/textarea/textarea.spec.js +0 -59
- package/lib/labelMessages/labelMessages.spec.js +0 -176
- package/lib/labels/label.spec.js +0 -162
- package/lib/list/list.spec.js +0 -768
- package/lib/menus/float/float-menu.spec.js +0 -221
- package/lib/menus/sidenav/sidenav.spec.js +0 -379
- package/lib/panel/panel.spec.js +0 -216
- package/lib/popover/popover.spec.js +0 -146
- package/lib/progress/progress.spec.js +0 -86
- package/lib/radio/radio.spec.js +0 -189
- package/lib/spinner/spinner.spec.js +0 -152
- package/lib/split/split.spec.js +0 -151
- package/lib/table/table.spec.js +0 -352
- package/lib/tabs/tabs.spec.js +0 -349
- package/lib/toolbar/toolbar.spec.js +0 -394
- package/lib/tooltip/tooltip.spec.js +0 -203
- package/lib/treeview/treeview.spec.js +0 -279
- package/lib/uitour/uitour.spec.js +0 -176
package/lib/inputs/date/index.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
12
|
var _moment = _interopRequireDefault(require("moment"));
|
|
13
13
|
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
14
|
var _BaseMask = _interopRequireDefault(require("../mask/BaseMask"));
|
|
17
15
|
|
|
18
16
|
var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
@@ -29,449 +27,295 @@ var _icons = _interopRequireDefault(require("../../icons"));
|
|
|
29
27
|
|
|
30
28
|
var _Dialog = _interopRequireDefault(require("./Dialog"));
|
|
31
29
|
|
|
32
|
-
var _colorStyles = _interopRequireDefault(require("../../internals/colorStyles"));
|
|
33
|
-
|
|
34
30
|
var _helpers = require("./helpers");
|
|
35
31
|
|
|
36
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
33
|
|
|
38
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
35
|
|
|
40
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
41
|
-
|
|
42
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
43
|
-
|
|
44
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
|
-
|
|
46
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
47
|
-
|
|
48
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
37
|
|
|
50
|
-
function
|
|
38
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
51
39
|
|
|
52
|
-
function
|
|
40
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
53
41
|
|
|
54
|
-
function
|
|
42
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
55
43
|
|
|
56
|
-
function
|
|
44
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
57
45
|
|
|
58
|
-
function
|
|
46
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
59
47
|
|
|
60
|
-
function
|
|
48
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
61
49
|
|
|
62
|
-
function
|
|
50
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
63
51
|
|
|
64
52
|
var CALENDAR_BUTTON_WIDTH = 24;
|
|
65
53
|
|
|
66
|
-
var DatePicker =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
})), showCalendar && this.getWrapperComponent());
|
|
144
|
-
}
|
|
145
|
-
}]);
|
|
146
|
-
|
|
147
|
-
return DatePicker;
|
|
148
|
-
}(_react.Component);
|
|
149
|
-
|
|
150
|
-
Object.defineProperty(DatePicker, "getDerivedStateFromProps", {
|
|
151
|
-
configurable: true,
|
|
152
|
-
enumerable: true,
|
|
153
|
-
writable: true,
|
|
154
|
-
value: function value(props, state) {
|
|
155
|
-
var value = props.value;
|
|
156
|
-
var propsValue = state.propsValue;
|
|
157
|
-
|
|
158
|
-
if (value && (0, _moment["default"])(value, _helpers.EN_US_FORMAT).format() !== 'Invalid date' && (0, _moment["default"])(propsValue, _helpers.EN_US_FORMAT).format() !== (0, _moment["default"])(value, _helpers.EN_US_FORMAT).format()) {
|
|
159
|
-
return {
|
|
160
|
-
value: (0, _moment["default"])(value, _helpers.EN_US_FORMAT),
|
|
161
|
-
propsValue: value
|
|
162
|
-
};
|
|
163
|
-
} else if (!value && value !== propsValue) {
|
|
164
|
-
return {
|
|
165
|
-
value: undefined,
|
|
166
|
-
propsValue: value
|
|
167
|
-
};
|
|
54
|
+
var DatePicker = function DatePicker(props) {
|
|
55
|
+
var _props$showButtonOpen = props.showButtonOpen,
|
|
56
|
+
showButtonOpen = _props$showButtonOpen === void 0 ? true : _props$showButtonOpen,
|
|
57
|
+
_props$openOnFocus = props.openOnFocus,
|
|
58
|
+
openOnFocus = _props$openOnFocus === void 0 ? true : _props$openOnFocus,
|
|
59
|
+
_props$shouldCloseOnS = props.shouldCloseOnSelect,
|
|
60
|
+
shouldCloseOnSelect = _props$shouldCloseOnS === void 0 ? true : _props$shouldCloseOnS,
|
|
61
|
+
_props$setFocusOnSele = props.setFocusOnSelect,
|
|
62
|
+
setFocusOnSelect = _props$setFocusOnSele === void 0 ? true : _props$setFocusOnSele,
|
|
63
|
+
_props$showCalendarIn = props.showCalendarInDialog,
|
|
64
|
+
showCalendarInDialog = _props$showCalendarIn === void 0 ? false : _props$showCalendarIn,
|
|
65
|
+
_props$required = props.required,
|
|
66
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
67
|
+
_props$value = props.value,
|
|
68
|
+
value = _props$value === void 0 ? '' : _props$value,
|
|
69
|
+
_props$name = props.name,
|
|
70
|
+
name = _props$name === void 0 ? '' : _props$name,
|
|
71
|
+
_props$dialogSize = props.dialogSize,
|
|
72
|
+
dialogSize = _props$dialogSize === void 0 ? {
|
|
73
|
+
width: '350px',
|
|
74
|
+
height: '350px'
|
|
75
|
+
} : _props$dialogSize;
|
|
76
|
+
|
|
77
|
+
var _useState = (0, _react.useState)(value ? (0, _helpers.getMomentValue)(value) : undefined),
|
|
78
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
79
|
+
valueState = _useState2[0],
|
|
80
|
+
setValueState = _useState2[1];
|
|
81
|
+
|
|
82
|
+
var _useState3 = (0, _react.useState)(value),
|
|
83
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
84
|
+
valueFromProps = _useState4[0],
|
|
85
|
+
setValueFromProps = _useState4[1];
|
|
86
|
+
|
|
87
|
+
var _useState5 = (0, _react.useState)(false),
|
|
88
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
89
|
+
showCalendar = _useState6[0],
|
|
90
|
+
setShowCalendar = _useState6[1];
|
|
91
|
+
|
|
92
|
+
var _useState7 = (0, _react.useState)(),
|
|
93
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
94
|
+
inputDimensions = _useState8[0],
|
|
95
|
+
setInputDimensions = _useState8[1];
|
|
96
|
+
|
|
97
|
+
var _useState9 = (0, _react.useState)({
|
|
98
|
+
disabled: false,
|
|
99
|
+
readOnly: false,
|
|
100
|
+
unvisible: false,
|
|
101
|
+
hideContent: false
|
|
102
|
+
}),
|
|
103
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
104
|
+
onDenied = _useState10[0],
|
|
105
|
+
setOnDenied = _useState10[1];
|
|
106
|
+
|
|
107
|
+
var _inputRef = (0, _react.useRef)();
|
|
108
|
+
|
|
109
|
+
var buttonOpenRef = (0, _react.useRef)();
|
|
110
|
+
var dropdownContainer = (0, _react.useRef)();
|
|
111
|
+
|
|
112
|
+
var _useState11 = (0, _react.useState)(false),
|
|
113
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
114
|
+
insideDropdown = _useState12[0],
|
|
115
|
+
setInsideDropdown = _useState12[1];
|
|
116
|
+
|
|
117
|
+
var onScreenResize = function onScreenResize() {
|
|
118
|
+
var _inputRef$current;
|
|
119
|
+
|
|
120
|
+
setInputDimensions(_inputRef === null || _inputRef === void 0 ? void 0 : (_inputRef$current = _inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.getBoundingClientRect());
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var onClickOutside = function onClickOutside(event) {
|
|
124
|
+
var _buttonOpenRef$curren;
|
|
125
|
+
|
|
126
|
+
var target = event.target;
|
|
127
|
+
if (!dropdownContainer || target === _inputRef.current || target === buttonOpenRef.current) return;
|
|
128
|
+
|
|
129
|
+
if (target !== dropdownContainer.current && dropdownContainer && dropdownContainer.current && !dropdownContainer.current.contains(target) && buttonOpenRef && !(buttonOpenRef !== null && buttonOpenRef !== void 0 && (_buttonOpenRef$curren = buttonOpenRef.current) !== null && _buttonOpenRef$curren !== void 0 && _buttonOpenRef$curren.contains(target))) {
|
|
130
|
+
setShowCalendar(false);
|
|
168
131
|
}
|
|
132
|
+
};
|
|
169
133
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
});
|
|
134
|
+
var openCalendar = function openCalendar() {
|
|
135
|
+
setShowCalendar(true);
|
|
173
136
|
|
|
174
|
-
|
|
175
|
-
|
|
137
|
+
if (_inputRef.current) {
|
|
138
|
+
setInputDimensions(_inputRef.current.getBoundingClientRect());
|
|
139
|
+
}
|
|
140
|
+
};
|
|
176
141
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
writable: true,
|
|
181
|
-
value: function value() {
|
|
182
|
-
var inputDimensions = _this3.inputRef.getBoundingClientRect();
|
|
142
|
+
var onMouseMove = function onMouseMove(event) {
|
|
143
|
+
var target = event.target;
|
|
144
|
+
setInsideDropdown(false);
|
|
183
145
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
Object.defineProperty(this, "onClickOutside", {
|
|
190
|
-
configurable: true,
|
|
191
|
-
enumerable: true,
|
|
192
|
-
writable: true,
|
|
193
|
-
value: function value(event) {
|
|
194
|
-
var dropdownContainer = _this3.dropdownContainer;
|
|
195
|
-
var target = event.target;
|
|
196
|
-
if (!_this3.dropdownContainer || target === _this3.inputRef || target === _this3.buttonOpenRef) return;
|
|
197
|
-
|
|
198
|
-
if (target !== dropdownContainer && dropdownContainer && !dropdownContainer.contains(target) && _this3.buttonOpenRef && !_this3.buttonOpenRef.contains(target)) {
|
|
199
|
-
_this3.setState({
|
|
200
|
-
showCalendar: false
|
|
201
|
-
});
|
|
146
|
+
if (dropdownContainer !== undefined && dropdownContainer.current) {
|
|
147
|
+
if (target === dropdownContainer.current || dropdownContainer.current.contains(target)) {
|
|
148
|
+
setInsideDropdown(true);
|
|
202
149
|
}
|
|
203
150
|
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var onInputFocus = function onInputFocus(e) {
|
|
154
|
+
if (props.onFocus) props.onFocus(e);
|
|
155
|
+
if (openOnFocus) openCalendar();
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var onInputBlur = function onInputBlur(e) {
|
|
159
|
+
if (props.onBlur) props.onBlur(e);
|
|
160
|
+
if (!insideDropdown) setShowCalendar(false);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var onInputKeyDown = function onInputKeyDown(event) {
|
|
164
|
+
if (Number(event.code) === contants.keyCodes.TAB) {
|
|
165
|
+
setInsideDropdown(false);
|
|
166
|
+
setShowCalendar(false);
|
|
218
167
|
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
Object.defineProperty(this, "onInputKeyDown", {
|
|
245
|
-
configurable: true,
|
|
246
|
-
enumerable: true,
|
|
247
|
-
writable: true,
|
|
248
|
-
value: function value(event) {
|
|
249
|
-
if (event.keyCode === contants.keyCodes.TAB) {
|
|
250
|
-
_this3.insideDropdown = false;
|
|
251
|
-
|
|
252
|
-
_this3.setState({
|
|
253
|
-
showCalendar: false
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
Object.defineProperty(this, "onInputChange", {
|
|
259
|
-
configurable: true,
|
|
260
|
-
enumerable: true,
|
|
261
|
-
writable: true,
|
|
262
|
-
value: function value(event, _value) {
|
|
263
|
-
var onChange = _this3.props.onChange;
|
|
264
|
-
|
|
265
|
-
if (onChange) {
|
|
266
|
-
if ((0, _moment["default"])(_value, _helpers.PT_BR_FORMAT, true).isValid()) {
|
|
267
|
-
var newValue = (0, _moment["default"])(_value, _helpers.PT_BR_FORMAT).format(_helpers.EN_US_FORMAT);
|
|
268
|
-
var obj = {
|
|
269
|
-
target: {
|
|
270
|
-
value: newValue,
|
|
271
|
-
name: event.target.name
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
onChange(obj, _value);
|
|
275
|
-
} else if (event.target.value === '') {
|
|
276
|
-
var _obj = {
|
|
277
|
-
target: {
|
|
278
|
-
value: '',
|
|
279
|
-
name: event.target.name
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
onChange(_obj, _value);
|
|
283
|
-
|
|
284
|
-
_this3.setState({
|
|
285
|
-
value: undefined,
|
|
286
|
-
showCalendar: false
|
|
287
|
-
});
|
|
288
|
-
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var onInputChange = function onInputChange(event, valueInput) {
|
|
171
|
+
if (props.onChange && event) {
|
|
172
|
+
if ((0, _moment.default)(valueInput, _helpers.PT_BR_FORMAT, true).isValid()) {
|
|
173
|
+
var newValue = (0, _moment.default)(valueInput, _helpers.PT_BR_FORMAT).format(_helpers.EN_US_FORMAT);
|
|
174
|
+
var obj = {
|
|
175
|
+
target: {
|
|
176
|
+
value: newValue,
|
|
177
|
+
name: event.target.name
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
props.onChange(obj, valueInput);
|
|
181
|
+
} else if (event.target.value === '') {
|
|
182
|
+
var _obj = {
|
|
183
|
+
target: {
|
|
184
|
+
value: '',
|
|
185
|
+
name: event.target.name
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
props.onChange(_obj, valueInput);
|
|
189
|
+
setShowCalendar(false);
|
|
190
|
+
setValueState(undefined);
|
|
289
191
|
}
|
|
290
192
|
}
|
|
291
|
-
}
|
|
292
|
-
Object.defineProperty(this, "setValue", {
|
|
293
|
-
configurable: true,
|
|
294
|
-
enumerable: true,
|
|
295
|
-
writable: true,
|
|
296
|
-
value: function value(e, _value2) {
|
|
297
|
-
var _this3$props2 = _this3.props,
|
|
298
|
-
setFocusOnSelect = _this3$props2.setFocusOnSelect,
|
|
299
|
-
onComplete = _this3$props2.onComplete,
|
|
300
|
-
onChange = _this3$props2.onChange,
|
|
301
|
-
name = _this3$props2.name;
|
|
302
|
-
var showCalendar = _this3.state.showCalendar;
|
|
303
|
-
if (showCalendar && setFocusOnSelect) _this3.inputRef.focus();
|
|
304
|
-
if (onComplete) onComplete(e, _value2);
|
|
305
|
-
if (onChange) _this3.onInputChange({
|
|
306
|
-
target: {
|
|
307
|
-
value: _value2,
|
|
308
|
-
name: name
|
|
309
|
-
}
|
|
310
|
-
}, _value2);
|
|
311
|
-
if (_this3.props.shouldCloseOnSelect) showCalendar = false;
|
|
193
|
+
};
|
|
312
194
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
showCalendar: showCalendar
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
Object.defineProperty(this, "setOnDenied", {
|
|
320
|
-
configurable: true,
|
|
321
|
-
enumerable: true,
|
|
322
|
-
writable: true,
|
|
323
|
-
value: function value(onDenied) {
|
|
324
|
-
_this3.setState({
|
|
325
|
-
onDenied: onDenied
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
Object.defineProperty(this, "getButtonOpen", {
|
|
330
|
-
configurable: true,
|
|
331
|
-
enumerable: true,
|
|
332
|
-
writable: true,
|
|
333
|
-
value: function value() {
|
|
334
|
-
var showButtonOpen = _this3.props.showButtonOpen;
|
|
335
|
-
if (!showButtonOpen) return null;
|
|
336
|
-
return /*#__PURE__*/_react["default"].createElement(_buttons["default"], {
|
|
337
|
-
key: "button-",
|
|
338
|
-
boxShadow: false,
|
|
339
|
-
icon: /*#__PURE__*/_react["default"].createElement(_icons["default"], {
|
|
340
|
-
name: "calendar",
|
|
341
|
-
size: 16
|
|
342
|
-
}),
|
|
343
|
-
onClick: function onClick() {
|
|
344
|
-
_this3.openCalendar();
|
|
345
|
-
},
|
|
346
|
-
customClass: "calendar-button",
|
|
347
|
-
tabIndex: "-1",
|
|
348
|
-
targetRef: function targetRef(ref) {
|
|
349
|
-
_this3.buttonOpenRef = ref;
|
|
350
|
-
},
|
|
351
|
-
disabled: _this3.shouldDisable()
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
Object.defineProperty(this, "getCalendar", {
|
|
356
|
-
configurable: true,
|
|
357
|
-
enumerable: true,
|
|
358
|
-
writable: true,
|
|
359
|
-
value: function value(_value3, calendarColorStyle) {
|
|
360
|
-
return /*#__PURE__*/_react["default"].createElement(_calendar["default"], {
|
|
361
|
-
currentDate: _value3 !== undefined ? _value3 : (0, _moment["default"])(),
|
|
362
|
-
onDateChange: function onDateChange(date) {
|
|
363
|
-
_this3.setValue(undefined, date);
|
|
364
|
-
},
|
|
365
|
-
colorStyle: calendarColorStyle
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
Object.defineProperty(this, "getWrapperComponent", {
|
|
370
|
-
configurable: true,
|
|
371
|
-
enumerable: true,
|
|
372
|
-
writable: true,
|
|
373
|
-
value: function value() {
|
|
374
|
-
var _this3$state = _this3.state,
|
|
375
|
-
value = _this3$state.value,
|
|
376
|
-
inputDimensions = _this3$state.inputDimensions,
|
|
377
|
-
onDenied = _this3$state.onDenied;
|
|
378
|
-
var _this3$props3 = _this3.props,
|
|
379
|
-
showCalendarInDialog = _this3$props3.showCalendarInDialog,
|
|
380
|
-
showButtonOpen = _this3$props3.showButtonOpen,
|
|
381
|
-
dialogSize = _this3$props3.dialogSize,
|
|
382
|
-
calendarColorStyle = _this3$props3.calendarColorStyle;
|
|
383
|
-
if (onDenied && onDenied.readOnly) return null;
|
|
384
|
-
|
|
385
|
-
if (showCalendarInDialog) {
|
|
386
|
-
return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
387
|
-
dialogSize: dialogSize,
|
|
388
|
-
handlerClose: function handlerClose() {
|
|
389
|
-
_this3.setState({
|
|
390
|
-
showCalendar: false
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
}, _this3.getCalendar(value, calendarColorStyle));
|
|
394
|
-
}
|
|
195
|
+
var setValue = function setValue(valueParam, e) {
|
|
196
|
+
var _inputRef$current2;
|
|
395
197
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
198
|
+
if (showCalendar && setFocusOnSelect) (_inputRef$current2 = _inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
|
|
199
|
+
if (props.onComplete) props.onComplete(e, valueParam);
|
|
200
|
+
if (props.onChange) onInputChange({
|
|
201
|
+
target: {
|
|
202
|
+
value: valueParam,
|
|
203
|
+
name: name
|
|
204
|
+
}
|
|
205
|
+
}, valueParam);
|
|
206
|
+
if (shouldCloseOnSelect) setShowCalendar(false);
|
|
207
|
+
setValueState((0, _moment.default)(valueParam, _helpers.PT_BR_FORMAT));
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
var shouldDisable = function shouldDisable() {
|
|
211
|
+
return props.disabled || onDenied && (onDenied.disabled || onDenied.hideContent);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
var getButtonOpen = function getButtonOpen() {
|
|
215
|
+
if (!showButtonOpen) return undefined;
|
|
216
|
+
return /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
217
|
+
key: "button-",
|
|
218
|
+
boxShadow: false,
|
|
219
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
220
|
+
name: "calendar",
|
|
221
|
+
size: 16
|
|
222
|
+
}),
|
|
223
|
+
onClick: function onClick() {
|
|
224
|
+
openCalendar();
|
|
225
|
+
},
|
|
226
|
+
customClass: "calendar-button",
|
|
227
|
+
tabIndex: -1,
|
|
228
|
+
targetRef: function targetRef(ref) {
|
|
229
|
+
buttonOpenRef.current = ref;
|
|
230
|
+
},
|
|
231
|
+
disabled: shouldDisable()
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
var getCalendar = function getCalendar(valueCalendar, calendarColorStyle) {
|
|
236
|
+
return /*#__PURE__*/_react.default.createElement(_calendar.default, {
|
|
237
|
+
currentDate: valueCalendar !== undefined ? valueCalendar : (0, _moment.default)(),
|
|
238
|
+
onDateChange: function onDateChange(date) {
|
|
239
|
+
setValue(date.format(_helpers.PT_BR_FORMAT), undefined);
|
|
240
|
+
},
|
|
241
|
+
colorStyle: calendarColorStyle
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
var getWrapperComponent = function getWrapperComponent() {
|
|
246
|
+
if (onDenied && onDenied.readOnly) return null;
|
|
247
|
+
|
|
248
|
+
if (showCalendarInDialog) {
|
|
249
|
+
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
250
|
+
dialogSize: dialogSize,
|
|
251
|
+
handlerClose: function handlerClose() {
|
|
252
|
+
setShowCalendar(false);
|
|
403
253
|
}
|
|
404
|
-
},
|
|
254
|
+
}, getCalendar(valueState, props === null || props === void 0 ? void 0 : props.calendarColorStyle));
|
|
405
255
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
256
|
+
|
|
257
|
+
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
258
|
+
topPosition: inputDimensions ? inputDimensions.top + inputDimensions.height + 5 : '',
|
|
259
|
+
leftPosition: inputDimensions ? inputDimensions.left : '',
|
|
260
|
+
width: inputDimensions ? inputDimensions.width + (showButtonOpen ? CALENDAR_BUTTON_WIDTH : 0) : '',
|
|
261
|
+
dropdownRef: function dropdownRef(el) {
|
|
262
|
+
dropdownContainer.current = el;
|
|
263
|
+
}
|
|
264
|
+
}, getCalendar(valueState, props === null || props === void 0 ? void 0 : props.calendarColorStyle));
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
if (onDenied && onDenied.unvisible) return null;
|
|
268
|
+
(0, _react.useEffect)(function () {
|
|
269
|
+
window.addEventListener('resize', onScreenResize);
|
|
270
|
+
document.addEventListener('click', onClickOutside);
|
|
271
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
272
|
+
if (_inputRef.current) onScreenResize();
|
|
273
|
+
return function () {
|
|
274
|
+
window.removeEventListener('resize', onScreenResize);
|
|
275
|
+
document.removeEventListener('click', onClickOutside);
|
|
276
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
277
|
+
}; // TODO: Procurar solução melhor.
|
|
278
|
+
// setTimeout(() => { this.onScreenResize(); }, 300);
|
|
279
|
+
}, [_inputRef.current]);
|
|
280
|
+
(0, _react.useEffect)(function () {
|
|
281
|
+
if (value && (0, _moment.default)(value, _helpers.EN_US_FORMAT).format() !== 'Invalid date' && (0, _moment.default)(valueFromProps, _helpers.EN_US_FORMAT).format() !== (0, _moment.default)(value, _helpers.EN_US_FORMAT).format()) {
|
|
282
|
+
setValueState((0, _moment.default)(value, _helpers.EN_US_FORMAT));
|
|
283
|
+
setValueFromProps(value);
|
|
284
|
+
} else if (!value && value !== valueFromProps) {
|
|
285
|
+
setValueState(undefined);
|
|
286
|
+
setValueFromProps(value);
|
|
415
287
|
}
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
showCalendar: true
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
if (_this3.inputRef) {
|
|
427
|
-
params = _extends({}, params, {
|
|
428
|
-
inputDimensions: _this3.inputRef.getBoundingClientRect()
|
|
429
|
-
});
|
|
288
|
+
}, [value]);
|
|
289
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_BaseMask.default, _extends({}, props, {
|
|
290
|
+
value: !valueState ? ' ' : valueState.format(_helpers.PT_BR_FORMAT),
|
|
291
|
+
mask: "00/00/0000",
|
|
292
|
+
onComplete: function onComplete(e, date) {
|
|
293
|
+
if (date) {
|
|
294
|
+
setValue(date, e);
|
|
430
295
|
}
|
|
431
|
-
|
|
432
|
-
|
|
296
|
+
},
|
|
297
|
+
onBlur: function onBlur(e) {
|
|
298
|
+
onInputBlur(e);
|
|
299
|
+
},
|
|
300
|
+
onFocus: function onFocus(e) {
|
|
301
|
+
onInputFocus(e);
|
|
302
|
+
},
|
|
303
|
+
onKeyDown: function onKeyDown(event) {
|
|
304
|
+
onInputKeyDown(event);
|
|
305
|
+
},
|
|
306
|
+
onChange: function onChange(e, date) {
|
|
307
|
+
if (date) onInputChange(e, date);
|
|
308
|
+
},
|
|
309
|
+
inputRef: function inputRef(el) {
|
|
310
|
+
_inputRef.current = el;
|
|
311
|
+
},
|
|
312
|
+
rightElements: getButtonOpen(),
|
|
313
|
+
required: required,
|
|
314
|
+
handlerSetOnDenied: function handlerSetOnDenied() {
|
|
315
|
+
return setOnDenied(onDenied);
|
|
433
316
|
}
|
|
434
|
-
});
|
|
317
|
+
})), showCalendar && getWrapperComponent());
|
|
435
318
|
};
|
|
436
319
|
|
|
437
|
-
DatePicker.propTypes = {
|
|
438
|
-
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
|
|
439
|
-
showButtonOpen: _propTypes["default"].bool,
|
|
440
|
-
shouldCloseOnSelect: _propTypes["default"].bool,
|
|
441
|
-
setFocusOnSelect: _propTypes["default"].bool,
|
|
442
|
-
openOnFocus: _propTypes["default"].bool,
|
|
443
|
-
showCalendarInDialog: _propTypes["default"].bool,
|
|
444
|
-
dialogSize: _propTypes["default"].object,
|
|
445
|
-
calendarColorStyle: _propTypes["default"].oneOf(['', _colorStyles["default"].PRIMARY, _colorStyles["default"].SUCCESS, _colorStyles["default"].WARNING, _colorStyles["default"].INFO, _colorStyles["default"].DANGER]),
|
|
446
|
-
required: _propTypes["default"].bool,
|
|
447
|
-
onComplete: _propTypes["default"].func,
|
|
448
|
-
onBlur: _propTypes["default"].func,
|
|
449
|
-
onFocus: _propTypes["default"].func,
|
|
450
|
-
onChange: _propTypes["default"].func,
|
|
451
|
-
name: _propTypes["default"].string,
|
|
452
|
-
disabled: _propTypes["default"].bool,
|
|
453
|
-
permissionAttr: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].arrayOf(_propTypes["default"].object)])
|
|
454
|
-
};
|
|
455
|
-
DatePicker.defaultProps = {
|
|
456
|
-
value: '',
|
|
457
|
-
showButtonOpen: true,
|
|
458
|
-
openOnFocus: true,
|
|
459
|
-
shouldCloseOnSelect: true,
|
|
460
|
-
setFocusOnSelect: true,
|
|
461
|
-
showCalendarInDialog: false,
|
|
462
|
-
dialogSize: {
|
|
463
|
-
width: '350px',
|
|
464
|
-
height: '350px'
|
|
465
|
-
},
|
|
466
|
-
calendarColorStyle: '',
|
|
467
|
-
required: false,
|
|
468
|
-
onComplete: undefined,
|
|
469
|
-
onBlur: undefined,
|
|
470
|
-
onFocus: undefined,
|
|
471
|
-
onChange: undefined,
|
|
472
|
-
name: '',
|
|
473
|
-
disabled: false,
|
|
474
|
-
permissionAttr: undefined
|
|
475
|
-
};
|
|
476
320
|
var _default = DatePicker;
|
|
477
|
-
exports
|
|
321
|
+
exports.default = _default;
|