linear-react-components-ui 1.1.20-beta.31 → 1.1.20-beta.33
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/package.json +1 -1
- package/lib/@types/Align.d.ts +0 -4
- 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 -18
- package/lib/alerts/AlertContainer.js +0 -80
- package/lib/alerts/AlertProvider.d.ts +0 -9
- package/lib/alerts/AlertProvider.js +0 -73
- package/lib/alerts/BaseAlert.d.ts +0 -9
- package/lib/alerts/BaseAlert.js +0 -34
- package/lib/alerts/Message.d.ts +0 -9
- package/lib/alerts/Message.js +0 -114
- package/lib/alerts/helpers.d.ts +0 -9
- package/lib/alerts/helpers.js +0 -9
- package/lib/alerts/index.d.ts +0 -11
- package/lib/alerts/index.js +0 -16
- package/lib/alerts/types.d.ts +0 -51
- package/lib/alerts/types.js +0 -5
- package/lib/alerts/withAlert.d.ts +0 -9
- package/lib/alerts/withAlert.js +0 -24
- 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 +0 -149
- package/lib/assets/styles/avatar.scss +0 -42
- package/lib/assets/styles/badge.scss +0 -48
- package/lib/assets/styles/button.scss +0 -345
- package/lib/assets/styles/calendar.scss +0 -172
- package/lib/assets/styles/checkbox.scss +0 -108
- package/lib/assets/styles/colorpicker.scss +0 -17
- package/lib/assets/styles/colors.scss +0 -144
- package/lib/assets/styles/commons.scss +0 -138
- package/lib/assets/styles/datepicker.scss +0 -16
- package/lib/assets/styles/dialog.scss +0 -200
- package/lib/assets/styles/drawers.scss +0 -159
- package/lib/assets/styles/dropdown.scss +0 -179
- package/lib/assets/styles/effects.scss +0 -823
- package/lib/assets/styles/error.scss +0 -9
- package/lib/assets/styles/fieldset.scss +0 -96
- package/lib/assets/styles/file.scss +0 -224
- package/lib/assets/styles/floatMenu.scss +0 -17
- package/lib/assets/styles/fonts.scss +0 -86
- package/lib/assets/styles/form.scss +0 -23
- package/lib/assets/styles/gridlayout.scss +0 -2054
- package/lib/assets/styles/hint.scss +0 -30
- package/lib/assets/styles/icon.scss +0 -42
- package/lib/assets/styles/input.scss +0 -156
- package/lib/assets/styles/label.scss +0 -116
- package/lib/assets/styles/labelMessages.scss +0 -81
- package/lib/assets/styles/list.scss +0 -124
- package/lib/assets/styles/multiSelect.scss +0 -125
- package/lib/assets/styles/noPermission.scss +0 -25
- package/lib/assets/styles/numbers.scss +0 -5
- package/lib/assets/styles/panel.scss +0 -95
- package/lib/assets/styles/periodpicker.scss +0 -69
- package/lib/assets/styles/popover.scss +0 -44
- package/lib/assets/styles/progress.scss +0 -72
- package/lib/assets/styles/radio.scss +0 -156
- package/lib/assets/styles/search.scss +0 -13
- package/lib/assets/styles/select.scss +0 -155
- package/lib/assets/styles/shortcuts.scss +0 -59
- package/lib/assets/styles/sidenav.scss +0 -408
- package/lib/assets/styles/skeleton.scss +0 -48
- package/lib/assets/styles/spinner.scss +0 -34
- package/lib/assets/styles/split.scss +0 -80
- package/lib/assets/styles/table.scss +0 -179
- package/lib/assets/styles/tabs.scss +0 -266
- package/lib/assets/styles/textContent.scss +0 -9
- package/lib/assets/styles/toolbar.scss +0 -74
- package/lib/assets/styles/tooltip.scss +0 -95
- package/lib/assets/styles/treetable.scss +0 -100
- package/lib/assets/styles/treeview.scss +0 -96
- package/lib/assets/styles/uitour.scss +0 -112
- package/lib/assets/styles/wizard.scss +0 -125
- package/lib/avatar/index.d.ts +0 -12
- package/lib/avatar/index.js +0 -91
- 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/index.js +0 -30
- package/lib/badge/types.d.ts +0 -13
- package/lib/badge/types.js +0 -5
- package/lib/buttons/ActivateButton.d.ts +0 -11
- package/lib/buttons/ActivateButton.js +0 -14
- package/lib/buttons/AddButton.d.ts +0 -11
- package/lib/buttons/AddButton.js +0 -18
- package/lib/buttons/Button.d.ts +0 -14
- package/lib/buttons/Button.js +0 -23
- package/lib/buttons/ButtonGroups.d.ts +0 -8
- package/lib/buttons/ButtonGroups.js +0 -17
- package/lib/buttons/CancelButton.d.ts +0 -11
- package/lib/buttons/CancelButton.js +0 -23
- package/lib/buttons/DangerButton.d.ts +0 -11
- package/lib/buttons/DangerButton.js +0 -23
- package/lib/buttons/DefaultButton.d.ts +0 -14
- package/lib/buttons/DefaultButton.js +0 -176
- package/lib/buttons/DestroyButton.d.ts +0 -11
- package/lib/buttons/DestroyButton.js +0 -27
- package/lib/buttons/EditButton.d.ts +0 -11
- package/lib/buttons/EditButton.js +0 -14
- package/lib/buttons/InactivateButton.d.ts +0 -11
- package/lib/buttons/InactivateButton.js +0 -14
- package/lib/buttons/InfoButton.d.ts +0 -11
- package/lib/buttons/InfoButton.js +0 -23
- package/lib/buttons/PrimaryButton.d.ts +0 -11
- package/lib/buttons/PrimaryButton.js +0 -23
- package/lib/buttons/RestoreButton.d.ts +0 -11
- package/lib/buttons/RestoreButton.js +0 -14
- package/lib/buttons/SaveButton.d.ts +0 -11
- package/lib/buttons/SaveButton.js +0 -23
- package/lib/buttons/SuccessButton.d.ts +0 -11
- package/lib/buttons/SuccessButton.js +0 -23
- package/lib/buttons/WarningButton.d.ts +0 -11
- package/lib/buttons/WarningButton.js +0 -23
- package/lib/buttons/button_container/index.d.ts +0 -12
- package/lib/buttons/button_container/index.js +0 -30
- package/lib/buttons/index.d.ts +0 -26
- package/lib/buttons/index.js +0 -108
- package/lib/buttons/split_button/index.d.ts +0 -11
- package/lib/buttons/split_button/index.js +0 -57
- package/lib/buttons/types.d.ts +0 -49
- package/lib/buttons/types.js +0 -5
- package/lib/calendar/DangerCalendar.d.ts +0 -7
- package/lib/calendar/DangerCalendar.js +0 -23
- package/lib/calendar/InfoCalendar.d.ts +0 -7
- package/lib/calendar/InfoCalendar.js +0 -23
- package/lib/calendar/PrimaryCalendar.d.ts +0 -7
- package/lib/calendar/PrimaryCalendar.js +0 -23
- package/lib/calendar/SuccessCalendar.d.ts +0 -7
- package/lib/calendar/SuccessCalendar.js +0 -23
- package/lib/calendar/WarningCalendar.d.ts +0 -7
- package/lib/calendar/WarningCalendar.js +0 -23
- package/lib/calendar/base/Day.d.ts +0 -7
- package/lib/calendar/base/Day.js +0 -32
- package/lib/calendar/base/Month.d.ts +0 -7
- package/lib/calendar/base/Month.js +0 -37
- package/lib/calendar/base/Week.d.ts +0 -7
- package/lib/calendar/base/Week.js +0 -35
- package/lib/calendar/base/helpers.d.ts +0 -62
- package/lib/calendar/base/helpers.js +0 -117
- package/lib/calendar/base/index.d.ts +0 -7
- package/lib/calendar/base/index.js +0 -79
- package/lib/calendar/index.d.ts +0 -13
- package/lib/calendar/index.js +0 -44
- package/lib/calendar/types.d.ts +0 -25
- package/lib/calendar/types.js +0 -5
- package/lib/checkbox/index.d.ts +0 -13
- package/lib/checkbox/index.js +0 -145
- package/lib/checkbox/types.d.ts +0 -47
- package/lib/checkbox/types.js +0 -5
- package/lib/dialog/Alert.d.ts +0 -9
- package/lib/dialog/Alert.js +0 -28
- package/lib/dialog/Custom.d.ts +0 -9
- package/lib/dialog/Custom.js +0 -56
- package/lib/dialog/Error.d.ts +0 -9
- package/lib/dialog/Error.js +0 -28
- package/lib/dialog/Information.d.ts +0 -9
- package/lib/dialog/Information.js +0 -28
- package/lib/dialog/Question.d.ts +0 -9
- package/lib/dialog/Question.js +0 -60
- package/lib/dialog/Warning.d.ts +0 -9
- package/lib/dialog/Warning.js +0 -28
- package/lib/dialog/base/Content.d.ts +0 -9
- package/lib/dialog/base/Content.js +0 -22
- package/lib/dialog/base/Footer.d.ts +0 -9
- package/lib/dialog/base/Footer.js +0 -12
- package/lib/dialog/base/Header.d.ts +0 -9
- package/lib/dialog/base/Header.js +0 -59
- package/lib/dialog/base/index.d.ts +0 -15
- package/lib/dialog/base/index.js +0 -157
- package/lib/dialog/base/style.js +0 -13
- package/lib/dialog/form/index.d.ts +0 -10
- package/lib/dialog/form/index.js +0 -84
- package/lib/dialog/index.d.ts +0 -16
- package/lib/dialog/index.js +0 -51
- package/lib/dialog/types.d.ts +0 -105
- package/lib/dialog/types.js +0 -5
- package/lib/dialog/wizard/index.d.ts +0 -13
- package/lib/dialog/wizard/index.js +0 -74
- package/lib/dialog/wizard/progressbar.d.ts +0 -13
- package/lib/dialog/wizard/progressbar.js +0 -36
- package/lib/dialog/wizard/step.d.ts +0 -9
- package/lib/dialog/wizard/step.js +0 -22
- package/lib/dialog/wizard/useWizard.d.ts +0 -9
- package/lib/dialog/wizard/useWizard.js +0 -48
- package/lib/drawer/Content.d.ts +0 -10
- package/lib/drawer/Content.js +0 -26
- package/lib/drawer/Drawer.d.ts +0 -10
- package/lib/drawer/Drawer.js +0 -138
- package/lib/drawer/Header.d.ts +0 -10
- package/lib/drawer/Header.js +0 -76
- package/lib/drawer/helpers.d.ts +0 -10
- package/lib/drawer/helpers.js +0 -10
- package/lib/drawer/index.d.ts +0 -12
- package/lib/drawer/index.js +0 -25
- package/lib/drawer/types.d.ts +0 -41
- package/lib/drawer/types.js +0 -5
- package/lib/dropdown/Popup.d.ts +0 -6
- package/lib/dropdown/Popup.js +0 -69
- package/lib/dropdown/helper.d.ts +0 -4
- package/lib/dropdown/helper.js +0 -16
- package/lib/dropdown/types.d.ts +0 -44
- package/lib/dropdown/types.js +0 -5
- package/lib/dropdown/withDropdown.d.ts +0 -10
- package/lib/dropdown/withDropdown.js +0 -92
- package/lib/fieldset/index.d.ts +0 -8
- package/lib/fieldset/index.js +0 -83
- package/lib/fieldset/types.d.ts +0 -30
- package/lib/fieldset/types.js +0 -5
- package/lib/form/Field.d.ts +0 -14
- package/lib/form/Field.js +0 -118
- package/lib/form/FieldArray.d.ts +0 -14
- package/lib/form/FieldArray.js +0 -105
- package/lib/form/FieldNumber.d.ts +0 -14
- package/lib/form/FieldNumber.js +0 -68
- package/lib/form/FieldPeriod.d.ts +0 -14
- package/lib/form/FieldPeriod.js +0 -98
- package/lib/form/helpers.d.ts +0 -19
- package/lib/form/helpers.js +0 -50
- package/lib/form/index.d.ts +0 -18
- package/lib/form/index.js +0 -283
- package/lib/form/types.d.ts +0 -243
- package/lib/form/types.js +0 -5
- package/lib/form/withFieldHOC.d.ts +0 -14
- package/lib/form/withFieldHOC.js +0 -71
- package/lib/form/withFormSecurity.d.ts +0 -15
- package/lib/form/withFormSecurity.js +0 -55
- package/lib/gridlayout/GridCol.d.ts +0 -6
- package/lib/gridlayout/GridCol.js +0 -34
- package/lib/gridlayout/GridRow.d.ts +0 -6
- package/lib/gridlayout/GridRow.js +0 -34
- package/lib/gridlayout/index.d.ts +0 -8
- package/lib/gridlayout/index.js +0 -16
- package/lib/gridlayout/types.d.ts +0 -20
- package/lib/gridlayout/types.js +0 -5
- package/lib/hint/helpers.d.ts +0 -3
- package/lib/hint/helpers.js +0 -21
- package/lib/hint/index.d.ts +0 -7
- package/lib/hint/index.js +0 -36
- package/lib/hint/types.d.ts +0 -14
- package/lib/hint/types.js +0 -5
- package/lib/icons/helper.d.ts +0 -632
- package/lib/icons/helper.js +0 -636
- package/lib/icons/index.d.ts +0 -15
- package/lib/icons/index.js +0 -71
- package/lib/icons/types.d.ts +0 -49
- package/lib/icons/types.js +0 -5
- package/lib/index.d.ts +0 -39
- package/lib/index.js +0 -69
- package/lib/inputs/base/InputTextBase.d.ts +0 -11
- package/lib/inputs/base/InputTextBase.js +0 -261
- package/lib/inputs/base/Label.d.ts +0 -14
- package/lib/inputs/base/Label.js +0 -35
- package/lib/inputs/base/helpers.d.ts +0 -17
- package/lib/inputs/base/helpers.js +0 -46
- package/lib/inputs/base/types.d.ts +0 -100
- package/lib/inputs/base/types.js +0 -5
- package/lib/inputs/color/index.d.ts +0 -7
- package/lib/inputs/color/index.js +0 -95
- package/lib/inputs/color/types.d.ts +0 -19
- package/lib/inputs/color/types.js +0 -5
- package/lib/inputs/date/Dialog.d.ts +0 -13
- package/lib/inputs/date/Dialog.js +0 -25
- package/lib/inputs/date/Dropdown.d.ts +0 -13
- package/lib/inputs/date/Dropdown.js +0 -32
- package/lib/inputs/date/helpers.d.ts +0 -17
- package/lib/inputs/date/helpers.js +0 -31
- package/lib/inputs/date/index.d.ts +0 -13
- package/lib/inputs/date/index.js +0 -251
- package/lib/inputs/date/types.d.ts +0 -62
- package/lib/inputs/date/types.js +0 -5
- package/lib/inputs/errorMessage/index.d.ts +0 -16
- package/lib/inputs/errorMessage/index.js +0 -26
- package/lib/inputs/file/DefaultFile.d.ts +0 -13
- package/lib/inputs/file/DefaultFile.js +0 -80
- package/lib/inputs/file/DragDropFile.d.ts +0 -13
- package/lib/inputs/file/DragDropFile.js +0 -272
- package/lib/inputs/file/File.d.ts +0 -13
- package/lib/inputs/file/File.js +0 -63
- package/lib/inputs/file/FileButtonSettings.d.ts +0 -13
- package/lib/inputs/file/FileButtonSettings.js +0 -34
- package/lib/inputs/file/helpers.d.ts +0 -13
- package/lib/inputs/file/helpers.js +0 -21
- package/lib/inputs/file/index.d.ts +0 -16
- package/lib/inputs/file/index.js +0 -24
- package/lib/inputs/file/types.d.ts +0 -57
- package/lib/inputs/file/types.js +0 -5
- package/lib/inputs/inputHOC.d.ts +0 -16
- package/lib/inputs/inputHOC.js +0 -44
- package/lib/inputs/mask/BaseMask.d.ts +0 -12
- package/lib/inputs/mask/BaseMask.js +0 -167
- package/lib/inputs/mask/Cnpj.d.ts +0 -15
- package/lib/inputs/mask/Cnpj.js +0 -60
- package/lib/inputs/mask/Cpf.d.ts +0 -15
- package/lib/inputs/mask/Cpf.js +0 -57
- package/lib/inputs/mask/Phone.d.ts +0 -12
- package/lib/inputs/mask/Phone.js +0 -19
- package/lib/inputs/mask/ZipCode.d.ts +0 -12
- package/lib/inputs/mask/ZipCode.js +0 -14
- package/lib/inputs/mask/helpers.d.ts +0 -62
- package/lib/inputs/mask/helpers.js +0 -138
- package/lib/inputs/mask/index.d.ts +0 -17
- package/lib/inputs/mask/index.js +0 -37
- package/lib/inputs/mask/types.d.ts +0 -79
- package/lib/inputs/mask/types.js +0 -5
- package/lib/inputs/multiSelect/ActionButtons.d.ts +0 -13
- package/lib/inputs/multiSelect/ActionButtons.js +0 -51
- package/lib/inputs/multiSelect/Dropdown.d.ts +0 -13
- package/lib/inputs/multiSelect/Dropdown.js +0 -136
- package/lib/inputs/multiSelect/helper.d.ts +0 -13
- package/lib/inputs/multiSelect/helper.js +0 -20
- package/lib/inputs/multiSelect/index.d.ts +0 -13
- package/lib/inputs/multiSelect/index.js +0 -218
- package/lib/inputs/multiSelect/types.d.ts +0 -65
- package/lib/inputs/multiSelect/types.js +0 -5
- package/lib/inputs/number/BaseNumber.d.ts +0 -17
- package/lib/inputs/number/BaseNumber.js +0 -70
- package/lib/inputs/number/Currency.d.ts +0 -17
- package/lib/inputs/number/Currency.js +0 -22
- package/lib/inputs/number/Decimal.d.ts +0 -17
- package/lib/inputs/number/Decimal.js +0 -11
- package/lib/inputs/number/format_number.d.ts +0 -5
- package/lib/inputs/number/format_number.js +0 -27
- package/lib/inputs/number/index.d.ts +0 -19
- package/lib/inputs/number/index.js +0 -64
- package/lib/inputs/number/types.d.ts +0 -39
- package/lib/inputs/number/types.js +0 -5
- package/lib/inputs/period/Dialog.d.ts +0 -14
- package/lib/inputs/period/Dialog.js +0 -25
- package/lib/inputs/period/Dropdown.d.ts +0 -14
- package/lib/inputs/period/Dropdown.js +0 -28
- package/lib/inputs/period/PeriodList.d.ts +0 -14
- package/lib/inputs/period/PeriodList.js +0 -61
- package/lib/inputs/period/helper.d.ts +0 -22
- package/lib/inputs/period/helper.js +0 -66
- package/lib/inputs/period/index.d.ts +0 -14
- package/lib/inputs/period/index.js +0 -423
- package/lib/inputs/period/types.d.ts +0 -73
- package/lib/inputs/period/types.js +0 -5
- package/lib/inputs/search/index.d.ts +0 -16
- package/lib/inputs/search/index.js +0 -129
- package/lib/inputs/select/ActionButtons.d.ts +0 -16
- package/lib/inputs/select/ActionButtons.js +0 -38
- package/lib/inputs/select/Dropdown.d.ts +0 -16
- package/lib/inputs/select/Dropdown.js +0 -112
- package/lib/inputs/select/helper.d.ts +0 -25
- package/lib/inputs/select/helper.js +0 -108
- package/lib/inputs/select/index.d.ts +0 -13
- package/lib/inputs/select/index.js +0 -42
- package/lib/inputs/select/multiple/Selecteds.d.ts +0 -13
- package/lib/inputs/select/multiple/Selecteds.js +0 -25
- package/lib/inputs/select/multiple/index.d.ts +0 -13
- package/lib/inputs/select/multiple/index.js +0 -276
- package/lib/inputs/select/simple/index.d.ts +0 -13
- package/lib/inputs/select/simple/index.js +0 -302
- package/lib/inputs/select/types.d.ts +0 -119
- package/lib/inputs/select/types.js +0 -5
- package/lib/inputs/text/index.d.ts +0 -12
- package/lib/inputs/text/index.js +0 -13
- 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 -12
- package/lib/inputs/textarea/index.js +0 -25
- package/lib/inputs/textarea/types.d.ts +0 -16
- package/lib/inputs/textarea/types.js +0 -5
- package/lib/inputs/types.d.ts +0 -157
- package/lib/inputs/types.js +0 -5
- package/lib/internals/colorStyles.d.ts +0 -9
- package/lib/internals/colorStyles.js +0 -14
- package/lib/internals/constants.d.ts +0 -11
- package/lib/internals/constants.js +0 -15
- package/lib/internals/types.d.ts +0 -25
- package/lib/internals/types.js +0 -5
- package/lib/internals/withTooltip.d.ts +0 -12
- package/lib/internals/withTooltip.js +0 -172
- package/lib/labelMessages/index.d.ts +0 -9
- package/lib/labelMessages/index.js +0 -60
- package/lib/labelMessages/types.d.ts +0 -20
- package/lib/labelMessages/types.js +0 -5
- package/lib/labels/DangerLabel.d.ts +0 -11
- package/lib/labels/DangerLabel.js +0 -23
- package/lib/labels/DefaultLabel.d.ts +0 -14
- package/lib/labels/DefaultLabel.js +0 -55
- package/lib/labels/InfoLabel.d.ts +0 -11
- package/lib/labels/InfoLabel.js +0 -23
- package/lib/labels/PrimaryLabel.d.ts +0 -11
- package/lib/labels/PrimaryLabel.js +0 -23
- package/lib/labels/SuccessLabel.d.ts +0 -11
- package/lib/labels/SuccessLabel.js +0 -23
- package/lib/labels/WarningLabel.d.ts +0 -11
- package/lib/labels/WarningLabel.js +0 -23
- package/lib/labels/index.d.ts +0 -18
- package/lib/labels/index.js +0 -52
- package/lib/labels/label_container/index.d.ts +0 -12
- package/lib/labels/label_container/index.js +0 -22
- package/lib/labels/types.d.ts +0 -26
- package/lib/labels/types.js +0 -5
- package/lib/list/Header.d.ts +0 -10
- package/lib/list/Header.js +0 -23
- package/lib/list/Item.d.ts +0 -13
- package/lib/list/Item.js +0 -154
- package/lib/list/Separator.d.ts +0 -3
- package/lib/list/Separator.js +0 -12
- package/lib/list/helpers.d.ts +0 -15
- package/lib/list/helpers.js +0 -14
- package/lib/list/index.d.ts +0 -13
- package/lib/list/index.js +0 -182
- package/lib/list/types.d.ts +0 -72
- package/lib/list/types.js +0 -5
- package/lib/menus/float/MenuItem.d.ts +0 -9
- package/lib/menus/float/MenuItem.js +0 -69
- package/lib/menus/float/SubMenuContainer.js +0 -77
- package/lib/menus/float/helpers.d.ts +0 -9
- package/lib/menus/float/helpers.js +0 -10
- package/lib/menus/float/index.d.ts +0 -40
- package/lib/menus/float/index.js +0 -68
- package/lib/menus/float/types.d.ts +0 -30
- package/lib/menus/float/types.js +0 -5
- package/lib/menus/index.d.ts +0 -12
- package/lib/menus/index.js +0 -9
- package/lib/menus/sidenav/ExpandMenu.d.ts +0 -12
- package/lib/menus/sidenav/ExpandMenu.js +0 -27
- package/lib/menus/sidenav/MenuLink.d.ts +0 -15
- package/lib/menus/sidenav/MenuLink.js +0 -29
- package/lib/menus/sidenav/NavMenuGroup.d.ts +0 -12
- package/lib/menus/sidenav/NavMenuGroup.js +0 -26
- package/lib/menus/sidenav/NavMenuItem.d.ts +0 -15
- package/lib/menus/sidenav/NavMenuItem.js +0 -150
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +0 -12
- package/lib/menus/sidenav/NavSubMenuItem.js +0 -47
- package/lib/menus/sidenav/helpers.d.ts +0 -14
- package/lib/menus/sidenav/helpers.js +0 -18
- package/lib/menus/sidenav/index.d.ts +0 -16
- package/lib/menus/sidenav/index.js +0 -184
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +0 -12
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +0 -26
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +0 -12
- package/lib/menus/sidenav/popup_menu_search/index.js +0 -116
- package/lib/menus/sidenav/types.d.ts +0 -90
- package/lib/menus/sidenav/types.js +0 -5
- package/lib/noPermission/index.d.ts +0 -3
- package/lib/noPermission/index.js +0 -23
- package/lib/panel/Content.d.ts +0 -10
- package/lib/panel/Content.js +0 -79
- package/lib/panel/DangerPanel.d.ts +0 -10
- package/lib/panel/DangerPanel.js +0 -15
- package/lib/panel/Default.d.ts +0 -10
- package/lib/panel/Default.js +0 -67
- package/lib/panel/Header.d.ts +0 -10
- package/lib/panel/Header.js +0 -77
- package/lib/panel/InfoPanel.d.ts +0 -10
- package/lib/panel/InfoPanel.js +0 -15
- package/lib/panel/PrimaryPanel.d.ts +0 -10
- package/lib/panel/PrimaryPanel.js +0 -15
- package/lib/panel/SuccessPanel.d.ts +0 -10
- package/lib/panel/SuccessPanel.js +0 -15
- package/lib/panel/ToolBar.d.ts +0 -10
- package/lib/panel/ToolBar.js +0 -22
- package/lib/panel/WarningPanel.d.ts +0 -10
- package/lib/panel/WarningPanel.js +0 -15
- package/lib/panel/helpers.d.ts +0 -11
- package/lib/panel/helpers.js +0 -25
- package/lib/panel/index.d.ts +0 -18
- package/lib/panel/index.js +0 -59
- package/lib/panel/types.d.ts +0 -47
- package/lib/panel/types.js +0 -5
- package/lib/permissionValidations.d.ts +0 -14
- package/lib/permissionValidations.js +0 -59
- package/lib/popover/PopoverText.d.ts +0 -10
- package/lib/popover/PopoverText.js +0 -20
- package/lib/popover/PopoverTitle.d.ts +0 -10
- package/lib/popover/PopoverTitle.js +0 -17
- package/lib/popover/index.d.ts +0 -15
- package/lib/popover/index.js +0 -63
- package/lib/popover/types.d.ts +0 -24
- package/lib/popover/types.js +0 -5
- package/lib/progress/Bar.d.ts +0 -6
- package/lib/progress/Bar.js +0 -74
- package/lib/progress/index.d.ts +0 -7
- package/lib/progress/index.js +0 -38
- package/lib/progress/types.d.ts +0 -37
- package/lib/progress/types.js +0 -5
- package/lib/radio/index.d.ts +0 -13
- package/lib/radio/index.js +0 -113
- package/lib/radio/types.d.ts +0 -28
- package/lib/radio/types.js +0 -5
- package/lib/shortcuts/index.d.ts +0 -7
- package/lib/shortcuts/index.js +0 -28
- package/lib/shortcuts/types.d.ts +0 -12
- package/lib/shortcuts/types.js +0 -5
- package/lib/skeleton/SkeletonContainer.d.ts +0 -7
- package/lib/skeleton/SkeletonContainer.js +0 -23
- package/lib/skeleton/index.d.ts +0 -8
- package/lib/skeleton/index.js +0 -54
- 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/SpinnerLoading.js +0 -219
- package/lib/spinner/index.d.ts +0 -7
- package/lib/spinner/index.js +0 -60
- 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/Split.js +0 -292
- package/lib/split/SplitSide.d.ts +0 -6
- package/lib/split/SplitSide.js +0 -42
- package/lib/split/helpers.d.ts +0 -10
- package/lib/split/helpers.js +0 -10
- package/lib/split/index.d.ts +0 -8
- package/lib/split/index.js +0 -17
- 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/Body.js +0 -71
- package/lib/table/Header.d.ts +0 -6
- package/lib/table/Header.js +0 -90
- package/lib/table/HeaderColumn.d.ts +0 -6
- package/lib/table/HeaderColumn.js +0 -55
- package/lib/table/Row.d.ts +0 -6
- package/lib/table/Row.js +0 -78
- package/lib/table/RowColumn.d.ts +0 -6
- package/lib/table/RowColumn.js +0 -81
- package/lib/table/helpers.d.ts +0 -8
- package/lib/table/helpers.js +0 -15
- package/lib/table/index.d.ts +0 -11
- package/lib/table/index.js +0 -154
- package/lib/table/types.d.ts +0 -97
- package/lib/table/types.js +0 -5
- package/lib/tabs/DropdownTabs.d.ts +0 -11
- package/lib/tabs/DropdownTabs.js +0 -73
- package/lib/tabs/Menu.d.ts +0 -11
- package/lib/tabs/Menu.js +0 -46
- package/lib/tabs/MenuTabs.d.ts +0 -11
- package/lib/tabs/MenuTabs.js +0 -84
- package/lib/tabs/Panel.d.ts +0 -11
- package/lib/tabs/Panel.js +0 -84
- package/lib/tabs/context.d.ts +0 -12
- package/lib/tabs/context.js +0 -127
- package/lib/tabs/index.d.ts +0 -12
- package/lib/tabs/index.js +0 -70
- package/lib/tabs/tabHelpers.d.ts +0 -12
- package/lib/tabs/tabHelpers.js +0 -75
- package/lib/tabs/types.d.ts +0 -98
- package/lib/tabs/types.js +0 -5
- package/lib/tabs/useTabs.d.ts +0 -11
- package/lib/tabs/useTabs.js +0 -11
- package/lib/textContent/index.d.ts +0 -22
- package/lib/textContent/index.js +0 -42
- package/lib/toolbar/ButtonBar.d.ts +0 -12
- package/lib/toolbar/ButtonBar.js +0 -66
- package/lib/toolbar/LabelBar.d.ts +0 -12
- package/lib/toolbar/LabelBar.js +0 -58
- package/lib/toolbar/Separator.d.ts +0 -3
- package/lib/toolbar/Separator.js +0 -12
- package/lib/toolbar/ToolBarGroup.d.ts +0 -12
- package/lib/toolbar/ToolBarGroup.js +0 -19
- package/lib/toolbar/helpers.d.ts +0 -12
- package/lib/toolbar/helpers.js +0 -9
- package/lib/toolbar/index.d.ts +0 -16
- package/lib/toolbar/index.js +0 -65
- package/lib/toolbar/types.d.ts +0 -46
- package/lib/toolbar/types.js +0 -5
- package/lib/tooltip/index.d.ts +0 -6
- package/lib/tooltip/index.js +0 -63
- package/lib/tooltip/types.d.ts +0 -17
- package/lib/tooltip/types.js +0 -5
- package/lib/treetable/Body.d.ts +0 -3
- package/lib/treetable/Body.js +0 -34
- package/lib/treetable/Header.d.ts +0 -3
- package/lib/treetable/Header.js +0 -24
- package/lib/treetable/Row.d.ts +0 -7
- package/lib/treetable/Row.js +0 -209
- package/lib/treetable/helpers.d.ts +0 -19
- package/lib/treetable/helpers.js +0 -32
- package/lib/treetable/index.d.ts +0 -8
- package/lib/treetable/index.js +0 -28
- package/lib/treetable/types.d.js +0 -5
- package/lib/treeview/Header.d.ts +0 -7
- package/lib/treeview/Header.js +0 -21
- package/lib/treeview/Node.d.ts +0 -7
- package/lib/treeview/Node.js +0 -245
- package/lib/treeview/constants.d.ts +0 -7
- package/lib/treeview/constants.js +0 -9
- package/lib/treeview/index.d.ts +0 -9
- package/lib/treeview/index.js +0 -320
- package/lib/treeview/types.d.ts +0 -108
- package/lib/treeview/types.js +0 -5
- package/lib/types.d-73cece43.d.ts +0 -46
- package/lib/uitour/helpers.d.ts +0 -8
- package/lib/uitour/helpers.js +0 -12
- package/lib/uitour/index.d.ts +0 -7
- package/lib/uitour/index.js +0 -255
- package/lib/uitour/types.d.ts +0 -38
- package/lib/uitour/types.js +0 -5
package/lib/form/index.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Field", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Field.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "FieldArray", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _FieldArray.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "FieldNumber", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _FieldNumber.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "FieldPeriod", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _FieldPeriod.default;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
exports.default = void 0;
|
|
31
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
32
|
-
var _uuid = require("uuid");
|
|
33
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
34
|
-
var _helpers = require("./helpers");
|
|
35
|
-
var _Field = _interopRequireDefault(require("./Field"));
|
|
36
|
-
var _FieldNumber = _interopRequireDefault(require("./FieldNumber"));
|
|
37
|
-
var _FieldArray = _interopRequireDefault(require("./FieldArray"));
|
|
38
|
-
var _FieldPeriod = _interopRequireDefault(require("./FieldPeriod"));
|
|
39
|
-
require("../assets/styles/form.scss");
|
|
40
|
-
var _dialog = require("../dialog");
|
|
41
|
-
var _withFormSecurity = require("./withFormSecurity");
|
|
42
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
43
|
-
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); }
|
|
44
|
-
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; }
|
|
45
|
-
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); }
|
|
46
|
-
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; }
|
|
47
|
-
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; }
|
|
48
|
-
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; }
|
|
49
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
50
|
-
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); }
|
|
51
|
-
const Form = _ref => {
|
|
52
|
-
let {
|
|
53
|
-
submitOnPressEnterKey = true,
|
|
54
|
-
dataSource,
|
|
55
|
-
securityBeforeUnload,
|
|
56
|
-
handlerReset,
|
|
57
|
-
handlerSubmit,
|
|
58
|
-
handlerValidates,
|
|
59
|
-
style,
|
|
60
|
-
customClass,
|
|
61
|
-
securityTitle,
|
|
62
|
-
securityText,
|
|
63
|
-
securityData,
|
|
64
|
-
onDataChange,
|
|
65
|
-
onValidateForm,
|
|
66
|
-
externalFieldErrors,
|
|
67
|
-
onSubmit,
|
|
68
|
-
skeletonize,
|
|
69
|
-
disabled,
|
|
70
|
-
children,
|
|
71
|
-
useInternalState = false
|
|
72
|
-
} = _ref;
|
|
73
|
-
const formId = (0, _uuid.v1)();
|
|
74
|
-
const [data, setData] = (0, _react.useState)(dataSource);
|
|
75
|
-
const [originalData, setOriginalData] = (0, _react.useState)(dataSource);
|
|
76
|
-
const [submitFormOnEnter, setSubmitFormOnEnter] = (0, _react.useState)(submitOnPressEnterKey);
|
|
77
|
-
const [fieldErrors, setFieldErrors] = (0, _react.useState)({});
|
|
78
|
-
const [oldFieldsValidatorsQuantity, setOldFieldsValidatorsQuantity] = (0, _react.useState)(0);
|
|
79
|
-
const [isValid, setIsValid] = (0, _react.useState)(false);
|
|
80
|
-
const context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
|
|
81
|
-
const formRef = (0, _react.useRef)(null);
|
|
82
|
-
const fieldsValidators = (0, _react.useRef)({});
|
|
83
|
-
const usedData = useInternalState ? data : dataSource;
|
|
84
|
-
const getValidatesErrorMessages = (validators, fieldValue) => {
|
|
85
|
-
const validatorsArray = !(validators instanceof Array) ? [validators] : validators;
|
|
86
|
-
let errors = [];
|
|
87
|
-
validatorsArray.forEach(validator => {
|
|
88
|
-
if (typeof validator === 'function') {
|
|
89
|
-
const result = validator(fieldValue);
|
|
90
|
-
if (result) errors = [...errors, result];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
return errors;
|
|
94
|
-
};
|
|
95
|
-
const getErrorMessages = (currentData, currentValidators) => {
|
|
96
|
-
const dataValidate = currentData || usedData;
|
|
97
|
-
let currentFieldErrors = _lodash.default.pickBy(fieldErrors, (error, fieldName) => {
|
|
98
|
-
const fieldValidatorsNames = Object.keys(currentValidators);
|
|
99
|
-
return fieldValidatorsNames.includes(fieldName);
|
|
100
|
-
});
|
|
101
|
-
_lodash.default.forEach(currentValidators, (validators, fieldName) => {
|
|
102
|
-
const fieldValue = _lodash.default.get(dataValidate, fieldName);
|
|
103
|
-
const messages = getValidatesErrorMessages(validators, fieldValue);
|
|
104
|
-
currentFieldErrors = _objectSpread(_objectSpread({}, currentFieldErrors), {}, {
|
|
105
|
-
[fieldName]: messages
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
return currentFieldErrors;
|
|
109
|
-
};
|
|
110
|
-
const checkIsValid = function (currentData) {
|
|
111
|
-
let updateState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
112
|
-
let currentValidators = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
113
|
-
const currentFieldErrors = getErrorMessages(currentData, currentValidators || fieldsValidators.current);
|
|
114
|
-
const isValidNow = Object.values(currentFieldErrors).every(value => value.length === 0);
|
|
115
|
-
if (updateState) setIsValid(isValidNow);
|
|
116
|
-
return isValidNow;
|
|
117
|
-
};
|
|
118
|
-
const onFieldChange = (0, _react.useCallback)(event => {
|
|
119
|
-
const {
|
|
120
|
-
target
|
|
121
|
-
} = event;
|
|
122
|
-
if (!useInternalState && onDataChange) {
|
|
123
|
-
onDataChange(prevState => (0, _helpers.changeValue)(prevState, target));
|
|
124
|
-
} else {
|
|
125
|
-
setData(prevState => (0, _helpers.changeValue)(prevState, target));
|
|
126
|
-
}
|
|
127
|
-
}, []);
|
|
128
|
-
const onValidate = (fieldName, fieldValue, validators) => {
|
|
129
|
-
if (validators) {
|
|
130
|
-
let currentFieldErrors = fieldErrors;
|
|
131
|
-
const errors = getValidatesErrorMessages(validators, fieldValue);
|
|
132
|
-
if (errors.length === 0) {
|
|
133
|
-
currentFieldErrors = _lodash.default.omit(currentFieldErrors, fieldName);
|
|
134
|
-
} else {
|
|
135
|
-
currentFieldErrors = _objectSpread(_objectSpread({}, currentFieldErrors), {}, {
|
|
136
|
-
[fieldName]: errors
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
setFieldErrors(currentFieldErrors);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
const onFormSubmit = (0, _react.useCallback)(event => {
|
|
143
|
-
if (event) {
|
|
144
|
-
event.preventDefault();
|
|
145
|
-
event.stopPropagation();
|
|
146
|
-
}
|
|
147
|
-
if (checkIsValid(usedData)) onSubmit(usedData);
|
|
148
|
-
}, [usedData]);
|
|
149
|
-
const onResetField = (cb, fields) => {
|
|
150
|
-
const fieldsArray = !fields ? [] : fields instanceof Array ? fields : [fields];
|
|
151
|
-
if (fieldsArray.length > 0) {
|
|
152
|
-
cb(state => {
|
|
153
|
-
const newState = JSON.parse(JSON.stringify(state));
|
|
154
|
-
fieldsArray.forEach(field => {
|
|
155
|
-
if (field) _lodash.default.set(newState, field, _lodash.default.get(originalData, field));
|
|
156
|
-
});
|
|
157
|
-
return newState;
|
|
158
|
-
});
|
|
159
|
-
setFieldErrors(state => {
|
|
160
|
-
fieldsArray.forEach(field => {
|
|
161
|
-
delete state[field];
|
|
162
|
-
});
|
|
163
|
-
return state;
|
|
164
|
-
});
|
|
165
|
-
} else {
|
|
166
|
-
cb(JSON.parse(JSON.stringify(originalData)));
|
|
167
|
-
setFieldErrors({});
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
const onReset = fields => {
|
|
171
|
-
if (!useInternalState && onDataChange) {
|
|
172
|
-
onResetField(onDataChange, fields);
|
|
173
|
-
} else {
|
|
174
|
-
onResetField(setData, fields);
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
const onRemoveFieldValidators = fieldName => {
|
|
178
|
-
const newFieldsValidators = _lodash.default.omit(fieldsValidators, fieldName);
|
|
179
|
-
fieldsValidators.current = newFieldsValidators;
|
|
180
|
-
};
|
|
181
|
-
const onBeforeUnload = e => {
|
|
182
|
-
const event = e;
|
|
183
|
-
event.preventDefault();
|
|
184
|
-
if (_lodash.default.isEqual(usedData, originalData)) return;
|
|
185
|
-
};
|
|
186
|
-
const formProps = () => {
|
|
187
|
-
let propsForm = null;
|
|
188
|
-
if (!disabled) {
|
|
189
|
-
propsForm = {
|
|
190
|
-
onSubmit: event => event.preventDefault(),
|
|
191
|
-
onKeyPress: event => {
|
|
192
|
-
if (event && event.key === 'Enter') {
|
|
193
|
-
event.preventDefault();
|
|
194
|
-
event.stopPropagation();
|
|
195
|
-
if (submitFormOnEnter) onFormSubmit();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
return propsForm;
|
|
201
|
-
};
|
|
202
|
-
const updateFormState = () => {
|
|
203
|
-
if (!_lodash.default.isEmpty(context)) {
|
|
204
|
-
const {
|
|
205
|
-
onChangedData
|
|
206
|
-
} = context;
|
|
207
|
-
if (securityData && !_lodash.default.isEqual(usedData, securityData)) {
|
|
208
|
-
onChangedData(true);
|
|
209
|
-
} else {
|
|
210
|
-
onChangedData(false);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (onDataChange && useInternalState) onDataChange(usedData);
|
|
214
|
-
|
|
215
|
-
// TODO - Usar debounce para evitar chamada a cada letra digitada
|
|
216
|
-
if (onValidateForm) onValidateForm(checkIsValid(usedData, true));
|
|
217
|
-
if (!disabled) {
|
|
218
|
-
handlerSubmit(onFormSubmit);
|
|
219
|
-
if (handlerReset) handlerReset(onReset);
|
|
220
|
-
if (handlerValidates) handlerValidates(() => checkIsValid(usedData));
|
|
221
|
-
}
|
|
222
|
-
if (_lodash.default.isEmpty(usedData)) setOriginalData(usedData);
|
|
223
|
-
};
|
|
224
|
-
(0, _react.useEffect)(() => {
|
|
225
|
-
if (useInternalState) updateFormState();
|
|
226
|
-
}, [JSON.stringify(data), useInternalState]);
|
|
227
|
-
(0, _react.useEffect)(() => {
|
|
228
|
-
if (!useInternalState && onDataChange) updateFormState();
|
|
229
|
-
}, [JSON.stringify(dataSource), useInternalState]);
|
|
230
|
-
(0, _react.useEffect)(() => {
|
|
231
|
-
if (securityBeforeUnload) {
|
|
232
|
-
if (context) context.setSecurityBeforeUnload(true);
|
|
233
|
-
window.addEventListener('beforeunload', onBeforeUnload);
|
|
234
|
-
}
|
|
235
|
-
return () => window.removeEventListener('beforeunload', onBeforeUnload);
|
|
236
|
-
}, [securityBeforeUnload, onBeforeUnload]);
|
|
237
|
-
(0, _react.useEffect)(() => {
|
|
238
|
-
if (!disabled && submitOnPressEnterKey !== submitFormOnEnter) {
|
|
239
|
-
setSubmitFormOnEnter(submitOnPressEnterKey);
|
|
240
|
-
}
|
|
241
|
-
}, [submitOnPressEnterKey]);
|
|
242
|
-
(0, _react.useEffect)(() => {
|
|
243
|
-
const validatorsQuantity = Object.values(fieldsValidators.current).reduce((acc, currentValue) => acc + (currentValue?.length || 0), 0);
|
|
244
|
-
if (fieldsValidators.current && onValidateForm && oldFieldsValidatorsQuantity !== validatorsQuantity) {
|
|
245
|
-
setOldFieldsValidatorsQuantity(validatorsQuantity);
|
|
246
|
-
onValidateForm(checkIsValid(usedData, true, fieldsValidators.current));
|
|
247
|
-
}
|
|
248
|
-
}, [fieldsValidators.current, oldFieldsValidatorsQuantity, onValidateForm, JSON.stringify(usedData)]);
|
|
249
|
-
const contextValues = {
|
|
250
|
-
skeletonize,
|
|
251
|
-
handlerFieldChange: onFieldChange,
|
|
252
|
-
handlerFieldValidate: onValidate,
|
|
253
|
-
handlerStoreValidators: (fieldName, fieldValidates) => {
|
|
254
|
-
fieldsValidators.current = _objectSpread(_objectSpread({}, fieldsValidators.current), {}, {
|
|
255
|
-
[fieldName]: fieldValidates
|
|
256
|
-
});
|
|
257
|
-
},
|
|
258
|
-
handlerRemoveValidators: onRemoveFieldValidators,
|
|
259
|
-
data: useInternalState ? data : dataSource,
|
|
260
|
-
originalData,
|
|
261
|
-
fieldErrors,
|
|
262
|
-
externalFieldErrors,
|
|
263
|
-
isFormValid: isValid
|
|
264
|
-
};
|
|
265
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_helpers.FormContext.Provider, {
|
|
266
|
-
value: contextValues
|
|
267
|
-
}, /*#__PURE__*/_react.default.createElement("form", _extends({
|
|
268
|
-
id: formId,
|
|
269
|
-
ref: formRef,
|
|
270
|
-
style: style
|
|
271
|
-
}, formProps(), {
|
|
272
|
-
role: "presentation",
|
|
273
|
-
className: `form-component ${customClass}`
|
|
274
|
-
}), children)), /*#__PURE__*/_react.default.createElement(_dialog.DialogQuestion, {
|
|
275
|
-
zIndex: "99999999",
|
|
276
|
-
title: securityTitle || 'Dados Alterados',
|
|
277
|
-
text: securityText || 'Você possui dados alterados, confirma o fechamento?',
|
|
278
|
-
visible: !_lodash.default.isEmpty(context) && context.showQuestion,
|
|
279
|
-
onConfirmClick: context ? context.onConfirmClick : () => {},
|
|
280
|
-
onUnconfirmClick: context ? context.onUnconfirmClick : () => {}
|
|
281
|
-
}));
|
|
282
|
-
};
|
|
283
|
-
var _default = exports.default = Form;
|
package/lib/form/types.d.ts
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { ChangeEvent, ComponentType, MouseEventHandler, ReactNode, CSSProperties } from 'react';
|
|
2
|
-
import { AllOptions } from '../inputs/select/types.js';
|
|
3
|
-
import '../@types/Align.js';
|
|
4
|
-
import '../@types/DataCombo.js';
|
|
5
|
-
import '../@types/PermissionAttr.js';
|
|
6
|
-
import '../inputs/base/types.js';
|
|
7
|
-
import '../@types/Period.js';
|
|
8
|
-
import '../internals/types.js';
|
|
9
|
-
import '../@types/Position.js';
|
|
10
|
-
|
|
11
|
-
type Validator = (value: string) => string | undefined;
|
|
12
|
-
type PeriodValidator = (value: {
|
|
13
|
-
inicial: string;
|
|
14
|
-
final: string;
|
|
15
|
-
}) => string | undefined;
|
|
16
|
-
type OnFielChangeEvent = Event & {
|
|
17
|
-
target: HTMLInputElement;
|
|
18
|
-
};
|
|
19
|
-
type CustomKeyboardEvent = ChangeEvent<HTMLInputElement> & {
|
|
20
|
-
keyCode: number;
|
|
21
|
-
};
|
|
22
|
-
type BaseFormProps = {
|
|
23
|
-
dataSource: object;
|
|
24
|
-
children: ReactNode;
|
|
25
|
-
onSubmit: (data: object) => void;
|
|
26
|
-
handlerSubmit: (value: () => void) => void;
|
|
27
|
-
handlerReset?: (value: () => void) => void;
|
|
28
|
-
handlerValidates?: (value: any) => void;
|
|
29
|
-
onValidateForm?: (value: boolean) => void;
|
|
30
|
-
submitOnPressEnterKey?: boolean;
|
|
31
|
-
style?: CSSProperties;
|
|
32
|
-
customClass?: string;
|
|
33
|
-
securityBeforeUnload?: boolean;
|
|
34
|
-
securityTitle?: string;
|
|
35
|
-
securityText?: string;
|
|
36
|
-
securityData?: object;
|
|
37
|
-
externalFieldErrors?: object;
|
|
38
|
-
skeletonize?: boolean;
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
};
|
|
41
|
-
type OnDataChange = React.Dispatch<React.SetStateAction<object>>;
|
|
42
|
-
type FormProps = BaseFormProps & ({
|
|
43
|
-
useInternalState?: false;
|
|
44
|
-
onDataChange: OnDataChange;
|
|
45
|
-
} | {
|
|
46
|
-
useInternalState: true;
|
|
47
|
-
onDataChange?: OnDataChange;
|
|
48
|
-
});
|
|
49
|
-
type Data = {
|
|
50
|
-
[key: string]: any;
|
|
51
|
-
};
|
|
52
|
-
interface IFieldProps extends WithFieldProps {
|
|
53
|
-
data?: Data;
|
|
54
|
-
originalData?: Data;
|
|
55
|
-
dataSource?: Data;
|
|
56
|
-
name: string;
|
|
57
|
-
value?: string;
|
|
58
|
-
label?: string;
|
|
59
|
-
handlerFieldChange?: (event: ChangeEvent<HTMLInputElement> | CustomKeyboardEvent) => ChangeEvent;
|
|
60
|
-
handlerFieldValidate?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
61
|
-
component: ComponentType<any>;
|
|
62
|
-
componentType?: 'Radio' | 'Checkbox';
|
|
63
|
-
onChange?: (event: ChangeEvent) => ChangeEvent;
|
|
64
|
-
onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
65
|
-
onKeyDown?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
66
|
-
validators?: Validator | Validator[];
|
|
67
|
-
fieldErrors?: {
|
|
68
|
-
[name: string]: string[];
|
|
69
|
-
};
|
|
70
|
-
externalFieldErrors?: {
|
|
71
|
-
[name: string]: string[];
|
|
72
|
-
};
|
|
73
|
-
externalMessagesErrors?: string[];
|
|
74
|
-
fieldId?: string;
|
|
75
|
-
scale?: number;
|
|
76
|
-
required?: boolean;
|
|
77
|
-
idKey?: string;
|
|
78
|
-
descriptionKey?: string;
|
|
79
|
-
showClearButton?: boolean;
|
|
80
|
-
gridLayout?: string;
|
|
81
|
-
allOptions?: AllOptions;
|
|
82
|
-
searchNotFoundText?: string;
|
|
83
|
-
min?: number;
|
|
84
|
-
max?: number;
|
|
85
|
-
autoFocus?: boolean;
|
|
86
|
-
autoCompleteMask?: 'left' | 'right';
|
|
87
|
-
mask?: string;
|
|
88
|
-
hint?: string | string[];
|
|
89
|
-
hintPosition?: 'below' | 'onLabelRight';
|
|
90
|
-
themePopover?: 'light' | 'dark';
|
|
91
|
-
popoverAlign?: 'right' | 'left';
|
|
92
|
-
displayCurrencySymbol?: boolean;
|
|
93
|
-
removeZeroLeft?: boolean;
|
|
94
|
-
textAlign?: 'left' | 'right';
|
|
95
|
-
disabled?: boolean;
|
|
96
|
-
currencySymbol?: string;
|
|
97
|
-
checked?: boolean;
|
|
98
|
-
}
|
|
99
|
-
interface CustomEvent {
|
|
100
|
-
target: {
|
|
101
|
-
value: string[];
|
|
102
|
-
name: string;
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
interface IFieldArrayProps extends WithFieldProps {
|
|
106
|
-
data?: Data;
|
|
107
|
-
originalData?: Data;
|
|
108
|
-
dataSource?: Data;
|
|
109
|
-
name: string;
|
|
110
|
-
handlerFieldChange?: (event: CustomEvent) => void;
|
|
111
|
-
fieldErrors?: {
|
|
112
|
-
[name: string]: string[];
|
|
113
|
-
};
|
|
114
|
-
component?: ComponentType<any>;
|
|
115
|
-
validators?: Validator | Validator[];
|
|
116
|
-
valuePropName?: string;
|
|
117
|
-
changePropName?: string;
|
|
118
|
-
handlerSelecionados?: (ids: string[]) => void;
|
|
119
|
-
label?: string;
|
|
120
|
-
skipLabel?: boolean;
|
|
121
|
-
bordered?: boolean;
|
|
122
|
-
cols?: string;
|
|
123
|
-
labelContainerStyle?: object;
|
|
124
|
-
externalMessagesErrors?: string[];
|
|
125
|
-
idKey?: string;
|
|
126
|
-
descriptionKey?: string;
|
|
127
|
-
showClearButton?: boolean;
|
|
128
|
-
gridLayout?: string;
|
|
129
|
-
multiple?: boolean;
|
|
130
|
-
disabled?: boolean;
|
|
131
|
-
onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
132
|
-
handlerFieldValidate?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
133
|
-
required?: boolean;
|
|
134
|
-
hint?: string | string[];
|
|
135
|
-
hintPosition?: 'below' | 'onLabelRight';
|
|
136
|
-
themePopover?: 'light' | 'dark';
|
|
137
|
-
popoverAlign?: 'right' | 'left';
|
|
138
|
-
}
|
|
139
|
-
type PeriodChangeEvent = {
|
|
140
|
-
initial: string;
|
|
141
|
-
final: string;
|
|
142
|
-
};
|
|
143
|
-
type PeriodFieldChangeEvent = {
|
|
144
|
-
target: {
|
|
145
|
-
name: string;
|
|
146
|
-
value: {
|
|
147
|
-
[valueDate: string]: string;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
interface IFieldPeriodProps extends WithFieldProps {
|
|
152
|
-
data?: Data;
|
|
153
|
-
originalData?: Data;
|
|
154
|
-
nameDateInitial: string;
|
|
155
|
-
nameDateFinal: string;
|
|
156
|
-
handlerFieldChange?: (event: PeriodFieldChangeEvent) => PeriodFieldChangeEvent;
|
|
157
|
-
label?: string;
|
|
158
|
-
component?: ComponentType<any>;
|
|
159
|
-
onBlur?: () => void;
|
|
160
|
-
validators?: PeriodValidator | PeriodValidator[];
|
|
161
|
-
fieldErrors?: {
|
|
162
|
-
[name: string]: string[];
|
|
163
|
-
};
|
|
164
|
-
externalMessagesErrors?: string[];
|
|
165
|
-
externalFieldErrors?: {
|
|
166
|
-
[name: string]: string[];
|
|
167
|
-
};
|
|
168
|
-
handlerFieldValidate?: (name: string, value: object, validatorsArray: PeriodValidator[] | PeriodValidator) => void;
|
|
169
|
-
onChange?: (event: PeriodChangeEvent) => PeriodChangeEvent;
|
|
170
|
-
gridLayout?: string;
|
|
171
|
-
hint?: string | string[];
|
|
172
|
-
hintPosition?: 'below' | 'onLabelRight';
|
|
173
|
-
themePopover?: 'light' | 'dark';
|
|
174
|
-
popoverAlign?: 'right' | 'left';
|
|
175
|
-
}
|
|
176
|
-
interface FormContextProps {
|
|
177
|
-
skeletonize?: boolean;
|
|
178
|
-
handlerFieldChange: (event: OnFielChangeEvent) => void;
|
|
179
|
-
handlerFieldValidate: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
180
|
-
handlerStoreValidators: (fieldName: string, fieldValidates: Validator) => void;
|
|
181
|
-
handlerRemoveValidators: (fieldName: string) => void;
|
|
182
|
-
data: object;
|
|
183
|
-
originalData: object;
|
|
184
|
-
fieldErrors: object;
|
|
185
|
-
externalFieldErrors?: object;
|
|
186
|
-
isFormValid?: boolean;
|
|
187
|
-
}
|
|
188
|
-
interface WithFieldProps {
|
|
189
|
-
name: string;
|
|
190
|
-
data?: Data;
|
|
191
|
-
handlerStoreValidators?: (name: string, validators: Validator | Validator[]) => void;
|
|
192
|
-
handlerRemoveValidators?: (name: string) => void;
|
|
193
|
-
validators?: Validator | Validator[] | PeriodValidator | PeriodValidator[];
|
|
194
|
-
customClass?: string;
|
|
195
|
-
}
|
|
196
|
-
interface IWithFieldContext {
|
|
197
|
-
validatorFromComponent: Validator | Validator[] | undefined;
|
|
198
|
-
handlerSetValidatorFromComponent: (validator: Validator | Validator[]) => void;
|
|
199
|
-
}
|
|
200
|
-
interface IWithFormSecurity {
|
|
201
|
-
onOpenChange?: (open: boolean) => void;
|
|
202
|
-
handlerClose?: () => void;
|
|
203
|
-
onClick?: MouseEventHandler;
|
|
204
|
-
children?: ReactNode;
|
|
205
|
-
}
|
|
206
|
-
interface IFormSecurityContext {
|
|
207
|
-
onChangedData: (value: boolean) => void;
|
|
208
|
-
showQuestion: boolean;
|
|
209
|
-
onConfirmClick: () => void;
|
|
210
|
-
onUnconfirmClick: () => void;
|
|
211
|
-
setSecurityBeforeUnload: (value: boolean) => void;
|
|
212
|
-
securityBeforeUnload?: boolean;
|
|
213
|
-
}
|
|
214
|
-
interface IEventParams {
|
|
215
|
-
name: string;
|
|
216
|
-
data?: object;
|
|
217
|
-
validators?: Validator | Validator[];
|
|
218
|
-
onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
219
|
-
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
220
|
-
onKeyDown?: (event: CustomKeyboardEvent) => void;
|
|
221
|
-
handlerFieldValidate?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
222
|
-
handlerFieldChange?: (event: ChangeEvent<HTMLInputElement> | CustomKeyboardEvent) => void;
|
|
223
|
-
validatorFromComponent?: Validator | Validator[];
|
|
224
|
-
component?: ComponentType<any>;
|
|
225
|
-
}
|
|
226
|
-
interface IGetErrorMessagesParams {
|
|
227
|
-
name: string;
|
|
228
|
-
fieldErrors?: {
|
|
229
|
-
[name: string]: string[];
|
|
230
|
-
};
|
|
231
|
-
externalFieldErrors?: {
|
|
232
|
-
[name: string]: string[];
|
|
233
|
-
};
|
|
234
|
-
externalMessagesErrors?: string[];
|
|
235
|
-
}
|
|
236
|
-
type FieldErrors = {
|
|
237
|
-
[name: string]: string[];
|
|
238
|
-
};
|
|
239
|
-
type FieldValidator = {
|
|
240
|
-
[name: string]: Validator | Validator[];
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export { CustomEvent, CustomKeyboardEvent, FieldErrors, FieldValidator, FormContextProps, FormProps, IEventParams, IFieldArrayProps, IFieldPeriodProps, IFieldProps, IFormSecurityContext, IGetErrorMessagesParams, IWithFieldContext, IWithFormSecurity, OnFielChangeEvent, PeriodChangeEvent, PeriodValidator, Validator, WithFieldProps };
|
package/lib/form/types.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { WithFieldProps } from './types.js';
|
|
3
|
-
import '../inputs/select/types.js';
|
|
4
|
-
import '../@types/Align.js';
|
|
5
|
-
import '../@types/DataCombo.js';
|
|
6
|
-
import '../@types/PermissionAttr.js';
|
|
7
|
-
import '../inputs/base/types.js';
|
|
8
|
-
import '../@types/Period.js';
|
|
9
|
-
import '../internals/types.js';
|
|
10
|
-
import '../@types/Position.js';
|
|
11
|
-
|
|
12
|
-
declare const withFieldHOC: <ComponentProps extends WithFieldProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ComponentProps> & React__default.RefAttributes<HTMLElement>>;
|
|
13
|
-
|
|
14
|
-
export { withFieldHOC as default };
|
package/lib/form/withFieldHOC.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
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 _helpers = require("./helpers");
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
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); }
|
|
12
|
-
const withFieldHOC = WrappedComponent => {
|
|
13
|
-
const EnhancedComponent = props => {
|
|
14
|
-
const {
|
|
15
|
-
name,
|
|
16
|
-
validators,
|
|
17
|
-
handlerStoreValidators,
|
|
18
|
-
handlerRemoveValidators
|
|
19
|
-
} = props;
|
|
20
|
-
const [validatorFromComponent, setValidatorFromComponent] = (0, _react.useState)(undefined);
|
|
21
|
-
const updateValidators = () => {
|
|
22
|
-
const validatorsArray = (0, _helpers.getValidatorsArray)(validators, validatorFromComponent);
|
|
23
|
-
if (validatorsArray && handlerStoreValidators) handlerStoreValidators(name, validatorsArray);
|
|
24
|
-
};
|
|
25
|
-
(0, _react.useEffect)(() => {
|
|
26
|
-
updateValidators();
|
|
27
|
-
return () => {
|
|
28
|
-
if (validators && handlerRemoveValidators) handlerRemoveValidators(name);
|
|
29
|
-
};
|
|
30
|
-
}, []);
|
|
31
|
-
(0, _react.useEffect)(() => {
|
|
32
|
-
updateValidators();
|
|
33
|
-
}, [validators]);
|
|
34
|
-
const contextValues = {
|
|
35
|
-
validatorFromComponent,
|
|
36
|
-
handlerSetValidatorFromComponent: validator => {
|
|
37
|
-
setValidatorFromComponent(validator);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
return /*#__PURE__*/_react.default.createElement(_helpers.withFieldContext.Provider, {
|
|
41
|
-
value: contextValues
|
|
42
|
-
}, /*#__PURE__*/_react.default.createElement(WrappedComponent, props));
|
|
43
|
-
};
|
|
44
|
-
function forwardRef(props, ref) {
|
|
45
|
-
return /*#__PURE__*/_react.default.createElement(_helpers.FormContext.Consumer, null, _ref => {
|
|
46
|
-
let {
|
|
47
|
-
handlerFieldChange,
|
|
48
|
-
handlerFieldValidate: handlerFieldValidate,
|
|
49
|
-
data,
|
|
50
|
-
fieldErrors,
|
|
51
|
-
externalFieldErrors,
|
|
52
|
-
handlerStoreValidators,
|
|
53
|
-
handlerRemoveValidators,
|
|
54
|
-
skeletonize
|
|
55
|
-
} = _ref;
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement(EnhancedComponent, _extends({}, props, {
|
|
57
|
-
skeletonize: skeletonize,
|
|
58
|
-
handlerFieldChange: handlerFieldChange,
|
|
59
|
-
handlerFieldValidate: handlerFieldValidate,
|
|
60
|
-
handlerStoreValidators: handlerStoreValidators,
|
|
61
|
-
handlerRemoveValidators: handlerRemoveValidators,
|
|
62
|
-
data: data,
|
|
63
|
-
fieldErrors: fieldErrors,
|
|
64
|
-
externalFieldErrors: externalFieldErrors,
|
|
65
|
-
forwardedRef: ref
|
|
66
|
-
}));
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return /*#__PURE__*/_react.default.forwardRef(forwardRef);
|
|
70
|
-
};
|
|
71
|
-
var _default = exports.default = withFieldHOC;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { IFormSecurityContext, IWithFormSecurity } from './types.js';
|
|
3
|
-
import '../inputs/select/types.js';
|
|
4
|
-
import '../@types/Align.js';
|
|
5
|
-
import '../@types/DataCombo.js';
|
|
6
|
-
import '../@types/PermissionAttr.js';
|
|
7
|
-
import '../inputs/base/types.js';
|
|
8
|
-
import '../@types/Period.js';
|
|
9
|
-
import '../internals/types.js';
|
|
10
|
-
import '../@types/Position.js';
|
|
11
|
-
|
|
12
|
-
declare const FormSecurityContext: React__default.Context<IFormSecurityContext>;
|
|
13
|
-
declare const withFormSecurity: <ComponentProps extends IWithFormSecurity>(WrappedComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
|
|
14
|
-
|
|
15
|
-
export { FormSecurityContext, withFormSecurity as default };
|