linear-react-components-ui 1.1.14-beta.0 → 1.1.14-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +45 -77
- package/.gitlab-ci.yml +13 -5
- package/.nvmrc +1 -0
- package/.vscode/settings.json +12 -3
- package/babel.config.json +4 -4
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/alerts/AlertContainer.js +48 -57
- package/lib/alerts/AlertProvider.js +36 -54
- package/lib/alerts/BaseAlert.js +12 -19
- package/lib/alerts/Message.d.ts +1 -1
- package/lib/alerts/Message.js +78 -45
- package/lib/alerts/helpers.js +2 -3
- package/lib/alerts/index.js +3 -4
- package/lib/alerts/types.d.ts +1 -0
- package/lib/alerts/withAlert.js +10 -11
- package/lib/assets/styles/alerts.scss +4 -7
- package/lib/assets/styles/button.scss +11 -9
- package/lib/assets/styles/checkbox.scss +45 -38
- package/lib/assets/styles/colors.scss +3 -1
- package/lib/assets/styles/commons.scss +1 -0
- package/lib/assets/styles/dialog.scss +37 -20
- package/lib/assets/styles/drawers.scss +9 -6
- package/lib/assets/styles/error.scss +9 -0
- package/lib/assets/styles/fieldset.scss +3 -0
- package/lib/assets/styles/gridlayout.scss +0 -2
- package/lib/assets/styles/hint.scss +21 -0
- package/lib/assets/styles/icon.scss +31 -4
- package/lib/assets/styles/input.scss +7 -7
- package/lib/assets/styles/multiSelect.scss +6 -1
- package/lib/assets/styles/radio.scss +37 -35
- package/lib/assets/styles/select.scss +13 -7
- package/lib/assets/styles/table.scss +9 -1
- package/lib/assets/styles/tabs.scss +28 -18
- package/lib/assets/styles/textContent.scss +9 -0
- package/lib/avatar/index.js +41 -41
- package/lib/badge/index.js +12 -14
- package/lib/buttons/ActivateButton.js +6 -9
- package/lib/buttons/AddButton.js +9 -12
- package/lib/buttons/Button.js +11 -12
- package/lib/buttons/ButtonGroups.js +6 -5
- package/lib/buttons/CancelButton.js +10 -9
- package/lib/buttons/DangerButton.js +10 -9
- package/lib/buttons/DefaultButton.js +90 -90
- package/lib/buttons/DestroyButton.js +10 -9
- package/lib/buttons/EditButton.js +6 -9
- package/lib/buttons/InactivateButton.js +6 -9
- package/lib/buttons/InfoButton.js +10 -9
- package/lib/buttons/PrimaryButton.js +10 -9
- package/lib/buttons/RestoreButton.js +6 -9
- package/lib/buttons/SaveButton.js +10 -9
- package/lib/buttons/SuccessButton.js +10 -9
- package/lib/buttons/WarningButton.js +10 -9
- package/lib/buttons/button_container/index.js +17 -21
- package/lib/buttons/index.js +16 -17
- package/lib/buttons/split_button/index.js +22 -25
- package/lib/buttons/types.d.ts +1 -0
- package/lib/calendar/DangerCalendar.js +10 -9
- package/lib/calendar/InfoCalendar.js +10 -9
- package/lib/calendar/PrimaryCalendar.js +10 -9
- package/lib/calendar/SuccessCalendar.js +10 -9
- package/lib/calendar/WarningCalendar.js +10 -9
- package/lib/calendar/base/Day.js +13 -12
- package/lib/calendar/base/Month.js +13 -18
- package/lib/calendar/base/Week.js +13 -18
- package/lib/calendar/base/helpers.js +12 -12
- package/lib/calendar/base/index.js +30 -44
- package/lib/calendar/index.js +7 -8
- package/lib/checkbox/Label.js +20 -10
- package/lib/checkbox/index.d.ts +2 -2
- package/lib/checkbox/index.js +83 -97
- package/lib/checkbox/types.d.ts +2 -1
- package/lib/dialog/Alert.js +5 -6
- package/lib/dialog/Custom.js +16 -18
- package/lib/dialog/Error.js +5 -6
- package/lib/dialog/Information.js +5 -6
- package/lib/dialog/Question.js +13 -14
- package/lib/dialog/Warning.js +7 -7
- package/lib/dialog/base/Content.js +8 -6
- package/lib/dialog/base/Footer.js +5 -8
- package/lib/dialog/base/Header.js +29 -29
- package/lib/dialog/base/index.d.ts +8 -2
- package/lib/dialog/base/index.js +109 -105
- package/lib/dialog/base/style.js +7 -10
- package/lib/dialog/form/index.js +31 -34
- package/lib/dialog/index.js +8 -9
- package/lib/dialog/types.d.ts +8 -13
- package/lib/drawer/Content.js +12 -11
- package/lib/drawer/Drawer.js +74 -88
- package/lib/drawer/Header.js +34 -37
- package/lib/drawer/helpers.js +3 -4
- package/lib/drawer/index.js +4 -5
- package/lib/dropdown/Popup.d.ts +1 -1
- package/lib/dropdown/Popup.js +41 -42
- package/lib/dropdown/helper.js +3 -5
- package/lib/dropdown/types.d.ts +1 -0
- package/lib/dropdown/withDropdown.js +39 -60
- package/lib/fieldset/index.js +52 -58
- package/lib/fieldset/types.d.ts +2 -0
- package/lib/form/Field.d.ts +2 -0
- package/lib/form/Field.js +73 -79
- package/lib/form/FieldArray.d.ts +2 -0
- package/lib/form/FieldArray.js +70 -94
- package/lib/form/FieldNumber.d.ts +2 -0
- package/lib/form/FieldNumber.js +39 -48
- package/lib/form/FieldPeriod.d.ts +2 -0
- package/lib/form/FieldPeriod.js +48 -54
- package/lib/form/helpers.d.ts +2 -0
- package/lib/form/helpers.js +22 -27
- package/lib/form/index.d.ts +2 -0
- package/lib/form/index.js +114 -146
- package/lib/form/types.d.ts +6 -2
- package/lib/form/withFieldHOC.d.ts +2 -0
- package/lib/form/withFieldHOC.js +32 -39
- package/lib/form/withFormSecurity.d.ts +2 -0
- package/lib/form/withFormSecurity.js +27 -35
- package/lib/gridlayout/GridCol.js +14 -14
- package/lib/gridlayout/GridRow.js +18 -12
- package/lib/gridlayout/index.js +3 -4
- package/lib/gridlayout/types.d.ts +1 -1
- package/lib/hint/helpers.d.ts +3 -0
- package/lib/hint/helpers.js +21 -0
- package/lib/hint/index.d.ts +2 -1
- package/lib/hint/index.js +18 -29
- package/lib/hint/types.d.ts +3 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +7 -4
- package/lib/icons/index.d.ts +3 -2
- package/lib/icons/index.js +43 -48
- package/lib/icons/types.d.ts +22 -9
- package/lib/index.d.ts +2 -1
- package/lib/index.js +10 -10
- package/lib/inputs/base/InputTextBase.d.ts +2 -0
- package/lib/inputs/base/InputTextBase.js +149 -113
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +3 -2
- package/lib/inputs/base/helpers.js +21 -26
- package/lib/inputs/base/types.d.ts +17 -2
- package/lib/inputs/color/index.js +29 -40
- package/lib/inputs/date/Dialog.d.ts +2 -0
- package/lib/inputs/date/Dialog.js +9 -10
- package/lib/inputs/date/Dropdown.d.ts +2 -0
- package/lib/inputs/date/Dropdown.js +12 -11
- package/lib/inputs/date/helpers.d.ts +2 -0
- package/lib/inputs/date/helpers.js +14 -14
- package/lib/inputs/date/index.d.ts +2 -0
- package/lib/inputs/date/index.js +127 -152
- package/lib/inputs/date/types.d.ts +4 -1
- package/lib/inputs/{mask/imaskHOC.d.ts → errorMessage/index.d.ts} +5 -7
- package/lib/inputs/errorMessage/index.js +26 -0
- package/lib/inputs/file/DefaultFile.d.ts +2 -0
- package/lib/inputs/file/DefaultFile.js +47 -74
- package/lib/inputs/file/DragDropFile.d.ts +2 -0
- package/lib/inputs/file/DragDropFile.js +97 -149
- package/lib/inputs/file/File.d.ts +3 -1
- package/lib/inputs/file/File.js +26 -32
- package/lib/inputs/file/FileButtonSettings.d.ts +2 -0
- package/lib/inputs/file/FileButtonSettings.js +13 -13
- package/lib/inputs/file/helpers.d.ts +2 -0
- package/lib/inputs/file/helpers.js +4 -6
- package/lib/inputs/file/index.d.ts +2 -0
- package/lib/inputs/file/index.js +4 -5
- package/lib/inputs/file/types.d.ts +2 -0
- package/lib/inputs/inputHOC.d.ts +2 -1
- package/lib/inputs/inputHOC.js +21 -34
- package/lib/inputs/mask/BaseMask.d.ts +4 -5
- package/lib/inputs/mask/BaseMask.js +125 -37
- package/lib/inputs/mask/Cnpj.d.ts +2 -0
- package/lib/inputs/mask/Cnpj.js +18 -31
- package/lib/inputs/mask/Cpf.d.ts +2 -0
- package/lib/inputs/mask/Cpf.js +20 -37
- package/lib/inputs/mask/Phone.d.ts +2 -0
- package/lib/inputs/mask/Phone.js +7 -6
- package/lib/inputs/mask/ZipCode.d.ts +2 -0
- package/lib/inputs/mask/ZipCode.js +6 -9
- package/lib/inputs/mask/helpers.d.ts +50 -12
- package/lib/inputs/mask/helpers.js +77 -37
- package/lib/inputs/mask/index.d.ts +4 -2
- package/lib/inputs/mask/index.js +6 -7
- package/lib/inputs/mask/types.d.ts +18 -17
- package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -0
- package/lib/inputs/multiSelect/ActionButtons.js +23 -22
- package/lib/inputs/multiSelect/Dropdown.d.ts +2 -0
- package/lib/inputs/multiSelect/Dropdown.js +50 -67
- package/lib/inputs/multiSelect/helper.d.ts +2 -0
- package/lib/inputs/multiSelect/helper.js +8 -7
- package/lib/inputs/multiSelect/index.d.ts +2 -0
- package/lib/inputs/multiSelect/index.js +83 -135
- package/lib/inputs/multiSelect/types.d.ts +2 -0
- package/lib/inputs/number/BaseNumber.d.ts +2 -1
- package/lib/inputs/number/BaseNumber.js +25 -24
- package/lib/inputs/number/Currency.d.ts +2 -1
- package/lib/inputs/number/Currency.js +8 -8
- package/lib/inputs/number/Decimal.d.ts +2 -1
- package/lib/inputs/number/Decimal.js +3 -6
- package/lib/inputs/number/format_number.js +5 -5
- package/lib/inputs/number/index.d.ts +2 -1
- package/lib/inputs/number/index.js +20 -32
- package/lib/inputs/number/types.d.ts +2 -9
- package/lib/inputs/period/Dialog.d.ts +3 -1
- package/lib/inputs/period/Dialog.js +9 -10
- package/lib/inputs/period/Dropdown.d.ts +2 -0
- package/lib/inputs/period/Dropdown.js +8 -9
- package/lib/inputs/period/PeriodList.d.ts +2 -0
- package/lib/inputs/period/PeriodList.js +14 -13
- package/lib/inputs/period/helper.d.ts +2 -0
- package/lib/inputs/period/helper.js +34 -37
- package/lib/inputs/period/index.d.ts +2 -0
- package/lib/inputs/period/index.js +162 -196
- package/lib/inputs/period/types.d.ts +3 -1
- package/lib/inputs/search/index.d.ts +2 -1
- package/lib/inputs/search/index.js +45 -68
- package/lib/inputs/select/ActionButtons.d.ts +2 -1
- package/lib/inputs/select/ActionButtons.js +25 -35
- package/lib/inputs/select/Dropdown.d.ts +2 -1
- package/lib/inputs/select/Dropdown.js +41 -60
- package/lib/inputs/select/helper.d.ts +2 -1
- package/lib/inputs/select/helper.js +49 -43
- package/lib/inputs/select/index.d.ts +2 -0
- package/lib/inputs/select/index.js +13 -12
- package/lib/inputs/select/multiple/Selecteds.d.ts +3 -1
- package/lib/inputs/select/multiple/Selecteds.js +17 -22
- package/lib/inputs/select/multiple/index.d.ts +2 -0
- package/lib/inputs/select/multiple/index.js +125 -162
- package/lib/inputs/select/simple/index.d.ts +2 -0
- package/lib/inputs/select/simple/index.js +154 -179
- package/lib/inputs/select/types.d.ts +5 -2
- package/lib/inputs/text/index.js +3 -6
- package/lib/inputs/textarea/index.d.ts +2 -0
- package/lib/inputs/textarea/index.js +10 -10
- package/lib/inputs/textarea/types.d.ts +2 -0
- package/lib/inputs/types.d.ts +12 -9
- package/lib/internals/colorStyles.js +2 -3
- package/lib/internals/constants.js +2 -4
- package/lib/internals/types.d.ts +5 -2
- package/lib/internals/withTooltip.d.ts +3 -2
- package/lib/internals/withTooltip.js +76 -76
- package/lib/labelMessages/index.js +22 -42
- package/lib/labels/DangerLabel.js +10 -9
- package/lib/labels/DefaultLabel.js +26 -40
- package/lib/labels/InfoLabel.js +10 -9
- package/lib/labels/PrimaryLabel.js +10 -9
- package/lib/labels/SuccessLabel.js +10 -9
- package/lib/labels/WarningLabel.js +10 -9
- package/lib/labels/index.js +8 -9
- package/lib/labels/label_container/index.js +8 -8
- package/lib/list/Header.js +9 -8
- package/lib/list/Item.js +74 -70
- package/lib/list/Separator.js +5 -8
- package/lib/list/helpers.js +4 -6
- package/lib/list/index.js +74 -101
- package/lib/menus/float/MenuItem.js +19 -20
- package/lib/menus/float/SubMenuContainer.js +27 -33
- package/lib/menus/float/helpers.js +3 -4
- package/lib/menus/float/index.js +17 -18
- package/lib/menus/float/types.d.ts +1 -1
- package/lib/menus/index.js +2 -3
- package/lib/menus/sidenav/ExpandMenu.js +9 -8
- package/lib/menus/sidenav/MenuLink.js +10 -9
- package/lib/menus/sidenav/NavMenuGroup.js +12 -11
- package/lib/menus/sidenav/NavMenuItem.js +48 -62
- package/lib/menus/sidenav/NavSubMenuItem.js +20 -25
- package/lib/menus/sidenav/helpers.js +6 -9
- package/lib/menus/sidenav/index.js +85 -113
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +7 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +64 -84
- package/lib/menus/sidenav/types.d.ts +1 -1
- package/lib/noPermission/index.js +14 -17
- package/lib/panel/Content.d.ts +1 -1
- package/lib/panel/Content.js +47 -60
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/DangerPanel.js +6 -9
- package/lib/panel/Default.d.ts +1 -1
- package/lib/panel/Default.js +45 -60
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/Header.js +32 -30
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/InfoPanel.js +6 -9
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.js +6 -9
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.js +6 -9
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/ToolBar.js +6 -5
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/WarningPanel.js +6 -9
- package/lib/panel/helpers.d.ts +7 -2
- package/lib/panel/helpers.js +12 -24
- package/lib/panel/index.d.ts +1 -1
- package/lib/panel/index.js +9 -10
- package/lib/panel/types.d.ts +46 -5
- package/lib/permissionValidations.js +24 -29
- package/lib/popover/PopoverText.js +6 -5
- package/lib/popover/PopoverTitle.js +6 -5
- package/lib/popover/index.js +15 -19
- package/lib/progress/Bar.js +31 -37
- package/lib/progress/index.js +18 -20
- package/lib/radio/index.js +36 -57
- package/lib/shortcuts/index.js +10 -9
- package/lib/skeleton/SkeletonContainer.js +10 -11
- package/lib/skeleton/index.js +27 -34
- package/lib/spinner/SpinnerLoading.js +7 -8
- package/lib/spinner/index.js +23 -37
- package/lib/split/Split.js +95 -112
- package/lib/split/SplitSide.js +20 -19
- package/lib/split/helpers.js +3 -4
- package/lib/split/index.js +3 -4
- package/lib/table/Body.js +42 -45
- package/lib/table/Header.js +29 -32
- package/lib/table/HeaderColumn.d.ts +1 -1
- package/lib/table/HeaderColumn.js +35 -22
- package/lib/table/Row.js +45 -48
- package/lib/table/RowColumn.js +38 -39
- package/lib/table/helpers.js +7 -13
- package/lib/table/index.js +82 -102
- package/lib/table/types.d.ts +3 -0
- package/lib/tabs/DropdownTabs.d.ts +11 -0
- package/lib/tabs/DropdownTabs.js +71 -0
- package/lib/tabs/Menu.d.ts +1 -1
- package/lib/tabs/Menu.js +35 -23
- package/lib/tabs/{DropdownItems.d.ts → MenuTabs.d.ts} +3 -3
- package/lib/tabs/MenuTabs.js +82 -0
- package/lib/tabs/Panel.d.ts +1 -1
- package/lib/tabs/Panel.js +70 -66
- package/lib/tabs/context.d.ts +12 -0
- package/lib/tabs/context.js +130 -0
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/index.js +46 -225
- package/lib/tabs/tabHelpers.d.ts +4 -15
- package/lib/tabs/tabHelpers.js +37 -42
- package/lib/tabs/types.d.ts +48 -15
- package/lib/tabs/useTabs.d.ts +11 -0
- package/lib/tabs/useTabs.js +11 -0
- package/lib/textContent/index.d.ts +8 -0
- package/lib/textContent/index.js +30 -0
- package/lib/toolbar/ButtonBar.js +39 -43
- package/lib/toolbar/LabelBar.js +36 -40
- package/lib/toolbar/Separator.js +5 -8
- package/lib/toolbar/ToolBarGroup.js +7 -7
- package/lib/toolbar/helpers.js +2 -3
- package/lib/toolbar/index.js +23 -25
- package/lib/toolbar/types.d.ts +1 -0
- package/lib/tooltip/index.js +28 -33
- package/lib/treetable/Body.js +21 -33
- package/lib/treetable/Header.js +11 -14
- package/lib/treetable/Row.js +90 -142
- package/lib/treetable/helpers.js +15 -24
- package/lib/treetable/index.js +11 -13
- package/lib/treeview/Header.js +8 -7
- package/lib/treeview/Node.js +96 -136
- package/lib/treeview/constants.js +2 -3
- package/lib/treeview/index.js +150 -216
- package/lib/uitour/helpers.js +4 -7
- package/lib/uitour/index.d.ts +2 -1
- package/lib/uitour/index.js +113 -100
- package/lib/uitour/types.d.ts +9 -1
- package/package.json +77 -82
- package/tsconfig.json +1 -0
- package/.tool-versions +0 -1
- package/lib/inputs/mask/imaskHOC.js +0 -224
- package/lib/tabs/DropdownItems.js +0 -65
- package/lib/tabs/MenuItems.d.ts +0 -11
- package/lib/tabs/MenuItems.js +0 -76
- package/lib/treeview_old/Header.js +0 -28
- package/lib/treeview_old/Node.js +0 -88
- package/lib/treeview_old/index.js +0 -42
- package/lib/types-c2a0f035.d.ts +0 -50
package/lib/inputs/mask/Cpf.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -9,51 +8,36 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
9
|
var _BaseMask = _interopRequireDefault(require("./BaseMask"));
|
|
11
10
|
var _helpers = require("./helpers");
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
16
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
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); }
|
|
19
|
-
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; }
|
|
20
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
21
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
22
15
|
// Em caso de alteração no nome do componente deverá ser atualizada
|
|
23
16
|
// à propriedade displayName, para o mesmo nome do componente
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
enableValidation =
|
|
27
|
-
handlerSetComponentValidator
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
setMessageFromValidator = _useState2[1];
|
|
32
|
-
(0, _react.useEffect)(function () {
|
|
17
|
+
const CpfField = props => {
|
|
18
|
+
const {
|
|
19
|
+
enableValidation = true,
|
|
20
|
+
handlerSetComponentValidator
|
|
21
|
+
} = props;
|
|
22
|
+
const [messageFromValidator, setMessageFromValidator] = (0, _react.useState)('');
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
33
24
|
if (enableValidation && handlerSetComponentValidator) {
|
|
34
|
-
handlerSetComponentValidator(
|
|
35
|
-
return _helpers.CPFValidation;
|
|
36
|
-
});
|
|
25
|
+
handlerSetComponentValidator(() => _helpers.CPFValidation);
|
|
37
26
|
}
|
|
38
27
|
}, []);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return debouncedOnChange.cancel;
|
|
46
|
-
}, []);
|
|
47
|
-
var onChange = function onChange(e) {
|
|
48
|
-
// console.log('onChange >>>', props.onChange);
|
|
49
|
-
if (enableValidation && e) {
|
|
28
|
+
const debouncedOnChange = (0, _react.useMemo)(() => _lodash.default.debounce(value => {
|
|
29
|
+
(0, _helpers.CPFValidation)(value, !handlerSetComponentValidator ? setMessageFromValidator : undefined);
|
|
30
|
+
}, 300), [handlerSetComponentValidator]);
|
|
31
|
+
(0, _react.useEffect)(() => debouncedOnChange.cancel, []);
|
|
32
|
+
const onChange = e => {
|
|
33
|
+
if (enableValidation) {
|
|
50
34
|
debouncedOnChange(e.target.value);
|
|
51
35
|
if (props.onChange) props.onChange(e);
|
|
52
36
|
} else if (props.onChange) {
|
|
53
37
|
props.onChange(e);
|
|
54
38
|
}
|
|
55
39
|
};
|
|
56
|
-
|
|
40
|
+
const getErrorMessagesProp = () => {
|
|
57
41
|
if (enableValidation && !handlerSetComponentValidator && messageFromValidator) {
|
|
58
42
|
return {
|
|
59
43
|
errorMessages: [messageFromValidator]
|
|
@@ -70,5 +54,4 @@ var CpfField = function CpfField(props) {
|
|
|
70
54
|
// Em caso de alteração na propriedade displayName deverá ser atualizada a lógica na função
|
|
71
55
|
// getCustomProps dentro do componente Field do diretório lib/form
|
|
72
56
|
CpfField.displayName = 'CpfField';
|
|
73
|
-
var _default = CpfField;
|
|
74
|
-
exports.default = _default;
|
|
57
|
+
var _default = exports.default = CpfField;
|
|
@@ -4,6 +4,8 @@ import '../../@types/Align.js';
|
|
|
4
4
|
import '../../@types/PermissionAttr.js';
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
|
+
import '../../internals/types.js';
|
|
8
|
+
import '../../@types/Position.js';
|
|
7
9
|
|
|
8
10
|
declare const PhoneField: (props: IPhoneFieldProps) => JSX.Element;
|
|
9
11
|
|
package/lib/inputs/mask/Phone.js
CHANGED
|
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _BaseMask = _interopRequireDefault(require("./BaseMask"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
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); }
|
|
11
|
+
const PhoneField = props => {
|
|
12
|
+
const {
|
|
13
|
+
cellNumber
|
|
14
|
+
} = props;
|
|
13
15
|
return /*#__PURE__*/_react.default.createElement(_BaseMask.default, _extends({}, props, {
|
|
14
16
|
mask: cellNumber ? '(00) 00000-0000' : '(00) 0000-0000'
|
|
15
17
|
}));
|
|
16
18
|
};
|
|
17
|
-
var _default = PhoneField;
|
|
18
|
-
exports.default = _default;
|
|
19
|
+
var _default = exports.default = PhoneField;
|
|
@@ -4,6 +4,8 @@ import '../../@types/Align.js';
|
|
|
4
4
|
import '../../@types/PermissionAttr.js';
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
|
+
import '../../internals/types.js';
|
|
8
|
+
import '../../@types/Position.js';
|
|
7
9
|
|
|
8
10
|
declare const ZipCodeField: (props: IZipCode) => JSX.Element;
|
|
9
11
|
|
|
@@ -6,12 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _BaseMask = _interopRequireDefault(require("./BaseMask"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
var _default = ZipCodeField;
|
|
17
|
-
exports.default = _default;
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
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); }
|
|
11
|
+
const ZipCodeField = props => /*#__PURE__*/_react.default.createElement(_BaseMask.default, _extends({}, props, {
|
|
12
|
+
mask: "00000-000"
|
|
13
|
+
}));
|
|
14
|
+
var _default = exports.default = ZipCodeField;
|
|
@@ -1,18 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import 'react';
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '../base/types.js';
|
|
7
|
-
import '../../@types/Align.js';
|
|
1
|
+
import { TextAlign } from '../../@types/Align.js';
|
|
2
|
+
import { OnDenied, PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { CustomInputEvent } from '../base/types.js';
|
|
5
|
+
import { IBaseMaskProps } from './types.js';
|
|
8
6
|
import '../../@types/Period.js';
|
|
9
|
-
import '../../
|
|
7
|
+
import '../../internals/types.js';
|
|
10
8
|
import '../../@types/Position.js';
|
|
11
|
-
import '../../@types/Icon.js';
|
|
12
|
-
import '../../icons/helper.js';
|
|
13
9
|
|
|
14
|
-
declare
|
|
10
|
+
declare const getMaskOptions: ({ isDateField, placeholderChar, min, max, lazy, rightElements, ...rest }: IBaseMaskProps) => {
|
|
11
|
+
value?: string | undefined;
|
|
12
|
+
onBlur?: ((e: CustomInputEvent) => void) | undefined;
|
|
13
|
+
onKeyDown?: ((e: CustomInputEvent | React.KeyboardEvent<Element>) => void) | undefined;
|
|
14
|
+
defaultValue?: string | undefined;
|
|
15
|
+
isNumeric?: boolean | undefined;
|
|
16
|
+
scale?: number | undefined;
|
|
17
|
+
radix?: string | undefined;
|
|
18
|
+
blocks?: any;
|
|
19
|
+
thousandsSeparator?: string | undefined;
|
|
20
|
+
leftElements?: JSX.Element | JSX.Element[] | undefined;
|
|
21
|
+
handlerSetOnDenied?: ((onDeniedValue: OnDenied) => void) | undefined;
|
|
22
|
+
onChange?: ((e: CustomInputEvent, maskValue?: string | undefined, date?: string | undefined) => void) | undefined;
|
|
23
|
+
padFractionalZeros?: boolean | undefined;
|
|
24
|
+
onComplete?: ((e: CustomInputEvent, maskValue?: string | undefined, date?: string | undefined) => void) | undefined;
|
|
25
|
+
inputRef?: React.MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void) | undefined;
|
|
26
|
+
permissionAttr?: PermissionAttr | undefined;
|
|
27
|
+
errorMessages?: string[] | undefined;
|
|
28
|
+
rounded?: boolean | undefined;
|
|
29
|
+
textAlign?: TextAlign | undefined;
|
|
30
|
+
customClassForInputContent?: string | undefined;
|
|
31
|
+
label?: string | undefined;
|
|
32
|
+
name?: string | undefined;
|
|
33
|
+
customClassForLabel?: string | undefined;
|
|
34
|
+
customClass?: string | undefined;
|
|
35
|
+
gridLayout?: string | undefined;
|
|
36
|
+
placeHolder?: string | undefined;
|
|
37
|
+
readOnly?: boolean | undefined;
|
|
38
|
+
labelUppercase?: boolean | undefined;
|
|
39
|
+
disabled?: boolean | undefined;
|
|
40
|
+
unmask?: boolean | undefined;
|
|
41
|
+
onFocus?: ((e: CustomInputEvent) => void) | undefined;
|
|
42
|
+
required?: boolean | undefined;
|
|
43
|
+
returnFormattedValueOnBlur?: boolean | undefined;
|
|
44
|
+
returnFormattedValueOnKeyDown?: boolean | undefined;
|
|
45
|
+
autoCompleteMask?: "left" | "right" | undefined;
|
|
46
|
+
definitions?: any;
|
|
47
|
+
mask?: any;
|
|
48
|
+
placeholderChar: string;
|
|
49
|
+
min: any;
|
|
50
|
+
max: any;
|
|
51
|
+
lazy: boolean | undefined;
|
|
52
|
+
};
|
|
15
53
|
declare function CPFValidation(cpf?: string, returnMessage?: (msg: string) => void): void | "CPF inválido";
|
|
16
54
|
declare function CNPJValidation(cnpj?: string, returnMessage?: (msg: string) => void): void | "CNPJ inválido";
|
|
17
55
|
|
|
18
|
-
export { CNPJValidation, CPFValidation,
|
|
56
|
+
export { CNPJValidation, CPFValidation, getMaskOptions };
|
|
@@ -5,37 +5,77 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.CNPJValidation = CNPJValidation;
|
|
7
7
|
exports.CPFValidation = CPFValidation;
|
|
8
|
-
exports.
|
|
8
|
+
exports.getMaskOptions = void 0;
|
|
9
9
|
var _lodash = require("lodash");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
const _excluded = ["isDateField", "placeholderChar", "min", "max", "lazy", "rightElements"];
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
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); }
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
19
|
+
const momentFormat = 'DD/MM/YYYY';
|
|
20
|
+
const getMaskOptions = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
isDateField,
|
|
23
|
+
placeholderChar = '_',
|
|
24
|
+
min,
|
|
25
|
+
max,
|
|
26
|
+
lazy,
|
|
27
|
+
rightElements
|
|
28
|
+
} = _ref,
|
|
29
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
// TODO: essa etapa deverá ser feita junto com o refactory dos componentes Date e Period.
|
|
31
|
+
// if (isDateField) {
|
|
32
|
+
// return {
|
|
33
|
+
// mask: Date,
|
|
34
|
+
// min: min || new Date(1900, 0, 1),
|
|
35
|
+
// max: max || new Date(9999, 0, 1),
|
|
36
|
+
// pattern: momentFormat,
|
|
37
|
+
// lazy,
|
|
38
|
+
// format: (date: moment.MomentInput) => moment(date).format(momentFormat),
|
|
39
|
+
// parse: (str) => moment(str, momentFormat).toDate(),
|
|
40
|
+
// blocks: {
|
|
41
|
+
// DD: {
|
|
42
|
+
// mask: IMask.MaskedRange,
|
|
43
|
+
// from: 1,
|
|
44
|
+
// to: 31,
|
|
45
|
+
// maxLength: 2,
|
|
46
|
+
// },
|
|
47
|
+
// MM: {
|
|
48
|
+
// mask: IMask.MaskedRange,
|
|
49
|
+
// from: 1,
|
|
50
|
+
// to: 12,
|
|
51
|
+
// maxLength: 2,
|
|
52
|
+
// },
|
|
53
|
+
// YYYY: {
|
|
54
|
+
// mask: IMask.MaskedRange,
|
|
55
|
+
// from: 1900,
|
|
56
|
+
// to: 9999,
|
|
57
|
+
// },
|
|
58
|
+
// },
|
|
59
|
+
// } satisfies ReactMaskOpts;
|
|
60
|
+
// }
|
|
61
|
+
|
|
62
|
+
return _objectSpread({
|
|
63
|
+
placeholderChar: placeholderChar === '' ? ' ' : placeholderChar,
|
|
64
|
+
min,
|
|
65
|
+
max,
|
|
66
|
+
lazy
|
|
67
|
+
}, rest);
|
|
30
68
|
};
|
|
69
|
+
exports.getMaskOptions = getMaskOptions;
|
|
70
|
+
const allEqualDigits = input => input.split('').every(char => char === input[0]);
|
|
31
71
|
function CPFValidation(cpf, returnMessage) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
72
|
+
const stringCpf = cpf ? cpf.replace(/[^\d]+/g, '') : '';
|
|
73
|
+
let sum = 0;
|
|
74
|
+
let splitRest;
|
|
35
75
|
if (stringCpf === '' || stringCpf.length < 11) return returnMessage ? returnMessage('CPF inválido') : 'CPF inválido';
|
|
36
76
|
if (allEqualDigits(stringCpf)) return returnMessage ? returnMessage('CPF inválido') : 'CPF inválido';
|
|
37
77
|
// 1st digit validation
|
|
38
|
-
for (
|
|
78
|
+
for (let i = 0; i < 9; i++) {
|
|
39
79
|
sum += (0, _lodash.parseInt)(stringCpf.charAt(i), 10) * (10 - i);
|
|
40
80
|
}
|
|
41
81
|
splitRest = sum * 10 % 11;
|
|
@@ -44,8 +84,8 @@ function CPFValidation(cpf, returnMessage) {
|
|
|
44
84
|
// 2nd digit validation
|
|
45
85
|
sum = 0;
|
|
46
86
|
splitRest = 0;
|
|
47
|
-
for (
|
|
48
|
-
sum += (0, _lodash.parseInt)(stringCpf.charAt(
|
|
87
|
+
for (let i = 0; i < 10; i++) {
|
|
88
|
+
sum += (0, _lodash.parseInt)(stringCpf.charAt(i), 10) * (11 - i);
|
|
49
89
|
}
|
|
50
90
|
splitRest = sum * 10 % 11;
|
|
51
91
|
if (splitRest === 10 || splitRest === 11) splitRest = 0;
|
|
@@ -53,28 +93,28 @@ function CPFValidation(cpf, returnMessage) {
|
|
|
53
93
|
return returnMessage ? returnMessage('') : undefined;
|
|
54
94
|
}
|
|
55
95
|
function CNPJValidation(cnpj, returnMessage) {
|
|
56
|
-
|
|
96
|
+
const stringCnpj = cnpj ? cnpj.replace(/[^\d]+/g, '') : '';
|
|
57
97
|
if (stringCnpj === '' || stringCnpj.length !== 14) return returnMessage ? returnMessage('CNPJ inválido') : 'CNPJ inválido';
|
|
58
98
|
if (allEqualDigits(stringCnpj)) return returnMessage ? returnMessage('CNPJ inválido') : 'CNPJ inválido';
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
99
|
+
let length = stringCnpj.length - 2;
|
|
100
|
+
let numbers = stringCnpj.substring(0, length);
|
|
101
|
+
const digits = stringCnpj.substring(length);
|
|
102
|
+
let sum = 0;
|
|
103
|
+
let pos = length - 7;
|
|
64
104
|
// 1° digit validation
|
|
65
|
-
for (
|
|
105
|
+
for (let i = length; i >= 1; i--) {
|
|
66
106
|
sum += (0, _lodash.parseInt)(numbers.charAt(length - i)) * pos--;
|
|
67
107
|
if (pos < 2) pos = 9;
|
|
68
108
|
}
|
|
69
|
-
|
|
109
|
+
let result = sum % 11 < 2 ? 0 : 11 - sum % 11;
|
|
70
110
|
if (result.toString() !== digits.charAt(0)) return returnMessage ? returnMessage('CNPJ inválido') : 'CNPJ inválido';
|
|
71
111
|
length += 1;
|
|
72
112
|
numbers = stringCnpj.substring(0, length);
|
|
73
113
|
sum = 0;
|
|
74
114
|
pos = length - 7;
|
|
75
115
|
// 2° digit validation
|
|
76
|
-
for (
|
|
77
|
-
sum += (0, _lodash.parseInt)(numbers.charAt(length -
|
|
116
|
+
for (let i = length; i >= 1; i--) {
|
|
117
|
+
sum += (0, _lodash.parseInt)(numbers.charAt(length - i)) * pos--;
|
|
78
118
|
if (pos < 2) pos = 9;
|
|
79
119
|
}
|
|
80
120
|
result = sum % 11 < 2 ? 0 : 11 - sum % 11;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BaseMask from './BaseMask.js';
|
|
2
2
|
export { default as CpfField } from './Cpf.js';
|
|
3
3
|
export { default as CnpjField } from './Cnpj.js';
|
|
4
4
|
export { default as PhoneField } from './Phone.js';
|
|
@@ -9,7 +9,9 @@ import '../../@types/Align.js';
|
|
|
9
9
|
import '../../@types/PermissionAttr.js';
|
|
10
10
|
import '../base/types.js';
|
|
11
11
|
import '../../@types/Period.js';
|
|
12
|
+
import '../../internals/types.js';
|
|
13
|
+
import '../../@types/Position.js';
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
export {
|
|
17
|
+
export { BaseMask as default };
|
package/lib/inputs/mask/index.js
CHANGED
|
@@ -5,25 +5,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "CnpjField", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _Cnpj.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CpfField", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _Cpf.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "PhoneField", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _Phone.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "ZipCodeField", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
26
|
+
get: function () {
|
|
27
27
|
return _ZipCode.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
@@ -33,6 +33,5 @@ var _Cpf = _interopRequireDefault(require("./Cpf"));
|
|
|
33
33
|
var _Cnpj = _interopRequireDefault(require("./Cnpj"));
|
|
34
34
|
var _Phone = _interopRequireDefault(require("./Phone"));
|
|
35
35
|
var _ZipCode = _interopRequireDefault(require("./ZipCode"));
|
|
36
|
-
function _interopRequireDefault(
|
|
37
|
-
var _default = _BaseMask.default;
|
|
38
|
-
exports.default = _default;
|
|
36
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
37
|
+
var _default = exports.default = _BaseMask.default;
|
|
@@ -3,24 +3,23 @@ import { TextAlign } from '../../@types/Align.js';
|
|
|
3
3
|
import { OnDenied, PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
4
4
|
import { CustomInputEvent } from '../base/types.js';
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
|
+
import '../../internals/types.js';
|
|
7
|
+
import '../../@types/Position.js';
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
type IBaseMaskProps = {
|
|
8
10
|
value?: string;
|
|
9
11
|
onBlur?: (e: CustomInputEvent) => void;
|
|
10
12
|
onKeyDown?: (e: CustomInputEvent | KeyboardEvent<Element>) => void;
|
|
11
13
|
defaultValue?: string;
|
|
12
|
-
mask?: string | NumberConstructor;
|
|
13
14
|
isNumeric?: boolean;
|
|
14
15
|
scale?: number;
|
|
15
16
|
radix?: string;
|
|
17
|
+
blocks?: any;
|
|
16
18
|
thousandsSeparator?: string;
|
|
17
19
|
rightElements?: JSX.Element | JSX.Element[];
|
|
18
20
|
leftElements?: JSX.Element | JSX.Element[];
|
|
19
21
|
handlerSetOnDenied?: (onDeniedValue: OnDenied) => void;
|
|
20
|
-
onChange?: (e: CustomInputEvent, maskValue?: string, date?: string
|
|
21
|
-
initial: string;
|
|
22
|
-
final: string;
|
|
23
|
-
}) => void;
|
|
22
|
+
onChange?: (e: CustomInputEvent, maskValue?: string, date?: string) => void;
|
|
24
23
|
padFractionalZeros?: boolean;
|
|
25
24
|
onComplete?: (e: CustomInputEvent, maskValue?: string, date?: string) => void;
|
|
26
25
|
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
@@ -47,25 +46,27 @@ interface IBaseMaskProps {
|
|
|
47
46
|
returnFormattedValueOnKeyDown?: boolean;
|
|
48
47
|
isDateField?: boolean;
|
|
49
48
|
autoCompleteMask?: 'left' | 'right';
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
definitions?: any;
|
|
50
|
+
mask?: any;
|
|
51
|
+
min?: any;
|
|
52
|
+
max?: any;
|
|
53
|
+
};
|
|
54
|
+
type ICnpjFieldProps = IBaseMaskProps & {
|
|
52
55
|
value?: string;
|
|
53
56
|
enableValidation?: boolean;
|
|
54
57
|
handlerSetComponentValidator?: (validator: () => void) => void;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
interface ICpfProps extends IBaseMaskProps {
|
|
58
|
+
};
|
|
59
|
+
type ICpfProps = IBaseMaskProps & {
|
|
58
60
|
value?: string;
|
|
59
61
|
enableValidation?: boolean;
|
|
60
62
|
handlerSetComponentValidator?: (validator: () => void) => void;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
interface IPhoneFieldProps extends IBaseMaskProps {
|
|
63
|
+
};
|
|
64
|
+
type IPhoneFieldProps = IBaseMaskProps & {
|
|
64
65
|
value?: string;
|
|
65
66
|
cellNumber?: boolean;
|
|
66
|
-
}
|
|
67
|
-
|
|
67
|
+
};
|
|
68
|
+
type IZipCode = IBaseMaskProps & {
|
|
68
69
|
value?: string;
|
|
69
|
-
}
|
|
70
|
+
};
|
|
70
71
|
|
|
71
72
|
export { IBaseMaskProps, ICnpjFieldProps, ICpfProps, IPhoneFieldProps, IZipCode };
|
|
@@ -5,6 +5,8 @@ import '../base/types.js';
|
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
7
|
import '../../@types/PermissionAttr.js';
|
|
8
|
+
import '../../internals/types.js';
|
|
9
|
+
import '../../@types/Position.js';
|
|
8
10
|
|
|
9
11
|
declare const ActionButtons: ({ disabled, dropdownOpened, handleOpenClose, handleCheckAll, handleUncheckAll, dropdownAlignButton, }: IActionButtonsProps) => JSX.Element;
|
|
10
12
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -8,34 +7,37 @@ exports.default = void 0;
|
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _buttons = _interopRequireDefault(require("../../buttons"));
|
|
10
9
|
var _list = _interopRequireWildcard(require("../../list"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dropdownAlignButton =
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
const ActionButtons = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
disabled,
|
|
16
|
+
dropdownOpened,
|
|
17
|
+
handleOpenClose,
|
|
18
|
+
handleCheckAll,
|
|
19
|
+
handleUncheckAll,
|
|
20
|
+
dropdownAlignButton = 'left'
|
|
21
|
+
} = _ref;
|
|
22
22
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
23
|
+
transparent: true,
|
|
24
|
+
tabIndex: -1,
|
|
23
25
|
disabled: disabled,
|
|
26
|
+
boxShadow: false,
|
|
24
27
|
size: "small",
|
|
25
|
-
iconName: dropdownOpened ? 'up' : 'down',
|
|
26
28
|
onClick: handleOpenClose,
|
|
27
29
|
customClass: "actionbutton",
|
|
28
|
-
|
|
29
|
-
boxShadow: false
|
|
30
|
+
iconName: dropdownOpened ? 'up' : 'down'
|
|
30
31
|
}), /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
31
|
-
|
|
32
|
-
iconName: "more1",
|
|
32
|
+
dropdown: true,
|
|
33
33
|
transparent: true,
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
tabIndex: -1,
|
|
34
36
|
boxShadow: false,
|
|
37
|
+
showIconDropdown: false,
|
|
38
|
+
iconName: "more1",
|
|
35
39
|
customClass: "actionbutton",
|
|
36
|
-
|
|
37
|
-
dropdownAlign: dropdownAlignButton,
|
|
38
|
-
showIconDropdown: false
|
|
40
|
+
dropdownAlign: dropdownAlignButton
|
|
39
41
|
}, /*#__PURE__*/_react.default.createElement(_list.default, null, /*#__PURE__*/_react.default.createElement(_list.ListItem, {
|
|
40
42
|
itemId: "1",
|
|
41
43
|
text: "Marcar Todos",
|
|
@@ -46,5 +48,4 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
46
48
|
onClick: handleUncheckAll
|
|
47
49
|
}))));
|
|
48
50
|
};
|
|
49
|
-
var _default = ActionButtons;
|
|
50
|
-
exports.default = _default;
|
|
51
|
+
var _default = exports.default = ActionButtons;
|
|
@@ -5,6 +5,8 @@ import '../base/types.js';
|
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
7
|
import '../../@types/PermissionAttr.js';
|
|
8
|
+
import '../../internals/types.js';
|
|
9
|
+
import '../../@types/Position.js';
|
|
8
10
|
|
|
9
11
|
declare const Dropdown: (props: IDropdownMultiSelectProps) => JSX.Element;
|
|
10
12
|
|