linear-react-components-ui 0.4.77-beta.23 → 0.4.77-beta.26
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 -3
- 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/dist/main.js +14 -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/LabelStyles.js +5 -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/PermissionAttr.js +5 -0
- package/lib/@types/PointerEvents.d.ts +3 -0
- package/lib/@types/PointerEvents.js +5 -0
- package/lib/@types/Position.d.ts +3 -0
- package/lib/@types/Position.js +5 -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/Size.js +5 -0
- package/lib/@types/SizePixels.d.ts +3 -0
- package/lib/@types/SizePixels.js +5 -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 +28 -26
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +30 -25
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/BaseAlert.js +22 -15
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/Message.js +41 -50
- package/lib/alerts/alert.spec.js +36 -59
- 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 +6 -6
- 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 +10 -10
- 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/table.scss +7 -2
- package/lib/assets/styles/treetable.scss +10 -12
- package/lib/avatar/avatar.spec.js +63 -95
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/index.js +24 -69
- package/lib/avatar/types.d.ts +31 -0
- package/lib/avatar/types.js +5 -0
- package/lib/badge/badge.spec.js +33 -55
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/index.js +12 -28
- 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 +8 -8
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/AddButton.js +8 -8
- 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 +20 -7
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DangerButton.js +18 -23
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +90 -142
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/DestroyButton.js +18 -9
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/EditButton.js +8 -8
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.js +8 -8
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/InfoButton.js +18 -23
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.js +18 -23
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.js +8 -8
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SaveButton.js +19 -6
- package/lib/buttons/SpinnerLoading.js +2 -2
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/SuccessButton.js +17 -22
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/WarningButton.js +17 -22
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/button_container/index.js +12 -25
- package/lib/buttons/buttons.spec.js +184 -258
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/index.js +33 -33
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +20 -37
- package/lib/buttons/types.d.ts +44 -0
- package/lib/buttons/types.js +5 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/DangerCalendar.js +17 -8
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.js +17 -8
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.js +17 -8
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.js +17 -8
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.js +17 -8
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Day.js +9 -15
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Month.js +19 -14
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/Week.js +19 -15
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +16 -16
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/base/index.js +58 -51
- package/lib/calendar/calendar.spec.js +44 -75
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/index.js +15 -15
- 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 +8 -18
- package/lib/checkbox/checkbox.spec.js +43 -84
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +68 -95
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/checkbox/types.js +5 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Alert.js +11 -16
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +28 -36
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Error.js +9 -14
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Information.js +9 -14
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Question.js +16 -27
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/Warning.js +9 -14
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Content.js +5 -14
- 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 +14 -36
- package/lib/dialog/base/style.js +2 -2
- package/lib/dialog/dialog.spec.js +95 -169
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/form/index.js +37 -47
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/index.js +16 -16
- 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 +8 -17
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +51 -62
- package/lib/drawer/Drawer.spec.js +62 -105
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/Header.js +29 -48
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/helpers.js +5 -5
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/index.js +9 -9
- 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 +37 -21
- package/lib/dropdown/dropdown.spec.js +41 -65
- 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/types.js +5 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +37 -52
- package/lib/fieldset/fieldset.spec.js +80 -126
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +35 -56
- 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 +37 -54
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +31 -61
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +11 -35
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +31 -53
- package/lib/form/form.spec.js +63 -105
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +26 -21
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +100 -118
- package/lib/form/types.d.ts +168 -0
- package/lib/form/types.js +5 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +51 -125
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +31 -39
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridCol.js +8 -23
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/GridRow.js +9 -29
- package/lib/gridlayout/gridLayout.spec.js +47 -74
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/index.js +6 -6
- 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/icons.spec.js +29 -45
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/index.js +29 -46
- package/lib/icons/types.d.ts +28 -0
- package/lib/icons/types.js +5 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +18 -18
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +58 -157
- package/lib/inputs/base/base.spec.js +187 -302
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +11 -11
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/base/types.js +5 -0
- package/lib/inputs/color/color_input.spec.js +37 -71
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/index.js +55 -43
- 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 +5 -12
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/Dropdown.js +21 -63
- package/lib/inputs/date/date.spec.js +79 -160
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/helpers.js +6 -6
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/index.js +265 -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 +53 -99
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/BaseMask.js +14 -25
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +32 -29
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +33 -31
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/Phone.js +7 -15
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.js +7 -7
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/helpers.js +25 -40
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +189 -251
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/index.js +11 -11
- package/lib/inputs/mask/input_mask.spec.js +193 -306
- 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 +10 -22
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.js +76 -93
- 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 +107 -107
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/multiSelect/types.js +5 -0
- package/lib/inputs/number/BaseNumber.d.ts +12 -0
- package/lib/inputs/number/BaseNumber.js +17 -29
- package/lib/inputs/number/Currency.d.ts +12 -0
- package/lib/inputs/number/Currency.js +10 -20
- package/lib/inputs/number/Decimal.d.ts +12 -0
- package/lib/inputs/number/Decimal.js +5 -5
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/format_number.js +1 -1
- package/lib/inputs/number/index.d.ts +14 -0
- package/lib/inputs/number/index.js +16 -22
- package/lib/inputs/number/numberfield.spec.js +47 -88
- package/lib/inputs/number/types.d.ts +30 -0
- package/lib/inputs/number/types.js +5 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dialog.js +5 -12
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/Dropdown.js +19 -63
- 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 +34 -74
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +158 -198
- 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 +147 -263
- package/lib/inputs/search/search_input.spec.js +50 -90
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/ActionButtons.js +20 -26
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/Dropdown.js +59 -82
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/helper.js +19 -15
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +25 -21
- 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 +299 -408
- package/lib/inputs/select/select.spec.js +135 -186
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.js +310 -457
- package/lib/inputs/select/types.d.ts +94 -0
- package/lib/inputs/select/types.js +5 -0
- package/lib/inputs/text/index.d.ts +11 -0
- package/lib/inputs/text/index.js +6 -5
- package/lib/inputs/text/textfield.spec.js +46 -87
- package/lib/inputs/text/types.d.ts +25 -0
- package/lib/inputs/text/types.js +5 -0
- package/lib/inputs/textarea/index.d.ts +9 -0
- package/lib/inputs/textarea/index.js +11 -21
- package/lib/inputs/textarea/textarea.spec.js +16 -29
- package/lib/inputs/textarea/types.d.ts +13 -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/constants.js +1 -1
- package/lib/internals/types.d.ts +21 -0
- package/lib/internals/types.js +5 -0
- package/lib/internals/withTooltip.d.ts +11 -0
- package/lib/internals/withTooltip.js +50 -48
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/index.js +48 -56
- package/lib/labelMessages/labelMessages.spec.js +44 -77
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labelMessages/types.js +5 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DangerLabel.js +18 -9
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +46 -68
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/InfoLabel.js +18 -9
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.js +18 -9
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.js +18 -9
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.js +18 -9
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/index.js +16 -16
- package/lib/labels/label.spec.js +59 -86
- 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 +54 -82
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/Separator.js +5 -5
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +4 -4
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +63 -72
- package/lib/list/list.spec.js +225 -371
- 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 +18 -38
- package/lib/menus/float/float-menu.spec.js +38 -72
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/helpers.js +5 -5
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/index.js +18 -38
- 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 +5 -5
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/ExpandMenu.js +7 -19
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/MenuLink.js +6 -20
- 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 +47 -63
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +24 -25
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/helpers.js +6 -6
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/index.js +71 -83
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +10 -19
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.js +41 -28
- package/lib/menus/sidenav/sidenav.spec.js +40 -89
- 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 +8 -8
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/Content.js +15 -27
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/DangerPanel.js +8 -8
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +41 -58
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/Header.js +19 -41
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/InfoPanel.js +8 -8
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.js +8 -8
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.js +8 -8
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/ToolBar.js +5 -10
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/WarningPanel.js +8 -8
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/helpers.js +10 -6
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/index.js +19 -19
- package/lib/panel/panel.spec.js +76 -113
- 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/popover.spec.js +44 -74
- 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 +19 -27
- package/lib/progress/progress.spec.js +38 -46
- 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 +45 -59
- package/lib/radio/radio.spec.js +51 -78
- package/lib/radio/types.d.ts +18 -0
- package/lib/radio/types.js +5 -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 +16 -35
- 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 +42 -37
- package/lib/spinner/spinner.spec.js +47 -69
- 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 +83 -90
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/SplitSide.js +8 -28
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/helpers.js +5 -5
- package/lib/split/index.d.ts +5 -0
- package/lib/split/index.js +6 -6
- package/lib/split/split.spec.js +60 -73
- 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 +25 -32
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +52 -31
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +14 -28
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +15 -36
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +21 -39
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/helpers.js +6 -6
- package/lib/table/index.d.ts +11 -0
- package/lib/table/index.js +45 -71
- package/lib/table/table.spec.js +108 -163
- 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 +21 -31
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/Menu.js +22 -26
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +34 -48
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +38 -61
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/index.js +125 -99
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/tabHelpers.js +13 -11
- package/lib/tabs/tabs.spec.js +121 -212
- 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 +54 -35
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +45 -32
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/Separator.js +5 -5
- 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 +35 -41
- package/lib/toolbar/toolbar.spec.js +142 -190
- 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 +35 -44
- package/lib/tooltip/tooltip.spec.js +40 -55
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/tooltip/types.js +5 -0
- package/lib/treetable/Body.js +46 -0
- package/lib/treetable/Header.js +27 -0
- package/lib/treetable/Row.js +261 -0
- package/lib/treetable/helpers.js +30 -61
- package/lib/treetable/index.js +13 -112
- package/lib/treetable/types.d.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 +281 -391
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +3 -4
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +386 -555
- package/lib/treeview/treeview.spec.js +65 -102
- package/lib/treeview/types.d.ts +104 -0
- package/lib/treeview/types.js +5 -0
- package/lib/treeview_old/Header.js +8 -8
- package/lib/treeview_old/Node.js +38 -32
- package/lib/treeview_old/index.js +10 -10
- package/lib/types-3c6f1c20.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/helpers.js +1 -1
- package/lib/uitour/index.d.ts +6 -0
- package/lib/uitour/index.js +54 -59
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/lib/uitour/uitour.spec.js +63 -85
- 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/treetable/TRow.js +0 -255
- package/lib/treetable/treetable.spec.js +0 -302
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
-
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
|
|
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); }
|
|
11
4
|
var _react = require("@testing-library/react");
|
|
12
|
-
|
|
13
5
|
var _react2 = _interopRequireDefault(require("react"));
|
|
14
|
-
|
|
15
6
|
require("@testing-library/jest-dom");
|
|
16
|
-
|
|
17
7
|
require("babel-polyfill");
|
|
18
|
-
|
|
19
8
|
var _ = _interopRequireDefault(require("."));
|
|
20
|
-
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
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); }
|
|
21
14
|
var dataMock = {
|
|
22
15
|
id: 1,
|
|
23
16
|
titulo: 'SG Linear',
|
|
@@ -45,7 +38,8 @@ var dataMock = {
|
|
|
45
38
|
codigo: 'Editar',
|
|
46
39
|
itens: [{
|
|
47
40
|
titulo: 'Editar permissão ERP',
|
|
48
|
-
codigo: 'Editar permissão ERP'
|
|
41
|
+
codigo: 'Editar permissão ERP',
|
|
42
|
+
itens: []
|
|
49
43
|
}]
|
|
50
44
|
}]
|
|
51
45
|
}]
|
|
@@ -61,60 +55,51 @@ var dataMock = {
|
|
|
61
55
|
itens: [{
|
|
62
56
|
id: 5,
|
|
63
57
|
titulo: 'Empresas',
|
|
64
|
-
codigo: 'empresas'
|
|
58
|
+
codigo: 'empresas',
|
|
59
|
+
itens: []
|
|
65
60
|
}]
|
|
66
61
|
}]
|
|
67
62
|
};
|
|
68
|
-
|
|
69
63
|
var treeviewRenderMock = function treeviewRenderMock(props) {
|
|
70
|
-
return /*#__PURE__*/_react2
|
|
64
|
+
return /*#__PURE__*/_react2.default.createElement(_.default, _extends({
|
|
71
65
|
data: dataMock,
|
|
72
66
|
valuePropName: "id",
|
|
73
67
|
labelPropName: "titulo",
|
|
74
68
|
parentPropName: "0"
|
|
75
69
|
}, props));
|
|
76
70
|
};
|
|
77
|
-
|
|
78
71
|
describe('Treeview', function () {
|
|
79
72
|
describe('Default', function () {
|
|
80
73
|
it('should render', function () {
|
|
81
74
|
var _render = (0, _react.render)(treeviewRenderMock()),
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
container = _render.container;
|
|
84
76
|
expect(container.firstChild).toBeTruthy();
|
|
85
77
|
});
|
|
86
78
|
it('should have start node visible', function () {
|
|
87
79
|
var _render2 = (0, _react.render)(treeviewRenderMock()),
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
queryByText = _render2.queryByText;
|
|
90
81
|
expect(queryByText(dataMock.titulo)).toBeTruthy();
|
|
91
82
|
});
|
|
92
83
|
it('should not have second node visible', function () {
|
|
93
84
|
var _render3 = (0, _react.render)(treeviewRenderMock()),
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
queryByText = _render3.queryByText;
|
|
96
86
|
expect(queryByText(dataMock.itens[0].titulo)).not.toBeTruthy();
|
|
97
87
|
});
|
|
98
|
-
it('should open on click', /*#__PURE__*/(
|
|
99
|
-
var _render4,
|
|
100
|
-
|
|
101
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
88
|
+
it('should open on click', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
89
|
+
var _render4, container, queryByText;
|
|
90
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
102
91
|
while (1) {
|
|
103
92
|
switch (_context.prev = _context.next) {
|
|
104
93
|
case 0:
|
|
105
|
-
_render4 = (0, _react.render)(treeviewRenderMock()),
|
|
106
|
-
|
|
107
|
-
_react.fireEvent.click(getByRole('button'));
|
|
108
|
-
|
|
94
|
+
_render4 = (0, _react.render)(treeviewRenderMock()), container = _render4.container, queryByText = _render4.queryByText;
|
|
95
|
+
_react.fireEvent.click(container.querySelector('.treeviewitem .opencloseicon'));
|
|
109
96
|
_context.next = 4;
|
|
110
97
|
return (0, _react.waitFor)(function () {
|
|
111
98
|
return queryByText(dataMock.itens[0].titulo);
|
|
112
99
|
});
|
|
113
|
-
|
|
114
100
|
case 4:
|
|
115
101
|
expect(queryByText(dataMock.itens[0].titulo)).toBeTruthy();
|
|
116
102
|
expect(queryByText(dataMock.itens[1].titulo)).toBeTruthy();
|
|
117
|
-
|
|
118
103
|
case 6:
|
|
119
104
|
case "end":
|
|
120
105
|
return _context.stop();
|
|
@@ -122,54 +107,42 @@ describe('Treeview', function () {
|
|
|
122
107
|
}
|
|
123
108
|
}, _callee);
|
|
124
109
|
})));
|
|
125
|
-
it('should open all layers', /*#__PURE__*/(
|
|
126
|
-
var _render5,
|
|
127
|
-
|
|
128
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
110
|
+
it('should open all layers', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
111
|
+
var _render5, container, queryByText;
|
|
112
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
129
113
|
while (1) {
|
|
130
114
|
switch (_context2.prev = _context2.next) {
|
|
131
115
|
case 0:
|
|
132
|
-
_render5 = (0, _react.render)(treeviewRenderMock()),
|
|
133
|
-
|
|
134
|
-
_react.fireEvent.click(getByRole('button'));
|
|
135
|
-
|
|
116
|
+
_render5 = (0, _react.render)(treeviewRenderMock()), container = _render5.container, queryByText = _render5.queryByText;
|
|
117
|
+
_react.fireEvent.click(container.querySelector('.treeviewitem .opencloseicon'));
|
|
136
118
|
_context2.next = 4;
|
|
137
119
|
return (0, _react.waitFor)(function () {
|
|
138
120
|
return queryByText(dataMock.itens[0].titulo);
|
|
139
121
|
});
|
|
140
|
-
|
|
141
122
|
case 4:
|
|
142
|
-
_react.fireEvent.click(
|
|
143
|
-
|
|
123
|
+
_react.fireEvent.click(container.querySelectorAll('.treeviewitem .opencloseicon')[1]);
|
|
144
124
|
_context2.next = 7;
|
|
145
125
|
return (0, _react.waitFor)(function () {
|
|
146
126
|
return queryByText(dataMock.itens[0].itens[0].titulo);
|
|
147
127
|
});
|
|
148
|
-
|
|
149
128
|
case 7:
|
|
150
|
-
_react.fireEvent.click(
|
|
151
|
-
|
|
129
|
+
_react.fireEvent.click(container.querySelectorAll('.treeviewitem .opencloseicon')[2]);
|
|
152
130
|
_context2.next = 10;
|
|
153
131
|
return (0, _react.waitFor)(function () {
|
|
154
132
|
return queryByText(dataMock.itens[0].itens[0].itens[0].titulo);
|
|
155
133
|
});
|
|
156
|
-
|
|
157
134
|
case 10:
|
|
158
|
-
_react.fireEvent.click(
|
|
159
|
-
|
|
135
|
+
_react.fireEvent.click(container.querySelectorAll('.treeviewitem .opencloseicon')[3]);
|
|
160
136
|
_context2.next = 13;
|
|
161
137
|
return (0, _react.waitFor)(function () {
|
|
162
138
|
return queryByText(dataMock.itens[0].itens[0].itens[0].itens[0].titulo);
|
|
163
139
|
});
|
|
164
|
-
|
|
165
140
|
case 13:
|
|
166
|
-
_react.fireEvent.click(
|
|
167
|
-
|
|
141
|
+
_react.fireEvent.click(container.querySelectorAll('.treeviewitem .opencloseicon')[4]);
|
|
168
142
|
_context2.next = 16;
|
|
169
143
|
return (0, _react.waitFor)(function () {
|
|
170
144
|
return queryByText(dataMock.itens[1].itens[0].titulo);
|
|
171
145
|
});
|
|
172
|
-
|
|
173
146
|
case 16:
|
|
174
147
|
expect(queryByText(dataMock.itens[0].titulo)).toBeTruthy();
|
|
175
148
|
expect(queryByText(dataMock.itens[0].itens[0].titulo)).toBeTruthy();
|
|
@@ -177,7 +150,6 @@ describe('Treeview', function () {
|
|
|
177
150
|
expect(queryByText(dataMock.itens[0].itens[0].itens[0].itens[0].titulo)).toBeTruthy();
|
|
178
151
|
expect(queryByText(dataMock.itens[1].titulo)).toBeTruthy();
|
|
179
152
|
expect(queryByText(dataMock.itens[1].itens[0].titulo)).toBeTruthy();
|
|
180
|
-
|
|
181
153
|
case 22:
|
|
182
154
|
case "end":
|
|
183
155
|
return _context2.stop();
|
|
@@ -187,51 +159,44 @@ describe('Treeview', function () {
|
|
|
187
159
|
})));
|
|
188
160
|
it('should render checkbox', function () {
|
|
189
161
|
var _render6 = (0, _react.render)(treeviewRenderMock({
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
162
|
+
showCheckBox: true
|
|
163
|
+
})),
|
|
164
|
+
container = _render6.container;
|
|
194
165
|
expect(container.querySelector('.checkbox-component')).toBeTruthy();
|
|
195
166
|
});
|
|
196
167
|
it('should call onSelectedIdsChange callback', function () {
|
|
197
168
|
var mockCallback = jest.fn(function (x) {
|
|
198
169
|
return x;
|
|
199
170
|
});
|
|
200
|
-
|
|
201
171
|
var _render7 = (0, _react.render)(treeviewRenderMock({
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
172
|
+
showCheckBox: true,
|
|
173
|
+
onSelectedIdsChange: mockCallback
|
|
174
|
+
})),
|
|
175
|
+
container = _render7.container;
|
|
207
176
|
_react.fireEvent.click(container.querySelector('.checkbox-component'));
|
|
208
|
-
|
|
209
177
|
expect(mockCallback.mock.calls.length).toBe(1);
|
|
210
178
|
expect(mockCallback.mock.calls[0][0]).toStrictEqual([1]);
|
|
211
179
|
});
|
|
212
180
|
it('should control checkbox by selectedIds', function () {
|
|
213
181
|
var _render8 = (0, _react.render)(treeviewRenderMock({
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
expect(container.querySelector('input.checkbox-component')).toBeChecked();
|
|
182
|
+
showCheckBox: true,
|
|
183
|
+
selectedIds: [1]
|
|
184
|
+
})),
|
|
185
|
+
container = _render8.container;
|
|
186
|
+
expect(container.querySelector('.checkbox-component input[type=checkbox]')).toBeChecked();
|
|
220
187
|
});
|
|
221
188
|
it('should start checkbox unchecked', function () {
|
|
222
189
|
var _render9 = (0, _react.render)(treeviewRenderMock({
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
expect(container.querySelector('input.checkbox-component')).not.toBeChecked();
|
|
190
|
+
showCheckBox: true
|
|
191
|
+
})),
|
|
192
|
+
container = _render9.container;
|
|
193
|
+
expect(container.querySelector('.checkbox-component input[type=checkbox]')).not.toBeChecked();
|
|
228
194
|
});
|
|
229
195
|
it('should start nodes open', function () {
|
|
230
196
|
var _render10 = (0, _react.render)(treeviewRenderMock({
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
197
|
+
startNodesOpened: true
|
|
198
|
+
})),
|
|
199
|
+
queryByText = _render10.queryByText;
|
|
235
200
|
expect(queryByText(dataMock.itens[0].titulo)).toBeTruthy();
|
|
236
201
|
expect(queryByText(dataMock.itens[0].itens[0].titulo)).toBeTruthy();
|
|
237
202
|
expect(queryByText(dataMock.itens[0].itens[0].itens[0].titulo)).toBeTruthy();
|
|
@@ -241,38 +206,36 @@ describe('Treeview', function () {
|
|
|
241
206
|
});
|
|
242
207
|
it('should apply customClass', function () {
|
|
243
208
|
var _render11 = (0, _react.render)(treeviewRenderMock({
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
209
|
+
customClass: 'customClass'
|
|
210
|
+
})),
|
|
211
|
+
container = _render11.container;
|
|
248
212
|
expect(container.firstChild).toHaveClass('customClass');
|
|
249
213
|
});
|
|
250
214
|
it('should apply style', function () {
|
|
251
215
|
var _render12 = (0, _react.render)(treeviewRenderMock({
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
216
|
+
styleForContainer: {
|
|
217
|
+
backgroundColor: '#000'
|
|
218
|
+
}
|
|
219
|
+
})),
|
|
220
|
+
container = _render12.container;
|
|
258
221
|
expect(container.querySelector('ul')).toHaveStyle('background-color: #000');
|
|
259
222
|
});
|
|
260
223
|
it('should apply idsInLoading', function () {
|
|
224
|
+
var _container$querySelec;
|
|
261
225
|
var _render13 = (0, _react.render)(treeviewRenderMock({
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
var li = container.querySelector('li').firstChild;
|
|
226
|
+
idsInLoading: [1]
|
|
227
|
+
})),
|
|
228
|
+
container = _render13.container;
|
|
229
|
+
var li = (_container$querySelec = container.querySelector('li')) === null || _container$querySelec === void 0 ? void 0 : _container$querySelec.firstChild;
|
|
267
230
|
expect(li.firstChild).toHaveClass('spinnerloading');
|
|
268
231
|
});
|
|
269
232
|
it('should apply selectedNodeId', function () {
|
|
233
|
+
var _container$querySelec2;
|
|
270
234
|
var _render14 = (0, _react.render)(treeviewRenderMock({
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
var filhosLi = container.querySelector('li').children;
|
|
235
|
+
selectedNodeId: 1
|
|
236
|
+
})),
|
|
237
|
+
container = _render14.container;
|
|
238
|
+
var filhosLi = (_container$querySelec2 = container.querySelector('li')) === null || _container$querySelec2 === void 0 ? void 0 : _container$querySelec2.children;
|
|
276
239
|
expect(filhosLi[1]).toHaveStyle('background-color: rgb(209, 209, 209)');
|
|
277
240
|
});
|
|
278
241
|
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
2
|
+
import { Size } from '../@types/Size.js';
|
|
3
|
+
|
|
4
|
+
declare type NodeItem<T = void> = T & {
|
|
5
|
+
id: number;
|
|
6
|
+
itens?: NodeItem<T>[];
|
|
7
|
+
statusEnum?: {
|
|
8
|
+
id: number | string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
interface IValidator<T = void> {
|
|
12
|
+
validator: (node: NodeItem<T>) => boolean;
|
|
13
|
+
applyBehavior?: 'unvisible' | 'disabled';
|
|
14
|
+
}
|
|
15
|
+
interface INodeElementsValidations<T = void> {
|
|
16
|
+
[key: string]: IValidator<T>[];
|
|
17
|
+
}
|
|
18
|
+
interface INodeValidationProps {
|
|
19
|
+
validationKey: string | null;
|
|
20
|
+
onNodeElementClick: (node: any) => void;
|
|
21
|
+
visible: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface ITreeviewProps {
|
|
24
|
+
data: object;
|
|
25
|
+
valuePropName: string;
|
|
26
|
+
labelPropName: string;
|
|
27
|
+
parentPropName: string;
|
|
28
|
+
customClass?: string;
|
|
29
|
+
bordered?: boolean;
|
|
30
|
+
startNodesOpened?: boolean;
|
|
31
|
+
alwaysShowArrow?: boolean;
|
|
32
|
+
selectedIds?: number[];
|
|
33
|
+
requiredIds?: number[] | string[];
|
|
34
|
+
showCheckBox?: boolean;
|
|
35
|
+
onSelectedIdsChange?: (value: any) => void;
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
styleForContainer?: CSSProperties;
|
|
38
|
+
allowCheckAllChildren?: boolean;
|
|
39
|
+
allowCheckAllAncestry?: boolean;
|
|
40
|
+
defaultDisabledTooltip?: string;
|
|
41
|
+
nodeRightElements?: ReactElement<INodeValidationProps>[];
|
|
42
|
+
nodeToolbarElements?: ReactElement<INodeValidationProps>[];
|
|
43
|
+
nodeMenuButtonSize?: Size;
|
|
44
|
+
onNodeClick?: () => void;
|
|
45
|
+
onNodeOpen?: (value: any) => void;
|
|
46
|
+
nodeElementsValidations?: INodeElementsValidations<any>;
|
|
47
|
+
enableDynamicData?: boolean;
|
|
48
|
+
idsInLoading?: number[];
|
|
49
|
+
selectedNodeId?: number;
|
|
50
|
+
}
|
|
51
|
+
interface ITreeNodeProps {
|
|
52
|
+
node: any;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
startNodesOpened: boolean;
|
|
55
|
+
childrenIds?: number[];
|
|
56
|
+
parentId?: number;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
isParent?: boolean;
|
|
59
|
+
alwaysShowArrow?: boolean;
|
|
60
|
+
nodeRightElements?: ReactElement<INodeValidationProps>[];
|
|
61
|
+
nodeToolbarElements?: ReactElement<INodeValidationProps>[];
|
|
62
|
+
nodeMenuButtonSize?: Size;
|
|
63
|
+
onNodeClick?: (node: any) => void;
|
|
64
|
+
handlerOnNodeOpen?: (node: any) => void;
|
|
65
|
+
nodeElementsValidations?: INodeElementsValidations;
|
|
66
|
+
idsInLoading?: number[];
|
|
67
|
+
selectedNodeId?: number;
|
|
68
|
+
}
|
|
69
|
+
interface ITreeHeaderProps {
|
|
70
|
+
title?: string;
|
|
71
|
+
customClass?: string;
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
interface ITreeViewContext extends ITreeviewProps {
|
|
75
|
+
requiredIds: number[] | string[];
|
|
76
|
+
selectedIds?: number[];
|
|
77
|
+
isHandlingSelectedIds: boolean;
|
|
78
|
+
selectedIdsUpdatedOnMount: boolean;
|
|
79
|
+
requiredParentsIds: number[] | string[];
|
|
80
|
+
alreadyOpenedIds: number[];
|
|
81
|
+
handlerUpdateSelectedIds: (nodeId: number, checked: boolean, isParent: boolean, required?: boolean, handling?: boolean) => void;
|
|
82
|
+
handlerToggleCheckChildren: (nodeId: number, check: boolean, required?: boolean) => void;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
declare type ItensMock = {
|
|
86
|
+
id?: number;
|
|
87
|
+
titulo: string;
|
|
88
|
+
codigo: string;
|
|
89
|
+
permissoes?: {
|
|
90
|
+
codigo: string;
|
|
91
|
+
}[];
|
|
92
|
+
itens: ItensMock[];
|
|
93
|
+
};
|
|
94
|
+
interface IDataMock {
|
|
95
|
+
id: number;
|
|
96
|
+
titulo: string;
|
|
97
|
+
codigo: string;
|
|
98
|
+
permissoes: {
|
|
99
|
+
codigo: string;
|
|
100
|
+
}[];
|
|
101
|
+
itens: ItensMock[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export { IDataMock, INodeElementsValidations, INodeValidationProps, ITreeHeaderProps, ITreeNodeProps, ITreeViewContext, ITreeviewProps, IValidator, NodeItem };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
9
7
|
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
14
|
var Header = function Header(props) {
|
|
15
15
|
var title = props.title,
|
|
16
16
|
customClass = props.customClass;
|
|
17
|
-
return /*#__PURE__*/_react
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
18
18
|
className: "treeviewheader ".concat(customClass)
|
|
19
|
-
}, /*#__PURE__*/_react
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
20
20
|
className: "title"
|
|
21
21
|
}, title));
|
|
22
22
|
};
|
|
@@ -26,8 +26,8 @@ Header.defaultProps = {
|
|
|
26
26
|
customClass: ''
|
|
27
27
|
};
|
|
28
28
|
Header.propTypes = {
|
|
29
|
-
title: _propTypes
|
|
30
|
-
customClass: _propTypes
|
|
29
|
+
title: _propTypes.default.string,
|
|
30
|
+
customClass: _propTypes.default.string
|
|
31
31
|
};
|
|
32
32
|
var _default = Header;
|
|
33
|
-
exports
|
|
33
|
+
exports.default = _default;
|
package/lib/treeview_old/Node.js
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/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); }
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
exports
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
8
|
+
exports.default = void 0;
|
|
23
9
|
|
|
24
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
25
11
|
|
|
@@ -31,25 +17,44 @@ var _icons = _interopRequireDefault(require("../icons"));
|
|
|
31
17
|
|
|
32
18
|
require("../assets/styles/treeview.scss");
|
|
33
19
|
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
34
22
|
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); }
|
|
35
23
|
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
24
|
+
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
|
+
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
27
|
|
|
38
|
-
function
|
|
28
|
+
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); } }
|
|
29
|
+
|
|
30
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
+
|
|
32
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
+
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
+
|
|
36
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
+
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
+
|
|
40
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
41
|
|
|
40
42
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
43
|
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
|
|
42
46
|
var TreeNode = /*#__PURE__*/function (_Component) {
|
|
43
|
-
(
|
|
47
|
+
_inherits(TreeNode, _Component);
|
|
44
48
|
|
|
45
49
|
var _super = _createSuper(TreeNode);
|
|
46
50
|
|
|
47
51
|
function TreeNode(props) {
|
|
48
52
|
var _this;
|
|
49
53
|
|
|
50
|
-
(
|
|
54
|
+
_classCallCheck(this, TreeNode);
|
|
55
|
+
|
|
51
56
|
_this = _super.call(this, props);
|
|
52
|
-
Object.defineProperty((
|
|
57
|
+
Object.defineProperty(_assertThisInitialized(_this), "openCloseTree", {
|
|
53
58
|
configurable: true,
|
|
54
59
|
enumerable: true,
|
|
55
60
|
writable: true,
|
|
@@ -65,7 +70,7 @@ var TreeNode = /*#__PURE__*/function (_Component) {
|
|
|
65
70
|
return _this;
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
(
|
|
73
|
+
_createClass(TreeNode, [{
|
|
69
74
|
key: "render",
|
|
70
75
|
value: function render() {
|
|
71
76
|
var _this$props = this.props,
|
|
@@ -74,28 +79,29 @@ var TreeNode = /*#__PURE__*/function (_Component) {
|
|
|
74
79
|
var span = '';
|
|
75
80
|
|
|
76
81
|
if (node.itens.length > 0) {
|
|
77
|
-
span = /*#__PURE__*/_react
|
|
82
|
+
span = /*#__PURE__*/_react.default.createElement("span", {
|
|
78
83
|
onKeyPress: null,
|
|
79
84
|
tabIndex: 0,
|
|
80
85
|
role: "button",
|
|
81
86
|
className: "opencloseicon",
|
|
82
87
|
onClick: this.openCloseTree
|
|
83
|
-
}, /*#__PURE__*/_react
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
84
89
|
name: this.state.isVisible ? 'up' : 'down',
|
|
85
90
|
size: 10
|
|
86
91
|
}));
|
|
87
92
|
}
|
|
88
93
|
|
|
89
|
-
return /*#__PURE__*/_react
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
90
95
|
className: "treeviewitem"
|
|
91
|
-
}, span, showCheckBox ? /*#__PURE__*/_react
|
|
96
|
+
}, span, showCheckBox ? /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
92
97
|
id: node.id,
|
|
93
98
|
label: node.titulo
|
|
94
|
-
}) : node.titulo, /*#__PURE__*/_react
|
|
99
|
+
}) : node.titulo, /*#__PURE__*/_react.default.createElement("ul", {
|
|
95
100
|
className: "nodelist"
|
|
96
101
|
}, this.state.isVisible && this.props.children));
|
|
97
102
|
}
|
|
98
103
|
}]);
|
|
104
|
+
|
|
99
105
|
return TreeNode;
|
|
100
106
|
}(_react.Component);
|
|
101
107
|
|
|
@@ -104,10 +110,10 @@ TreeNode.defaultProps = {
|
|
|
104
110
|
data: []
|
|
105
111
|
};
|
|
106
112
|
TreeNode.propTypes = {
|
|
107
|
-
showCheckBox: _propTypes
|
|
108
|
-
data: _propTypes
|
|
109
|
-
node: _propTypes
|
|
110
|
-
children: _propTypes
|
|
113
|
+
showCheckBox: _propTypes.default.bool,
|
|
114
|
+
data: _propTypes.default.arrayOf(_propTypes.default.element),
|
|
115
|
+
node: _propTypes.default.object.isRequired,
|
|
116
|
+
children: _propTypes.default.arrayOf(_propTypes.default.element).isRequired
|
|
111
117
|
};
|
|
112
118
|
var _default = TreeNode;
|
|
113
|
-
exports
|
|
119
|
+
exports.default = _default;
|