linear-react-components-ui 1.1.0-beta.6 → 1.1.0

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.
Files changed (224) hide show
  1. package/babel.config.json +2 -2
  2. package/lib/alerts/AlertContainer.js +46 -54
  3. package/lib/alerts/AlertProvider.js +36 -53
  4. package/lib/alerts/BaseAlert.js +14 -20
  5. package/lib/alerts/Message.js +37 -46
  6. package/lib/alerts/helpers.js +3 -3
  7. package/lib/alerts/index.js +5 -5
  8. package/lib/alerts/withAlert.js +11 -11
  9. package/lib/assets/styles/checkbox.scss +0 -8
  10. package/lib/avatar/index.js +42 -41
  11. package/lib/badge/index.js +15 -16
  12. package/lib/buttons/ActivateButton.js +6 -8
  13. package/lib/buttons/AddButton.js +9 -11
  14. package/lib/buttons/Button.js +11 -11
  15. package/lib/buttons/ButtonGroups.js +8 -6
  16. package/lib/buttons/CancelButton.js +9 -7
  17. package/lib/buttons/DangerButton.js +9 -7
  18. package/lib/buttons/DefaultButton.js +66 -85
  19. package/lib/buttons/DestroyButton.js +10 -8
  20. package/lib/buttons/EditButton.js +6 -8
  21. package/lib/buttons/InactivateButton.js +6 -8
  22. package/lib/buttons/InfoButton.js +9 -7
  23. package/lib/buttons/PrimaryButton.js +9 -7
  24. package/lib/buttons/RestoreButton.js +6 -8
  25. package/lib/buttons/SaveButton.js +9 -7
  26. package/lib/buttons/SuccessButton.js +9 -7
  27. package/lib/buttons/WarningButton.js +9 -7
  28. package/lib/buttons/button_container/index.js +16 -19
  29. package/lib/buttons/index.js +31 -31
  30. package/lib/buttons/split_button/index.js +24 -26
  31. package/lib/calendar/DangerCalendar.js +9 -7
  32. package/lib/calendar/InfoCalendar.js +9 -7
  33. package/lib/calendar/PrimaryCalendar.js +9 -7
  34. package/lib/calendar/SuccessCalendar.js +9 -7
  35. package/lib/calendar/WarningCalendar.js +9 -7
  36. package/lib/calendar/base/Day.js +16 -14
  37. package/lib/calendar/base/Month.js +15 -19
  38. package/lib/calendar/base/Week.js +15 -19
  39. package/lib/calendar/base/helpers.js +17 -15
  40. package/lib/calendar/base/index.js +38 -51
  41. package/lib/calendar/index.js +13 -13
  42. package/lib/checkbox/Label.js +10 -8
  43. package/lib/checkbox/index.d.ts +1 -1
  44. package/lib/checkbox/index.js +75 -97
  45. package/lib/checkbox/types.d.ts +0 -1
  46. package/lib/dialog/Alert.js +7 -7
  47. package/lib/dialog/Custom.js +20 -23
  48. package/lib/dialog/Error.js +7 -7
  49. package/lib/dialog/Information.js +7 -7
  50. package/lib/dialog/Question.js +16 -16
  51. package/lib/dialog/Warning.js +7 -7
  52. package/lib/dialog/base/Content.js +9 -7
  53. package/lib/dialog/base/Footer.js +6 -8
  54. package/lib/dialog/base/Header.js +32 -34
  55. package/lib/dialog/base/index.js +64 -72
  56. package/lib/dialog/base/style.js +8 -10
  57. package/lib/dialog/form/index.js +35 -38
  58. package/lib/dialog/index.js +15 -15
  59. package/lib/drawer/Content.js +14 -12
  60. package/lib/drawer/Drawer.js +68 -82
  61. package/lib/drawer/Header.js +45 -48
  62. package/lib/drawer/helpers.js +4 -4
  63. package/lib/drawer/index.js +7 -7
  64. package/lib/dropdown/Popup.js +37 -40
  65. package/lib/dropdown/helper.js +6 -6
  66. package/lib/dropdown/withDropdown.js +44 -63
  67. package/lib/fieldset/index.js +49 -56
  68. package/lib/form/Field.js +73 -79
  69. package/lib/form/FieldArray.js +76 -85
  70. package/lib/form/FieldNumber.js +34 -42
  71. package/lib/form/FieldPeriod.js +54 -59
  72. package/lib/form/helpers.js +29 -28
  73. package/lib/form/index.js +121 -151
  74. package/lib/form/withFieldHOC.js +36 -42
  75. package/lib/form/withFormSecurity.js +27 -35
  76. package/lib/gridlayout/GridCol.js +16 -15
  77. package/lib/gridlayout/GridRow.js +11 -12
  78. package/lib/gridlayout/index.js +5 -5
  79. package/lib/hint/index.js +25 -29
  80. package/lib/icons/helper.js +2 -2
  81. package/lib/icons/index.js +37 -48
  82. package/lib/index.js +19 -19
  83. package/lib/inputs/base/InputTextBase.js +99 -109
  84. package/lib/inputs/base/helpers.js +29 -23
  85. package/lib/inputs/color/index.js +34 -44
  86. package/lib/inputs/date/Dialog.js +10 -8
  87. package/lib/inputs/date/Dropdown.js +14 -12
  88. package/lib/inputs/date/helpers.js +18 -14
  89. package/lib/inputs/date/index.js +96 -133
  90. package/lib/inputs/file/DefaultFile.js +50 -74
  91. package/lib/inputs/file/DragDropFile.js +119 -172
  92. package/lib/inputs/file/File.js +22 -28
  93. package/lib/inputs/file/FileButtonSettings.js +14 -16
  94. package/lib/inputs/file/helpers.js +6 -7
  95. package/lib/inputs/file/index.js +7 -7
  96. package/lib/inputs/inputHOC.js +23 -35
  97. package/lib/inputs/mask/BaseMask.js +33 -27
  98. package/lib/inputs/mask/Cnpj.js +19 -31
  99. package/lib/inputs/mask/Cpf.js +20 -35
  100. package/lib/inputs/mask/Phone.js +8 -6
  101. package/lib/inputs/mask/ZipCode.js +6 -8
  102. package/lib/inputs/mask/helpers.js +21 -26
  103. package/lib/inputs/mask/imaskHOC.js +102 -122
  104. package/lib/inputs/mask/index.js +11 -11
  105. package/lib/inputs/multiSelect/ActionButtons.js +18 -18
  106. package/lib/inputs/multiSelect/Dropdown.js +63 -75
  107. package/lib/inputs/multiSelect/helper.js +9 -7
  108. package/lib/inputs/multiSelect/index.js +85 -136
  109. package/lib/inputs/number/BaseNumber.js +23 -21
  110. package/lib/inputs/number/Currency.js +9 -8
  111. package/lib/inputs/number/Decimal.js +4 -6
  112. package/lib/inputs/number/format_number.js +9 -6
  113. package/lib/inputs/number/index.js +13 -13
  114. package/lib/inputs/period/Dialog.js +10 -8
  115. package/lib/inputs/period/Dropdown.js +12 -12
  116. package/lib/inputs/period/PeriodList.js +19 -17
  117. package/lib/inputs/period/helper.js +38 -37
  118. package/lib/inputs/period/index.js +147 -196
  119. package/lib/inputs/search/index.js +45 -67
  120. package/lib/inputs/select/ActionButtons.js +18 -18
  121. package/lib/inputs/select/Dropdown.js +51 -65
  122. package/lib/inputs/select/helper.js +55 -44
  123. package/lib/inputs/select/index.js +13 -11
  124. package/lib/inputs/select/multiple/Selecteds.js +20 -22
  125. package/lib/inputs/select/multiple/index.js +90 -143
  126. package/lib/inputs/select/simple/index.js +103 -156
  127. package/lib/inputs/text/index.js +4 -6
  128. package/lib/inputs/textarea/index.js +11 -10
  129. package/lib/internals/colorStyles.js +3 -3
  130. package/lib/internals/constants.js +2 -2
  131. package/lib/internals/withTooltip.js +54 -68
  132. package/lib/labelMessages/index.js +28 -47
  133. package/lib/labels/DangerLabel.js +9 -7
  134. package/lib/labels/DefaultLabel.js +29 -42
  135. package/lib/labels/InfoLabel.js +9 -7
  136. package/lib/labels/PrimaryLabel.js +9 -7
  137. package/lib/labels/SuccessLabel.js +9 -7
  138. package/lib/labels/WarningLabel.js +9 -7
  139. package/lib/labels/index.js +15 -15
  140. package/lib/labels/label_container/index.js +11 -10
  141. package/lib/list/Header.js +12 -10
  142. package/lib/list/Item.js +58 -72
  143. package/lib/list/Separator.js +6 -8
  144. package/lib/list/helpers.js +3 -3
  145. package/lib/list/index.js +81 -107
  146. package/lib/menus/float/MenuItem.js +27 -27
  147. package/lib/menus/float/SubMenuContainer.js +39 -44
  148. package/lib/menus/float/helpers.js +4 -4
  149. package/lib/menus/float/index.js +25 -25
  150. package/lib/menus/index.js +3 -3
  151. package/lib/menus/sidenav/ExpandMenu.js +12 -10
  152. package/lib/menus/sidenav/MenuLink.js +12 -10
  153. package/lib/menus/sidenav/NavMenuGroup.js +15 -13
  154. package/lib/menus/sidenav/NavMenuItem.js +56 -69
  155. package/lib/menus/sidenav/NavSubMenuItem.js +24 -28
  156. package/lib/menus/sidenav/helpers.js +7 -7
  157. package/lib/menus/sidenav/index.js +92 -119
  158. package/lib/menus/sidenav/popup_menu_search/EmptyList.js +12 -11
  159. package/lib/menus/sidenav/popup_menu_search/index.js +64 -84
  160. package/lib/noPermission/index.js +15 -17
  161. package/lib/panel/Content.js +46 -58
  162. package/lib/panel/DangerPanel.js +6 -8
  163. package/lib/panel/Default.js +45 -59
  164. package/lib/panel/Header.js +37 -34
  165. package/lib/panel/InfoPanel.js +6 -8
  166. package/lib/panel/PrimaryPanel.js +6 -8
  167. package/lib/panel/SuccessPanel.js +6 -8
  168. package/lib/panel/ToolBar.js +8 -6
  169. package/lib/panel/WarningPanel.js +6 -8
  170. package/lib/panel/helpers.js +13 -11
  171. package/lib/panel/index.js +17 -17
  172. package/lib/permissionValidations.js +26 -28
  173. package/lib/popover/PopoverText.js +8 -6
  174. package/lib/popover/PopoverTitle.js +8 -6
  175. package/lib/popover/index.js +21 -24
  176. package/lib/progress/Bar.js +34 -39
  177. package/lib/progress/index.js +19 -20
  178. package/lib/radio/index.js +37 -57
  179. package/lib/shortcuts/index.js +13 -11
  180. package/lib/skeleton/SkeletonContainer.js +12 -12
  181. package/lib/skeleton/index.js +27 -33
  182. package/lib/spinner/SpinnerLoading.js +46 -46
  183. package/lib/spinner/index.js +27 -40
  184. package/lib/split/Split.js +97 -113
  185. package/lib/split/SplitSide.js +22 -20
  186. package/lib/split/helpers.js +4 -4
  187. package/lib/split/index.js +5 -5
  188. package/lib/table/Body.js +47 -49
  189. package/lib/table/Header.js +39 -41
  190. package/lib/table/HeaderColumn.js +22 -22
  191. package/lib/table/Row.js +48 -50
  192. package/lib/table/RowColumn.js +37 -35
  193. package/lib/table/helpers.js +9 -12
  194. package/lib/table/index.js +89 -108
  195. package/lib/tabs/DropdownTabs.js +39 -43
  196. package/lib/tabs/Menu.js +20 -19
  197. package/lib/tabs/MenuTabs.js +48 -55
  198. package/lib/tabs/Panel.js +54 -73
  199. package/lib/tabs/context.js +62 -93
  200. package/lib/tabs/index.js +30 -35
  201. package/lib/tabs/tabHelpers.js +24 -21
  202. package/lib/toolbar/ButtonBar.js +49 -52
  203. package/lib/toolbar/LabelBar.js +38 -41
  204. package/lib/toolbar/Separator.js +6 -8
  205. package/lib/toolbar/ToolBarGroup.js +9 -8
  206. package/lib/toolbar/helpers.js +3 -3
  207. package/lib/toolbar/index.js +25 -26
  208. package/lib/tooltip/index.js +29 -33
  209. package/lib/treetable/Body.js +22 -33
  210. package/lib/treetable/Header.js +13 -15
  211. package/lib/treetable/Row.d.ts +1 -1
  212. package/lib/treetable/Row.js +107 -158
  213. package/lib/treetable/helpers.d.ts +1 -1
  214. package/lib/treetable/helpers.js +18 -24
  215. package/lib/treetable/index.d.ts +2 -2
  216. package/lib/treetable/index.js +11 -12
  217. package/lib/treeview/Header.js +11 -9
  218. package/lib/treeview/Node.js +109 -148
  219. package/lib/treeview/constants.js +2 -2
  220. package/lib/treeview/index.js +156 -221
  221. package/lib/uitour/helpers.js +3 -3
  222. package/lib/uitour/index.js +67 -106
  223. package/package.json +5 -14
  224. /package/lib/{types.d-BfM3lUbt.d.ts → types.d-DvJcBS8L.d.ts} +0 -0
