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,55 +1,80 @@
1
- import { j as s } from "../chunks/jsx-runtime.CYK1ROHF.js";
2
- import { createContext as L, useState as h, useRef as x, useEffect as O } from "react";
3
- import A from "./Popup.js";
4
- import '../assets/withDropdown.css';const M = L({}), S = (o) => o.displayName || o.name || "Component", q = (o) => {
5
- const a = (c) => {
6
- const {
7
- dropdownOpened: t,
8
- showDropdown: p,
1
+ import { j as f } from "../chunks/jsx-runtime.D1SHvdVE.js";
2
+ import { c as K } from "../chunks/compiler-runtime.Cu50tn6L.js";
3
+ import { createContext as Q, useState as V, useRef as q, useEffect as z } from "react";
4
+ import T from "./Popup.js";
5
+ import '../assets/withDropdown.css';const U = Q({}), X = (o) => o.displayName || o.name || "Component", oe = (o) => {
6
+ const A = (n) => {
7
+ const e = K.c(30), {
8
+ dropdownOpened: c,
9
+ showDropdown: m,
9
10
  dropdown: i,
10
- closeDropdownOnClickOutside: w = !0,
11
- handlerClose: l,
12
- customClassForDropdown: v,
13
- children: C,
14
- dropdownAlign: j = "left",
15
- isFloatMenu: m,
16
- isDropdownOpened: P
17
- } = c, [u, r] = h(t), [k, E] = h(t), e = x(null), D = x(null);
18
- t !== k && (r(t), E(t));
19
- const f = (n) => {
20
- const { target: d } = n;
21
- e != null && e.current && d !== (e == null ? void 0 : e.current) && !n.composedPath().includes(e.current) && D.current !== d && r(!1);
22
- }, g = () => {
23
- r((n) => !n);
24
- }, N = (n) => !n || !u ? null : (D.current = n, /* @__PURE__ */ s.jsx(
25
- A,
26
- {
27
- targetRef: n,
28
- align: j,
29
- customClassForDropdown: v,
30
- isFloatMenu: m,
31
- children: /* @__PURE__ */ s.jsx("div", { className: m ? "items" : void 0, ref: (d) => {
32
- e.current = d;
33
- }, children: C })
34
- }
35
- ));
36
- O(() => (i && w && document.addEventListener("click", f), () => {
37
- i && w && document.removeEventListener("click", f);
38
- }), []), O(() => {
39
- l && l(() => r(!1));
40
- }, [l]);
41
- const y = {
42
- handleDropdownClose: g
43
- }, F = {
44
- getDropdownPopup: (n) => N(n),
45
- showDropdown: p || (() => r(!u)),
46
- isDropdownOpened: P || u
47
- };
48
- return i ? /* @__PURE__ */ s.jsx(M.Provider, { value: y, children: /* @__PURE__ */ s.jsx(o, { ...c, ...F }) }) : /* @__PURE__ */ s.jsx(o, { ...c });
11
+ closeDropdownOnClickOutside: F,
12
+ handlerClose: d,
13
+ customClassForDropdown: P,
14
+ children: g,
15
+ dropdownAlign: L,
16
+ isFloatMenu: p,
17
+ isDropdownOpened: B
18
+ } = n, a = F === void 0 ? !0 : F, S = L === void 0 ? "left" : L, [s, u] = V(c), [G, H] = V(c), w = q(null), $ = q(null);
19
+ c !== G && (u(c), H(c));
20
+ let h;
21
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = (t) => {
22
+ const {
23
+ target: E
24
+ } = t;
25
+ w?.current && E !== w?.current && !t.composedPath().includes(w.current) && $.current !== E && u(!1);
26
+ }, e[0] = h) : h = e[0];
27
+ const M = h;
28
+ let D;
29
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (D = () => {
30
+ u(Y);
31
+ }, e[1] = D) : D = e[1];
32
+ const I = D;
33
+ let x;
34
+ e[2] !== g || e[3] !== P || e[4] !== S || e[5] !== p || e[6] !== s ? (x = (t) => !t || !s ? null : ($.current = t, /* @__PURE__ */ f.jsx(T, { targetRef: t, align: S, customClassForDropdown: P, isFloatMenu: p, children: /* @__PURE__ */ f.jsx("div", { className: p ? "items" : void 0, ref: (E) => {
35
+ w.current = E;
36
+ }, children: g }) })), e[2] = g, e[3] = P, e[4] = S, e[5] = p, e[6] = s, e[7] = x) : x = e[7];
37
+ const b = x;
38
+ let O;
39
+ e[8] !== a || e[9] !== i ? (O = () => (i && a && document.addEventListener("click", M), () => {
40
+ i && a && document.removeEventListener("click", M);
41
+ }), e[8] = a, e[9] = i, e[10] = O) : O = e[10];
42
+ let v;
43
+ e[11] === Symbol.for("react.memo_cache_sentinel") ? (v = [], e[11] = v) : v = e[11], z(O, v);
44
+ let C, _;
45
+ e[12] !== d ? (C = () => {
46
+ d && d(() => u(!1));
47
+ }, _ = [d], e[12] = d, e[13] = C, e[14] = _) : (C = e[13], _ = e[14]), z(C, _);
48
+ let j;
49
+ e[15] === Symbol.for("react.memo_cache_sentinel") ? (j = {
50
+ handleDropdownClose: I
51
+ }, e[15] = j) : j = e[15];
52
+ const J = j;
53
+ let r;
54
+ e[16] !== b ? (r = (t) => b(t), e[16] = b, e[17] = r) : r = e[17];
55
+ let l;
56
+ e[18] !== s || e[19] !== m ? (l = m || (() => u(!s)), e[18] = s, e[19] = m, e[20] = l) : l = e[20];
57
+ const N = B || s;
58
+ let y;
59
+ e[21] !== r || e[22] !== l || e[23] !== N ? (y = {
60
+ getDropdownPopup: r,
61
+ showDropdown: l,
62
+ isDropdownOpened: N
63
+ }, e[21] = r, e[22] = l, e[23] = N, e[24] = y) : y = e[24];
64
+ const R = y;
65
+ if (!i) {
66
+ let t;
67
+ return e[25] !== n ? (t = /* @__PURE__ */ f.jsx(o, { ...n }), e[25] = n, e[26] = t) : t = e[26], t;
68
+ }
69
+ let k;
70
+ return e[27] !== R || e[28] !== n ? (k = /* @__PURE__ */ f.jsx(U.Provider, { value: J, children: /* @__PURE__ */ f.jsx(o, { ...n, ...R }) }), e[27] = R, e[28] = n, e[29] = k) : k = e[29], k;
49
71
  };
50
- return a.displayName = `withDropdown(${S(o)})`, a;
72
+ return A.displayName = `withDropdown(${X(o)})`, A;
51
73
  };
74
+ function Y(o) {
75
+ return !o;
76
+ }
52
77
  export {
53
- M as WithDropdownContext,
54
- q as default
78
+ U as WithDropdownContext,
79
+ oe as default
55
80
  };
@@ -1,51 +1,70 @@
1
- import { j as e } from "../chunks/jsx-runtime.CYK1ROHF.js";
2
- import { useState as O, Fragment as D } from "react";
1
+ import { j as l } from "../chunks/jsx-runtime.D1SHvdVE.js";
2
+ import { c as _ } from "../chunks/compiler-runtime.Cu50tn6L.js";
3
+ import { useState as F, Fragment as I } from "react";
3
4
  import '../assets/gridlayout.css';import '../assets/index12.css';/* empty css */
4
- import T from "../gridlayout/GridCol.js";
5
- import { actionsOnPermissionDenied as b, OPTIONS_ON_DENIED as v } from "../permissionValidations.js";
6
- import w from "../noPermission/index.js";
7
- const _ = (n) => {
8
- const {
9
- gridCols: r,
10
- children: c,
11
- title: o,
12
- titleAlign: d = "left",
13
- style: f,
14
- styleContent: u,
15
- styleTitle: C,
16
- template: l = "none",
17
- titleCustomClass: g,
18
- permissionAttr: p,
19
- leftElements: h = null,
20
- rightElements: j = null
21
- } = n, { hideContent: x, unvisible: $ } = v, [m] = O(b([x, $], p)), N = ({ type: s, customClass: i, hasError: E }) => {
22
- let t = `fieldset-component ${i}`;
23
- return s && (t = `${t} -${s}`), E && (t = `${t} -witherror`), t;
24
- }, y = ({ colsCount: s = 2, rowsCount: i = 2 }) => l === "rows" ? { gridTemplateRows: `repeat(${i}, 1fr)` } : l === "columns" ? { gridTemplateColumns: `repeat(${s}, 1fr)` } : {}, a = () => /* @__PURE__ */ e.jsx("fieldset", { style: f, className: N({ ...n }), children: m.hideContent ? /* @__PURE__ */ e.jsx(w, {}) : /* @__PURE__ */ e.jsxs(D, { children: [
25
- o && /* @__PURE__ */ e.jsxs(
26
- "legend",
27
- {
28
- style: C,
29
- align: d,
30
- className: `legend ${g}`,
31
- children: [
32
- h,
33
- o,
34
- j
35
- ]
36
- }
37
- ),
38
- /* @__PURE__ */ e.jsx(
39
- "div",
40
- {
41
- className: `contentfieldset -template${l} `,
42
- style: Object.assign(y(n), u),
43
- children: c
44
- }
45
- )
46
- ] }) });
47
- return m.unvisible ? null : r ? /* @__PURE__ */ e.jsx(T, { cols: r, children: a() }) : a();
5
+ import G from "../gridlayout/GridCol.js";
6
+ import { actionsOnPermissionDenied as k, OPTIONS_ON_DENIED as q } from "../permissionValidations.js";
7
+ import z from "../noPermission/index.js";
8
+ const V = (s) => {
9
+ const t = _.c(21), {
10
+ gridCols: o,
11
+ children: i,
12
+ title: e,
13
+ titleAlign: $,
14
+ style: u,
15
+ styleContent: C,
16
+ styleTitle: g,
17
+ template: y,
18
+ titleCustomClass: p,
19
+ permissionAttr: h,
20
+ leftElements: N,
21
+ rightElements: w
22
+ } = s, x = $ === void 0 ? "left" : $, n = y === void 0 ? "none" : y, j = N === void 0 ? null : N, v = w === void 0 ? null : w, {
23
+ hideContent: T,
24
+ unvisible: b
25
+ } = q;
26
+ let r;
27
+ t[0] !== h ? (r = k([T, b], h), t[0] = h, t[1] = r) : r = t[1];
28
+ const [c] = F(r), A = B;
29
+ let m;
30
+ t[2] !== n ? (m = (P) => {
31
+ const {
32
+ colsCount: O,
33
+ rowsCount: D
34
+ } = P, R = O === void 0 ? 2 : O, S = D === void 0 ? 2 : D;
35
+ return n === "rows" ? {
36
+ gridTemplateRows: `repeat(${S}, 1fr)`
37
+ } : n === "columns" ? {
38
+ gridTemplateColumns: `repeat(${R}, 1fr)`
39
+ } : {};
40
+ }, t[2] = n, t[3] = m) : m = t[3];
41
+ const E = m;
42
+ let d;
43
+ t[4] !== i || t[5] !== E || t[6] !== j || t[7] !== c.hideContent || t[8] !== s || t[9] !== v || t[10] !== u || t[11] !== C || t[12] !== g || t[13] !== n || t[14] !== e || t[15] !== x || t[16] !== p ? (d = () => /* @__PURE__ */ l.jsx("fieldset", { style: u, className: A({
44
+ ...s
45
+ }), children: c.hideContent ? /* @__PURE__ */ l.jsx(z, {}) : /* @__PURE__ */ l.jsxs(I, { children: [
46
+ e && /* @__PURE__ */ l.jsxs("legend", { style: g, align: x, className: `legend ${p}`, children: [
47
+ j,
48
+ e,
49
+ v
50
+ ] }),
51
+ /* @__PURE__ */ l.jsx("div", { className: `contentfieldset -template${n} `, style: Object.assign(E(s), C), children: i })
52
+ ] }) }), t[4] = i, t[5] = E, t[6] = j, t[7] = c.hideContent, t[8] = s, t[9] = v, t[10] = u, t[11] = C, t[12] = g, t[13] = n, t[14] = e, t[15] = x, t[16] = p, t[17] = d) : d = t[17];
53
+ const a = d;
54
+ if (c.unvisible)
55
+ return null;
56
+ let f;
57
+ return t[18] !== o || t[19] !== a ? (f = o ? /* @__PURE__ */ l.jsx(G, { cols: o, children: a() }) : a(), t[18] = o, t[19] = a, t[20] = f) : f = t[20], f;
48
58
  };
59
+ function B(s) {
60
+ const {
61
+ type: t,
62
+ customClass: o,
63
+ hasError: i
64
+ } = s;
65
+ let e = `fieldset-component ${o}`;
66
+ return t && (e = `${e} -${t}`), i && (e = `${e} -witherror`), e;
67
+ }
49
68
  export {
50
- _ as default
69
+ V as default
51
70
  };
package/lib/form/Field.js CHANGED
@@ -1,72 +1,98 @@
1
- import { j as p } from "../chunks/jsx-runtime.CYK1ROHF.js";
2
- import { forwardRef as C, useContext as v } from "react";
3
- import l from "lodash";
4
- import x from "./withFieldHOC.js";
5
- import { withFieldContext as E, getErrorMessages as F, getValidatorsArray as h } from "./helpers.js";
6
- const y = ({
7
- validators: t = [],
8
- name: d,
9
- onBlur: s,
10
- handlerFieldValidate: e,
11
- validatorFromComponent: o,
1
+ import { j as N } from "../chunks/jsx-runtime.D1SHvdVE.js";
2
+ import { c as V } from "../chunks/compiler-runtime.Cu50tn6L.js";
3
+ import { forwardRef as A, useContext as L } from "react";
4
+ import { _ as C } from "../chunks/lodash.CIAK_hAg.js";
5
+ import M from "./withFieldHOC.js";
6
+ import { withFieldContext as S, getErrorMessages as $, getValidatorsArray as b } from "./helpers.js";
7
+ const B = ({
8
+ validators: o = [],
9
+ name: s,
10
+ onBlur: e,
11
+ handlerFieldValidate: r,
12
+ validatorFromComponent: l,
12
13
  handlerFieldChange: n,
13
- onChange: r
14
+ onChange: t
14
15
  }) => {
15
- if (!(t || o || s || r)) return {};
16
- const a = h(t, o);
16
+ if (!(o || l || e || t)) return {};
17
+ const i = b(o, l);
17
18
  return {
18
- onBlur: (i) => {
19
- a && i.target && e && e(d, i.target.value, a), s && s(i);
19
+ onBlur: (a) => {
20
+ i && a.target && r && r(s, a.target.value, i), e && e(a);
20
21
  },
21
- onChange: (i) => {
22
- a && i.target && e && e(d, i.target.value, a), n && n(i), r && r(i);
22
+ onChange: (a) => {
23
+ i && a.target && r && r(s, a.target.value, i), n && n(a), t && t(a);
23
24
  }
24
25
  };
25
- }, w = (t, d) => {
26
- const { value: s, data: e, name: o, fieldId: n, componentType: r, component: a } = t;
27
- return r && r.toLowerCase() === "radio" ? { checked: l.get(e, o) === s, id: n } : r && r.toLowerCase() === "checkbox" ? { checked: l.get(e, o), id: n } : a.displayName === "CpfField" || a.displayName === "CnpjField" ? { value: l.get(e, o), handlerSetComponentValidator: d } : { value: l.get(e, o) };
28
- }, m = C((t, d) => {
26
+ }, D = (o, s) => {
29
27
  const {
30
- handlerFieldChange: s,
31
- handlerFieldValidate: e,
32
- onChange: o,
33
- onBlur: n,
34
- name: r,
35
- validators: a,
36
- data: i,
37
- fieldErrors: j,
38
- handlerStoreValidators: k,
39
- handlerRemoveValidators: N,
40
- component: f,
41
- externalFieldErrors: R,
42
- originalData: A,
43
- ...c
44
- } = t, { handlerSetValidatorFromComponent: u, validatorFromComponent: g } = v(E);
45
- return /* @__PURE__ */ p.jsx(
46
- f,
47
- {
48
- ...c,
49
- ...y({
50
- name: r,
51
- validators: a,
52
- onBlur: n,
53
- validatorFromComponent: g,
54
- handlerFieldValidate: e,
55
- handlerFieldChange: s,
56
- onChange: o
57
- }),
58
- ...w(t, u),
59
- ref: d,
60
- name: r,
61
- errorMessages: F({
62
- ...t,
63
- fieldErrors: t.fieldErrors
64
- })
65
- }
66
- );
28
+ value: e,
29
+ data: r,
30
+ name: l,
31
+ fieldId: n,
32
+ componentType: t,
33
+ component: i
34
+ } = o;
35
+ return t && t.toLowerCase() === "radio" ? {
36
+ checked: C.get(r, l) === e,
37
+ id: n
38
+ } : t && t.toLowerCase() === "checkbox" ? {
39
+ checked: C.get(r, l),
40
+ id: n
41
+ } : i.displayName === "CpfField" || i.displayName === "CnpjField" ? {
42
+ value: C.get(r, l),
43
+ handlerSetComponentValidator: s
44
+ } : {
45
+ value: C.get(r, l)
46
+ };
47
+ }, x = A((o, s) => {
48
+ const e = V.c(30);
49
+ let r, l, n, t, i, a, d, m;
50
+ if (e[0] !== o) {
51
+ const {
52
+ handlerFieldChange: F,
53
+ handlerFieldValidate: E,
54
+ onChange: y,
55
+ onBlur: w,
56
+ name: j,
57
+ validators: p,
58
+ data: H,
59
+ fieldErrors: I,
60
+ handlerStoreValidators: O,
61
+ handlerRemoveValidators: P,
62
+ component: R,
63
+ externalFieldErrors: T,
64
+ originalData: _,
65
+ ...k
66
+ } = o;
67
+ l = F, n = E, a = y, i = w, t = j, m = p, r = R, d = k, e[0] = o, e[1] = r, e[2] = l, e[3] = n, e[4] = t, e[5] = i, e[6] = a, e[7] = d, e[8] = m;
68
+ } else
69
+ r = e[1], l = e[2], n = e[3], t = e[4], i = e[5], a = e[6], d = e[7], m = e[8];
70
+ const {
71
+ handlerSetValidatorFromComponent: h,
72
+ validatorFromComponent: v
73
+ } = L(S);
74
+ let f;
75
+ e[9] !== l || e[10] !== n || e[11] !== t || e[12] !== i || e[13] !== a || e[14] !== v || e[15] !== m ? (f = B({
76
+ name: t,
77
+ validators: m,
78
+ onBlur: i,
79
+ validatorFromComponent: v,
80
+ handlerFieldValidate: n,
81
+ handlerFieldChange: l,
82
+ onChange: a
83
+ }), e[9] = l, e[10] = n, e[11] = t, e[12] = i, e[13] = a, e[14] = v, e[15] = m, e[16] = f) : f = e[16];
84
+ let c;
85
+ e[17] !== h || e[18] !== o ? (c = D(o, h), e[17] = h, e[18] = o, e[19] = c) : c = e[19];
86
+ let u;
87
+ e[20] !== o ? (u = $({
88
+ ...o,
89
+ fieldErrors: o.fieldErrors
90
+ }), e[20] = o, e[21] = u) : u = e[21];
91
+ let g;
92
+ return e[22] !== r || e[23] !== t || e[24] !== s || e[25] !== d || e[26] !== f || e[27] !== c || e[28] !== u ? (g = /* @__PURE__ */ N.jsx(r, { ...d, ...f, ...c, ref: s, name: t, errorMessages: u }), e[22] = r, e[23] = t, e[24] = s, e[25] = d, e[26] = f, e[27] = c, e[28] = u, e[29] = g) : g = e[29], g;
67
93
  });
68
- m.displayName = "Field";
69
- const D = x(m);
94
+ x.displayName = "Field";
95
+ const U = M(x);
70
96
  export {
71
- D as default
97
+ U as default
72
98
  };
@@ -1,7 +1,8 @@
1
- import { j as t } from "../chunks/jsx-runtime.CYK1ROHF.js";
1
+ import { j as t } from "../chunks/jsx-runtime.D1SHvdVE.js";
2
2
  import { Fragment as C, useCallback as u } from "react";
3
- import x from "lodash";
3
+ import { _ as x } from "../chunks/lodash.CIAK_hAg.js";
4
4
  import E from "./withFieldHOC.js";
5
+ import "../chunks/compiler-runtime.Cu50tn6L.js";
5
6
  import '../assets/gridlayout.css';/* empty css */
6
7
  import F from "../gridlayout/GridCol.js";
7
8
  import b from "../fieldset/index.js";
@@ -22,7 +23,12 @@ const g = (e) => {
22
23
  }, [a]),
23
24
  [i]: x.get(m, n),
24
25
  [r]: u((o) => {
25
- l && l({ target: { value: o, name: n } }), s && s(o);
26
+ l && l({
27
+ target: {
28
+ value: o,
29
+ name: n
30
+ }
31
+ }), s && s(o);
26
32
  }, [l, s, r])
27
33
  };
28
34
  }, j = (e) => {
@@ -49,41 +55,14 @@ const g = (e) => {
49
55
  ...c
50
56
  } = e;
51
57
  let d = null;
52
- return f && (!l && r ? d = /* @__PURE__ */ t.jsx(
53
- b,
54
- {
55
- title: r,
56
- customClass: `arraycontainer ${m && "-bordered"}`,
57
- style: n,
58
- titleCustomClass: "label",
59
- children: /* @__PURE__ */ t.jsx(
60
- f,
61
- {
62
- ...c,
63
- ...g(e),
64
- label: r,
65
- name: a,
66
- errorMessages: h({
67
- ...e,
68
- fieldErrors: e.fieldErrors
69
- })
70
- }
71
- )
72
- }
73
- ) : d = /* @__PURE__ */ t.jsx(C, { children: /* @__PURE__ */ t.jsx(
74
- f,
75
- {
76
- ...c,
77
- ...g(e),
78
- label: r,
79
- name: a,
80
- errorMessages: h({
81
- ...e,
82
- fieldErrors: e.fieldErrors
83
- })
84
- }
85
- ) })), i ? /* @__PURE__ */ t.jsx(F, { cols: i, children: d }) : d;
86
- }, O = E(j);
58
+ return f && (!l && r ? d = /* @__PURE__ */ t.jsx(b, { title: r, customClass: `arraycontainer ${m && "-bordered"}`, style: n, titleCustomClass: "label", children: /* @__PURE__ */ t.jsx(f, { ...c, ...g(e), label: r, name: a, errorMessages: h({
59
+ ...e,
60
+ fieldErrors: e.fieldErrors
61
+ }) }) }) : d = /* @__PURE__ */ t.jsx(C, { children: /* @__PURE__ */ t.jsx(f, { ...c, ...g(e), label: r, name: a, errorMessages: h({
62
+ ...e,
63
+ fieldErrors: e.fieldErrors
64
+ }) }) })), i ? /* @__PURE__ */ t.jsx(F, { cols: i, children: d }) : d;
65
+ }, _ = E(j);
87
66
  export {
88
- O as default
67
+ _ as default
89
68
  };
@@ -1,44 +1,48 @@
1
- import { j as N } from "../chunks/jsx-runtime.CYK1ROHF.js";
2
- import b from "lodash";
3
- import j from "./withFieldHOC.js";
4
- import { getErrorMessages as k } from "./helpers.js";
5
- import { keyCodes as M } from "../internals/constants.js";
6
- const y = ({
7
- name: r,
8
- validators: u,
9
- onBlur: m,
10
- onKeyDown: E,
11
- onChange: x,
12
- handlerFieldValidate: s,
13
- handlerFieldChange: g,
14
- component: t
1
+ import { j as E } from "../chunks/jsx-runtime.D1SHvdVE.js";
2
+ import { c as g } from "../chunks/compiler-runtime.Cu50tn6L.js";
3
+ import { _ as x } from "../chunks/lodash.CIAK_hAg.js";
4
+ import n from "./withFieldHOC.js";
5
+ import { getErrorMessages as N } from "./helpers.js";
6
+ import { keyCodes as b } from "../internals/constants.js";
7
+ const j = ({
8
+ name: f,
9
+ validators: t,
10
+ onBlur: o,
11
+ onKeyDown: s,
12
+ onChange: i,
13
+ handlerFieldValidate: m,
14
+ handlerFieldChange: u,
15
+ component: r
15
16
  }) => ({
16
- onBlur: (f) => {
17
- (t == null ? void 0 : t.name) !== "NumberField" && g && g(f), u && s && s(r, f.target.value, u), m && m(f);
17
+ onBlur: (e) => {
18
+ r?.name !== "NumberField" && u && u(e), t && m && m(f, e.target.value, t), o && o(e);
18
19
  },
19
- onKeyDown: (f) => {
20
- [M.ENTER].includes(f.keyCode) && (u && (s == null || s(r, f.target.value, u)), E && E(f));
20
+ onKeyDown: (e) => {
21
+ [b.ENTER].includes(e.keyCode) && (t && m?.(f, e.target.value, t), s && s(e));
21
22
  },
22
- onChange: (f) => {
23
- (t == null ? void 0 : t.name) === "NumberField" && (u && f.target && s && s(r, f.target.value, u), g && g(f)), x && x(f);
23
+ onChange: (e) => {
24
+ r?.name === "NumberField" && (t && e.target && m && m(f, e.target.value, t), u && u(e)), i && i(e);
24
25
  }
25
- }), R = (r) => {
26
- const { data: u, name: m } = r, E = b.get(u, m);
27
- return /* @__PURE__ */ N.jsx(
28
- r.component,
29
- {
30
- ...r,
31
- ...y({
32
- ...r
33
- }),
34
- errorMessages: k({
35
- ...r,
36
- fieldErrors: r.fieldErrors
37
- }),
38
- value: E
39
- }
40
- );
41
- }, T = j(R);
26
+ }), k = (f) => {
27
+ const t = g.c(12), {
28
+ data: o,
29
+ name: s
30
+ } = f;
31
+ let i;
32
+ t[0] !== o || t[1] !== s ? (i = x.get(o, s), t[0] = o, t[1] = s, t[2] = i) : i = t[2];
33
+ const m = i, u = f.component;
34
+ let r;
35
+ t[3] !== f ? (r = j({
36
+ ...f
37
+ }), t[3] = f, t[4] = r) : r = t[4];
38
+ let e;
39
+ t[5] !== f ? (e = N({
40
+ ...f,
41
+ fieldErrors: f.fieldErrors
42
+ }), t[5] = f, t[6] = e) : e = t[6];
43
+ let c;
44
+ return t[7] !== m || t[8] !== f || t[9] !== r || t[10] !== e ? (c = /* @__PURE__ */ E.jsx(u, { ...f, ...r, errorMessages: e, value: m }), t[7] = m, t[8] = f, t[9] = r, t[10] = e, t[11] = c) : c = t[11], c;
45
+ }, O = n(k);
42
46
  export {
43
- T as default
47
+ O as default
44
48
  };