linear-react-components-ui 1.1.26-beta-1 → 1.1.26-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 (225) hide show
  1. package/lib/alerts/AlertContainer.js +8 -2
  2. package/lib/alerts/AlertProvider.js +11 -5
  3. package/lib/alerts/BaseAlert.js +10 -8
  4. package/lib/alerts/Message.js +91 -64
  5. package/lib/alerts/withAlert.js +10 -6
  6. package/lib/assets/BaseAlert.css +1 -1
  7. package/lib/assets/Content.css +1 -1
  8. package/lib/assets/DefaultFile.css +1 -1
  9. package/lib/assets/Drawer.css +1 -1
  10. package/lib/assets/index11.css +1 -1
  11. package/lib/assets/index5.css +1 -1
  12. package/lib/avatar/index.js +29 -51
  13. package/lib/badge/index.js +25 -23
  14. package/lib/buttons/ActivateButton.js +9 -4
  15. package/lib/buttons/AddButton.js +12 -5
  16. package/lib/buttons/Button.js +16 -5
  17. package/lib/buttons/ButtonGroups.js +10 -3
  18. package/lib/buttons/CancelButton.js +14 -4
  19. package/lib/buttons/DangerButton.js +15 -4
  20. package/lib/buttons/DefaultButton.js +76 -111
  21. package/lib/buttons/DestroyButton.js +21 -5
  22. package/lib/buttons/EditButton.js +9 -4
  23. package/lib/buttons/InactivateButton.js +9 -4
  24. package/lib/buttons/InfoButton.js +15 -4
  25. package/lib/buttons/PrimaryButton.js +15 -4
  26. package/lib/buttons/RestoreButton.js +9 -4
  27. package/lib/buttons/SaveButton.js +14 -4
  28. package/lib/buttons/SuccessButton.js +15 -4
  29. package/lib/buttons/WarningButton.js +15 -4
  30. package/lib/buttons/button_container/index.js +21 -16
  31. package/lib/buttons/split_button/index.js +53 -55
  32. package/lib/calendar/DangerCalendar.js +18 -4
  33. package/lib/calendar/InfoCalendar.js +18 -4
  34. package/lib/calendar/PrimaryCalendar.js +18 -4
  35. package/lib/calendar/SuccessCalendar.js +18 -4
  36. package/lib/calendar/WarningCalendar.js +18 -4
  37. package/lib/calendar/base/Day.js +32 -22
  38. package/lib/calendar/base/Month.js +24 -21
  39. package/lib/calendar/base/Week.js +20 -19
  40. package/lib/calendar/base/helpers.js +11 -19
  41. package/lib/calendar/base/index.js +129 -97
  42. package/lib/checkbox/index.js +6 -5
  43. package/lib/chunks/compiler-runtime.Cu50tn6L.js +54 -0
  44. package/lib/chunks/{index.Da--18GT.js → index.Df3kt2LQ.js} +179 -181
  45. package/lib/chunks/index.aw0XaUkg.js +266 -0
  46. package/lib/chunks/jsx-runtime.D1SHvdVE.js +282 -0
  47. package/lib/chunks/lodash.CIAK_hAg.js +3684 -0
  48. package/lib/chunks/moment.DMLRxgRE.js +2589 -0
  49. package/lib/chunks/tabs.BvKfeA6Y.js +244 -0
  50. package/lib/chunks/v1.Ds1rkxUj.js +49 -0
  51. package/lib/dialog/Alert.js +18 -17
  52. package/lib/dialog/Custom.js +42 -28
  53. package/lib/dialog/Error.js +18 -17
  54. package/lib/dialog/Information.js +18 -17
  55. package/lib/dialog/Question.js +43 -59
  56. package/lib/dialog/Warning.js +18 -17
  57. package/lib/dialog/base/Content.js +13 -4
  58. package/lib/dialog/base/Footer.js +8 -3
  59. package/lib/dialog/base/Header.js +4 -3
  60. package/lib/dialog/base/index.js +5 -4
  61. package/lib/dialog/form/index.js +5 -4
  62. package/lib/dialog/index.js +1 -1
  63. package/lib/dialog/wizard/index.js +11 -10
  64. package/lib/dialog/wizard/progressbar.js +96 -3
  65. package/lib/dialog/wizard/step.js +4 -3
  66. package/lib/dialog/wizard/useWizard.js +42 -29
  67. package/lib/drawer/Content.js +15 -8
  68. package/lib/drawer/Drawer.js +38 -35
  69. package/lib/drawer/Header.js +53 -40
  70. package/lib/drawer/helpers.js +2 -2
  71. package/lib/dropdown/Popup.js +4 -2
  72. package/lib/dropdown/withDropdown.js +75 -50
  73. package/lib/fieldset/index.js +66 -47
  74. package/lib/form/Field.js +88 -62
  75. package/lib/form/FieldArray.js +18 -39
  76. package/lib/form/FieldNumber.js +42 -38
  77. package/lib/form/FieldPeriod.js +90 -59
  78. package/lib/form/helpers.js +14 -11
  79. package/lib/form/index.js +88 -100
  80. package/lib/form/withFieldHOC.js +57 -48
  81. package/lib/form/withFormSecurity.js +15 -18
  82. package/lib/gridlayout/GridCol.js +21 -20
  83. package/lib/gridlayout/GridRow.js +22 -20
  84. package/lib/hint/helpers.js +6 -2
  85. package/lib/hint/index.js +27 -25
  86. package/lib/icons/helper.js +142 -569
  87. package/lib/icons/index.js +62 -57
  88. package/lib/index.js +20 -19
  89. package/lib/inputs/base/InputTextBase.js +121 -207
  90. package/lib/inputs/base/Label.js +27 -29
  91. package/lib/inputs/base/helpers.d.ts +3 -3
  92. package/lib/inputs/base/helpers.js +4 -2
  93. package/lib/inputs/color/index.js +52 -73
  94. package/lib/inputs/date/Dialog.js +15 -16
  95. package/lib/inputs/date/Dropdown.js +16 -14
  96. package/lib/inputs/date/helpers.js +7 -7
  97. package/lib/inputs/date/index.js +101 -147
  98. package/lib/inputs/errorMessage/index.js +21 -13
  99. package/lib/inputs/file/DefaultFile.js +64 -67
  100. package/lib/inputs/file/DragDropFile.js +79 -135
  101. package/lib/inputs/file/File.d.ts +1 -1
  102. package/lib/inputs/file/File.js +24 -39
  103. package/lib/inputs/file/FileButtonSettings.js +20 -17
  104. package/lib/inputs/inputHOC.js +38 -20
  105. package/lib/inputs/mask/BaseMask.js +51 -30
  106. package/lib/inputs/mask/Cnpj.js +42 -36
  107. package/lib/inputs/mask/Cpf.js +45 -33
  108. package/lib/inputs/mask/Phone.js +10 -6
  109. package/lib/inputs/mask/ZipCode.js +9 -4
  110. package/lib/inputs/mask/helpers.d.ts +33 -33
  111. package/lib/inputs/mask/helpers.js +44 -44
  112. package/lib/inputs/multiSelect/ActionButtons.js +35 -46
  113. package/lib/inputs/multiSelect/Dropdown.js +94 -133
  114. package/lib/inputs/multiSelect/helper.js +4 -7
  115. package/lib/inputs/multiSelect/index.js +167 -127
  116. package/lib/inputs/number/BaseNumber.js +43 -31
  117. package/lib/inputs/number/Currency.js +19 -12
  118. package/lib/inputs/number/Decimal.js +9 -4
  119. package/lib/inputs/number/index.js +31 -35
  120. package/lib/inputs/period/Dialog.js +16 -16
  121. package/lib/inputs/period/Dropdown.js +15 -15
  122. package/lib/inputs/period/PeriodList.js +41 -27
  123. package/lib/inputs/period/helper.js +8 -4
  124. package/lib/inputs/period/index.js +192 -330
  125. package/lib/inputs/search/index.js +95 -71
  126. package/lib/inputs/select/ActionButtons.js +24 -45
  127. package/lib/inputs/select/Dropdown.js +61 -110
  128. package/lib/inputs/select/helper.d.ts +1 -1
  129. package/lib/inputs/select/helper.js +43 -45
  130. package/lib/inputs/select/index.js +23 -25
  131. package/lib/inputs/select/multiple/Selecteds.js +23 -19
  132. package/lib/inputs/select/multiple/index.js +106 -176
  133. package/lib/inputs/select/simple/index.js +126 -196
  134. package/lib/inputs/text/index.js +9 -4
  135. package/lib/inputs/textarea/index.js +13 -15
  136. package/lib/internals/withTooltip.js +114 -67
  137. package/lib/labelMessages/index.js +50 -45
  138. package/lib/labels/DangerLabel.js +18 -4
  139. package/lib/labels/DefaultLabel.js +53 -39
  140. package/lib/labels/InfoLabel.js +18 -4
  141. package/lib/labels/PrimaryLabel.js +18 -4
  142. package/lib/labels/SuccessLabel.js +18 -4
  143. package/lib/labels/WarningLabel.js +18 -4
  144. package/lib/labels/label_container/index.js +15 -9
  145. package/lib/list/Header.js +18 -6
  146. package/lib/list/Item.js +5 -4
  147. package/lib/list/Separator.js +8 -3
  148. package/lib/list/helpers.js +2 -2
  149. package/lib/list/index.js +21 -18
  150. package/lib/menus/float/MenuItem.js +49 -52
  151. package/lib/menus/float/SubMenuContainer.d.ts +10 -10
  152. package/lib/menus/float/index.js +102 -81
  153. package/lib/menus/sidenav/ExpandMenu.js +17 -15
  154. package/lib/menus/sidenav/MenuLink.js +21 -14
  155. package/lib/menus/sidenav/NavMenuGroup.js +19 -14
  156. package/lib/menus/sidenav/NavMenuItem.js +131 -111
  157. package/lib/menus/sidenav/NavSubMenuItem.js +36 -20
  158. package/lib/menus/sidenav/helpers.js +4 -4
  159. package/lib/menus/sidenav/index.js +145 -123
  160. package/lib/menus/sidenav/popup_menu_search/EmptyList.js +21 -17
  161. package/lib/menus/sidenav/popup_menu_search/index.js +17 -51
  162. package/lib/noPermission/index.js +13 -8
  163. package/lib/panel/Content.js +49 -40
  164. package/lib/panel/DangerPanel.js +10 -5
  165. package/lib/panel/Default.js +62 -36
  166. package/lib/panel/Header.js +53 -37
  167. package/lib/panel/InfoPanel.js +10 -5
  168. package/lib/panel/PrimaryPanel.js +10 -5
  169. package/lib/panel/SuccessPanel.js +10 -5
  170. package/lib/panel/ToolBar.js +17 -4
  171. package/lib/panel/WarningPanel.js +10 -5
  172. package/lib/panel/helpers.js +8 -5
  173. package/lib/permissionValidations.js +15 -11
  174. package/lib/popover/PopoverText.js +12 -5
  175. package/lib/popover/PopoverTitle.js +10 -3
  176. package/lib/popover/index.js +36 -56
  177. package/lib/progress/Bar.js +43 -34
  178. package/lib/progress/index.js +23 -18
  179. package/lib/radio/index.js +105 -89
  180. package/lib/shortcuts/index.js +20 -7
  181. package/lib/skeleton/SkeletonContainer.js +16 -6
  182. package/lib/skeleton/index.js +42 -18
  183. package/lib/spinner/SpinnerLoading.js +53 -16
  184. package/lib/spinner/index.js +47 -37
  185. package/lib/split/Split.js +83 -79
  186. package/lib/split/SplitSide.js +24 -16
  187. package/lib/table/Body.js +36 -49
  188. package/lib/table/Header.js +45 -35
  189. package/lib/table/HeaderColumn.js +40 -27
  190. package/lib/table/Row.js +47 -48
  191. package/lib/table/RowColumn.js +50 -38
  192. package/lib/table/helpers.js +3 -1
  193. package/lib/table/index.js +101 -104
  194. package/lib/tabs/DropdownTabs.js +64 -61
  195. package/lib/tabs/Menu.js +35 -49
  196. package/lib/tabs/MenuTabs.js +59 -84
  197. package/lib/tabs/Panel.js +57 -47
  198. package/lib/tabs/context.js +36 -40
  199. package/lib/tabs/index.js +69 -64
  200. package/lib/tabs/tabHelpers.js +10 -8
  201. package/lib/textContent/index.js +30 -32
  202. package/lib/toolbar/ButtonBar.js +62 -58
  203. package/lib/toolbar/LabelBar.js +46 -38
  204. package/lib/toolbar/Separator.js +8 -3
  205. package/lib/toolbar/ToolBarGroup.js +14 -3
  206. package/lib/toolbar/index.js +35 -29
  207. package/lib/tooltip/index.js +24 -24
  208. package/lib/treetable/Body.js +26 -27
  209. package/lib/treetable/Header.js +23 -19
  210. package/lib/treetable/Row.js +210 -147
  211. package/lib/treetable/helpers.d.ts +4 -5
  212. package/lib/treetable/helpers.js +6 -14
  213. package/lib/treetable/index.js +25 -15
  214. package/lib/treeview/Header.js +13 -5
  215. package/lib/treeview/Node.js +198 -175
  216. package/lib/treeview/index.js +257 -174
  217. package/lib/uitour/index.js +167 -166
  218. package/package.json +32 -43
  219. package/lib/chunks/index.CmrLK9Qe.js +0 -675
  220. package/lib/chunks/index.D5f6Ow9V.js +0 -89
  221. package/lib/chunks/index.yztgndLc.js +0 -206
  222. package/lib/chunks/jsx-runtime.CYK1ROHF.js +0 -445
  223. package/lib/chunks/tabs.Cvj2MJH6.js +0 -246
  224. package/lib/chunks/v1.CDXKvGzE.js +0 -41
  225. /package/lib/assets/{index29.css → progressbar.css} +0 -0
