linear-react-components-ui 1.1.24-beta.0 → 1.1.24-beta.10

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 (265) hide show
  1. package/lib/BaseMask-0c14ef51.d.ts +24 -0
  2. package/lib/Cnpj-bde01dd0.d.ts +18 -0
  3. package/lib/Cpf-3fa496ad.d.ts +18 -0
  4. package/lib/Phone-2bb0b397.d.ts +18 -0
  5. package/lib/ZipCode-09460e18.d.ts +13 -0
  6. package/lib/alerts/AlertProvider.js +1 -2
  7. package/lib/alerts/BaseAlert.js +1 -1
  8. package/lib/alerts/Message.js +2 -3
  9. package/lib/alerts/withAlert.js +1 -2
  10. package/lib/assets/styles/calendar.scss +140 -35
  11. package/lib/assets/styles/datepicker2.scss +3 -9
  12. package/lib/assets/styles/file.scss +8 -0
  13. package/lib/assets/styles/filefield.scss +42 -0
  14. package/lib/assets/styles/numberfield.scss +18 -0
  15. package/lib/assets/styles/periodpicker.scss +1 -1
  16. package/lib/assets/styles/radiofield.scss +185 -0
  17. package/lib/assets/styles/selectfield.scss +1 -3
  18. package/lib/assets/styles/table.scss +6 -0
  19. package/lib/assets/styles/textfield.scss +61 -27
  20. package/lib/avatar/index.js +9 -11
  21. package/lib/badge/index.js +4 -4
  22. package/lib/buttons/Button.js +1 -2
  23. package/lib/buttons/DangerButton.js +1 -1
  24. package/lib/buttons/DefaultButton.js +22 -21
  25. package/lib/buttons/InfoButton.js +1 -1
  26. package/lib/buttons/PrimaryButton.js +1 -1
  27. package/lib/buttons/SuccessButton.js +1 -1
  28. package/lib/buttons/WarningButton.js +1 -1
  29. package/lib/buttons/button_container/index.js +1 -1
  30. package/lib/buttons/split_button/index.js +2 -2
  31. package/lib/calendar/base/helpers.js +2 -2
  32. package/lib/calendar/base/index.js +123 -44
  33. package/lib/checkbox/index.js +2 -3
  34. package/lib/dialog/Custom.js +2 -3
  35. package/lib/dialog/Question.js +5 -4
  36. package/lib/dialog/base/Content.js +5 -6
  37. package/lib/dialog/base/Header.js +3 -4
  38. package/lib/dialog/base/index.js +33 -23
  39. package/lib/dialog/form/index.js +52 -12
  40. package/lib/dialog/types.d.ts +4 -0
  41. package/lib/dialog/wizard/index.js +1 -2
  42. package/lib/dialog/wizard/progressbar.js +1 -1
  43. package/lib/dialog/wizard/step.js +1 -1
  44. package/lib/dialog/wizard/useWizard.js +1 -2
  45. package/lib/drawer/Content.js +1 -2
  46. package/lib/drawer/Drawer.js +6 -7
  47. package/lib/drawer/Header.js +2 -3
  48. package/lib/dropdown/Popup.js +7 -7
  49. package/lib/dropdown/helper.js +1 -1
  50. package/lib/dropdown/withDropdown.js +3 -4
  51. package/lib/fieldset/index.js +8 -9
  52. package/lib/form/Field.js +2 -3
  53. package/lib/form/FieldArray.js +2 -3
  54. package/lib/form/FieldNumber.js +4 -5
  55. package/lib/form/FieldPeriod.js +3 -4
  56. package/lib/form/index.js +3 -4
  57. package/lib/form/withFieldHOC.js +1 -2
  58. package/lib/form/withFormSecurity.js +1 -2
  59. package/lib/form2/helpers.js +1 -1
  60. package/lib/form2/index.d.ts +1 -1
  61. package/lib/form2/types.d.ts +7 -3
  62. package/lib/form2/useForm/index.js +22 -15
  63. package/lib/gridlayout/GridCol.js +5 -5
  64. package/lib/gridlayout/GridRow.js +1 -4
  65. package/lib/hint/index.js +1 -7
  66. package/lib/icons/helper.d.ts +16 -0
  67. package/lib/icons/helper.js +16 -0
  68. package/lib/icons/index.js +9 -9
  69. package/lib/index-208e7f62.d.ts +44 -0
  70. package/lib/index-3b70931d.d.ts +44 -0
  71. package/lib/index-442d51a2.d.ts +15 -0
  72. package/lib/index-4e511971.d.ts +26 -0
  73. package/lib/index-7dfa8924.d.ts +22 -0
  74. package/lib/index-9e576346.d.ts +23 -0
  75. package/lib/index-d3b6a19a.d.ts +41 -0
  76. package/lib/index-ecafc8c6.d.ts +30 -0
  77. package/lib/inputs/base/InputTextBase.js +9 -8
  78. package/lib/inputs/base/helpers.js +3 -7
  79. package/lib/inputs/base/types.d.ts +1 -1
  80. package/lib/inputs/color/index.js +2 -3
  81. package/lib/inputs/date/Dropdown.js +6 -4
  82. package/lib/inputs/date/index.js +34 -22
  83. package/lib/inputs/errorMessage/index.js +2 -3
  84. package/lib/inputs/file/DefaultFile.js +31 -31
  85. package/lib/inputs/file/DragDropFile.js +18 -17
  86. package/lib/inputs/file/File.js +6 -5
  87. package/lib/inputs/file/FileButtonSettings.js +0 -1
  88. package/lib/inputs/file/index.js +0 -1
  89. package/lib/inputs/inputHOC.js +1 -2
  90. package/lib/inputs/mask/BaseMask.js +1 -2
  91. package/lib/inputs/mask/Cnpj.js +1 -2
  92. package/lib/inputs/mask/Cpf.js +1 -2
  93. package/lib/inputs/multiSelect/ActionButtons.js +1 -2
  94. package/lib/inputs/multiSelect/Dropdown.js +11 -11
  95. package/lib/inputs/multiSelect/helper.js +2 -1
  96. package/lib/inputs/multiSelect/index.js +10 -9
  97. package/lib/inputs/number/BaseNumber.js +1 -1
  98. package/lib/inputs/number/index.js +3 -3
  99. package/lib/inputs/period/Dropdown.js +7 -4
  100. package/lib/inputs/period/PeriodList.js +3 -12
  101. package/lib/inputs/period/helper.js +1 -3
  102. package/lib/inputs/period/index.js +116 -113
  103. package/lib/inputs/period/types.d.ts +4 -1
  104. package/lib/inputs/search/index.js +8 -5
  105. package/lib/inputs/select/ActionButtons.js +1 -1
  106. package/lib/inputs/select/Dropdown.js +3 -4
  107. package/lib/inputs/select/helper.js +13 -10
  108. package/lib/inputs/select/multiple/Selecteds.js +2 -2
  109. package/lib/inputs/select/multiple/index.js +14 -11
  110. package/lib/inputs/select/simple/index.js +19 -13
  111. package/lib/inputs/textarea/index.js +1 -1
  112. package/lib/inputs/types.d.ts +1 -0
  113. package/lib/inputs2/checkboxfield/index.d.ts +1 -1
  114. package/lib/inputs2/checkboxfield/index.js +18 -15
  115. package/lib/inputs2/colorfield/index.d.ts +2 -2
  116. package/lib/inputs2/colorfield/index.js +5 -5
  117. package/lib/inputs2/date/base/constants.js +2 -1
  118. package/lib/inputs2/date/base/index.js +6 -8
  119. package/lib/inputs2/date/datefield/calendarbox.d.ts +1 -1
  120. package/lib/inputs2/date/datefield/calendarbox.js +3 -2
  121. package/lib/inputs2/date/datefield/context.d.ts +1 -0
  122. package/lib/inputs2/date/datefield/index.d.ts +1 -0
  123. package/lib/inputs2/date/datefield/index.js +44 -33
  124. package/lib/inputs2/date/datefield/triggers.js +1 -2
  125. package/lib/inputs2/date/datefield/types.d.ts +2 -0
  126. package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +1 -1
  127. package/lib/inputs2/date/dateperiodfield/calendarbox.js +8 -6
  128. package/lib/inputs2/date/dateperiodfield/context.d.ts +1 -0
  129. package/lib/inputs2/date/dateperiodfield/index.d.ts +1 -0
  130. package/lib/inputs2/date/dateperiodfield/index.js +66 -48
  131. package/lib/inputs2/date/dateperiodfield/triggers.js +19 -14
  132. package/lib/inputs2/date/dateperiodfield/types.d.ts +2 -0
  133. package/lib/inputs2/date/helpers.d.ts +1 -0
  134. package/lib/inputs2/date/types.d.ts +2 -1
  135. package/lib/inputs2/{number/Number.d.ts → filefield/index.d.ts} +2 -2
  136. package/lib/inputs2/filefield/index.js +174 -0
  137. package/lib/inputs2/index.d.ts +20 -14
  138. package/lib/inputs2/index.js +10 -11
  139. package/lib/inputs2/mask/BaseMask.d.ts +2 -2
  140. package/lib/inputs2/mask/BaseMask.js +7 -7
  141. package/lib/inputs2/mask/Cnpj.d.ts +3 -3
  142. package/lib/inputs2/mask/Cnpj.js +4 -5
  143. package/lib/inputs2/mask/Cpf.d.ts +3 -3
  144. package/lib/inputs2/mask/Cpf.js +4 -5
  145. package/lib/inputs2/mask/Phone.d.ts +3 -3
  146. package/lib/inputs2/mask/Phone.js +1 -2
  147. package/lib/inputs2/mask/ZipCode.d.ts +3 -3
  148. package/lib/inputs2/mask/ZipCode.js +1 -2
  149. package/lib/inputs2/numberfield/currency.d.ts +13 -0
  150. package/lib/inputs2/numberfield/currency.js +91 -0
  151. package/lib/inputs2/numberfield/decimal.d.ts +13 -0
  152. package/lib/inputs2/{number/BaseNumber.js → numberfield/decimal.js} +57 -58
  153. package/lib/inputs2/numberfield/helpers.d.ts +30 -0
  154. package/lib/inputs2/numberfield/helpers.js +53 -0
  155. package/lib/inputs2/numberfield/index.d.ts +12 -0
  156. package/lib/inputs2/numberfield/index.js +104 -0
  157. package/lib/inputs2/numberfield/types.d.ts +36 -0
  158. package/lib/inputs2/numberfield/types.js +5 -0
  159. package/lib/inputs2/{number/BaseNumber.d.ts → radiofield/index.d.ts} +4 -5
  160. package/lib/inputs2/radiofield/index.js +144 -0
  161. package/lib/inputs2/radiofield/types.d.ts +33 -0
  162. package/lib/inputs2/radiofield/types.js +5 -0
  163. package/lib/inputs2/selectfield/context.d.ts +1 -0
  164. package/lib/inputs2/selectfield/index.d.ts +2 -1
  165. package/lib/inputs2/selectfield/index.js +118 -58
  166. package/lib/inputs2/selectfield/item.d.ts +2 -1
  167. package/lib/inputs2/selectfield/item.js +8 -4
  168. package/lib/inputs2/selectfield/listbox.d.ts +1 -1
  169. package/lib/inputs2/selectfield/listbox.js +24 -10
  170. package/lib/inputs2/selectfield/options.d.ts +9 -0
  171. package/lib/inputs2/selectfield/options.js +26 -0
  172. package/lib/inputs2/selectfield/search.d.ts +1 -1
  173. package/lib/inputs2/selectfield/search.js +3 -4
  174. package/lib/inputs2/selectfield/selections.d.ts +1 -1
  175. package/lib/inputs2/selectfield/selections.js +3 -2
  176. package/lib/inputs2/selectfield/triggers.js +17 -8
  177. package/lib/inputs2/selectfield/types.d.ts +0 -1
  178. package/lib/inputs2/slot/index.d.ts +2 -2
  179. package/lib/inputs2/{number/Decimal.d.ts → textareafield/index.d.ts} +2 -5
  180. package/lib/inputs2/textareafield/index.js +194 -0
  181. package/lib/inputs2/textfield/index.d.ts +1 -1
  182. package/lib/inputs2/textfield/index.js +18 -17
  183. package/lib/labelMessages/index.js +4 -6
  184. package/lib/labels/DefaultLabel.js +2 -6
  185. package/lib/labels/label_container/index.js +1 -1
  186. package/lib/list/Header.js +1 -1
  187. package/lib/list/Item.js +10 -12
  188. package/lib/list/index.js +2 -4
  189. package/lib/menus/float/MenuItem.js +3 -4
  190. package/lib/menus/float/SubMenuContainer.js +2 -3
  191. package/lib/menus/float/index.js +1 -1
  192. package/lib/menus/sidenav/ExpandMenu.js +1 -1
  193. package/lib/menus/sidenav/MenuLink.js +1 -2
  194. package/lib/menus/sidenav/NavMenuGroup.js +2 -3
  195. package/lib/menus/sidenav/NavMenuItem.js +10 -9
  196. package/lib/menus/sidenav/NavSubMenuItem.js +2 -3
  197. package/lib/menus/sidenav/helpers.js +1 -1
  198. package/lib/menus/sidenav/index.js +6 -7
  199. package/lib/menus/sidenav/popup_menu_search/index.js +1 -2
  200. package/lib/panel/Content.js +9 -8
  201. package/lib/panel/Default.js +3 -4
  202. package/lib/panel/Header.js +4 -5
  203. package/lib/permissionValidations.js +1 -1
  204. package/lib/popover/PopoverText.js +1 -2
  205. package/lib/popover/index.js +2 -1
  206. package/lib/progress/Bar.js +6 -6
  207. package/lib/radio/index.js +3 -4
  208. package/lib/shortcuts/index.js +1 -1
  209. package/lib/skeleton/SkeletonContainer.js +1 -2
  210. package/lib/skeleton/index.js +1 -4
  211. package/lib/spinner/index.js +3 -4
  212. package/lib/split/Split.js +2 -3
  213. package/lib/split/SplitSide.js +4 -5
  214. package/lib/table/Body.js +4 -5
  215. package/lib/table/Header.js +9 -7
  216. package/lib/table/HeaderColumn.js +2 -3
  217. package/lib/table/Row.js +4 -5
  218. package/lib/table/RowColumn.js +2 -3
  219. package/lib/table/index.js +20 -16
  220. package/lib/table/types.d.ts +1 -0
  221. package/lib/tabs/DropdownTabs.js +2 -3
  222. package/lib/tabs/Menu.js +1 -1
  223. package/lib/tabs/MenuTabs.js +4 -9
  224. package/lib/tabs/Panel.js +8 -7
  225. package/lib/tabs/context.js +7 -5
  226. package/lib/tabs/index.js +1 -2
  227. package/lib/textContent/index.js +2 -3
  228. package/lib/toolbar/ButtonBar.js +2 -3
  229. package/lib/toolbar/LabelBar.js +1 -2
  230. package/lib/toolbar/index.js +1 -1
  231. package/lib/tooltip/TooltipContent.js +8 -9
  232. package/lib/tooltip/useTooltip.js +8 -8
  233. package/lib/treetable/Body.js +2 -3
  234. package/lib/treetable/Header.js +3 -4
  235. package/lib/treetable/Row.js +9 -10
  236. package/lib/treeview/Header.js +1 -1
  237. package/lib/treeview/Node.js +5 -6
  238. package/lib/treeview/index.js +5 -6
  239. package/lib/uitour/index.js +9 -8
  240. package/package.json +1 -1
  241. package/lib/BaseMask-3d5d581d.d.ts +0 -24
  242. package/lib/BaseNumber-797088d7.d.ts +0 -23
  243. package/lib/Cnpj-1602be21.d.ts +0 -18
  244. package/lib/Cpf-4d6b9079.d.ts +0 -18
  245. package/lib/Currency-b33d3a22.d.ts +0 -18
  246. package/lib/Decimal-55e836d5.d.ts +0 -13
  247. package/lib/Number-9c6aceff.d.ts +0 -20
  248. package/lib/Phone-79e5e3b4.d.ts +0 -18
  249. package/lib/ZipCode-8c2e9d8b.d.ts +0 -13
  250. package/lib/calendar/base/Day.d.ts +0 -8
  251. package/lib/calendar/base/Day.js +0 -36
  252. package/lib/calendar/base/Month.d.ts +0 -8
  253. package/lib/calendar/base/Month.js +0 -39
  254. package/lib/calendar/base/Week.d.ts +0 -8
  255. package/lib/calendar/base/Week.js +0 -35
  256. package/lib/index-18a64236.d.ts +0 -23
  257. package/lib/index-43ad8140.d.ts +0 -41
  258. package/lib/index-772f9f1a.d.ts +0 -44
  259. package/lib/index-8a59cf4b.d.ts +0 -23
  260. package/lib/inputs2/number/Currency.d.ts +0 -11
  261. package/lib/inputs2/number/Currency.js +0 -47
  262. package/lib/inputs2/number/Decimal.js +0 -36
  263. package/lib/inputs2/number/Number.js +0 -49
  264. package/lib/inputs2/number/format_number.d.ts +0 -5
  265. package/lib/inputs2/number/format_number.js +0 -29
