linear-react-components-ui 1.0.3-beta.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/@types/Align.d.ts +1 -1
- package/lib/@types/ButtonTypes.d.ts +1 -1
- package/lib/@types/ColorStyles.d.ts +1 -1
- package/lib/@types/DataCombo.d.ts +1 -1
- package/lib/@types/Icon.d.ts +1 -1
- package/lib/@types/LabelStyles.d.ts +1 -1
- package/lib/@types/Period.d.ts +1 -1
- package/lib/@types/PermissionAttr.d.ts +2 -2
- package/lib/@types/PointerEvents.d.ts +1 -1
- package/lib/@types/Position.d.ts +1 -1
- package/lib/@types/PositionAlert.d.ts +1 -1
- package/lib/@types/Size.d.ts +1 -1
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/alerts/AlertContainer.js +5 -21
- package/lib/alerts/AlertProvider.js +15 -45
- package/lib/alerts/BaseAlert.js +4 -20
- package/lib/alerts/Message.js +21 -32
- package/lib/alerts/alert.spec.js +3 -3
- package/lib/alerts/helpers.js +0 -2
- package/lib/alerts/index.d.ts +4 -1
- package/lib/alerts/index.js +0 -4
- package/lib/alerts/types.d.ts +4 -4
- package/lib/alerts/withAlert.js +1 -12
- package/lib/assets/styles/hint.scss +9 -0
- package/lib/avatar/avatar.spec.js +20 -20
- package/lib/avatar/index.js +20 -35
- package/lib/badge/badge.spec.js +3 -3
- package/lib/badge/index.js +9 -14
- package/lib/buttons/ActivateButton.js +0 -6
- package/lib/buttons/AddButton.js +0 -7
- package/lib/buttons/Button.js +2 -15
- package/lib/buttons/ButtonGroups.js +0 -4
- package/lib/buttons/CancelButton.js +1 -11
- package/lib/buttons/DangerButton.js +1 -11
- package/lib/buttons/DefaultButton.js +45 -81
- package/lib/buttons/DestroyButton.js +1 -12
- package/lib/buttons/EditButton.js +0 -6
- package/lib/buttons/InactivateButton.js +0 -6
- package/lib/buttons/InfoButton.js +1 -11
- package/lib/buttons/PrimaryButton.js +1 -11
- package/lib/buttons/RestoreButton.js +0 -6
- package/lib/buttons/SaveButton.js +1 -11
- package/lib/buttons/SpinnerLoading.js +41 -41
- package/lib/buttons/SuccessButton.js +1 -11
- package/lib/buttons/WarningButton.js +1 -11
- package/lib/buttons/button_container/index.js +5 -11
- package/lib/buttons/buttons.spec.js +50 -50
- package/lib/buttons/index.d.ts +4 -1
- package/lib/buttons/index.js +0 -18
- package/lib/buttons/split_button/index.js +11 -17
- package/lib/calendar/DangerCalendar.js +1 -11
- package/lib/calendar/InfoCalendar.js +1 -11
- package/lib/calendar/PrimaryCalendar.js +1 -11
- package/lib/calendar/SuccessCalendar.js +1 -11
- package/lib/calendar/WarningCalendar.js +1 -11
- package/lib/calendar/base/Day.js +2 -13
- package/lib/calendar/base/Month.js +1 -18
- package/lib/calendar/base/Week.js +2 -18
- package/lib/calendar/base/helpers.js +8 -24
- package/lib/calendar/base/index.js +13 -37
- package/lib/calendar/calendar.spec.js +16 -16
- package/lib/calendar/index.d.ts +4 -1
- package/lib/calendar/index.js +0 -8
- package/lib/checkbox/Label.js +1 -7
- package/lib/checkbox/checkbox.spec.js +8 -8
- package/lib/checkbox/index.js +34 -56
- package/lib/checkbox/types.d.ts +2 -2
- package/lib/dialog/Alert.js +0 -8
- package/lib/dialog/Custom.js +5 -17
- package/lib/dialog/Error.js +0 -8
- package/lib/dialog/Information.js +0 -8
- package/lib/dialog/Question.js +4 -15
- package/lib/dialog/Warning.js +0 -8
- package/lib/dialog/base/Content.js +1 -6
- package/lib/dialog/base/Footer.js +0 -4
- package/lib/dialog/base/Header.js +5 -13
- package/lib/dialog/base/index.js +7 -28
- package/lib/dialog/base/style.js +0 -2
- package/lib/dialog/dialog.spec.js +19 -19
- package/lib/dialog/form/index.js +9 -29
- package/lib/dialog/index.d.ts +4 -1
- package/lib/dialog/index.js +0 -9
- package/lib/drawer/Content.d.ts +1 -0
- package/lib/drawer/Content.js +2 -13
- package/lib/drawer/Drawer.d.ts +1 -0
- package/lib/drawer/Drawer.js +22 -55
- package/lib/drawer/Drawer.spec.js +9 -9
- package/lib/drawer/Header.d.ts +1 -0
- package/lib/drawer/Header.js +10 -27
- package/lib/drawer/helpers.d.ts +1 -0
- package/lib/drawer/helpers.js +0 -4
- package/lib/drawer/index.d.ts +1 -0
- package/lib/drawer/index.js +0 -8
- package/lib/drawer/types.d.ts +2 -1
- package/lib/dropdown/Popup.js +19 -32
- package/lib/dropdown/dropdown.spec.js +8 -9
- package/lib/dropdown/helper.js +0 -4
- package/lib/dropdown/withDropdown.js +18 -47
- package/lib/fieldset/fieldset.spec.js +3 -3
- package/lib/fieldset/index.js +21 -46
- package/lib/form/Field.js +16 -42
- package/lib/form/FieldArray.js +15 -32
- package/lib/form/FieldNumber.js +6 -20
- package/lib/form/FieldPeriod.js +9 -21
- package/lib/form/form.spec.js +11 -11
- package/lib/form/helpers.js +5 -30
- package/lib/form/index.js +36 -91
- package/lib/form/types.d.ts +6 -6
- package/lib/form/withFieldHOC.js +15 -34
- package/lib/form/withFormSecurity.js +5 -28
- package/lib/gridlayout/GridCol.js +5 -11
- package/lib/gridlayout/GridRow.js +3 -9
- package/lib/gridlayout/gridLayout.spec.js +4 -4
- package/lib/gridlayout/index.d.ts +4 -1
- package/lib/gridlayout/index.js +0 -4
- package/lib/hint/index.d.ts +6 -0
- package/lib/hint/index.js +25 -0
- package/lib/hint/types.d.ts +11 -0
- package/lib/hint/types.js +5 -0
- package/lib/icons/helper.d.ts +0 -4
- package/lib/icons/helper.js +0 -4
- package/lib/icons/icons.spec.js +9 -9
- package/lib/icons/index.js +16 -26
- package/lib/icons/types.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -10
- package/lib/inputs/base/InputTextBase.js +55 -76
- package/lib/inputs/base/base.spec.js +13 -13
- package/lib/inputs/base/helpers.js +6 -19
- package/lib/inputs/color/color_input.spec.js +4 -4
- package/lib/inputs/color/index.js +11 -38
- package/lib/inputs/date/Dialog.js +2 -7
- package/lib/inputs/date/Dropdown.js +1 -8
- package/lib/inputs/date/date.spec.js +5 -5
- package/lib/inputs/date/helper.js +16 -0
- package/lib/inputs/date/helpers.js +2 -11
- package/lib/inputs/date/index.js +48 -101
- package/lib/inputs/file/DefaultFile.js +13 -42
- package/lib/inputs/file/DragDropFile.js +37 -90
- package/lib/inputs/file/File.js +4 -25
- package/lib/inputs/file/FileButtonSettings.js +5 -11
- package/lib/inputs/file/helpers.js +0 -5
- package/lib/inputs/file/index.d.ts +4 -1
- package/lib/inputs/file/index.js +0 -6
- package/lib/inputs/file/types.d.ts +1 -1
- package/lib/inputs/inputHOC.d.ts +2 -1
- package/lib/inputs/inputHOC.js +10 -34
- package/lib/inputs/mask/BaseMask.js +1 -17
- package/lib/inputs/mask/Cnpj.js +12 -37
- package/lib/inputs/mask/Cpf.js +10 -33
- package/lib/inputs/mask/Phone.js +0 -6
- package/lib/inputs/mask/ZipCode.js +0 -6
- package/lib/inputs/mask/helpers.d.ts +2 -1
- package/lib/inputs/mask/helpers.js +8 -20
- package/lib/inputs/mask/imaskHOC.d.ts +2 -1
- package/lib/inputs/mask/imaskHOC.js +52 -83
- package/lib/inputs/mask/index.d.ts +4 -1
- package/lib/inputs/mask/index.js +0 -7
- package/lib/inputs/mask/input_mask.spec.js +47 -47
- package/lib/inputs/multiSelect/ActionButtons.js +4 -13
- package/lib/inputs/multiSelect/Dropdown.js +22 -45
- package/lib/inputs/multiSelect/helper.js +2 -4
- package/lib/inputs/multiSelect/index.js +40 -104
- package/lib/inputs/number/BaseNumber.d.ts +2 -1
- package/lib/inputs/number/BaseNumber.js +3 -16
- package/lib/inputs/number/Currency.d.ts +2 -1
- package/lib/inputs/number/Currency.js +1 -7
- package/lib/inputs/number/Decimal.d.ts +2 -1
- package/lib/inputs/number/Decimal.js +0 -5
- package/lib/inputs/number/format_number.js +0 -7
- package/lib/inputs/number/index.d.ts +2 -1
- package/lib/inputs/number/index.js +3 -13
- package/lib/inputs/number/numberfield.spec.js +5 -5
- package/lib/inputs/number/types.d.ts +2 -1
- package/lib/inputs/period/Dialog.js +2 -7
- package/lib/inputs/period/Dropdown.js +0 -7
- package/lib/inputs/period/PeriodList.js +1 -7
- package/lib/inputs/period/helper.js +2 -12
- package/lib/inputs/period/index.js +43 -114
- package/lib/inputs/period/types.d.ts +1 -1
- package/lib/inputs/search/index.d.ts +2 -1
- package/lib/inputs/search/index.js +27 -68
- package/lib/inputs/search/search_input.spec.js +4 -4
- package/lib/inputs/select/ActionButtons.d.ts +2 -1
- package/lib/inputs/select/ActionButtons.js +4 -12
- package/lib/inputs/select/Dropdown.d.ts +2 -1
- package/lib/inputs/select/Dropdown.js +28 -48
- package/lib/inputs/select/helper.d.ts +2 -1
- package/lib/inputs/select/helper.js +9 -25
- package/lib/inputs/select/index.d.ts +1 -1
- package/lib/inputs/select/index.js +3 -18
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
- package/lib/inputs/select/multiple/Selecteds.js +3 -7
- package/lib/inputs/select/multiple/index.d.ts +1 -1
- package/lib/inputs/select/multiple/index.js +37 -96
- package/lib/inputs/select/select.spec.js +12 -16
- package/lib/inputs/select/simple/index.d.ts +1 -1
- package/lib/inputs/select/simple/index.js +54 -118
- package/lib/inputs/select/types.d.ts +2 -7
- package/lib/inputs/text/index.js +1 -5
- package/lib/inputs/text/textfield.spec.js +4 -4
- package/lib/inputs/text/types.d.ts +1 -1
- package/lib/inputs/textarea/index.js +4 -10
- package/lib/inputs/textarea/textarea.spec.js +2 -2
- package/lib/inputs/types.d.ts +9 -3
- package/lib/internals/withTooltip.js +25 -70
- package/lib/labelMessages/index.js +25 -45
- package/lib/labelMessages/labelMessages.spec.js +16 -16
- package/lib/labels/DangerLabel.js +1 -11
- package/lib/labels/DefaultLabel.js +19 -41
- package/lib/labels/InfoLabel.js +1 -11
- package/lib/labels/PrimaryLabel.js +1 -11
- package/lib/labels/SuccessLabel.js +1 -11
- package/lib/labels/WarningLabel.js +1 -11
- package/lib/labels/index.d.ts +4 -1
- package/lib/labels/index.js +0 -10
- package/lib/labels/label.spec.js +18 -18
- package/lib/labels/label_container/index.js +3 -7
- package/lib/list/Header.js +3 -7
- package/lib/list/Item.js +33 -68
- package/lib/list/Separator.js +0 -4
- package/lib/list/helpers.js +0 -4
- package/lib/list/index.js +25 -60
- package/lib/list/list.spec.js +15 -16
- package/lib/list/types.d.ts +1 -1
- package/lib/menus/float/MenuItem.js +9 -26
- package/lib/menus/float/SubMenuContainer.js +5 -17
- package/lib/menus/float/float-menu.spec.js +13 -13
- package/lib/menus/float/helpers.js +0 -4
- package/lib/menus/float/index.js +8 -21
- package/lib/menus/index.d.ts +4 -1
- package/lib/menus/index.js +0 -3
- package/lib/menus/sidenav/ExpandMenu.js +2 -7
- package/lib/menus/sidenav/MenuLink.js +3 -12
- package/lib/menus/sidenav/NavMenuGroup.js +3 -12
- package/lib/menus/sidenav/NavMenuItem.js +27 -56
- package/lib/menus/sidenav/NavSubMenuItem.js +8 -27
- package/lib/menus/sidenav/helpers.js +0 -9
- package/lib/menus/sidenav/index.js +26 -75
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +2 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +15 -45
- package/lib/menus/sidenav/sidenav.spec.js +9 -9
- package/lib/menus/sidenav/types.d.ts +1 -1
- package/lib/noPermission/index.js +0 -6
- package/lib/panel/Content.d.ts +1 -1
- package/lib/panel/Content.js +7 -22
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/DangerPanel.js +0 -7
- package/lib/panel/Default.d.ts +1 -1
- package/lib/panel/Default.js +20 -44
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/Header.js +12 -27
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/InfoPanel.js +0 -7
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.js +0 -7
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.js +0 -7
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/ToolBar.js +0 -5
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/WarningPanel.js +0 -7
- package/lib/panel/helpers.d.ts +1 -1
- package/lib/panel/helpers.js +2 -10
- package/lib/panel/index.d.ts +5 -2
- package/lib/panel/index.js +0 -11
- package/lib/panel/panel.spec.js +8 -8
- package/lib/panel/types.d.ts +1 -1
- package/lib/permissionValidations.js +3 -15
- package/lib/popover/PopoverText.js +0 -4
- package/lib/popover/PopoverTitle.js +0 -4
- package/lib/popover/index.js +12 -23
- package/lib/popover/popover.spec.js +4 -4
- package/lib/progress/Bar.js +20 -33
- package/lib/progress/index.js +5 -14
- package/lib/progress/progress.spec.js +4 -12
- package/lib/radio/index.js +23 -46
- package/lib/radio/radio.spec.js +8 -8
- package/lib/skeleton/SkeletonContainer.js +3 -9
- package/lib/skeleton/index.js +10 -22
- package/lib/spinner/SpinnerLoading.js +3 -7
- package/lib/spinner/index.js +18 -40
- package/lib/spinner/spinner.spec.js +2 -2
- package/lib/split/Split.js +32 -83
- package/lib/split/SplitSide.js +6 -18
- package/lib/split/helpers.d.ts +1 -1
- package/lib/split/helpers.js +0 -4
- package/lib/split/index.d.ts +4 -1
- package/lib/split/index.js +0 -5
- package/lib/split/split.spec.js +13 -25
- package/lib/table/Body.js +18 -32
- package/lib/table/Header.js +23 -45
- package/lib/table/HeaderColumn.js +10 -21
- package/lib/table/Row.js +18 -28
- package/lib/table/RowColumn.js +12 -29
- package/lib/table/helpers.js +0 -7
- package/lib/table/index.js +32 -62
- package/lib/table/table.spec.js +14 -14
- package/lib/table/types.d.ts +1 -1
- package/lib/tabs/DropdownItems.js +12 -21
- package/lib/tabs/Menu.js +5 -15
- package/lib/tabs/MenuItems.js +23 -33
- package/lib/tabs/Panel.js +14 -39
- package/lib/tabs/index.js +46 -113
- package/lib/tabs/tabHelpers.js +3 -16
- package/lib/tabs/tabs.spec.js +73 -45
- package/lib/toolbar/ButtonBar.js +13 -29
- package/lib/toolbar/LabelBar.js +11 -28
- package/lib/toolbar/Separator.js +0 -4
- package/lib/toolbar/ToolBarGroup.js +2 -6
- package/lib/toolbar/helpers.js +0 -2
- package/lib/toolbar/index.js +7 -23
- package/lib/toolbar/toolbar.spec.js +10 -10
- package/lib/tooltip/index.js +10 -25
- package/lib/tooltip/tooltip.spec.js +3 -15
- package/lib/tooltip/types.d.ts +1 -1
- package/lib/treetable/Body.js +9 -27
- package/lib/treetable/Header.js +1 -11
- package/lib/treetable/Row.js +58 -113
- package/lib/treetable/helpers.js +0 -10
- package/lib/treetable/index.js +0 -11
- package/lib/treeview/Header.js +2 -6
- package/lib/treeview/Node.js +47 -111
- package/lib/treeview/constants.js +0 -4
- package/lib/treeview/index.js +54 -134
- package/lib/treeview/treeview.spec.js +14 -14
- package/lib/treeview/types.d.ts +2 -2
- package/lib/treeview_old/Header.js +1 -6
- package/lib/treeview_old/Node.js +5 -32
- package/lib/treeview_old/index.js +1 -9
- package/lib/{types-3c6f1c20.d.ts → types-90c43ae1.d.ts} +1 -1
- package/lib/uitour/index.js +33 -73
- package/lib/uitour/types.d.ts +1 -1
- package/lib/uitour/uitour.spec.js +20 -20
- package/package.json +1 -1
|
@@ -4,83 +4,64 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _imask = _interopRequireDefault(require("imask"));
|
|
11
|
-
|
|
12
9
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
13
|
-
|
|
14
10
|
var _permissionValidations = require("../../permissionValidations");
|
|
15
|
-
|
|
16
11
|
var _format_number = require("../number/format_number");
|
|
17
|
-
|
|
18
12
|
var _this = void 0;
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
-
|
|
28
17
|
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); }
|
|
29
|
-
|
|
30
18
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
-
|
|
32
19
|
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."); }
|
|
33
|
-
|
|
34
20
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
-
|
|
21
|
+
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; }
|
|
22
|
+
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; } }
|
|
40
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
-
|
|
42
24
|
var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
43
|
-
|
|
44
25
|
var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
45
26
|
var MaskedComponent = function MaskedComponent(props) {
|
|
46
27
|
var permissionAttr = props.permissionAttr,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
28
|
+
skeletonize = props.skeletonize,
|
|
29
|
+
_inputRef = props.inputRef,
|
|
30
|
+
_props$placeholderCha = props.placeholderChar,
|
|
31
|
+
placeholderChar = _props$placeholderCha === void 0 ? '_' : _props$placeholderCha,
|
|
32
|
+
_props$lazy = props.lazy,
|
|
33
|
+
lazy = _props$lazy === void 0 ? false : _props$lazy,
|
|
34
|
+
_props$pattern = props.pattern,
|
|
35
|
+
pattern = _props$pattern === void 0 ? '' : _props$pattern,
|
|
36
|
+
_props$radix = props.radix,
|
|
37
|
+
radix = _props$radix === void 0 ? ' ' : _props$radix,
|
|
38
|
+
_props$thousandsSepar = props.thousandsSeparator,
|
|
39
|
+
thousandsSeparator = _props$thousandsSepar === void 0 ? '' : _props$thousandsSepar,
|
|
40
|
+
_props$mapToRadix = props.mapToRadix,
|
|
41
|
+
mapToRadix = _props$mapToRadix === void 0 ? [] : _props$mapToRadix,
|
|
42
|
+
_props$scale = props.scale,
|
|
43
|
+
scale = _props$scale === void 0 ? 2 : _props$scale,
|
|
44
|
+
_props$signed = props.signed,
|
|
45
|
+
signed = _props$signed === void 0 ? false : _props$signed,
|
|
46
|
+
_props$normalizeZeros = props.normalizeZeros,
|
|
47
|
+
normalizeZeros = _props$normalizeZeros === void 0 ? true : _props$normalizeZeros,
|
|
48
|
+
_props$padFractionalZ = props.padFractionalZeros,
|
|
49
|
+
padFractionalZeros = _props$padFractionalZ === void 0 ? true : _props$padFractionalZ,
|
|
50
|
+
mask = props.mask,
|
|
51
|
+
_props$commit = props.commit,
|
|
52
|
+
commit = _props$commit === void 0 ? function () {} : _props$commit,
|
|
53
|
+
parse = props.parse,
|
|
54
|
+
format = props.format,
|
|
55
|
+
definitions = props.definitions,
|
|
56
|
+
groups = props.groups,
|
|
57
|
+
min = props.min,
|
|
58
|
+
max = props.max,
|
|
59
|
+
dispatch = props.dispatch,
|
|
60
|
+
_props$value = props.value,
|
|
61
|
+
value = _props$value === void 0 ? '' : _props$value,
|
|
62
|
+
onChange = props.onChange,
|
|
63
|
+
_props$isDateField = props.isDateField,
|
|
64
|
+
isDateField = _props$isDateField === void 0 ? false : _props$isDateField;
|
|
84
65
|
var maskOptions = {
|
|
85
66
|
placeholderChar: placeholderChar,
|
|
86
67
|
lazy: lazy,
|
|
@@ -102,32 +83,28 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
102
83
|
max: max,
|
|
103
84
|
dispatch: dispatch
|
|
104
85
|
};
|
|
105
|
-
|
|
106
86
|
var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr)),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
87
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
88
|
+
onDenied = _useState2[0];
|
|
110
89
|
var elementRef = (0, _react.useRef)(null);
|
|
111
90
|
var maskRef = (0, _react.useRef)(null);
|
|
112
91
|
var hideContent = onDenied.hideContent,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
92
|
+
unvisible = onDenied.unvisible,
|
|
93
|
+
disabled = onDenied.disabled,
|
|
94
|
+
readOnly = onDenied.readOnly;
|
|
116
95
|
var dontInitMask = hideContent || unvisible || skeletonize;
|
|
117
96
|
var disableCallbacks = disabled || readOnly;
|
|
118
|
-
|
|
119
97
|
var setValue = function setValue(newValue) {
|
|
120
98
|
if (maskRef.current) {
|
|
121
99
|
if (props.unmask) maskRef.current.unmaskedValue = newValue.toString();
|
|
122
100
|
maskRef.current.value = String(newValue);
|
|
123
101
|
}
|
|
124
102
|
};
|
|
125
|
-
|
|
126
103
|
var onAccept = function onAccept() {
|
|
127
104
|
if (onChange && !disableCallbacks && maskRef.current) {
|
|
128
105
|
var _maskRef$current = maskRef.current,
|
|
129
|
-
|
|
130
|
-
|
|
106
|
+
unmaskedValue = _maskRef$current.unmaskedValue,
|
|
107
|
+
el = _maskRef$current.el;
|
|
131
108
|
var name = el.name || el.input && el.input.name;
|
|
132
109
|
onChange({
|
|
133
110
|
target: {
|
|
@@ -137,12 +114,11 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
137
114
|
}, props.unmask ? unmaskedValue : maskRef.current.value);
|
|
138
115
|
}
|
|
139
116
|
};
|
|
140
|
-
|
|
141
117
|
var onComplete = function onComplete() {
|
|
142
118
|
if (props.onComplete && !disableCallbacks && maskRef.current) {
|
|
143
119
|
var _maskRef$current2 = maskRef.current,
|
|
144
|
-
|
|
145
|
-
|
|
120
|
+
unmaskedValue = _maskRef$current2.unmaskedValue,
|
|
121
|
+
el = _maskRef$current2.el;
|
|
146
122
|
var name = el.name || el.input && el.input.name;
|
|
147
123
|
props.onComplete({
|
|
148
124
|
target: {
|
|
@@ -152,13 +128,10 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
152
128
|
}, props.unmask ? unmaskedValue : maskRef.current.value);
|
|
153
129
|
}
|
|
154
130
|
};
|
|
155
|
-
|
|
156
131
|
var getMask = function getMask() {
|
|
157
132
|
var element = elementRef.current;
|
|
158
|
-
|
|
159
133
|
if (element) {
|
|
160
134
|
var maskCurrent = maskRef.current;
|
|
161
|
-
|
|
162
135
|
if (!maskCurrent) {
|
|
163
136
|
maskRef.current = (0, _imask.default)(element, maskOptions).on('accept', onAccept.bind(_this)).on('complete', onComplete.bind(_this));
|
|
164
137
|
setValue(value);
|
|
@@ -167,22 +140,20 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
167
140
|
}
|
|
168
141
|
}
|
|
169
142
|
};
|
|
170
|
-
|
|
171
143
|
var destroyMask = function destroyMask() {
|
|
172
144
|
if (maskRef.current) {
|
|
173
145
|
maskRef.current.destroy();
|
|
174
146
|
maskRef.current = null;
|
|
175
147
|
}
|
|
176
148
|
};
|
|
177
|
-
|
|
178
149
|
(0, _react.useEffect)(function () {
|
|
179
150
|
if (props.handlerSetOnDenied) props.handlerSetOnDenied(onDenied);
|
|
180
151
|
if (!props.mask || dontInitMask) return;
|
|
181
|
-
getMask();
|
|
152
|
+
getMask();
|
|
182
153
|
|
|
154
|
+
// eslint-disable-next-line consistent-return
|
|
183
155
|
return function () {
|
|
184
156
|
var _maskRef$current3, _maskRef$current4;
|
|
185
|
-
|
|
186
157
|
(_maskRef$current3 = maskRef.current) === null || _maskRef$current3 === void 0 ? void 0 : _maskRef$current3.off('accept', onAccept);
|
|
187
158
|
(_maskRef$current4 = maskRef.current) === null || _maskRef$current4 === void 0 ? void 0 : _maskRef$current4.off('complete', onComplete);
|
|
188
159
|
};
|
|
@@ -210,19 +181,17 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
210
181
|
return setValue(e.target.value);
|
|
211
182
|
},
|
|
212
183
|
inputRef: function inputRef(el) {
|
|
213
|
-
elementRef.current = el;
|
|
214
|
-
|
|
184
|
+
elementRef.current = el;
|
|
185
|
+
// Propagate the input ref for who call it
|
|
215
186
|
if (_inputRef) {
|
|
216
187
|
if (_typeof(_inputRef) === 'object') _inputRef.current = el;else _inputRef(el);
|
|
217
188
|
}
|
|
218
189
|
}
|
|
219
190
|
}));
|
|
220
191
|
};
|
|
221
|
-
|
|
222
192
|
var nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
|
|
223
193
|
MaskedComponent.displayName = "IMask(".concat(nestedComponentName, ")");
|
|
224
194
|
return MaskedComponent;
|
|
225
195
|
};
|
|
226
|
-
|
|
227
196
|
var _default = IMaskHOC;
|
|
228
197
|
exports.default = _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _default from './BaseMask.js';
|
|
2
|
-
export { default } from './BaseMask.js';
|
|
3
2
|
export { default as CpfField } from './Cpf.js';
|
|
4
3
|
export { default as CnpjField } from './Cnpj.js';
|
|
5
4
|
export { default as PhoneField } from './Phone.js';
|
|
@@ -9,3 +8,7 @@ import 'react';
|
|
|
9
8
|
import '../../@types/PermissionAttr.js';
|
|
10
9
|
import '../base/types.js';
|
|
11
10
|
import '../../@types/Period.js';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export { _default as default };
|
package/lib/inputs/mask/index.js
CHANGED
|
@@ -28,18 +28,11 @@ Object.defineProperty(exports, "ZipCodeField", {
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
exports.default = void 0;
|
|
31
|
-
|
|
32
31
|
var _BaseMask = _interopRequireDefault(require("./BaseMask"));
|
|
33
|
-
|
|
34
32
|
var _Cpf = _interopRequireDefault(require("./Cpf"));
|
|
35
|
-
|
|
36
33
|
var _Cnpj = _interopRequireDefault(require("./Cnpj"));
|
|
37
|
-
|
|
38
34
|
var _Phone = _interopRequireDefault(require("./Phone"));
|
|
39
|
-
|
|
40
35
|
var _ZipCode = _interopRequireDefault(require("./ZipCode"));
|
|
41
|
-
|
|
42
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
|
-
|
|
44
37
|
var _default = _BaseMask.default;
|
|
45
38
|
exports.default = _default;
|