@@ -1,351 +1,213 @@
1
- import { j as r } from "../../chunks/jsx-runtime.CYK1ROHF.js";
2
- import { useId as ve, useState as Y, useRef as h, useEffect as V, useCallback as Ce } from "react";
3
- import s from "moment";
4
- import qe from "./PeriodList.js";
5
- import De from "../mask/BaseMask.js";
6
- import _ from "./Dropdown.js";
7
- import Ne from "../../calendar/base/index.js";
8
- import Ye from "../../buttons/Button.js";
9
- import G from "../../icons/index.js";
1
+ import { j as i } from "../../chunks/jsx-runtime.D1SHvdVE.js";
2
+ import { useId as fe, useState as D, useRef as g, useEffect as k, useCallback as de } from "react";
3
+ import { h as r } from "../../chunks/moment.DMLRxgRE.js";
4
+ import ke from "./PeriodList.js";
5
+ import me from "../mask/BaseMask.js";
6
+ import U from "./Dropdown.js";
7
+ import Oe from "../../calendar/base/index.js";
8
+ import "../../chunks/compiler-runtime.Cu50tn6L.js";
9
+ import ge from "../../buttons/Button.js";
10
+ import W from "../../icons/index.js";
10
11
  import '../../assets/gridlayout.css';import '../../assets/button.css';import '../../assets/index24.css';/* empty css */
