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,71 +1,68 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { j as i } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as S } from "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import { useState as $ } from "react";
|
|
4
|
+
import { _ as k } from "../../chunks/lodash.CIAK_hAg.js";
|
|
5
|
+
import z from "../base/InputTextBase.js";
|
|
6
|
+
import L from "./FileButtonSettings.js";
|
|
7
|
+
import _ from "../../buttons/Button.js";
|
|
8
|
+
import P from "../../icons/index.js";
|
|
8
9
|
import '../../assets/button.css';import '../../assets/DefaultFile.css';/* empty css */
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
const {
|
|
13
|
-
id:
|
|
14
|
-
accept:
|
|
15
|
-
onBtnClickInsert:
|
|
16
|
-
onBtnClickRemove:
|
|
17
|
-
inputRef:
|
|
18
|
-
defaultFiles:
|
|
19
|
-
hint:
|
|
20
|
-
onChange:
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
rightElements: /* @__PURE__ */ t.jsx(
|
|
56
|
-
y,
|
|
57
|
-
{
|
|
58
|
-
id: r,
|
|
59
|
-
onBtnClickInsert: p
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
children: [
|
|
63
|
-
j(),
|
|
64
|
-
v()
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
) });
|
|
10
|
+
import T from "../../popover/index.js";
|
|
11
|
+
import U from "../../popover/PopoverText.js";
|
|
12
|
+
const ee = (t) => {
|
|
13
|
+
const e = S.c(27), {
|
|
14
|
+
id: y,
|
|
15
|
+
accept: B,
|
|
16
|
+
onBtnClickInsert: x,
|
|
17
|
+
onBtnClickRemove: h,
|
|
18
|
+
inputRef: v,
|
|
19
|
+
defaultFiles: A,
|
|
20
|
+
hint: c,
|
|
21
|
+
onChange: j
|
|
22
|
+
} = t, n = y === void 0 ? "file" : y, g = B === void 0 ? "image/*" : B;
|
|
23
|
+
let m;
|
|
24
|
+
e[0] !== c ? (m = c === void 0 ? [] : c, e[0] = c, e[1] = m) : m = e[1];
|
|
25
|
+
const C = m, D = q, [a, I] = $(A), s = a instanceof Array && a.length > 0;
|
|
26
|
+
let p;
|
|
27
|
+
e[2] !== a || e[3] !== s ? (p = () => /* @__PURE__ */ i.jsx("div", { className: `size-position-icon ${s ? "" : "-disabled-popover"}`, children: /* @__PURE__ */ i.jsx(T, { iconSize: 16, children: /* @__PURE__ */ i.jsxs(U, { children: [
|
|
28
|
+
/* @__PURE__ */ i.jsx("strong", { children: "Arquivos" }),
|
|
29
|
+
/* @__PURE__ */ i.jsx("br", {}),
|
|
30
|
+
s && a.map(w)
|
|
31
|
+
] }) }) }), e[2] = a, e[3] = s, e[4] = p) : p = e[4];
|
|
32
|
+
const b = p;
|
|
33
|
+
let f;
|
|
34
|
+
e[5] !== s || e[6] !== h ? (f = () => /* @__PURE__ */ i.jsx(_, { disabled: !s, className: "-pointerEventsRemove", transparent: !0, boxShadow: !1, onClick: () => {
|
|
35
|
+
h(), I([]);
|
|
36
|
+
}, icon: /* @__PURE__ */ i.jsx(P, { customClass: "colorIconUpload", name: "close" }) }), e[5] = s, e[6] = h, e[7] = f) : f = e[7];
|
|
37
|
+
const F = f;
|
|
38
|
+
let d;
|
|
39
|
+
e[8] !== j ? (d = (R) => {
|
|
40
|
+
R.preventDefault?.();
|
|
41
|
+
const N = D(R.target.files);
|
|
42
|
+
I(N), j?.(N, R);
|
|
43
|
+
}, e[8] = j, e[9] = d) : d = e[9];
|
|
44
|
+
const E = d;
|
|
45
|
+
let o;
|
|
46
|
+
e[10] !== n || e[11] !== x ? (o = /* @__PURE__ */ i.jsx(L, { id: n, onBtnClickInsert: x }), e[10] = n, e[11] = x, e[12] = o) : o = e[12];
|
|
47
|
+
let l;
|
|
48
|
+
e[13] !== b ? (l = b(), e[13] = b, e[14] = l) : l = e[14];
|
|
49
|
+
let r;
|
|
50
|
+
e[15] !== F ? (r = F(), e[15] = F, e[16] = r) : r = e[16];
|
|
51
|
+
let u;
|
|
52
|
+
return e[17] !== g || e[18] !== E || e[19] !== C || e[20] !== n || e[21] !== v || e[22] !== t || e[23] !== o || e[24] !== l || e[25] !== r ? (u = /* @__PURE__ */ i.jsx("div", { className: "input-simple-file-container", children: /* @__PURE__ */ i.jsxs(z, { ...t, hint: C, readOnlyClass: "-disabledVisualApply", customClassForInputContent: "-absolute -pointEventDisabled -disabledVisualApply", type: "file", id: n, accept: g, inputRef: v, onChange: E, rightElements: o, children: [
|
|
53
|
+
l,
|
|
54
|
+
r
|
|
55
|
+
] }) }), e[17] = g, e[18] = E, e[19] = C, e[20] = n, e[21] = v, e[22] = t, e[23] = o, e[24] = l, e[25] = r, e[26] = u) : u = e[26], u;
|
|
68
56
|
};
|
|
57
|
+
function V(t) {
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
function q(t) {
|
|
61
|
+
return t?.length ? k.map(t, V) : [];
|
|
62
|
+
}
|
|
63
|
+
function w(t) {
|
|
64
|
+
return /* @__PURE__ */ i.jsx("div", { className: "list-simple-file", children: /* @__PURE__ */ i.jsx("div", { className: "file-name", children: /* @__PURE__ */ i.jsx("span", { children: t.name }) }) }, `${t.name}${t.size}`);
|
|
65
|
+
}
|
|
69
66
|
export {
|
|
70
|
-
|
|
67
|
+
ee as default
|
|
71
68
|
};
|
|
@@ -1,191 +1,135 @@
|
|
|
1
|
-
import { j as t } from "../../chunks/jsx-runtime.
|
|
2
|
-
import { useState as
|
|
3
|
-
import ee from "lodash";
|
|
1
|
+
import { j as t } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { useState as D, Fragment as w } from "react";
|
|
3
|
+
import { _ as ee } from "../../chunks/lodash.CIAK_hAg.js";
|
|
4
|
+
import "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
4
5
|
import "../../buttons/DefaultButton.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import S from "../../buttons/PrimaryButton.js";
|
|
7
|
+
import $ from "../../buttons/DangerButton.js";
|
|
8
|
+
import F from "../../icons/index.js";
|
|
8
9
|
import '../../assets/button.css';/* empty css */
|
|
9
10
|
import te from "../base/InputTextBase.js";
|
|
10
11
|
import se from "../../hint/index.js";
|
|
11
12
|
import { ErrorMessage as ae } from "../errorMessage/index.js";
|
|
12
|
-
const
|
|
13
|
+
const q = (n) => n?.length ? ee.map(n, (i) => i) : [], g = (n) => n.split(",").map((i) => i.includes(".") ? i.split(".")[1] : i.split("/")[1]).join(", "), re = (n) => n.split(", "), he = (n) => {
|
|
13
14
|
const {
|
|
14
|
-
id:
|
|
15
|
+
id: i = Math.random().toString(36).substring(2, 7),
|
|
15
16
|
accept: o = "image/png, image/jpeg",
|
|
16
|
-
labelButton:
|
|
17
|
-
subtitleDragDrop:
|
|
18
|
-
titleDragDrop:
|
|
19
|
-
onBtnClickInsert:
|
|
20
|
-
inputRef:
|
|
21
|
-
onChange:
|
|
22
|
-
onDragEnter:
|
|
23
|
-
onDragOver:
|
|
24
|
-
onDragLeave:
|
|
25
|
-
onDrop:
|
|
17
|
+
labelButton: L = "Selecionar",
|
|
18
|
+
subtitleDragDrop: f = "Selecione arquivos do tipo ",
|
|
19
|
+
titleDragDrop: u = "Arquivo para importação",
|
|
20
|
+
onBtnClickInsert: A,
|
|
21
|
+
inputRef: z,
|
|
22
|
+
onChange: C,
|
|
23
|
+
onDragEnter: M,
|
|
24
|
+
onDragOver: P,
|
|
25
|
+
onDragLeave: U,
|
|
26
|
+
onDrop: I,
|
|
26
27
|
showSubtitle: H = !0,
|
|
27
28
|
multiple: x = !1,
|
|
28
|
-
hint:
|
|
29
|
+
hint: R = [],
|
|
29
30
|
hintPosition: W = "below",
|
|
30
31
|
errorMessages: G = [],
|
|
31
|
-
skeletonize:
|
|
32
|
-
} =
|
|
32
|
+
skeletonize: b = !1
|
|
33
|
+
} = n, [J, N] = D(!1), [r, h] = D([]), [j, T] = D(!1), [c, m] = D({
|
|
33
34
|
class: "",
|
|
34
|
-
text:
|
|
35
|
-
subtitle:
|
|
35
|
+
text: u,
|
|
36
|
+
subtitle: f + g(o),
|
|
36
37
|
error: !1
|
|
37
38
|
}), v = (e) => {
|
|
38
|
-
|
|
39
|
-
(s = e.preventDefault) == null || s.call(e), (a = e.stopPropagation) == null || a.call(e);
|
|
39
|
+
e.preventDefault?.(), e.stopPropagation?.();
|
|
40
40
|
}, K = (e, s, a) => {
|
|
41
|
-
|
|
41
|
+
T(!1), s.forEach((l) => (!j && e.indexOf(l) === -1 && T(!0), j)), !x && (a.dataTransfer.items.length > 1 || r.length > 0) ? m({
|
|
42
42
|
class: "disapprovedFile",
|
|
43
43
|
text: "Não é permitido anexar mais de um arquivo.",
|
|
44
44
|
subtitle: "",
|
|
45
45
|
error: !0
|
|
46
|
-
}) :
|
|
46
|
+
}) : m(j ? {
|
|
47
47
|
class: "disapprovedFile",
|
|
48
48
|
text: "Por favor, verifique a extensão do(s) arquivo(s) inserido(s).",
|
|
49
49
|
subtitle: `Apenas as extensões ${g(o)} são permitidas.`,
|
|
50
50
|
error: !0
|
|
51
51
|
} : {
|
|
52
52
|
class: "approvedFile",
|
|
53
|
-
text:
|
|
54
|
-
subtitle:
|
|
53
|
+
text: u,
|
|
54
|
+
subtitle: f + g(o),
|
|
55
55
|
error: !1
|
|
56
56
|
});
|
|
57
57
|
}, Q = (e) => {
|
|
58
58
|
let s = [];
|
|
59
59
|
return e.dataTransfer.items && Array.from(e.dataTransfer.items).map((a) => (s.indexOf(a.type) === -1 && (s = [...s, a.type]), s)), s;
|
|
60
|
-
},
|
|
60
|
+
}, k = (e) => {
|
|
61
61
|
const s = re(o), a = Q(e);
|
|
62
|
-
K(s, a, e), v(e),
|
|
63
|
-
},
|
|
64
|
-
|
|
62
|
+
K(s, a, e), v(e), N(!0), M?.(e);
|
|
63
|
+
}, B = (e) => {
|
|
64
|
+
m({
|
|
65
65
|
class: "",
|
|
66
|
-
text:
|
|
67
|
-
subtitle:
|
|
66
|
+
text: u,
|
|
67
|
+
subtitle: f + g(o),
|
|
68
68
|
error: !1
|
|
69
|
-
}), v(e),
|
|
70
|
-
},
|
|
71
|
-
v(e),
|
|
72
|
-
},
|
|
73
|
-
v(e),
|
|
69
|
+
}), v(e), N(!1), U?.(e);
|
|
70
|
+
}, E = (e) => {
|
|
71
|
+
v(e), P?.(e);
|
|
72
|
+
}, O = (e) => {
|
|
73
|
+
v(e), N(!1);
|
|
74
74
|
const s = e.dataTransfer;
|
|
75
|
-
if (s && !
|
|
76
|
-
const a =
|
|
75
|
+
if (s && !c.error) {
|
|
76
|
+
const a = q(s.files);
|
|
77
77
|
if (a.length > 0) {
|
|
78
|
-
const l = r.concat(a),
|
|
79
|
-
|
|
78
|
+
const l = r.concat(a), y = l.map((d) => d.name), p = l.filter(({
|
|
79
|
+
name: d
|
|
80
|
+
}, _) => !y.includes(d, _ + 1));
|
|
81
|
+
h(p), C?.(a, e), I?.(e);
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
|
-
|
|
84
|
+
m({
|
|
83
85
|
class: "",
|
|
84
|
-
text:
|
|
85
|
-
subtitle:
|
|
86
|
+
text: u,
|
|
87
|
+
subtitle: f + g(o),
|
|
86
88
|
error: !1
|
|
87
89
|
});
|
|
88
90
|
}, V = (e) => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const s = I(e.target.files);
|
|
91
|
+
e.preventDefault?.();
|
|
92
|
+
const s = q(e.target.files);
|
|
92
93
|
if (s.length > 0 && !j) {
|
|
93
|
-
const
|
|
94
|
-
|
|
94
|
+
const a = r.concat(s), l = a.map((p) => p.name), y = a.filter(({
|
|
95
|
+
name: p
|
|
96
|
+
}, d) => !l.includes(p, d + 1));
|
|
97
|
+
h(y), C?.(s, e);
|
|
95
98
|
}
|
|
96
99
|
}, X = () => h([]), Y = (e) => {
|
|
97
100
|
h((s) => s.filter((a) => a.name !== e));
|
|
98
|
-
}, Z = () =>
|
|
99
|
-
r[0].type === "image/jpeg" || r[0].type === "image/png" ? /* @__PURE__ */ t.jsx("img", { alt: r[0].name, src: URL.createObjectURL(r[0]) }) : /* @__PURE__ */ t.jsx(
|
|
101
|
+
}, Z = () => r?.length === 1 ? /* @__PURE__ */ t.jsxs(w, { children: [
|
|
102
|
+
r[0].type === "image/jpeg" || r[0].type === "image/png" ? /* @__PURE__ */ t.jsx("img", { alt: r[0].name, src: URL.createObjectURL(r[0]) }) : /* @__PURE__ */ t.jsx(F, { size: 64, name: "file_excel" }),
|
|
100
103
|
/* @__PURE__ */ t.jsx("div", { className: "image-preview-solo", children: /* @__PURE__ */ t.jsx("div", { className: "description-file", children: /* @__PURE__ */ t.jsx("span", { className: "subtitle", children: r[0].name }) }) })
|
|
101
|
-
] }) : /* @__PURE__ */ t.jsx("ul", { className: "file-list", children: r.length > 0 && r.map((e) => /* @__PURE__ */ t.jsxs(
|
|
102
|
-
"
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
),
|
|
116
|
-
/* @__PURE__ */ t.jsx("div", { className: "image-content", children: (e.type === "image/jpeg" || e.type === "image/png") && /* @__PURE__ */ t.jsx(
|
|
117
|
-
"img",
|
|
118
|
-
{
|
|
119
|
-
alt: e.name,
|
|
120
|
-
className: "image-preview",
|
|
121
|
-
src: URL.createObjectURL(e)
|
|
122
|
-
}
|
|
123
|
-
) }),
|
|
124
|
-
/* @__PURE__ */ t.jsx("div", { className: "description-file", children: /* @__PURE__ */ t.jsx("span", { className: "subtitle", children: e.name }) })
|
|
125
|
-
]
|
|
126
|
-
},
|
|
127
|
-
`${e.name}${e.size}`
|
|
128
|
-
)) });
|
|
129
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "input-dragdrop-container", onDragEnter: O, onSubmit: (e) => e.preventDefault(), children: [
|
|
130
|
-
/* @__PURE__ */ t.jsxs("div", { className: `drag-content ${A ? "-skeletonized" : ""}`, children: [
|
|
131
|
-
/* @__PURE__ */ t.jsx("div", { className: `${p.class} ${A ? "" : "content"}`, children: p.error || r.length === 0 ? /* @__PURE__ */ t.jsxs("label", { htmlFor: n, children: [
|
|
132
|
-
/* @__PURE__ */ t.jsx("h1", { className: "title", style: { paddingBottom: "20px" }, children: p.text }),
|
|
133
|
-
H && /* @__PURE__ */ t.jsx("p", { className: "subtitle", children: p.subtitle }),
|
|
134
|
-
!A && /* @__PURE__ */ t.jsx(P, { onClick: C, label: w })
|
|
135
|
-
] }) : /* @__PURE__ */ t.jsxs(M, { children: [
|
|
104
|
+
] }) : /* @__PURE__ */ t.jsx("ul", { className: "file-list", children: r.length > 0 && r.map((e) => /* @__PURE__ */ t.jsxs("li", { className: "file-card", children: [
|
|
105
|
+
/* @__PURE__ */ t.jsx($, { transparent: !0, boxShadow: !1, className: "delete-button", onClick: () => Y(e.name), icon: /* @__PURE__ */ t.jsx(F, { customClass: "color-icon-upload", name: "close" }) }),
|
|
106
|
+
/* @__PURE__ */ t.jsx("div", { className: "image-content", children: (e.type === "image/jpeg" || e.type === "image/png") && /* @__PURE__ */ t.jsx("img", { alt: e.name, className: "image-preview", src: URL.createObjectURL(e) }) }),
|
|
107
|
+
/* @__PURE__ */ t.jsx("div", { className: "description-file", children: /* @__PURE__ */ t.jsx("span", { className: "subtitle", children: e.name }) })
|
|
108
|
+
] }, `${e.name}${e.size}`)) });
|
|
109
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "input-dragdrop-container", onDragEnter: k, onSubmit: (e) => e.preventDefault(), children: [
|
|
110
|
+
/* @__PURE__ */ t.jsxs("div", { className: `drag-content ${b ? "-skeletonized" : ""}`, children: [
|
|
111
|
+
/* @__PURE__ */ t.jsx("div", { className: `${c.class} ${b ? "" : "content"}`, children: c.error || r.length === 0 ? /* @__PURE__ */ t.jsxs("label", { htmlFor: i, children: [
|
|
112
|
+
/* @__PURE__ */ t.jsx("h1", { className: "title", style: {
|
|
113
|
+
paddingBottom: "20px"
|
|
114
|
+
}, children: c.text }),
|
|
115
|
+
H && /* @__PURE__ */ t.jsx("p", { className: "subtitle", children: c.subtitle }),
|
|
116
|
+
!b && /* @__PURE__ */ t.jsx(S, { onClick: A, label: L })
|
|
117
|
+
] }) : /* @__PURE__ */ t.jsxs(w, { children: [
|
|
136
118
|
Z(),
|
|
137
119
|
/* @__PURE__ */ t.jsxs("footer", { className: "footer-button-action", children: [
|
|
138
|
-
(!x && r.length < 1 || x) && /* @__PURE__ */ t.jsx(
|
|
139
|
-
|
|
140
|
-
{
|
|
141
|
-
className: "selectButton",
|
|
142
|
-
onClick: C,
|
|
143
|
-
label: w
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
/* @__PURE__ */ t.jsx(
|
|
147
|
-
U,
|
|
148
|
-
{
|
|
149
|
-
className: "cancelButton",
|
|
150
|
-
onClick: X,
|
|
151
|
-
icon: /* @__PURE__ */ t.jsx(B, { name: "close", color: "white" }),
|
|
152
|
-
label: "Limpar"
|
|
153
|
-
}
|
|
154
|
-
)
|
|
120
|
+
(!x && r.length < 1 || x) && /* @__PURE__ */ t.jsx(S, { className: "selectButton", onClick: A, label: L }),
|
|
121
|
+
/* @__PURE__ */ t.jsx($, { className: "cancelButton", onClick: X, icon: /* @__PURE__ */ t.jsx(F, { name: "close", color: "white" }), label: "Limpar" })
|
|
155
122
|
] })
|
|
156
123
|
] }) }),
|
|
157
|
-
/* @__PURE__ */ t.jsx(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
inputRef: _,
|
|
162
|
-
style: { display: "none" },
|
|
163
|
-
type: "file",
|
|
164
|
-
id: n,
|
|
165
|
-
accept: o,
|
|
166
|
-
multiple: x,
|
|
167
|
-
onDragOver: q,
|
|
168
|
-
onDrop: z,
|
|
169
|
-
onDragLeave: $,
|
|
170
|
-
onChange: V
|
|
171
|
-
}
|
|
172
|
-
),
|
|
173
|
-
J && /* @__PURE__ */ t.jsx(
|
|
174
|
-
"div",
|
|
175
|
-
{
|
|
176
|
-
className: "drag-position-element",
|
|
177
|
-
id: "dragFileElement",
|
|
178
|
-
onDragEnter: O,
|
|
179
|
-
onDragLeave: $,
|
|
180
|
-
onDragOver: q,
|
|
181
|
-
onDrop: z
|
|
182
|
-
}
|
|
183
|
-
)
|
|
124
|
+
/* @__PURE__ */ t.jsx(te, { ...n, inputRef: z, style: {
|
|
125
|
+
display: "none"
|
|
126
|
+
}, type: "file", id: i, accept: o, multiple: x, onDragOver: E, onDrop: O, onDragLeave: B, onChange: V }),
|
|
127
|
+
J && /* @__PURE__ */ t.jsx("div", { className: "drag-position-element", id: "dragFileElement", onDragEnter: k, onDragLeave: B, onDragOver: E, onDrop: O })
|
|
184
128
|
] }),
|
|
185
129
|
/* @__PURE__ */ t.jsx(ae, { messages: G }),
|
|
186
|
-
/* @__PURE__ */ t.jsx(se, { visible: !!
|
|
130
|
+
/* @__PURE__ */ t.jsx(se, { visible: !!R && W === "below", customClass: "hint", description: R })
|
|
187
131
|
] });
|
|
188
132
|
};
|
|
189
133
|
export {
|
|
190
|
-
|
|
134
|
+
he as default
|
|
191
135
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IFileProps } from './types';
|
|
2
|
-
declare const File: ({ applyDragDrop, defaultFiles, gridLayout, onBtnClickRemove: onBtnClickRemoveProp, ...rest }: Omit<IFileProps,
|
|
2
|
+
declare const File: ({ applyDragDrop, defaultFiles, gridLayout, onBtnClickRemove: onBtnClickRemoveProp, ...rest }: Omit<IFileProps, "onBtnClickInsert">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default File;
|
package/lib/inputs/file/File.js
CHANGED
|
@@ -1,46 +1,31 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { j as n } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { useRef as l, useEffect as u } from "react";
|
|
3
|
+
import p from "./DefaultFile.js";
|
|
4
|
+
import C from "./DragDropFile.js";
|
|
5
|
+
import "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
5
6
|
import '../../assets/gridlayout.css';/* empty css */
|
|
6
|
-
import
|
|
7
|
-
import { transformFilesToFileList as
|
|
8
|
-
const
|
|
9
|
-
applyDragDrop:
|
|
10
|
-
defaultFiles:
|
|
11
|
-
gridLayout:
|
|
7
|
+
import R from "../../gridlayout/GridCol.js";
|
|
8
|
+
import { transformFilesToFileList as k } from "./helpers.js";
|
|
9
|
+
const I = ({
|
|
10
|
+
applyDragDrop: m = !1,
|
|
11
|
+
defaultFiles: r,
|
|
12
|
+
gridLayout: o,
|
|
12
13
|
onBtnClickRemove: e,
|
|
13
|
-
...
|
|
14
|
+
...i
|
|
14
15
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
r.current && (r.current.value = ""), e && e();
|
|
16
|
+
const t = l(null), c = () => {
|
|
17
|
+
t.current?.click();
|
|
18
|
+
}, f = () => {
|
|
19
|
+
t.current && (t.current.value = ""), e && e();
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
const s =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
defaultFiles: t,
|
|
29
|
-
inputRef: r,
|
|
30
|
-
onBtnClickInsert: () => i()
|
|
31
|
-
}
|
|
32
|
-
) : /* @__PURE__ */ o.jsx(
|
|
33
|
-
C,
|
|
34
|
-
{
|
|
35
|
-
...c,
|
|
36
|
-
inputRef: r,
|
|
37
|
-
defaultFiles: t,
|
|
38
|
-
onBtnClickRemove: () => l(),
|
|
39
|
-
onBtnClickInsert: () => i()
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
return n !== void 0 ? /* @__PURE__ */ o.jsx(x, { customClass: "-withinput", cols: n, style: { height: "100%" }, children: s }) : s;
|
|
21
|
+
u(() => {
|
|
22
|
+
t?.current && r && (t.current.files = k(r));
|
|
23
|
+
}, [t?.current]);
|
|
24
|
+
const s = m ? /* @__PURE__ */ n.jsx(C, { ...i, defaultFiles: r, inputRef: t, onBtnClickInsert: () => c() }) : /* @__PURE__ */ n.jsx(p, { ...i, inputRef: t, defaultFiles: r, onBtnClickRemove: () => f(), onBtnClickInsert: () => c() });
|
|
25
|
+
return o !== void 0 ? /* @__PURE__ */ n.jsx(R, { customClass: "-withinput", cols: o, style: {
|
|
26
|
+
height: "100%"
|
|
27
|
+
}, children: s }) : s;
|
|
43
28
|
};
|
|
44
29
|
export {
|
|
45
|
-
|
|
30
|
+
I as default
|
|
46
31
|
};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { j as m } from "../../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as u } from "../../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import f from "../../buttons/Button.js";
|
|
4
|
+
import b from "../../icons/index.js";
|
|
4
5
|
import '../../assets/button.css';/* empty css */
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
const _ = (p) => {
|
|
7
|
+
const t = u.c(9), {
|
|
8
|
+
size: c,
|
|
9
|
+
labelButton: d,
|
|
10
|
+
id: s,
|
|
11
|
+
onBtnClickInsert: n
|
|
12
|
+
} = p, r = c === void 0 ? "medium" : c, a = d === void 0 ? "Selecionar" : d;
|
|
13
|
+
let o, l;
|
|
14
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {
|
|
15
|
+
height: "100%"
|
|
16
|
+
}, l = /* @__PURE__ */ m.jsx(b, { name: "file_download" }), t[0] = o, t[1] = l) : (o = t[0], l = t[1]);
|
|
17
|
+
let e;
|
|
18
|
+
t[2] !== a || t[3] !== n || t[4] !== r ? (e = /* @__PURE__ */ m.jsx(f, { className: "uploadButton simple-search-file-button -shadowsdisabled -transparent", onClick: n, size: r, style: o, icon: l, label: a }), t[2] = a, t[3] = n, t[4] = r, t[5] = e) : e = t[5];
|
|
19
|
+
let i;
|
|
20
|
+
return t[6] !== s || t[7] !== e ? (i = /* @__PURE__ */ m.jsx("label", { id: "", htmlFor: s, children: e }), t[6] = s, t[7] = e, t[8] = i) : i = t[8], i;
|
|
18
21
|
};
|
|
19
22
|
export {
|
|
20
|
-
|
|
23
|
+
_ as default
|
|
21
24
|
};
|
package/lib/inputs/inputHOC.js
CHANGED
|
@@ -1,24 +1,42 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
1
|
+
import { j as f } from "../chunks/jsx-runtime.D1SHvdVE.js";
|
|
2
|
+
import { c as F } from "../chunks/compiler-runtime.Cu50tn6L.js";
|
|
3
|
+
import { useState as E } from "react";
|
|
3
4
|
import '../assets/gridlayout.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
7
|
-
visible:
|
|
8
|
-
gridLayout:
|
|
9
|
-
} =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
import I from "../gridlayout/GridCol.js";
|
|
6
|
+
const g = (d) => (e) => {
|
|
7
|
+
const t = F.c(14), {
|
|
8
|
+
visible: v,
|
|
9
|
+
gridLayout: x
|
|
10
|
+
} = e, b = v === void 0 ? !0 : v, n = x === void 0 ? void 0 : x, [m, h] = E(!1), [a] = E(!1);
|
|
11
|
+
let i;
|
|
12
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
13
|
+
h(!0);
|
|
14
|
+
}, t[0] = i) : i = t[0];
|
|
15
|
+
const y = i;
|
|
16
|
+
let c;
|
|
17
|
+
t[1] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
|
|
18
|
+
h(!1);
|
|
19
|
+
}, t[1] = c) : c = t[1];
|
|
20
|
+
const C = c;
|
|
21
|
+
let l;
|
|
22
|
+
t[2] !== m || t[3] !== a ? (l = {
|
|
23
|
+
inputHasFocus: m,
|
|
24
|
+
requiredError: a,
|
|
25
|
+
onInputReceiveFocus: y,
|
|
26
|
+
onInputLostFocus: C
|
|
27
|
+
}, t[2] = m, t[3] = a, t[4] = l) : l = t[4];
|
|
28
|
+
const o = l;
|
|
29
|
+
let r;
|
|
30
|
+
t[5] !== o || t[6] !== e ? (r = /* @__PURE__ */ f.jsx(d, { ...e, ...o }), t[5] = o, t[6] = e, t[7] = r) : r = t[7];
|
|
31
|
+
let j = r;
|
|
32
|
+
if (n !== void 0 && b) {
|
|
33
|
+
let s;
|
|
34
|
+
t[8] !== o || t[9] !== e ? (s = /* @__PURE__ */ f.jsx(d, { ...e, ...o }), t[8] = o, t[9] = e, t[10] = s) : s = t[10];
|
|
35
|
+
let u;
|
|
36
|
+
t[11] !== n || t[12] !== s ? (u = /* @__PURE__ */ f.jsx(I, { customClass: "-withinput", cols: n, children: s }), t[11] = n, t[12] = s, t[13] = u) : u = t[13], j = u;
|
|
37
|
+
}
|
|
38
|
+
return j;
|
|
21
39
|
};
|
|
22
40
|
export {
|
|
23
|
-
|
|
41
|
+
g as default
|
|
24
42
|
};
|