@@ -3,134 +3,118 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _imask = _interopRequireDefault(require("imask"));
9
9
  var helpers = _interopRequireWildcard(require("./helpers"));
10
10
  var _permissionValidations = require("../../permissionValidations");
11
11
  var _format_number = require("../number/format_number");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
- 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 && Object.prototype.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; }
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ 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); }
14
+ 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; }
15
15
  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); }
16
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
17
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
- 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."); }
19
- 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); }
20
- 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; }
21
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
22
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
- var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
24
- var IMaskHOC = function IMaskHOC(ComposedComponent) {
25
- var MaskedComponent = function MaskedComponent(props) {
26
- var permissionAttr = props.permissionAttr,
27
- skeletonize = props.skeletonize,
28
- _inputRef = props.inputRef,
29
- _props$placeholderCha = props.placeholderChar,
30
- placeholderChar = _props$placeholderCha === void 0 ? '_' : _props$placeholderCha,
31
- _props$lazy = props.lazy,
32
- lazy = _props$lazy === void 0 ? false : _props$lazy,
33
- _props$pattern = props.pattern,
34
- pattern = _props$pattern === void 0 ? '' : _props$pattern,
35
- _props$radix = props.radix,
36
- radix = _props$radix === void 0 ? ' ' : _props$radix,
37
- _props$thousandsSepar = props.thousandsSeparator,
38
- thousandsSeparator = _props$thousandsSepar === void 0 ? '' : _props$thousandsSepar,
39
- _props$mapToRadix = props.mapToRadix,
40
- mapToRadix = _props$mapToRadix === void 0 ? [] : _props$mapToRadix,
41
- _props$scale = props.scale,
42
- scale = _props$scale === void 0 ? 2 : _props$scale,
43
- _props$signed = props.signed,
44
- signed = _props$signed === void 0 ? false : _props$signed,
45
- _props$normalizeZeros = props.normalizeZeros,
46
- normalizeZeros = _props$normalizeZeros === void 0 ? true : _props$normalizeZeros,
47
- _props$padFractionalZ = props.padFractionalZeros,
48
- padFractionalZeros = _props$padFractionalZ === void 0 ? true : _props$padFractionalZ,
49
- mask = props.mask,
50
- _props$commit = props.commit,
51
- commit = _props$commit === void 0 ? function () {} : _props$commit,
52
- parse = props.parse,
53
- format = props.format,
54
- definitions = props.definitions,
55
- groups = props.groups,
56
- min = props.min,
57
- max = props.max,
58
- dispatch = props.dispatch,
59
- _props$value = props.value,
60
- value = _props$value === void 0 ? '' : _props$value,
61
- onChange = props.onChange,
62
- _props$isDateField = props.isDateField,
63
- isDateField = _props$isDateField === void 0 ? false : _props$isDateField,
64
- autoCompleteMask = props.autoCompleteMask;
65
- var maskOptions = {
16
+ const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
17
+ const IMaskHOC = ComposedComponent => {
18
+ const MaskedComponent = props => {
19
+ const {
20
+ permissionAttr,
21
+ skeletonize,
22
+ inputRef,
23
+ placeholderChar = '_',
24
+ lazy = false,
25
+ pattern = '',
26
+ radix = ' ',
27
+ thousandsSeparator = '',
28
+ mapToRadix = [],
29
+ scale = 2,
30
+ signed = false,
31
+ normalizeZeros = true,
32
+ padFractionalZeros = true,
33
+ mask,
34
+ commit = () => {},
35
+ parse,
36
+ format,
37
+ definitions,
38
+ groups,
39
+ min,
40
+ max,
41
+ dispatch,
42
+ value = '',
43
+ onChange,
44
+ isDateField = false,
45
+ autoCompleteMask
46
+ } = props;
47
+ const maskOptions = {
66
48
  placeholderChar: placeholderChar === '' ? ' ' : placeholderChar,
67
- lazy: lazy,
68
- pattern: pattern,
69
- radix: radix,
70
- thousandsSeparator: thousandsSeparator,
71
- mapToRadix: mapToRadix,
72
- scale: scale,
73
- signed: signed,
74
- normalizeZeros: normalizeZeros,
75
- padFractionalZeros: padFractionalZeros,
76
- mask: mask,
77
- commit: commit,
78
- parse: parse,
79
- format: format,
80
- definitions: definitions,
81
- groups: groups,
82
- min: min,
83
- max: max,
84
- dispatch: dispatch
49
+ lazy,
50
+ pattern,
51
+ radix,
52
+ thousandsSeparator,
53
+ mapToRadix,
54
+ scale,
55
+ signed,
56
+ normalizeZeros,
57
+ padFractionalZeros,
58
+ mask,
59
+ commit,
60
+ parse,
61
+ format,
62
+ definitions,
63
+ groups,
64
+ min,
65
+ max,
66
+ dispatch
85
67
  };
86
- var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr)),
87
- _useState2 = _slicedToArray(_useState, 1),
88
- onDenied = _useState2[0];
89
- var elementRef = (0, _react.useRef)(null);
90
- var maskRef = (0, _react.useRef)(null);
91
- var hideContent = onDenied.hideContent,
92
- unvisible = onDenied.unvisible,
93
- disabled = onDenied.disabled,
94
- readOnly = onDenied.readOnly;
95
- var dontInitMask = hideContent || unvisible || skeletonize;
96
- var disableCallbacks = disabled || readOnly;
97
- var setValue = function setValue(newValue) {
68
+ const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
69
+ const elementRef = (0, _react.useRef)(null);
70
+ const maskRef = (0, _react.useRef)(null);
71
+ const {
72
+ hideContent,
73
+ unvisible,
74
+ disabled,
75
+ readOnly
76
+ } = onDenied;
77
+ const dontInitMask = hideContent || unvisible || skeletonize;
78
+ const disableCallbacks = disabled || readOnly;
79
+ const setValue = newValue => {
98
80
  if (maskRef.current) {
99
81
  if (props.unmask) maskRef.current.unmaskedValue = newValue.toString();
100
82
  maskRef.current.value = String(newValue);
101
83
  }
102
84
  };
103
- var onAccept = (0, _react.useCallback)(function () {
85
+ const onAccept = (0, _react.useCallback)(() => {
104
86
  if (onChange && !disableCallbacks && maskRef.current) {
105
- var _maskRef$current = maskRef.current,
106
- unmaskedValue = _maskRef$current.unmaskedValue,
107
- el = _maskRef$current.el;
108
- var name = el.name || el.input && el.input.name;
87
+ const {
88
+ unmaskedValue,
89
+ el
90
+ } = maskRef.current;
91
+ const name = el.name || el.input && el.input.name;
109
92
  onChange({
110
93
  target: {
111
94
  value: unmaskedValue,
112
- name: name
95
+ name
113
96
  }
114
97
  }, props.unmask ? unmaskedValue : maskRef.current.value);
115
98
  }
116
99
  }, [onChange]);
117
- var onComplete = (0, _react.useCallback)(function () {
100
+ const onComplete = (0, _react.useCallback)(() => {
118
101
  if (props.onComplete && !disableCallbacks && maskRef.current) {
119
- var _maskRef$current2 = maskRef.current,
120
- unmaskedValue = _maskRef$current2.unmaskedValue,
121
- el = _maskRef$current2.el;
122
- var name = el.name || el.input && el.input.name;
102
+ const {
103
+ unmaskedValue,
104
+ el
105
+ } = maskRef.current;
106
+ const name = el.name || el.input && el.input.name;
123
107
  props.onComplete({
124
108
  target: {
125
109
  value: unmaskedValue,
126
- name: name
110
+ name
127
111
  }
128
112
  }, props.unmask ? unmaskedValue : maskRef.current.value);
129
113
  }
130
114
  }, [props.onComplete]);
131
- var autoCompleteMaskValue = (0, _react.useCallback)(function (eventTargetValue) {
115
+ const autoCompleteMaskValue = (0, _react.useCallback)(eventTargetValue => {
132
116
  if (autoCompleteMask && eventTargetValue.length && maskRef.current && elementRef.current) {
133
- var sizeMask = maskRef.current.mask.toString().replace(/\D+/g, '').length;
117
+ const sizeMask = maskRef.current.mask.toString().replace(/\D+/g, '').length;
134
118
  if (sizeMask > eventTargetValue.length) {
135
119
  switch (autoCompleteMask) {
136
120
  case 'left':
@@ -146,12 +130,12 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
146
130
  }
147
131
  }
148
132
  }, [autoCompleteMask, maskRef.current, elementRef.current]);
149
- var getMask = function getMask() {
150
- var element = elementRef.current;
133
+ const getMask = () => {
134
+ const element = elementRef.current;
151
135
  if (element) {
152
- var maskCurrent = maskRef.current;
136
+ const maskCurrent = maskRef.current;
153
137
  if (!maskCurrent) {
154
- maskRef.current = (0, _imask["default"])(element, maskOptions);
138
+ maskRef.current = (0, _imask.default)(element, maskOptions);
155
139
  if (value && typeof value !== 'number' && value.trim() !== '' || value && typeof value === 'number') onAccept();
156
140
  setValue(value);
157
141
  } else {
@@ -159,33 +143,33 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
159
143
  }
160
144
  }
161
145
  };
162
- var destroyMask = function destroyMask() {
146
+ const destroyMask = () => {
163
147
  if (maskRef.current) {
164
148
  maskRef.current.destroy();
165
149
  maskRef.current = null;
166
150
  }
167
151
  };
168
- (0, _react.useEffect)(function () {
152
+ (0, _react.useEffect)(() => {
169
153
  if (props.handlerSetOnDenied) props.handlerSetOnDenied(onDenied);
170
154
  if (!props.mask || dontInitMask) return;
171
155
  getMask();
172
156
  }, [maskOptions]);
173
- (0, _react.useEffect)(function () {
157
+ (0, _react.useEffect)(() => {
174
158
  if (!maskRef.current) return;
175
- var maskCurrent = maskRef.current;
159
+ const maskCurrent = maskRef.current;
176
160
  maskCurrent.on('accept', onAccept);
177
161
  maskCurrent.on('complete', onComplete);
178
162
 
179
163
  // eslint-disable-next-line consistent-return
180
- return function () {
164
+ return () => {
181
165
  maskCurrent.off('accept', onAccept);
182
166
  maskCurrent.off('complete', onComplete);
183
167
  };
184
168
  }, [onAccept, onComplete]);
185
- (0, _react.useEffect)(function () {
169
+ (0, _react.useEffect)(() => {
186
170
  if (maskOptions.mask && !dontInitMask) {
187
171
  if (maskRef.current) {
188
- var formattedValue = isDateField ? value : (0, _format_number.numberToPtBR)(value) || '';
172
+ const formattedValue = isDateField ? value : (0, _format_number.numberToPtBR)(value) || '';
189
173
  setValue(formattedValue);
190
174
  } else {
191
175
  getMask();
@@ -195,29 +179,25 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
195
179
  if (value && elementRef.current) elementRef.current.value = value;
196
180
  }
197
181
  }, [value, isDateField]);
198
- (0, _react.useEffect)(function () {
199
- return destroyMask;
200
- }, []);
201
- return /*#__PURE__*/_react["default"].createElement(ComposedComponent, _extends({}, helpers.extractNonMaskProps(props, maskOptions), {
182
+ (0, _react.useEffect)(() => destroyMask, []);
183
+ return /*#__PURE__*/_react.default.createElement(ComposedComponent, _extends({}, helpers.extractNonMaskProps(props, maskOptions), {
202
184
  onDeniedActions: onDenied,
203
185
  defaultValue: value,
204
- onBlur: function onBlur(e) {
186
+ onBlur: e => {
205
187
  autoCompleteMaskValue(e.target.value);
206
188
  if (props.onBlur) props.onBlur(e);
207
189
  },
208
- onChange: function onChange(e) {
209
- return setValue(e.target.value);
210
- },
211
- inputRef: function inputRef(el) {
190
+ onChange: e => setValue(e.target.value),
191
+ inputRef: el => {
212
192
  elementRef.current = el;
213
- if (_inputRef) {
214
- if (_typeof(_inputRef) === 'object') _inputRef.current = el;else _inputRef(el);
193
+ if (inputRef) {
194
+ if (typeof inputRef === 'object') inputRef.current = el;else inputRef(el);
215
195
  }
216
196
  }
217
197
  }));
218
198
  };
219
- var nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
199
+ const nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
220
200
  MaskedComponent.displayName = "IMask(".concat(nestedComponentName, ")");
221
201
  return MaskedComponent;
222
202
  };
223
- var _default = exports["default"] = IMaskHOC;
203
+ var _default = exports.default = IMaskHOC;
@@ -5,33 +5,33 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "CnpjField", {
7
7
  enumerable: true,
8
- get: function get() {
9
- return _Cnpj["default"];
8
+ get: function () {
9
+ return _Cnpj.default;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "CpfField", {
13
13
  enumerable: true,
14
- get: function get() {
15
- return _Cpf["default"];
14
+ get: function () {
15
+ return _Cpf.default;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "PhoneField", {
19
19
  enumerable: true,
20
- get: function get() {
21
- return _Phone["default"];
20
+ get: function () {
21
+ return _Phone.default;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "ZipCodeField", {
25
25
  enumerable: true,
26
- get: function get() {
27
- return _ZipCode["default"];
26
+ get: function () {
27
+ return _ZipCode.default;
28
28
  }
29
29
  });
30
- exports["default"] = void 0;
30
+ exports.default = void 0;
31
31
  var _BaseMask = _interopRequireDefault(require("./BaseMask"));
32
32
  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(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
- var _default = exports["default"] = _BaseMask["default"];
36
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
+ var _default = exports.default = _BaseMask.default;
@@ -1,25 +1,25 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports["default"] = void 0;
6
+ 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(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(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 && Object.prototype.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
- var ActionButtons = function ActionButtons(_ref) {
15
- var disabled = _ref.disabled,
16
- dropdownOpened = _ref.dropdownOpened,
17
- handleOpenClose = _ref.handleOpenClose,
18
- handleCheckAll = _ref.handleCheckAll,
19
- handleUncheckAll = _ref.handleUncheckAll,
20
- _ref$dropdownAlignBut = _ref.dropdownAlignButton,
21
- dropdownAlignButton = _ref$dropdownAlignBut === void 0 ? 'left' : _ref$dropdownAlignBut;
22
- return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_buttons["default"], {
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_buttons.default, {
23
23
  disabled: disabled,
24
24
  size: "small",
25
25
  iconName: dropdownOpened ? 'up' : 'down',
@@ -27,7 +27,7 @@ var ActionButtons = function ActionButtons(_ref) {
27
27
  customClass: "actionbutton",
28
28
  transparent: true,
29
29
  boxShadow: false
30
- }), /*#__PURE__*/_react["default"].createElement(_buttons["default"], {
30
+ }), /*#__PURE__*/_react.default.createElement(_buttons.default, {
31
31
  disabled: disabled,
32
32
  iconName: "more1",
33
33
  transparent: true,
@@ -36,14 +36,14 @@ var ActionButtons = function ActionButtons(_ref) {
36
36
  dropdown: true,
37
37
  dropdownAlign: dropdownAlignButton,
38
38
  showIconDropdown: false
39
- }, /*#__PURE__*/_react["default"].createElement(_list["default"], null, /*#__PURE__*/_react["default"].createElement(_list.ListItem, {
39
+ }, /*#__PURE__*/_react.default.createElement(_list.default, null, /*#__PURE__*/_react.default.createElement(_list.ListItem, {
40
40
  itemId: "1",
41
41
  text: "Marcar Todos",
42
42
  onClick: handleCheckAll
43
- }), /*#__PURE__*/_react["default"].createElement(_list.ListItem, {
43
+ }), /*#__PURE__*/_react.default.createElement(_list.ListItem, {
44
44
  itemId: "2",
45
45
  text: "Desmarcar Todos",
46
46
  onClick: handleUncheckAll
47
47
  }))));
48
48
  };
49
- var _default = exports["default"] = ActionButtons;
49
+ var _default = exports.default = ActionButtons;