linear-react-components-ui 1.0.2 → 1.0.3-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.
Files changed (331) hide show
  1. package/lib/@types/Align.d.ts +1 -1
  2. package/lib/@types/ButtonTypes.d.ts +1 -1
  3. package/lib/@types/ColorStyles.d.ts +1 -1
  4. package/lib/@types/DataCombo.d.ts +1 -1
  5. package/lib/@types/Icon.d.ts +1 -1
  6. package/lib/@types/LabelStyles.d.ts +1 -1
  7. package/lib/@types/Period.d.ts +1 -1
  8. package/lib/@types/PermissionAttr.d.ts +2 -2
  9. package/lib/@types/PointerEvents.d.ts +1 -1
  10. package/lib/@types/Position.d.ts +1 -1
  11. package/lib/@types/PositionAlert.d.ts +1 -1
  12. package/lib/@types/Size.d.ts +1 -1
  13. package/lib/@types/SizePixels.d.ts +1 -1
  14. package/lib/alerts/AlertContainer.js +21 -5
  15. package/lib/alerts/AlertProvider.js +45 -15
  16. package/lib/alerts/BaseAlert.js +20 -4
  17. package/lib/alerts/Message.js +32 -21
  18. package/lib/alerts/alert.spec.js +133 -0
  19. package/lib/alerts/helpers.js +2 -0
  20. package/lib/alerts/index.d.ts +1 -4
  21. package/lib/alerts/index.js +4 -0
  22. package/lib/alerts/types.d.ts +4 -4
  23. package/lib/alerts/withAlert.js +12 -1
  24. package/lib/avatar/avatar.spec.js +190 -0
  25. package/lib/avatar/index.js +35 -20
  26. package/lib/badge/badge.spec.js +127 -0
  27. package/lib/badge/index.js +14 -9
  28. package/lib/buttons/ActivateButton.js +6 -0
  29. package/lib/buttons/AddButton.js +7 -0
  30. package/lib/buttons/Button.js +15 -2
  31. package/lib/buttons/ButtonGroups.js +4 -0
  32. package/lib/buttons/CancelButton.js +11 -1
  33. package/lib/buttons/DangerButton.js +11 -1
  34. package/lib/buttons/DefaultButton.js +81 -45
  35. package/lib/buttons/DestroyButton.js +12 -1
  36. package/lib/buttons/EditButton.js +6 -0
  37. package/lib/buttons/InactivateButton.js +6 -0
  38. package/lib/buttons/InfoButton.js +11 -1
  39. package/lib/buttons/PrimaryButton.js +11 -1
  40. package/lib/buttons/RestoreButton.js +6 -0
  41. package/lib/buttons/SaveButton.js +11 -1
  42. package/lib/buttons/SpinnerLoading.js +230 -0
  43. package/lib/buttons/SuccessButton.js +11 -1
  44. package/lib/buttons/WarningButton.js +11 -1
  45. package/lib/buttons/button_container/index.js +11 -5
  46. package/lib/buttons/buttons.spec.js +504 -0
  47. package/lib/buttons/index.d.ts +1 -4
  48. package/lib/buttons/index.js +18 -0
  49. package/lib/buttons/split_button/index.js +17 -11
  50. package/lib/calendar/DangerCalendar.js +11 -1
  51. package/lib/calendar/InfoCalendar.js +11 -1
  52. package/lib/calendar/PrimaryCalendar.js +11 -1
  53. package/lib/calendar/SuccessCalendar.js +11 -1
  54. package/lib/calendar/WarningCalendar.js +11 -1
  55. package/lib/calendar/base/Day.js +13 -2
  56. package/lib/calendar/base/Month.js +18 -1
  57. package/lib/calendar/base/Week.js +18 -2
  58. package/lib/calendar/base/helpers.js +24 -8
  59. package/lib/calendar/base/index.js +37 -13
  60. package/lib/calendar/calendar.spec.js +171 -0
  61. package/lib/calendar/index.d.ts +1 -4
  62. package/lib/calendar/index.js +8 -0
  63. package/lib/checkbox/Label.js +7 -1
  64. package/lib/checkbox/checkbox.spec.js +215 -0
  65. package/lib/checkbox/index.js +53 -28
  66. package/lib/checkbox/types.d.ts +2 -2
  67. package/lib/dialog/Alert.js +8 -0
  68. package/lib/dialog/Custom.js +17 -5
  69. package/lib/dialog/Error.js +8 -0
  70. package/lib/dialog/Information.js +8 -0
  71. package/lib/dialog/Question.js +15 -4
  72. package/lib/dialog/Warning.js +8 -0
  73. package/lib/dialog/base/Content.js +6 -1
  74. package/lib/dialog/base/Footer.js +4 -0
  75. package/lib/dialog/base/Header.js +13 -5
  76. package/lib/dialog/base/index.js +28 -7
  77. package/lib/dialog/base/style.js +2 -0
  78. package/lib/dialog/dialog.spec.js +488 -0
  79. package/lib/dialog/form/index.js +29 -9
  80. package/lib/dialog/index.d.ts +1 -4
  81. package/lib/dialog/index.js +9 -0
  82. package/lib/drawer/Content.d.ts +0 -1
  83. package/lib/drawer/Content.js +13 -2
  84. package/lib/drawer/Drawer.d.ts +0 -1
  85. package/lib/drawer/Drawer.js +55 -22
  86. package/lib/drawer/Drawer.spec.js +258 -0
  87. package/lib/drawer/Header.d.ts +0 -1
  88. package/lib/drawer/Header.js +27 -10
  89. package/lib/drawer/helpers.d.ts +0 -1
  90. package/lib/drawer/helpers.js +4 -0
  91. package/lib/drawer/index.d.ts +0 -1
  92. package/lib/drawer/index.js +8 -0
  93. package/lib/drawer/types.d.ts +1 -2
  94. package/lib/dropdown/Popup.js +32 -19
  95. package/lib/dropdown/dropdown.spec.js +169 -0
  96. package/lib/dropdown/helper.js +4 -0
  97. package/lib/dropdown/withDropdown.js +47 -18
  98. package/lib/fieldset/fieldset.spec.js +329 -0
  99. package/lib/fieldset/index.js +46 -21
  100. package/lib/form/Field.js +42 -16
  101. package/lib/form/FieldArray.js +32 -15
  102. package/lib/form/FieldNumber.js +20 -6
  103. package/lib/form/FieldPeriod.js +21 -9
  104. package/lib/form/form.spec.js +293 -0
  105. package/lib/form/helpers.js +30 -5
  106. package/lib/form/index.js +91 -36
  107. package/lib/form/types.d.ts +6 -6
  108. package/lib/form/withFieldHOC.js +34 -15
  109. package/lib/form/withFormSecurity.js +28 -5
  110. package/lib/gridlayout/GridCol.js +11 -5
  111. package/lib/gridlayout/GridRow.js +9 -3
  112. package/lib/gridlayout/gridLayout.spec.js +169 -0
  113. package/lib/gridlayout/index.d.ts +1 -4
  114. package/lib/gridlayout/index.js +4 -0
  115. package/lib/icons/icons.spec.js +86 -0
  116. package/lib/icons/index.js +26 -16
  117. package/lib/icons/types.d.ts +1 -1
  118. package/lib/index.d.ts +1 -1
  119. package/lib/index.js +10 -0
  120. package/lib/inputs/base/InputTextBase.js +75 -50
  121. package/lib/inputs/base/base.spec.js +690 -0
  122. package/lib/inputs/base/helpers.d.ts +1 -1
  123. package/lib/inputs/base/helpers.js +40 -7
  124. package/lib/inputs/base/index.js +1 -0
  125. package/lib/inputs/base/types.d.ts +1 -0
  126. package/lib/inputs/color/color_input.spec.js +174 -0
  127. package/lib/inputs/color/index.js +38 -11
  128. package/lib/inputs/date/Dialog.js +7 -2
  129. package/lib/inputs/date/Dropdown.js +8 -1
  130. package/lib/inputs/date/date.spec.js +354 -0
  131. package/lib/inputs/date/helpers.js +11 -2
  132. package/lib/inputs/date/index.js +101 -48
  133. package/lib/inputs/file/DefaultFile.js +42 -13
  134. package/lib/inputs/file/DragDropFile.js +90 -37
  135. package/lib/inputs/file/File.js +25 -4
  136. package/lib/inputs/file/FileButtonSettings.js +11 -5
  137. package/lib/inputs/file/helpers.js +5 -0
  138. package/lib/inputs/file/index.d.ts +1 -4
  139. package/lib/inputs/file/index.js +6 -0
  140. package/lib/inputs/file/types.d.ts +1 -1
  141. package/lib/inputs/inputHOC.d.ts +1 -2
  142. package/lib/inputs/inputHOC.js +34 -10
  143. package/lib/inputs/mask/BaseMask.js +17 -1
  144. package/lib/inputs/mask/Cnpj.js +37 -12
  145. package/lib/inputs/mask/Cpf.js +33 -10
  146. package/lib/inputs/mask/Phone.js +6 -0
  147. package/lib/inputs/mask/ZipCode.js +6 -0
  148. package/lib/inputs/mask/helpers.d.ts +1 -2
  149. package/lib/inputs/mask/helpers.js +20 -8
  150. package/lib/inputs/mask/imaskHOC.d.ts +1 -2
  151. package/lib/inputs/mask/imaskHOC.js +83 -52
  152. package/lib/inputs/mask/index.d.ts +1 -4
  153. package/lib/inputs/mask/index.js +7 -0
  154. package/lib/inputs/mask/input_mask.spec.js +607 -0
  155. package/lib/inputs/multiSelect/ActionButtons.js +13 -4
  156. package/lib/inputs/multiSelect/Dropdown.js +45 -22
  157. package/lib/inputs/multiSelect/helper.js +4 -2
  158. package/lib/inputs/multiSelect/index.js +104 -40
  159. package/lib/inputs/number/BaseNumber.d.ts +1 -2
  160. package/lib/inputs/number/BaseNumber.js +16 -3
  161. package/lib/inputs/number/Currency.d.ts +1 -2
  162. package/lib/inputs/number/Currency.js +7 -1
  163. package/lib/inputs/number/Decimal.d.ts +1 -2
  164. package/lib/inputs/number/Decimal.js +5 -0
  165. package/lib/inputs/number/format_number.js +7 -0
  166. package/lib/inputs/number/index.d.ts +1 -2
  167. package/lib/inputs/number/index.js +13 -3
  168. package/lib/inputs/number/numberfield.spec.js +215 -0
  169. package/lib/inputs/number/types.d.ts +1 -2
  170. package/lib/inputs/period/Dialog.js +7 -2
  171. package/lib/inputs/period/Dropdown.js +7 -0
  172. package/lib/inputs/period/PeriodList.js +7 -1
  173. package/lib/inputs/period/helper.js +12 -2
  174. package/lib/inputs/period/index.js +114 -43
  175. package/lib/inputs/period/types.d.ts +1 -1
  176. package/lib/inputs/search/index.d.ts +1 -2
  177. package/lib/inputs/search/index.js +68 -27
  178. package/lib/inputs/search/search_input.spec.js +209 -0
  179. package/lib/inputs/select/ActionButtons.d.ts +1 -2
  180. package/lib/inputs/select/ActionButtons.js +12 -4
  181. package/lib/inputs/select/Dropdown.d.ts +1 -2
  182. package/lib/inputs/select/Dropdown.js +48 -28
  183. package/lib/inputs/select/helper.d.ts +1 -2
  184. package/lib/inputs/select/helper.js +25 -9
  185. package/lib/inputs/select/index.d.ts +1 -1
  186. package/lib/inputs/select/index.js +18 -3
  187. package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
  188. package/lib/inputs/select/multiple/Selecteds.js +7 -3
  189. package/lib/inputs/select/multiple/index.d.ts +1 -1
  190. package/lib/inputs/select/multiple/index.js +96 -37
  191. package/lib/inputs/select/select.spec.js +395 -0
  192. package/lib/inputs/select/simple/index.d.ts +1 -1
  193. package/lib/inputs/select/simple/index.js +118 -54
  194. package/lib/inputs/select/types.d.ts +7 -2
  195. package/lib/inputs/text/index.js +5 -1
  196. package/lib/inputs/text/textfield.spec.js +215 -0
  197. package/lib/inputs/text/types.d.ts +1 -1
  198. package/lib/inputs/textarea/index.js +10 -4
  199. package/lib/inputs/textarea/textarea.spec.js +59 -0
  200. package/lib/inputs/types.d.ts +3 -9
  201. package/lib/internals/withTooltip.js +70 -25
  202. package/lib/labelMessages/index.js +45 -25
  203. package/lib/labelMessages/labelMessages.spec.js +176 -0
  204. package/lib/labels/DangerLabel.js +11 -1
  205. package/lib/labels/DefaultLabel.js +41 -19
  206. package/lib/labels/InfoLabel.js +11 -1
  207. package/lib/labels/PrimaryLabel.js +11 -1
  208. package/lib/labels/SuccessLabel.js +11 -1
  209. package/lib/labels/WarningLabel.js +11 -1
  210. package/lib/labels/index.d.ts +1 -4
  211. package/lib/labels/index.js +10 -0
  212. package/lib/labels/label.spec.js +162 -0
  213. package/lib/labels/label_container/index.js +7 -3
  214. package/lib/list/Header.js +7 -3
  215. package/lib/list/Item.js +68 -33
  216. package/lib/list/Separator.js +4 -0
  217. package/lib/list/helpers.js +4 -0
  218. package/lib/list/index.js +60 -25
  219. package/lib/list/list.spec.js +769 -0
  220. package/lib/list/types.d.ts +1 -1
  221. package/lib/menus/float/MenuItem.js +26 -9
  222. package/lib/menus/float/SubMenuContainer.js +17 -5
  223. package/lib/menus/float/float-menu.spec.js +221 -0
  224. package/lib/menus/float/helpers.js +4 -0
  225. package/lib/menus/float/index.js +21 -8
  226. package/lib/menus/index.d.ts +1 -4
  227. package/lib/menus/index.js +3 -0
  228. package/lib/menus/sidenav/ExpandMenu.js +7 -2
  229. package/lib/menus/sidenav/MenuLink.js +12 -3
  230. package/lib/menus/sidenav/NavMenuGroup.js +12 -3
  231. package/lib/menus/sidenav/NavMenuItem.js +56 -27
  232. package/lib/menus/sidenav/NavSubMenuItem.js +27 -8
  233. package/lib/menus/sidenav/helpers.js +9 -0
  234. package/lib/menus/sidenav/index.js +75 -26
  235. package/lib/menus/sidenav/popup_menu_search/EmptyList.js +7 -2
  236. package/lib/menus/sidenav/popup_menu_search/index.js +45 -15
  237. package/lib/menus/sidenav/sidenav.spec.js +379 -0
  238. package/lib/menus/sidenav/types.d.ts +1 -1
  239. package/lib/noPermission/index.js +6 -0
  240. package/lib/panel/Content.d.ts +1 -1
  241. package/lib/panel/Content.js +22 -7
  242. package/lib/panel/DangerPanel.d.ts +1 -1
  243. package/lib/panel/DangerPanel.js +7 -0
  244. package/lib/panel/Default.d.ts +1 -1
  245. package/lib/panel/Default.js +44 -20
  246. package/lib/panel/Header.d.ts +1 -1
  247. package/lib/panel/Header.js +27 -12
  248. package/lib/panel/InfoPanel.d.ts +1 -1
  249. package/lib/panel/InfoPanel.js +7 -0
  250. package/lib/panel/PrimaryPanel.d.ts +1 -1
  251. package/lib/panel/PrimaryPanel.js +7 -0
  252. package/lib/panel/SuccessPanel.d.ts +1 -1
  253. package/lib/panel/SuccessPanel.js +7 -0
  254. package/lib/panel/ToolBar.d.ts +1 -1
  255. package/lib/panel/ToolBar.js +5 -0
  256. package/lib/panel/WarningPanel.d.ts +1 -1
  257. package/lib/panel/WarningPanel.js +7 -0
  258. package/lib/panel/helpers.d.ts +1 -1
  259. package/lib/panel/helpers.js +10 -2
  260. package/lib/panel/index.d.ts +2 -5
  261. package/lib/panel/index.js +11 -0
  262. package/lib/panel/panel.spec.js +216 -0
  263. package/lib/panel/types.d.ts +1 -1
  264. package/lib/permissionValidations.js +15 -3
  265. package/lib/popover/PopoverText.js +4 -0
  266. package/lib/popover/PopoverTitle.js +4 -0
  267. package/lib/popover/index.js +29 -16
  268. package/lib/popover/popover.spec.js +146 -0
  269. package/lib/popover/types.d.ts +2 -1
  270. package/lib/progress/Bar.js +33 -20
  271. package/lib/progress/index.js +14 -5
  272. package/lib/progress/progress.spec.js +94 -0
  273. package/lib/radio/index.js +46 -23
  274. package/lib/radio/radio.spec.js +189 -0
  275. package/lib/skeleton/SkeletonContainer.js +9 -3
  276. package/lib/skeleton/index.js +22 -10
  277. package/lib/spinner/SpinnerLoading.js +7 -3
  278. package/lib/spinner/index.js +40 -18
  279. package/lib/spinner/spinner.spec.js +152 -0
  280. package/lib/split/Split.js +83 -32
  281. package/lib/split/SplitSide.js +18 -6
  282. package/lib/split/helpers.d.ts +1 -1
  283. package/lib/split/helpers.js +4 -0
  284. package/lib/split/index.d.ts +1 -4
  285. package/lib/split/index.js +5 -0
  286. package/lib/split/split.spec.js +163 -0
  287. package/lib/table/Body.js +29 -15
  288. package/lib/table/Header.js +28 -5
  289. package/lib/table/HeaderColumn.js +21 -10
  290. package/lib/table/Row.js +28 -18
  291. package/lib/table/RowColumn.js +29 -12
  292. package/lib/table/helpers.js +7 -0
  293. package/lib/table/index.js +62 -32
  294. package/lib/table/table.spec.js +352 -0
  295. package/lib/table/types.d.ts +1 -1
  296. package/lib/tabs/DropdownItems.js +21 -12
  297. package/lib/tabs/Menu.js +15 -5
  298. package/lib/tabs/MenuItems.js +33 -23
  299. package/lib/tabs/Panel.js +39 -14
  300. package/lib/tabs/index.js +113 -46
  301. package/lib/tabs/tabHelpers.js +16 -3
  302. package/lib/tabs/tabs.spec.js +321 -0
  303. package/lib/toolbar/ButtonBar.js +29 -13
  304. package/lib/toolbar/LabelBar.js +28 -11
  305. package/lib/toolbar/Separator.js +4 -0
  306. package/lib/toolbar/ToolBarGroup.js +6 -2
  307. package/lib/toolbar/helpers.js +2 -0
  308. package/lib/toolbar/index.js +23 -7
  309. package/lib/toolbar/toolbar.spec.js +394 -0
  310. package/lib/tooltip/index.js +25 -10
  311. package/lib/tooltip/tooltip.spec.js +215 -0
  312. package/lib/tooltip/types.d.ts +1 -1
  313. package/lib/treetable/Body.js +27 -9
  314. package/lib/treetable/Header.js +11 -1
  315. package/lib/treetable/Row.js +113 -58
  316. package/lib/treetable/helpers.js +10 -0
  317. package/lib/treetable/index.js +11 -0
  318. package/lib/treeview/Header.js +6 -2
  319. package/lib/treeview/Node.js +111 -47
  320. package/lib/treeview/constants.js +4 -0
  321. package/lib/treeview/index.js +134 -54
  322. package/lib/treeview/treeview.spec.js +279 -0
  323. package/lib/treeview/types.d.ts +2 -2
  324. package/lib/treeview_old/Header.js +6 -1
  325. package/lib/treeview_old/Node.js +32 -5
  326. package/lib/treeview_old/index.js +9 -1
  327. package/lib/{types-90c43ae1.d.ts → types-3c6f1c20.d.ts} +1 -1
  328. package/lib/uitour/index.js +73 -33
  329. package/lib/uitour/types.d.ts +1 -1
  330. package/lib/uitour/uitour.spec.js +176 -0
  331. package/package.json +1 -1
