@alixpartners/ui-components 2.4.1 → 2.4.3
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/dist/assets/FilePicker.css +1 -1
- package/dist/assets/SplitButton.css +1 -1
- package/dist/assets/ap-icons-types.d.ts +1 -1
- package/dist/assets/ap-icons.d.ts +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +5 -3
- package/dist/components/DragAndDrop/DragAndDrop.js +103 -101
- package/dist/components/FilePicker/FilePicker.d.ts +6 -2
- package/dist/components/FilePicker/FilePicker.js +197 -189
- package/dist/components/Icons/IconsGallery.js +1 -1
- package/dist/components/SplitButton/SplitButton.js +132 -127
- package/dist/components/Tooltip/Tooltip.d.ts +3 -1
- package/dist/components/Tooltip/Tooltip.js +200 -196
- package/package.json +1 -1
|
@@ -1,243 +1,251 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { c as
|
|
7
|
-
import '../../assets/FilePicker.css';const
|
|
8
|
-
container:
|
|
9
|
-
containerMultiple:
|
|
10
|
-
label:
|
|
11
|
-
required:
|
|
12
|
-
labelTooltipIcon:
|
|
13
|
-
helpers:
|
|
14
|
-
helperText:
|
|
15
|
-
errorMessage:
|
|
16
|
-
singleFileHelpLinkContainer:
|
|
17
|
-
singleFileHelpLinkReservedSpace:
|
|
18
|
-
helpLink:
|
|
19
|
-
input:
|
|
20
|
-
singleFileContainer:
|
|
21
|
-
singleFileInputContainer:
|
|
22
|
-
inputFileName:
|
|
23
|
-
inputFileNamePlaceholder:
|
|
24
|
-
inputButton:
|
|
25
|
-
multipleHelpText:
|
|
26
|
-
multipleInputButton:
|
|
27
|
-
multipleFilesList:
|
|
28
|
-
multipleFilesListItem:
|
|
29
|
-
multipleFilesListItemContent:
|
|
30
|
-
multipleFilesListItemContentData:
|
|
31
|
-
multipleFilesListItemIconContainer:
|
|
32
|
-
multipleFilesListItemIcon:
|
|
33
|
-
multipleFilesListItemText:
|
|
34
|
-
multipleFilesListItemName:
|
|
35
|
-
multipleFilesListItemSize:
|
|
36
|
-
multipleFilesListItemError:
|
|
37
|
-
multipleFilesListItemIconError:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as ae, useId as pe, useRef as ue, useState as M, useCallback as _, useEffect as me, useContext as de } from "react";
|
|
3
|
+
import _e from "../Tooltip/Tooltip.js";
|
|
4
|
+
import B from "../Icon/Icon.js";
|
|
5
|
+
import y from "../Button/Button.js";
|
|
6
|
+
import { c as D } from "../../clsx-OuTLNxxd.js";
|
|
7
|
+
import '../../assets/FilePicker.css';const Fe = "FilePicker-module__container___knCCi", Ie = "FilePicker-module__containerMultiple___Psi5u", Le = "FilePicker-module__label___al7Xe", he = "FilePicker-module__required___41Vjd", ke = "FilePicker-module__labelTooltipIcon___Cc1QF", ge = "FilePicker-module__helpers___79-g5", fe = "FilePicker-module__helperText___ja9Rr", Ne = "FilePicker-module__errorMessage___TvHrL", Pe = "FilePicker-module__singleFileHelpLinkContainer___mpjUf", Ce = "FilePicker-module__singleFileHelpLinkReservedSpace___r8j2b", Te = "FilePicker-module__helpLink___uu45D", be = "FilePicker-module__input___cL1Hs", xe = "FilePicker-module__singleFileContainer___OFSDt", ye = "FilePicker-module__singleFileInputContainer___MOkES", De = "FilePicker-module__inputFileName___sMs7R", Se = "FilePicker-module__inputFileNamePlaceholder___-mkDD", we = "FilePicker-module__inputButton___ghLlD", Be = "FilePicker-module__multipleHelpText___5tnnn", Re = "FilePicker-module__multipleInputButton___WCJp9", He = "FilePicker-module__multipleFilesList___Kim0I", ve = "FilePicker-module__multipleFilesListItem___01PDS", Me = "FilePicker-module__multipleFilesListItemContent___pKbho", Ae = "FilePicker-module__multipleFilesListItemContentData___5GC-C", Ee = "FilePicker-module__multipleFilesListItemIconContainer___7sUL5", ze = "FilePicker-module__multipleFilesListItemIcon___nfMX9", je = "FilePicker-module__multipleFilesListItemText___nPqrL", Oe = "FilePicker-module__multipleFilesListItemName___NjHhX", Ve = "FilePicker-module__multipleFilesListItemSize___wc8LJ", Ke = "FilePicker-module__multipleFilesListItemError___x9qkT", qe = "FilePicker-module__multipleFilesListItemIconError___0RO46", Xe = "FilePicker-module__multipleFilesListItemAppendedRow___nzls7", $e = "FilePicker-module__multipleFilesListItemIconDelete___9Z9Dl", Ye = "FilePicker-module__disabled___szMiq", i = {
|
|
8
|
+
container: Fe,
|
|
9
|
+
containerMultiple: Ie,
|
|
10
|
+
label: Le,
|
|
11
|
+
required: he,
|
|
12
|
+
labelTooltipIcon: ke,
|
|
13
|
+
helpers: ge,
|
|
14
|
+
helperText: fe,
|
|
15
|
+
errorMessage: Ne,
|
|
16
|
+
singleFileHelpLinkContainer: Pe,
|
|
17
|
+
singleFileHelpLinkReservedSpace: Ce,
|
|
18
|
+
helpLink: Te,
|
|
19
|
+
input: be,
|
|
20
|
+
singleFileContainer: xe,
|
|
21
|
+
singleFileInputContainer: ye,
|
|
22
|
+
inputFileName: De,
|
|
23
|
+
inputFileNamePlaceholder: Se,
|
|
24
|
+
inputButton: we,
|
|
25
|
+
multipleHelpText: Be,
|
|
26
|
+
multipleInputButton: Re,
|
|
27
|
+
multipleFilesList: He,
|
|
28
|
+
multipleFilesListItem: ve,
|
|
29
|
+
multipleFilesListItemContent: Me,
|
|
30
|
+
multipleFilesListItemContentData: Ae,
|
|
31
|
+
multipleFilesListItemIconContainer: Ee,
|
|
32
|
+
multipleFilesListItemIcon: ze,
|
|
33
|
+
multipleFilesListItemText: je,
|
|
34
|
+
multipleFilesListItemName: Oe,
|
|
35
|
+
multipleFilesListItemSize: Ve,
|
|
36
|
+
multipleFilesListItemError: Ke,
|
|
37
|
+
multipleFilesListItemIconError: qe,
|
|
38
|
+
multipleFilesListItemAppendedRow: Xe,
|
|
39
|
+
multipleFilesListItemIconDelete: $e,
|
|
40
|
+
disabled: Ye
|
|
41
|
+
}, A = ae(null);
|
|
42
|
+
function p() {
|
|
43
|
+
const e = de(A);
|
|
43
44
|
if (!e)
|
|
44
45
|
throw new Error("FilePicker compound components must be used within a FilePicker.");
|
|
45
46
|
return e;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
const Ge = (e) => `File size is too large. Must be up to ${e}MB.`, Je = (e) => `The file format is incorrect. Please make sure it is one of the extensions: ${e}.`;
|
|
49
|
+
function Ze(e) {
|
|
48
50
|
const l = e.name.toLowerCase();
|
|
49
51
|
return l.includes(".") ? l.split(".").pop() ?? "" : "";
|
|
50
52
|
}
|
|
51
|
-
function
|
|
53
|
+
function Qe({
|
|
52
54
|
type: e = "single",
|
|
53
|
-
maxFiles: l =
|
|
55
|
+
maxFiles: l = Number.POSITIVE_INFINITY,
|
|
54
56
|
fileExtensionsAllowed: s,
|
|
55
|
-
maxSize:
|
|
56
|
-
queueFiles:
|
|
57
|
-
disabled:
|
|
58
|
-
isUploadDisabled:
|
|
59
|
-
value:
|
|
60
|
-
label:
|
|
61
|
-
required:
|
|
62
|
-
placeholder:
|
|
57
|
+
maxSize: o = Number.POSITIVE_INFINITY,
|
|
58
|
+
queueFiles: I = !1,
|
|
59
|
+
disabled: a = !1,
|
|
60
|
+
isUploadDisabled: z = !1,
|
|
61
|
+
value: h,
|
|
62
|
+
label: j,
|
|
63
|
+
required: O = !1,
|
|
64
|
+
placeholder: V,
|
|
63
65
|
errorMessage: K,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
maxSizeErrorMessage: k,
|
|
67
|
+
fileExtensionInvalidErrorMessage: g,
|
|
68
|
+
helpText: q,
|
|
69
|
+
helpLink: X,
|
|
66
70
|
helpLinkText: $,
|
|
67
|
-
multipleHelpText:
|
|
68
|
-
multipleButtonHelpText:
|
|
69
|
-
labelTooltip:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
multipleHelpText: Y,
|
|
72
|
+
multipleButtonHelpText: G,
|
|
73
|
+
labelTooltip: J,
|
|
74
|
+
uploadedFileAppendedRow: Z,
|
|
75
|
+
onUpload: d,
|
|
76
|
+
onRemoveFile: f,
|
|
77
|
+
children: N
|
|
73
78
|
}) {
|
|
74
|
-
const
|
|
79
|
+
const R = pe(), P = ue(null), [u, C] = M(h ? h.map((n) => ({
|
|
75
80
|
file: n
|
|
76
|
-
})) : []), [
|
|
77
|
-
const
|
|
78
|
-
return n.map((
|
|
79
|
-
const
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
error: y
|
|
81
|
+
})) : []), [Q, S] = M(!1), T = s.join(", "), H = s.map((n) => `.${n.replace(/^\./, "")}`).join(","), b = _((n) => {
|
|
82
|
+
const r = o ? o * 1024 * 1024 : Number.POSITIVE_INFINITY, m = new Set(s.map((L) => L.toLowerCase().replace(/^\./, ""))), x = (k == null ? void 0 : k.replace(/\{maxSize\}/g, String(o))) ?? Ge(o), se = (g == null ? void 0 : g.replace(/\{fileExtensionsAllowed\}/g, T)) ?? Je(T);
|
|
83
|
+
return n.map((L) => {
|
|
84
|
+
const oe = L.size <= r, re = m.size === 0 || m.has(Ze(L));
|
|
85
|
+
let w;
|
|
86
|
+
return oe || (w = x), re || (w = se), {
|
|
87
|
+
file: L,
|
|
88
|
+
error: w
|
|
85
89
|
};
|
|
86
90
|
});
|
|
87
|
-
}, [s,
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
}, [l,
|
|
91
|
-
|
|
92
|
-
const n =
|
|
93
|
-
|
|
94
|
-
}, [
|
|
95
|
-
const
|
|
91
|
+
}, [s, T, o, k, g]), v = _((n) => {
|
|
92
|
+
const r = u.length;
|
|
93
|
+
return S(r + n.length > l), b(n);
|
|
94
|
+
}, [l, u.length, b]);
|
|
95
|
+
me(() => {
|
|
96
|
+
const n = b(h ?? []);
|
|
97
|
+
C(n), S(n.length > l);
|
|
98
|
+
}, [h, l, b]);
|
|
99
|
+
const U = _((n) => (n / 1024).toFixed(2) + " KB", []), W = _(() => {
|
|
96
100
|
var n;
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
var
|
|
100
|
-
|
|
101
|
-
}, [
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
if (e === "multiple" &&
|
|
105
|
-
const
|
|
106
|
-
|
|
101
|
+
a || (n = P.current) == null || n.click();
|
|
102
|
+
}, [a]), ee = _((n) => {
|
|
103
|
+
var r;
|
|
104
|
+
a || n.key === "Enter" && ((r = P.current) == null || r.click());
|
|
105
|
+
}, [a]), le = _((n) => {
|
|
106
|
+
if (a) return;
|
|
107
|
+
const r = n.target.files, m = v(Array.from(r ?? []));
|
|
108
|
+
if (e === "multiple" && I) {
|
|
109
|
+
const x = [...u, ...m];
|
|
110
|
+
C(x), d == null || d(x);
|
|
107
111
|
} else
|
|
108
|
-
|
|
112
|
+
C(m), d == null || d(m);
|
|
109
113
|
n.target.value = "";
|
|
110
|
-
}, [
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
}, [
|
|
115
|
-
id:
|
|
114
|
+
}, [a, e, I, u, v, d]), ie = _((n) => {
|
|
115
|
+
if (a || !u) return;
|
|
116
|
+
const r = u.filter((m) => m.file.name !== n);
|
|
117
|
+
S(r.length > l), C(r), f == null || f(n);
|
|
118
|
+
}, [a, u, l, f]), te = {
|
|
119
|
+
id: R,
|
|
116
120
|
type: e,
|
|
117
121
|
maxFiles: l,
|
|
118
122
|
fileExtensionsAllowed: s,
|
|
119
|
-
fileExtensionsAllowedText:
|
|
120
|
-
maxSize:
|
|
121
|
-
queueFiles:
|
|
122
|
-
disabled:
|
|
123
|
-
isUploadDisabled:
|
|
124
|
-
uploadedFiles:
|
|
125
|
-
isMaxFilesExceeded:
|
|
126
|
-
label:
|
|
127
|
-
required:
|
|
128
|
-
placeholder:
|
|
123
|
+
fileExtensionsAllowedText: T,
|
|
124
|
+
maxSize: o,
|
|
125
|
+
queueFiles: I,
|
|
126
|
+
disabled: a,
|
|
127
|
+
isUploadDisabled: z,
|
|
128
|
+
uploadedFiles: u,
|
|
129
|
+
isMaxFilesExceeded: Q,
|
|
130
|
+
label: j,
|
|
131
|
+
required: O,
|
|
132
|
+
placeholder: V,
|
|
129
133
|
errorMessage: K,
|
|
130
|
-
helpText:
|
|
131
|
-
helpLink:
|
|
134
|
+
helpText: q,
|
|
135
|
+
helpLink: X,
|
|
132
136
|
helpLinkText: $,
|
|
133
|
-
multipleHelpText:
|
|
134
|
-
multipleButtonHelpText:
|
|
135
|
-
labelTooltip:
|
|
136
|
-
accept:
|
|
137
|
-
inputRef:
|
|
138
|
-
triggerInput:
|
|
139
|
-
handleKeyDown:
|
|
140
|
-
handleRemoveFile:
|
|
141
|
-
displayFileSize:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/* @__PURE__ */
|
|
137
|
+
multipleHelpText: Y,
|
|
138
|
+
multipleButtonHelpText: G,
|
|
139
|
+
labelTooltip: J,
|
|
140
|
+
accept: H,
|
|
141
|
+
inputRef: P,
|
|
142
|
+
triggerInput: W,
|
|
143
|
+
handleKeyDown: ee,
|
|
144
|
+
handleRemoveFile: ie,
|
|
145
|
+
displayFileSize: U,
|
|
146
|
+
uploadedFileAppendedRow: Z
|
|
147
|
+
}, ne = N != null && (Array.isArray(N) ? N.length > 0 : !0);
|
|
148
|
+
return /* @__PURE__ */ c(A.Provider, { value: te, children: [
|
|
149
|
+
/* @__PURE__ */ t("input", { accept: H, multiple: e === "multiple", ref: P, type: "file", id: R, className: i.input, onChange: le }),
|
|
150
|
+
/* @__PURE__ */ t("div", { className: D(i.container, e === "multiple" && i.containerMultiple, a && i.disabled), children: ne ? N : /* @__PURE__ */ t(Ue, {}) })
|
|
146
151
|
] });
|
|
147
152
|
}
|
|
148
|
-
function
|
|
149
|
-
const e =
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
e.type === "single" && /* @__PURE__ */
|
|
153
|
-
e.type === "single" && e.uploadedFiles.length > 0 && /* @__PURE__ */
|
|
154
|
-
e.type === "multiple" && /* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
153
|
+
function Ue() {
|
|
154
|
+
const e = p();
|
|
155
|
+
return /* @__PURE__ */ c(ce, { children: [
|
|
156
|
+
/* @__PURE__ */ t(F.Label, {}),
|
|
157
|
+
e.type === "single" && /* @__PURE__ */ t(F.SingleFileRow, { children: /* @__PURE__ */ t(F.BrowseButton, {}) }),
|
|
158
|
+
e.type === "single" && e.uploadedFiles.length > 0 && /* @__PURE__ */ t("span", { className: i.singleFileHelpLinkReservedSpace, children: /* @__PURE__ */ t(F.SingleFileDeleteButton, {}) }),
|
|
159
|
+
e.type === "multiple" && /* @__PURE__ */ t(F.BrowseButton, {}),
|
|
160
|
+
/* @__PURE__ */ t(F.HelpText, {}),
|
|
161
|
+
/* @__PURE__ */ t(F.UploadedFilesList, {})
|
|
157
162
|
] });
|
|
158
163
|
}
|
|
159
|
-
function
|
|
164
|
+
function We({
|
|
160
165
|
children: e
|
|
161
166
|
}) {
|
|
162
|
-
const l =
|
|
163
|
-
return /* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
l.required && /* @__PURE__ */
|
|
166
|
-
l.labelTooltip && /* @__PURE__ */
|
|
167
|
-
l.type === "multiple" && l.multipleHelpText && /* @__PURE__ */
|
|
167
|
+
const l = p(), s = e ?? l.label;
|
|
168
|
+
return /* @__PURE__ */ c("label", { htmlFor: l.id, onClick: (o) => o.preventDefault(), className: D(i.label, l.type === "multiple" && i.labelMultiple), children: [
|
|
169
|
+
/* @__PURE__ */ t("span", { title: l.label, className: i.labelText, children: s }),
|
|
170
|
+
l.required && /* @__PURE__ */ t("span", { "aria-hidden": "true", className: i.required, children: "*" }),
|
|
171
|
+
l.labelTooltip && /* @__PURE__ */ t(_e, { content: l.labelTooltip.content, size: l.labelTooltip.size, theme: l.labelTooltip.theme, tipSide: l.labelTooltip.tipSide, tipAlignment: l.labelTooltip.tipAlignment, startVisible: l.labelTooltip.startVisible, children: /* @__PURE__ */ t(B, { icon: "ap-icon-info", className: i.labelTooltipIcon }) }),
|
|
172
|
+
l.type === "multiple" && l.multipleHelpText && /* @__PURE__ */ t("span", { className: i.multipleHelpText, children: l.multipleHelpText })
|
|
168
173
|
] });
|
|
169
174
|
}
|
|
170
|
-
function
|
|
175
|
+
function el({
|
|
171
176
|
children: e,
|
|
172
177
|
className: l
|
|
173
178
|
}) {
|
|
174
|
-
const s =
|
|
175
|
-
return s.type === "multiple" ? /* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
}, children: /* @__PURE__ */
|
|
179
|
+
const s = p();
|
|
180
|
+
return s.type === "multiple" ? /* @__PURE__ */ t(y, { type: "secondary", variant: "default", size: "md", icon: "ap-icon-upload", className: D(i.multipleInputButton, l), onClick: s.triggerInput, onKeyDown: s.handleKeyDown, disabled: s.disabled || s.isUploadDisabled, children: /* @__PURE__ */ t("span", { children: e ?? `Browse files ${s.multipleButtonHelpText ?? ""}` }) }) : /* @__PURE__ */ t(y, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-upload", className: D(i.inputButton, l), tabIndex: -1, disabled: s.disabled || s.isUploadDisabled, onClick: (o) => {
|
|
181
|
+
o.preventDefault(), o.stopPropagation(), s.triggerInput();
|
|
182
|
+
}, children: /* @__PURE__ */ t("span", { children: e ?? "Browse file" }) });
|
|
178
183
|
}
|
|
179
|
-
function
|
|
184
|
+
function ll({
|
|
180
185
|
children: e
|
|
181
186
|
}) {
|
|
182
|
-
return
|
|
187
|
+
return p().type !== "single" ? null : /* @__PURE__ */ t("div", { className: i.singleFileContainer, children: e });
|
|
183
188
|
}
|
|
184
|
-
function
|
|
189
|
+
function il({
|
|
185
190
|
children: e
|
|
186
191
|
}) {
|
|
187
|
-
const l =
|
|
188
|
-
return l.type !== "single" ? null : /* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
192
|
+
const l = p();
|
|
193
|
+
return l.type !== "single" ? null : /* @__PURE__ */ c("div", { tabIndex: l.disabled ? -1 : 0, onClick: l.triggerInput, onKeyDown: l.handleKeyDown, className: i.singleFileInputContainer, children: [
|
|
194
|
+
/* @__PURE__ */ t("span", { className: i.inputFileName, children: l.uploadedFiles.length > 0 ? /* @__PURE__ */ t("span", { className: i.inputFileNameText, children: l.uploadedFiles[0].file.name }) : /* @__PURE__ */ t("span", { className: i.inputFileNamePlaceholder, children: l.placeholder }) }),
|
|
190
195
|
e
|
|
191
196
|
] });
|
|
192
197
|
}
|
|
193
|
-
function
|
|
194
|
-
return
|
|
198
|
+
function tl() {
|
|
199
|
+
return p().type !== "single" ? null : /* @__PURE__ */ t("span", { className: i.singleFileHelpLinkReservedSpace, children: /* @__PURE__ */ t(E, {}) });
|
|
195
200
|
}
|
|
196
|
-
function
|
|
197
|
-
const e =
|
|
201
|
+
function E() {
|
|
202
|
+
const e = p();
|
|
198
203
|
if (e.type !== "single" || e.uploadedFiles.length === 0) return null;
|
|
199
204
|
const l = e.uploadedFiles[0].file.name;
|
|
200
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ t(y, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-delete", className: i.singleFileDeleteButton, onClick: () => e.handleRemoveFile(l), disabled: e.disabled });
|
|
201
206
|
}
|
|
202
|
-
function
|
|
203
|
-
var
|
|
204
|
-
const e =
|
|
205
|
-
return e.type === "multiple" && !s ? null : /* @__PURE__ */
|
|
206
|
-
l ? /* @__PURE__ */
|
|
207
|
-
e.type === "single" && e.helpLink && e.helpLinkText && /* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
207
|
+
function nl() {
|
|
208
|
+
var o, I;
|
|
209
|
+
const e = p(), l = e.errorMessage || e.isMaxFilesExceeded || e.type === "single" && ((o = e.uploadedFiles[0]) == null ? void 0 : o.error), s = e.type === "single" ? e.errorMessage || ((I = e.uploadedFiles[0]) == null ? void 0 : I.error) : e.errorMessage || (e.isMaxFilesExceeded ? `You can only upload up to ${e.maxFiles} files.` : "");
|
|
210
|
+
return e.type === "multiple" && !s ? null : /* @__PURE__ */ c("div", { className: i.helpers, children: [
|
|
211
|
+
l ? /* @__PURE__ */ t("span", { title: e.errorMessage, className: i.errorMessage, children: s }) : e.helpText && e.type === "single" && /* @__PURE__ */ t("span", { title: e.helpText, className: i.helperText, children: e.helpText }),
|
|
212
|
+
e.type === "single" && e.helpLink && e.helpLinkText && /* @__PURE__ */ c("span", { className: i.singleFileHelpLinkContainer, children: [
|
|
213
|
+
/* @__PURE__ */ t("a", { href: e.helpLink, className: i.helpLink, target: "_blank", rel: "noopener noreferrer", tabIndex: e.disabled ? -1 : 0, children: e.helpLinkText }),
|
|
214
|
+
/* @__PURE__ */ t("span", { className: i.singleFileHelpLinkReservedSpace })
|
|
210
215
|
] })
|
|
211
216
|
] });
|
|
212
217
|
}
|
|
213
|
-
function
|
|
214
|
-
const e =
|
|
215
|
-
return e.type !== "multiple" || !e.uploadedFiles.length ? null : /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
218
|
+
function sl() {
|
|
219
|
+
const e = p();
|
|
220
|
+
return e.type !== "multiple" || !e.uploadedFiles.length ? null : /* @__PURE__ */ t("ul", { className: i.multipleFilesList, children: e.uploadedFiles.map((l, s) => /* @__PURE__ */ c("li", { className: i.multipleFilesListItem, children: [
|
|
221
|
+
/* @__PURE__ */ c("div", { className: i.multipleFilesListItemContent, children: [
|
|
222
|
+
/* @__PURE__ */ t("span", { className: i.multipleFilesListItemIconContainer, children: /* @__PURE__ */ t(B, { icon: "ap-icon-document", className: i.multipleFilesListItemIcon }) }),
|
|
223
|
+
/* @__PURE__ */ c("div", { className: i.multipleFilesListItemContentData, children: [
|
|
224
|
+
/* @__PURE__ */ c("div", { className: i.multipleFilesListItemText, children: [
|
|
225
|
+
/* @__PURE__ */ t("span", { className: i.multipleFilesListItemName, children: l.file.name }),
|
|
226
|
+
/* @__PURE__ */ t("span", { className: i.multipleFilesListItemSize, children: e.displayFileSize(l.file.size) }),
|
|
227
|
+
l.error && /* @__PURE__ */ c("span", { className: i.multipleFilesListItemError, children: [
|
|
228
|
+
/* @__PURE__ */ t(B, { icon: "ap-icon-alert", className: i.multipleFilesListItemIconError }),
|
|
229
|
+
l.error
|
|
230
|
+
] })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ t(y, { type: "tertiary", variant: "default", size: "sm", onClick: () => e.handleRemoveFile(l.file.name), icon: "ap-icon-delete", iconClassName: i.multipleFilesListItemIconDelete, disabled: e.disabled })
|
|
233
|
+
] })
|
|
234
|
+
] }),
|
|
235
|
+
e.uploadedFileAppendedRow && /* @__PURE__ */ t("div", { className: i.multipleFilesListItemAppendedRow, children: e.uploadedFileAppendedRow(l, s) })
|
|
236
|
+
] }, s)) });
|
|
229
237
|
}
|
|
230
|
-
const
|
|
231
|
-
Label:
|
|
232
|
-
BrowseButton:
|
|
233
|
-
HelpText:
|
|
234
|
-
UploadedFilesList:
|
|
235
|
-
SingleFileContainer:
|
|
236
|
-
SingleFileRow:
|
|
237
|
-
SingleFileActions:
|
|
238
|
-
SingleFileDeleteButton:
|
|
238
|
+
const F = Object.assign(Qe, {
|
|
239
|
+
Label: We,
|
|
240
|
+
BrowseButton: el,
|
|
241
|
+
HelpText: nl,
|
|
242
|
+
UploadedFilesList: sl,
|
|
243
|
+
SingleFileContainer: ll,
|
|
244
|
+
SingleFileRow: il,
|
|
245
|
+
SingleFileActions: tl,
|
|
246
|
+
SingleFileDeleteButton: E
|
|
239
247
|
});
|
|
240
248
|
export {
|
|
241
|
-
|
|
242
|
-
|
|
249
|
+
F as default,
|
|
250
|
+
p as useFilePickerContext
|
|
243
251
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import '../../assets/IconsGallery.css';const c = ["ap-icon-add", "ap-icon-add-bold", "ap-icon-add-filled", "ap-icon-add-outlined", "ap-icon-aggregation", "ap-icon-agreements", "ap-icon-ai", "ap-icon-alert", "ap-icon-alert-filled", "ap-icon-alixpartners", "ap-icon-approved", "ap-icon-ascendant", "ap-icon-at", "ap-icon-attach", "ap-icon-bar", "ap-icon-bold", "ap-icon-book", "ap-icon-bookmark", "ap-icon-bookmark-list", "ap-icon-bookmark-saved", "ap-icon-
|
|
2
|
+
import '../../assets/IconsGallery.css';const c = ["ap-icon-add", "ap-icon-add-bold", "ap-icon-add-filled", "ap-icon-add-outlined", "ap-icon-aggregation", "ap-icon-agreements", "ap-icon-ai", "ap-icon-alert", "ap-icon-alert-filled", "ap-icon-alixpartners", "ap-icon-approved", "ap-icon-ascendant", "ap-icon-at", "ap-icon-attach", "ap-icon-bar", "ap-icon-bold", "ap-icon-book", "ap-icon-bookmark", "ap-icon-bookmark-list", "ap-icon-bookmark-saved", "ap-icon-box-collapse", "ap-icon-box-expand", "ap-icon-box-list", "ap-icon-branch", "ap-icon-chapter11", "ap-icon-check", "ap-icon-clock", "ap-icon-clock-filled", "ap-icon-close", "ap-icon-close-bold", "ap-icon-collapse-all", "ap-icon-collapse-filled", "ap-icon-collapse-outlined", "ap-icon-color", "ap-icon-columns", "ap-icon-comment", "ap-icon-copy", "ap-icon-copy-file", "ap-icon-date", "ap-icon-deedi", "ap-icon-delete", "ap-icon-descendant", "ap-icon-deselect-branch", "ap-icon-deselect-individual", "ap-icon-direction", "ap-icon-document", "ap-icon-document-rpm", "ap-icon-dot", "ap-icon-dot-filled", "ap-icon-down", "ap-icon-download", "ap-icon-drag", "ap-icon-drilldown", "ap-icon-edit", "ap-icon-edit-filled", "ap-icon-elevation", "ap-icon-expand-all", "ap-icon-expand-filled", "ap-icon-expand-less", "ap-icon-expand-more", "ap-icon-expand-outlined", "ap-icon-expand-section", "ap-icon-export", "ap-icon-external", "ap-icon-file-csv", "ap-icon-file-docx", "ap-icon-file-pdf", "ap-icon-file-ppt", "ap-icon-file-xls", "ap-icon-filter", "ap-icon-filter-advanced", "ap-icon-financial", "ap-icon-financial-filled", "ap-icon-fit", "ap-icon-flag-filled", "ap-icon-folder", "ap-icon-font-size", "ap-icon-fullscreen", "ap-icon-function", "ap-icon-gantt", "ap-icon-grid", "ap-icon-gto", "ap-icon-help", "ap-icon-help-filled", "ap-icon-hide", "ap-icon-hide-source", "ap-icon-history", "ap-icon-idea", "ap-icon-image", "ap-icon-import", "ap-icon-in-progress-filled", "ap-icon-industry", "ap-icon-info", "ap-icon-info-filled", "ap-icon-italic", "ap-icon-job", "ap-icon-key", "ap-icon-layers", "ap-icon-left", "ap-icon-line", "ap-icon-link", "ap-icon-list", "ap-icon-list-numbered", "ap-icon-location", "ap-icon-lock", "ap-icon-logout", "ap-icon-mail", "ap-icon-milestone-filled", "ap-icon-more", "ap-icon-more-horizontal", "ap-icon-move", "ap-icon-new", "ap-icon-new-filled", "ap-icon-next", "ap-icon-notification-filled", "ap-icon-notification-warning", "ap-icon-person", "ap-icon-person-actions", "ap-icon-person-add", "ap-icon-person-add-filled", "ap-icon-person-check", "ap-icon-person-check-filled", "ap-icon-person-discard", "ap-icon-person-filled", "ap-icon-person-group", "ap-icon-person-group-checked", "ap-icon-person-group-checked-filled", "ap-icon-person-group-dashed", "ap-icon-person-group-dashed-filled", "ap-icon-person-group-filled", "ap-icon-person-group-filled-wide", "ap-icon-person-move", "ap-icon-person-move-filled", "ap-icon-person-remove", "ap-icon-person-remove-filled", "ap-icon-phone", "ap-icon-pin", "ap-icon-pin-filled", "ap-icon-platforms", "ap-icon-present", "ap-icon-previous", "ap-icon-projects", "ap-icon-quote", "ap-icon-radial", "ap-icon-remove", "ap-icon-remove-filled", "ap-icon-remove-outlined", "ap-icon-reply", "ap-icon-reset", "ap-icon-resize", "ap-icon-right", "ap-icon-rotate-left", "ap-icon-rotate-right", "ap-icon-row-height", "ap-icon-rpms", "ap-icon-screenshot", "ap-icon-search", "ap-icon-select-branch", "ap-icon-select-individual", "ap-icon-send", "ap-icon-settings", "ap-icon-settings-filled", "ap-icon-show", "ap-icon-show-filled", "ap-icon-sign", "ap-icon-smart-factory", "ap-icon-star", "ap-icon-star-dashed", "ap-icon-star-filled", "ap-icon-strikethrough", "ap-icon-success", "ap-icon-summary", "ap-icon-sxr", "ap-icon-sync", "ap-icon-table", "ap-icon-tip-bottom", "ap-icon-tip-left", "ap-icon-tip-right", "ap-icon-tip-top", "ap-icon-tree", "ap-icon-underline", "ap-icon-unpin", "ap-icon-unpin-filled", "ap-icon-up", "ap-icon-upload", "ap-icon-web", "ap-icon-working-capital", "ap-icon-zip", "ap-icon-zoom-in", "ap-icon-zoom-out"], p = "IconsGallery-module__grid___oQqfO", e = "IconsGallery-module__icon___7ZdqB", n = {
|
|
3
3
|
grid: p,
|
|
4
4
|
icon: e
|
|
5
5
|
};
|