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.
- package/lib/alerts/AlertContainer.js +8 -2
- package/lib/alerts/AlertProvider.js +11 -5
- package/lib/alerts/BaseAlert.js +10 -8
- package/lib/alerts/Message.js +91 -64
- package/lib/alerts/withAlert.js +10 -6
- package/lib/assets/BaseAlert.css +1 -1
- package/lib/assets/Content.css +1 -1
- package/lib/assets/DefaultFile.css +1 -1
- package/lib/assets/Drawer.css +1 -1
- package/lib/assets/index11.css +1 -1
- package/lib/assets/index5.css +1 -1
- package/lib/avatar/index.js +29 -51
- package/lib/badge/index.js +25 -23
- package/lib/buttons/ActivateButton.js +9 -4
- package/lib/buttons/AddButton.js +12 -5
- package/lib/buttons/Button.js +16 -5
- package/lib/buttons/ButtonGroups.js +10 -3
- package/lib/buttons/CancelButton.js +14 -4
- package/lib/buttons/DangerButton.js +15 -4
- package/lib/buttons/DefaultButton.js +76 -111
- package/lib/buttons/DestroyButton.js +21 -5
- package/lib/buttons/EditButton.js +9 -4
- package/lib/buttons/InactivateButton.js +9 -4
- package/lib/buttons/InfoButton.js +15 -4
- package/lib/buttons/PrimaryButton.js +15 -4
- package/lib/buttons/RestoreButton.js +9 -4
- package/lib/buttons/SaveButton.js +14 -4
- package/lib/buttons/SuccessButton.js +15 -4
- package/lib/buttons/WarningButton.js +15 -4
- package/lib/buttons/button_container/index.js +21 -16
- package/lib/buttons/split_button/index.js +53 -55
- package/lib/calendar/DangerCalendar.js +18 -4
- package/lib/calendar/InfoCalendar.js +18 -4
- package/lib/calendar/PrimaryCalendar.js +18 -4
- package/lib/calendar/SuccessCalendar.js +18 -4
- package/lib/calendar/WarningCalendar.js +18 -4
- package/lib/calendar/base/Day.js +32 -22
- package/lib/calendar/base/Month.js +24 -21
- package/lib/calendar/base/Week.js +20 -19
- package/lib/calendar/base/helpers.js +11 -19
- package/lib/calendar/base/index.js +129 -97
- package/lib/checkbox/index.js +6 -5
- package/lib/chunks/compiler-runtime.Cu50tn6L.js +54 -0
- package/lib/chunks/{index.Da--18GT.js → index.Df3kt2LQ.js} +179 -181
- package/lib/chunks/index.aw0XaUkg.js +266 -0
- package/lib/chunks/jsx-runtime.D1SHvdVE.js +282 -0
- package/lib/chunks/lodash.CIAK_hAg.js +3684 -0
- package/lib/chunks/moment.DMLRxgRE.js +2589 -0
- package/lib/chunks/tabs.BvKfeA6Y.js +244 -0
- package/lib/chunks/v1.Ds1rkxUj.js +49 -0
- package/lib/dialog/Alert.js +18 -17
- package/lib/dialog/Custom.js +42 -28
- package/lib/dialog/Error.js +18 -17
- package/lib/dialog/Information.js +18 -17
- package/lib/dialog/Question.js +43 -59
- package/lib/dialog/Warning.js +18 -17
- package/lib/dialog/base/Content.js +13 -4
- package/lib/dialog/base/Footer.js +8 -3
- package/lib/dialog/base/Header.js +4 -3
- package/lib/dialog/base/index.js +5 -4
- package/lib/dialog/form/index.js +5 -4
- package/lib/dialog/index.js +1 -1
- package/lib/dialog/wizard/index.js +11 -10
- package/lib/dialog/wizard/progressbar.js +96 -3
- package/lib/dialog/wizard/step.js +4 -3
- package/lib/dialog/wizard/useWizard.js +42 -29
- package/lib/drawer/Content.js +15 -8
- package/lib/drawer/Drawer.js +38 -35
- package/lib/drawer/Header.js +53 -40
- package/lib/drawer/helpers.js +2 -2
- package/lib/dropdown/Popup.js +4 -2
- package/lib/dropdown/withDropdown.js +75 -50
- package/lib/fieldset/index.js +66 -47
- package/lib/form/Field.js +88 -62
- package/lib/form/FieldArray.js +18 -39
- package/lib/form/FieldNumber.js +42 -38
- package/lib/form/FieldPeriod.js +90 -59
- package/lib/form/helpers.js +14 -11
- package/lib/form/index.js +88 -100
- package/lib/form/withFieldHOC.js +57 -48
- package/lib/form/withFormSecurity.js +15 -18
- package/lib/gridlayout/GridCol.js +21 -20
- package/lib/gridlayout/GridRow.js +22 -20
- package/lib/hint/helpers.js +6 -2
- package/lib/hint/index.js +27 -25
- package/lib/icons/helper.js +142 -569
- package/lib/icons/index.js +62 -57
- package/lib/index.js +20 -19
- package/lib/inputs/base/InputTextBase.js +121 -207
- package/lib/inputs/base/Label.js +27 -29
- package/lib/inputs/base/helpers.d.ts +3 -3
- package/lib/inputs/base/helpers.js +4 -2
- package/lib/inputs/color/index.js +52 -73
- package/lib/inputs/date/Dialog.js +15 -16
- package/lib/inputs/date/Dropdown.js +16 -14
- package/lib/inputs/date/helpers.js +7 -7
- package/lib/inputs/date/index.js +101 -147
- package/lib/inputs/errorMessage/index.js +21 -13
- package/lib/inputs/file/DefaultFile.js +64 -67
- package/lib/inputs/file/DragDropFile.js +79 -135
- package/lib/inputs/file/File.d.ts +1 -1
- package/lib/inputs/file/File.js +24 -39
- package/lib/inputs/file/FileButtonSettings.js +20 -17
- package/lib/inputs/inputHOC.js +38 -20
- package/lib/inputs/mask/BaseMask.js +51 -30
- package/lib/inputs/mask/Cnpj.js +42 -36
- package/lib/inputs/mask/Cpf.js +45 -33
- package/lib/inputs/mask/Phone.js +10 -6
- package/lib/inputs/mask/ZipCode.js +9 -4
- package/lib/inputs/mask/helpers.d.ts +33 -33
- package/lib/inputs/mask/helpers.js +44 -44
- package/lib/inputs/multiSelect/ActionButtons.js +35 -46
- package/lib/inputs/multiSelect/Dropdown.js +94 -133
- package/lib/inputs/multiSelect/helper.js +4 -7
- package/lib/inputs/multiSelect/index.js +167 -127
- package/lib/inputs/number/BaseNumber.js +43 -31
- package/lib/inputs/number/Currency.js +19 -12
- package/lib/inputs/number/Decimal.js +9 -4
- package/lib/inputs/number/index.js +31 -35
- package/lib/inputs/period/Dialog.js +16 -16
- package/lib/inputs/period/Dropdown.js +15 -15
- package/lib/inputs/period/PeriodList.js +41 -27
- package/lib/inputs/period/helper.js +8 -4
- package/lib/inputs/period/index.js +192 -330
- package/lib/inputs/search/index.js +95 -71
- package/lib/inputs/select/ActionButtons.js +24 -45
- package/lib/inputs/select/Dropdown.js +61 -110
- package/lib/inputs/select/helper.d.ts +1 -1
- package/lib/inputs/select/helper.js +43 -45
- package/lib/inputs/select/index.js +23 -25
- package/lib/inputs/select/multiple/Selecteds.js +23 -19
- package/lib/inputs/select/multiple/index.js +106 -176
- package/lib/inputs/select/simple/index.js +126 -196
- package/lib/inputs/text/index.js +9 -4
- package/lib/inputs/textarea/index.js +13 -15
- package/lib/internals/withTooltip.js +114 -67
- package/lib/labelMessages/index.js +50 -45
- package/lib/labels/DangerLabel.js +18 -4
- package/lib/labels/DefaultLabel.js +53 -39
- package/lib/labels/InfoLabel.js +18 -4
- package/lib/labels/PrimaryLabel.js +18 -4
- package/lib/labels/SuccessLabel.js +18 -4
- package/lib/labels/WarningLabel.js +18 -4
- package/lib/labels/label_container/index.js +15 -9
- package/lib/list/Header.js +18 -6
- package/lib/list/Item.js +5 -4
- package/lib/list/Separator.js +8 -3
- package/lib/list/helpers.js +2 -2
- package/lib/list/index.js +21 -18
- package/lib/menus/float/MenuItem.js +49 -52
- package/lib/menus/float/SubMenuContainer.d.ts +10 -10
- package/lib/menus/float/index.js +102 -81
- package/lib/menus/sidenav/ExpandMenu.js +17 -15
- package/lib/menus/sidenav/MenuLink.js +21 -14
- package/lib/menus/sidenav/NavMenuGroup.js +19 -14
- package/lib/menus/sidenav/NavMenuItem.js +131 -111
- package/lib/menus/sidenav/NavSubMenuItem.js +36 -20
- package/lib/menus/sidenav/helpers.js +4 -4
- package/lib/menus/sidenav/index.js +145 -123
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +21 -17
- package/lib/menus/sidenav/popup_menu_search/index.js +17 -51
- package/lib/noPermission/index.js +13 -8
- package/lib/panel/Content.js +49 -40
- package/lib/panel/DangerPanel.js +10 -5
- package/lib/panel/Default.js +62 -36
- package/lib/panel/Header.js +53 -37
- package/lib/panel/InfoPanel.js +10 -5
- package/lib/panel/PrimaryPanel.js +10 -5
- package/lib/panel/SuccessPanel.js +10 -5
- package/lib/panel/ToolBar.js +17 -4
- package/lib/panel/WarningPanel.js +10 -5
- package/lib/panel/helpers.js +8 -5
- package/lib/permissionValidations.js +15 -11
- package/lib/popover/PopoverText.js +12 -5
- package/lib/popover/PopoverTitle.js +10 -3
- package/lib/popover/index.js +36 -56
- package/lib/progress/Bar.js +43 -34
- package/lib/progress/index.js +23 -18
- package/lib/radio/index.js +105 -89
- package/lib/shortcuts/index.js +20 -7
- package/lib/skeleton/SkeletonContainer.js +16 -6
- package/lib/skeleton/index.js +42 -18
- package/lib/spinner/SpinnerLoading.js +53 -16
- package/lib/spinner/index.js +47 -37
- package/lib/split/Split.js +83 -79
- package/lib/split/SplitSide.js +24 -16
- package/lib/table/Body.js +36 -49
- package/lib/table/Header.js +45 -35
- package/lib/table/HeaderColumn.js +40 -27
- package/lib/table/Row.js +47 -48
- package/lib/table/RowColumn.js +50 -38
- package/lib/table/helpers.js +3 -1
- package/lib/table/index.js +101 -104
- package/lib/tabs/DropdownTabs.js +64 -61
- package/lib/tabs/Menu.js +35 -49
- package/lib/tabs/MenuTabs.js +59 -84
- package/lib/tabs/Panel.js +57 -47
- package/lib/tabs/context.js +36 -40
- package/lib/tabs/index.js +69 -64
- package/lib/tabs/tabHelpers.js +10 -8
- package/lib/textContent/index.js +30 -32
- package/lib/toolbar/ButtonBar.js +62 -58
- package/lib/toolbar/LabelBar.js +46 -38
- package/lib/toolbar/Separator.js +8 -3
- package/lib/toolbar/ToolBarGroup.js +14 -3
- package/lib/toolbar/index.js +35 -29
- package/lib/tooltip/index.js +24 -24
- package/lib/treetable/Body.js +26 -27
- package/lib/treetable/Header.js +23 -19
- package/lib/treetable/Row.js +210 -147
- package/lib/treetable/helpers.d.ts +4 -5
- package/lib/treetable/helpers.js +6 -14
- package/lib/treetable/index.js +25 -15
- package/lib/treeview/Header.js +13 -5
- package/lib/treeview/Node.js +198 -175
- package/lib/treeview/index.js +257 -174
- package/lib/uitour/index.js +167 -166
- package/package.json +32 -43
- package/lib/chunks/index.CmrLK9Qe.js +0 -675
- package/lib/chunks/index.D5f6Ow9V.js +0 -89
- package/lib/chunks/index.yztgndLc.js +0 -206
- package/lib/chunks/jsx-runtime.CYK1ROHF.js +0 -445
- package/lib/chunks/tabs.Cvj2MJH6.js +0 -246
- package/lib/chunks/v1.CDXKvGzE.js +0 -41
- /package/lib/assets/{index29.css → progressbar.css} +0 -0
package/lib/form/FieldPeriod.js
CHANGED
|
@@ -1,64 +1,95 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { j as b } from "../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as H } from "../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import { useState as I, useEffect as L } from "react";
|
|
4
|
+
import { _ as a } from "../chunks/lodash.CIAK_hAg.js";
|
|
4
5
|
import '../assets/gridlayout.css';/* empty css */
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { getErrorMessages as
|
|
8
|
-
const
|
|
9
|
-
const {
|
|
10
|
-
data:
|
|
11
|
-
nameDateInitial:
|
|
12
|
-
nameDateFinal:
|
|
13
|
-
handlerFieldChange:
|
|
6
|
+
import O from "../gridlayout/GridCol.js";
|
|
7
|
+
import k from "./withFieldHOC.js";
|
|
8
|
+
import { getErrorMessages as z } from "./helpers.js";
|
|
9
|
+
const B = (d) => {
|
|
10
|
+
const e = H.c(47), {
|
|
11
|
+
data: i,
|
|
12
|
+
nameDateInitial: o,
|
|
13
|
+
nameDateFinal: n,
|
|
14
|
+
handlerFieldChange: u,
|
|
14
15
|
handlerFieldValidate: g,
|
|
15
|
-
fieldErrors:
|
|
16
|
-
externalMessagesErrors:
|
|
17
|
-
onChange:
|
|
18
|
-
validators:
|
|
19
|
-
originalData:
|
|
20
|
-
gridLayout:
|
|
21
|
-
component:
|
|
22
|
-
name:
|
|
23
|
-
externalFieldErrors:
|
|
24
|
-
} =
|
|
25
|
-
let
|
|
26
|
-
const [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
16
|
+
fieldErrors: V,
|
|
17
|
+
externalMessagesErrors: j,
|
|
18
|
+
onChange: h,
|
|
19
|
+
validators: E,
|
|
20
|
+
originalData: w,
|
|
21
|
+
gridLayout: p,
|
|
22
|
+
component: x,
|
|
23
|
+
name: t,
|
|
24
|
+
externalFieldErrors: D
|
|
25
|
+
} = d;
|
|
26
|
+
let c = null;
|
|
27
|
+
const [S, q] = I(!1);
|
|
28
|
+
let y;
|
|
29
|
+
e[0] !== i || e[1] !== t ? (y = a.get(i, t), e[0] = i, e[1] = t, e[2] = y) : y = e[2];
|
|
30
|
+
const l = y;
|
|
31
|
+
let _;
|
|
32
|
+
e[3] !== t || e[4] !== w ? (_ = a.get(w, t), e[3] = t, e[4] = w, e[5] = _) : _ = e[5];
|
|
33
|
+
const C = _;
|
|
34
|
+
let F;
|
|
35
|
+
e[6] !== l || e[7] !== i || e[8] !== C ? (F = () => {
|
|
36
|
+
!a.isEqual(l, C) && l && (l || l === 0 || Array.isArray(l) && l.length > 0) ? q(!0) : (a.isEmpty(i) || a.every(i, a.isEmpty) || a.isEqual(l, C)) && q(!1);
|
|
37
|
+
}, e[6] = l, e[7] = i, e[8] = C, e[9] = F) : F = e[9];
|
|
38
|
+
let $;
|
|
39
|
+
e[10] !== l ? ($ = [l], e[10] = l, e[11] = $) : $ = e[11], L(F, $);
|
|
40
|
+
let v;
|
|
41
|
+
e[12] !== D || e[13] !== j || e[14] !== V || e[15] !== t || e[16] !== S ? (v = z({
|
|
42
|
+
name: t,
|
|
43
|
+
fieldErrors: S ? V : {},
|
|
44
|
+
externalFieldErrors: D,
|
|
45
|
+
externalMessagesErrors: j
|
|
46
|
+
}), e[12] = D, e[13] = j, e[14] = V, e[15] = t, e[16] = S, e[17] = v) : v = e[17];
|
|
47
|
+
const A = v;
|
|
48
|
+
if (x) {
|
|
49
|
+
let s;
|
|
50
|
+
e[18] !== u || e[19] !== g || e[20] !== t || e[21] !== n || e[22] !== o || e[23] !== h || e[24] !== E ? (s = (J, K, G) => {
|
|
51
|
+
const {
|
|
52
|
+
initial: P,
|
|
53
|
+
final: R
|
|
54
|
+
} = G;
|
|
55
|
+
E && g && (g(o, {
|
|
56
|
+
[o]: P,
|
|
57
|
+
[n]: R
|
|
58
|
+
}, E), q(!0)), u && u({
|
|
59
|
+
target: {
|
|
60
|
+
name: t,
|
|
61
|
+
value: {
|
|
62
|
+
[o]: P,
|
|
63
|
+
[n]: R
|
|
52
64
|
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
}
|
|
66
|
+
}), h && h({
|
|
67
|
+
initial: P,
|
|
68
|
+
final: R
|
|
69
|
+
});
|
|
70
|
+
}, e[18] = u, e[19] = g, e[20] = t, e[21] = n, e[22] = o, e[23] = h, e[24] = E, e[25] = s) : s = e[25];
|
|
71
|
+
let r;
|
|
72
|
+
e[26] !== i || e[27] !== t || e[28] !== o ? (r = a.get(i, `${t}.${o}`), e[26] = i, e[27] = t, e[28] = o, e[29] = r) : r = e[29];
|
|
73
|
+
let f;
|
|
74
|
+
e[30] !== i || e[31] !== t || e[32] !== n ? (f = a.get(i, `${t}.${n}`), e[30] = i, e[31] = t, e[32] = n, e[33] = f) : f = e[33];
|
|
75
|
+
let m;
|
|
76
|
+
e[34] !== r || e[35] !== f ? (m = {
|
|
77
|
+
initial: r,
|
|
78
|
+
final: f
|
|
79
|
+
}, e[34] = r, e[35] = f, e[36] = m) : m = e[36];
|
|
80
|
+
let M;
|
|
81
|
+
e[37] !== x || e[38] !== A || e[39] !== d || e[40] !== s || e[41] !== m ? (M = /* @__PURE__ */ b.jsx(x, { ...d, errorMessages: A, onChange: s, value: m }), e[37] = x, e[38] = A, e[39] = d, e[40] = s, e[41] = m, e[42] = M) : M = e[42], c = M;
|
|
82
|
+
}
|
|
83
|
+
if (p !== void 0) {
|
|
84
|
+
let s;
|
|
85
|
+
e[43] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
86
|
+
height: "100%"
|
|
87
|
+
}, e[43] = s) : s = e[43];
|
|
88
|
+
let r;
|
|
89
|
+
return e[44] !== c || e[45] !== p ? (r = /* @__PURE__ */ b.jsx(O, { customClass: "-withinput", cols: p, style: s, children: c }), e[44] = c, e[45] = p, e[46] = r) : r = e[46], r;
|
|
90
|
+
}
|
|
91
|
+
return c;
|
|
92
|
+
}, ee = k(B);
|
|
62
93
|
export {
|
|
63
|
-
|
|
94
|
+
ee as default
|
|
64
95
|
};
|
package/lib/form/helpers.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import y from "lodash";
|
|
1
|
+
import { _ as y } from "../chunks/lodash.CIAK_hAg.js";
|
|
2
2
|
import u from "react";
|
|
3
|
-
const
|
|
4
|
-
const {
|
|
3
|
+
const h = "securityBeforeUnload", x = u.createContext({}), B = u.createContext({}), J = (e, c) => {
|
|
4
|
+
const {
|
|
5
|
+
name: t,
|
|
6
|
+
value: s
|
|
7
|
+
} = c;
|
|
5
8
|
return y.set(JSON.parse(JSON.stringify(e)), t, s);
|
|
6
|
-
},
|
|
9
|
+
}, N = ({
|
|
7
10
|
name: e,
|
|
8
11
|
fieldErrors: c,
|
|
9
12
|
externalFieldErrors: t,
|
|
@@ -11,15 +14,15 @@ const _ = "securityBeforeUnload", h = u.createContext({}), x = u.createContext({
|
|
|
11
14
|
}) => {
|
|
12
15
|
let f = s ? [...s] : [];
|
|
13
16
|
return c && c[e] && (f = [...f, ...c[e]]), t && t[e] && (f = [...f, ...t[e]]), f;
|
|
14
|
-
},
|
|
17
|
+
}, O = (e, c) => {
|
|
15
18
|
let t = [];
|
|
16
19
|
return e && c ? (t = y.isArray(e) ? e : [e], t = y.isArray(c) ? [...t, ...c] : [...t, c]) : c ? t = y.isArray(c) ? c : [c] : e && (t = e instanceof Array ? e : [e]), t;
|
|
17
20
|
};
|
|
18
21
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
x as FormContext,
|
|
23
|
+
J as changeValue,
|
|
24
|
+
N as getErrorMessages,
|
|
25
|
+
O as getValidatorsArray,
|
|
26
|
+
h as securityBeforeUnload,
|
|
27
|
+
B as withFieldContext
|
|
25
28
|
};
|
package/lib/form/index.js
CHANGED
|
@@ -1,81 +1,90 @@
|
|
|
1
|
-
import { j as x } from "../chunks/jsx-runtime.
|
|
2
|
-
import { useState as m, useContext as ar, useRef as U, useCallback as q, useEffect as F, Fragment as
|
|
3
|
-
import f from "lodash";
|
|
1
|
+
import { j as x } from "../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { useState as m, useContext as ar, useRef as U, useCallback as q, useEffect as F, Fragment as ur } from "react";
|
|
3
|
+
import { _ as f } from "../chunks/lodash.CIAK_hAg.js";
|
|
4
4
|
import { changeValue as B, FormContext as mr } from "./helpers.js";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import "../chunks/index.
|
|
5
|
+
import { default as Ar } from "./Field.js";
|
|
6
|
+
import { default as Qr } from "./FieldNumber.js";
|
|
7
|
+
import { default as Dr } from "./FieldArray.js";
|
|
8
|
+
import { default as Ur } from "./FieldPeriod.js";
|
|
9
|
+
import "../chunks/index.aw0XaUkg.js";
|
|
10
|
+
import "../chunks/compiler-runtime.Cu50tn6L.js";
|
|
10
11
|
import "../buttons/DefaultButton.js";
|
|
11
12
|
import "../icons/index.js";
|
|
12
13
|
import '../assets/button.css';import '../assets/index13.css';/* empty css */
|
|
13
|
-
import
|
|
14
|
+
import dr from "../dialog/Question.js";
|
|
14
15
|
import { FormSecurityContext as pr } from "./withFormSecurity.js";
|
|
15
|
-
import { v as Fr } from "../chunks/v1.
|
|
16
|
-
const
|
|
16
|
+
import { v as Fr } from "../chunks/v1.Ds1rkxUj.js";
|
|
17
|
+
const Cr = ({
|
|
17
18
|
submitOnPressEnterKey: g = !0,
|
|
18
|
-
dataSource:
|
|
19
|
+
dataSource: d,
|
|
19
20
|
securityBeforeUnload: j,
|
|
20
21
|
handlerReset: k,
|
|
21
22
|
handlerSubmit: L,
|
|
22
23
|
handlerValidates: w,
|
|
23
24
|
style: M,
|
|
24
25
|
customClass: z,
|
|
25
|
-
securityTitle:
|
|
26
|
-
securityText:
|
|
26
|
+
securityTitle: $,
|
|
27
|
+
securityText: G,
|
|
27
28
|
securityData: C,
|
|
28
|
-
onDataChange:
|
|
29
|
+
onDataChange: u,
|
|
29
30
|
onValidateForm: p,
|
|
30
|
-
externalFieldErrors:
|
|
31
|
-
onSubmit:
|
|
32
|
-
skeletonize:
|
|
33
|
-
disabled:
|
|
34
|
-
children:
|
|
31
|
+
externalFieldErrors: H,
|
|
32
|
+
onSubmit: T,
|
|
33
|
+
skeletonize: W,
|
|
34
|
+
disabled: V,
|
|
35
|
+
children: X,
|
|
35
36
|
useInternalState: l = !1
|
|
36
37
|
}) => {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
return
|
|
38
|
+
const Y = Fr(), [h, J] = m(d), [E, Z] = m(d), [b, K] = m(g), [v, O] = m({}), [A, _] = m(0), [I, rr] = m(!1), c = ar(pr), tr = U(null), a = U({}), i = l ? h : d, R = (r, t) => {
|
|
39
|
+
const e = r instanceof Array ? r : [r];
|
|
40
|
+
let o = [];
|
|
41
|
+
return e.forEach((s) => {
|
|
41
42
|
if (typeof s == "function") {
|
|
42
43
|
const n = s(t);
|
|
43
|
-
n && (
|
|
44
|
+
n && (o = [...o, n]);
|
|
44
45
|
}
|
|
45
|
-
}),
|
|
46
|
+
}), o;
|
|
46
47
|
}, or = (r, t) => {
|
|
47
|
-
const
|
|
48
|
-
let
|
|
48
|
+
const e = r || i;
|
|
49
|
+
let o = f.pickBy(v, (s, n) => Object.keys(t).includes(n));
|
|
49
50
|
return f.forEach(t, (s, n) => {
|
|
50
|
-
const P = f.get(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
const P = f.get(e, n), lr = R(s, P);
|
|
52
|
+
o = {
|
|
53
|
+
...o,
|
|
54
|
+
[n]: lr
|
|
55
|
+
};
|
|
56
|
+
}), o;
|
|
57
|
+
}, y = (r, t = !0, e = null) => {
|
|
58
|
+
const o = or(r, e || a.current), s = Object.values(o).every((n) => n.length === 0);
|
|
55
59
|
return t && rr(s), s;
|
|
56
60
|
}, er = q((r) => {
|
|
57
|
-
const {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const {
|
|
62
|
+
target: t
|
|
63
|
+
} = r;
|
|
64
|
+
!l && u ? u((e) => B(e, t)) : J((e) => B(e, t));
|
|
65
|
+
}, []), sr = (r, t, e) => {
|
|
66
|
+
if (e) {
|
|
67
|
+
let o = v;
|
|
68
|
+
const s = R(e, t);
|
|
69
|
+
s.length === 0 ? o = f.omit(o, r) : o = {
|
|
70
|
+
...o,
|
|
71
|
+
[r]: s
|
|
72
|
+
}, O(o);
|
|
64
73
|
}
|
|
65
74
|
}, Q = q((r) => {
|
|
66
|
-
r && (r.preventDefault(), r.stopPropagation()), y(i) &&
|
|
75
|
+
r && (r.preventDefault(), r.stopPropagation()), y(i) && T(i);
|
|
67
76
|
}, [i]), S = (r, t) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const s = JSON.parse(JSON.stringify(
|
|
71
|
-
return
|
|
77
|
+
const e = t ? t instanceof Array ? t : [t] : [];
|
|
78
|
+
e.length > 0 ? (r((o) => {
|
|
79
|
+
const s = JSON.parse(JSON.stringify(o));
|
|
80
|
+
return e.forEach((n) => {
|
|
72
81
|
n && f.set(s, n, f.get(E, n));
|
|
73
82
|
}), s;
|
|
74
|
-
}), O((
|
|
75
|
-
delete
|
|
76
|
-
}),
|
|
83
|
+
}), O((o) => (e.forEach((s) => {
|
|
84
|
+
delete o[s];
|
|
85
|
+
}), o))) : (r(JSON.parse(JSON.stringify(E))), O({}));
|
|
77
86
|
}, ir = (r) => {
|
|
78
|
-
S(!l &&
|
|
87
|
+
S(!l && u ? u : J, r);
|
|
79
88
|
}, nr = (r) => {
|
|
80
89
|
const t = f.omit(a, r);
|
|
81
90
|
a.current = t;
|
|
@@ -83,7 +92,7 @@ const wr = ({
|
|
|
83
92
|
r.preventDefault(), f.isEqual(i, E);
|
|
84
93
|
}, fr = () => {
|
|
85
94
|
let r = null;
|
|
86
|
-
return
|
|
95
|
+
return V || (r = {
|
|
87
96
|
onSubmit: (t) => t.preventDefault(),
|
|
88
97
|
onKeyPress: (t) => {
|
|
89
98
|
t && t.key === "Enter" && (t.preventDefault(), t.stopPropagation(), b && Q());
|
|
@@ -91,72 +100,51 @@ const wr = ({
|
|
|
91
100
|
}), r;
|
|
92
101
|
}, D = () => {
|
|
93
102
|
if (!f.isEmpty(c)) {
|
|
94
|
-
const {
|
|
103
|
+
const {
|
|
104
|
+
onChangedData: r
|
|
105
|
+
} = c;
|
|
95
106
|
C && !f.isEqual(i, C) ? r(!0) : r(!1);
|
|
96
107
|
}
|
|
97
|
-
|
|
108
|
+
u && l && u(i), p && p(y(i, !0)), V || (L(Q), k && k(ir), w && w(() => y(i))), f.isEmpty(i) && Z(i);
|
|
98
109
|
};
|
|
99
110
|
F(() => {
|
|
100
111
|
l && D();
|
|
101
|
-
}, [JSON.stringify(
|
|
102
|
-
!l &&
|
|
103
|
-
}, [JSON.stringify(
|
|
104
|
-
!
|
|
112
|
+
}, [JSON.stringify(h), l]), F(() => {
|
|
113
|
+
!l && u && D();
|
|
114
|
+
}, [JSON.stringify(d), l]), F(() => (j && (c && c.setSecurityBeforeUnload(!0), window.addEventListener("beforeunload", N)), () => window.removeEventListener("beforeunload", N)), [j, N]), F(() => {
|
|
115
|
+
!V && g !== b && K(g);
|
|
105
116
|
}, [g]), F(() => {
|
|
106
|
-
const r = Object.values(a.current).reduce((t,
|
|
107
|
-
a.current && p && A !== r && (
|
|
108
|
-
}, [
|
|
109
|
-
a.current,
|
|
110
|
-
A,
|
|
111
|
-
p,
|
|
112
|
-
JSON.stringify(i)
|
|
113
|
-
]);
|
|
117
|
+
const r = Object.values(a.current).reduce((t, e) => t + (e?.length || 0), 0);
|
|
118
|
+
a.current && p && A !== r && (_(r), p(y(i, !0, a.current)));
|
|
119
|
+
}, [a.current, A, p, JSON.stringify(i)]);
|
|
114
120
|
const cr = {
|
|
115
|
-
skeletonize:
|
|
121
|
+
skeletonize: W,
|
|
116
122
|
handlerFieldChange: er,
|
|
117
123
|
handlerFieldValidate: sr,
|
|
118
124
|
handlerStoreValidators: (r, t) => {
|
|
119
|
-
a.current = {
|
|
125
|
+
a.current = {
|
|
126
|
+
...a.current,
|
|
127
|
+
[r]: t
|
|
128
|
+
};
|
|
120
129
|
},
|
|
121
130
|
handlerRemoveValidators: nr,
|
|
122
|
-
data: l ?
|
|
131
|
+
data: l ? h : d,
|
|
123
132
|
originalData: E,
|
|
124
|
-
fieldErrors:
|
|
125
|
-
externalFieldErrors:
|
|
133
|
+
fieldErrors: v,
|
|
134
|
+
externalFieldErrors: H,
|
|
126
135
|
isFormValid: I
|
|
127
136
|
};
|
|
128
|
-
return /* @__PURE__ */ x.jsxs(
|
|
129
|
-
/* @__PURE__ */ x.jsx(mr.Provider, { value: cr, children: /* @__PURE__ */ x.jsx(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
ref: tr,
|
|
134
|
-
style: M,
|
|
135
|
-
...fr(),
|
|
136
|
-
role: "presentation",
|
|
137
|
-
className: `form-component ${z}`,
|
|
138
|
-
children: W
|
|
139
|
-
}
|
|
140
|
-
) }),
|
|
141
|
-
/* @__PURE__ */ x.jsx(
|
|
142
|
-
ur,
|
|
143
|
-
{
|
|
144
|
-
zIndex: "99999999",
|
|
145
|
-
title: _ || "Dados Alterados",
|
|
146
|
-
text: $ || "Você possui dados alterados, confirma o fechamento?",
|
|
147
|
-
visible: !f.isEmpty(c) && c.showQuestion,
|
|
148
|
-
onConfirmClick: c ? c.onConfirmClick : () => {
|
|
149
|
-
},
|
|
150
|
-
onUnconfirmClick: c ? c.onUnconfirmClick : () => {
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
)
|
|
137
|
+
return /* @__PURE__ */ x.jsxs(ur, { children: [
|
|
138
|
+
/* @__PURE__ */ x.jsx(mr.Provider, { value: cr, children: /* @__PURE__ */ x.jsx("form", { id: Y, ref: tr, style: M, ...fr(), role: "presentation", className: `form-component ${z}`, children: X }) }),
|
|
139
|
+
/* @__PURE__ */ x.jsx(dr, { zIndex: "99999999", title: $ || "Dados Alterados", text: G || "Você possui dados alterados, confirma o fechamento?", visible: !f.isEmpty(c) && c.showQuestion, onConfirmClick: c ? c.onConfirmClick : () => {
|
|
140
|
+
}, onUnconfirmClick: c ? c.onUnconfirmClick : () => {
|
|
141
|
+
} })
|
|
154
142
|
] });
|
|
155
143
|
};
|
|
156
144
|
export {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
145
|
+
Ar as Field,
|
|
146
|
+
Dr as FieldArray,
|
|
147
|
+
Qr as FieldNumber,
|
|
148
|
+
Ur as FieldPeriod,
|
|
149
|
+
Cr as default
|
|
162
150
|
};
|
package/lib/form/withFieldHOC.js
CHANGED
|
@@ -1,53 +1,62 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { j as v } from "../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as y } from "../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import E, { useState as _, useEffect as j } from "react";
|
|
4
|
+
import { FormContext as b, withFieldContext as A, getValidatorsArray as g } from "./helpers.js";
|
|
5
|
+
const k = (F) => {
|
|
6
|
+
const w = (a) => {
|
|
7
|
+
const e = y.c(23), {
|
|
8
|
+
name: o,
|
|
9
|
+
validators: t,
|
|
10
|
+
handlerStoreValidators: n,
|
|
11
|
+
handlerRemoveValidators: i
|
|
12
|
+
} = a, [r, R] = _(void 0);
|
|
13
|
+
let s;
|
|
14
|
+
e[0] !== n || e[1] !== o || e[2] !== r || e[3] !== t ? (s = () => {
|
|
15
|
+
const p = g(t, r);
|
|
16
|
+
p && n && n(o, p);
|
|
17
|
+
}, e[0] = n, e[1] = o, e[2] = r, e[3] = t, e[4] = s) : s = e[4];
|
|
18
|
+
const l = s;
|
|
19
|
+
let f;
|
|
20
|
+
e[5] !== i || e[6] !== o || e[7] !== l || e[8] !== t ? (f = () => (l(), () => {
|
|
21
|
+
t && i && i(o);
|
|
22
|
+
}), e[5] = i, e[6] = o, e[7] = l, e[8] = t, e[9] = f) : f = e[9];
|
|
23
|
+
let d;
|
|
24
|
+
e[10] === Symbol.for("react.memo_cache_sentinel") ? (d = [], e[10] = d) : d = e[10], j(f, d);
|
|
25
|
+
let c;
|
|
26
|
+
e[11] !== l ? (c = () => {
|
|
27
|
+
l();
|
|
28
|
+
}, e[11] = l, e[12] = c) : c = e[12];
|
|
29
|
+
let u;
|
|
30
|
+
e[13] !== t ? (u = [t], e[13] = t, e[14] = u) : u = e[14], j(c, u);
|
|
31
|
+
let x;
|
|
32
|
+
e[15] === Symbol.for("react.memo_cache_sentinel") ? (x = (p) => {
|
|
33
|
+
R(p);
|
|
34
|
+
}, e[15] = x) : x = e[15];
|
|
35
|
+
let h;
|
|
36
|
+
e[16] !== r ? (h = {
|
|
37
|
+
validatorFromComponent: r,
|
|
38
|
+
handlerSetValidatorFromComponent: x
|
|
39
|
+
}, e[16] = r, e[17] = h) : h = e[17];
|
|
40
|
+
const V = h;
|
|
41
|
+
let m;
|
|
42
|
+
e[18] !== a ? (m = /* @__PURE__ */ v.jsx(F, { ...a }), e[18] = a, e[19] = m) : m = e[19];
|
|
43
|
+
let C;
|
|
44
|
+
return e[20] !== V || e[21] !== m ? (C = /* @__PURE__ */ v.jsx(A.Provider, { value: V, children: m }), e[20] = V, e[21] = m, e[22] = C) : C = e[22], C;
|
|
22
45
|
};
|
|
23
|
-
function
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
handlerFieldChange:
|
|
26
|
-
handlerFieldValidate:
|
|
27
|
-
data:
|
|
28
|
-
fieldErrors:
|
|
29
|
-
externalFieldErrors:
|
|
30
|
-
handlerStoreValidators:
|
|
31
|
-
handlerRemoveValidators:
|
|
32
|
-
skeletonize:
|
|
33
|
-
}) => /* @__PURE__ */
|
|
34
|
-
x,
|
|
35
|
-
{
|
|
36
|
-
...o,
|
|
37
|
-
skeletonize: m,
|
|
38
|
-
handlerFieldChange: t,
|
|
39
|
-
handlerFieldValidate: e,
|
|
40
|
-
handlerStoreValidators: l,
|
|
41
|
-
handlerRemoveValidators: d,
|
|
42
|
-
data: a,
|
|
43
|
-
fieldErrors: f,
|
|
44
|
-
externalFieldErrors: n,
|
|
45
|
-
forwardedRef: r
|
|
46
|
-
}
|
|
47
|
-
) });
|
|
46
|
+
function S(a, e) {
|
|
47
|
+
return /* @__PURE__ */ v.jsx(b.Consumer, { children: ({
|
|
48
|
+
handlerFieldChange: o,
|
|
49
|
+
handlerFieldValidate: t,
|
|
50
|
+
data: n,
|
|
51
|
+
fieldErrors: i,
|
|
52
|
+
externalFieldErrors: r,
|
|
53
|
+
handlerStoreValidators: R,
|
|
54
|
+
handlerRemoveValidators: s,
|
|
55
|
+
skeletonize: l
|
|
56
|
+
}) => /* @__PURE__ */ v.jsx(w, { ...a, skeletonize: l, handlerFieldChange: o, handlerFieldValidate: t, handlerStoreValidators: R, handlerRemoveValidators: s, data: n, fieldErrors: i, externalFieldErrors: r, forwardedRef: e }) });
|
|
48
57
|
}
|
|
49
|
-
return
|
|
58
|
+
return E.forwardRef(S);
|
|
50
59
|
};
|
|
51
60
|
export {
|
|
52
|
-
|
|
61
|
+
k as default
|
|
53
62
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { j as a } from "../chunks/jsx-runtime.
|
|
2
|
-
import
|
|
3
|
-
const h =
|
|
4
|
-
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { j as a } from "../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import d, { useRef as i, useState as m } from "react";
|
|
3
|
+
const h = d.createContext({}), k = (l) => (r) => {
|
|
4
|
+
const {
|
|
5
|
+
onOpenChange: e,
|
|
6
|
+
handlerClose: n
|
|
7
|
+
} = r, s = i(!1), o = i(!1), [f, c] = m(!1), u = () => {
|
|
8
|
+
s.current && o.current ? c(!0) : e ? e(!1) : n && n();
|
|
9
|
+
}, C = {
|
|
10
|
+
onChangedData: (t) => {
|
|
11
|
+
s.current = t;
|
|
9
12
|
},
|
|
10
13
|
showQuestion: f,
|
|
11
14
|
onConfirmClick: () => {
|
|
@@ -14,18 +17,12 @@ const h = C.createContext({}), k = (l) => (r) => {
|
|
|
14
17
|
onUnconfirmClick: () => {
|
|
15
18
|
c(!1);
|
|
16
19
|
},
|
|
17
|
-
setSecurityBeforeUnload: (
|
|
18
|
-
|
|
20
|
+
setSecurityBeforeUnload: (t) => {
|
|
21
|
+
o.current = t;
|
|
19
22
|
},
|
|
20
|
-
securityBeforeUnload:
|
|
23
|
+
securityBeforeUnload: o.current
|
|
21
24
|
};
|
|
22
|
-
return /* @__PURE__ */ a.jsx(h.Provider, { value:
|
|
23
|
-
l,
|
|
24
|
-
{
|
|
25
|
-
...r,
|
|
26
|
-
handlerClose: u
|
|
27
|
-
}
|
|
28
|
-
) });
|
|
25
|
+
return /* @__PURE__ */ a.jsx(h.Provider, { value: C, children: /* @__PURE__ */ a.jsx(l, { ...r, handlerClose: u }) });
|
|
29
26
|
};
|
|
30
27
|
export {
|
|
31
28
|
h as FormSecurityContext,
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as d } from "../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as p } from "../chunks/compiler-runtime.Cu50tn6L.js";
|
|
2
3
|
import '../assets/gridlayout.css';/* empty css */
|
|
3
|
-
const
|
|
4
|
-
const s =
|
|
4
|
+
const $ = (o) => {
|
|
5
|
+
const s = o ? o.split(" ") : [];
|
|
5
6
|
let t = "grid-container ";
|
|
6
7
|
return s[0] && (t += `col-xs-${s[0]}`), s[1] && (t += ` col-sm-${s[1]}`), s[2] && (t += ` col-md-${s[2]}`), s[3] && (t += ` col-lg-${s[3]}`), t;
|
|
7
|
-
},
|
|
8
|
-
const {
|
|
9
|
-
cols:
|
|
10
|
-
customClass:
|
|
11
|
-
children:
|
|
12
|
-
style:
|
|
13
|
-
visible:
|
|
14
|
-
} =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
) :
|
|
8
|
+
}, C = (o) => {
|
|
9
|
+
const s = p.c(6), {
|
|
10
|
+
cols: t,
|
|
11
|
+
customClass: a,
|
|
12
|
+
children: i,
|
|
13
|
+
style: c,
|
|
14
|
+
visible: m
|
|
15
|
+
} = o, f = m === void 0 ? !0 : m, r = t || "";
|
|
16
|
+
let l;
|
|
17
|
+
s[0] !== r ? (l = $(r), s[0] = r, s[1] = l) : l = s[1];
|
|
18
|
+
const u = l;
|
|
19
|
+
if (!f)
|
|
20
|
+
return null;
|
|
21
|
+
const n = `${a} ${u}`;
|
|
22
|
+
let e;
|
|
23
|
+
return s[2] !== i || s[3] !== c || s[4] !== n ? (e = /* @__PURE__ */ d.jsx("div", { className: n, style: c, children: i }), s[2] = i, s[3] = c, s[4] = n, s[5] = e) : e = s[5], e;
|
|
23
24
|
};
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
C as default
|
|
26
27
|
};
|