@@ -8,24 +8,24 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _avatar = _interopRequireDefault(require("../../avatar"));
9
9
  var _icons = _interopRequireDefault(require("../../icons"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
14
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
16
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
17
  const returnDropdownDynamicStyles = (selectFieldRef, dropdownMaxHeight) => {
19
- const selectFieldRects = selectFieldRef?.current?.getBoundingClientRect();
20
- const bottom = selectFieldRects?.bottom ? selectFieldRects?.bottom : 0;
21
- const offsetTop = selectFieldRef?.current?.offsetTop ? selectFieldRef?.current?.offsetTop : 0;
18
+ var _selectFieldRef$curre, _selectFieldRef$curre2, _selectFieldRef$curre3;
19
+ const selectFieldRects = selectFieldRef === null || selectFieldRef === void 0 ? void 0 : (_selectFieldRef$curre = selectFieldRef.current) === null || _selectFieldRef$curre === void 0 ? void 0 : _selectFieldRef$curre.getBoundingClientRect();
20
+ const bottom = selectFieldRects !== null && selectFieldRects !== void 0 && selectFieldRects.bottom ? selectFieldRects === null || selectFieldRects === void 0 ? void 0 : selectFieldRects.bottom : 0;
21
+ const offsetTop = selectFieldRef !== null && selectFieldRef !== void 0 && (_selectFieldRef$curre2 = selectFieldRef.current) !== null && _selectFieldRef$curre2 !== void 0 && _selectFieldRef$curre2.offsetTop ? selectFieldRef === null || selectFieldRef === void 0 ? void 0 : (_selectFieldRef$curre3 = selectFieldRef.current) === null || _selectFieldRef$curre3 === void 0 ? void 0 : _selectFieldRef$curre3.offsetTop : 0;
22
22
  const dropdownBottomDistance = window.innerHeight - bottom;
23
23
  let maxDropdownBottomDistance = 200;
24
24
  let height = dropdownMaxHeight;
25
25
  let dropdownPosition;
26
26
  if (!height || height <= 0) {
27
27
  if (dropdownBottomDistance < maxDropdownBottomDistance) {
28
- height = selectFieldRects?.top ? selectFieldRects.top : 0;
28
+ height = selectFieldRects !== null && selectFieldRects !== void 0 && selectFieldRects.top ? selectFieldRects.top : 0;
29
29
  dropdownPosition = window.innerHeight - offsetTop + 10;
30
30
  } else {
31
31
  height = dropdownBottomDistance;
@@ -37,8 +37,8 @@ const returnDropdownDynamicStyles = (selectFieldRef, dropdownMaxHeight) => {
37
37
  }
38
38
  }
39
39
  return {
40
- maxHeight: `${height - 30}px`,
41
- bottom: `${dropdownPosition}px`
40
+ maxHeight: "".concat(height - 30, "px"),
41
+ bottom: "".concat(dropdownPosition, "px")
42
42
  };
43
43
  };
44
44
  const Dropdown = props => {
@@ -102,11 +102,11 @@ const Dropdown = props => {
102
102
  customClass: "checkboxicon"
103
103
  }), /*#__PURE__*/_react.default.createElement("span", {
104
104
  className: "label"
105
- }, inputValue !== '' ? 'Selecionar todos pesquisados' : 'Selecionar Todos'))), dataCombo?.map(item => {
105
+ }, inputValue !== '' ? 'Selecionar todos pesquisados' : 'Selecionar Todos'))), dataCombo === null || dataCombo === void 0 ? void 0 : dataCombo.map(item => {
106
106
  const isChecked = selecteds ? selecteds.find(selected => selected[idKey] === item[idKey]) : undefined;
107
107
  return /*#__PURE__*/_react.default.createElement("div", {
108
- key: `dropdowmItem ${item[idKey]}}`,
109
- className: `item ${isChecked && '-selected'}`
108
+ key: "dropdowmItem ".concat(item[idKey], "}"),
109
+ className: "item ".concat(isChecked && '-selected')
110
110
  }, /*#__PURE__*/_react.default.createElement("button", {
111
111
  className: "menubutton",
112
112
  tabIndex: -1,
@@ -11,10 +11,11 @@ const getFilteredDataCombo = _ref => {
11
11
  inputText
12
12
  } = _ref;
13
13
  return dataSource.filter(item => {
14
+ var _descriptionKey;
14
15
  if (typeof descriptionKey === 'string') {
15
16
  return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1;
16
17
  }
17
- return descriptionKey(item)?.toLowerCase().indexOf(inputText.toLowerCase()) > -1;
18
+ return ((_descriptionKey = descriptionKey(item)) === null || _descriptionKey === void 0 ? void 0 : _descriptionKey.toLowerCase().indexOf(inputText.toLowerCase())) > -1;
18
19
  });
19
20
  };
20
21
  var _default = exports.default = getFilteredDataCombo;
@@ -12,8 +12,7 @@ var _ActionButtons = _interopRequireDefault(require("./ActionButtons"));
12
12
  var _Dropdown = _interopRequireDefault(require("./Dropdown"));
13
13
  var _helper = _interopRequireDefault(require("./helper"));
14
14
  require("../../assets/styles/multiSelect.scss");
15
- 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); }
16
- 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
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
17
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
19
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -33,7 +32,7 @@ const MultiSelectField = props => {
33
32
  gridLayout,
34
33
  dropdownAlignButton = 'left'
35
34
  } = props;
36
- const componentId = `multiSelect-component${uuid.v1()}`;
35
+ const componentId = "multiSelect-component".concat(uuid.v1());
37
36
  const [dataCombo, setDataCombo] = (0, _react.useState)(dataSource);
38
37
  const [selecteds, setSelecteds] = (0, _react.useState)();
39
38
  const [inputValue, setInputValue] = (0, _react.useState)('');
@@ -68,8 +67,8 @@ const MultiSelectField = props => {
68
67
  };
69
68
  const onMouseMove = event => {
70
69
  const target = event.target;
71
- if (target?.className === '') return;
72
- const newInsideComponent = ['item', 'menubutton', 'filterinput', 'filtercontainer', 'label'].includes(target?.className);
70
+ if ((target === null || target === void 0 ? void 0 : target.className) === '') return;
71
+ const newInsideComponent = ['item', 'menubutton', 'filterinput', 'filtercontainer', 'label'].includes(target === null || target === void 0 ? void 0 : target.className);
73
72
  setInsideComponent(newInsideComponent);
74
73
  };
75
74
  const onBlurComponent = e => {
@@ -109,10 +108,11 @@ const MultiSelectField = props => {
109
108
  if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
110
109
  };
111
110
  const onClickOutSide = event => {
111
+ var _componentRef$current;
112
112
  const {
113
113
  target
114
114
  } = event;
115
- if (target !== componentRef.current && !componentRef.current?.contains(target)) {
115
+ if (target !== componentRef.current && !((_componentRef$current = componentRef.current) !== null && _componentRef$current !== void 0 && _componentRef$current.contains(target))) {
116
116
  setOpened(false);
117
117
  setDataCombo(dataSource);
118
118
  setInputValue('');
@@ -138,7 +138,8 @@ const MultiSelectField = props => {
138
138
  };
139
139
  (0, _react.useEffect)(() => {
140
140
  if (gridLayout) {
141
- const currentGridEl = selectWrapper.current?.parentElement;
141
+ var _selectWrapper$curren;
142
+ const currentGridEl = (_selectWrapper$curren = selectWrapper.current) === null || _selectWrapper$curren === void 0 ? void 0 : _selectWrapper$curren.parentElement;
142
143
  if (currentGridEl) setElementStyles(window.getComputedStyle(currentGridEl));
143
144
  }
144
145
  window.addEventListener('resize', onScreenResize);
@@ -152,10 +153,10 @@ const MultiSelectField = props => {
152
153
  }, []);
153
154
  (0, _react.useEffect)(() => {
154
155
  if (dataSource && dataSource.length > 0) {
155
- const newSelecteds = dataSource.filter(item => value?.includes(item[idKey]));
156
+ const newSelecteds = dataSource.filter(item => value === null || value === void 0 ? void 0 : value.includes(item[idKey]));
156
157
  setSelecteds(newSelecteds);
157
158
  }
158
- }, [value?.length, dataSource?.length]);
159
+ }, [value === null || value === void 0 ? void 0 : value.length, dataSource === null || dataSource === void 0 ? void 0 : dataSource.length]);
159
160
  (0, _react.useEffect)(() => {
160
161
  if (dataSource && dataCombo && !_lodash.default.isEqual(dataSource, dataCombo)) {
161
162
  const newDataCombo = (0, _helper.default)(_objectSpread(_objectSpread({}, props), {}, {
@@ -68,7 +68,7 @@ const BaseNumber = _ref => {
68
68
  });
69
69
  return /*#__PURE__*/_react.default.createElement(_BaseMask.default, _extends({
70
70
  mask: Number,
71
- value: value ?? 0,
71
+ value: value !== null && value !== void 0 ? value : 0,
72
72
  thousandsSeparator: ".",
73
73
  radix: ",",
74
74
  mapToRadix: ['.'],
@@ -22,8 +22,7 @@ var _Decimal = _interopRequireDefault(require("./Decimal"));
22
22
  require("../../assets/styles/numbers.scss");
23
23
  var _InputTextBase = _interopRequireDefault(require("../base/InputTextBase"));
24
24
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
25
- 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); }
26
- 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; }
25
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
27
26
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
28
27
  const NumberField = props => {
29
28
  const {
@@ -50,7 +49,8 @@ const NumberField = props => {
50
49
  if (props.onChange) props.onChange(event);
51
50
  };
52
51
  (0, _react.useEffect)(() => {
53
- setNumberValue(value?.toString() ?? '');
52
+ var _value$toString;
53
+ setNumberValue((_value$toString = value === null || value === void 0 ? void 0 : value.toString()) !== null && _value$toString !== void 0 ? _value$toString : '');
54
54
  }, [value]);
55
55
  return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
56
56
  value: numberValue,
@@ -18,18 +18,21 @@ const Dropdown = props => {
18
18
  const elementRef = (0, _react.useRef)(document.createElement('div'));
19
19
  const width = inputDimensions && inputDimensions.width || CALENDAR_MIN_WIDTH;
20
20
  (0, _react.useEffect)(() => {
21
+ var _containerRef$current;
21
22
  elementRef.current.className = 'datepicker-component';
22
23
  elementRef.current.style.width = String(width).concat('px');
23
- elementRef.current.style.top = String(inputDimensions?.bottom).concat('px');
24
- containerRef.current?.appendChild(elementRef.current);
24
+ elementRef.current.style.top = String(inputDimensions === null || inputDimensions === void 0 ? void 0 : inputDimensions.bottom).concat('px');
25
+ (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.appendChild(elementRef.current);
25
26
  dropdownRef(elementRef.current);
26
27
  return () => {
27
- containerRef.current?.removeChild(elementRef.current);
28
+ var _containerRef$current2;
29
+ (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.removeChild(elementRef.current);
28
30
  };
29
31
  }, []);
30
32
  (0, _react.useEffect)(() => {
33
+ var _props$inputDimension;
31
34
  elementRef.current.style.width = String(width).concat('px');
32
- elementRef.current.style.top = String(props.inputDimensions?.bottom).concat('px');
35
+ elementRef.current.style.top = String((_props$inputDimension = props.inputDimensions) === null || _props$inputDimension === void 0 ? void 0 : _props$inputDimension.bottom).concat('px');
33
36
  }, [props]);
34
37
  return /*#__PURE__*/_reactDom.default.createPortal(children, elementRef.current);
35
38
  };
@@ -38,24 +38,15 @@ const PeriodList = _ref => {
38
38
  className: "dropdown-period"
39
39
  }, periodOptions.map(item => {
40
40
  const itemSelected = selected === item.id;
41
- return /*#__PURE__*/_react.default.createElement("div", {
42
- role: "button",
41
+ return /*#__PURE__*/_react.default.createElement("button", {
42
+ key: String('item-').concat(item.id),
43
43
  tabIndex: -1,
44
- onKeyDown: () => {},
45
- key: `item-${item.id}`,
46
44
  className: (0, _helper.getDropdownItemCssClass)(itemSelected),
47
45
  onClick: () => {
48
46
  const dates = item.id !== 'custom' ? (0, _helper.CalcDatesByPeriod)(item.id) : null;
49
47
  handleOnSelect(item.id, dates);
50
48
  }
51
- }, /*#__PURE__*/_react.default.createElement("span", {
52
- role: "button",
53
- className: "menubutton",
54
- tabIndex: -1,
55
- onKeyPress: () => {}
56
- }, /*#__PURE__*/_react.default.createElement("span", {
57
- className: "label"
58
- }, item.label)));
49
+ }, item.label);
59
50
  }));
60
51
  };
61
52
  var _default = exports.default = PeriodList;
@@ -12,9 +12,7 @@ const getCalendarDropdownStyle = _ref => {
12
12
  leftPosition,
13
13
  width
14
14
  } = _ref;
15
- return `top: ${topPosition}px;
16
- left: ${leftPosition}px;
17
- width:${width}px`;
15
+ return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width:").concat(width, "px");
18
16
  };
19
17
  var _default = exports.default = getCalendarDropdownStyle;
20
18
  const getDropdownItemCssClass = function () {
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ require("../../assets/styles/periodpicker.scss");
7
8
  var _react = _interopRequireWildcard(require("react"));
8
9
  var _moment = _interopRequireDefault(require("moment"));
9
10
  var _PeriodList = _interopRequireDefault(require("./PeriodList"));
@@ -16,13 +17,11 @@ var _Dialog = _interopRequireDefault(require("./Dialog"));
16
17
  var _hint = _interopRequireDefault(require("../../hint"));
17
18
  var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
18
19
  var helperBase = _interopRequireWildcard(require("../base/helpers"));
19
- require("../../assets/styles/periodpicker.scss");
20
20
  var _errorMessage = require("../errorMessage");
21
21
  var _textContent = _interopRequireDefault(require("../../textContent"));
22
22
  var _popover = _interopRequireDefault(require("../../popover"));
23
23
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
24
- 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); }
25
- 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; }
24
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
26
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
27
26
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28
27
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -66,10 +65,12 @@ const PeriodPicker = props => {
66
65
  const inputFinalRef = (0, _react.useRef)(null);
67
66
  const calendarContainerRef = (0, _react.useRef)(null);
68
67
  const onScreenResize = () => {
69
- setInputDimensions(inputContainerRef?.current?.getBoundingClientRect());
68
+ var _inputContainerRef$cu;
69
+ setInputDimensions(inputContainerRef === null || inputContainerRef === void 0 ? void 0 : (_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 ? void 0 : _inputContainerRef$cu.getBoundingClientRect());
70
70
  };
71
71
  const onBlurWithoutWrapper = event => {
72
- const focusOnAnotherField = !wrapperBaseInputPeriodRef.current?.contains(event.relatedTarget);
72
+ var _wrapperBaseInputPeri;
73
+ const focusOnAnotherField = !((_wrapperBaseInputPeri = wrapperBaseInputPeriodRef.current) !== null && _wrapperBaseInputPeri !== void 0 && _wrapperBaseInputPeri.contains(event.relatedTarget));
73
74
  if (!showCalendarInDialog && showCalendarValueInitial && focusOnAnotherField) {
74
75
  setShowCalendarValueInitial(false);
75
76
  }
@@ -87,98 +88,46 @@ const PeriodPicker = props => {
87
88
  targetElement.focus();
88
89
  if (showCalendarValueInitial) {
89
90
  if (targetElement.id !== 'valueInitial') {
90
- inputInitialRef.current?.focus();
91
+ var _inputInitialRef$curr;
92
+ (_inputInitialRef$curr = inputInitialRef.current) === null || _inputInitialRef$curr === void 0 ? void 0 : _inputInitialRef$curr.focus();
91
93
  }
92
94
  setShowCalendarValueInitial(false);
93
95
  }
94
96
  if (showCalendarValueFinal) {
95
97
  if (targetElement.id !== 'valueFinal') {
96
- inputFinalRef.current?.focus();
98
+ var _inputFinalRef$curren;
99
+ (_inputFinalRef$curren = inputFinalRef.current) === null || _inputFinalRef$curren === void 0 ? void 0 : _inputFinalRef$curren.focus();
97
100
  }
98
101
  setShowCalendarValueFinal(false);
99
102
  }
100
103
  if (showPeriodSelection) {
104
+ var _inputFinalRef$curren2;
101
105
  setShowPeriodSelection(false);
102
- inputFinalRef.current?.focus();
106
+ (_inputFinalRef$curren2 = inputFinalRef.current) === null || _inputFinalRef$curren2 === void 0 ? void 0 : _inputFinalRef$curren2.focus();
103
107
  setShowCalendarValueFinal(false);
104
108
  }
105
109
  }
106
- if (calendarContainerRef.current && event && event.key && event.key === 'Tab') {
107
- const buttonForNavigateCalendar = calendarContainerRef.current?.getElementsByClassName('navbutton');
108
- const datePicked = calendarContainerRef.current?.getElementsByClassName('-selectedday');
109
- const buttonDatePicked = datePicked[0].firstChild;
110
- const buttonsForFocus = Array.from([...buttonForNavigateCalendar, buttonDatePicked]);
111
- const firstElement = buttonsForFocus[0];
112
- const lastElement = buttonsForFocus[buttonsForFocus.length - 1];
113
- const calendarOpenedIsInitial = calendarContainerRef.current.id === 'valueInitial';
114
- if (!event.shiftKey && showCalendarValueInitial && document.activeElement === inputInitialRef.current) {
115
- event.preventDefault();
116
- firstElement.focus();
117
- }
118
- if (event.shiftKey && calendarOpenedIsInitial && document.activeElement === firstElement) {
119
- event.preventDefault();
120
- inputInitialRef.current?.focus();
121
- }
122
- if (!event.shiftKey && calendarOpenedIsInitial && document.activeElement === lastElement) {
123
- event.preventDefault();
124
- inputFinalRef.current?.focus();
125
- }
126
- }
127
110
  event.stopPropagation();
128
111
  };
129
112
  const keepPositionCalendarByScroll = () => {
130
- const inputDateDimensions = inputContainerRef.current?.getBoundingClientRect();
113
+ var _inputContainerRef$cu2;
114
+ const inputDateDimensions = (_inputContainerRef$cu2 = inputContainerRef.current) === null || _inputContainerRef$cu2 === void 0 ? void 0 : _inputContainerRef$cu2.getBoundingClientRect();
131
115
  const positionTop = inputDateDimensions && inputDateDimensions.bottom;
132
116
  if (dropdownCalendarContainer && dropdownCalendarContainer.current && inputDateDimensions) {
133
117
  dropdownCalendarContainer.current.style.top = String(positionTop).concat('px');
134
118
  }
135
119
  };
136
- (0, _react.useEffect)(() => {
137
- window.addEventListener('resize', onScreenResize);
138
- document.addEventListener('scroll', keepPositionCalendarByScroll);
139
- document.getElementById('modal-dialog-content')?.addEventListener('scroll', keepPositionCalendarByScroll);
140
- if (inputContainerRef.current) onScreenResize();
141
- if (inputInitialRef && inputInitialRef.current) inputInitialRef.current.id = idValueInitial;
142
- if (inputFinalRef && inputFinalRef.current) inputFinalRef.current.id = idValueFinal;
143
- return () => {
144
- window.removeEventListener('resize', onScreenResize);
145
- document.removeEventListener('scroll', keepPositionCalendarByScroll);
146
- document.getElementById('modal-dialog-content')?.removeEventListener('scroll', keepPositionCalendarByScroll);
147
- };
148
- }, []);
149
- (0, _react.useEffect)(() => {
150
- document.addEventListener('keydown', onKeyDownPress);
151
- return () => {
152
- document.removeEventListener('keydown', onKeyDownPress);
153
- };
154
- }, [showCalendarValueFinal, showCalendarValueInitial, showPeriodSelection, calendarContainerRef.current]);
155
- (0, _react.useEffect)(() => {
156
- if (props.value && !((0, _moment.default)(props.value.initial).isSame(valueInitial) || (0, _moment.default)(props.value.final).isSame(valueFinal))) {
157
- const {
158
- initial: valueInitialProp,
159
- final: valueFinalProp
160
- } = props.value;
161
- let newValueInitial;
162
- let newValueFinal;
163
- if ((0, _moment.default)(valueInitialProp, 'YYYY-MM-DD', true).isValid()) {
164
- newValueInitial = (0, _moment.default)(valueInitialProp, 'YYYY-MM-DD');
165
- }
166
- if ((0, _moment.default)(valueFinalProp, 'YYYY-MM-DD', true).isValid()) {
167
- newValueFinal = (0, _moment.default)(valueFinalProp, 'YYYY-MM-DD');
168
- }
169
- setValueInitial(newValueInitial);
170
- setValueFinal(newValueFinal);
171
- }
172
- }, [props.value]);
173
120
  const openCalendar = calendarName => {
174
121
  if (calendarName === 'valueInitial') {
175
122
  setCurrentTypeDate('valueInitial');
176
123
  setShowCalendarValueFinal(false);
177
124
  if (!showCalendarValueInitial) {
178
- inputInitialRef.current?.focus();
125
+ var _inputInitialRef$curr2;
126
+ (_inputInitialRef$curr2 = inputInitialRef.current) === null || _inputInitialRef$curr2 === void 0 ? void 0 : _inputInitialRef$curr2.focus();
179
127
  if (showCalendarInDialog) {
180
128
  setTimeout(() => {
181
- currentDateButtonRef.current?.focus();
129
+ var _currentDateButtonRef;
130
+ (_currentDateButtonRef = currentDateButtonRef.current) === null || _currentDateButtonRef === void 0 ? void 0 : _currentDateButtonRef.focus();
182
131
  }, 100);
183
132
  }
184
133
  setShowCalendarValueInitial(true);
@@ -188,10 +137,12 @@ const PeriodPicker = props => {
188
137
  setCurrentTypeDate('valueFinal');
189
138
  setShowCalendarValueInitial(false);
190
139
  if (!showCalendarValueFinal) {
191
- inputFinalRef.current?.focus();
140
+ var _inputFinalRef$curren3;
141
+ (_inputFinalRef$curren3 = inputFinalRef.current) === null || _inputFinalRef$curren3 === void 0 ? void 0 : _inputFinalRef$curren3.focus();
192
142
  if (showCalendarInDialog) {
193
143
  setTimeout(() => {
194
- currentDateButtonRef.current?.focus();
144
+ var _currentDateButtonRef2;
145
+ (_currentDateButtonRef2 = currentDateButtonRef.current) === null || _currentDateButtonRef2 === void 0 ? void 0 : _currentDateButtonRef2.focus();
195
146
  }, 100);
196
147
  }
197
148
  setShowCalendarValueFinal(true);
@@ -203,27 +154,41 @@ const PeriodPicker = props => {
203
154
  };
204
155
  const closeCalendar = calendarName => {
205
156
  if (calendarName === 'valueInitial') {
206
- inputInitialRef.current?.focus();
157
+ var _inputInitialRef$curr3;
158
+ (_inputInitialRef$curr3 = inputInitialRef.current) === null || _inputInitialRef$curr3 === void 0 ? void 0 : _inputInitialRef$curr3.focus();
207
159
  }
208
160
  if (calendarName === 'valueFinal') {
209
- inputFinalRef.current?.focus();
161
+ var _inputFinalRef$curren4;
162
+ (_inputFinalRef$curren4 = inputFinalRef.current) === null || _inputFinalRef$curren4 === void 0 ? void 0 : _inputFinalRef$curren4.focus();
210
163
  }
211
164
  setShowCalendarValueInitial(false);
212
165
  setShowCalendarValueFinal(false);
213
166
  };
167
+ const onDateChange = date => {
168
+ var _props$onChange;
169
+ const initial = date.initial ? date.initial.format('YYYY-MM-DD') : '';
170
+ const final = date.final ? date.final.format('YYYY-MM-DD') : '';
171
+ props === null || props === void 0 ? void 0 : (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, undefined, '', {
172
+ initial,
173
+ final
174
+ });
175
+ };
214
176
  const onCloseDateDialog = calendarName => {
215
177
  setTimeout(() => {
216
178
  if (calendarName === 'valueInitial') {
217
- inputInitialRef.current?.focus();
179
+ var _inputInitialRef$curr4;
180
+ (_inputInitialRef$curr4 = inputInitialRef.current) === null || _inputInitialRef$curr4 === void 0 ? void 0 : _inputInitialRef$curr4.focus();
218
181
  setShowCalendarValueInitial(false);
219
182
  }
220
183
  if (calendarName === 'valueFinal') {
221
- inputFinalRef.current?.focus();
184
+ var _inputFinalRef$curren5;
185
+ (_inputFinalRef$curren5 = inputFinalRef.current) === null || _inputFinalRef$curren5 === void 0 ? void 0 : _inputFinalRef$curren5.focus();
222
186
  setShowCalendarValueFinal(false);
223
187
  }
224
188
  if (calendarName === 'periodSelection') {
189
+ var _inputFinalRef$curren6;
225
190
  setShowPeriodSelection(false);
226
- inputFinalRef.current?.focus();
191
+ (_inputFinalRef$curren6 = inputFinalRef.current) === null || _inputFinalRef$curren6 === void 0 ? void 0 : _inputFinalRef$curren6.focus();
227
192
  setShowCalendarValueFinal(false);
228
193
  }
229
194
  }, 100);
@@ -238,12 +203,13 @@ const PeriodPicker = props => {
238
203
  const onInputBlur = e => {
239
204
  if (props.onBlur) props.onBlur(e);
240
205
  };
241
- const onInputChange = (event, value) => {
206
+ const onInputChange = event => {
242
207
  if (event) {
243
208
  const {
244
- name: changingAux
209
+ name: changingAux,
210
+ value
245
211
  } = event.target;
246
- if (value && value.replace(/\D/g, '').trim().length !== 0) {
212
+ if (String(value).trim().length === 0) {
247
213
  if (changingAux === 'valueInitial') {
248
214
  setValueInitial(undefined);
249
215
  } else {
@@ -252,43 +218,24 @@ const PeriodPicker = props => {
252
218
  }
253
219
  }
254
220
  };
255
- const onDateChange = date => {
256
- if (props.onChange) {
257
- const initial = date.initial ? date.initial.format('YYYY-MM-DD') : '';
258
- const final = date.final ? date.final.format('YYYY-MM-DD') : '';
259
- props.onChange(undefined, '', {
260
- initial,
261
- final
262
- });
263
- }
264
- };
265
221
  const setValue = function (event, value) {
222
+ var _inputInitialRef$curr5, _inputFinalRef$curren7;
266
223
  let shouldOpenDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
267
224
  const valueDateName = event ? event.target.name : '';
268
225
  const dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
269
- if (showCalendarValueInitial) inputInitialRef.current?.focus();
270
- if (showCalendarValueFinal) inputFinalRef.current?.focus();
271
- if (valueDateName === 'valueFinal' && valueInitial && dateObj.isBefore(valueInitial)) {
272
- setValueInitial(dateObj);
273
- setValueFinal(valueInitial);
274
- onDateChange({
275
- initial: dateObj,
276
- final: valueInitial
277
- });
278
- } else if (valueDateName === 'valueInitial' && valueFinal && dateObj.isAfter(valueFinal)) {
279
- setValueInitial(valueFinal);
280
- setValueFinal(dateObj);
281
- onDateChange({
282
- initial: valueFinal,
283
- final: dateObj
284
- });
285
- } else if (valueDateName === 'valueInitial') {
226
+ if (showCalendarValueInitial) (_inputInitialRef$curr5 = inputInitialRef.current) === null || _inputInitialRef$curr5 === void 0 ? void 0 : _inputInitialRef$curr5.focus();
227
+ if (showCalendarValueFinal) (_inputFinalRef$curren7 = inputFinalRef.current) === null || _inputFinalRef$curren7 === void 0 ? void 0 : _inputFinalRef$curren7.focus();
228
+ if (valueDateName === 'valueInitial') {
286
229
  setValueInitial(dateObj);
287
230
  onDateChange({
288
231
  initial: dateObj,
289
232
  final: valueFinal
290
233
  });
291
234
  } else {
235
+ // if (valueFinal && valueInitial && moment(valueFinal).isBefore(moment(valueInitial))) {
236
+ // setValueInitial(valueFinal);
237
+ // setValueFinal(valueInitial);
238
+ // }
292
239
  setValueFinal(dateObj);
293
240
  onDateChange({
294
241
  initial: valueInitial,
@@ -296,7 +243,8 @@ const PeriodPicker = props => {
296
243
  });
297
244
  }
298
245
  if (valueDateName === 'valueInitial' && !valueFinal && shouldOpenDropdown) {
299
- inputFinalRef.current?.focus();
246
+ var _inputFinalRef$curren8;
247
+ (_inputFinalRef$curren8 = inputFinalRef.current) === null || _inputFinalRef$curren8 === void 0 ? void 0 : _inputFinalRef$curren8.focus();
300
248
  setTimeout(() => setShowCalendarValueFinal(true), 100);
301
249
  }
302
250
  if (shouldCloseOnSelect) {
@@ -346,8 +294,9 @@ const PeriodPicker = props => {
346
294
  }
347
295
  };
348
296
  const closePeriodSelection = () => {
297
+ var _inputFinalRef$curren9;
349
298
  setShowPeriodSelection(false);
350
- inputFinalRef.current?.focus();
299
+ (_inputFinalRef$curren9 = inputFinalRef.current) === null || _inputFinalRef$curren9 === void 0 ? void 0 : _inputFinalRef$curren9.focus();
351
300
  setShowCalendarValueFinal(false);
352
301
  };
353
302
  const getButtonSelectPeriod = (0, _react.useCallback)(() => {
@@ -380,8 +329,10 @@ const PeriodPicker = props => {
380
329
  currentDateButton: buttonElement => currentDateButtonRef.current = buttonElement
381
330
  });
382
331
  const setPeriodDates = (selected, dates) => {
332
+ var _inputFinalRef$curren0;
383
333
  if (selected === 'custom') {
384
- inputInitialRef.current?.focus();
334
+ var _inputInitialRef$curr6;
335
+ (_inputInitialRef$curr6 = inputInitialRef.current) === null || _inputInitialRef$curr6 === void 0 ? void 0 : _inputInitialRef$curr6.focus();
385
336
  setValuePeriodSelection(selected);
386
337
  setShowPeriodSelection(false);
387
338
  return;
@@ -394,7 +345,7 @@ const PeriodPicker = props => {
394
345
  if (shouldCloseOnSelect) {
395
346
  setShowPeriodSelection(false);
396
347
  }
397
- inputFinalRef.current?.focus();
348
+ (_inputFinalRef$curren0 = inputFinalRef.current) === null || _inputFinalRef$curren0 === void 0 ? void 0 : _inputFinalRef$curren0.focus();
398
349
  setShowCalendarValueFinal(false);
399
350
  };
400
351
  const getCalendarInitial = () => {
@@ -452,6 +403,58 @@ const PeriodPicker = props => {
452
403
  }
453
404
  }, getPeriodSelection(valuePeriodSelection, setPeriodDates));
454
405
  };
406
+ (0, _react.useEffect)(() => {
407
+ var _document$getElementB;
408
+ window.addEventListener('resize', onScreenResize);
409
+ document.addEventListener('scroll', keepPositionCalendarByScroll);
410
+ (_document$getElementB = document.getElementById('modal-dialog-content')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('scroll', keepPositionCalendarByScroll);
411
+ if (inputContainerRef.current) onScreenResize();
412
+ if (inputInitialRef && inputInitialRef.current) inputInitialRef.current.id = idValueInitial;
413
+ if (inputFinalRef && inputFinalRef.current) inputFinalRef.current.id = idValueFinal;
414
+ return () => {
415
+ var _document$getElementB2;
416
+ window.removeEventListener('resize', onScreenResize);
417
+ document.removeEventListener('scroll', keepPositionCalendarByScroll);
418
+ (_document$getElementB2 = document.getElementById('modal-dialog-content')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.removeEventListener('scroll', keepPositionCalendarByScroll);
419
+ };
420
+ }, []);
421
+ (0, _react.useEffect)(() => {
422
+ document.addEventListener('keydown', onKeyDownPress);
423
+ return () => {
424
+ document.removeEventListener('keydown', onKeyDownPress);
425
+ };
426
+ }, [showCalendarValueFinal, showCalendarValueInitial, showPeriodSelection, calendarContainerRef.current]);
427
+ (0, _react.useEffect)(() => {
428
+ if (valueFinal && valueInitial && (0, _moment.default)(valueFinal).isBefore((0, _moment.default)(valueInitial))) {
429
+ setValueInitial(valueFinal);
430
+ setValueFinal(valueInitial);
431
+ } else if (props.onChange) {
432
+ const initial = valueInitial ? valueInitial.format('YYYY-MM-DD') : '';
433
+ const final = valueFinal ? valueFinal.format('YYYY-MM-DD') : '';
434
+ props.onChange(undefined, '', {
435
+ initial,
436
+ final
437
+ });
438
+ }
439
+ }, [valueInitial, valueFinal]);
440
+ (0, _react.useEffect)(() => {
441
+ if (props.value && !((0, _moment.default)(props.value.initial).isSame(valueInitial) || (0, _moment.default)(props.value.final).isSame(valueFinal))) {
442
+ const {
443
+ initial: valueInitialProp,
444
+ final: valueFinalProp
445
+ } = props.value;
446
+ let newValueInitial;
447
+ let newValueFinal;
448
+ if ((0, _moment.default)(valueInitialProp, 'YYYY-MM-DD', true).isValid()) {
449
+ newValueInitial = (0, _moment.default)(valueInitialProp, 'YYYY-MM-DD');
450
+ }
451
+ if ((0, _moment.default)(valueFinalProp, 'YYYY-MM-DD', true).isValid()) {
452
+ newValueFinal = (0, _moment.default)(valueFinalProp, 'YYYY-MM-DD');
453
+ }
454
+ setValueInitial(newValueInitial);
455
+ setValueFinal(newValueFinal);
456
+ }
457
+ }, [props.value]);
455
458
  if (onDenied && onDenied.unvisible) return null;
456
459
  const component = () => /*#__PURE__*/_react.default.createElement("div", {
457
460
  ref: wrapperBaseInputPeriodRef,
@@ -469,7 +472,7 @@ const PeriodPicker = props => {
469
472
  display: 'flex'
470
473
  }
471
474
  }, /*#__PURE__*/_react.default.createElement("div", {
472
- className: `label ${props.customClassForLabel} ${props.labelUppercase && ' -uppercase'}`,
475
+ className: "label ".concat(props.customClassForLabel, " ").concat(props.labelUppercase && ' -uppercase'),
473
476
  style: {
474
477
  alignSelf: 'center'
475
478
  }
@@ -486,10 +489,10 @@ const PeriodPicker = props => {
486
489
  width: 20
487
490
  }
488
491
  }, hint))), /*#__PURE__*/_react.default.createElement(_textContent.default, null)), /*#__PURE__*/_react.default.createElement("div", {
489
- className: `periodpicker-component ${helperBase.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
492
+ className: "periodpicker-component ".concat(helperBase.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
490
493
  value: !valueInitial ? '' : (0, _moment.default)(valueInitial).format('DD/MM/YYYY'),
491
494
  disabled: shouldDisable()
492
- }))}`,
495
+ }))),
493
496
  ref: inputContainerRef
494
497
  }, /*#__PURE__*/_react.default.createElement(_BaseMask.default, {
495
498
  gridLayout: undefined,