11
- import H from "./Dialog.js";
12
- import ze from "../../hint/index.js";
12
+ import $ from "./Dialog.js";
13
+ import Le from "../../hint/index.js";
13
14
  /* empty css */
14
- import Ke from "../../gridlayout/GridCol.js";
15
- import { getInputWrapperClass as Ue } from "../base/helpers.js";
16
- import { ErrorMessage as We } from "../errorMessage/index.js";
17
- import pe from "../../textContent/index.js";
18
- import $e from "../../popover/index.js";
19
- const mn = (t) => {
15
+ import Ve from "../../gridlayout/GridCol.js";
16
+ import { getInputWrapperClass as Te } from "../base/helpers.js";
17
+ import { ErrorMessage as Ae } from "../errorMessage/index.js";
18
+ import he from "../../textContent/index.js";
19
+ import qe from "../../popover/index.js";
20
+ const on = (n) => {
20
21
  const {
21
- showButtonOpen: P = !0,
22
- openOnFocus: xe = !0,
23
- shouldCloseOnSelect: J = !0,
24
- calendarColorStyle: R,
22
+ showButtonOpen: j = !0,
23
+ openOnFocus: ve = !0,
24
+ shouldCloseOnSelect: G = !0,
25
+ calendarColorStyle: S,
25
26
  showCalendarInDialog: b = !1,
26
- dialogSize: T = { width: "350px", height: "350px" },
27
- hint: E,
28
- hintPosition: Q = "below",
29
- themePopover: be = "light",
30
- popoverAlign: Ie = "left",
31
- gridLayout: X
32
- } = t, Fe = ve(), we = ve(), [a, I] = Y(t.value && s(t.value.initial, "DD/MM/YYYY")), [o, F] = Y(t.value && s(t.value.final, "DD/MM/YYYY")), [Z, ee] = Y("week"), [v, C] = Y(!1), [p, c] = Y(!1), [y, x] = Y(!1), [A, q] = Y(), [D, ne] = Y(), [te, ie] = Y("valueInitial"), M = h(null), g = h(null), m = h(null), ye = h(null), N = h(null), Me = h(null), w = h(null);
33
- h(null);
34
- const u = h(null), f = h(null), z = () => {
35
- var e;
36
- q((e = g == null ? void 0 : g.current) == null ? void 0 : e.getBoundingClientRect());
37
- }, je = (e) => {
38
- var i;
39
- const n = !((i = M.current) != null && i.contains(e.relatedTarget));
40
- !b && v && n && C(!1), !b && p && n && c(!1);
41
- }, le = (e) => {
42
- var l, d, j, S, B, de, me;
43
- const { target: n } = e, i = n;
44
- if (f.current && e && e.key && e.key === "Escape" && (e.preventDefault(), i.focus(), v && (i.id !== "valueInitial" && ((l = m.current) == null || l.focus()), C(!1)), p && (i.id !== "valueFinal" && ((d = u.current) == null || d.focus()), c(!1)), y && (x(!1), (j = u.current) == null || j.focus(), c(!1))), f.current && e && e.key && e.key === "Tab") {
45
- const Ve = (S = f.current) == null ? void 0 : S.getElementsByClassName("navbutton"), Te = ((B = f.current) == null ? void 0 : B.getElementsByClassName("-selectedday"))[0].firstChild, $ = Array.from([...Ve, Te]), ge = $[0], Ae = $[$.length - 1], he = f.current.id === "valueInitial";
46
- !e.shiftKey && v && document.activeElement === m.current && (e.preventDefault(), ge.focus()), e.shiftKey && he && document.activeElement === ge && (e.preventDefault(), (de = m.current) == null || de.focus()), !e.shiftKey && he && document.activeElement === Ae && (e.preventDefault(), (me = u.current) == null || me.focus());
27
+ dialogSize: O = {
28
+ width: "350px",
29
+ height: "350px"
30
+ },
31
+ hint: B,
32
+ hintPosition: H = "below",
33
+ themePopover: Ce = "light",
34
+ popoverAlign: De = "left",
35
+ gridLayout: J
36
+ } = n, Ye = fe(), pe = fe(), [l, I] = D(n.value && r(n.value.initial, "DD/MM/YYYY")), [a, F] = D(n.value && r(n.value.final, "DD/MM/YYYY")), [Q, X] = D("week"), [h, v] = D(!1), [Y, u] = D(!1), [y, p] = D(!1), [L, V] = D(), [C, Z] = D(), [_, ee] = D("valueInitial"), M = g(null), x = g(null), d = g(null), xe = g(null), T = g(null), be = g(null), w = g(null);
37
+ g(null);
38
+ const o = g(null), f = g(null), A = () => {
39
+ V(x?.current?.getBoundingClientRect());
40
+ }, Ie = (e) => {
41
+ const t = !M.current?.contains(e.relatedTarget);
42
+ !b && h && t && v(!1), !b && Y && t && u(!1);
43
+ }, ne = (e) => {
44
+ const {
45
+ target: t
46
+ } = e, c = t;
47
+ if (f.current && e && e.key && e.key === "Escape" && (e.preventDefault(), c.focus(), h && (c.id !== "valueInitial" && d.current?.focus(), v(!1)), Y && (c.id !== "valueFinal" && o.current?.focus(), u(!1)), y && (p(!1), o.current?.focus(), u(!1))), f.current && e && e.key && e.key === "Tab") {
48
+ const s = f.current?.getElementsByClassName("navbutton"), Re = (f.current?.getElementsByClassName("-selectedday"))[0].firstChild, K = Array.from([...s, Re]), ue = K[0], Ee = K[K.length - 1], ce = f.current.id === "valueInitial";
49
+ !e.shiftKey && h && document.activeElement === d.current && (e.preventDefault(), ue.focus()), e.shiftKey && ce && document.activeElement === ue && (e.preventDefault(), d.current?.focus()), !e.shiftKey && ce && document.activeElement === Ee && (e.preventDefault(), o.current?.focus());
47
50
  }
48
51
  e.stopPropagation();
49
- }, k = () => {
50
- var i;
51
- const e = (i = g.current) == null ? void 0 : i.getBoundingClientRect(), n = e && e.bottom;
52
- w && w.current && e && (w.current.style.top = String(n).concat("px"));
52
+ }, P = () => {
53
+ const e = x.current?.getBoundingClientRect(), t = e && e.bottom;
54
+ w && w.current && e && (w.current.style.top = String(t).concat("px"));
53
55
  };
54
- V(() => {
55
- var e;
56
- return window.addEventListener("resize", z), document.addEventListener("scroll", k), (e = document.getElementById("modal-dialog-content")) == null || e.addEventListener("scroll", k), g.current && z(), m && m.current && (m.current.id = Fe), u && u.current && (u.current.id = we), () => {
57
- var n;
58
- window.removeEventListener("resize", z), document.removeEventListener("scroll", k), (n = document.getElementById("modal-dialog-content")) == null || n.removeEventListener("scroll", k);
59
- };
60
- }, []), V(() => (document.addEventListener("keydown", le), () => {
61
- document.removeEventListener("keydown", le);
62
- }), [
63
- p,
64
- v,
65
- y,
66
- f.current
67
- ]), V(() => {
68
- if (o && a && s(o).isBefore(s(a)))
69
- I(o), F(a);
70
- else if (t.onChange) {
71
- const e = a ? a.format("YYYY-MM-DD") : "", n = o ? o.format("YYYY-MM-DD") : "";
72
- t.onChange(void 0, "", { initial: e, final: n });
56
+ k(() => (window.addEventListener("resize", A), document.addEventListener("scroll", P), document.getElementById("modal-dialog-content")?.addEventListener("scroll", P), x.current && A(), d && d.current && (d.current.id = Ye), o && o.current && (o.current.id = pe), () => {
57
+ window.removeEventListener("resize", A), document.removeEventListener("scroll", P), document.getElementById("modal-dialog-content")?.removeEventListener("scroll", P);
58
+ }), []), k(() => (document.addEventListener("keydown", ne), () => {
59
+ document.removeEventListener("keydown", ne);
60
+ }), [Y, h, y, f.current]), k(() => {
61
+ if (a && l && r(a).isBefore(r(l)))
62
+ I(a), F(l);
63
+ else if (n.onChange) {
64
+ const e = l ? l.format("YYYY-MM-DD") : "", t = a ? a.format("YYYY-MM-DD") : "";
65
+ n.onChange(void 0, "", {
66
+ initial: e,
67
+ final: t
68
+ });
73
69
  }
74
- }, [a, o]), V(() => {
75
- if (t.value && !(s(t.value.initial).isSame(a) || s(t.value.final).isSame(o))) {
76
- const { initial: e, final: n } = t.value;
77
- let i, l;
78
- s(e, "YYYY-MM-DD", !0).isValid() && (i = s(e, "YYYY-MM-DD")), s(n, "YYYY-MM-DD", !0).isValid() && (l = s(n, "YYYY-MM-DD")), I(i), F(l);
70
+ }, [l, a]), k(() => {
71
+ if (n.value && !(r(n.value.initial).isSame(l) || r(n.value.final).isSame(a))) {
72
+ const {
73
+ initial: e,
74
+ final: t
75
+ } = n.value;
76
+ let c, s;
77
+ r(e, "YYYY-MM-DD", !0).isValid() && (c = r(e, "YYYY-MM-DD")), r(t, "YYYY-MM-DD", !0).isValid() && (s = r(t, "YYYY-MM-DD")), I(c), F(s);
79
78
  }
80
- }, [t.value]);
81
- const re = (e) => {
82
- var n, i;
83
- e === "valueInitial" && (ie("valueInitial"), c(!1), v || ((n = m.current) == null || n.focus(), b && setTimeout(() => {
84
- var l;
85
- (l = N.current) == null || l.focus();
86
- }, 100), C(!0))), e === "valueFinal" && (ie("valueFinal"), C(!1), p || ((i = u.current) == null || i.focus(), b && setTimeout(() => {
87
- var l;
88
- (l = N.current) == null || l.focus();
89
- }, 100), c(!0))), g.current && q(g.current.getBoundingClientRect());
90
- }, Se = (e) => {
91
- var n, i;
92
- e === "valueInitial" && ((n = m.current) == null || n.focus()), e === "valueFinal" && ((i = u.current) == null || i.focus()), C(!1), c(!1);
93
- }, K = (e) => {
79
+ }, [n.value]);
80
+ const te = (e) => {
81
+ e === "valueInitial" && (ee("valueInitial"), u(!1), h || (d.current?.focus(), b && setTimeout(() => {
82
+ T.current?.focus();
83
+ }, 100), v(!0))), e === "valueFinal" && (ee("valueFinal"), v(!1), Y || (o.current?.focus(), b && setTimeout(() => {
84
+ T.current?.focus();
85
+ }, 100), u(!0))), x.current && V(x.current.getBoundingClientRect());
86
+ }, Fe = (e) => {
87
+ e === "valueInitial" && d.current?.focus(), e === "valueFinal" && o.current?.focus(), v(!1), u(!1);
88
+ }, q = (e) => {
94
89
  setTimeout(() => {
95
- var n, i, l;
96
- e === "valueInitial" && ((n = m.current) == null || n.focus(), C(!1)), e === "valueFinal" && ((i = u.current) == null || i.focus(), c(!1)), e === "periodSelection" && (x(!1), (l = u.current) == null || l.focus(), c(!1));
90
+ e === "valueInitial" && (d.current?.focus(), v(!1)), e === "valueFinal" && (o.current?.focus(), u(!1)), e === "periodSelection" && (p(!1), o.current?.focus(), u(!1));
97
91
  }, 100);
98
- }, ae = (e) => {
99
- const { name: n } = e.target;
100
- xe && re(n), t.onFocus && t.onFocus(e);
101
- }, oe = (e) => {
102
- t.onBlur && t.onBlur(e);
103
- }, se = (e, n) => {
92
+ }, ie = (e) => {
93
+ const {
94
+ name: t
95
+ } = e.target;
96
+ ve && te(t), n.onFocus && n.onFocus(e);
97
+ }, le = (e) => {
98
+ n.onBlur && n.onBlur(e);
99
+ }, ae = (e, t) => {
104
100
  if (e) {
105
- const { name: i } = e.target;
106
- n && n.replace(/\D/g, "").trim().length !== 0 && (i === "valueInitial" ? I(void 0) : F(void 0));
101
+ const {
102
+ name: c
103
+ } = e.target;
104
+ t && t.replace(/\D/g, "").trim().length !== 0 && (c === "valueInitial" ? I(void 0) : F(void 0));
107
105
  }
108
- }, O = (e) => {
109
- if (t.onChange) {
110
- const n = e.initial ? e.initial.format("YYYY-MM-DD") : "", i = e.final ? e.final.format("YYYY-MM-DD") : "";
111
- t.onChange(void 0, "", { initial: n, final: i });
106
+ }, R = (e) => {
107
+ if (n.onChange) {
108
+ const t = e.initial ? e.initial.format("YYYY-MM-DD") : "", c = e.final ? e.final.format("YYYY-MM-DD") : "";
109
+ n.onChange(void 0, "", {
110
+ initial: t,
111
+ final: c
112
+ });
112
113
  }
113
- }, U = (e, n, i = !0) => {
114
- var j, S, B;
115
- const l = e ? e.target.name : "", d = s(n, "DD/MM/YYYY");
116
- v && ((j = m.current) == null || j.focus()), p && ((S = u.current) == null || S.focus()), l === "valueFinal" && a && d.isBefore(a) ? (I(d), F(a), O({ initial: d, final: a })) : l === "valueInitial" && o && d.isAfter(o) ? (I(o), F(d), O({ initial: o, final: d })) : l === "valueInitial" ? (I(d), O({ initial: d, final: o })) : (F(d), O({ initial: a, final: d })), l === "valueInitial" && !o && i && ((B = u.current) == null || B.focus(), setTimeout(() => c(!0), 100)), J && (C(!1), c(!1));
117
- }, W = () => {
118
- const { disabled: e } = t;
119
- return e || D && (D.disabled || D.hideContent);
120
- }, Be = Ce(() => P ? /* @__PURE__ */ r.jsx(
121
- Ye,
122
- {
123
- boxShadow: !1,
124
- disabled: W(),
125
- customClass: "calendar-button",
126
- icon: /* @__PURE__ */ r.jsx(G, { name: "calendar" }),
127
- onClick: () => {
128
- p || v ? Se(te) : re(te);
129
- },
130
- tabIndex: -1,
131
- targetRef: (e) => {
132
- ye.current = e;
133
- }
134
- },
135
- "button-open"
136
- ) : null, [p, v]), ue = (e, n) => /* @__PURE__ */ r.jsx(qe, { selected: e, handleOnSelect: n }), Pe = () => {
137
- c(!1), C(!1), x(!0), g.current && q(g.current.getBoundingClientRect());
138
- }, Re = () => {
139
- var e;
140
- x(!1), (e = u.current) == null || e.focus(), c(!1);
141
- }, Ee = Ce(() => /* @__PURE__ */ r.jsx(
142
- Ye,
143
- {
144
- disabled: W(),
145
- tabIndex: -1,
146
- customClass: "calendar-button",
147
- icon: /* @__PURE__ */ r.jsx(G, { name: "more1" }),
148
- onBlur: () => setTimeout(() => x(!1), 100),
149
- onClick: () => y ? Re() : Pe(),
150
- targetRef: (e) => {
151
- Me.current = e;
152
- }
153
- },
154
- "button-select-period"
155
- ), [y]), L = (e, n, i) => /* @__PURE__ */ r.jsx(
156
- Ne,
157
- {
158
- colorStyle: n,
159
- currentDate: e !== void 0 ? s(e) : s(),
160
- calendarContainer: (l) => {
161
- f.current = l;
162
- },
163
- onDateChange: (l) => U({ target: { name: i } }, l),
164
- currentDateButton: (l) => N.current = l
114
+ }, N = (e, t, c = !0) => {
115
+ const s = e ? e.target.name : "", m = r(t, "DD/MM/YYYY");
116
+ h && d.current?.focus(), Y && o.current?.focus(), s === "valueFinal" && l && m.isBefore(l) ? (I(m), F(l), R({
117
+ initial: m,
118
+ final: l
119
+ })) : s === "valueInitial" && a && m.isAfter(a) ? (I(a), F(m), R({
120
+ initial: a,
121
+ final: m
122
+ })) : s === "valueInitial" ? (I(m), R({
123
+ initial: m,
124
+ final: a
125
+ })) : (F(m), R({
126
+ initial: l,
127
+ final: m
128
+ })), s === "valueInitial" && !a && c && (o.current?.focus(), setTimeout(() => u(!0), 100)), G && (v(!1), u(!1));
129
+ }, z = () => {
130
+ const {
131
+ disabled: e
132
+ } = n;
133
+ return e || C && (C.disabled || C.hideContent);
134
+ }, we = de(() => j ? /* @__PURE__ */ i.jsx(ge, { boxShadow: !1, disabled: z(), customClass: "calendar-button", icon: /* @__PURE__ */ i.jsx(W, { name: "calendar" }), onClick: () => {
135
+ Y || h ? Fe(_) : te(_);
136
+ }, tabIndex: -1, targetRef: (e) => {
137
+ xe.current = e;
138
+ } }, "button-open") : null, [Y, h]), re = (e, t) => /* @__PURE__ */ i.jsx(ke, { selected: e, handleOnSelect: t }), ye = () => {
139
+ u(!1), v(!1), p(!0), x.current && V(x.current.getBoundingClientRect());
140
+ }, Me = () => {
141
+ p(!1), o.current?.focus(), u(!1);
142
+ }, je = de(() => /* @__PURE__ */ i.jsx(ge, { disabled: z(), tabIndex: -1, customClass: "calendar-button", icon: /* @__PURE__ */ i.jsx(W, { name: "more1" }), onBlur: () => setTimeout(() => p(!1), 100), onClick: () => y ? Me() : ye(), targetRef: (e) => {
143
+ be.current = e;
144
+ } }, "button-select-period"), [y]), E = (e, t, c) => /* @__PURE__ */ i.jsx(Oe, { colorStyle: t, currentDate: e !== void 0 ? r(e) : r(), calendarContainer: (s) => {
145
+ f.current = s;
146
+ }, onDateChange: (s) => N({
147
+ target: {
148
+ name: c
165
149
  }
166
- ), ce = (e, n) => {
167
- var i, l;
150
+ }, s), currentDateButton: (s) => T.current = s }), oe = (e, t) => {
168
151
  if (e === "custom") {
169
- (i = m.current) == null || i.focus(), ee(e), x(!1);
152
+ d.current?.focus(), X(e), p(!1);
170
153
  return;
171
154
  }
172
- ee(e), n && (I(n[0]), F(n[1])), J && x(!1), (l = u.current) == null || l.focus(), c(!1);
173
- }, ke = () => D && D.readOnly ? null : (f && f.current && (f.current.id = "valueInitial"), b ? /* @__PURE__ */ r.jsx(
174
- H,
175
- {
176
- handlerClose: () => K("valueInitial"),
177
- dialogSize: T,
178
- onOpenChange: C,
179
- children: L(a, R, "valueInitial")
180
- }
181
- ) : /* @__PURE__ */ r.jsx(
182
- _,
183
- {
184
- containerRef: M,
185
- showButtonOpen: P,
186
- inputDimensions: A,
187
- dropdownRef: (e) => {
188
- w.current = e;
189
- },
190
- children: L(a, R, "valueInitial")
191
- }
192
- )), Oe = () => D && D.readOnly ? null : (f && f.current && (f.current.id = "valueFinal"), b ? /* @__PURE__ */ r.jsx(
193
- H,
194
- {
195
- handlerClose: () => K("valueFinal"),
196
- dialogSize: T,
197
- onOpenChange: c,
198
- children: L(o, R, "valueFinal")
199
- }
200
- ) : /* @__PURE__ */ r.jsx(
201
- _,
202
- {
203
- containerRef: M,
204
- showButtonOpen: P,
205
- inputDimensions: A,
206
- dropdownRef: (e) => {
207
- w.current = e;
208
- },
209
- children: L(o, R, "valueFinal")
210
- }
211
- )), Le = () => b ? /* @__PURE__ */ r.jsx(
212
- H,
213
- {
214
- handlerClose: () => K("periodSelection"),
215
- dialogSize: T,
216
- onOpenChange: x,
217
- children: ue(Z, ce)
218
- }
219
- ) : /* @__PURE__ */ r.jsx(
220
- _,
221
- {
222
- containerRef: M,
223
- showButtonOpen: P,
224
- inputDimensions: A,
225
- dropdownRef: (e) => {
226
- w.current = e;
227
- },
228
- children: ue(Z, ce)
229
- }
230
- );
231
- if (D && D.unvisible) return null;
232
- const fe = () => /* @__PURE__ */ r.jsxs(
233
- "div",
234
- {
235
- ref: M,
236
- onBlur: je,
237
- className: "input-base-component datepicker-period-container",
238
- children: [
239
- t.label && /* @__PURE__ */ r.jsxs("div", { className: "labelcontainer", children: [
240
- /* @__PURE__ */ r.jsx(
241
- pe,
242
- {
243
- required: t.required,
244
- className: t.customClassForLabel,
245
- labelUppercase: t.labelUppercase
246
- }
247
- ),
248
- /* @__PURE__ */ r.jsx(
249
- "div",
250
- {
251
- className: "text-content",
252
- style: { display: "flex" },
253
- children: /* @__PURE__ */ r.jsxs(
254
- "div",
255
- {
256
- className: `label ${t.customClassForLabel} ${t.labelUppercase && " -uppercase"}`,
257
- style: { alignSelf: "center" },
258
- children: [
259
- t.label,
260
- t.required && /* @__PURE__ */ r.jsx("span", { className: "-requiredlabel", children: "*" }),
261
- !!E && Q === "onLabelRight" && /* @__PURE__ */ r.jsx(
262
- $e,
263
- {
264
- theme: be,
265
- align: Ie,
266
- iconColor: "#03bde2",
267
- customClass: "-hint",
268
- style: { margin: "0px 5px", height: "auto", width: 20 },
269
- children: E
270
- }
271
- )
272
- ]
273
- }
274
- )
275
- }
276
- ),
277
- /* @__PURE__ */ r.jsx(pe, {})
278
- ] }),
279
- /* @__PURE__ */ r.jsxs(
280
- "div",
281
- {
282
- className: `periodpicker-component ${Ue({
283
- ...t,
284
- value: a ? s(a).format("DD/MM/YYYY") : "",
285
- disabled: W()
286
- })}`,
287
- ref: g,
288
- children: [
289
- /* @__PURE__ */ r.jsx(
290
- De,
291
- {
292
- gridLayout: void 0,
293
- permissionAttr: t.permissionAttr,
294
- name: "valueInitial",
295
- value: a ? s(a).format("DD/MM/YYYY") : "",
296
- mask: "00/00/0000",
297
- onComplete: (e) => {
298
- U(e, e.target.value, !0);
299
- },
300
- onFocus: ae,
301
- onBlur: (e) => oe(e),
302
- onChange: se,
303
- inputRef: (e) => {
304
- m.current = e;
305
- },
306
- handlerSetOnDenied: (e) => {
307
- ne(e);
308
- },
309
- required: t.required
310
- }
311
- ),
312
- /* @__PURE__ */ r.jsx(G, { name: "arrow_right", customClass: "separation_icon" }),
313
- /* @__PURE__ */ r.jsx(
314
- De,
315
- {
316
- gridLayout: void 0,
317
- permissionAttr: t.permissionAttr,
318
- name: "valueFinal",
319
- value: o ? s(o).format("DD/MM/YYYY") : "",
320
- mask: "00/00/0000",
321
- onComplete: (e) => {
322
- U(e, e.target.value, !0);
323
- },
324
- onFocus: ae,
325
- onBlur: (e) => oe(e),
326
- onChange: se,
327
- inputRef: (e) => {
328
- u.current = e;
329
- },
330
- handlerSetOnDenied: (e) => ne(e),
331
- required: t.required
332
- }
333
- ),
334
- Be(),
335
- Ee()
336
- ]
337
- }
338
- ),
339
- v && ke(),
340
- p && Oe(),
341
- y && Le(),
342
- /* @__PURE__ */ r.jsx(ze, { visible: !!E && Q === "below", customClass: "hint", description: E }),
343
- /* @__PURE__ */ r.jsx(We, { messages: t.errorMessages })
344
- ]
345
- }
346
- );
347
- return X ? /* @__PURE__ */ r.jsx(Ke, { customClass: "-withinput", cols: X, children: fe() }) : fe();
155
+ X(e), t && (I(t[0]), F(t[1])), G && p(!1), o.current?.focus(), u(!1);
156
+ }, Se = () => C && C.readOnly ? null : (f && f.current && (f.current.id = "valueInitial"), b ? /* @__PURE__ */ i.jsx($, { handlerClose: () => q("valueInitial"), dialogSize: O, onOpenChange: v, children: E(l, S, "valueInitial") }) : /* @__PURE__ */ i.jsx(U, { containerRef: M, showButtonOpen: j, inputDimensions: L, dropdownRef: (e) => {
157
+ w.current = e;
158
+ }, children: E(l, S, "valueInitial") })), Be = () => C && C.readOnly ? null : (f && f.current && (f.current.id = "valueFinal"), b ? /* @__PURE__ */ i.jsx($, { handlerClose: () => q("valueFinal"), dialogSize: O, onOpenChange: u, children: E(a, S, "valueFinal") }) : /* @__PURE__ */ i.jsx(U, { containerRef: M, showButtonOpen: j, inputDimensions: L, dropdownRef: (e) => {
159
+ w.current = e;
160
+ }, children: E(a, S, "valueFinal") })), Pe = () => b ? /* @__PURE__ */ i.jsx($, { handlerClose: () => q("periodSelection"), dialogSize: O, onOpenChange: p, children: re(Q, oe) }) : /* @__PURE__ */ i.jsx(U, { containerRef: M, showButtonOpen: j, inputDimensions: L, dropdownRef: (e) => {
161
+ w.current = e;
162
+ }, children: re(Q, oe) });
163
+ if (C && C.unvisible) return null;
164
+ const se = () => /* @__PURE__ */ i.jsxs("div", { ref: M, onBlur: Ie, className: "input-base-component datepicker-period-container", children: [
165
+ n.label && /* @__PURE__ */ i.jsxs("div", { className: "labelcontainer", children: [
166
+ /* @__PURE__ */ i.jsx(he, { required: n.required, className: n.customClassForLabel, labelUppercase: n.labelUppercase }),
167
+ /* @__PURE__ */ i.jsx("div", { className: "text-content", style: {
168
+ display: "flex"
169
+ }, children: /* @__PURE__ */ i.jsxs("div", { className: `label ${n.customClassForLabel} ${n.labelUppercase && " -uppercase"}`, style: {
170
+ alignSelf: "center"
171
+ }, children: [
172
+ n.label,
173
+ n.required && /* @__PURE__ */ i.jsx("span", { className: "-requiredlabel", children: "*" }),
174
+ !!B && H === "onLabelRight" && /* @__PURE__ */ i.jsx(qe, { theme: Ce, align: De, iconColor: "#03bde2", customClass: "-hint", style: {
175
+ margin: "0px 5px",
176
+ height: "auto",
177
+ width: 20
178
+ }, children: B })
179
+ ] }) }),
180
+ /* @__PURE__ */ i.jsx(he, {})
181
+ ] }),
182
+ /* @__PURE__ */ i.jsxs("div", { className: `periodpicker-component ${Te({
183
+ ...n,
184
+ value: l ? r(l).format("DD/MM/YYYY") : "",
185
+ disabled: z()
186
+ })}`, ref: x, children: [
187
+ /* @__PURE__ */ i.jsx(me, { gridLayout: void 0, permissionAttr: n.permissionAttr, name: "valueInitial", value: l ? r(l).format("DD/MM/YYYY") : "", mask: "00/00/0000", onComplete: (e) => {
188
+ N(e, e.target.value, !0);
189
+ }, onFocus: ie, onBlur: (e) => le(e), onChange: ae, inputRef: (e) => {
190
+ d.current = e;
191
+ }, handlerSetOnDenied: (e) => {
192
+ Z(e);
193
+ }, required: n.required }),
194
+ /* @__PURE__ */ i.jsx(W, { name: "arrow_right", customClass: "separation_icon" }),
195
+ /* @__PURE__ */ i.jsx(me, { gridLayout: void 0, permissionAttr: n.permissionAttr, name: "valueFinal", value: a ? r(a).format("DD/MM/YYYY") : "", mask: "00/00/0000", onComplete: (e) => {
196
+ N(e, e.target.value, !0);
197
+ }, onFocus: ie, onBlur: (e) => le(e), onChange: ae, inputRef: (e) => {
198
+ o.current = e;
199
+ }, handlerSetOnDenied: (e) => Z(e), required: n.required }),
200
+ we(),
201
+ je()
202
+ ] }),
203
+ h && Se(),
204
+ Y && Be(),
205
+ y && Pe(),
206
+ /* @__PURE__ */ i.jsx(Le, { visible: !!B && H === "below", customClass: "hint", description: B }),
207
+ /* @__PURE__ */ i.jsx(Ae, { messages: n.errorMessages })
208
+ ] });
209
+ return J ? /* @__PURE__ */ i.jsx(Ve, { customClass: "-withinput", cols: J, children: se() }) : se();
348
210
  };
349
211
  export {
350
- mn as default
212
+ on as default
351
213
  };