@@ -4,64 +4,83 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _react = _interopRequireWildcard(require("react"));
9
+
8
10
  var _imask = _interopRequireDefault(require("imask"));
11
+
9
12
  var helpers = _interopRequireWildcard(require("./helpers"));
13
+
10
14
  var _permissionValidations = require("../../permissionValidations");
15
+
11
16
  var _format_number = require("../number/format_number");
17
+
12
18
  var _this = void 0;
19
+
13
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
14
22
  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
+
15
24
  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
+
16
26
  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
+
17
28
  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
+
18
30
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
+
19
32
  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
+
20
34
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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; } }
35
+
36
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
37
+
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
+
23
40
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
+
24
42
  var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
43
+
25
44
  var IMaskHOC = function IMaskHOC(ComposedComponent) {
26
45
  var MaskedComponent = function MaskedComponent(props) {
27
46
  var permissionAttr = props.permissionAttr,
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;
47
+ skeletonize = props.skeletonize,
48
+ _inputRef = props.inputRef,
49
+ _props$placeholderCha = props.placeholderChar,
50
+ placeholderChar = _props$placeholderCha === void 0 ? '_' : _props$placeholderCha,
51
+ _props$lazy = props.lazy,
52
+ lazy = _props$lazy === void 0 ? false : _props$lazy,
53
+ _props$pattern = props.pattern,
54
+ pattern = _props$pattern === void 0 ? '' : _props$pattern,
55
+ _props$radix = props.radix,
56
+ radix = _props$radix === void 0 ? ' ' : _props$radix,
57
+ _props$thousandsSepar = props.thousandsSeparator,
58
+ thousandsSeparator = _props$thousandsSepar === void 0 ? '' : _props$thousandsSepar,
59
+ _props$mapToRadix = props.mapToRadix,
60
+ mapToRadix = _props$mapToRadix === void 0 ? [] : _props$mapToRadix,
61
+ _props$scale = props.scale,
62
+ scale = _props$scale === void 0 ? 2 : _props$scale,
63
+ _props$signed = props.signed,
64
+ signed = _props$signed === void 0 ? false : _props$signed,
65
+ _props$normalizeZeros = props.normalizeZeros,
66
+ normalizeZeros = _props$normalizeZeros === void 0 ? true : _props$normalizeZeros,
67
+ _props$padFractionalZ = props.padFractionalZeros,
68
+ padFractionalZeros = _props$padFractionalZ === void 0 ? true : _props$padFractionalZ,
69
+ mask = props.mask,
70
+ _props$commit = props.commit,
71
+ commit = _props$commit === void 0 ? function () {} : _props$commit,
72
+ parse = props.parse,
73
+ format = props.format,
74
+ definitions = props.definitions,
75
+ groups = props.groups,
76
+ min = props.min,
77
+ max = props.max,
78
+ dispatch = props.dispatch,
79
+ _props$value = props.value,
80
+ value = _props$value === void 0 ? '' : _props$value,
81
+ onChange = props.onChange,
82
+ _props$isDateField = props.isDateField,
83
+ isDateField = _props$isDateField === void 0 ? false : _props$isDateField;
65
84
  var maskOptions = {
66
85
  placeholderChar: placeholderChar,
67
86
  lazy: lazy,
@@ -83,28 +102,32 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
83
102
  max: max,
84
103
  dispatch: dispatch
85
104
  };
105
+
86
106
  var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr)),
