linear-react-components-ui 1.1.20-beta.33 → 1.1.20-beta.34
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/lib/@types/Align.d.ts +4 -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 +18 -0
- package/lib/alerts/AlertContainer.js +80 -0
- package/lib/alerts/AlertProvider.d.ts +9 -0
- package/lib/alerts/AlertProvider.js +73 -0
- package/lib/alerts/BaseAlert.d.ts +9 -0
- package/lib/alerts/BaseAlert.js +34 -0
- package/lib/alerts/Message.d.ts +9 -0
- package/lib/alerts/Message.js +114 -0
- package/lib/alerts/helpers.d.ts +9 -0
- package/lib/alerts/helpers.js +9 -0
- package/lib/alerts/index.d.ts +11 -0
- package/lib/alerts/index.js +16 -0
- package/lib/alerts/types.d.ts +51 -0
- package/lib/alerts/types.js +5 -0
- package/lib/alerts/withAlert.d.ts +9 -0
- package/lib/alerts/withAlert.js +24 -0
- package/lib/assets/fonts/Roboto-Black.woff +0 -0
- package/lib/assets/fonts/Roboto-Black.woff2 +0 -0
- package/lib/assets/fonts/Roboto-Bold.woff +0 -0
- package/lib/assets/fonts/Roboto-Bold.woff2 +0 -0
- package/lib/assets/fonts/Roboto-Light.woff +0 -0
- package/lib/assets/fonts/Roboto-Light.woff2 +0 -0
- package/lib/assets/fonts/Roboto-Medium.woff +0 -0
- package/lib/assets/fonts/Roboto-Medium.woff2 +0 -0
- package/lib/assets/fonts/Roboto-Regular.woff +0 -0
- package/lib/assets/fonts/Roboto-Regular.woff2 +0 -0
- package/lib/assets/fonts/Roboto-Thin.woff +0 -0
- package/lib/assets/fonts/Roboto-Thin.woff2 +0 -0
- package/lib/assets/fonts/TitilliumWeb-Black.woff +0 -0
- package/lib/assets/fonts/TitilliumWeb-Black.woff2 +0 -0
- package/lib/assets/fonts/TitilliumWeb-Bold.woff +0 -0
- package/lib/assets/fonts/TitilliumWeb-Bold.woff2 +0 -0
- package/lib/assets/fonts/TitilliumWeb-ExtraLight.woff +0 -0
- package/lib/assets/fonts/TitilliumWeb-ExtraLight.woff2 +0 -0
- package/lib/assets/fonts/TitilliumWeb-Light.woff +0 -0
- package/lib/assets/fonts/TitilliumWeb-Light.woff2 +0 -0
- package/lib/assets/fonts/TitilliumWeb-Regular.woff +0 -0
- package/lib/assets/fonts/TitilliumWeb-Regular.woff2 +0 -0
- package/lib/assets/fonts/TitilliumWeb-SemiBold.woff +0 -0
- package/lib/assets/fonts/TitilliumWeb-SemiBold.woff2 +0 -0
- package/lib/assets/images/logo.png +0 -0
- package/lib/assets/styles/alerts.scss +149 -0
- package/lib/assets/styles/avatar.scss +42 -0
- package/lib/assets/styles/badge.scss +48 -0
- package/lib/assets/styles/button.scss +345 -0
- package/lib/assets/styles/calendar.scss +172 -0
- package/lib/assets/styles/checkbox.scss +108 -0
- package/lib/assets/styles/colorpicker.scss +17 -0
- package/lib/assets/styles/colors.scss +144 -0
- package/lib/assets/styles/commons.scss +138 -0
- package/lib/assets/styles/datepicker.scss +16 -0
- package/lib/assets/styles/dialog.scss +200 -0
- package/lib/assets/styles/drawers.scss +159 -0
- package/lib/assets/styles/dropdown.scss +179 -0
- package/lib/assets/styles/effects.scss +823 -0
- package/lib/assets/styles/error.scss +9 -0
- package/lib/assets/styles/fieldset.scss +96 -0
- package/lib/assets/styles/file.scss +224 -0
- package/lib/assets/styles/floatMenu.scss +17 -0
- package/lib/assets/styles/fonts.scss +86 -0
- package/lib/assets/styles/form.scss +23 -0
- package/lib/assets/styles/gridlayout.scss +2054 -0
- package/lib/assets/styles/hint.scss +30 -0
- package/lib/assets/styles/icon.scss +42 -0
- package/lib/assets/styles/input.scss +156 -0
- package/lib/assets/styles/label.scss +116 -0
- package/lib/assets/styles/labelMessages.scss +81 -0
- package/lib/assets/styles/list.scss +124 -0
- package/lib/assets/styles/multiSelect.scss +125 -0
- package/lib/assets/styles/noPermission.scss +25 -0
- package/lib/assets/styles/numbers.scss +5 -0
- package/lib/assets/styles/panel.scss +95 -0
- package/lib/assets/styles/periodpicker.scss +69 -0
- package/lib/assets/styles/popover.scss +44 -0
- package/lib/assets/styles/progress.scss +72 -0
- package/lib/assets/styles/radio.scss +156 -0
- package/lib/assets/styles/search.scss +13 -0
- package/lib/assets/styles/select.scss +155 -0
- package/lib/assets/styles/shortcuts.scss +59 -0
- package/lib/assets/styles/sidenav.scss +408 -0
- package/lib/assets/styles/skeleton.scss +48 -0
- package/lib/assets/styles/spinner.scss +34 -0
- package/lib/assets/styles/split.scss +80 -0
- package/lib/assets/styles/table.scss +179 -0
- package/lib/assets/styles/tabs.scss +266 -0
- package/lib/assets/styles/textContent.scss +9 -0
- package/lib/assets/styles/toolbar.scss +74 -0
- package/lib/assets/styles/tooltip.scss +95 -0
- package/lib/assets/styles/treetable.scss +100 -0
- package/lib/assets/styles/treeview.scss +96 -0
- package/lib/assets/styles/uitour.scss +112 -0
- package/lib/assets/styles/wizard.scss +125 -0
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/index.js +91 -0
- 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 +30 -0
- package/lib/badge/types.d.ts +13 -0
- package/lib/badge/types.js +5 -0
- package/lib/buttons/ActivateButton.d.ts +11 -0
- package/lib/buttons/ActivateButton.js +14 -0
- package/lib/buttons/AddButton.d.ts +11 -0
- package/lib/buttons/AddButton.js +18 -0
- package/lib/buttons/Button.d.ts +14 -0
- package/lib/buttons/Button.js +23 -0
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/ButtonGroups.js +17 -0
- package/lib/buttons/CancelButton.d.ts +11 -0
- package/lib/buttons/CancelButton.js +23 -0
- package/lib/buttons/DangerButton.d.ts +11 -0
- package/lib/buttons/DangerButton.js +23 -0
- package/lib/buttons/DefaultButton.d.ts +14 -0
- package/lib/buttons/DefaultButton.js +176 -0
- package/lib/buttons/DestroyButton.d.ts +11 -0
- package/lib/buttons/DestroyButton.js +27 -0
- package/lib/buttons/EditButton.d.ts +11 -0
- package/lib/buttons/EditButton.js +14 -0
- package/lib/buttons/InactivateButton.d.ts +11 -0
- package/lib/buttons/InactivateButton.js +14 -0
- package/lib/buttons/InfoButton.d.ts +11 -0
- package/lib/buttons/InfoButton.js +23 -0
- package/lib/buttons/PrimaryButton.d.ts +11 -0
- package/lib/buttons/PrimaryButton.js +23 -0
- package/lib/buttons/RestoreButton.d.ts +11 -0
- package/lib/buttons/RestoreButton.js +14 -0
- package/lib/buttons/SaveButton.d.ts +11 -0
- package/lib/buttons/SaveButton.js +23 -0
- package/lib/buttons/SuccessButton.d.ts +11 -0
- package/lib/buttons/SuccessButton.js +23 -0
- package/lib/buttons/WarningButton.d.ts +11 -0
- package/lib/buttons/WarningButton.js +23 -0
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/button_container/index.js +30 -0
- package/lib/buttons/index.d.ts +26 -0
- package/lib/buttons/index.js +108 -0
- package/lib/buttons/split_button/index.d.ts +11 -0
- package/lib/buttons/split_button/index.js +57 -0
- package/lib/buttons/types.d.ts +49 -0
- package/lib/buttons/types.js +5 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/DangerCalendar.js +23 -0
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.js +23 -0
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.js +23 -0
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.js +23 -0
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.js +23 -0
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Day.js +32 -0
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Month.js +37 -0
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/Week.js +35 -0
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +117 -0
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/base/index.js +79 -0
- package/lib/calendar/index.d.ts +13 -0
- package/lib/calendar/index.js +44 -0
- package/lib/calendar/types.d.ts +25 -0
- package/lib/calendar/types.js +5 -0
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +145 -0
- package/lib/checkbox/types.d.ts +47 -0
- package/lib/checkbox/types.js +5 -0
- package/lib/dialog/Alert.d.ts +9 -0
- package/lib/dialog/Alert.js +28 -0
- package/lib/dialog/Custom.d.ts +9 -0
- package/lib/dialog/Custom.js +56 -0
- package/lib/dialog/Error.d.ts +9 -0
- package/lib/dialog/Error.js +28 -0
- package/lib/dialog/Information.d.ts +9 -0
- package/lib/dialog/Information.js +28 -0
- package/lib/dialog/Question.d.ts +9 -0
- package/lib/dialog/Question.js +60 -0
- package/lib/dialog/Warning.d.ts +9 -0
- package/lib/dialog/Warning.js +28 -0
- package/lib/dialog/base/Content.d.ts +9 -0
- package/lib/dialog/base/Content.js +22 -0
- package/lib/dialog/base/Footer.d.ts +9 -0
- package/lib/dialog/base/Footer.js +12 -0
- package/lib/dialog/base/Header.d.ts +9 -0
- package/lib/dialog/base/Header.js +59 -0
- package/lib/dialog/base/index.d.ts +15 -0
- package/lib/dialog/base/index.js +157 -0
- package/lib/dialog/base/style.js +13 -0
- package/lib/dialog/form/index.d.ts +10 -0
- package/lib/dialog/form/index.js +84 -0
- package/lib/dialog/index.d.ts +16 -0
- package/lib/dialog/index.js +51 -0
- package/lib/dialog/types.d.ts +105 -0
- package/lib/dialog/types.js +5 -0
- package/lib/dialog/wizard/index.d.ts +13 -0
- package/lib/dialog/wizard/index.js +74 -0
- package/lib/dialog/wizard/progressbar.d.ts +13 -0
- package/lib/dialog/wizard/progressbar.js +36 -0
- package/lib/dialog/wizard/step.d.ts +9 -0
- package/lib/dialog/wizard/step.js +22 -0
- package/lib/dialog/wizard/useWizard.d.ts +9 -0
- package/lib/dialog/wizard/useWizard.js +48 -0
- package/lib/drawer/Content.d.ts +10 -0
- package/lib/drawer/Content.js +26 -0
- package/lib/drawer/Drawer.d.ts +10 -0
- package/lib/drawer/Drawer.js +138 -0
- package/lib/drawer/Header.d.ts +10 -0
- package/lib/drawer/Header.js +76 -0
- package/lib/drawer/helpers.d.ts +10 -0
- package/lib/drawer/helpers.js +10 -0
- package/lib/drawer/index.d.ts +12 -0
- package/lib/drawer/index.js +25 -0
- package/lib/drawer/types.d.ts +41 -0
- package/lib/drawer/types.js +5 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +69 -0
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/helper.js +16 -0
- package/lib/dropdown/types.d.ts +44 -0
- package/lib/dropdown/types.js +5 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +92 -0
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +83 -0
- package/lib/fieldset/types.d.ts +30 -0
- package/lib/fieldset/types.js +5 -0
- package/lib/form/Field.d.ts +14 -0
- package/lib/form/Field.js +118 -0
- package/lib/form/FieldArray.d.ts +14 -0
- package/lib/form/FieldArray.js +105 -0
- package/lib/form/FieldNumber.d.ts +14 -0
- package/lib/form/FieldNumber.js +68 -0
- package/lib/form/FieldPeriod.d.ts +14 -0
- package/lib/form/FieldPeriod.js +98 -0
- package/lib/form/helpers.d.ts +19 -0
- package/lib/form/helpers.js +50 -0
- package/lib/form/index.d.ts +18 -0
- package/lib/form/index.js +283 -0
- package/lib/form/types.d.ts +243 -0
- package/lib/form/types.js +5 -0
- package/lib/form/withFieldHOC.d.ts +14 -0
- package/lib/form/withFieldHOC.js +71 -0
- package/lib/form/withFormSecurity.d.ts +15 -0
- package/lib/form/withFormSecurity.js +55 -0
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridCol.js +34 -0
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/GridRow.js +34 -0
- package/lib/gridlayout/index.d.ts +8 -0
- package/lib/gridlayout/index.js +16 -0
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/gridlayout/types.js +5 -0
- package/lib/hint/helpers.d.ts +3 -0
- package/lib/hint/helpers.js +21 -0
- package/lib/hint/index.d.ts +7 -0
- package/lib/hint/index.js +36 -0
- package/lib/hint/types.d.ts +14 -0
- package/lib/hint/types.js +5 -0
- package/lib/icons/helper.d.ts +636 -0
- package/lib/icons/helper.js +640 -0
- package/lib/icons/index.d.ts +15 -0
- package/lib/icons/index.js +71 -0
- package/lib/icons/types.d.ts +49 -0
- package/lib/icons/types.js +5 -0
- package/lib/index.d.ts +39 -0
- package/lib/index.js +69 -0
- package/lib/inputs/base/InputTextBase.d.ts +11 -0
- package/lib/inputs/base/InputTextBase.js +261 -0
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +17 -0
- package/lib/inputs/base/helpers.js +46 -0
- package/lib/inputs/base/types.d.ts +100 -0
- package/lib/inputs/base/types.js +5 -0
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/index.js +95 -0
- package/lib/inputs/color/types.d.ts +19 -0
- package/lib/inputs/color/types.js +5 -0
- package/lib/inputs/date/Dialog.d.ts +13 -0
- package/lib/inputs/date/Dialog.js +25 -0
- package/lib/inputs/date/Dropdown.d.ts +13 -0
- package/lib/inputs/date/Dropdown.js +32 -0
- package/lib/inputs/date/helpers.d.ts +17 -0
- package/lib/inputs/date/helpers.js +31 -0
- package/lib/inputs/date/index.d.ts +13 -0
- package/lib/inputs/date/index.js +251 -0
- package/lib/inputs/date/types.d.ts +62 -0
- package/lib/inputs/date/types.js +5 -0
- package/lib/inputs/errorMessage/index.d.ts +16 -0
- package/lib/inputs/errorMessage/index.js +26 -0
- package/lib/inputs/file/DefaultFile.d.ts +13 -0
- package/lib/inputs/file/DefaultFile.js +80 -0
- package/lib/inputs/file/DragDropFile.d.ts +13 -0
- package/lib/inputs/file/DragDropFile.js +272 -0
- package/lib/inputs/file/File.d.ts +13 -0
- package/lib/inputs/file/File.js +63 -0
- package/lib/inputs/file/FileButtonSettings.d.ts +13 -0
- package/lib/inputs/file/FileButtonSettings.js +34 -0
- package/lib/inputs/file/helpers.d.ts +13 -0
- package/lib/inputs/file/helpers.js +21 -0
- package/lib/inputs/file/index.d.ts +16 -0
- package/lib/inputs/file/index.js +24 -0
- package/lib/inputs/file/types.d.ts +57 -0
- package/lib/inputs/file/types.js +5 -0
- package/lib/inputs/inputHOC.d.ts +16 -0
- package/lib/inputs/inputHOC.js +44 -0
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/BaseMask.js +167 -0
- package/lib/inputs/mask/Cnpj.d.ts +15 -0
- package/lib/inputs/mask/Cnpj.js +60 -0
- package/lib/inputs/mask/Cpf.d.ts +15 -0
- package/lib/inputs/mask/Cpf.js +57 -0
- package/lib/inputs/mask/Phone.d.ts +12 -0
- package/lib/inputs/mask/Phone.js +19 -0
- package/lib/inputs/mask/ZipCode.d.ts +12 -0
- package/lib/inputs/mask/ZipCode.js +14 -0
- package/lib/inputs/mask/helpers.d.ts +62 -0
- package/lib/inputs/mask/helpers.js +138 -0
- package/lib/inputs/mask/index.d.ts +17 -0
- package/lib/inputs/mask/index.js +37 -0
- package/lib/inputs/mask/types.d.ts +79 -0
- package/lib/inputs/mask/types.js +5 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +13 -0
- package/lib/inputs/multiSelect/ActionButtons.js +51 -0
- package/lib/inputs/multiSelect/Dropdown.d.ts +13 -0
- package/lib/inputs/multiSelect/Dropdown.js +136 -0
- package/lib/inputs/multiSelect/helper.d.ts +13 -0
- package/lib/inputs/multiSelect/helper.js +20 -0
- package/lib/inputs/multiSelect/index.d.ts +13 -0
- package/lib/inputs/multiSelect/index.js +218 -0
- package/lib/inputs/multiSelect/types.d.ts +65 -0
- package/lib/inputs/multiSelect/types.js +5 -0
- package/lib/inputs/number/BaseNumber.d.ts +17 -0
- package/lib/inputs/number/BaseNumber.js +70 -0
- package/lib/inputs/number/Currency.d.ts +17 -0
- package/lib/inputs/number/Currency.js +22 -0
- package/lib/inputs/number/Decimal.d.ts +17 -0
- package/lib/inputs/number/Decimal.js +11 -0
- package/lib/inputs/number/format_number.d.ts +5 -0
- package/lib/inputs/number/format_number.js +27 -0
- package/lib/inputs/number/index.d.ts +19 -0
- package/lib/inputs/number/index.js +64 -0
- package/lib/inputs/number/types.d.ts +39 -0
- package/lib/inputs/number/types.js +5 -0
- package/lib/inputs/period/Dialog.d.ts +14 -0
- package/lib/inputs/period/Dialog.js +25 -0
- package/lib/inputs/period/Dropdown.d.ts +14 -0
- package/lib/inputs/period/Dropdown.js +28 -0
- package/lib/inputs/period/PeriodList.d.ts +14 -0
- package/lib/inputs/period/PeriodList.js +61 -0
- package/lib/inputs/period/helper.d.ts +22 -0
- package/lib/inputs/period/helper.js +66 -0
- package/lib/inputs/period/index.d.ts +14 -0
- package/lib/inputs/period/index.js +423 -0
- package/lib/inputs/period/types.d.ts +73 -0
- package/lib/inputs/period/types.js +5 -0
- package/lib/inputs/search/index.d.ts +16 -0
- package/lib/inputs/search/index.js +129 -0
- package/lib/inputs/select/ActionButtons.d.ts +16 -0
- package/lib/inputs/select/ActionButtons.js +38 -0
- package/lib/inputs/select/Dropdown.d.ts +16 -0
- package/lib/inputs/select/Dropdown.js +112 -0
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/helper.js +108 -0
- package/lib/inputs/select/index.d.ts +13 -0
- package/lib/inputs/select/index.js +42 -0
- package/lib/inputs/select/multiple/Selecteds.d.ts +13 -0
- package/lib/inputs/select/multiple/Selecteds.js +25 -0
- package/lib/inputs/select/multiple/index.d.ts +13 -0
- package/lib/inputs/select/multiple/index.js +276 -0
- package/lib/inputs/select/simple/index.d.ts +13 -0
- package/lib/inputs/select/simple/index.js +302 -0
- package/lib/inputs/select/types.d.ts +119 -0
- package/lib/inputs/select/types.js +5 -0
- package/lib/inputs/text/index.d.ts +12 -0
- package/lib/inputs/text/index.js +13 -0
- package/lib/inputs/text/types.d.ts +25 -0
- package/lib/inputs/text/types.js +5 -0
- package/lib/inputs/textarea/index.d.ts +12 -0
- package/lib/inputs/textarea/index.js +25 -0
- package/lib/inputs/textarea/types.d.ts +16 -0
- package/lib/inputs/textarea/types.js +5 -0
- package/lib/inputs/types.d.ts +157 -0
- package/lib/inputs/types.js +5 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/colorStyles.js +14 -0
- package/lib/internals/constants.d.ts +11 -0
- package/lib/internals/constants.js +15 -0
- package/lib/internals/types.d.ts +25 -0
- package/lib/internals/types.js +5 -0
- package/lib/internals/withTooltip.d.ts +12 -0
- package/lib/internals/withTooltip.js +172 -0
- package/lib/labelMessages/index.d.ts +9 -0
- package/lib/labelMessages/index.js +60 -0
- package/lib/labelMessages/types.d.ts +20 -0
- package/lib/labelMessages/types.js +5 -0
- package/lib/labels/DangerLabel.d.ts +11 -0
- package/lib/labels/DangerLabel.js +23 -0
- package/lib/labels/DefaultLabel.d.ts +14 -0
- package/lib/labels/DefaultLabel.js +55 -0
- package/lib/labels/InfoLabel.d.ts +11 -0
- package/lib/labels/InfoLabel.js +23 -0
- package/lib/labels/PrimaryLabel.d.ts +11 -0
- package/lib/labels/PrimaryLabel.js +23 -0
- package/lib/labels/SuccessLabel.d.ts +11 -0
- package/lib/labels/SuccessLabel.js +23 -0
- package/lib/labels/WarningLabel.d.ts +11 -0
- package/lib/labels/WarningLabel.js +23 -0
- package/lib/labels/index.d.ts +18 -0
- package/lib/labels/index.js +52 -0
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/label_container/index.js +22 -0
- package/lib/labels/types.d.ts +26 -0
- package/lib/labels/types.js +5 -0
- package/lib/list/Header.d.ts +10 -0
- package/lib/list/Header.js +23 -0
- package/lib/list/Item.d.ts +13 -0
- package/lib/list/Item.js +162 -0
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/Separator.js +12 -0
- package/lib/list/helpers.d.ts +15 -0
- package/lib/list/helpers.js +14 -0
- package/lib/list/index.d.ts +13 -0
- package/lib/list/index.js +182 -0
- package/lib/list/types.d.ts +73 -0
- package/lib/list/types.js +5 -0
- package/lib/menus/float/MenuItem.d.ts +9 -0
- package/lib/menus/float/MenuItem.js +69 -0
- package/lib/menus/float/SubMenuContainer.js +77 -0
- package/lib/menus/float/helpers.d.ts +9 -0
- package/lib/menus/float/helpers.js +10 -0
- package/lib/menus/float/index.d.ts +40 -0
- package/lib/menus/float/index.js +68 -0
- package/lib/menus/float/types.d.ts +30 -0
- package/lib/menus/float/types.js +5 -0
- package/lib/menus/index.d.ts +12 -0
- package/lib/menus/index.js +9 -0
- package/lib/menus/sidenav/ExpandMenu.d.ts +12 -0
- package/lib/menus/sidenav/ExpandMenu.js +27 -0
- package/lib/menus/sidenav/MenuLink.d.ts +15 -0
- package/lib/menus/sidenav/MenuLink.js +29 -0
- package/lib/menus/sidenav/NavMenuGroup.d.ts +12 -0
- package/lib/menus/sidenav/NavMenuGroup.js +26 -0
- package/lib/menus/sidenav/NavMenuItem.d.ts +15 -0
- package/lib/menus/sidenav/NavMenuItem.js +150 -0
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +12 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +43 -0
- package/lib/menus/sidenav/helpers.d.ts +14 -0
- package/lib/menus/sidenav/helpers.js +18 -0
- package/lib/menus/sidenav/index.d.ts +16 -0
- package/lib/menus/sidenav/index.js +184 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +12 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +26 -0
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +12 -0
- package/lib/menus/sidenav/popup_menu_search/index.js +116 -0
- package/lib/menus/sidenav/types.d.ts +90 -0
- package/lib/menus/sidenav/types.js +5 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/noPermission/index.js +23 -0
- package/lib/panel/Content.d.ts +10 -0
- package/lib/panel/Content.js +79 -0
- package/lib/panel/DangerPanel.d.ts +10 -0
- package/lib/panel/DangerPanel.js +15 -0
- package/lib/panel/Default.d.ts +10 -0
- package/lib/panel/Default.js +67 -0
- package/lib/panel/Header.d.ts +10 -0
- package/lib/panel/Header.js +77 -0
- package/lib/panel/InfoPanel.d.ts +10 -0
- package/lib/panel/InfoPanel.js +15 -0
- package/lib/panel/PrimaryPanel.d.ts +10 -0
- package/lib/panel/PrimaryPanel.js +15 -0
- package/lib/panel/SuccessPanel.d.ts +10 -0
- package/lib/panel/SuccessPanel.js +15 -0
- package/lib/panel/ToolBar.d.ts +10 -0
- package/lib/panel/ToolBar.js +22 -0
- package/lib/panel/WarningPanel.d.ts +10 -0
- package/lib/panel/WarningPanel.js +15 -0
- package/lib/panel/helpers.d.ts +11 -0
- package/lib/panel/helpers.js +25 -0
- package/lib/panel/index.d.ts +18 -0
- package/lib/panel/index.js +59 -0
- package/lib/panel/types.d.ts +47 -0
- package/lib/panel/types.js +5 -0
- package/lib/permissionValidations.d.ts +14 -0
- package/lib/permissionValidations.js +59 -0
- package/lib/popover/PopoverText.d.ts +10 -0
- package/lib/popover/PopoverText.js +20 -0
- package/lib/popover/PopoverTitle.d.ts +10 -0
- package/lib/popover/PopoverTitle.js +17 -0
- package/lib/popover/index.d.ts +15 -0
- package/lib/popover/index.js +63 -0
- package/lib/popover/types.d.ts +24 -0
- package/lib/popover/types.js +5 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/Bar.js +74 -0
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/index.js +38 -0
- package/lib/progress/types.d.ts +37 -0
- package/lib/progress/types.js +5 -0
- package/lib/radio/index.d.ts +13 -0
- package/lib/radio/index.js +113 -0
- package/lib/radio/types.d.ts +28 -0
- package/lib/radio/types.js +5 -0
- package/lib/shortcuts/index.d.ts +7 -0
- package/lib/shortcuts/index.js +28 -0
- package/lib/shortcuts/types.d.ts +12 -0
- package/lib/shortcuts/types.js +5 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +23 -0
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +54 -0
- 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 +219 -0
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/index.js +60 -0
- 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 +292 -0
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/SplitSide.js +42 -0
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/helpers.js +10 -0
- package/lib/split/index.d.ts +8 -0
- package/lib/split/index.js +17 -0
- 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 +71 -0
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +90 -0
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +55 -0
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +78 -0
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +81 -0
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/helpers.js +15 -0
- package/lib/table/index.d.ts +11 -0
- package/lib/table/index.js +154 -0
- package/lib/table/types.d.ts +97 -0
- package/lib/table/types.js +5 -0
- package/lib/tabs/DropdownTabs.d.ts +11 -0
- package/lib/tabs/DropdownTabs.js +73 -0
- package/lib/tabs/Menu.d.ts +11 -0
- package/lib/tabs/Menu.js +46 -0
- package/lib/tabs/MenuTabs.d.ts +11 -0
- package/lib/tabs/MenuTabs.js +84 -0
- package/lib/tabs/Panel.d.ts +11 -0
- package/lib/tabs/Panel.js +84 -0
- package/lib/tabs/context.d.ts +12 -0
- package/lib/tabs/context.js +127 -0
- package/lib/tabs/index.d.ts +12 -0
- package/lib/tabs/index.js +70 -0
- package/lib/tabs/tabHelpers.d.ts +12 -0
- package/lib/tabs/tabHelpers.js +75 -0
- package/lib/tabs/types.d.ts +98 -0
- package/lib/tabs/types.js +5 -0
- package/lib/tabs/useTabs.d.ts +11 -0
- package/lib/tabs/useTabs.js +11 -0
- package/lib/textContent/index.d.ts +22 -0
- package/lib/textContent/index.js +42 -0
- package/lib/toolbar/ButtonBar.d.ts +12 -0
- package/lib/toolbar/ButtonBar.js +66 -0
- package/lib/toolbar/LabelBar.d.ts +12 -0
- package/lib/toolbar/LabelBar.js +58 -0
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/Separator.js +12 -0
- package/lib/toolbar/ToolBarGroup.d.ts +12 -0
- package/lib/toolbar/ToolBarGroup.js +19 -0
- package/lib/toolbar/helpers.d.ts +12 -0
- package/lib/toolbar/helpers.js +9 -0
- package/lib/toolbar/index.d.ts +16 -0
- package/lib/toolbar/index.js +65 -0
- package/lib/toolbar/types.d.ts +46 -0
- package/lib/toolbar/types.js +5 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/index.js +63 -0
- package/lib/tooltip/types.d.ts +17 -0
- package/lib/tooltip/types.js +5 -0
- package/lib/treetable/Body.d.ts +3 -0
- package/lib/treetable/Body.js +34 -0
- package/lib/treetable/Header.d.ts +3 -0
- package/lib/treetable/Header.js +24 -0
- package/lib/treetable/Row.d.ts +7 -0
- package/lib/treetable/Row.js +209 -0
- package/lib/treetable/helpers.d.ts +19 -0
- package/lib/treetable/helpers.js +32 -0
- package/lib/treetable/index.d.ts +8 -0
- package/lib/treetable/index.js +28 -0
- package/lib/treetable/types.d.js +5 -0
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Header.js +21 -0
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +245 -0
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +9 -0
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +320 -0
- package/lib/treeview/types.d.ts +108 -0
- package/lib/treeview/types.js +5 -0
- package/lib/types.d-73cece43.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/helpers.js +12 -0
- package/lib/uitour/index.d.ts +7 -0
- package/lib/uitour/index.js +255 -0
- package/lib/uitour/types.d.ts +38 -0
- package/lib/uitour/types.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
require("../assets/styles/treetable.scss");
|
|
9
|
+
var _table = _interopRequireDefault(require("../table"));
|
|
10
|
+
var _Body = _interopRequireDefault(require("./Body"));
|
|
11
|
+
var _Header = _interopRequireDefault(require("./Header"));
|
|
12
|
+
var _helpers = require("./helpers");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
const TreeTable = props => {
|
|
21
|
+
const contextValues = _objectSpread({}, props);
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_helpers.TreeTableContext.Provider, {
|
|
23
|
+
value: contextValues
|
|
24
|
+
}, /*#__PURE__*/_react.default.createElement(_table.default, _extends({}, props, {
|
|
25
|
+
onColClick: () => {}
|
|
26
|
+
}), /*#__PURE__*/_react.default.createElement(_Header.default, null), /*#__PURE__*/_react.default.createElement(_Body.default, null)));
|
|
27
|
+
};
|
|
28
|
+
var _default = exports.default = TreeTable;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const Header = props => {
|
|
10
|
+
const {
|
|
11
|
+
title,
|
|
12
|
+
customClass,
|
|
13
|
+
children
|
|
14
|
+
} = props;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
16
|
+
className: `treeviewheader ${customClass}`
|
|
17
|
+
}, title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
18
|
+
className: "title"
|
|
19
|
+
}, title) : children);
|
|
20
|
+
};
|
|
21
|
+
var _default = exports.default = Header;
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var uuid = _interopRequireWildcard(require("uuid"));
|
|
9
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
+
var _checkbox = _interopRequireDefault(require("../checkbox"));
|
|
11
|
+
var _icons = _interopRequireDefault(require("../icons"));
|
|
12
|
+
var _constants = require("./constants");
|
|
13
|
+
var _buttons = _interopRequireDefault(require("../buttons"));
|
|
14
|
+
var _list = _interopRequireWildcard(require("../list"));
|
|
15
|
+
var _toolbar = _interopRequireWildcard(require("../toolbar"));
|
|
16
|
+
var _SpinnerLoading = _interopRequireDefault(require("../spinner/SpinnerLoading"));
|
|
17
|
+
const _excluded = ["validationKey", "onNodeElementClick"];
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
27
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
28
|
+
const nodeHasItens = node => !!(node.itens && node.itens.length > 0);
|
|
29
|
+
const TreeNode = props => {
|
|
30
|
+
const {
|
|
31
|
+
startNodesOpened,
|
|
32
|
+
isParent = false,
|
|
33
|
+
nodeToolbarElements,
|
|
34
|
+
nodeRightElements,
|
|
35
|
+
idsInLoading = [],
|
|
36
|
+
handlerOnNodeOpen,
|
|
37
|
+
nodeElementsValidations,
|
|
38
|
+
onNodeClick,
|
|
39
|
+
children,
|
|
40
|
+
nodeMenuButtonSize = 'small',
|
|
41
|
+
selectedNodeId,
|
|
42
|
+
alwaysShowArrow = false,
|
|
43
|
+
customClass = '',
|
|
44
|
+
customStyle
|
|
45
|
+
} = props;
|
|
46
|
+
const [node, setNode] = (0, _react.useState)(props.node);
|
|
47
|
+
const [isVisible, setIsVisible] = (0, _react.useState)(startNodesOpened && nodeHasItens(node));
|
|
48
|
+
const [wasOpened, setWasOpened] = (0, _react.useState)(startNodesOpened && nodeHasItens(node));
|
|
49
|
+
const [showNodeElements, setShowNodeElements] = (0, _react.useState)(false);
|
|
50
|
+
const [keepMenuOpened, setKeepMenuOpened] = (0, _react.useState)(false);
|
|
51
|
+
const labelRef = (0, _react.useRef)(null);
|
|
52
|
+
const {
|
|
53
|
+
valuePropName,
|
|
54
|
+
labelPropName,
|
|
55
|
+
selectedIds,
|
|
56
|
+
handlerUpdateSelectedIds,
|
|
57
|
+
showCheckBox,
|
|
58
|
+
requiredIds,
|
|
59
|
+
disabled,
|
|
60
|
+
handlerToggleCheckChildren,
|
|
61
|
+
allowCheckAllChildren,
|
|
62
|
+
requiredParentsIds,
|
|
63
|
+
defaultDisabledTooltip
|
|
64
|
+
} = (0, _react.useContext)(_constants.TreeviewContext);
|
|
65
|
+
const requiredNodes = [...requiredIds, ...requiredParentsIds];
|
|
66
|
+
const required = requiredNodes.includes(node[valuePropName]);
|
|
67
|
+
const checked = selectedIds && selectedIds.includes(node[valuePropName]) || required;
|
|
68
|
+
if (node !== props.node) {
|
|
69
|
+
setNode(props.node);
|
|
70
|
+
}
|
|
71
|
+
const openCloseTree = currentNode => {
|
|
72
|
+
if (!wasOpened && handlerOnNodeOpen) {
|
|
73
|
+
setWasOpened(true);
|
|
74
|
+
handlerOnNodeOpen(currentNode);
|
|
75
|
+
}
|
|
76
|
+
setIsVisible(prevState => !prevState);
|
|
77
|
+
};
|
|
78
|
+
const getSpan = () => {
|
|
79
|
+
const isLoading = idsInLoading.includes(node.id);
|
|
80
|
+
let span = /*#__PURE__*/_react.default.createElement("noscript", null);
|
|
81
|
+
if (node.itens && node.itens.length > 0 || alwaysShowArrow) {
|
|
82
|
+
span = /*#__PURE__*/_react.default.createElement("span", {
|
|
83
|
+
tabIndex: 0,
|
|
84
|
+
role: "button",
|
|
85
|
+
className: isLoading ? 'loading' : 'opencloseicon',
|
|
86
|
+
onClick: () => openCloseTree(node)
|
|
87
|
+
}, isLoading ? /*#__PURE__*/_react.default.createElement(_SpinnerLoading.default, {
|
|
88
|
+
size: "35px"
|
|
89
|
+
}) : /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
90
|
+
name: isVisible ? 'down' : 'arrow_right',
|
|
91
|
+
size: 10
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return span;
|
|
95
|
+
};
|
|
96
|
+
const handleShowNodeElements = function () {
|
|
97
|
+
let enter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
98
|
+
if (!showNodeElements) {
|
|
99
|
+
setShowNodeElements(true);
|
|
100
|
+
} else if (showNodeElements && !keepMenuOpened && !enter) {
|
|
101
|
+
setShowNodeElements(false);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const validateNodeElement = validationKey => {
|
|
105
|
+
const validations = nodeElementsValidations && nodeElementsValidations[validationKey];
|
|
106
|
+
const options = {
|
|
107
|
+
disabled: {
|
|
108
|
+
disabled: true
|
|
109
|
+
},
|
|
110
|
+
unvisible: {
|
|
111
|
+
visible: false
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
let elementBehavior = {};
|
|
115
|
+
if (validations) {
|
|
116
|
+
validations.forEach(validation => {
|
|
117
|
+
const {
|
|
118
|
+
validator,
|
|
119
|
+
applyBehavior
|
|
120
|
+
} = validation;
|
|
121
|
+
if (_lodash.default.isEmpty(elementBehavior) && validator && validator(node)) {
|
|
122
|
+
elementBehavior = options[applyBehavior ?? 'unvisible'];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return elementBehavior;
|
|
127
|
+
};
|
|
128
|
+
const updateElements = elements => {
|
|
129
|
+
let updatedElements = [];
|
|
130
|
+
if (elements) {
|
|
131
|
+
updatedElements = _react.default.Children.map(elements, element => {
|
|
132
|
+
if (/*#__PURE__*/_react.default.isValidElement(element) && element.props) {
|
|
133
|
+
const _element$props = element.props,
|
|
134
|
+
{
|
|
135
|
+
validationKey,
|
|
136
|
+
onNodeElementClick
|
|
137
|
+
} = _element$props,
|
|
138
|
+
rest = _objectWithoutProperties(_element$props, _excluded);
|
|
139
|
+
let elementBehavior;
|
|
140
|
+
let newProps = {};
|
|
141
|
+
if (nodeElementsValidations && validationKey) {
|
|
142
|
+
elementBehavior = validateNodeElement(validationKey);
|
|
143
|
+
}
|
|
144
|
+
if (onNodeElementClick) {
|
|
145
|
+
newProps = _objectSpread(_objectSpread({}, newProps), {}, {
|
|
146
|
+
onClick: e => {
|
|
147
|
+
onNodeElementClick(node);
|
|
148
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
const newElement = /*#__PURE__*/_react.default.createElement(element.type, _objectSpread(_objectSpread(_objectSpread({}, rest), newProps), elementBehavior));
|
|
153
|
+
return newElement;
|
|
154
|
+
}
|
|
155
|
+
return element;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return updatedElements;
|
|
159
|
+
};
|
|
160
|
+
const returnNodeRightElements = () => {
|
|
161
|
+
const updatedNodeRightElements = updateElements(nodeRightElements).map(element => {
|
|
162
|
+
const unvisible = element.props && 'visible' in element.props && !element.props.visible;
|
|
163
|
+
const style = unvisible ? {
|
|
164
|
+
display: 'none'
|
|
165
|
+
} : {};
|
|
166
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
167
|
+
style: style,
|
|
168
|
+
key: `element-${uuid.v1()}`,
|
|
169
|
+
className: "element"
|
|
170
|
+
}, element);
|
|
171
|
+
});
|
|
172
|
+
return updatedNodeRightElements.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
+
className: "node-rightelements"
|
|
174
|
+
}, updatedNodeRightElements) : null;
|
|
175
|
+
};
|
|
176
|
+
const returnNodeToolbarElements = () => {
|
|
177
|
+
const updatedNodeRightElements = updateElements(nodeToolbarElements);
|
|
178
|
+
return updatedNodeRightElements.length > 0 ? /*#__PURE__*/_react.default.createElement(_toolbar.default, {
|
|
179
|
+
customClass: "node-toolbarelements"
|
|
180
|
+
}, /*#__PURE__*/_react.default.createElement(_toolbar.ToolBarGroup, null, updatedNodeRightElements)) : null;
|
|
181
|
+
};
|
|
182
|
+
(0, _react.useEffect)(() => {
|
|
183
|
+
setIsVisible(startNodesOpened && nodeHasItens(node));
|
|
184
|
+
setWasOpened(startNodesOpened && nodeHasItens(node));
|
|
185
|
+
}, [node]);
|
|
186
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
187
|
+
style: customStyle,
|
|
188
|
+
className: `treeviewitem ${customClass}`
|
|
189
|
+
}, getSpan(), /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
+
className: "label",
|
|
191
|
+
style: {
|
|
192
|
+
textDecoration: !onNodeClick ? 'none' : undefined,
|
|
193
|
+
backgroundColor: selectedNodeId === node.id ? 'rgb(209, 209, 209)' : undefined
|
|
194
|
+
},
|
|
195
|
+
ref: labelRef,
|
|
196
|
+
role: "button",
|
|
197
|
+
onKeyPress: () => {},
|
|
198
|
+
onMouseEnter: () => handleShowNodeElements(),
|
|
199
|
+
onMouseLeave: () => handleShowNodeElements(false),
|
|
200
|
+
tabIndex: -1,
|
|
201
|
+
onClick: onNodeClick ? () => onNodeClick(node) : undefined
|
|
202
|
+
}, showCheckBox ? /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
203
|
+
checked: checked,
|
|
204
|
+
disabled: required || disabled,
|
|
205
|
+
value: `${node[valuePropName]}`,
|
|
206
|
+
label: node[labelPropName],
|
|
207
|
+
tooltip: required ? defaultDisabledTooltip : '',
|
|
208
|
+
onChange: disabled || required ? undefined : e => {
|
|
209
|
+
handlerUpdateSelectedIds(node.id, e.target.checked, !!isParent);
|
|
210
|
+
}
|
|
211
|
+
}) : node[labelPropName], allowCheckAllChildren && showNodeElements && isParent ? /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
212
|
+
dropdown: true,
|
|
213
|
+
dropdownAlign: "left",
|
|
214
|
+
size: nodeMenuButtonSize,
|
|
215
|
+
showIconDropdown: false,
|
|
216
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
217
|
+
name: "menu",
|
|
218
|
+
style: {
|
|
219
|
+
margin: 0
|
|
220
|
+
}
|
|
221
|
+
}),
|
|
222
|
+
customClass: "node-menu",
|
|
223
|
+
boxShadow: false,
|
|
224
|
+
onClick: () => setKeepMenuOpened(prevState => !prevState)
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement(_list.default, {
|
|
226
|
+
condensed: true
|
|
227
|
+
}, /*#__PURE__*/_react.default.createElement(_list.ListItem, {
|
|
228
|
+
text: "Marcar todos",
|
|
229
|
+
onClick: () => {
|
|
230
|
+
handlerToggleCheckChildren(node.id, true);
|
|
231
|
+
setShowNodeElements(false);
|
|
232
|
+
setKeepMenuOpened(false);
|
|
233
|
+
}
|
|
234
|
+
}), /*#__PURE__*/_react.default.createElement(_list.ListItem, {
|
|
235
|
+
text: "Desmarcar todos",
|
|
236
|
+
onClick: () => {
|
|
237
|
+
handlerToggleCheckChildren(node.id, false, required);
|
|
238
|
+
setShowNodeElements(false);
|
|
239
|
+
setKeepMenuOpened(false);
|
|
240
|
+
}
|
|
241
|
+
}))) : null, showNodeElements && returnNodeRightElements(), showNodeElements && returnNodeToolbarElements()), /*#__PURE__*/_react.default.createElement("ul", {
|
|
242
|
+
className: "nodelist"
|
|
243
|
+
}, isVisible && children));
|
|
244
|
+
};
|
|
245
|
+
var _default = exports.default = TreeNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TreeviewContext = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const TreeviewContext = exports.TreeviewContext = /*#__PURE__*/_react.default.createContext({});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as TreeNode } from './Node.js';
|
|
2
|
+
export { default as TreeViewHeader } from './Header.js';
|
|
3
|
+
import { ITreeviewProps } from './types.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const TreeView: (props: ITreeviewProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { TreeView as default };
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TreeNode", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Node.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TreeViewHeader", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Header.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.default = void 0;
|
|
19
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
21
|
+
var _Node = _interopRequireDefault(require("./Node"));
|
|
22
|
+
var _Header = _interopRequireDefault(require("./Header"));
|
|
23
|
+
require("../assets/styles/treeview.scss");
|
|
24
|
+
var _constants = require("./constants");
|
|
25
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
31
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
32
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
|
+
const TreeView = props => {
|
|
34
|
+
const {
|
|
35
|
+
selectedIds = [],
|
|
36
|
+
enableDynamicData,
|
|
37
|
+
allowCheckAllAncestry,
|
|
38
|
+
onNodeOpen,
|
|
39
|
+
allowCheckAllChildren,
|
|
40
|
+
onSelectedIdsChange,
|
|
41
|
+
idsInLoading,
|
|
42
|
+
startNodesOpened = false,
|
|
43
|
+
alwaysShowArrow,
|
|
44
|
+
nodeElementsValidations,
|
|
45
|
+
nodeRightElements,
|
|
46
|
+
nodeMenuButtonSize = 'small',
|
|
47
|
+
nodeToolbarElements,
|
|
48
|
+
onNodeClick,
|
|
49
|
+
selectedNodeId,
|
|
50
|
+
customClass = '',
|
|
51
|
+
children,
|
|
52
|
+
styleForContainer,
|
|
53
|
+
bordered,
|
|
54
|
+
requiredIds: propsRequiredIds = [],
|
|
55
|
+
customClassForNodes = '',
|
|
56
|
+
customStyleForNodes
|
|
57
|
+
} = props;
|
|
58
|
+
const [data, setData] = (0, _react.useState)(props.data);
|
|
59
|
+
const [currentSelectedIds, setCurrentSelectedIds] = (0, _react.useState)(selectedIds);
|
|
60
|
+
const [propSelectedIds, setPropSelectedIds] = (0, _react.useState)(selectedIds);
|
|
61
|
+
const [isHandlingSelectedIds, setIsHandlingSelectedIds] = (0, _react.useState)(false);
|
|
62
|
+
const [selectedIdsUpdatedOnMount, setSelectedIdsUpdatedOnMount] = (0, _react.useState)(false);
|
|
63
|
+
const [requiredParentsIds, setRequiredParentsIds] = (0, _react.useState)([]);
|
|
64
|
+
const [alreadyOpenedIds, setAlreadyOpenedIds] = (0, _react.useState)([]);
|
|
65
|
+
const [idsWithChildren] = (0, _react.useState)({});
|
|
66
|
+
const returnChildrenIds = function (nodeId) {
|
|
67
|
+
let returnRequiredIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
68
|
+
let nodeChildrenIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
69
|
+
let requiredIds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
70
|
+
if (idsWithChildren[nodeId] !== undefined) {
|
|
71
|
+
nodeChildrenIds.push(nodeId);
|
|
72
|
+
if (returnRequiredIds) requiredIds.push(nodeId);
|
|
73
|
+
idsWithChildren[nodeId].forEach(childId => returnChildrenIds(childId, returnRequiredIds, nodeChildrenIds, requiredIds));
|
|
74
|
+
} else nodeChildrenIds.push(nodeId);
|
|
75
|
+
return returnRequiredIds ? {
|
|
76
|
+
nodeChildrenIds,
|
|
77
|
+
requiredIds
|
|
78
|
+
} : {
|
|
79
|
+
nodeChildrenIds
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const returnParentId = nodeId => {
|
|
83
|
+
const parentId = Object.keys(idsWithChildren).find(id => idsWithChildren[id].find(childId => childId === nodeId));
|
|
84
|
+
return Number(parentId);
|
|
85
|
+
};
|
|
86
|
+
const returnAllAncestryIds = function (nodeId) {
|
|
87
|
+
let ancestryIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
88
|
+
const parentId = returnParentId(nodeId);
|
|
89
|
+
if (parentId) {
|
|
90
|
+
const currentAncestryIds = [...ancestryIds, Number(parentId)];
|
|
91
|
+
return returnAllAncestryIds(Number(parentId), currentAncestryIds);
|
|
92
|
+
}
|
|
93
|
+
return ancestryIds;
|
|
94
|
+
};
|
|
95
|
+
const returnRequiredAncestryIds = function (nodeId) {
|
|
96
|
+
let requiredAncestryIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
97
|
+
let previousParentId = arguments.length > 2 ? arguments[2] : undefined;
|
|
98
|
+
let selectedSiblingsIds = [];
|
|
99
|
+
const parentId = returnParentId(nodeId);
|
|
100
|
+
if (parentId) {
|
|
101
|
+
const nodeSiblingsIds = idsWithChildren && idsWithChildren[parentId].filter(childId => childId !== nodeId);
|
|
102
|
+
const isPreviousParentSelected = previousParentId && currentSelectedIds.includes(previousParentId);
|
|
103
|
+
if (nodeSiblingsIds && nodeSiblingsIds.length > 0) {
|
|
104
|
+
selectedSiblingsIds = currentSelectedIds.filter(id => nodeSiblingsIds.includes(id));
|
|
105
|
+
}
|
|
106
|
+
const requiredIds = isPreviousParentSelected || selectedSiblingsIds.length > 0 ? [...requiredAncestryIds] : [...requiredAncestryIds, parentId];
|
|
107
|
+
if (selectedSiblingsIds.length === 0 && !isPreviousParentSelected) {
|
|
108
|
+
return returnRequiredAncestryIds(parentId, requiredIds, parentId);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return requiredAncestryIds;
|
|
112
|
+
};
|
|
113
|
+
const updateAncestryAndSelectedIds = (nodeId, codigos, requiredParents) => {
|
|
114
|
+
const ancestryIds = returnRequiredAncestryIds(nodeId);
|
|
115
|
+
const remainRequiredParentsIds = requiredParents.filter(id => !ancestryIds.includes(id));
|
|
116
|
+
const newSelectedIds = currentSelectedIds.filter(selectedId => !codigos.includes(selectedId));
|
|
117
|
+
setRequiredParentsIds(remainRequiredParentsIds);
|
|
118
|
+
return newSelectedIds;
|
|
119
|
+
};
|
|
120
|
+
const checkAllAncestry = function (nodeId, codigos) {
|
|
121
|
+
let returnRequiredParentsIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
122
|
+
let updateState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
123
|
+
const nodeAncestryIds = returnAllAncestryIds(nodeId);
|
|
124
|
+
const notRequiredAncestryIds = nodeAncestryIds.filter(id => !requiredParentsIds.includes(id));
|
|
125
|
+
const notSelectedAncestryIds = nodeAncestryIds.filter(id => !currentSelectedIds.includes(id));
|
|
126
|
+
const newSelectedIds = [...currentSelectedIds, ...codigos, ...notSelectedAncestryIds];
|
|
127
|
+
const newRequiredParentsIds = [...requiredParentsIds, ...notRequiredAncestryIds];
|
|
128
|
+
if (updateState) {
|
|
129
|
+
setRequiredParentsIds(newRequiredParentsIds);
|
|
130
|
+
}
|
|
131
|
+
return !returnRequiredParentsIds ? {
|
|
132
|
+
updatedIdsWithAncestryIds: newSelectedIds
|
|
133
|
+
} : {
|
|
134
|
+
updatedIdsWithAncestryIds: newSelectedIds,
|
|
135
|
+
requiredParentsIds: newRequiredParentsIds
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const checkAllChildren = function (nodeId) {
|
|
139
|
+
let returnRequiredIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
140
|
+
let currentRequiredIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
141
|
+
let childrenIds;
|
|
142
|
+
let newRequiredParentsIds = currentRequiredIds;
|
|
143
|
+
if (returnRequiredIds) {
|
|
144
|
+
const {
|
|
145
|
+
nodeChildrenIds,
|
|
146
|
+
requiredIds
|
|
147
|
+
} = returnChildrenIds(nodeId, returnRequiredIds);
|
|
148
|
+
const newRequiredIds = requiredIds ? requiredIds.filter(id => !currentRequiredIds.includes(id)) : [];
|
|
149
|
+
newRequiredParentsIds = [...currentRequiredIds, ...newRequiredIds];
|
|
150
|
+
childrenIds = nodeChildrenIds;
|
|
151
|
+
} else childrenIds = returnChildrenIds(nodeId).nodeChildrenIds;
|
|
152
|
+
const notSelectedChildrenIds = childrenIds.filter(id => !currentSelectedIds.includes(id));
|
|
153
|
+
const newSelectedIds = [...currentSelectedIds, ...notSelectedChildrenIds];
|
|
154
|
+
setRequiredParentsIds(newRequiredParentsIds);
|
|
155
|
+
setIsHandlingSelectedIds(false);
|
|
156
|
+
return newSelectedIds;
|
|
157
|
+
};
|
|
158
|
+
const uncheckAllChildren = function (nodeId) {
|
|
159
|
+
let remainSelectedIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
160
|
+
let newSelectedIds = remainSelectedIds.length > 0 ? remainSelectedIds : currentSelectedIds;
|
|
161
|
+
const childrenIds = returnChildrenIds(nodeId).nodeChildrenIds;
|
|
162
|
+
newSelectedIds = newSelectedIds.filter(selectedId => !childrenIds.includes(selectedId));
|
|
163
|
+
setIsHandlingSelectedIds(false);
|
|
164
|
+
return newSelectedIds;
|
|
165
|
+
};
|
|
166
|
+
const uncheckRequiredChildren = (nodeId, codigos, requiredParents) => {
|
|
167
|
+
const childrenIds = returnChildrenIds(nodeId).nodeChildrenIds;
|
|
168
|
+
const remainRequiredIds = requiredParents.filter(id => !childrenIds.includes(id));
|
|
169
|
+
setRequiredParentsIds([...remainRequiredIds]);
|
|
170
|
+
updateAncestryAndSelectedIds(nodeId, codigos, remainRequiredIds);
|
|
171
|
+
};
|
|
172
|
+
const handleOnNodeOpen = node => {
|
|
173
|
+
const {
|
|
174
|
+
id
|
|
175
|
+
} = node;
|
|
176
|
+
let newAlreadyOpenedIds = alreadyOpenedIds;
|
|
177
|
+
if (!alreadyOpenedIds.includes(id) && onNodeOpen) {
|
|
178
|
+
newAlreadyOpenedIds = [...newAlreadyOpenedIds, id];
|
|
179
|
+
onNodeOpen(node);
|
|
180
|
+
}
|
|
181
|
+
setAlreadyOpenedIds(newAlreadyOpenedIds);
|
|
182
|
+
};
|
|
183
|
+
const handleCheck = (nodeId, handlingSelectedIds, isParent) => {
|
|
184
|
+
const codigos = _lodash.default.isArray(nodeId) ? nodeId : [nodeId];
|
|
185
|
+
let newSelectedIds = [...currentSelectedIds, ...codigos];
|
|
186
|
+
if (isParent && (handlingSelectedIds || isHandlingSelectedIds) && allowCheckAllChildren) {
|
|
187
|
+
if (allowCheckAllAncestry) {
|
|
188
|
+
const {
|
|
189
|
+
updatedIdsWithAncestryIds,
|
|
190
|
+
requiredParentsIds: requiredParents
|
|
191
|
+
} = checkAllAncestry(nodeId, codigos, true);
|
|
192
|
+
const updatedIdsWithChildrenIds = checkAllChildren(nodeId, true, requiredParents);
|
|
193
|
+
newSelectedIds = [...updatedIdsWithAncestryIds, ...updatedIdsWithChildrenIds];
|
|
194
|
+
} else newSelectedIds = checkAllChildren(nodeId);
|
|
195
|
+
} else if (allowCheckAllAncestry) {
|
|
196
|
+
newSelectedIds = checkAllAncestry(nodeId, codigos).updatedIdsWithAncestryIds;
|
|
197
|
+
}
|
|
198
|
+
return newSelectedIds;
|
|
199
|
+
};
|
|
200
|
+
const handleUncheck = (nodeId, handlingSelectedIds, isParent, required) => {
|
|
201
|
+
const codigos = _lodash.default.isArray(nodeId) ? nodeId : [nodeId];
|
|
202
|
+
let newSelectedIds = currentSelectedIds.filter(id => !codigos.includes(id));
|
|
203
|
+
if (isParent && (handlingSelectedIds || isHandlingSelectedIds) && allowCheckAllChildren) {
|
|
204
|
+
if (allowCheckAllAncestry) {
|
|
205
|
+
const updatedSelectedIds = updateAncestryAndSelectedIds(nodeId, codigos, requiredParentsIds);
|
|
206
|
+
newSelectedIds = uncheckAllChildren(nodeId, updatedSelectedIds);
|
|
207
|
+
if (required) uncheckRequiredChildren(nodeId, codigos, requiredParentsIds);
|
|
208
|
+
} else newSelectedIds = uncheckAllChildren(nodeId);
|
|
209
|
+
} else if (allowCheckAllAncestry) {
|
|
210
|
+
newSelectedIds = updateAncestryAndSelectedIds(nodeId, codigos, requiredParentsIds);
|
|
211
|
+
}
|
|
212
|
+
return newSelectedIds;
|
|
213
|
+
};
|
|
214
|
+
const updateSelectedIds = function (nodeId, checked, isParent) {
|
|
215
|
+
let required = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
216
|
+
let handlingSelectedIds = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : isHandlingSelectedIds;
|
|
217
|
+
let newSelectedIds = [...currentSelectedIds];
|
|
218
|
+
if (checked) {
|
|
219
|
+
newSelectedIds = handleCheck(nodeId, handlingSelectedIds, isParent);
|
|
220
|
+
} else {
|
|
221
|
+
newSelectedIds = handleUncheck(nodeId, handlingSelectedIds, isParent, required);
|
|
222
|
+
}
|
|
223
|
+
setCurrentSelectedIds(newSelectedIds);
|
|
224
|
+
if (onSelectedIdsChange) onSelectedIdsChange(newSelectedIds);
|
|
225
|
+
};
|
|
226
|
+
const toggleCheckChildren = function (nodeId, check) {
|
|
227
|
+
let required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
228
|
+
setIsHandlingSelectedIds(true);
|
|
229
|
+
updateSelectedIds(nodeId, check, true, required, true);
|
|
230
|
+
};
|
|
231
|
+
const buildTree = (node, parentId, ids) => {
|
|
232
|
+
let childrenIds = [];
|
|
233
|
+
if (node.itens && node.itens.length > 0) {
|
|
234
|
+
childrenIds = node.itens.map(i => i.id);
|
|
235
|
+
if (ids) {
|
|
236
|
+
const idWithChildren = {};
|
|
237
|
+
idWithChildren[node.id] = childrenIds;
|
|
238
|
+
Object.assign(ids, idWithChildren);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return /*#__PURE__*/_react.default.createElement(_Node.default, {
|
|
242
|
+
key: `node-${node.id}`,
|
|
243
|
+
node: node,
|
|
244
|
+
idsInLoading: idsInLoading,
|
|
245
|
+
startNodesOpened: startNodesOpened,
|
|
246
|
+
alwaysShowArrow: alwaysShowArrow,
|
|
247
|
+
childrenIds: childrenIds,
|
|
248
|
+
isParent: node.itens && node.itens.length > 0,
|
|
249
|
+
parentId: parentId,
|
|
250
|
+
nodeRightElements: nodeRightElements,
|
|
251
|
+
nodeToolbarElements: nodeToolbarElements,
|
|
252
|
+
nodeElementsValidations: nodeElementsValidations,
|
|
253
|
+
nodeMenuButtonSize: nodeMenuButtonSize,
|
|
254
|
+
onNodeClick: onNodeClick,
|
|
255
|
+
selectedNodeId: selectedNodeId,
|
|
256
|
+
handlerOnNodeOpen: handleOnNodeOpen,
|
|
257
|
+
customClass: customClassForNodes,
|
|
258
|
+
customStyle: customStyleForNodes
|
|
259
|
+
}, childrenIds.length > 0 && node.itens && node.itens.map(nodeitem => buildTree(nodeitem, node.id, idsWithChildren)));
|
|
260
|
+
};
|
|
261
|
+
const handleNewSelectedIds = selectedNodeIds => {
|
|
262
|
+
let requiredIds = [];
|
|
263
|
+
let newSelectedIds = [];
|
|
264
|
+
selectedNodeIds.forEach(id => {
|
|
265
|
+
const {
|
|
266
|
+
requiredParentsIds: requiredParents,
|
|
267
|
+
updatedIdsWithAncestryIds
|
|
268
|
+
} = checkAllAncestry(id, [], true, false);
|
|
269
|
+
newSelectedIds = [...newSelectedIds, ...updatedIdsWithAncestryIds];
|
|
270
|
+
if (requiredParents) {
|
|
271
|
+
requiredIds = [...requiredIds, ...requiredParents];
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
setRequiredParentsIds(_lodash.default.uniq(requiredIds));
|
|
275
|
+
setCurrentSelectedIds(_lodash.default.uniq(newSelectedIds));
|
|
276
|
+
setSelectedIdsUpdatedOnMount(prevState => prevState || true);
|
|
277
|
+
};
|
|
278
|
+
(0, _react.useEffect)(() => {
|
|
279
|
+
const isSameSelectedIds = _lodash.default.isEqual(propSelectedIds.sort(), selectedIds.sort());
|
|
280
|
+
if (enableDynamicData && props.data !== data) {
|
|
281
|
+
setData(props.data);
|
|
282
|
+
} else if (!isSameSelectedIds) {
|
|
283
|
+
setCurrentSelectedIds(selectedIds);
|
|
284
|
+
onSelectedIdsChange?.(selectedIds);
|
|
285
|
+
setPropSelectedIds(selectedIds);
|
|
286
|
+
}
|
|
287
|
+
}, [selectedIds.length, props.data]);
|
|
288
|
+
(0, _react.useEffect)(() => {
|
|
289
|
+
if (allowCheckAllAncestry && !selectedIdsUpdatedOnMount) {
|
|
290
|
+
handleNewSelectedIds(currentSelectedIds);
|
|
291
|
+
}
|
|
292
|
+
}, [currentSelectedIds]);
|
|
293
|
+
(0, _react.useEffect)(() => {
|
|
294
|
+
if (allowCheckAllAncestry) {
|
|
295
|
+
handleNewSelectedIds(currentSelectedIds);
|
|
296
|
+
}
|
|
297
|
+
}, [propSelectedIds]);
|
|
298
|
+
(0, _react.useEffect)(() => {
|
|
299
|
+
buildTree(data, undefined, idsWithChildren);
|
|
300
|
+
}, []);
|
|
301
|
+
const contextValues = _objectSpread(_objectSpread({}, props), {}, {
|
|
302
|
+
requiredIds: propsRequiredIds,
|
|
303
|
+
selectedIds: currentSelectedIds,
|
|
304
|
+
isHandlingSelectedIds,
|
|
305
|
+
selectedIdsUpdatedOnMount,
|
|
306
|
+
requiredParentsIds,
|
|
307
|
+
alreadyOpenedIds,
|
|
308
|
+
handlerUpdateSelectedIds: updateSelectedIds,
|
|
309
|
+
handlerToggleCheckChildren: toggleCheckChildren
|
|
310
|
+
});
|
|
311
|
+
return /*#__PURE__*/_react.default.createElement(_constants.TreeviewContext.Provider, {
|
|
312
|
+
value: contextValues
|
|
313
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
314
|
+
className: `treeview-component ${customClass}`
|
|
315
|
+
}, children, /*#__PURE__*/_react.default.createElement("ul", {
|
|
316
|
+
style: styleForContainer,
|
|
317
|
+
className: `treeviewcontainer ${bordered && '-bordered'}`
|
|
318
|
+
}, buildTree(data))));
|
|
319
|
+
};
|
|
320
|
+
var _default = exports.default = TreeView;
|