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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import a from "react";
|
|
2
|
-
import l from "lodash";
|
|
2
|
+
import { _ as l } from "../../chunks/lodash.CIAK_hAg.js";
|
|
3
3
|
const p = ({
|
|
4
4
|
textAlign: r,
|
|
5
5
|
readOnly: t,
|
|
@@ -19,7 +19,9 @@ const p = ({
|
|
|
19
19
|
${o && " -disabled"}`;
|
|
20
20
|
}, c = (r, t, n) => {
|
|
21
21
|
let e = n || [];
|
|
22
|
-
return t ? null : (l.isArray(e) || (e = [e]), e = e.map((s, o) => s && a.cloneElement(s, {
|
|
22
|
+
return t ? null : (l.isArray(e) || (e = [e]), e = e.map((s, o) => s && a.cloneElement(s, {
|
|
23
|
+
key: `rightelement-${o + 1}`
|
|
24
|
+
})), e);
|
|
23
25
|
};
|
|
24
26
|
export {
|
|
25
27
|
p as getInputClass,
|
|
@@ -1,78 +1,57 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { j as c } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as N } from "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import { useState as R, useRef as S, useEffect as B } from "react";
|
|
4
|
+
import { _ as F } from "../../chunks/lodash.CIAK_hAg.js";
|
|
5
|
+
import T from "../text/index.js";
|
|
6
|
+
import _ from "../../buttons/Button.js";
|
|
6
7
|
import "../../icons/index.js";
|
|
7
8
|
import '../../assets/button.css';import '../../assets/index20.css';/* empty css */
|
|
8
|
-
const
|
|
9
|
-
const {
|
|
10
|
-
asTextField:
|
|
11
|
-
value:
|
|
12
|
-
onChange:
|
|
13
|
-
onButtonClick:
|
|
14
|
-
name:
|
|
15
|
-
} =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
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
|
-
],
|
|
52
|
-
rightElements: /* @__PURE__ */ e.jsx(
|
|
53
|
-
v,
|
|
54
|
-
{
|
|
55
|
-
className: "colorpicker-palettebutton",
|
|
56
|
-
onClick: C,
|
|
57
|
-
iconName: "pallete",
|
|
58
|
-
boxShadow: !1
|
|
59
|
-
},
|
|
60
|
-
"palettebutton"
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
) : /* @__PURE__ */ e.jsx(
|
|
64
|
-
"input",
|
|
65
|
-
{
|
|
66
|
-
name: s,
|
|
67
|
-
ref: a,
|
|
68
|
-
type: "color",
|
|
69
|
-
defaultValue: l,
|
|
70
|
-
onClick: (o) => r ? r(o) : void 0,
|
|
71
|
-
onInput: f
|
|
72
|
-
},
|
|
73
|
-
"inputColor"
|
|
74
|
-
);
|
|
9
|
+
const A = (l) => {
|
|
10
|
+
const t = N.c(17), {
|
|
11
|
+
asTextField: j,
|
|
12
|
+
value: y,
|
|
13
|
+
onChange: o,
|
|
14
|
+
onButtonClick: n,
|
|
15
|
+
name: a
|
|
16
|
+
} = l, g = j === void 0 ? !0 : j, i = y === void 0 ? "#aaaaaa" : y, [r, h] = R(i), s = S(null);
|
|
17
|
+
let u;
|
|
18
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = F.debounce(P, 300), t[0] = u) : u = t[0];
|
|
19
|
+
const E = u;
|
|
20
|
+
let m;
|
|
21
|
+
t[1] !== o ? (m = (e) => {
|
|
22
|
+
const {
|
|
23
|
+
target: b
|
|
24
|
+
} = e;
|
|
25
|
+
h(b.value), o && E(o, e);
|
|
26
|
+
}, t[1] = o, t[2] = m) : m = t[2];
|
|
27
|
+
const v = m;
|
|
28
|
+
let f;
|
|
29
|
+
t[3] !== o ? (f = (e) => {
|
|
30
|
+
const {
|
|
31
|
+
target: b
|
|
32
|
+
} = e;
|
|
33
|
+
h(b.value), o && (e.persist(), E(o, e));
|
|
34
|
+
}, t[3] = o, t[4] = f) : f = t[4];
|
|
35
|
+
const p = f;
|
|
36
|
+
let d;
|
|
37
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (d = () => {
|
|
38
|
+
s.current && s.current.click();
|
|
39
|
+
}, t[5] = d) : d = t[5];
|
|
40
|
+
const I = d;
|
|
41
|
+
let C, x;
|
|
42
|
+
t[6] !== i ? (C = () => {
|
|
43
|
+
h(i);
|
|
44
|
+
}, x = [i], t[6] = i, t[7] = C, t[8] = x) : (C = t[7], x = t[8]), B(C, x);
|
|
45
|
+
let k;
|
|
46
|
+
return t[9] !== g || t[10] !== r || t[11] !== a || t[12] !== n || t[13] !== v || t[14] !== p || t[15] !== l ? (k = g ? /* @__PURE__ */ c.jsx(T, { ...l, value: r, onChange: (e) => {
|
|
47
|
+
e && v(e);
|
|
48
|
+
}, leftElements: [/* @__PURE__ */ c.jsx("div", { className: "colorpicker-colormirror", style: {
|
|
49
|
+
background: r
|
|
50
|
+
} }, "colorMirror"), /* @__PURE__ */ c.jsx("input", { className: "colorpicker-hideinputcolor", ref: s, type: "color", defaultValue: r, name: a, onClick: (e) => n ? n(e) : void 0, onInput: p }, "inputColor")], rightElements: /* @__PURE__ */ c.jsx(_, { className: "colorpicker-palettebutton", onClick: I, iconName: "pallete", boxShadow: !1 }, "palettebutton") }) : /* @__PURE__ */ c.jsx("input", { name: a, ref: s, type: "color", defaultValue: r, onClick: (e) => n ? n(e) : void 0, onInput: p }, "inputColor"), t[9] = g, t[10] = r, t[11] = a, t[12] = n, t[13] = v, t[14] = p, t[15] = l, t[16] = k) : k = t[16], k;
|
|
75
51
|
};
|
|
52
|
+
function P(l, t) {
|
|
53
|
+
l(t);
|
|
54
|
+
}
|
|
76
55
|
export {
|
|
77
|
-
|
|
56
|
+
A as default
|
|
78
57
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { j as a } from "../../chunks/jsx-runtime.
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
1
|
+
import { j as a } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as h } from "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import { B as n } from "../../chunks/index.aw0XaUkg.js";
|
|
4
|
+
const p = (r) => {
|
|
5
|
+
const e = h.c(8), {
|
|
6
|
+
handlerClose: t,
|
|
7
|
+
children: l,
|
|
8
|
+
dialogSize: i
|
|
9
|
+
} = r;
|
|
10
|
+
let s;
|
|
11
|
+
e[0] !== t ? (s = () => t(!1), e[0] = t, e[1] = s) : s = e[1];
|
|
12
|
+
let o;
|
|
13
|
+
return e[2] !== l || e[3] !== i.height || e[4] !== i.width || e[5] !== t || e[6] !== s ? (o = /* @__PURE__ */ a.jsx(n, { closeOnEsc: !0, closeOnOutsideClick: !0, handlerClose: s, wrapperClassName: "", width: i.width, height: i.height, onOpenChange: t, children: l }), e[2] = l, e[3] = i.height, e[4] = i.width, e[5] = t, e[6] = s, e[7] = o) : o = e[7], o;
|
|
14
|
+
};
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
p as default
|
|
18
17
|
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, [
|
|
1
|
+
import { useRef as a, useEffect as o } from "react";
|
|
2
|
+
import d from "react-dom";
|
|
3
|
+
const p = 24, m = 250, h = (n) => {
|
|
4
|
+
const {
|
|
5
|
+
containerRef: r,
|
|
6
|
+
showButtonOpen: i,
|
|
7
|
+
dropdownRef: u,
|
|
8
|
+
children: s,
|
|
9
|
+
inputDimensions: e
|
|
10
|
+
} = n, t = a(document.createElement("div")), c = e && e.width + (i ? p : 0) + 4 || m;
|
|
11
|
+
return o(() => (t.current.className = "datepicker-component", t.current.style.width = String(c).concat("px"), t.current.style.top = String(e?.bottom).concat("px"), r.current?.appendChild(t.current), u(t.current), () => {
|
|
12
|
+
r.current?.removeChild(t.current);
|
|
13
|
+
}), []), o(() => {
|
|
14
|
+
t.current.style.width = String(c).concat("px"), t.current.style.top = String(e?.bottom).concat("px");
|
|
15
|
+
}, [n]), d.createPortal(s, t.current);
|
|
14
16
|
};
|
|
15
17
|
export {
|
|
16
|
-
|
|
18
|
+
h as default
|
|
17
19
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
let t =
|
|
4
|
-
return
|
|
1
|
+
import { h as o } from "../../chunks/moment.DMLRxgRE.js";
|
|
2
|
+
const e = "DD/MM/YYYY", Y = "YYYY-MM-DD", s = (r) => {
|
|
3
|
+
let t = r;
|
|
4
|
+
return o(t, e, !0).isValid() && (t = o(t, e).format(e)), typeof t == "string" ? o(t, Y) : t;
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
Y as EN_US_FORMAT,
|
|
8
|
+
e as PT_BR_FORMAT,
|
|
9
|
+
s as getMomentValue
|
|
10
10
|
};
|
package/lib/inputs/date/index.js
CHANGED
|
@@ -1,182 +1,136 @@
|
|
|
1
|
-
import { j as d } from "../../chunks/jsx-runtime.
|
|
2
|
-
import { useState as m, useRef as g, useEffect as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { j as d } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { useState as m, useRef as g, useEffect as w } from "react";
|
|
3
|
+
import { h as s } from "../../chunks/moment.DMLRxgRE.js";
|
|
4
|
+
import se from "./Dialog.js";
|
|
5
|
+
import le from "./Dropdown.js";
|
|
6
|
+
import "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
7
|
+
import ce from "../../buttons/Button.js";
|
|
7
8
|
import "../../icons/index.js";
|
|
8
9
|
import '../../assets/gridlayout.css';import '../../assets/button.css';import '../../assets/index21.css';/* empty css */
|
|
9
10
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { getMomentValue as
|
|
14
|
-
const
|
|
11
|
+
import ue from "../../gridlayout/GridCol.js";
|
|
12
|
+
import de from "../../calendar/base/index.js";
|
|
13
|
+
import fe from "../mask/BaseMask.js";
|
|
14
|
+
import { getMomentValue as me, EN_US_FORMAT as h, PT_BR_FORMAT as f } from "./helpers.js";
|
|
15
|
+
const Fe = (n) => {
|
|
15
16
|
const {
|
|
16
|
-
showButtonOpen:
|
|
17
|
+
showButtonOpen: O = !0,
|
|
17
18
|
openOnFocus: q = !0,
|
|
18
19
|
shouldCloseOnSelect: G = !0,
|
|
19
20
|
setFocusOnSelect: U = !0,
|
|
20
21
|
showCalendarInDialog: c = !1,
|
|
21
22
|
required: W = !1,
|
|
22
|
-
value:
|
|
23
|
+
value: r = "",
|
|
23
24
|
name: H = "",
|
|
24
|
-
inputRef:
|
|
25
|
-
dialogSize: J = {
|
|
26
|
-
|
|
25
|
+
inputRef: F,
|
|
26
|
+
dialogSize: J = {
|
|
27
|
+
width: "384px",
|
|
28
|
+
height: "384px"
|
|
29
|
+
},
|
|
30
|
+
gridLayout: S,
|
|
27
31
|
shouldCloseOnEsc: Q = !0
|
|
28
|
-
} =
|
|
32
|
+
} = n, [p, D] = m(r ? me(r) : void 0), [a, u] = m(!1), [x, j] = m(r), [X, V] = m(), [Y, v] = m(!1), [l, Z] = m({
|
|
29
33
|
disabled: !1,
|
|
30
34
|
readOnly: !1,
|
|
31
35
|
unvisible: !1,
|
|
32
36
|
hideContent: !1
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, ee = () => {
|
|
37
|
+
}), i = g(null), $ = g(null), y = g(null), L = g(null), B = g(null), R = g(null), k = () => {
|
|
38
|
+
V(i?.current?.getBoundingClientRect());
|
|
39
|
+
}, _ = () => {
|
|
37
40
|
u(!1), c && setTimeout(() => {
|
|
38
|
-
|
|
39
|
-
v(!1), (e = r.current) == null || e.focus();
|
|
41
|
+
v(!1), i.current?.focus();
|
|
40
42
|
}, 100);
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
const t = !((n = w.current) != null && n.contains(e.relatedTarget));
|
|
43
|
+
}, ee = (e) => {
|
|
44
|
+
const t = !R.current?.contains(e.relatedTarget);
|
|
44
45
|
!c && a && t && u(!1);
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
e.shiftKey && document.activeElement === _ ? (e.preventDefault(), K.focus()) : !e.shiftKey && document.activeElement === K && (e.preventDefault(), _.focus());
|
|
46
|
+
}, I = (e) => {
|
|
47
|
+
if (Q && a && e && e.key && e.key === "Escape" && (e.preventDefault(), u(!1), i.current?.focus()), a && c && e && e.key && e.key === "Tab") {
|
|
48
|
+
const t = B.current?.getElementsByClassName("navbutton"), b = (B.current?.getElementsByClassName("-selectedday"))[0].firstChild, C = Array.from([...t, b]), M = C[0], K = C[C.length - 1];
|
|
49
|
+
e.shiftKey && document.activeElement === M ? (e.preventDefault(), K.focus()) : !e.shiftKey && document.activeElement === K && (e.preventDefault(), M.focus());
|
|
50
50
|
}
|
|
51
51
|
e.stopPropagation();
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
u(!0), r.current && (r.current.focus(), L((e = r.current) == null ? void 0 : e.getBoundingClientRect())), c && setTimeout(() => {
|
|
59
|
-
var t;
|
|
60
|
-
(t = I.current) == null || t.focus();
|
|
52
|
+
}, E = () => {
|
|
53
|
+
const e = i.current?.getBoundingClientRect(), t = e && e.bottom;
|
|
54
|
+
y && y.current && e && (y.current.style.top = String(t).concat("px"));
|
|
55
|
+
}, P = () => {
|
|
56
|
+
u(!0), i.current && (i.current.focus(), V(i.current?.getBoundingClientRect())), c && setTimeout(() => {
|
|
57
|
+
L.current?.focus();
|
|
61
58
|
}, 100);
|
|
59
|
+
}, te = (e) => {
|
|
60
|
+
n.onFocus && n.onFocus(e), q && !a && !Y && P();
|
|
62
61
|
}, ne = (e) => {
|
|
63
|
-
|
|
62
|
+
n.onBlur && n.onBlur(e);
|
|
64
63
|
}, oe = (e) => {
|
|
65
|
-
o.onBlur && o.onBlur(e);
|
|
66
|
-
}, re = (e) => {
|
|
67
64
|
if (typeof e == "object" && !(e instanceof Date)) {
|
|
68
|
-
const t =
|
|
69
|
-
return t &&
|
|
65
|
+
const t = s(e.initial, f, !0).isValid(), o = s(e.final, f, !0).isValid();
|
|
66
|
+
return t && o;
|
|
70
67
|
}
|
|
71
|
-
return
|
|
72
|
-
},
|
|
68
|
+
return s(e, f, !0).isValid();
|
|
69
|
+
}, T = (e, t = "") => {
|
|
73
70
|
if (typeof t == "string") {
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
|
|
71
|
+
const o = e.target.value ?? "";
|
|
72
|
+
if (n.onChange) {
|
|
73
|
+
if (oe(o)) {
|
|
74
|
+
const C = {
|
|
75
|
+
target: {
|
|
76
|
+
value: s(o, f).format(h),
|
|
77
|
+
name: e.target.name
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
n.onChange(C, o);
|
|
79
81
|
} else if (e.target.value === "") {
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
+
const b = {
|
|
83
|
+
target: {
|
|
84
|
+
value: "",
|
|
85
|
+
name: e.target.name
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
n.onChange(b, o), u(!1), D(void 0);
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return /* @__PURE__ */ d.jsx(
|
|
91
|
-
de,
|
|
92
|
-
{
|
|
93
|
-
disabled: ie(),
|
|
94
|
-
tabIndex: -1,
|
|
95
|
-
customClass: "calendar-button",
|
|
96
|
-
iconName: "calendar",
|
|
97
|
-
title: a ? "Fechar Calendário" : "Abrir Calendário",
|
|
98
|
-
onClick: () => {
|
|
99
|
-
a ? u(!1) : T();
|
|
100
|
-
},
|
|
101
|
-
targetRef: (e) => {
|
|
102
|
-
$.current = e;
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"button-open-date-picker"
|
|
106
|
-
);
|
|
107
|
-
}, z = (e, t) => /* @__PURE__ */ d.jsx(
|
|
108
|
-
me,
|
|
109
|
-
{
|
|
110
|
-
colorStyle: t,
|
|
111
|
-
currentDate: e !== void 0 ? e : l(),
|
|
112
|
-
onDateChange: (n) => {
|
|
113
|
-
A(n.format(f), void 0), c && v(!1);
|
|
114
|
-
},
|
|
115
|
-
currentDateButton: (n) => I.current = n,
|
|
116
|
-
calendarContainer: (n) => {
|
|
117
|
-
B.current = n;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
), le = () => s && s.readOnly ? null : c ? /* @__PURE__ */ d.jsx(
|
|
121
|
-
ce,
|
|
122
|
-
{
|
|
123
|
-
dialogSize: J,
|
|
124
|
-
handlerClose: ee,
|
|
125
|
-
children: z(y, o == null ? void 0 : o.calendarColorStyle)
|
|
126
|
-
}
|
|
127
|
-
) : /* @__PURE__ */ d.jsx(
|
|
128
|
-
ue,
|
|
129
|
-
{
|
|
130
|
-
showButtonOpen: S,
|
|
131
|
-
inputDimensions: X,
|
|
132
|
-
containerRef: w,
|
|
133
|
-
dropdownRef: (e) => {
|
|
134
|
-
E.current = e;
|
|
135
|
-
},
|
|
136
|
-
children: z(y, o == null ? void 0 : o.calendarColorStyle)
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
if (F(() => {
|
|
140
|
-
i && l(i, h).format() !== "Invalid date" && l(j, h).format() !== l(i, h).format() ? (D(l(i, h)), V(i)) : !i && i !== j && (D(void 0), V(i));
|
|
141
|
-
}, [i]), F(() => (window.addEventListener("resize", R), document.addEventListener("keydown", P), r.current && R(), a && c && v(!0), () => {
|
|
142
|
-
window.removeEventListener("resize", R), document.removeEventListener("keydown", P);
|
|
143
|
-
}), [r.current, a]), F(() => {
|
|
144
|
-
var e;
|
|
145
|
-
return document.addEventListener("scroll", b), (e = document.getElementById("modal-dialog-content")) == null || e.addEventListener("scroll", b), () => {
|
|
146
|
-
var t;
|
|
147
|
-
document.removeEventListener("scroll", b), (t = document.getElementById("modal-dialog-content")) == null || t.removeEventListener("scroll", b);
|
|
148
|
-
};
|
|
149
|
-
}, []), s && s.unvisible) return null;
|
|
150
|
-
const M = () => /* @__PURE__ */ d.jsxs("div", { ref: w, onBlur: te, className: "datepicker-container", children: [
|
|
151
|
-
/* @__PURE__ */ d.jsx(
|
|
152
|
-
ge,
|
|
153
|
-
{
|
|
154
|
-
...o,
|
|
155
|
-
gridLayout: void 0,
|
|
156
|
-
value: y ? y.format(f) : " ",
|
|
157
|
-
mask: "00/00/0000",
|
|
158
|
-
onComplete: (e, t) => {
|
|
159
|
-
t && A(t, e);
|
|
160
|
-
},
|
|
161
|
-
onBlur: oe,
|
|
162
|
-
onFocus: (e) => {
|
|
163
|
-
ne(e);
|
|
164
|
-
},
|
|
165
|
-
onChange: (e, t) => {
|
|
166
|
-
t && N(e, t);
|
|
167
|
-
},
|
|
168
|
-
inputRef: (e) => {
|
|
169
|
-
r.current = e, p && (p.current = e);
|
|
170
|
-
},
|
|
171
|
-
rightElements: ae(),
|
|
172
|
-
required: W,
|
|
173
|
-
handlerSetOnDenied: () => Z(s)
|
|
92
|
+
}, N = (e, t) => {
|
|
93
|
+
a && U && i.current?.focus(), n.onComplete && n.onComplete(t, e), n.onChange && T({
|
|
94
|
+
target: {
|
|
95
|
+
value: e,
|
|
96
|
+
name: H
|
|
174
97
|
}
|
|
175
|
-
),
|
|
176
|
-
|
|
98
|
+
}, e), G && u(!1), D(s(e, f));
|
|
99
|
+
}, re = () => n.disabled || l && (l.disabled || l.hideContent), ie = () => {
|
|
100
|
+
if (O)
|
|
101
|
+
return /* @__PURE__ */ d.jsx(ce, { disabled: re(), tabIndex: -1, customClass: "calendar-button", iconName: "calendar", title: a ? "Fechar Calendário" : "Abrir Calendário", onClick: () => {
|
|
102
|
+
a ? u(!1) : P();
|
|
103
|
+
}, targetRef: (e) => {
|
|
104
|
+
$.current = e;
|
|
105
|
+
} }, "button-open-date-picker");
|
|
106
|
+
}, A = (e, t) => /* @__PURE__ */ d.jsx(de, { colorStyle: t, currentDate: e !== void 0 ? e : s(), onDateChange: (o) => {
|
|
107
|
+
N(o.format(f), void 0), c && v(!1);
|
|
108
|
+
}, currentDateButton: (o) => L.current = o, calendarContainer: (o) => {
|
|
109
|
+
B.current = o;
|
|
110
|
+
} }), ae = () => l && l.readOnly ? null : c ? /* @__PURE__ */ d.jsx(se, { dialogSize: J, handlerClose: _, children: A(p, n?.calendarColorStyle) }) : /* @__PURE__ */ d.jsx(le, { showButtonOpen: O, inputDimensions: X, containerRef: R, dropdownRef: (e) => {
|
|
111
|
+
y.current = e;
|
|
112
|
+
}, children: A(p, n?.calendarColorStyle) });
|
|
113
|
+
if (w(() => {
|
|
114
|
+
r && s(r, h).format() !== "Invalid date" && s(x, h).format() !== s(r, h).format() ? (D(s(r, h)), j(r)) : !r && r !== x && (D(void 0), j(r));
|
|
115
|
+
}, [r]), w(() => (window.addEventListener("resize", k), document.addEventListener("keydown", I), i.current && k(), a && c && v(!0), () => {
|
|
116
|
+
window.removeEventListener("resize", k), document.removeEventListener("keydown", I);
|
|
117
|
+
}), [i.current, a]), w(() => (document.addEventListener("scroll", E), document.getElementById("modal-dialog-content")?.addEventListener("scroll", E), () => {
|
|
118
|
+
document.removeEventListener("scroll", E), document.getElementById("modal-dialog-content")?.removeEventListener("scroll", E);
|
|
119
|
+
}), []), l && l.unvisible) return null;
|
|
120
|
+
const z = () => /* @__PURE__ */ d.jsxs("div", { ref: R, onBlur: ee, className: "datepicker-container", children: [
|
|
121
|
+
/* @__PURE__ */ d.jsx(fe, { ...n, gridLayout: void 0, value: p ? p.format(f) : " ", mask: "00/00/0000", onComplete: (e, t) => {
|
|
122
|
+
t && N(t, e);
|
|
123
|
+
}, onBlur: ne, onFocus: (e) => {
|
|
124
|
+
te(e);
|
|
125
|
+
}, onChange: (e, t) => {
|
|
126
|
+
t && T(e, t);
|
|
127
|
+
}, inputRef: (e) => {
|
|
128
|
+
i.current = e, F && (F.current = e);
|
|
129
|
+
}, rightElements: ie(), required: W, handlerSetOnDenied: () => Z(l) }),
|
|
130
|
+
a && ae()
|
|
177
131
|
] });
|
|
178
|
-
return
|
|
132
|
+
return S ? /* @__PURE__ */ d.jsx(ue, { customClass: "-withinput", cols: S, children: z() }) : z();
|
|
179
133
|
};
|
|
180
134
|
export {
|
|
181
|
-
|
|
135
|
+
Fe as default
|
|
182
136
|
};
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { j as f } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as u } from "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import { forwardRef as g } from "react";
|
|
4
|
+
import '../../assets/index7.css';const d = g((c, a) => {
|
|
5
|
+
const s = u.c(9), {
|
|
6
|
+
customClass: i,
|
|
7
|
+
messages: e,
|
|
8
|
+
style: m
|
|
9
|
+
} = c, p = i === void 0 ? "" : i;
|
|
10
|
+
if (!e || e.length === 0)
|
|
11
|
+
return null;
|
|
12
|
+
let r;
|
|
13
|
+
s[0] !== e ? (r = Array.isArray(e) ? e : [e], s[0] = e, s[1] = r) : r = s[1];
|
|
14
|
+
const l = r, n = `errormessages-component ${p}`;
|
|
15
|
+
let t;
|
|
16
|
+
s[2] !== l ? (t = l.join(", "), s[2] = l, s[3] = t) : t = s[3];
|
|
17
|
+
let o;
|
|
18
|
+
return s[4] !== a || s[5] !== m || s[6] !== n || s[7] !== t ? (o = /* @__PURE__ */ f.jsx("p", { ref: a, style: m, className: n, children: t }), s[4] = a, s[5] = m, s[6] = n, s[7] = t, s[8] = o) : o = s[8], o;
|
|
11
19
|
});
|
|
12
|
-
|
|
20
|
+
d.displayName = "ErrorMessage";
|
|
13
21
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
d as ErrorMessage,
|
|
23
|
+
d as default
|
|
16
24
|
};
|