87
- _useState2 = _slicedToArray(_useState, 1),
88
- onDenied = _useState2[0];
107
+ _useState2 = _slicedToArray(_useState, 1),
108
+ onDenied = _useState2[0];
109
+
89
110
  var elementRef = (0, _react.useRef)(null);
90
111
  var maskRef = (0, _react.useRef)(null);
91
112
  var hideContent = onDenied.hideContent,
92
- unvisible = onDenied.unvisible,
93
- disabled = onDenied.disabled,
94
- readOnly = onDenied.readOnly;
113
+ unvisible = onDenied.unvisible,
114
+ disabled = onDenied.disabled,
115
+ readOnly = onDenied.readOnly;
95
116
  var dontInitMask = hideContent || unvisible || skeletonize;
96
117
  var disableCallbacks = disabled || readOnly;
118
+
97
119
  var setValue = function setValue(newValue) {
98
120
  if (maskRef.current) {
99
121
  if (props.unmask) maskRef.current.unmaskedValue = newValue.toString();
100
122
  maskRef.current.value = String(newValue);
101
123
  }
102
124
  };
125
+
103
126
  var onAccept = function onAccept() {
104
127
  if (onChange && !disableCallbacks && maskRef.current) {
105
128
  var _maskRef$current = maskRef.current,
106
- unmaskedValue = _maskRef$current.unmaskedValue,
107
- el = _maskRef$current.el;
129
+ unmaskedValue = _maskRef$current.unmaskedValue,
130
+ el = _maskRef$current.el;
108
131
  var name = el.name || el.input && el.input.name;
109
132
  onChange({
110
133
  target: {
@@ -114,11 +137,12 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
114
137
  }, props.unmask ? unmaskedValue : maskRef.current.value);
115
138
  }
116
139
  };
140
+
117
141
  var onComplete = function onComplete() {
118
142
  if (props.onComplete && !disableCallbacks && maskRef.current) {
119
143
  var _maskRef$current2 = maskRef.current,
120
- unmaskedValue = _maskRef$current2.unmaskedValue,
121
- el = _maskRef$current2.el;
144
+ unmaskedValue = _maskRef$current2.unmaskedValue,
145
+ el = _maskRef$current2.el;
122
146
  var name = el.name || el.input && el.input.name;
123
147
  props.onComplete({
124
148
  target: {
@@ -128,10 +152,13 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
128
152
  }, props.unmask ? unmaskedValue : maskRef.current.value);
129
153
  }
130
154
  };
155
+
131
156
  var getMask = function getMask() {
132
157
  var element = elementRef.current;
158
+
133
159
  if (element) {
134
160
  var maskCurrent = maskRef.current;
161
+
135
162
  if (!maskCurrent) {
136
163
  maskRef.current = (0, _imask.default)(element, maskOptions).on('accept', onAccept.bind(_this)).on('complete', onComplete.bind(_this));
137
164
  setValue(value);
@@ -140,20 +167,22 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
140
167
  }
141
168
  }
142
169
  };
170
+
143
171
  var destroyMask = function destroyMask() {
144
172
  if (maskRef.current) {
145
173
  maskRef.current.destroy();
146
174
  maskRef.current = null;
147
175
  }
148
176
  };
177
+
149
178
  (0, _react.useEffect)(function () {
150
179
  if (props.handlerSetOnDenied) props.handlerSetOnDenied(onDenied);
151
180
  if (!props.mask || dontInitMask) return;
152
- getMask();
181
+ getMask(); // eslint-disable-next-line consistent-return
153
182
 
154
- // eslint-disable-next-line consistent-return
155
183
  return function () {
156
184
  var _maskRef$current3, _maskRef$current4;
185
+
157
186
  (_maskRef$current3 = maskRef.current) === null || _maskRef$current3 === void 0 ? void 0 : _maskRef$current3.off('accept', onAccept);
158
187
  (_maskRef$current4 = maskRef.current) === null || _maskRef$current4 === void 0 ? void 0 : _maskRef$current4.off('complete', onComplete);
159
188
  };
@@ -181,17 +210,19 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
181
210
  return setValue(e.target.value);
182
211
  },
183
212
  inputRef: function inputRef(el) {
184
- elementRef.current = el;
185
- // Propagate the input ref for who call it
213
+ elementRef.current = el; // Propagate the input ref for who call it
214
+
186
215
  if (_inputRef) {
187
216
  if (_typeof(_inputRef) === 'object') _inputRef.current = el;else _inputRef(el);
188
217
  }
189
218
  }
190
219
  }));
