linear-react-components-ui 0.4.77-beta.8 → 1.0.0-rc.1
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 +50 -0
- package/lib/index.js +140 -14
- 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 +18 -25
- 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 +77 -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/tabs/MenuItems.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
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 = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _buttons = _interopRequireDefault(require("./../buttons"));
|
|
12
|
+
var _buttons = _interopRequireDefault(require("../buttons"));
|
|
15
13
|
|
|
16
14
|
var helpers = _interopRequireWildcard(require("./tabHelpers"));
|
|
17
15
|
|
|
@@ -19,82 +17,70 @@ var _permissionValidations = require("../permissionValidations");
|
|
|
19
17
|
|
|
20
18
|
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); }
|
|
21
19
|
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
20
|
+
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; }
|
|
23
21
|
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
23
|
|
|
26
24
|
var MenuItems = function MenuItems(_ref) {
|
|
27
|
-
var
|
|
28
|
-
handlerClick = _ref.handlerClick,
|
|
29
|
-
handlerRemovePanel = _ref.handlerRemovePanel,
|
|
30
|
-
tabMenuAlign = _ref.tabMenuAlign,
|
|
31
|
-
firstTabIdent = _ref.firstTabIdent,
|
|
32
|
-
tabMenuSize = _ref.tabMenuSize,
|
|
25
|
+
var handlerClick = _ref.handlerClick,
|
|
33
26
|
currentPanels = _ref.currentPanels,
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
handlerRemovePanel = _ref.handlerRemovePanel,
|
|
28
|
+
_ref$tabWidth = _ref.tabWidth,
|
|
29
|
+
tabWidth = _ref$tabWidth === void 0 ? 'auto' : _ref$tabWidth,
|
|
30
|
+
_ref$tabMenuSize = _ref.tabMenuSize,
|
|
31
|
+
tabMenuSize = _ref$tabMenuSize === void 0 ? 'medium' : _ref$tabMenuSize,
|
|
32
|
+
_ref$tabMenuAlign = _ref.tabMenuAlign,
|
|
33
|
+
tabMenuAlign = _ref$tabMenuAlign === void 0 ? 'left' : _ref$tabMenuAlign,
|
|
34
|
+
_ref$selectedTabId = _ref.selectedTabId,
|
|
35
|
+
selectedTabId = _ref$selectedTabId === void 0 ? '' : _ref$selectedTabId,
|
|
36
|
+
_ref$firstTabIdent = _ref.firstTabIdent,
|
|
37
|
+
firstTabIdent = _ref$firstTabIdent === void 0 ? false : _ref$firstTabIdent;
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
36
39
|
className: "menu ".concat(firstTabIdent && '-firsttabident'),
|
|
37
40
|
style: helpers.menuStyles(tabMenuAlign)
|
|
38
|
-
}, currentPanels.map(function (panel, index) {
|
|
41
|
+
}, currentPanels === null || currentPanels === void 0 ? void 0 : currentPanels.map(function (panel, index) {
|
|
39
42
|
var _panel$props = panel.props,
|
|
40
43
|
id = _panel$props.id,
|
|
44
|
+
icon = _panel$props.icon,
|
|
41
45
|
title = _panel$props.title,
|
|
46
|
+
tooltip = _panel$props.tooltip,
|
|
47
|
+
disabled = _panel$props.disabled,
|
|
48
|
+
iconName = _panel$props.iconName,
|
|
42
49
|
closeable = _panel$props.closeable,
|
|
43
50
|
iconAlign = _panel$props.iconAlign,
|
|
44
|
-
icon = _panel$props.icon,
|
|
45
|
-
iconName = _panel$props.iconName,
|
|
46
|
-
disabled = _panel$props.disabled,
|
|
47
|
-
tooltip = _panel$props.tooltip,
|
|
48
|
-
tooltipPosition = _panel$props.tooltipPosition,
|
|
49
51
|
tooltipWidth = _panel$props.tooltipWidth,
|
|
50
|
-
permissionAttr = _panel$props.permissionAttr
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
permissionAttr = _panel$props.permissionAttr,
|
|
53
|
+
tooltipPosition = _panel$props.tooltipPosition;
|
|
54
|
+
var onDenied = (0, _permissionValidations.actionsOnPermissionDenied)(helpers.onDeniedOptions, permissionAttr);
|
|
55
|
+
return onDenied.unvisible ? null : /*#__PURE__*/_react.default.createElement("li", {
|
|
53
56
|
key: id,
|
|
54
57
|
style: {
|
|
55
58
|
width: tabWidth
|
|
56
59
|
},
|
|
57
60
|
className: "menuitem ".concat(selectedTabId === id && 'selected')
|
|
58
|
-
}, /*#__PURE__*/_react
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
59
62
|
className: "btn menubutton",
|
|
60
63
|
boxShadow: false,
|
|
61
64
|
onClick: function onClick() {
|
|
62
|
-
return handlerClick(id);
|
|
65
|
+
return handlerClick === null || handlerClick === void 0 ? void 0 : handlerClick(id);
|
|
63
66
|
},
|
|
64
67
|
iconAlign: iconAlign,
|
|
65
68
|
iconName: iconName,
|
|
66
69
|
icon: icon,
|
|
67
|
-
disabled: disabled || onDenied.disabled,
|
|
70
|
+
disabled: disabled || !!onDenied.disabled,
|
|
68
71
|
label: title,
|
|
69
72
|
size: tabMenuSize,
|
|
70
73
|
tooltip: tooltip || title,
|
|
71
74
|
tooltipPosition: tooltipPosition,
|
|
72
75
|
tooltipWidth: tooltipWidth
|
|
73
|
-
}), closeable && currentPanels.length > 1 && /*#__PURE__*/_react
|
|
76
|
+
}), closeable && currentPanels.length > 1 && /*#__PURE__*/_react.default.createElement("button", {
|
|
74
77
|
className: "closepanel",
|
|
75
78
|
onClick: function onClick() {
|
|
76
|
-
handlerRemovePanel(id, index);
|
|
79
|
+
handlerRemovePanel === null || handlerRemovePanel === void 0 ? void 0 : handlerRemovePanel(id, index);
|
|
77
80
|
}
|
|
78
81
|
}));
|
|
79
82
|
}));
|
|
80
83
|
};
|
|
81
84
|
|
|
82
|
-
MenuItems.propTypes = {
|
|
83
|
-
currentPanels: _propTypes["default"].arrayOf(_propTypes["default"].element).isRequired,
|
|
84
|
-
selectedTabId: _propTypes["default"].string,
|
|
85
|
-
handlerClick: _propTypes["default"].func.isRequired,
|
|
86
|
-
handlerRemovePanel: _propTypes["default"].func,
|
|
87
|
-
tabMenuAlign: _propTypes["default"].string.isRequired,
|
|
88
|
-
tabMenuSize: _propTypes["default"].string,
|
|
89
|
-
firstTabIdent: _propTypes["default"].bool,
|
|
90
|
-
tabWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
|
|
91
|
-
};
|
|
92
|
-
MenuItems.defaultProps = {
|
|
93
|
-
handlerRemovePanel: null,
|
|
94
|
-
selectedTabId: '',
|
|
95
|
-
firstTabIdent: false,
|
|
96
|
-
tabMenuSize: 'medium',
|
|
97
|
-
tabWidth: 'auto'
|
|
98
|
-
};
|
|
99
85
|
var _default = MenuItems;
|
|
100
|
-
exports
|
|
86
|
+
exports.default = _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PanelProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/Size.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/PermissionAttr.js';
|
|
6
|
+
|
|
7
|
+
declare const Panel: ({ id, children, onEndReached, permissionAttr, customClass, onEndReachedThreshold, }: PanelProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { Panel as default };
|
package/lib/tabs/Panel.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
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
|
-
var
|
|
13
|
-
|
|
14
|
-
var _tabHelpers = require("./tabHelpers");
|
|
12
|
+
var _tabHelpers = _interopRequireWildcard(require("./tabHelpers"));
|
|
15
13
|
|
|
16
14
|
var _permissionValidations = require("../permissionValidations");
|
|
17
15
|
|
|
18
16
|
var _noPermission = _interopRequireDefault(require("../noPermission"));
|
|
19
17
|
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
19
|
|
|
22
20
|
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); }
|
|
23
21
|
|
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
22
|
+
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; }
|
|
25
23
|
|
|
26
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
25
|
|
|
@@ -37,15 +35,17 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
37
35
|
|
|
38
36
|
var observer = null;
|
|
39
37
|
|
|
40
|
-
var Panel = function Panel(
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
var Panel = function Panel(_ref) {
|
|
39
|
+
var id = _ref.id,
|
|
40
|
+
children = _ref.children,
|
|
41
|
+
onEndReached = _ref.onEndReached,
|
|
42
|
+
permissionAttr = _ref.permissionAttr,
|
|
43
|
+
_ref$customClass = _ref.customClass,
|
|
44
|
+
customClass = _ref$customClass === void 0 ? '' : _ref$customClass,
|
|
45
|
+
_ref$onEndReachedThre = _ref.onEndReachedThreshold,
|
|
46
|
+
onEndReachedThreshold = _ref$onEndReachedThre === void 0 ? 0.1 : _ref$onEndReachedThre;
|
|
47
|
+
|
|
48
|
+
var _useContext = (0, _react.useContext)(_tabHelpers.default),
|
|
49
49
|
selectedTabId = _useContext.selectedTabId,
|
|
50
50
|
contentHeight = _useContext.contentHeight;
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ var Panel = function Panel(props) {
|
|
|
57
57
|
|
|
58
58
|
var onEndReachedRef = (0, _react.useRef)(onEndReached);
|
|
59
59
|
|
|
60
|
-
var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(
|
|
60
|
+
var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(_tabHelpers.onDeniedOptions, permissionAttr)),
|
|
61
61
|
_useState2 = _slicedToArray(_useState, 1),
|
|
62
62
|
onDenied = _useState2[0];
|
|
63
63
|
|
|
@@ -74,7 +74,9 @@ var Panel = function Panel(props) {
|
|
|
74
74
|
observer = new IntersectionObserver(function (entries) {
|
|
75
75
|
entries.forEach(function (en) {
|
|
76
76
|
if (en.intersectionRatio > 0) {
|
|
77
|
-
|
|
77
|
+
var _onEndReachedRef$curr;
|
|
78
|
+
|
|
79
|
+
(_onEndReachedRef$curr = onEndReachedRef.current) === null || _onEndReachedRef$curr === void 0 ? void 0 : _onEndReachedRef$curr.call(onEndReachedRef);
|
|
78
80
|
}
|
|
79
81
|
}, options);
|
|
80
82
|
});
|
|
@@ -91,50 +93,15 @@ var Panel = function Panel(props) {
|
|
|
91
93
|
scrollObserver(observedElement.current);
|
|
92
94
|
}
|
|
93
95
|
}, [observedElement]);
|
|
94
|
-
return /*#__PURE__*/_react
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
95
97
|
ref: rootElementRef,
|
|
96
98
|
id: id,
|
|
97
99
|
className: " ".concat(customClass, " panel ").concat(hidePanel),
|
|
98
100
|
style: style
|
|
99
|
-
}, hideContent ? /*#__PURE__*/_react
|
|
101
|
+
}, hideContent ? /*#__PURE__*/_react.default.createElement(_noPermission.default, null) : children, !hideContent && onEndReached ? /*#__PURE__*/_react.default.createElement("div", {
|
|
100
102
|
ref: observedElement
|
|
101
|
-
}) : /*#__PURE__*/_react
|
|
103
|
+
}) : /*#__PURE__*/_react.default.createElement("noscript", null));
|
|
102
104
|
};
|
|
103
105
|
|
|
104
|
-
Panel.defaultProps = {
|
|
105
|
-
title: '',
|
|
106
|
-
closable: false,
|
|
107
|
-
hidden: false,
|
|
108
|
-
iconName: null,
|
|
109
|
-
icon: null,
|
|
110
|
-
iconAlign: 'left',
|
|
111
|
-
customClass: '',
|
|
112
|
-
children: undefined,
|
|
113
|
-
tooltipPosition: 'bottom',
|
|
114
|
-
tooltipWidth: 'auto',
|
|
115
|
-
onEndReached: undefined,
|
|
116
|
-
onEndReachedThreshold: 0.1,
|
|
117
|
-
permissionAttr: undefined
|
|
118
|
-
};
|
|
119
|
-
Panel.propTypes = {
|
|
120
|
-
children: _propTypes["default"].any,
|
|
121
|
-
id: _propTypes["default"].string.isRequired,
|
|
122
|
-
customClass: _propTypes["default"].string,
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Properties are used inside Menu.jsx to build the tabMenus
|
|
126
|
-
*/
|
|
127
|
-
title: _propTypes["default"].string,
|
|
128
|
-
closable: _propTypes["default"].bool,
|
|
129
|
-
hidden: _propTypes["default"].bool,
|
|
130
|
-
icon: _propTypes["default"].instanceOf(Object),
|
|
131
|
-
iconName: _propTypes["default"].string,
|
|
132
|
-
iconAlign: _propTypes["default"].string,
|
|
133
|
-
tooltipPosition: _propTypes["default"].string,
|
|
134
|
-
tooltipWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
135
|
-
onEndReached: _propTypes["default"].func,
|
|
136
|
-
onEndReachedThreshold: _tabHelpers.numberAroundZeroAndOne,
|
|
137
|
-
permissionAttr: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].arrayOf(_propTypes["default"].object)])
|
|
138
|
-
};
|
|
139
106
|
var _default = Panel;
|
|
140
|
-
exports
|
|
107
|
+
exports.default = _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as TabPanel } from './Panel.js';
|
|
2
|
+
import { ITabsPros } from './types.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../@types/Size.js';
|
|
5
|
+
import '../@types/Position.js';
|
|
6
|
+
import '../@types/PermissionAttr.js';
|
|
7
|
+
|
|
8
|
+
declare const Tabs: ({ toolbar, children, selectedTab, firstTabIdent, handlerTabClick, handlerCloseTab, style, tabMenuSize, tabMenuAlign, tabMenuPosition, customClassForToolBar, tabsWidthOnExceedCount, ...props }: ITabsPros) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { Tabs as default };
|
package/lib/tabs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
@@ -8,30 +8,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
Object.defineProperty(exports, "TabPanel", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return _Panel
|
|
11
|
+
return _Panel.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
exports
|
|
14
|
+
exports.default = void 0;
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
18
|
var _Menu = _interopRequireDefault(require("./Menu"));
|
|
21
19
|
|
|
22
20
|
var _Panel = _interopRequireDefault(require("./Panel"));
|
|
23
21
|
|
|
24
|
-
var _tabHelpers = require("./tabHelpers");
|
|
22
|
+
var _tabHelpers = _interopRequireWildcard(require("./tabHelpers"));
|
|
25
23
|
|
|
26
24
|
require("../assets/styles/tabs.scss");
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
var _excluded = ["toolbar", "children", "selectedTab", "firstTabIdent", "handlerTabClick", "handlerCloseTab", "style", "tabMenuSize", "tabMenuAlign", "tabMenuPosition", "customClassForToolBar", "tabsWidthOnExceedCount"];
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
30
|
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); }
|
|
31
31
|
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
32
|
+
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; }
|
|
33
33
|
|
|
34
|
-
function _extends() { _extends = Object.assign
|
|
34
|
+
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); }
|
|
35
35
|
|
|
36
36
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
37
37
|
|
|
@@ -53,17 +53,34 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
53
53
|
|
|
54
54
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
55
|
|
|
56
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
57
|
+
|
|
58
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
59
|
+
|
|
56
60
|
var DROPDOWN_WIDTH = 26;
|
|
57
61
|
|
|
58
|
-
var Tabs = function Tabs(
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
var Tabs = function Tabs(_ref) {
|
|
63
|
+
var _panels$, _panels$$props;
|
|
64
|
+
|
|
65
|
+
var toolbar = _ref.toolbar,
|
|
66
|
+
children = _ref.children,
|
|
67
|
+
selectedTab = _ref.selectedTab,
|
|
68
|
+
firstTabIdent = _ref.firstTabIdent,
|
|
69
|
+
handlerTabClick = _ref.handlerTabClick,
|
|
70
|
+
handlerCloseTab = _ref.handlerCloseTab,
|
|
71
|
+
_ref$style = _ref.style,
|
|
72
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
73
|
+
_ref$tabMenuSize = _ref.tabMenuSize,
|
|
74
|
+
tabMenuSize = _ref$tabMenuSize === void 0 ? 'default' : _ref$tabMenuSize,
|
|
75
|
+
_ref$tabMenuAlign = _ref.tabMenuAlign,
|
|
76
|
+
tabMenuAlign = _ref$tabMenuAlign === void 0 ? 'left' : _ref$tabMenuAlign,
|
|
77
|
+
_ref$tabMenuPosition = _ref.tabMenuPosition,
|
|
78
|
+
tabMenuPosition = _ref$tabMenuPosition === void 0 ? 'top' : _ref$tabMenuPosition,
|
|
79
|
+
_ref$customClassForTo = _ref.customClassForToolBar,
|
|
80
|
+
customClassForToolBar = _ref$customClassForTo === void 0 ? '' : _ref$customClassForTo,
|
|
81
|
+
_ref$tabsWidthOnExcee = _ref.tabsWidthOnExceedCount,
|
|
82
|
+
tabsWidthOnExceedCount = _ref$tabsWidthOnExcee === void 0 ? 0 : _ref$tabsWidthOnExcee,
|
|
83
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
67
84
|
|
|
68
85
|
var _useState = (0, _react.useState)((0, _tabHelpers.buildPanels)(children) || []),
|
|
69
86
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -80,7 +97,7 @@ var Tabs = function Tabs(props) {
|
|
|
80
97
|
dropdownPanels = _useState6[0],
|
|
81
98
|
setDropdownPanels = _useState6[1];
|
|
82
99
|
|
|
83
|
-
var _useState7 = (0, _react.useState)(selectedTab || panels[0]
|
|
100
|
+
var _useState7 = (0, _react.useState)(selectedTab || ((_panels$ = panels[0]) === null || _panels$ === void 0 ? void 0 : (_panels$$props = _panels$.props) === null || _panels$$props === void 0 ? void 0 : _panels$$props.id)),
|
|
84
101
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
85
102
|
selectedTabId = _useState8[0],
|
|
86
103
|
setSelectedTabId = _useState8[1];
|
|
@@ -89,7 +106,7 @@ var Tabs = function Tabs(props) {
|
|
|
89
106
|
_useState10 = _slicedToArray(_useState9, 1),
|
|
90
107
|
customClass = _useState10[0];
|
|
91
108
|
|
|
92
|
-
var _useState11 = (0, _react.useState)(
|
|
109
|
+
var _useState11 = (0, _react.useState)(0),
|
|
93
110
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
94
111
|
contentHeight = _useState12[0],
|
|
95
112
|
setContentHeight = _useState12[1];
|
|
@@ -116,10 +133,10 @@ var Tabs = function Tabs(props) {
|
|
|
116
133
|
var _toolBarRef = (0, _react.useRef)(null);
|
|
117
134
|
|
|
118
135
|
var getTabListWidth = function getTabListWidth() {
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
var tabList = _toConsumableArray(tabMenu.children);
|
|
136
|
+
var _menuRef$current;
|
|
122
137
|
|
|
138
|
+
var tabMenu = (_menuRef$current = _menuRef.current) === null || _menuRef$current === void 0 ? void 0 : _menuRef$current.children[0];
|
|
139
|
+
var tabList = Array.from(tabMenu === null || tabMenu === void 0 ? void 0 : tabMenu.childNodes);
|
|
123
140
|
var tabsListWidth = tabList.reduce(function (total, tab) {
|
|
124
141
|
return total + tab.clientWidth;
|
|
125
142
|
}, 0);
|
|
@@ -127,9 +144,11 @@ var Tabs = function Tabs(props) {
|
|
|
127
144
|
};
|
|
128
145
|
|
|
129
146
|
var getMenuAttributes = function getMenuAttributes() {
|
|
130
|
-
var
|
|
147
|
+
var _menuRef$current2;
|
|
148
|
+
|
|
149
|
+
var menuSize = (_menuRef$current2 = _menuRef.current) === null || _menuRef$current2 === void 0 ? void 0 : _menuRef$current2.clientWidth;
|
|
131
150
|
var toolbarSize = toolbar && _toolBarRef.current ? _toolBarRef.current.clientWidth : 0;
|
|
132
|
-
var contentWidth = (toolbar ? menuSize - toolbarSize : menuSize) - DROPDOWN_WIDTH;
|
|
151
|
+
var contentWidth = menuSize ? (toolbar ? menuSize - toolbarSize : menuSize) - DROPDOWN_WIDTH : 0;
|
|
133
152
|
setTabsContentWidth(contentWidth);
|
|
134
153
|
};
|
|
135
154
|
|
|
@@ -142,10 +161,12 @@ var Tabs = function Tabs(props) {
|
|
|
142
161
|
|
|
143
162
|
if (newDropdownPanels.length) {
|
|
144
163
|
var newDropdownPanelsIds = newDropdownPanels.map(function (dd) {
|
|
145
|
-
|
|
164
|
+
var _dd$props;
|
|
165
|
+
|
|
166
|
+
return dd === null || dd === void 0 ? void 0 : (_dd$props = dd.props) === null || _dd$props === void 0 ? void 0 : _dd$props.id;
|
|
146
167
|
});
|
|
147
168
|
newCurrentPanels = newCurrentPanels.filter(function (tab) {
|
|
148
|
-
return !newDropdownPanelsIds.includes(tab.props.id);
|
|
169
|
+
return !newDropdownPanelsIds.includes(tab === null || tab === void 0 ? void 0 : tab.props.id);
|
|
149
170
|
});
|
|
150
171
|
}
|
|
151
172
|
|
|
@@ -165,15 +186,19 @@ var Tabs = function Tabs(props) {
|
|
|
165
186
|
|
|
166
187
|
var onMenuClick = function onMenuClick(tabId) {
|
|
167
188
|
var includedInDropdown = dropdownPanels.filter(function (item) {
|
|
168
|
-
|
|
189
|
+
var _item$props;
|
|
190
|
+
|
|
191
|
+
return (item === null || item === void 0 ? void 0 : (_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.id) === tabId;
|
|
169
192
|
});
|
|
170
193
|
|
|
171
194
|
if (includedInDropdown.length > 0 && getTabListWidth() > 0) {
|
|
172
195
|
var newDropdownPanels = dropdownPanels.filter(function (item) {
|
|
173
|
-
|
|
196
|
+
var _item$props2;
|
|
197
|
+
|
|
198
|
+
return (item === null || item === void 0 ? void 0 : (_item$props2 = item.props) === null || _item$props2 === void 0 ? void 0 : _item$props2.id) !== tabId;
|
|
174
199
|
});
|
|
175
200
|
var newPanels = panels.filter(function (item) {
|
|
176
|
-
return item.props.id !== tabId;
|
|
201
|
+
return (item === null || item === void 0 ? void 0 : item.props.id) !== tabId;
|
|
177
202
|
});
|
|
178
203
|
var newCurrentPanels = currentPanels.slice(0, -1);
|
|
179
204
|
newDropdownPanels.push(currentPanels.pop());
|
|
@@ -188,25 +213,30 @@ var Tabs = function Tabs(props) {
|
|
|
188
213
|
setSelectedTabId(tabId);
|
|
189
214
|
};
|
|
190
215
|
|
|
191
|
-
var onRemovePanel = function onRemovePanel(closedPanelId
|
|
216
|
+
var onRemovePanel = function onRemovePanel(closedPanelId) {
|
|
217
|
+
var panelIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
192
218
|
var fromDropdownPanels = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
193
219
|
var newSelectedTabId = selectedTabId;
|
|
194
220
|
var remainPanels;
|
|
195
221
|
|
|
196
222
|
if (!fromDropdownPanels) {
|
|
223
|
+
var _remainPanels;
|
|
224
|
+
|
|
197
225
|
remainPanels = panels.filter(function (panel) {
|
|
198
|
-
return panel.props.id !== closedPanelId;
|
|
226
|
+
return (panel === null || panel === void 0 ? void 0 : panel.props.id) !== closedPanelId;
|
|
199
227
|
});
|
|
200
|
-
newSelectedTabId = selectedTabId === closedPanelId ? remainPanels[panelIndex - (panelIndex === 0 ? 0 : 1)].props.id : selectedTabId;
|
|
228
|
+
newSelectedTabId = selectedTabId === closedPanelId ? (_remainPanels = remainPanels[panelIndex - (panelIndex === 0 ? 0 : 1)]) === null || _remainPanels === void 0 ? void 0 : _remainPanels.props.id : selectedTabId;
|
|
201
229
|
setSelectedTabId(newSelectedTabId);
|
|
202
230
|
} else {
|
|
203
231
|
remainPanels = dropdownPanels.filter(function (panel) {
|
|
204
|
-
|
|
232
|
+
var _panel$props;
|
|
233
|
+
|
|
234
|
+
return (panel === null || panel === void 0 ? void 0 : (_panel$props = panel.props) === null || _panel$props === void 0 ? void 0 : _panel$props.id) !== closedPanelId;
|
|
205
235
|
});
|
|
206
236
|
setDropdownPanels(remainPanels);
|
|
207
237
|
}
|
|
208
238
|
|
|
209
|
-
if (handlerCloseTab) handlerCloseTab(closedPanelId, newSelectedTabId);
|
|
239
|
+
if (handlerCloseTab && newSelectedTabId) handlerCloseTab(closedPanelId, newSelectedTabId);
|
|
210
240
|
};
|
|
211
241
|
|
|
212
242
|
var onResize = function onResize() {
|
|
@@ -221,20 +251,25 @@ var Tabs = function Tabs(props) {
|
|
|
221
251
|
};
|
|
222
252
|
|
|
223
253
|
var renderContent = function renderContent() {
|
|
224
|
-
var menu = /*#__PURE__*/_react
|
|
254
|
+
var menu = /*#__PURE__*/_react.default.createElement(_Menu.default, _extends({}, props, {
|
|
255
|
+
toolbar: toolbar,
|
|
225
256
|
tabWidth: tabWidth,
|
|
257
|
+
customClass: customClass,
|
|
258
|
+
tabMenuSize: tabMenuSize,
|
|
259
|
+
handlerClick: onMenuClick,
|
|
260
|
+
tabMenuAlign: tabMenuAlign,
|
|
261
|
+
firstTabIdent: firstTabIdent,
|
|
262
|
+
currentPanels: currentPanels,
|
|
263
|
+
selectedTabId: selectedTabId,
|
|
264
|
+
dropdownPanels: dropdownPanels,
|
|
265
|
+
handlerRemovePanel: onRemovePanel,
|
|
266
|
+
customClassForToolBar: customClassForToolBar,
|
|
226
267
|
menuRef: function menuRef(ref) {
|
|
227
268
|
_menuRef.current = ref;
|
|
228
269
|
},
|
|
229
270
|
toolBarRef: function toolBarRef(ref) {
|
|
230
271
|
_toolBarRef.current = ref;
|
|
231
|
-
}
|
|
232
|
-
customClass: customClass,
|
|
233
|
-
currentPanels: currentPanels,
|
|
234
|
-
dropdownPanels: dropdownPanels,
|
|
235
|
-
selectedTabId: selectedTabId,
|
|
236
|
-
handlerClick: onMenuClick,
|
|
237
|
-
handlerRemovePanel: onRemovePanel
|
|
272
|
+
}
|
|
238
273
|
}));
|
|
239
274
|
/*
|
|
240
275
|
Change the order of elements depending of menus position
|
|
@@ -242,10 +277,10 @@ var Tabs = function Tabs(props) {
|
|
|
242
277
|
|
|
243
278
|
|
|
244
279
|
if (tabMenuPosition === 'top' || tabMenuPosition === 'left') {
|
|
245
|
-
return /*#__PURE__*/_react
|
|
280
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, menu, panels);
|
|
246
281
|
}
|
|
247
282
|
|
|
248
|
-
return /*#__PURE__*/_react
|
|
283
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, panels, menu);
|
|
249
284
|
};
|
|
250
285
|
|
|
251
286
|
(0, _react.useEffect)(function () {
|
|
@@ -262,49 +297,20 @@ var Tabs = function Tabs(props) {
|
|
|
262
297
|
(0, _react.useEffect)(function () {
|
|
263
298
|
getTabsList();
|
|
264
299
|
}, [panels.length, currentPanels.length, tabsContentWidth]);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
selectedTabId: selectedTabId,
|
|
269
|
-
contentHeight: contentHeight
|
|
270
|
-
};
|
|
300
|
+
var contextValues = {
|
|
301
|
+
selectedTabId: selectedTabId,
|
|
302
|
+
contentHeight: contentHeight
|
|
271
303
|
};
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
componentRef.current = _ref;
|
|
304
|
+
return /*#__PURE__*/_react.default.createElement(_tabHelpers.default.Provider, {
|
|
305
|
+
value: contextValues
|
|
306
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
307
|
+
ref: function ref(_ref2) {
|
|
308
|
+
componentRef.current = _ref2;
|
|
278
309
|
},
|
|
279
310
|
className: (0, _tabHelpers.tabsClass)(tabMenuPosition),
|
|
280
311
|
style: style
|
|
281
312
|
}, renderContent()));
|
|
282
313
|
};
|
|
283
314
|
|
|
284
|
-
Tabs.propTypes = {
|
|
285
|
-
selectedTab: _propTypes["default"].string,
|
|
286
|
-
tabMenuAlign: _propTypes["default"].oneOf(['left', 'center', 'right', 'top', 'bottom']),
|
|
287
|
-
tabMenuPosition: _propTypes["default"].oneOf(['top', 'left', 'bottom', 'right']),
|
|
288
|
-
tabMenuSize: _propTypes["default"].string,
|
|
289
|
-
handlerTabClick: _propTypes["default"].func,
|
|
290
|
-
handlerCloseTab: _propTypes["default"].func,
|
|
291
|
-
children: _propTypes["default"].any.isRequired,
|
|
292
|
-
toolbar: _propTypes["default"].object,
|
|
293
|
-
customClassForToolBar: _propTypes["default"].string,
|
|
294
|
-
style: _propTypes["default"].object,
|
|
295
|
-
tabsWidthOnExceedCount: _propTypes["default"].number
|
|
296
|
-
};
|
|
297
|
-
Tabs.defaultProps = {
|
|
298
|
-
selectedTab: null,
|
|
299
|
-
tabMenuAlign: 'left',
|
|
300
|
-
tabMenuPosition: 'top',
|
|
301
|
-
tabMenuSize: 'default',
|
|
302
|
-
handlerTabClick: null,
|
|
303
|
-
handlerCloseTab: null,
|
|
304
|
-
toolbar: undefined,
|
|
305
|
-
customClassForToolBar: '',
|
|
306
|
-
style: {},
|
|
307
|
-
tabsWidthOnExceedCount: 0
|
|
308
|
-
};
|
|
309
315
|
var _default = Tabs;
|
|
310
|
-
exports
|
|
316
|
+
exports.default = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Position } from '../@types/Position.js';
|
|
4
|
+
import { PanelTypeAndProps, TabsContextValues } from './types.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
import '../@types/PermissionAttr.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Recursive funcion to get the panels passed as children elements to the Tabs Component.
|
|
10
|
+
* Sometimes, when tabs were added dynamically, the children can came as array or Panels.
|
|
11
|
+
*/
|
|
12
|
+
declare function buildPanels(children: ReactNode | ReactNode, panels?: Array<ReactNode>): PanelTypeAndProps[];
|
|
13
|
+
declare function tabsClass(tabMenuPosition: Exclude<Position, 'center'>): string;
|
|
14
|
+
declare function menuStyles(tabMenuAlign: Position): {
|
|
15
|
+
justifyContent: string;
|
|
16
|
+
};
|
|
17
|
+
declare function numberAroundZeroAndOne(props: Array<object>, propName: number, componentName: string): Error | null;
|
|
18
|
+
declare const onDeniedOptions: string[];
|
|
19
|
+
declare const TabContext: React.Context<TabsContextValues>;
|
|
20
|
+
|
|
21
|
+
export { buildPanels, TabContext as default, menuStyles, numberAroundZeroAndOne, onDeniedOptions, tabsClass };
|