linear-react-components-ui 0.4.77-beta.27 → 0.4.77-beta.29
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 +3 -76
- package/.husky/pre-commit +4 -0
- package/.vscode/settings.json +2 -2
- package/jest.config.js +3 -3
- package/lib/alerts/AlertContainer.js +19 -14
- package/lib/alerts/AlertProvider.js +9 -4
- package/lib/alerts/BaseAlert.js +8 -5
- package/lib/alerts/Message.js +40 -31
- package/lib/alerts/alert.spec.js +133 -0
- package/lib/alerts/helpers.js +5 -2
- package/lib/alerts/withAlert.js +2 -2
- package/lib/assets/styles/commons.scss +10 -0
- package/lib/assets/styles/dropdown.scss +36 -2
- package/lib/assets/styles/effects.scss +11 -0
- package/lib/assets/styles/list.scss +8 -0
- package/lib/assets/styles/table.scss +2 -7
- package/lib/avatar/avatar.spec.js +190 -0
- package/lib/avatar/index.js +58 -13
- package/lib/badge/badge.spec.js +127 -0
- package/lib/badge/index.js +22 -6
- package/lib/buttons/ActivateButton.js +3 -3
- package/lib/buttons/AddButton.js +1 -1
- package/lib/buttons/Button.js +11 -19
- package/lib/buttons/ButtonGroups.js +5 -0
- package/lib/buttons/CancelButton.js +3 -16
- package/lib/buttons/DangerButton.js +19 -14
- package/lib/buttons/DefaultButton.js +127 -65
- package/lib/buttons/DestroyButton.js +3 -12
- package/lib/buttons/EditButton.js +3 -3
- package/lib/buttons/InactivateButton.js +3 -3
- package/lib/buttons/InfoButton.js +19 -14
- package/lib/buttons/PrimaryButton.js +19 -14
- package/lib/buttons/RestoreButton.js +3 -3
- package/lib/buttons/SaveButton.js +2 -15
- package/lib/buttons/SpinnerLoading.js +230 -0
- package/lib/buttons/SuccessButton.js +18 -13
- package/lib/buttons/WarningButton.js +18 -13
- package/lib/buttons/button_container/index.js +18 -5
- package/lib/buttons/buttons.spec.js +504 -0
- package/lib/buttons/index.js +28 -28
- package/lib/buttons/split_button/index.js +30 -13
- package/lib/calendar/DangerCalendar.js +2 -11
- package/lib/calendar/InfoCalendar.js +2 -11
- package/lib/calendar/PrimaryCalendar.js +2 -11
- package/lib/calendar/SuccessCalendar.js +2 -11
- package/lib/calendar/WarningCalendar.js +2 -11
- package/lib/calendar/base/Day.js +8 -2
- package/lib/calendar/base/Month.js +5 -0
- package/lib/calendar/base/Week.js +6 -0
- package/lib/calendar/base/helpers.js +9 -9
- package/lib/calendar/base/index.js +36 -33
- package/lib/calendar/calendar.spec.js +171 -0
- package/lib/calendar/index.js +10 -10
- package/lib/checkbox/Label.js +12 -2
- package/lib/checkbox/checkbox.spec.js +215 -0
- package/lib/checkbox/index.js +79 -42
- package/lib/dialog/Alert.js +8 -3
- package/lib/dialog/Custom.js +25 -17
- package/lib/dialog/Error.js +6 -1
- package/lib/dialog/Information.js +6 -1
- package/lib/dialog/Question.js +17 -6
- package/lib/dialog/Warning.js +6 -1
- package/lib/dialog/base/Content.js +9 -0
- package/lib/dialog/base/Footer.js +8 -2
- package/lib/dialog/base/Header.js +22 -8
- package/lib/dialog/base/index.js +28 -6
- package/lib/dialog/dialog.spec.js +488 -0
- package/lib/dialog/form/index.js +32 -22
- package/lib/dialog/index.js +6 -6
- package/lib/drawer/Content.js +10 -1
- package/lib/drawer/Drawer.js +50 -29
- package/lib/drawer/Drawer.spec.js +258 -0
- package/lib/drawer/Header.js +31 -12
- package/lib/drawer/helpers.js +1 -1
- package/lib/drawer/index.js +4 -4
- package/lib/dropdown/Popup.js +16 -32
- package/lib/dropdown/dropdown.spec.js +169 -0
- package/lib/dropdown/helper.js +2 -2
- package/lib/dropdown/withDropdown.js +43 -18
- package/lib/fieldset/fieldset.spec.js +329 -0
- package/lib/fieldset/index.js +43 -12
- package/lib/form/Field.js +41 -14
- package/lib/form/FieldArray.js +50 -20
- package/lib/form/FieldNumber.js +44 -12
- package/lib/form/FieldPeriod.js +41 -19
- package/lib/form/form.spec.js +293 -0
- package/lib/form/helpers.js +16 -10
- package/lib/form/index.js +92 -57
- package/lib/form/withFieldHOC.js +120 -40
- package/lib/form/withFormSecurity.js +38 -17
- package/lib/gridlayout/GridCol.js +18 -3
- package/lib/gridlayout/GridRow.js +24 -4
- package/lib/gridlayout/gridLayout.spec.js +169 -0
- package/lib/icons/helper.js +571 -560
- package/lib/icons/icons.spec.js +86 -0
- package/lib/icons/index.js +40 -23
- package/lib/index.js +12 -12
- package/lib/inputs/base/InputTextBase.js +149 -40
- package/lib/inputs/base/base.spec.js +690 -0
- package/lib/inputs/base/helpers.js +4 -4
- package/lib/inputs/base/index.js +1 -0
- package/lib/inputs/color/color_input.spec.js +174 -0
- package/lib/inputs/color/index.js +29 -31
- package/lib/inputs/date/Dialog.js +8 -1
- package/lib/inputs/date/Dropdown.js +70 -18
- package/lib/inputs/date/date.spec.js +354 -0
- package/lib/inputs/date/helpers.js +1 -1
- package/lib/inputs/date/index.js +411 -255
- package/lib/inputs/inputHOC.js +96 -44
- package/lib/inputs/mask/BaseMask.js +45 -16
- package/lib/inputs/mask/Cnpj.js +19 -12
- package/lib/inputs/mask/Cpf.js +22 -14
- package/lib/inputs/mask/Phone.js +9 -1
- package/lib/inputs/mask/ZipCode.js +1 -1
- package/lib/inputs/mask/helpers.js +36 -21
- package/lib/inputs/mask/imaskHOC.js +255 -186
- package/lib/inputs/mask/index.js +4 -4
- package/lib/inputs/mask/input_mask.spec.js +607 -0
- package/lib/inputs/multiSelect/ActionButtons.js +14 -2
- package/lib/inputs/multiSelect/Dropdown.js +70 -43
- package/lib/inputs/multiSelect/index.js +80 -60
- package/lib/inputs/number/BaseNumber.js +62 -27
- package/lib/inputs/number/Currency.js +14 -4
- package/lib/inputs/number/format_number.js +1 -1
- package/lib/inputs/number/index.js +15 -9
- package/lib/inputs/number/numberfield.spec.js +215 -0
- package/lib/inputs/period/Dialog.js +8 -1
- package/lib/inputs/period/Dropdown.js +70 -16
- package/lib/inputs/period/PeriodList.js +19 -6
- package/lib/inputs/period/helper.js +71 -30
- package/lib/inputs/period/index.js +160 -112
- package/lib/inputs/search/index.js +261 -129
- package/lib/inputs/search/search_input.spec.js +209 -0
- package/lib/inputs/select/ActionButtons.js +20 -14
- package/lib/inputs/select/Dropdown.js +63 -30
- package/lib/inputs/select/helper.js +16 -18
- package/lib/inputs/select/index.js +13 -14
- package/lib/inputs/select/multiple/Selecteds.js +13 -5
- package/lib/inputs/select/multiple/index.js +414 -289
- package/lib/inputs/select/select.spec.js +395 -0
- package/lib/inputs/select/simple/index.js +461 -322
- package/lib/inputs/text/index.js +0 -1
- package/lib/inputs/text/textfield.spec.js +215 -0
- package/lib/inputs/textarea/index.js +15 -5
- package/lib/inputs/textarea/textarea.spec.js +59 -0
- package/lib/internals/constants.js +1 -1
- package/lib/internals/withTooltip.js +34 -26
- package/lib/labelMessages/index.js +45 -27
- package/lib/labelMessages/labelMessages.spec.js +176 -0
- package/lib/labels/DangerLabel.js +4 -13
- package/lib/labels/DefaultLabel.js +57 -25
- package/lib/labels/InfoLabel.js +4 -13
- package/lib/labels/PrimaryLabel.js +4 -13
- package/lib/labels/SuccessLabel.js +4 -13
- package/lib/labels/WarningLabel.js +4 -13
- package/lib/labels/index.js +10 -10
- package/lib/labels/label.spec.js +162 -0
- package/lib/labels/label_container/index.js +12 -2
- package/lib/list/Header.js +13 -0
- package/lib/list/Item.js +65 -27
- package/lib/list/helpers.js +2 -2
- package/lib/list/index.js +51 -31
- package/lib/list/list.spec.js +769 -0
- package/lib/menus/float/MenuItem.js +42 -10
- package/lib/menus/float/SubMenuContainer.js +95 -0
- package/lib/menus/float/float-menu.spec.js +221 -0
- package/lib/menus/float/helpers.js +1 -1
- package/lib/menus/float/index.js +39 -9
- package/lib/menus/sidenav/ExpandMenu.js +13 -1
- package/lib/menus/sidenav/MenuLink.js +14 -0
- package/lib/menus/sidenav/NavMenuGroup.js +12 -1
- package/lib/menus/sidenav/NavMenuItem.js +45 -19
- package/lib/menus/sidenav/NavSubMenuItem.js +15 -4
- package/lib/menus/sidenav/helpers.js +3 -3
- package/lib/menus/sidenav/index.js +60 -30
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +11 -2
- package/lib/menus/sidenav/popup_menu_search/index.js +11 -14
- package/lib/menus/sidenav/sidenav.spec.js +379 -0
- package/lib/panel/Content.js +18 -6
- package/lib/panel/DangerPanel.js +1 -1
- package/lib/panel/Default.js +45 -18
- package/lib/panel/Header.js +29 -7
- package/lib/panel/InfoPanel.js +1 -1
- package/lib/panel/PrimaryPanel.js +1 -1
- package/lib/panel/SuccessPanel.js +1 -1
- package/lib/panel/ToolBar.js +5 -0
- package/lib/panel/WarningPanel.js +1 -1
- package/lib/panel/helpers.js +3 -7
- package/lib/panel/index.js +14 -14
- package/lib/panel/panel.spec.js +216 -0
- package/lib/permissionValidations.js +12 -14
- package/lib/popover/PopoverText.js +5 -0
- package/lib/popover/PopoverTitle.js +5 -0
- package/lib/popover/index.js +40 -26
- package/lib/popover/popover.spec.js +146 -0
- package/lib/progress/Bar.js +47 -37
- package/lib/progress/index.js +18 -8
- package/lib/progress/progress.spec.js +94 -0
- package/lib/radio/index.js +46 -22
- package/lib/radio/radio.spec.js +189 -0
- package/lib/skeleton/SkeletonContainer.js +13 -0
- package/lib/skeleton/index.js +26 -7
- package/lib/spinner/SpinnerLoading.js +12 -4
- package/lib/spinner/index.js +29 -24
- package/lib/spinner/spinner.spec.js +152 -0
- package/lib/split/Split.js +62 -45
- package/lib/split/SplitSide.js +21 -1
- package/lib/split/helpers.js +1 -1
- package/lib/split/split.spec.js +163 -0
- package/lib/table/Body.js +16 -9
- package/lib/table/Header.js +19 -40
- package/lib/table/HeaderColumn.js +20 -6
- package/lib/table/Row.js +28 -7
- package/lib/table/RowColumn.js +30 -12
- package/lib/table/helpers.js +3 -3
- package/lib/table/index.js +53 -15
- package/lib/table/table.spec.js +352 -0
- package/lib/tabs/DropdownItems.js +53 -39
- package/lib/tabs/Menu.js +20 -16
- package/lib/tabs/MenuItems.js +39 -25
- package/lib/tabs/Panel.js +51 -18
- package/lib/tabs/index.js +75 -81
- package/lib/tabs/tabHelpers.js +8 -10
- package/lib/tabs/tabs.spec.js +321 -0
- package/lib/toolbar/ButtonBar.js +13 -32
- package/lib/toolbar/LabelBar.js +18 -31
- package/lib/toolbar/ToolBarGroup.js +12 -6
- package/lib/toolbar/helpers.js +1 -1
- package/lib/toolbar/index.js +33 -25
- package/lib/toolbar/toolbar.spec.js +394 -0
- package/lib/tooltip/index.js +34 -25
- package/lib/tooltip/tooltip.spec.js +215 -0
- package/lib/treeview/Header.js +12 -0
- package/lib/treeview/Node.js +387 -261
- package/lib/treeview/constants.js +2 -1
- package/lib/treeview/index.js +548 -363
- package/lib/treeview/treeview.spec.js +279 -0
- package/lib/treeview_old/Node.js +6 -6
- package/lib/uitour/helpers.js +1 -1
- package/lib/uitour/index.js +32 -15
- package/lib/uitour/uitour.spec.js +176 -0
- package/package.json +16 -40
- package/.husky/pre-push +0 -4
- package/babel.config.json +0 -11
- package/lib/@types/Align.d.ts +0 -3
- package/lib/@types/Align.js +0 -5
- package/lib/@types/ButtonTypes.d.ts +0 -3
- package/lib/@types/ButtonTypes.js +0 -5
- package/lib/@types/ColorStyles.d.ts +0 -3
- package/lib/@types/ColorStyles.js +0 -5
- package/lib/@types/DataCombo.d.ts +0 -3
- package/lib/@types/DataCombo.js +0 -5
- package/lib/@types/Icon.d.ts +0 -5
- package/lib/@types/Icon.js +0 -5
- package/lib/@types/LabelStyles.d.ts +0 -3
- package/lib/@types/LabelStyles.js +0 -5
- package/lib/@types/Period.d.ts +0 -6
- package/lib/@types/Period.js +0 -5
- package/lib/@types/PermissionAttr.d.ts +0 -14
- package/lib/@types/PermissionAttr.js +0 -5
- package/lib/@types/PointerEvents.d.ts +0 -3
- package/lib/@types/PointerEvents.js +0 -5
- package/lib/@types/Position.d.ts +0 -3
- package/lib/@types/Position.js +0 -5
- package/lib/@types/PositionAlert.d.ts +0 -3
- package/lib/@types/PositionAlert.js +0 -5
- package/lib/@types/Size.d.ts +0 -3
- package/lib/@types/Size.js +0 -5
- package/lib/@types/SizePixels.d.ts +0 -3
- package/lib/@types/SizePixels.js +0 -5
- package/lib/@types/StorageMock.d.ts +0 -5
- package/lib/@types/StorageMock.js +0 -5
- package/lib/alerts/AlertContainer.d.ts +0 -16
- package/lib/alerts/AlertProvider.d.ts +0 -7
- package/lib/alerts/BaseAlert.d.ts +0 -7
- package/lib/alerts/Message.d.ts +0 -7
- package/lib/alerts/helpers.d.ts +0 -7
- package/lib/alerts/index.d.ts +0 -6
- package/lib/alerts/types.d.ts +0 -48
- package/lib/alerts/types.js +0 -5
- package/lib/alerts/withAlert.d.ts +0 -7
- package/lib/avatar/index.d.ts +0 -12
- package/lib/avatar/types.d.ts +0 -31
- package/lib/avatar/types.js +0 -5
- package/lib/badge/index.d.ts +0 -6
- package/lib/badge/types.d.ts +0 -13
- package/lib/badge/types.js +0 -5
- package/lib/buttons/ActivateButton.d.ts +0 -9
- package/lib/buttons/AddButton.d.ts +0 -9
- package/lib/buttons/Button.d.ts +0 -12
- package/lib/buttons/ButtonGroups.d.ts +0 -8
- package/lib/buttons/CancelButton.d.ts +0 -9
- package/lib/buttons/DangerButton.d.ts +0 -9
- package/lib/buttons/DefaultButton.d.ts +0 -12
- package/lib/buttons/DestroyButton.d.ts +0 -9
- package/lib/buttons/EditButton.d.ts +0 -9
- package/lib/buttons/InactivateButton.d.ts +0 -9
- package/lib/buttons/InfoButton.d.ts +0 -9
- package/lib/buttons/PrimaryButton.d.ts +0 -9
- package/lib/buttons/RestoreButton.d.ts +0 -9
- package/lib/buttons/SaveButton.d.ts +0 -9
- package/lib/buttons/SuccessButton.d.ts +0 -9
- package/lib/buttons/WarningButton.d.ts +0 -9
- package/lib/buttons/button_container/index.d.ts +0 -12
- package/lib/buttons/index.d.ts +0 -21
- package/lib/buttons/split_button/index.d.ts +0 -9
- package/lib/buttons/types.d.ts +0 -44
- package/lib/buttons/types.js +0 -5
- package/lib/calendar/DangerCalendar.d.ts +0 -7
- package/lib/calendar/InfoCalendar.d.ts +0 -7
- package/lib/calendar/PrimaryCalendar.d.ts +0 -7
- package/lib/calendar/SuccessCalendar.d.ts +0 -7
- package/lib/calendar/WarningCalendar.d.ts +0 -7
- package/lib/calendar/base/Day.d.ts +0 -7
- package/lib/calendar/base/Month.d.ts +0 -7
- package/lib/calendar/base/Week.d.ts +0 -7
- package/lib/calendar/base/helpers.d.ts +0 -62
- package/lib/calendar/base/index.d.ts +0 -7
- package/lib/calendar/index.d.ts +0 -10
- package/lib/calendar/types.d.ts +0 -25
- package/lib/calendar/types.js +0 -5
- package/lib/checkbox/Label.d.ts +0 -11
- package/lib/checkbox/index.d.ts +0 -13
- package/lib/checkbox/types.d.ts +0 -42
- package/lib/checkbox/types.js +0 -5
- package/lib/dialog/Alert.d.ts +0 -6
- package/lib/dialog/Custom.d.ts +0 -6
- package/lib/dialog/Error.d.ts +0 -6
- package/lib/dialog/Information.d.ts +0 -6
- package/lib/dialog/Question.d.ts +0 -6
- package/lib/dialog/Warning.d.ts +0 -6
- package/lib/dialog/base/Content.d.ts +0 -6
- package/lib/dialog/base/Footer.d.ts +0 -6
- package/lib/dialog/base/Header.d.ts +0 -6
- package/lib/dialog/base/index.d.ts +0 -6
- package/lib/dialog/form/index.d.ts +0 -6
- package/lib/dialog/index.d.ts +0 -10
- package/lib/dialog/types.d.ts +0 -68
- package/lib/dialog/types.js +0 -5
- package/lib/drawer/Content.d.ts +0 -7
- package/lib/drawer/Drawer.d.ts +0 -7
- package/lib/drawer/Header.d.ts +0 -7
- package/lib/drawer/helpers.d.ts +0 -7
- package/lib/drawer/index.d.ts +0 -9
- package/lib/drawer/types.d.ts +0 -34
- package/lib/drawer/types.js +0 -5
- package/lib/dropdown/Popup.d.ts +0 -6
- package/lib/dropdown/helper.d.ts +0 -4
- package/lib/dropdown/types.d.ts +0 -43
- package/lib/dropdown/types.js +0 -5
- package/lib/dropdown/withDropdown.d.ts +0 -10
- package/lib/fieldset/index.d.ts +0 -8
- package/lib/fieldset/types.d.ts +0 -28
- package/lib/fieldset/types.js +0 -5
- package/lib/form/Field.d.ts +0 -6
- package/lib/form/FieldArray.d.ts +0 -6
- package/lib/form/FieldNumber.d.ts +0 -6
- package/lib/form/FieldPeriod.d.ts +0 -6
- package/lib/form/helpers.d.ts +0 -11
- package/lib/form/index.d.ts +0 -9
- package/lib/form/types.d.ts +0 -168
- package/lib/form/types.js +0 -5
- package/lib/form/withFieldHOC.d.ts +0 -6
- package/lib/form/withFormSecurity.d.ts +0 -7
- package/lib/gridlayout/GridCol.d.ts +0 -6
- package/lib/gridlayout/GridRow.d.ts +0 -6
- package/lib/gridlayout/index.d.ts +0 -5
- package/lib/gridlayout/types.d.ts +0 -20
- package/lib/gridlayout/types.js +0 -5
- package/lib/icons/helper.d.ts +0 -560
- package/lib/icons/index.d.ts +0 -8
- package/lib/icons/types.d.ts +0 -28
- package/lib/icons/types.js +0 -5
- package/lib/index.d.ts +0 -35
- package/lib/inputs/base/InputTextBase.d.ts +0 -8
- package/lib/inputs/base/helpers.d.ts +0 -14
- package/lib/inputs/base/types.d.ts +0 -68
- package/lib/inputs/base/types.js +0 -5
- package/lib/inputs/color/index.d.ts +0 -7
- package/lib/inputs/color/types.d.ts +0 -14
- package/lib/inputs/color/types.js +0 -5
- package/lib/inputs/date/Dialog.d.ts +0 -10
- package/lib/inputs/date/Dropdown.d.ts +0 -10
- package/lib/inputs/date/helpers.d.ts +0 -14
- package/lib/inputs/date/index.d.ts +0 -10
- package/lib/inputs/date/types.d.ts +0 -53
- package/lib/inputs/date/types.js +0 -5
- package/lib/inputs/inputHOC.d.ts +0 -11
- package/lib/inputs/mask/BaseMask.d.ts +0 -12
- package/lib/inputs/mask/Cnpj.d.ts +0 -12
- package/lib/inputs/mask/Cpf.d.ts +0 -12
- package/lib/inputs/mask/Phone.d.ts +0 -9
- package/lib/inputs/mask/ZipCode.d.ts +0 -9
- package/lib/inputs/mask/helpers.d.ts +0 -14
- package/lib/inputs/mask/imaskHOC.d.ts +0 -14
- package/lib/inputs/mask/index.d.ts +0 -11
- package/lib/inputs/mask/types.d.ts +0 -66
- package/lib/inputs/mask/types.js +0 -5
- package/lib/inputs/multiSelect/ActionButtons.d.ts +0 -10
- package/lib/inputs/multiSelect/Dropdown.d.ts +0 -10
- package/lib/inputs/multiSelect/helper.d.ts +0 -9
- package/lib/inputs/multiSelect/index.d.ts +0 -10
- package/lib/inputs/multiSelect/types.d.ts +0 -49
- package/lib/inputs/multiSelect/types.js +0 -5
- package/lib/inputs/number/BaseNumber.d.ts +0 -12
- package/lib/inputs/number/Currency.d.ts +0 -12
- package/lib/inputs/number/Decimal.d.ts +0 -12
- package/lib/inputs/number/format_number.d.ts +0 -4
- package/lib/inputs/number/index.d.ts +0 -14
- package/lib/inputs/number/types.d.ts +0 -30
- package/lib/inputs/number/types.js +0 -5
- package/lib/inputs/period/Dialog.d.ts +0 -11
- package/lib/inputs/period/Dropdown.d.ts +0 -11
- package/lib/inputs/period/PeriodList.d.ts +0 -11
- package/lib/inputs/period/helper.d.ts +0 -19
- package/lib/inputs/period/index.d.ts +0 -11
- package/lib/inputs/period/types.d.ts +0 -58
- package/lib/inputs/period/types.js +0 -5
- package/lib/inputs/search/index.d.ts +0 -11
- package/lib/inputs/select/ActionButtons.d.ts +0 -11
- package/lib/inputs/select/Dropdown.d.ts +0 -11
- package/lib/inputs/select/helper.d.ts +0 -25
- package/lib/inputs/select/index.d.ts +0 -10
- package/lib/inputs/select/multiple/Selecteds.d.ts +0 -10
- package/lib/inputs/select/multiple/index.d.ts +0 -10
- package/lib/inputs/select/simple/index.d.ts +0 -10
- package/lib/inputs/select/types.d.ts +0 -98
- package/lib/inputs/select/types.js +0 -5
- package/lib/inputs/text/index.d.ts +0 -11
- package/lib/inputs/text/types.d.ts +0 -25
- package/lib/inputs/text/types.js +0 -5
- package/lib/inputs/textarea/index.d.ts +0 -9
- package/lib/inputs/textarea/types.d.ts +0 -13
- package/lib/inputs/textarea/types.js +0 -5
- package/lib/inputs/types.d.ts +0 -146
- package/lib/inputs/types.js +0 -5
- package/lib/internals/colorStyles.d.ts +0 -9
- package/lib/internals/constants.d.ts +0 -11
- package/lib/internals/types.d.ts +0 -21
- package/lib/internals/types.js +0 -5
- package/lib/internals/withTooltip.d.ts +0 -11
- package/lib/labelMessages/index.d.ts +0 -7
- package/lib/labelMessages/types.d.ts +0 -18
- package/lib/labelMessages/types.js +0 -5
- package/lib/labels/DangerLabel.d.ts +0 -9
- package/lib/labels/DefaultLabel.d.ts +0 -12
- package/lib/labels/InfoLabel.d.ts +0 -9
- package/lib/labels/PrimaryLabel.d.ts +0 -9
- package/lib/labels/SuccessLabel.d.ts +0 -9
- package/lib/labels/WarningLabel.d.ts +0 -9
- package/lib/labels/index.d.ts +0 -13
- package/lib/labels/label_container/index.d.ts +0 -12
- package/lib/labels/types.d.ts +0 -24
- package/lib/labels/types.js +0 -5
- package/lib/list/Header.d.ts +0 -7
- package/lib/list/Item.d.ts +0 -7
- package/lib/list/Separator.d.ts +0 -3
- package/lib/list/helpers.d.ts +0 -12
- package/lib/list/index.d.ts +0 -10
- package/lib/list/types.d.ts +0 -64
- package/lib/list/types.js +0 -5
- package/lib/menus/float/MenuItem.d.ts +0 -7
- package/lib/menus/float/helpers.d.ts +0 -7
- package/lib/menus/float/index.d.ts +0 -8
- package/lib/menus/float/types.d.ts +0 -27
- package/lib/menus/float/types.js +0 -5
- package/lib/menus/index.d.ts +0 -6
- package/lib/menus/sidenav/ExpandMenu.d.ts +0 -10
- package/lib/menus/sidenav/MenuLink.d.ts +0 -13
- package/lib/menus/sidenav/NavMenuGroup.d.ts +0 -10
- package/lib/menus/sidenav/NavMenuItem.d.ts +0 -13
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +0 -10
- package/lib/menus/sidenav/helpers.d.ts +0 -12
- package/lib/menus/sidenav/index.d.ts +0 -14
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +0 -10
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +0 -10
- package/lib/menus/sidenav/types.d.ts +0 -82
- package/lib/menus/sidenav/types.js +0 -5
- package/lib/noPermission/index.d.ts +0 -3
- package/lib/panel/Content.d.ts +0 -8
- package/lib/panel/DangerPanel.d.ts +0 -8
- package/lib/panel/Default.d.ts +0 -8
- package/lib/panel/Header.d.ts +0 -8
- package/lib/panel/InfoPanel.d.ts +0 -8
- package/lib/panel/PrimaryPanel.d.ts +0 -8
- package/lib/panel/SuccessPanel.d.ts +0 -8
- package/lib/panel/ToolBar.d.ts +0 -8
- package/lib/panel/WarningPanel.d.ts +0 -8
- package/lib/panel/helpers.d.ts +0 -4
- package/lib/panel/index.d.ts +0 -13
- package/lib/panel/types.d.ts +0 -4
- package/lib/panel/types.js +0 -5
- package/lib/permissionValidations.d.ts +0 -14
- package/lib/popover/PopoverText.d.ts +0 -8
- package/lib/popover/PopoverTitle.d.ts +0 -8
- package/lib/popover/index.d.ts +0 -13
- package/lib/popover/types.d.ts +0 -21
- package/lib/popover/types.js +0 -5
- package/lib/progress/Bar.d.ts +0 -6
- package/lib/progress/index.d.ts +0 -7
- package/lib/progress/types.d.ts +0 -37
- package/lib/progress/types.js +0 -5
- package/lib/radio/index.d.ts +0 -12
- package/lib/radio/types.d.ts +0 -18
- package/lib/radio/types.js +0 -5
- package/lib/skeleton/SkeletonContainer.d.ts +0 -7
- package/lib/skeleton/index.d.ts +0 -8
- package/lib/skeleton/types.d.ts +0 -21
- package/lib/skeleton/types.js +0 -5
- package/lib/spinner/SpinnerLoading.d.ts +0 -7
- package/lib/spinner/index.d.ts +0 -7
- package/lib/spinner/types.d.ts +0 -20
- package/lib/spinner/types.js +0 -5
- package/lib/split/Split.d.ts +0 -6
- package/lib/split/SplitSide.d.ts +0 -6
- package/lib/split/helpers.d.ts +0 -10
- package/lib/split/index.d.ts +0 -5
- package/lib/split/types.d.ts +0 -34
- package/lib/split/types.js +0 -5
- package/lib/table/Body.d.ts +0 -6
- package/lib/table/Header.d.ts +0 -6
- package/lib/table/HeaderColumn.d.ts +0 -6
- package/lib/table/Row.d.ts +0 -6
- package/lib/table/RowColumn.d.ts +0 -6
- package/lib/table/helpers.d.ts +0 -8
- package/lib/table/index.d.ts +0 -11
- package/lib/table/types.d.ts +0 -84
- package/lib/table/types.js +0 -5
- package/lib/tabs/DropdownItems.d.ts +0 -9
- package/lib/tabs/Menu.d.ts +0 -9
- package/lib/tabs/MenuItems.d.ts +0 -9
- package/lib/tabs/Panel.d.ts +0 -9
- package/lib/tabs/index.d.ts +0 -10
- package/lib/tabs/tabHelpers.d.ts +0 -21
- package/lib/tabs/types.d.ts +0 -63
- package/lib/tabs/types.js +0 -5
- package/lib/toolbar/ButtonBar.d.ts +0 -10
- package/lib/toolbar/LabelBar.d.ts +0 -10
- package/lib/toolbar/Separator.d.ts +0 -3
- package/lib/toolbar/ToolBarGroup.d.ts +0 -10
- package/lib/toolbar/helpers.d.ts +0 -10
- package/lib/toolbar/index.d.ts +0 -14
- package/lib/toolbar/types.d.ts +0 -43
- package/lib/toolbar/types.js +0 -5
- package/lib/tooltip/index.d.ts +0 -6
- package/lib/tooltip/types.d.ts +0 -16
- package/lib/tooltip/types.js +0 -5
- package/lib/treeview/Header.d.ts +0 -7
- package/lib/treeview/Node.d.ts +0 -7
- package/lib/treeview/constants.d.ts +0 -7
- package/lib/treeview/index.d.ts +0 -9
- package/lib/treeview/types.d.ts +0 -104
- package/lib/treeview/types.js +0 -5
- package/lib/types-3c6f1c20.d.ts +0 -46
- package/lib/uitour/helpers.d.ts +0 -8
- package/lib/uitour/index.d.ts +0 -6
- package/lib/uitour/types.d.ts +0 -30
- package/lib/uitour/types.js +0 -5
- package/tsconfig.json +0 -32
- package/tsup.config.ts +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,6 +9,8 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
12
14
|
var _InputTextBase = _interopRequireDefault(require("../base/InputTextBase"));
|
|
13
15
|
|
|
14
16
|
var _buttons = _interopRequireDefault(require("../../buttons"));
|
|
@@ -29,160 +31,290 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
29
31
|
|
|
30
32
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
31
33
|
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
32
36
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
33
37
|
|
|
34
38
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
35
39
|
|
|
36
|
-
function
|
|
40
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
41
|
|
|
38
|
-
function
|
|
42
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
39
43
|
|
|
40
|
-
function
|
|
44
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
41
45
|
|
|
42
|
-
function
|
|
46
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
43
47
|
|
|
44
|
-
function
|
|
48
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
45
49
|
|
|
46
|
-
function
|
|
50
|
+
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
47
51
|
|
|
48
|
-
function
|
|
52
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
53
|
|
|
50
|
-
var
|
|
51
|
-
var _props$resetButton = props.resetButton,
|
|
52
|
-
resetButton = _props$resetButton === void 0 ? true : _props$resetButton,
|
|
53
|
-
advancedFilterProps = props.advancedFilterProps,
|
|
54
|
-
value = props.value;
|
|
54
|
+
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); }; }
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
-
advancedFilterOpened = _useState2[0],
|
|
59
|
-
setAdvancedFilterOpened = _useState2[1];
|
|
56
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
-
valorCampo = _useState4[0],
|
|
64
|
-
setValorCampo = _useState4[1];
|
|
58
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
68
|
-
onDenied = _useState6[0],
|
|
69
|
-
setOnDenied = _useState6[1];
|
|
60
|
+
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; } }
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
if (props.onReset) props.onReset(event);
|
|
73
|
-
setValorCampo('');
|
|
74
|
-
};
|
|
62
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
75
63
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (props.onChange) props.onChange(event);
|
|
79
|
-
setValorCampo(event.target.value);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
var shouldDisable = function shouldDisable() {
|
|
84
|
-
return props.disabled || onDenied && (onDenied.disabled || onDenied.hideContent);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
var shouldBeReadOnly = function shouldBeReadOnly() {
|
|
88
|
-
return props.readOnly || onDenied && onDenied.readOnly;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var hideContent = onDenied && onDenied.hideContent;
|
|
92
|
-
|
|
93
|
-
var buttonProps = function buttonProps() {
|
|
94
|
-
var _ref = advancedFilterProps || {},
|
|
95
|
-
onStateChange = _ref.onStateChange;
|
|
96
|
-
|
|
97
|
-
var disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
|
|
98
|
-
var propsButton = {
|
|
99
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
100
|
-
name: "filter1",
|
|
101
|
-
color: "#a9a8a8",
|
|
102
|
-
key: "filter-icon"
|
|
103
|
-
}),
|
|
104
|
-
key: 'advanced-filter-button',
|
|
105
|
-
boxShadow: false,
|
|
106
|
-
readOnly: shouldBeReadOnly(),
|
|
107
|
-
style: {
|
|
108
|
-
padding: '0 0 0 5px',
|
|
109
|
-
width: 30
|
|
110
|
-
},
|
|
111
|
-
transparent: true,
|
|
112
|
-
disabled: shouldDisable()
|
|
113
|
-
};
|
|
64
|
+
var SearchField = /*#__PURE__*/function (_Component) {
|
|
65
|
+
_inherits(SearchField, _Component);
|
|
114
66
|
|
|
115
|
-
|
|
116
|
-
propsButton = _extends({}, propsButton, {
|
|
117
|
-
onClick: function onClick(e) {
|
|
118
|
-
if (props.onClick) props.onClick(e);
|
|
119
|
-
setAdvancedFilterOpened(!advancedFilterOpened);
|
|
120
|
-
if (onStateChange) onStateChange(!advancedFilterOpened);
|
|
121
|
-
}
|
|
122
|
-
}, propsButton);
|
|
123
|
-
}
|
|
67
|
+
var _super = _createSuper(SearchField);
|
|
124
68
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
var enableFilterButton = advancedFilterProps !== undefined;
|
|
130
|
-
var elements = [/*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
131
|
-
name: "search",
|
|
132
|
-
color: "#a9a8a8",
|
|
133
|
-
key: "search-icon",
|
|
134
|
-
disabled: shouldDisable()
|
|
135
|
-
})];
|
|
136
|
-
|
|
137
|
-
var resetButtonIcon = /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
138
|
-
name: "cancel2",
|
|
139
|
-
color: "#a9a8a8",
|
|
140
|
-
key: "inputSearchIcon",
|
|
141
|
-
style: {
|
|
142
|
-
cursor: 'pointer',
|
|
143
|
-
pointerEvents: 'auto'
|
|
144
|
-
},
|
|
145
|
-
onClick: onReset
|
|
146
|
-
});
|
|
69
|
+
function SearchField() {
|
|
70
|
+
var _this;
|
|
71
|
+
|
|
72
|
+
_classCallCheck(this, SearchField);
|
|
147
73
|
|
|
148
|
-
|
|
74
|
+
_this = _super.call(this);
|
|
75
|
+
Object.defineProperty(_assertThisInitialized(_this), "onReset", {
|
|
76
|
+
configurable: true,
|
|
77
|
+
enumerable: true,
|
|
78
|
+
writable: true,
|
|
79
|
+
value: function value(event) {
|
|
80
|
+
var onReset = _this.props.onReset;
|
|
81
|
+
if (onReset) onReset(event);
|
|
149
82
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
83
|
+
_this.setState({
|
|
84
|
+
value: ''
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(_assertThisInitialized(_this), "onChange", {
|
|
89
|
+
configurable: true,
|
|
90
|
+
enumerable: true,
|
|
91
|
+
writable: true,
|
|
92
|
+
value: function value(event) {
|
|
93
|
+
var onChange = _this.props.onChange;
|
|
94
|
+
if (onChange) onChange(event);
|
|
95
|
+
|
|
96
|
+
_this.setState({
|
|
97
|
+
value: event.target.value
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(_assertThisInitialized(_this), "onReset", {
|
|
102
|
+
configurable: true,
|
|
103
|
+
enumerable: true,
|
|
104
|
+
writable: true,
|
|
105
|
+
value: function value(event) {
|
|
106
|
+
var onReset = _this.props.onReset;
|
|
107
|
+
if (onReset) onReset(event);
|
|
108
|
+
|
|
109
|
+
_this.setState({
|
|
110
|
+
value: ''
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(_assertThisInitialized(_this), "setOnDenied", {
|
|
115
|
+
configurable: true,
|
|
116
|
+
enumerable: true,
|
|
117
|
+
writable: true,
|
|
118
|
+
value: function value(onDenied) {
|
|
119
|
+
_this.setState({
|
|
120
|
+
onDenied: onDenied
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(_assertThisInitialized(_this), "shouldDisable", {
|
|
125
|
+
configurable: true,
|
|
126
|
+
enumerable: true,
|
|
127
|
+
writable: true,
|
|
128
|
+
value: function value() {
|
|
129
|
+
var disabled = _this.props.disabled;
|
|
130
|
+
var onDenied = _this.state.onDenied;
|
|
131
|
+
return disabled || onDenied && (onDenied.disabled || onDenied.hideContent);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(_assertThisInitialized(_this), "shouldBeReadOnly", {
|
|
135
|
+
configurable: true,
|
|
136
|
+
enumerable: true,
|
|
137
|
+
writable: true,
|
|
138
|
+
value: function value() {
|
|
139
|
+
var readOnly = _this.props.readOnly;
|
|
140
|
+
var onDenied = _this.state.onDenied;
|
|
141
|
+
return readOnly || onDenied && onDenied.readOnly;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(_assertThisInitialized(_this), "buttonProps", {
|
|
145
|
+
configurable: true,
|
|
146
|
+
enumerable: true,
|
|
147
|
+
writable: true,
|
|
148
|
+
value: function value() {
|
|
149
|
+
var advancedFilterOpened = _this.state.advancedFilterOpened;
|
|
150
|
+
var _this$props = _this.props,
|
|
151
|
+
_onClick = _this$props.onClick,
|
|
152
|
+
advancedFilterProps = _this$props.advancedFilterProps;
|
|
153
|
+
|
|
154
|
+
var _ref = advancedFilterProps || {},
|
|
155
|
+
onStateChange = _ref.onStateChange;
|
|
156
|
+
|
|
157
|
+
var disableCallbacks = _this.shouldBeReadOnly() || _this.shouldDisable() || _this.hideContent;
|
|
158
|
+
|
|
159
|
+
var propsButton = {
|
|
160
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
161
|
+
name: "filter1",
|
|
162
|
+
color: "#a9a8a8",
|
|
163
|
+
key: "filter-icon"
|
|
164
|
+
}),
|
|
165
|
+
key: 'advanced-filter-button',
|
|
166
|
+
boxShadow: false,
|
|
167
|
+
readOnly: _this.shouldBeReadOnly(),
|
|
168
|
+
style: {
|
|
169
|
+
padding: '0 0 0 5px',
|
|
170
|
+
width: 30
|
|
171
|
+
},
|
|
172
|
+
transparent: true,
|
|
173
|
+
disabled: _this.shouldDisable(),
|
|
174
|
+
cursor: true
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
if (!disableCallbacks) {
|
|
178
|
+
propsButton = _extends({}, propsButton, {
|
|
179
|
+
onClick: function onClick(e) {
|
|
180
|
+
if (_onClick) _onClick(e);
|
|
181
|
+
|
|
182
|
+
_this.setState({
|
|
183
|
+
advancedFilterOpened: !advancedFilterOpened
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
if (onStateChange) onStateChange(!advancedFilterOpened);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
154
190
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
191
|
+
return propsButton;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(_assertThisInitialized(_this), "rightElements", {
|
|
195
|
+
configurable: true,
|
|
196
|
+
enumerable: true,
|
|
197
|
+
writable: true,
|
|
198
|
+
value: function value() {
|
|
199
|
+
var _this$props2 = _this.props,
|
|
200
|
+
resetButton = _this$props2.resetButton,
|
|
201
|
+
advancedFilterProps = _this$props2.advancedFilterProps;
|
|
202
|
+
var enableFilterButton = advancedFilterProps !== undefined;
|
|
203
|
+
var elements = [/*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
204
|
+
name: "search",
|
|
205
|
+
color: "#a9a8a8",
|
|
206
|
+
key: "search-icon",
|
|
207
|
+
disabled: _this.shouldDisable()
|
|
208
|
+
})];
|
|
209
|
+
|
|
210
|
+
var resetButtonIcon = /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
211
|
+
name: "cancel2",
|
|
212
|
+
color: "#a9a8a8",
|
|
213
|
+
key: "inputSearchIcon",
|
|
214
|
+
style: {
|
|
215
|
+
cursor: 'pointer',
|
|
216
|
+
pointerEvents: 'auto'
|
|
217
|
+
},
|
|
218
|
+
onClick: _this.onReset
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
var filterButton = /*#__PURE__*/_react.default.createElement(_buttons.default, _this.buttonProps());
|
|
222
|
+
|
|
223
|
+
if (enableFilterButton) elements = [].concat(_toConsumableArray(elements), [filterButton]);
|
|
224
|
+
if (resetButton && _this.state.value.trim() !== '') elements = [resetButtonIcon].concat(_toConsumableArray(elements));
|
|
225
|
+
return elements;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
_this.state = {
|
|
229
|
+
advancedFilterOpened: false,
|
|
230
|
+
value: '',
|
|
231
|
+
onDenied: undefined
|
|
232
|
+
};
|
|
233
|
+
return _this;
|
|
234
|
+
}
|
|
159
235
|
|
|
160
|
-
(
|
|
161
|
-
|
|
162
|
-
|
|
236
|
+
_createClass(SearchField, [{
|
|
237
|
+
key: "render",
|
|
238
|
+
value: function render() {
|
|
239
|
+
var _this2 = this;
|
|
240
|
+
|
|
241
|
+
var _this$state = this.state,
|
|
242
|
+
advancedFilterOpened = _this$state.advancedFilterOpened,
|
|
243
|
+
onDenied = _this$state.onDenied;
|
|
244
|
+
var advancedFilterProps = this.props.advancedFilterProps;
|
|
245
|
+
|
|
246
|
+
var _ref2 = advancedFilterProps || {},
|
|
247
|
+
headerTitle = _ref2.headerTitle,
|
|
248
|
+
content = _ref2.content,
|
|
249
|
+
onStateChange = _ref2.onStateChange;
|
|
250
|
+
|
|
251
|
+
if (onDenied && onDenied.unvisible) return null;
|
|
252
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, this.props, {
|
|
253
|
+
style: {
|
|
254
|
+
heigth: 40
|
|
255
|
+
},
|
|
256
|
+
onReset: this.onReset,
|
|
257
|
+
onChange: this.onChange,
|
|
258
|
+
value: this.state.value,
|
|
259
|
+
customClass: "",
|
|
260
|
+
handlerSetOnDenied: this.setOnDenied,
|
|
261
|
+
rightElements: this.rightElements()
|
|
262
|
+
})), advancedFilterOpened && /*#__PURE__*/_react.default.createElement(_drawer.default, _extends({
|
|
263
|
+
handlerClose: function handlerClose() {
|
|
264
|
+
_this2.setState({
|
|
265
|
+
advancedFilterOpened: false
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
if (onStateChange) onStateChange(false);
|
|
269
|
+
}
|
|
270
|
+
}, advancedFilterProps), headerTitle && /*#__PURE__*/_react.default.createElement(_drawer.DrawerHeader, {
|
|
271
|
+
title: headerTitle
|
|
272
|
+
}), /*#__PURE__*/_react.default.createElement(_drawer.DrawerContent, null, content)));
|
|
273
|
+
}
|
|
274
|
+
}]);
|
|
275
|
+
|
|
276
|
+
return SearchField;
|
|
277
|
+
}(_react.Component);
|
|
278
|
+
|
|
279
|
+
Object.defineProperty(SearchField, "getDerivedStateFromProps", {
|
|
280
|
+
configurable: true,
|
|
281
|
+
enumerable: true,
|
|
282
|
+
writable: true,
|
|
283
|
+
value: function value(props, state) {
|
|
284
|
+
var value = props.value;
|
|
285
|
+
|
|
286
|
+
if (value !== undefined && value !== state.value) {
|
|
287
|
+
return {
|
|
288
|
+
value: value
|
|
289
|
+
};
|
|
163
290
|
}
|
|
164
|
-
}, []);
|
|
165
291
|
|
|
166
|
-
if (onDenied && onDenied.unvisible) {
|
|
167
292
|
return null;
|
|
168
293
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
294
|
+
});
|
|
295
|
+
SearchField.propTypes = {
|
|
296
|
+
resetButton: _propTypes.default.bool,
|
|
297
|
+
onReset: _propTypes.default.func,
|
|
298
|
+
onChange: _propTypes.default.func,
|
|
299
|
+
onClick: _propTypes.default.func,
|
|
300
|
+
advancedFilterProps: _propTypes.default.object,
|
|
301
|
+
disabled: _propTypes.default.bool,
|
|
302
|
+
readOnly: _propTypes.default.bool,
|
|
303
|
+
value: _propTypes.default.string,
|
|
304
|
+
placeHolder: _propTypes.default.string,
|
|
305
|
+
permissionAttr: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.arrayOf(_propTypes.default.object)])
|
|
306
|
+
};
|
|
307
|
+
SearchField.defaultProps = {
|
|
308
|
+
resetButton: true,
|
|
309
|
+
onReset: undefined,
|
|
310
|
+
onChange: undefined,
|
|
311
|
+
onClick: undefined,
|
|
312
|
+
advancedFilterProps: undefined,
|
|
313
|
+
disabled: false,
|
|
314
|
+
readOnly: false,
|
|
315
|
+
value: undefined,
|
|
316
|
+
placeHolder: '',
|
|
317
|
+
permissionAttr: undefined
|
|
185
318
|
};
|
|
186
|
-
|
|
187
319
|
var _default = SearchField;
|
|
188
320
|
exports.default = _default;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
|
|
9
|
+
require("@testing-library/jest-dom/extend-expect");
|
|
10
|
+
|
|
11
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
12
|
+
|
|
13
|
+
var _storageMock = _interopRequireWildcard(require("../../../../config/jest/storageMock"));
|
|
14
|
+
|
|
15
|
+
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); }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
+
|
|
23
|
+
var searchField = function searchField(fieldProps, advancedFilterProps) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, _extends({
|
|
25
|
+
advancedFilterProps: _extends({
|
|
26
|
+
headerTitle: 'Pesquisa Avançada',
|
|
27
|
+
content: 'Conteúdo da Pesquisa'
|
|
28
|
+
}, advancedFilterProps)
|
|
29
|
+
}, fieldProps));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
describe('SearchField', function () {
|
|
33
|
+
it('should render correctly', function () {
|
|
34
|
+
var _render = (0, _react2.render)(searchField()),
|
|
35
|
+
container = _render.container;
|
|
36
|
+
|
|
37
|
+
expect(container.firstChild).toBeTruthy();
|
|
38
|
+
});
|
|
39
|
+
it('should be apply value', function () {
|
|
40
|
+
var value = '1 ';
|
|
41
|
+
|
|
42
|
+
var _render2 = (0, _react2.render)(searchField({
|
|
43
|
+
value: value
|
|
44
|
+
})),
|
|
45
|
+
container = _render2.container;
|
|
46
|
+
|
|
47
|
+
var inputHTML = container.querySelector('.textinput');
|
|
48
|
+
expect(inputHTML.value).toBe(value);
|
|
49
|
+
});
|
|
50
|
+
it('should apply textAlign', function () {
|
|
51
|
+
var textAlign = 'left';
|
|
52
|
+
|
|
53
|
+
var _render3 = (0, _react2.render)(searchField({
|
|
54
|
+
textAlign: textAlign
|
|
55
|
+
})),
|
|
56
|
+
container = _render3.container;
|
|
57
|
+
|
|
58
|
+
var inputHTML = container.querySelector('.textinput');
|
|
59
|
+
expect(inputHTML).toHaveClass("text-align-".concat(textAlign));
|
|
60
|
+
});
|
|
61
|
+
it('should apply resetButton and execute onReset callback', function () {
|
|
62
|
+
var onReset = jest.fn();
|
|
63
|
+
|
|
64
|
+
var _render4 = (0, _react2.render)(searchField({
|
|
65
|
+
onReset: onReset,
|
|
66
|
+
resetButton: true,
|
|
67
|
+
value: 'foo'
|
|
68
|
+
})),
|
|
69
|
+
getAllByTestId = _render4.getAllByTestId;
|
|
70
|
+
|
|
71
|
+
_react2.fireEvent.click(getAllByTestId('icon')[0]);
|
|
72
|
+
|
|
73
|
+
expect(onReset).toBeCalled();
|
|
74
|
+
});
|
|
75
|
+
describe('advancedFilterProps', function () {
|
|
76
|
+
it('should drawerHeader content headerTitle', function () {
|
|
77
|
+
var _render5 = (0, _react2.render)(searchField()),
|
|
78
|
+
container = _render5.container;
|
|
79
|
+
|
|
80
|
+
_react2.fireEvent.click(container.querySelector('.button-component'));
|
|
81
|
+
|
|
82
|
+
expect(document.querySelector('.drawerheader')).toHaveTextContent('Pesquisa Avançada');
|
|
83
|
+
});
|
|
84
|
+
it('should drawerContent to have content', function () {
|
|
85
|
+
var _render6 = (0, _react2.render)(searchField()),
|
|
86
|
+
container = _render6.container;
|
|
87
|
+
|
|
88
|
+
_react2.fireEvent.click(container.querySelector('.button-component'));
|
|
89
|
+
|
|
90
|
+
expect(document.querySelector('.drawercontent')).toHaveTextContent('Conteúdo da Pesquisa');
|
|
91
|
+
});
|
|
92
|
+
it('should execute onStateChange on Drawer Open', function () {
|
|
93
|
+
var onStateChange = jest.fn();
|
|
94
|
+
|
|
95
|
+
var _render7 = (0, _react2.render)(searchField({}, {
|
|
96
|
+
onStateChange: onStateChange
|
|
97
|
+
})),
|
|
98
|
+
container = _render7.container;
|
|
99
|
+
|
|
100
|
+
_react2.fireEvent.click(container.querySelector('.button-component'));
|
|
101
|
+
|
|
102
|
+
expect(onStateChange).toBeCalledTimes(1);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
describe('Permission', function () {
|
|
106
|
+
var setSessionStorageMock = function setSessionStorageMock() {
|
|
107
|
+
Object.defineProperty(window, 'sessionStorage', {
|
|
108
|
+
value: (0, _storageMock.default)()
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
it('should render subject when permission granted', function () {
|
|
113
|
+
setSessionStorageMock();
|
|
114
|
+
var permissionAttr = (0, _storageMock.permissionAttrMockAuthorized)('unvisible');
|
|
115
|
+
|
|
116
|
+
var _render8 = (0, _react2.render)(searchField({
|
|
117
|
+
permissionAttr: permissionAttr
|
|
118
|
+
})),
|
|
119
|
+
container = _render8.container;
|
|
120
|
+
|
|
121
|
+
expect(container.querySelector('.input-base-component')).not.toBeNull();
|
|
122
|
+
});
|
|
123
|
+
it('should check permission, be unavaible and onDenied is unvisible', function () {
|
|
124
|
+
setSessionStorageMock();
|
|
125
|
+
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('unvisible');
|
|
126
|
+
|
|
127
|
+
var _render9 = (0, _react2.render)(searchField({
|
|
128
|
+
permissionAttr: permissionAttr
|
|
129
|
+
})),
|
|
130
|
+
container = _render9.container;
|
|
131
|
+
|
|
132
|
+
expect(container.querySelector('.input-base-component')).toBeNull();
|
|
133
|
+
});
|
|
134
|
+
it('should check permission, be unavaible and onDenied is disabled', function () {
|
|
135
|
+
setSessionStorageMock();
|
|
136
|
+
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('disabled');
|
|
137
|
+
var onChange = jest.fn();
|
|
138
|
+
|
|
139
|
+
var _render10 = (0, _react2.render)(searchField({
|
|
140
|
+
permissionAttr: permissionAttr,
|
|
141
|
+
onChange: onChange
|
|
142
|
+
})),
|
|
143
|
+
container = _render10.container;
|
|
144
|
+
|
|
145
|
+
var inputHTML = container.querySelector('.textinput');
|
|
146
|
+
var inputWrapper = container.querySelector('.inputwrapper');
|
|
147
|
+
|
|
148
|
+
_react2.fireEvent.change(inputHTML, {
|
|
149
|
+
target: {
|
|
150
|
+
value: 'sus'
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
expect(inputHTML.disabled).toBeTruthy();
|
|
155
|
+
expect(onChange).not.toBeCalled();
|
|
156
|
+
expect(inputWrapper).toHaveClass('-disabled');
|
|
157
|
+
});
|
|
158
|
+
it('should check permission, be unavaible and onDenied is readOnly', function () {
|
|
159
|
+
setSessionStorageMock();
|
|
160
|
+
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('disabled');
|
|
161
|
+
var onChange = jest.fn();
|
|
162
|
+
|
|
163
|
+
var _render11 = (0, _react2.render)(searchField({
|
|
164
|
+
permissionAttr: permissionAttr,
|
|
165
|
+
onChange: onChange
|
|
166
|
+
})),
|
|
167
|
+
container = _render11.container;
|
|
168
|
+
|
|
169
|
+
var inputHTML = container.querySelector('.textinput');
|
|
170
|
+
var inputWrapper = container.querySelector('.inputwrapper');
|
|
171
|
+
|
|
172
|
+
_react2.fireEvent.change(inputHTML, {
|
|
173
|
+
target: {
|
|
174
|
+
value: 'sus'
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
expect(inputHTML.disabled).toBeTruthy();
|
|
179
|
+
expect(onChange).not.toBeCalled();
|
|
180
|
+
expect(inputWrapper).toHaveClass('-disabled');
|
|
181
|
+
});
|
|
182
|
+
it('should check permission, be unavaible and onDenied is hideContent', function () {
|
|
183
|
+
setSessionStorageMock();
|
|
184
|
+
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('hideContent');
|
|
185
|
+
var onChange = jest.fn();
|
|
186
|
+
|
|
187
|
+
var _render12 = (0, _react2.render)(searchField({
|
|
188
|
+
permissionAttr: permissionAttr,
|
|
189
|
+
onChange: onChange,
|
|
190
|
+
value: 'text'
|
|
191
|
+
})),
|
|
192
|
+
container = _render12.container;
|
|
193
|
+
|
|
194
|
+
var inputHTML = container.querySelector('.textinput');
|
|
195
|
+
var inputWrapper = container.querySelector('.inputwrapper');
|
|
196
|
+
|
|
197
|
+
_react2.fireEvent.change(inputHTML, {
|
|
198
|
+
target: {
|
|
199
|
+
value: 'sus'
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
expect(inputHTML.value).toBe('');
|
|
204
|
+
expect(inputHTML.disabled).toBeTruthy();
|
|
205
|
+
expect(onChange).not.toBeCalled();
|
|
206
|
+
expect(inputWrapper).toHaveClass('-disabled');
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
});
|