191
220
  };
221
+
192
222
  var nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
193
223
  MaskedComponent.displayName = "IMask(".concat(nestedComponentName, ")");
194
224
  return MaskedComponent;
195
225
  };
226
+
196
227
  var _default = IMaskHOC;
197
228
  exports.default = _default;
@@ -1,4 +1,5 @@
1
1
  import _default from './BaseMask.js';
2
+ export { default } from './BaseMask.js';
2
3
  export { default as CpfField } from './Cpf.js';
3
4
  export { default as CnpjField } from './Cnpj.js';
4
5
  export { default as PhoneField } from './Phone.js';
@@ -8,7 +9,3 @@ import 'react';
8
9
  import '../../@types/PermissionAttr.js';
9
10
  import '../base/types.js';
10
11
  import '../../@types/Period.js';
11
-
12
-
13
-
14
- export { _default as default };
@@ -28,11 +28,18 @@ Object.defineProperty(exports, "ZipCodeField", {
28
28
  }
29
29
  });
30
30
  exports.default = void 0;
31
+
31
32
  var _BaseMask = _interopRequireDefault(require("./BaseMask"));
33
+
32
34
  var _Cpf = _interopRequireDefault(require("./Cpf"));
35
+
33
36
  var _Cnpj = _interopRequireDefault(require("./Cnpj"));
37
+
34
38
  var _Phone = _interopRequireDefault(require("./Phone"));
39
+
35
40
  var _ZipCode = _interopRequireDefault(require("./ZipCode"));
41
+
36
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
+
37
44
  var _default = _BaseMask.default;
38
45
  exports.default = _default;