handy-fluentui 0.1.0
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/README.md +681 -0
- package/dist/components/fui-button-panel.d.ts +13 -0
- package/dist/components/fui-button-panel.d.ts.map +1 -0
- package/dist/components/fui-image-carousell.d.ts +17 -0
- package/dist/components/fui-image-carousell.d.ts.map +1 -0
- package/dist/components/fui-tab.d.ts +29 -0
- package/dist/components/fui-tab.d.ts.map +1 -0
- package/dist/components/fui-table.d.ts +89 -0
- package/dist/components/fui-table.d.ts.map +1 -0
- package/dist/components/input-checkbox.d.ts +17 -0
- package/dist/components/input-checkbox.d.ts.map +1 -0
- package/dist/components/input-date.d.ts +27 -0
- package/dist/components/input-date.d.ts.map +1 -0
- package/dist/components/input-dropdown.d.ts +33 -0
- package/dist/components/input-dropdown.d.ts.map +1 -0
- package/dist/components/input-group.d.ts +25 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-multi-lang.d.ts +35 -0
- package/dist/components/input-multi-lang.d.ts.map +1 -0
- package/dist/components/input-number.d.ts +39 -0
- package/dist/components/input-number.d.ts.map +1 -0
- package/dist/components/input-radio.d.ts +33 -0
- package/dist/components/input-radio.d.ts.map +1 -0
- package/dist/components/input-switch.d.ts +17 -0
- package/dist/components/input-switch.d.ts.map +1 -0
- package/dist/components/input-text.d.ts +19 -0
- package/dist/components/input-text.d.ts.map +1 -0
- package/dist/components/input-textarea.d.ts +20 -0
- package/dist/components/input-textarea.d.ts.map +1 -0
- package/dist/components/input-time.d.ts +31 -0
- package/dist/components/input-time.d.ts.map +1 -0
- package/dist/components/with-input-field.d.ts +49 -0
- package/dist/components/with-input-field.d.ts.map +1 -0
- package/dist/contexts/breadcrumb-context.d.ts +20 -0
- package/dist/contexts/breadcrumb-context.d.ts.map +1 -0
- package/dist/contexts/dialog-context.d.ts +28 -0
- package/dist/contexts/dialog-context.d.ts.map +1 -0
- package/dist/contexts/handy-fluent-ui-context.d.ts +48 -0
- package/dist/contexts/handy-fluent-ui-context.d.ts.map +1 -0
- package/dist/contexts/spinner-context.d.ts +19 -0
- package/dist/contexts/spinner-context.d.ts.map +1 -0
- package/dist/contexts/toast-context.d.ts +17 -0
- package/dist/contexts/toast-context.d.ts.map +1 -0
- package/dist/hooks/use-breadcrumb.d.ts +19 -0
- package/dist/hooks/use-breadcrumb.d.ts.map +1 -0
- package/dist/hooks/use-dialog.d.ts +6 -0
- package/dist/hooks/use-dialog.d.ts.map +1 -0
- package/dist/hooks/use-logger.d.ts +9 -0
- package/dist/hooks/use-logger.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts +4 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-spinner.d.ts +7 -0
- package/dist/hooks/use-spinner.d.ts.map +1 -0
- package/dist/hooks/use-theme.d.ts +8 -0
- package/dist/hooks/use-theme.d.ts.map +1 -0
- package/dist/hooks/use-time-zone.d.ts +17 -0
- package/dist/hooks/use-time-zone.d.ts.map +1 -0
- package/dist/hooks/use-toast.d.ts +9 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1571 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/breadcrumb-provider.d.ts +10 -0
- package/dist/providers/breadcrumb-provider.d.ts.map +1 -0
- package/dist/providers/dialog-provider.d.ts +6 -0
- package/dist/providers/dialog-provider.d.ts.map +1 -0
- package/dist/providers/handy-fluent-ui-provider.d.ts +10 -0
- package/dist/providers/handy-fluent-ui-provider.d.ts.map +1 -0
- package/dist/providers/spinner-provider.d.ts +10 -0
- package/dist/providers/spinner-provider.d.ts.map +1 -0
- package/dist/providers/toast-provider.d.ts +9 -0
- package/dist/providers/toast-provider.d.ts.map +1 -0
- package/dist/utils/string-util.d.ts +4 -0
- package/dist/utils/string-util.d.ts.map +1 -0
- package/package.json +94 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1571 @@
|
|
|
1
|
+
import { Body1 as e, Body1Strong as t, Button as n, Caption1 as r, Carousel as i, CarouselCard as a, CarouselNav as o, CarouselNavButton as s, CarouselNavContainer as c, CarouselSlider as l, CarouselViewport as u, Checkbox as d, DataGrid as f, DataGridBody as p, DataGridCell as m, DataGridHeader as h, DataGridHeaderCell as g, DataGridRow as _, Dialog as v, DialogActions as y, DialogBody as b, DialogContent as x, DialogSurface as S, DialogTitle as C, Divider as w, DrawerBody as T, DrawerHeader as E, DrawerHeaderTitle as D, Dropdown as ee, FluentProvider as te, Image as ne, InfoLabel as re, Input as O, Label as ie, Link as ae, Listbox as oe, Option as se, OptionGroup as ce, OverlayDrawer as k, RadioGroup as le, SpinButton as ue, Spinner as de, Switch as fe, Tab as pe, TabList as me, Textarea as he, Toast as ge, ToastBody as _e, ToastTitle as ve, ToastTrigger as ye, Toaster as be, Tooltip as A, createTableColumn as xe, makeStyles as j, mergeClasses as M, teamsDarkV21Theme as Se, teamsLightV21Theme as Ce, tokens as N, useId as we, useToastController as Te, webDarkTheme as Ee, webLightTheme as De } from "@fluentui/react-components";
|
|
2
|
+
import P, { createContext as F, createElement as Oe, useCallback as I, useContext as L, useEffect as R, useMemo as z, useRef as B, useState as V } from "react";
|
|
3
|
+
import { useMediaQuery as ke } from "usehooks-ts";
|
|
4
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
5
|
+
import { CalendarRegular as Ae, ChevronDoubleLeftRegular as je, ChevronDoubleRightRegular as Me, ChevronDownRegular as G, ChevronLeftRegular as Ne, ChevronRightRegular as Pe, ChevronUpRegular as Fe, DismissRegular as K, EraserRegular as Ie, EyeOffRegular as Le, EyeRegular as Re, TranslateRegular as ze } from "@fluentui/react-icons";
|
|
6
|
+
import { Calendar as Be } from "@fluentui/react-calendar-compat";
|
|
7
|
+
import { DatePicker as Ve } from "@fluentui/react-datepicker-compat";
|
|
8
|
+
//#region src/contexts/handy-fluent-ui-context.ts
|
|
9
|
+
var q = F(void 0), He = F(void 0), Ue = ({ children: e }) => {
|
|
10
|
+
let [t, n] = V([]);
|
|
11
|
+
return /* @__PURE__ */ U(He.Provider, {
|
|
12
|
+
value: {
|
|
13
|
+
items: t,
|
|
14
|
+
setItems: n
|
|
15
|
+
},
|
|
16
|
+
children: e
|
|
17
|
+
});
|
|
18
|
+
}, We = F({ openDialog: () => {} }), Ge = ({ title: e, content: t, buttons: r, visible: i }) => /* @__PURE__ */ U(v, {
|
|
19
|
+
modalType: "alert",
|
|
20
|
+
open: i,
|
|
21
|
+
children: /* @__PURE__ */ U(S, { children: /* @__PURE__ */ W(b, { children: [
|
|
22
|
+
/* @__PURE__ */ U(C, { children: e }),
|
|
23
|
+
/* @__PURE__ */ U(x, { children: t }),
|
|
24
|
+
/* @__PURE__ */ U(y, { children: r.map((e, t) => /* @__PURE__ */ U(n, {
|
|
25
|
+
appearance: r.length > 1 && (e.cta ?? !1) ? "primary" : "secondary",
|
|
26
|
+
disabled: e.disabled,
|
|
27
|
+
icon: e.icon,
|
|
28
|
+
onClick: e.action,
|
|
29
|
+
children: e.label
|
|
30
|
+
}, t)) })
|
|
31
|
+
] }) })
|
|
32
|
+
}), Ke = ({ title: e, content: t, primaryButton: n, secondaryButton: r, tertiaryButton: i }, a) => {
|
|
33
|
+
let o = [{
|
|
34
|
+
...n,
|
|
35
|
+
cta: !0
|
|
36
|
+
}];
|
|
37
|
+
return r && o.push({
|
|
38
|
+
...r,
|
|
39
|
+
cta: !1
|
|
40
|
+
}), i && o.push({
|
|
41
|
+
...i,
|
|
42
|
+
cta: !1
|
|
43
|
+
}), /* @__PURE__ */ U(Ge, {
|
|
44
|
+
buttons: o.reverse().map(({ action: e, ...t }) => ({
|
|
45
|
+
...t,
|
|
46
|
+
action: () => {
|
|
47
|
+
a(), e && e();
|
|
48
|
+
}
|
|
49
|
+
})),
|
|
50
|
+
content: t,
|
|
51
|
+
title: e,
|
|
52
|
+
visible: !0
|
|
53
|
+
});
|
|
54
|
+
}, qe = ({ children: e }) => {
|
|
55
|
+
let [t, n] = V({
|
|
56
|
+
dialogProps: void 0,
|
|
57
|
+
openTime: 0,
|
|
58
|
+
closeTime: 0
|
|
59
|
+
}), r = I((e) => {
|
|
60
|
+
n((t) => ({
|
|
61
|
+
...t,
|
|
62
|
+
dialogProps: e,
|
|
63
|
+
openTime: Date.now()
|
|
64
|
+
}));
|
|
65
|
+
}, []), i = t.dialogProps && t.openTime > t.closeTime ? Ke(t.dialogProps, () => n((e) => ({
|
|
66
|
+
...e,
|
|
67
|
+
closeTime: Date.now()
|
|
68
|
+
}))) : /* @__PURE__ */ U(H, {});
|
|
69
|
+
return /* @__PURE__ */ W(We.Provider, {
|
|
70
|
+
value: { openDialog: r },
|
|
71
|
+
children: [e, i]
|
|
72
|
+
});
|
|
73
|
+
}, Je = F({
|
|
74
|
+
show: () => {},
|
|
75
|
+
hide: () => {}
|
|
76
|
+
}), Ye = j({ overlay: {
|
|
77
|
+
position: "fixed",
|
|
78
|
+
inset: 0,
|
|
79
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
80
|
+
display: "flex",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
justifyContent: "center",
|
|
83
|
+
zIndex: 9999
|
|
84
|
+
} }), Xe = ({ children: e, config: t }) => {
|
|
85
|
+
let n = Ye(), { initialDelay: r, label: i } = t ?? {}, a = B(null), [o, s] = V(0), [c, l] = V();
|
|
86
|
+
R(() => () => {
|
|
87
|
+
a.current !== null && clearTimeout(a.current);
|
|
88
|
+
}, []);
|
|
89
|
+
let u = I((e) => {
|
|
90
|
+
l(e || i?.loading), a.current = setTimeout(() => {
|
|
91
|
+
s((e) => e + 1), a.current = null;
|
|
92
|
+
}, r ?? 300);
|
|
93
|
+
}, [t]), d = I(() => {
|
|
94
|
+
a.current === null ? s((e) => Math.max(0, e - 1)) : (clearTimeout(a.current), a.current = null), l(void 0);
|
|
95
|
+
}, []), f = z(() => ({
|
|
96
|
+
show: u,
|
|
97
|
+
hide: d
|
|
98
|
+
}), [u, d]);
|
|
99
|
+
return /* @__PURE__ */ W(Je.Provider, {
|
|
100
|
+
value: f,
|
|
101
|
+
children: [e, o > 0 && /* @__PURE__ */ U("div", {
|
|
102
|
+
className: n.overlay,
|
|
103
|
+
children: /* @__PURE__ */ U(de, { label: c })
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
}, Ze = F({ show: () => {} }), Qe = ({ config: e, children: t }) => {
|
|
107
|
+
let { dismissTimeout: n, position: r, toastCreator: i } = e ?? {}, { dispatchToast: a, updateToast: o } = Te(), s = I((e, t, s, c) => {
|
|
108
|
+
if (i) {
|
|
109
|
+
a(i(t, e), {
|
|
110
|
+
intent: e,
|
|
111
|
+
position: r,
|
|
112
|
+
timeout: e === "error" ? -1 : n
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
let l = s ? /* @__PURE__ */ U(ye, { children: /* @__PURE__ */ U(ae, { children: s }) }) : /* @__PURE__ */ U(ye, { children: /* @__PURE__ */ U(K, {}) }), u = c ?? e.charAt(0).toUpperCase() + e.slice(1), d = (e) => /* @__PURE__ */ W(ge, {
|
|
117
|
+
appearance: "inverted",
|
|
118
|
+
children: [/* @__PURE__ */ U(ve, {
|
|
119
|
+
action: e,
|
|
120
|
+
children: u
|
|
121
|
+
}), /* @__PURE__ */ U(_e, { children: t })]
|
|
122
|
+
});
|
|
123
|
+
if (e === "error") if (n && n > 0) {
|
|
124
|
+
let t = `fui-toast-${Date.now()}-${Math.random()}`;
|
|
125
|
+
a(d(void 0), {
|
|
126
|
+
intent: e,
|
|
127
|
+
position: r,
|
|
128
|
+
timeout: -1,
|
|
129
|
+
toastId: t
|
|
130
|
+
}), setTimeout(() => {
|
|
131
|
+
o({
|
|
132
|
+
content: d(l),
|
|
133
|
+
timeout: -1,
|
|
134
|
+
toastId: t
|
|
135
|
+
});
|
|
136
|
+
}, n);
|
|
137
|
+
} else a(d(l), {
|
|
138
|
+
intent: e,
|
|
139
|
+
position: r,
|
|
140
|
+
timeout: -1
|
|
141
|
+
});
|
|
142
|
+
else a(d(l), {
|
|
143
|
+
intent: e,
|
|
144
|
+
position: r,
|
|
145
|
+
timeout: n
|
|
146
|
+
});
|
|
147
|
+
}, [
|
|
148
|
+
e,
|
|
149
|
+
a,
|
|
150
|
+
o
|
|
151
|
+
]), c = z(() => ({ show: s }), [s]);
|
|
152
|
+
return /* @__PURE__ */ W(Ze.Provider, {
|
|
153
|
+
value: c,
|
|
154
|
+
children: [t, /* @__PURE__ */ U(be, {})]
|
|
155
|
+
});
|
|
156
|
+
}, $e = {
|
|
157
|
+
light: De,
|
|
158
|
+
dark: Ee
|
|
159
|
+
}, et = {
|
|
160
|
+
light: Ce,
|
|
161
|
+
dark: Se
|
|
162
|
+
}, tt = (e, t) => ({
|
|
163
|
+
light: e?.light ?? t.light,
|
|
164
|
+
dark: e?.dark ?? t.dark,
|
|
165
|
+
custom: e?.custom ?? t.custom
|
|
166
|
+
}), nt = (e) => ({
|
|
167
|
+
web: tt(e?.web, {
|
|
168
|
+
...$e,
|
|
169
|
+
custom: e?.mobile?.custom
|
|
170
|
+
}),
|
|
171
|
+
mobile: tt(e?.mobile, {
|
|
172
|
+
...et,
|
|
173
|
+
custom: e?.web?.custom
|
|
174
|
+
}),
|
|
175
|
+
default: e?.default
|
|
176
|
+
}), rt = (e, t) => {
|
|
177
|
+
let n = "light";
|
|
178
|
+
return e === void 0 || e === "custom" && !t?.includes("custom") ? typeof window > "u" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e ?? n;
|
|
179
|
+
}, it = {
|
|
180
|
+
mobileBreakpoint: 600,
|
|
181
|
+
supportedLanguage: {
|
|
182
|
+
iso: "en",
|
|
183
|
+
name: "English"
|
|
184
|
+
},
|
|
185
|
+
supportedTheme: {
|
|
186
|
+
web: $e,
|
|
187
|
+
mobile: et
|
|
188
|
+
}
|
|
189
|
+
}, at = ({ mobileBreakpoint: e, component: t, supportedTheme: n, loggerConfig: r, children: i }) => {
|
|
190
|
+
let a = nt(n), o = a.web.custom || a.mobile.custom ? [
|
|
191
|
+
"light",
|
|
192
|
+
"dark",
|
|
193
|
+
"custom"
|
|
194
|
+
] : ["light", "dark"], [s, c] = V(rt(n?.default, o)), l = e ?? it.mobileBreakpoint, u = ke(`(max-width: ${l}px)`) ? a.mobile[s] : a.web[s], d = I((e) => {
|
|
195
|
+
c(e);
|
|
196
|
+
}, []), f = Intl.DateTimeFormat().resolvedOptions().timeZone, p = I((e, t = "info") => {
|
|
197
|
+
r?.logMessage ? r.logMessage(e, t) : console.log(`[${t.toUpperCase()}] ${e}`);
|
|
198
|
+
}, [r]);
|
|
199
|
+
return /* @__PURE__ */ U(q.Provider, {
|
|
200
|
+
value: {
|
|
201
|
+
logMessage: p,
|
|
202
|
+
mobileBreakpoint: l,
|
|
203
|
+
selectedTheme: s,
|
|
204
|
+
supportedThemeType: o,
|
|
205
|
+
switchTheme: d,
|
|
206
|
+
timeZone: f
|
|
207
|
+
},
|
|
208
|
+
children: /* @__PURE__ */ U(te, {
|
|
209
|
+
theme: u,
|
|
210
|
+
children: /* @__PURE__ */ U(Xe, {
|
|
211
|
+
config: t?.spinner,
|
|
212
|
+
children: /* @__PURE__ */ U(qe, { children: /* @__PURE__ */ U(Qe, {
|
|
213
|
+
config: t?.toast,
|
|
214
|
+
children: /* @__PURE__ */ U(Ue, { children: i })
|
|
215
|
+
}) })
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
});
|
|
219
|
+
}, J = () => {
|
|
220
|
+
let e = L(q);
|
|
221
|
+
if (!e) throw Error("useLogger must be used within HandyFluentUiProvider");
|
|
222
|
+
let t = e.logMessage;
|
|
223
|
+
return {
|
|
224
|
+
debug: (e) => t(e, "debug"),
|
|
225
|
+
error: (e) => t(e, "error"),
|
|
226
|
+
info: (e) => t(e, "info"),
|
|
227
|
+
warn: (e) => t(e, "warn")
|
|
228
|
+
};
|
|
229
|
+
}, ot = () => {
|
|
230
|
+
let e = L(He);
|
|
231
|
+
if (!e) throw Error("useBreadcrumb must be used within FuiBreadcrumbContextProvider");
|
|
232
|
+
let t = J();
|
|
233
|
+
return {
|
|
234
|
+
items: [...e.items],
|
|
235
|
+
start: (n) => {
|
|
236
|
+
t.debug(`[useBreadcrumb] start() with tag ${n.tag}`);
|
|
237
|
+
let r = n.action, i = {
|
|
238
|
+
...n,
|
|
239
|
+
action: r ? () => {
|
|
240
|
+
r(), e.setItems([i]);
|
|
241
|
+
} : void 0
|
|
242
|
+
};
|
|
243
|
+
e.setItems([i]);
|
|
244
|
+
},
|
|
245
|
+
append: (n) => {
|
|
246
|
+
t.debug(`[useBreadcrumb] append() with tag ${n.tag}, action = ${n.action === void 0}`);
|
|
247
|
+
let r = n.action, i = {
|
|
248
|
+
...n,
|
|
249
|
+
action: r ? () => {
|
|
250
|
+
r(), e.setItems((e) => {
|
|
251
|
+
let t = e.findIndex((e) => e === i);
|
|
252
|
+
return e.slice(0, t + 1);
|
|
253
|
+
});
|
|
254
|
+
} : void 0
|
|
255
|
+
};
|
|
256
|
+
e.setItems((e) => {
|
|
257
|
+
let r = e[e.length - 1];
|
|
258
|
+
return n.tag !== void 0 && r?.tag === n.tag ? (t.warn(`[useBreadcrumb] append(), the tag of last item is ${n.tag}, ignored append`), e) : [...e, i];
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
peek: () => e.items[e.items.length - 1],
|
|
262
|
+
popTill: (n) => {
|
|
263
|
+
t.debug(`[useBreadcrumb] popTill(), no of items = ${e.items.length}`), e.setItems((e) => {
|
|
264
|
+
if (n) {
|
|
265
|
+
let r = e.findIndex((e) => e.tag === n);
|
|
266
|
+
return r === -1 ? (t.warn(`[useBreadcrumb] popTill(), tag "${n}" not found, trail unchanged`), e) : e.slice(0, r);
|
|
267
|
+
}
|
|
268
|
+
if (e.length === 0) return e;
|
|
269
|
+
let r = e.slice(0, -1);
|
|
270
|
+
return t.debug(`[useBreadcrumb] popTill(), no of items after pop = ${r.length}`), r;
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
}, st = () => L(We), Y = () => {
|
|
275
|
+
let e = L(q);
|
|
276
|
+
if (!e) throw Error("useIsMobile must be used within HandyFluentUiProvider");
|
|
277
|
+
return ke(`(max-width: ${e.mobileBreakpoint}px)`);
|
|
278
|
+
}, ct = () => L(Je), lt = () => {
|
|
279
|
+
let e = L(q);
|
|
280
|
+
if (!e) throw Error("useTheme must be used within HandyFluentUiProvider");
|
|
281
|
+
let { selectedTheme: t, supportedThemeType: n, switchTheme: r } = e;
|
|
282
|
+
return {
|
|
283
|
+
currentTheme: t,
|
|
284
|
+
switchTheme: (e) => {
|
|
285
|
+
n.includes(e) && r(e);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}, ut = () => {
|
|
289
|
+
let e = L(q);
|
|
290
|
+
if (!e) throw Error("useTimezone must be used within HandyFluentUiProvider");
|
|
291
|
+
let t = (t) => {
|
|
292
|
+
try {
|
|
293
|
+
return Intl.DateTimeFormat(void 0, { timeZone: t }), !0;
|
|
294
|
+
} catch {
|
|
295
|
+
return e.logMessage(`Invalid timeZone = ${t}`, "warn"), !1;
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
return {
|
|
299
|
+
timeZone: e.timeZone,
|
|
300
|
+
setTimeZone: (n) => {
|
|
301
|
+
t(n) && (e.timeZone = n);
|
|
302
|
+
},
|
|
303
|
+
zonedDate2LocalDate: (n, r) => {
|
|
304
|
+
if (r && !t(r)) return {
|
|
305
|
+
year: n.getFullYear(),
|
|
306
|
+
month: n.getMonth(),
|
|
307
|
+
day: n.getDate(),
|
|
308
|
+
hour: n.getHours(),
|
|
309
|
+
minute: n.getMinutes(),
|
|
310
|
+
second: n.getSeconds()
|
|
311
|
+
};
|
|
312
|
+
let i = new Intl.DateTimeFormat(void 0, {
|
|
313
|
+
timeZone: r ?? e.timeZone,
|
|
314
|
+
year: "numeric",
|
|
315
|
+
month: "2-digit",
|
|
316
|
+
day: "2-digit",
|
|
317
|
+
hour: "2-digit",
|
|
318
|
+
minute: "2-digit",
|
|
319
|
+
second: "2-digit",
|
|
320
|
+
hourCycle: "h23"
|
|
321
|
+
}).formatToParts(n), { year: a, month: o, day: s, hour: c, minute: l, second: u } = Object.fromEntries(i.filter((e) => e.type !== "literal").map((e) => [e.type, Number(e.value)]));
|
|
322
|
+
return {
|
|
323
|
+
year: a,
|
|
324
|
+
month: o,
|
|
325
|
+
day: s,
|
|
326
|
+
hour: c,
|
|
327
|
+
minute: l,
|
|
328
|
+
second: u
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
}, dt = () => {
|
|
333
|
+
let { show: e } = L(Ze);
|
|
334
|
+
return {
|
|
335
|
+
success: (t, n, r) => e("success", t, n, r),
|
|
336
|
+
error: (t, n, r) => e("error", t, n, r),
|
|
337
|
+
warning: (t, n, r) => e("warning", t, n, r),
|
|
338
|
+
info: (t, n, r) => e("info", t, n, r)
|
|
339
|
+
};
|
|
340
|
+
}, ft = j({
|
|
341
|
+
root: {
|
|
342
|
+
display: "flex",
|
|
343
|
+
gap: N.spacingHorizontalM
|
|
344
|
+
},
|
|
345
|
+
row: { flexDirection: "row" },
|
|
346
|
+
column: {
|
|
347
|
+
flexDirection: "column",
|
|
348
|
+
alignItems: "stretch"
|
|
349
|
+
},
|
|
350
|
+
left: { justifyContent: "flex-start" },
|
|
351
|
+
right: { justifyContent: "flex-end" }
|
|
352
|
+
}), pt = ({ className: e, alignItems: t = "right", children: n }) => {
|
|
353
|
+
let r = ft(), i = Y();
|
|
354
|
+
return /* @__PURE__ */ U("div", {
|
|
355
|
+
className: M(r.root, i ? r.column : r.row, t === "left" ? r.left : r.right, e),
|
|
356
|
+
children: n
|
|
357
|
+
});
|
|
358
|
+
}, mt = j({
|
|
359
|
+
root: {
|
|
360
|
+
display: "flex",
|
|
361
|
+
flexDirection: "column",
|
|
362
|
+
width: "100%"
|
|
363
|
+
},
|
|
364
|
+
rootVertical: { flexDirection: "row" },
|
|
365
|
+
tabList: { width: "max-content" },
|
|
366
|
+
tabListVertical: {
|
|
367
|
+
borderBottom: "none",
|
|
368
|
+
borderRight: `1px solid ${N.colorNeutralStroke2}`,
|
|
369
|
+
minWidth: "0",
|
|
370
|
+
width: "auto"
|
|
371
|
+
},
|
|
372
|
+
scrollWrapper: {
|
|
373
|
+
width: "100%",
|
|
374
|
+
overflowX: "auto",
|
|
375
|
+
WebkitOverflowScrolling: "touch",
|
|
376
|
+
"::-webkit-scrollbar": { display: "none" },
|
|
377
|
+
msOverflowStyle: "none",
|
|
378
|
+
scrollbarWidth: "none"
|
|
379
|
+
},
|
|
380
|
+
content: {
|
|
381
|
+
paddingTop: N.spacingVerticalM,
|
|
382
|
+
flexGrow: 1
|
|
383
|
+
},
|
|
384
|
+
contentVertical: {
|
|
385
|
+
paddingTop: "0",
|
|
386
|
+
paddingLeft: N.spacingHorizontalM
|
|
387
|
+
},
|
|
388
|
+
tabTextSelected: { color: N.colorBrandForeground1 }
|
|
389
|
+
}), ht = Symbol.for("FuiTab"), gt = Object.assign((e) => null, { _marker: ht }), _t = (e) => {
|
|
390
|
+
let { children: t, vertical: n, selectedValue: r, onTabSelect: i, ...a } = e, o = Y(), s = mt(), c = !o && n, l = P.Children.toArray(t).filter((e) => P.isValidElement(e) && e.type?._marker === ht).map((e) => ({
|
|
391
|
+
props: e.props,
|
|
392
|
+
value: e.props.value ?? e.props.name
|
|
393
|
+
})), u = (e, t) => {
|
|
394
|
+
i?.(t);
|
|
395
|
+
}, d = /* @__PURE__ */ U(me, {
|
|
396
|
+
...a,
|
|
397
|
+
className: c ? s.tabListVertical : s.tabList,
|
|
398
|
+
onTabSelect: u,
|
|
399
|
+
selectedValue: r,
|
|
400
|
+
vertical: c,
|
|
401
|
+
children: l.map((e) => /* @__PURE__ */ U(pe, {
|
|
402
|
+
...e.props,
|
|
403
|
+
value: e.value,
|
|
404
|
+
children: /* @__PURE__ */ U("span", {
|
|
405
|
+
className: e.value === r ? s.tabTextSelected : void 0,
|
|
406
|
+
children: e.props.name
|
|
407
|
+
})
|
|
408
|
+
}, String(e.value)))
|
|
409
|
+
}), f = l.find((e) => e.value === r);
|
|
410
|
+
return /* @__PURE__ */ W("div", {
|
|
411
|
+
className: M(s.root, c && s.rootVertical),
|
|
412
|
+
children: [o ? /* @__PURE__ */ U("div", {
|
|
413
|
+
className: s.scrollWrapper,
|
|
414
|
+
children: d
|
|
415
|
+
}) : d, f && /* @__PURE__ */ U("div", {
|
|
416
|
+
className: M(s.content, c && s.contentVertical),
|
|
417
|
+
children: f.props.children
|
|
418
|
+
})]
|
|
419
|
+
});
|
|
420
|
+
}, X = (e, t) => e.replace(/{{\s*([\w.]+)\s*}}/g, (e, n) => {
|
|
421
|
+
let r = n.split(".").reduce((e, t) => {
|
|
422
|
+
if (e && typeof e == "object" && t in e) return e[t];
|
|
423
|
+
}, t);
|
|
424
|
+
return r == null ? "" : String(r);
|
|
425
|
+
}), vt = j({
|
|
426
|
+
rootVertical: {
|
|
427
|
+
display: "flex",
|
|
428
|
+
flexDirection: "column",
|
|
429
|
+
gap: "2px"
|
|
430
|
+
},
|
|
431
|
+
rootHorizontal: {
|
|
432
|
+
display: "flex",
|
|
433
|
+
alignItems: "flex-start",
|
|
434
|
+
gap: N.spacingHorizontalM
|
|
435
|
+
},
|
|
436
|
+
rootHorizontalRow: { flexDirection: "row" },
|
|
437
|
+
rootHorizontalColumn: {
|
|
438
|
+
flexDirection: "column",
|
|
439
|
+
gap: "2px"
|
|
440
|
+
},
|
|
441
|
+
labelContainer: {
|
|
442
|
+
display: "flex",
|
|
443
|
+
flexDirection: "row",
|
|
444
|
+
alignItems: "center",
|
|
445
|
+
gap: "4px",
|
|
446
|
+
overflow: "hidden",
|
|
447
|
+
flexShrink: 1
|
|
448
|
+
},
|
|
449
|
+
eraserIcon: {
|
|
450
|
+
cursor: "pointer",
|
|
451
|
+
color: N.colorNeutralForeground3,
|
|
452
|
+
fontSize: "16px",
|
|
453
|
+
flexShrink: 0,
|
|
454
|
+
":hover": { color: N.colorNeutralForeground2 }
|
|
455
|
+
},
|
|
456
|
+
labelHorizontal: {
|
|
457
|
+
minHeight: "32px",
|
|
458
|
+
display: "flex",
|
|
459
|
+
alignItems: "center",
|
|
460
|
+
flexShrink: 0
|
|
461
|
+
},
|
|
462
|
+
labelHorizontalColumn: {
|
|
463
|
+
width: "100% !important",
|
|
464
|
+
minHeight: "auto"
|
|
465
|
+
},
|
|
466
|
+
labelSmall: { width: "10%" },
|
|
467
|
+
labelMedium: { width: "20%" },
|
|
468
|
+
labelLarge: { width: "30%" },
|
|
469
|
+
labelNone: { width: "auto" },
|
|
470
|
+
labelComponent: {
|
|
471
|
+
display: "inline-flex",
|
|
472
|
+
alignItems: "center",
|
|
473
|
+
whiteSpace: "nowrap",
|
|
474
|
+
overflow: "hidden",
|
|
475
|
+
minWidth: 0,
|
|
476
|
+
flexShrink: 1
|
|
477
|
+
},
|
|
478
|
+
labelText: {
|
|
479
|
+
overflow: "hidden",
|
|
480
|
+
textOverflow: "ellipsis",
|
|
481
|
+
whiteSpace: "nowrap"
|
|
482
|
+
},
|
|
483
|
+
fieldGroup: {
|
|
484
|
+
display: "flex",
|
|
485
|
+
flexDirection: "column",
|
|
486
|
+
flexGrow: 1,
|
|
487
|
+
width: "100%"
|
|
488
|
+
},
|
|
489
|
+
messageContainer: {
|
|
490
|
+
display: "flex",
|
|
491
|
+
flexDirection: "row",
|
|
492
|
+
justifyContent: "space-between",
|
|
493
|
+
alignItems: "center",
|
|
494
|
+
gap: N.spacingHorizontalM
|
|
495
|
+
},
|
|
496
|
+
message: {
|
|
497
|
+
lineHeight: N.spacingVerticalL,
|
|
498
|
+
paddingLeft: N.spacingHorizontalM
|
|
499
|
+
},
|
|
500
|
+
messagePlaceholder: { visibility: "hidden" },
|
|
501
|
+
additionalMessage: {
|
|
502
|
+
flexShrink: 0,
|
|
503
|
+
color: N.colorNeutralForeground3
|
|
504
|
+
},
|
|
505
|
+
errorMessage: { color: N.colorPaletteRedForeground1 },
|
|
506
|
+
infoMessage: { color: N.colorPaletteGreenForeground1 }
|
|
507
|
+
}), Z = (e) => (t) => {
|
|
508
|
+
let { label: n = "", required: i, hint: a, errorMessage: o, infoMessage: s, noMessage: c = !1, direction: l = "vertical", labelWidth: u = "medium", additionalMessage: d, clearable: f = !0, onClear: p, ...m } = t, h = vt(), g = Y(), _ = we("input-field"), v = l === "horizontal", y = M(v && h.labelHorizontal, v && g && h.labelHorizontalColumn, v && u === "small" && h.labelSmall, v && u === "medium" && h.labelMedium, v && u === "large" && h.labelLarge, v && u === "none" && h.labelNone), b = n !== null, x = n === void 0 || n === "" ? "\xA0" : n, S = /* @__PURE__ */ U("span", {
|
|
509
|
+
className: h.labelText,
|
|
510
|
+
children: x
|
|
511
|
+
});
|
|
512
|
+
return /* @__PURE__ */ W("div", {
|
|
513
|
+
className: v && b ? M(h.rootHorizontal, g ? h.rootHorizontalColumn : h.rootHorizontalRow) : h.rootVertical,
|
|
514
|
+
children: [b && /* @__PURE__ */ W("div", {
|
|
515
|
+
className: M(h.labelContainer, y),
|
|
516
|
+
children: [a ? /* @__PURE__ */ U(re, {
|
|
517
|
+
className: h.labelComponent,
|
|
518
|
+
"data-testid": "info-label",
|
|
519
|
+
htmlFor: _,
|
|
520
|
+
info: a,
|
|
521
|
+
required: i,
|
|
522
|
+
children: S
|
|
523
|
+
}) : /* @__PURE__ */ U(ie, {
|
|
524
|
+
className: h.labelComponent,
|
|
525
|
+
"data-testid": "label",
|
|
526
|
+
htmlFor: _,
|
|
527
|
+
required: i,
|
|
528
|
+
children: S
|
|
529
|
+
}), f !== !1 && p && m.readOnly !== !0 && m.disabled !== !0 && /* @__PURE__ */ U(Ie, {
|
|
530
|
+
className: h.eraserIcon,
|
|
531
|
+
"data-testid": "eraser-icon",
|
|
532
|
+
onClick: p
|
|
533
|
+
})]
|
|
534
|
+
}), /* @__PURE__ */ W("div", {
|
|
535
|
+
className: h.fieldGroup,
|
|
536
|
+
children: [/* @__PURE__ */ U(e, {
|
|
537
|
+
...m,
|
|
538
|
+
id: _
|
|
539
|
+
}), !c && /* @__PURE__ */ W("div", {
|
|
540
|
+
className: h.messageContainer,
|
|
541
|
+
children: [/* @__PURE__ */ U(r, {
|
|
542
|
+
className: M(h.message, o ? h.errorMessage : s ? h.infoMessage : h.messagePlaceholder),
|
|
543
|
+
children: o ?? s ?? "\xA0"
|
|
544
|
+
}), d && /* @__PURE__ */ U(r, {
|
|
545
|
+
className: h.additionalMessage,
|
|
546
|
+
children: d
|
|
547
|
+
})]
|
|
548
|
+
})]
|
|
549
|
+
})]
|
|
550
|
+
});
|
|
551
|
+
}, yt = j({
|
|
552
|
+
drawer: {
|
|
553
|
+
height: "auto",
|
|
554
|
+
maxHeight: "60vh",
|
|
555
|
+
overflowY: "auto"
|
|
556
|
+
},
|
|
557
|
+
drawerHeader: { paddingBottom: N.spacingVerticalM },
|
|
558
|
+
listboxWrapper: { padding: N.spacingVerticalM }
|
|
559
|
+
}), bt = (e, t, n) => n ? e == null ? t : t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : e, Q = ({ groups: e, ungrouped: t }) => {
|
|
560
|
+
let n = (e) => /* @__PURE__ */ U(se, {
|
|
561
|
+
disabled: e.disabled,
|
|
562
|
+
text: e.text,
|
|
563
|
+
value: e.value,
|
|
564
|
+
children: e.render ? e.render() : e.text
|
|
565
|
+
}, e.value);
|
|
566
|
+
return /* @__PURE__ */ W(H, { children: [t.map(n), Object.entries(e).map(([e, t]) => /* @__PURE__ */ U(ce, {
|
|
567
|
+
label: e,
|
|
568
|
+
children: t.map(n)
|
|
569
|
+
}, e))] });
|
|
570
|
+
}, xt = (e, t) => {
|
|
571
|
+
let n = z(() => e == null ? [] : Array.isArray(e) ? e : [e], [e]);
|
|
572
|
+
return {
|
|
573
|
+
selectedValues: n,
|
|
574
|
+
displayValue: z(() => t.filter((e) => n.includes(e.value)).map((e) => e.text).join(", "), [t, n]),
|
|
575
|
+
groupedOptions: z(() => {
|
|
576
|
+
let e = {}, n = [];
|
|
577
|
+
return t.forEach((t) => {
|
|
578
|
+
t.group ? (e[t.group] ??= []).push(t) : n.push(t);
|
|
579
|
+
}), {
|
|
580
|
+
groups: e,
|
|
581
|
+
ungrouped: n
|
|
582
|
+
};
|
|
583
|
+
}, [t])
|
|
584
|
+
};
|
|
585
|
+
}, St = (e) => {
|
|
586
|
+
let { value: t, onChange: r, options: i, placeholder: a, multiselect: o = !1, className: s, style: c, disabled: l, readOnly: u = !1, drawerTitle: d, id: f } = e, p = yt(), [m, h] = V(!1), { selectedValues: g, displayValue: _, groupedOptions: v } = xt(t, i), y = (e) => {
|
|
587
|
+
r(bt(e, g, o)), o || h(!1);
|
|
588
|
+
};
|
|
589
|
+
return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(O, {
|
|
590
|
+
autoComplete: "off",
|
|
591
|
+
className: s,
|
|
592
|
+
contentAfter: /* @__PURE__ */ U(G, {
|
|
593
|
+
onClick: () => h(!0),
|
|
594
|
+
style: { cursor: "pointer" }
|
|
595
|
+
}, `${f}-chevron`),
|
|
596
|
+
disabled: l,
|
|
597
|
+
id: f,
|
|
598
|
+
onClick: () => h(!0),
|
|
599
|
+
onKeyDown: (e) => e.preventDefault(),
|
|
600
|
+
placeholder: a,
|
|
601
|
+
readOnly: !0,
|
|
602
|
+
style: c,
|
|
603
|
+
type: "text",
|
|
604
|
+
value: _
|
|
605
|
+
}), /* @__PURE__ */ W(k, {
|
|
606
|
+
className: p.drawer,
|
|
607
|
+
onOpenChange: (e, { open: t }) => h(t),
|
|
608
|
+
open: m,
|
|
609
|
+
position: "bottom",
|
|
610
|
+
children: [/* @__PURE__ */ U(E, {
|
|
611
|
+
className: p.drawerHeader,
|
|
612
|
+
children: /* @__PURE__ */ U(D, {
|
|
613
|
+
action: /* @__PURE__ */ U(n, {
|
|
614
|
+
appearance: "subtle",
|
|
615
|
+
"aria-label": "Close",
|
|
616
|
+
icon: /* @__PURE__ */ U(K, {}),
|
|
617
|
+
onClick: () => h(!1)
|
|
618
|
+
}),
|
|
619
|
+
children: d
|
|
620
|
+
})
|
|
621
|
+
}), /* @__PURE__ */ U(T, { children: /* @__PURE__ */ U("div", {
|
|
622
|
+
className: p.listboxWrapper,
|
|
623
|
+
children: /* @__PURE__ */ U(oe, {
|
|
624
|
+
multiselect: o,
|
|
625
|
+
onOptionSelect: u ? void 0 : (e, t) => y(t.optionValue ?? null),
|
|
626
|
+
selectedOptions: g,
|
|
627
|
+
children: Q(v)
|
|
628
|
+
})
|
|
629
|
+
}) })]
|
|
630
|
+
})] });
|
|
631
|
+
}, Ct = Z((e) => {
|
|
632
|
+
let { value: t, onChange: n, options: r, multiselect: i = !1, style: a, readOnly: o = !1, ...s } = e, c = Y(), { selectedValues: l, displayValue: u, groupedOptions: d } = xt(t, r);
|
|
633
|
+
if (c) return /* @__PURE__ */ U(St, { ...e });
|
|
634
|
+
let f = (e) => {
|
|
635
|
+
n(bt(e, l, i));
|
|
636
|
+
};
|
|
637
|
+
return /* @__PURE__ */ U(ee, {
|
|
638
|
+
...s,
|
|
639
|
+
"aria-labelledby": s.id,
|
|
640
|
+
multiselect: i,
|
|
641
|
+
onOptionSelect: (e, t) => {
|
|
642
|
+
o || f(t.optionValue ?? null);
|
|
643
|
+
},
|
|
644
|
+
selectedOptions: l,
|
|
645
|
+
style: {
|
|
646
|
+
width: "100%",
|
|
647
|
+
...a
|
|
648
|
+
},
|
|
649
|
+
value: u,
|
|
650
|
+
children: Q(d)
|
|
651
|
+
});
|
|
652
|
+
}), wt = (e) => {
|
|
653
|
+
let { value: t, onChange: n, ...r } = e, i = (Array.isArray(t) ? t.length > 0 : t !== null && t !== "") ? () => n(e.multiselect === !0 ? [] : null) : void 0;
|
|
654
|
+
return /* @__PURE__ */ U(Ct, {
|
|
655
|
+
...r,
|
|
656
|
+
drawerTitle: e.label ?? e.placeholder,
|
|
657
|
+
onChange: n,
|
|
658
|
+
onClear: i,
|
|
659
|
+
value: t
|
|
660
|
+
});
|
|
661
|
+
}, Tt = j({
|
|
662
|
+
headerRow: {
|
|
663
|
+
backgroundColor: N.colorNeutralBackground3,
|
|
664
|
+
"& > *": { color: N.colorNeutralForeground1 },
|
|
665
|
+
width: "100%"
|
|
666
|
+
},
|
|
667
|
+
row: { width: "100%" },
|
|
668
|
+
headerCell: {
|
|
669
|
+
backgroundColor: N.colorNeutralBackground3,
|
|
670
|
+
display: "flex",
|
|
671
|
+
flexDirection: "column",
|
|
672
|
+
justifyContent: "center"
|
|
673
|
+
},
|
|
674
|
+
ellipsis: {
|
|
675
|
+
overflow: "hidden",
|
|
676
|
+
textOverflow: "ellipsis",
|
|
677
|
+
whiteSpace: "nowrap"
|
|
678
|
+
},
|
|
679
|
+
sortableHeader: { cursor: "pointer" },
|
|
680
|
+
cell: { paddingLeft: N.spacingHorizontalS },
|
|
681
|
+
outerWrapper: { width: "100%" },
|
|
682
|
+
scrollContainer: {
|
|
683
|
+
width: "100%",
|
|
684
|
+
overflowX: "auto",
|
|
685
|
+
WebkitOverflowScrolling: "touch"
|
|
686
|
+
},
|
|
687
|
+
paginationBar: {
|
|
688
|
+
display: "flex",
|
|
689
|
+
alignItems: "center",
|
|
690
|
+
justifyContent: "flex-end",
|
|
691
|
+
gap: N.spacingHorizontalS,
|
|
692
|
+
padding: `${N.spacingVerticalS} ${N.spacingHorizontalM}`,
|
|
693
|
+
backgroundColor: N.colorNeutralBackground2
|
|
694
|
+
},
|
|
695
|
+
paginationBarMobile: {
|
|
696
|
+
flexDirection: "column",
|
|
697
|
+
alignItems: "flex-end",
|
|
698
|
+
padding: `${N.spacingVerticalXXS} ${N.spacingHorizontalXXS}`,
|
|
699
|
+
gap: N.spacingHorizontalXS
|
|
700
|
+
},
|
|
701
|
+
navRow: {
|
|
702
|
+
display: "flex",
|
|
703
|
+
alignItems: "center",
|
|
704
|
+
gap: N.spacingHorizontalS,
|
|
705
|
+
order: 1
|
|
706
|
+
},
|
|
707
|
+
navRowMobile: { justifyContent: "center" },
|
|
708
|
+
sizeRow: {
|
|
709
|
+
display: "flex",
|
|
710
|
+
alignItems: "center",
|
|
711
|
+
gap: N.spacingHorizontalS,
|
|
712
|
+
order: 2
|
|
713
|
+
},
|
|
714
|
+
sizeRowMobile: {
|
|
715
|
+
justifyContent: "center",
|
|
716
|
+
paddingRight: N.spacingHorizontalM
|
|
717
|
+
},
|
|
718
|
+
listbox: {
|
|
719
|
+
minWidth: 0,
|
|
720
|
+
width: "80px"
|
|
721
|
+
},
|
|
722
|
+
range: {
|
|
723
|
+
fontSize: N.fontSizeBase200,
|
|
724
|
+
color: N.colorNeutralForeground3,
|
|
725
|
+
fontVariantNumeric: "tabular-nums",
|
|
726
|
+
minWidth: "90px",
|
|
727
|
+
textAlign: "center"
|
|
728
|
+
}
|
|
729
|
+
}), Et = Symbol.for("FuiColumn"), Dt = Object.assign(() => null, { _marker: Et }), Ot = (e, t) => t.split(".").reduce((e, t) => {
|
|
730
|
+
if (typeof e == "object" && e) return e[t];
|
|
731
|
+
}, e), kt = (e) => P.Children.toArray(e).filter((e) => P.isValidElement(e) && e.type?._marker === Et).map((e) => e.props), At = (t, n) => {
|
|
732
|
+
let r = Ot(n, t.field);
|
|
733
|
+
return t.builder ? t.builder(r, n) : t.formatter ? /* @__PURE__ */ U(e, { children: t.formatter(r, n) }) : /* @__PURE__ */ U(e, { children: r == null ? "" : String(r) });
|
|
734
|
+
}, jt = ({ offset: t, pageSize: r, fastForwardPage: i = 5, pageSizeOption: a, totalRecord: o, visibleCount: s, onPageChange: c, langLabel: l }) => {
|
|
735
|
+
let u = Tt(), d = l?.paginationBar, f = o === 0 ? 0 : t + 1, p = o === 0 ? 0 : t + s, m = t > 0, h = t + r < o, g = Y(), _ = String(r), v = o === 0 ? l?.noData || "No data" : l?.pageRange ? X(l.pageRange, {
|
|
736
|
+
from: f,
|
|
737
|
+
to: p,
|
|
738
|
+
total: o
|
|
739
|
+
}) : `${f} to ${p} of ${o}`, y = l?.pageSize ?? "Rows :", b = d?.next ?? "Next page", x = d?.nextN ? X(d.nextN, { n: i }) : `Next ${i} pages`, S = d?.previous ?? "Previous page", C = d?.previousN ? X(d.previousN, { n: i }) : `Previous ${i} pages`;
|
|
740
|
+
return /* @__PURE__ */ W("div", {
|
|
741
|
+
className: M(u.paginationBar, g && u.paginationBarMobile),
|
|
742
|
+
children: [/* @__PURE__ */ W("div", {
|
|
743
|
+
className: M(u.navRow, g && u.navRowMobile),
|
|
744
|
+
children: [
|
|
745
|
+
/* @__PURE__ */ U(A, {
|
|
746
|
+
content: C,
|
|
747
|
+
relationship: "label",
|
|
748
|
+
children: /* @__PURE__ */ U(n, {
|
|
749
|
+
appearance: "subtle",
|
|
750
|
+
"aria-label": C,
|
|
751
|
+
disabled: !m,
|
|
752
|
+
icon: /* @__PURE__ */ U(je, {}),
|
|
753
|
+
onClick: () => c(Math.max(0, t - i * r), r)
|
|
754
|
+
})
|
|
755
|
+
}),
|
|
756
|
+
/* @__PURE__ */ U(A, {
|
|
757
|
+
content: S,
|
|
758
|
+
relationship: "label",
|
|
759
|
+
children: /* @__PURE__ */ U(n, {
|
|
760
|
+
appearance: "subtle",
|
|
761
|
+
"aria-label": S,
|
|
762
|
+
disabled: !m,
|
|
763
|
+
icon: /* @__PURE__ */ U(Ne, {}),
|
|
764
|
+
onClick: () => c(Math.max(0, t - r), r)
|
|
765
|
+
})
|
|
766
|
+
}),
|
|
767
|
+
/* @__PURE__ */ U("span", {
|
|
768
|
+
className: u.range,
|
|
769
|
+
children: /* @__PURE__ */ U(e, { children: v })
|
|
770
|
+
}),
|
|
771
|
+
/* @__PURE__ */ U(A, {
|
|
772
|
+
content: b,
|
|
773
|
+
relationship: "label",
|
|
774
|
+
children: /* @__PURE__ */ U(n, {
|
|
775
|
+
appearance: "subtle",
|
|
776
|
+
"aria-label": b,
|
|
777
|
+
disabled: !h,
|
|
778
|
+
icon: /* @__PURE__ */ U(Pe, {}),
|
|
779
|
+
onClick: () => c(t + r, r)
|
|
780
|
+
})
|
|
781
|
+
}),
|
|
782
|
+
/* @__PURE__ */ U(A, {
|
|
783
|
+
content: x,
|
|
784
|
+
relationship: "label",
|
|
785
|
+
children: /* @__PURE__ */ U(n, {
|
|
786
|
+
appearance: "subtle",
|
|
787
|
+
"aria-label": x,
|
|
788
|
+
disabled: !h,
|
|
789
|
+
icon: /* @__PURE__ */ U(Me, {}),
|
|
790
|
+
onClick: () => c(t + i * r, r)
|
|
791
|
+
})
|
|
792
|
+
}),
|
|
793
|
+
" ",
|
|
794
|
+
!g && /* @__PURE__ */ U(w, { vertical: !0 })
|
|
795
|
+
]
|
|
796
|
+
}), /* @__PURE__ */ W("div", {
|
|
797
|
+
className: M(u.sizeRow, g && u.sizeRowMobile),
|
|
798
|
+
children: [/* @__PURE__ */ U(e, { children: y }), g ? /* @__PURE__ */ U(St, {
|
|
799
|
+
className: u.listbox,
|
|
800
|
+
onChange: (e) => {
|
|
801
|
+
e && !Array.isArray(e) && c(t, Number(e));
|
|
802
|
+
},
|
|
803
|
+
options: a.map((e) => String(e)).map((e) => ({
|
|
804
|
+
value: e,
|
|
805
|
+
text: e
|
|
806
|
+
})),
|
|
807
|
+
value: _
|
|
808
|
+
}) : /* @__PURE__ */ U(ee, {
|
|
809
|
+
className: u.listbox,
|
|
810
|
+
listbox: { className: u.listbox },
|
|
811
|
+
onOptionSelect: (e, n) => {
|
|
812
|
+
n.optionValue && c(t, Number(n.optionValue));
|
|
813
|
+
},
|
|
814
|
+
selectedOptions: [_],
|
|
815
|
+
value: _,
|
|
816
|
+
children: a.map((e) => String(e)).map((e) => /* @__PURE__ */ U(se, {
|
|
817
|
+
text: e,
|
|
818
|
+
value: e,
|
|
819
|
+
children: e
|
|
820
|
+
}, e))
|
|
821
|
+
})]
|
|
822
|
+
})]
|
|
823
|
+
});
|
|
824
|
+
}, Mt = ({ data: e, onPageOrSort: n, pagination: r, width: i, langLabel: a, children: o }) => {
|
|
825
|
+
let [s, c] = V(null), [l, u] = V("asc"), d = Tt(), v = J(), y = kt(o), b = (e) => {
|
|
826
|
+
let t = e.style?.width;
|
|
827
|
+
return t == null ? e.style ?? {} : {
|
|
828
|
+
...e.style,
|
|
829
|
+
boxSizing: "border-box",
|
|
830
|
+
flex: `0 0 ${t}`,
|
|
831
|
+
minWidth: 0,
|
|
832
|
+
overflow: "hidden"
|
|
833
|
+
};
|
|
834
|
+
}, x = y.map((e, t) => xe({
|
|
835
|
+
columnId: `${e.field}_${t}`,
|
|
836
|
+
renderHeaderCell: () => e.header,
|
|
837
|
+
renderCell: (t) => At(e, t)
|
|
838
|
+
})), S = (e) => {
|
|
839
|
+
if (n || v.warn("Sorting is not performed because onSort handler is not provided"), s === e) {
|
|
840
|
+
let t = l === "asc" ? "desc" : "asc";
|
|
841
|
+
u(t), n?.(r, {
|
|
842
|
+
field: e,
|
|
843
|
+
direction: t
|
|
844
|
+
});
|
|
845
|
+
} else c(e), u("asc"), n?.(r, {
|
|
846
|
+
field: e,
|
|
847
|
+
direction: "asc"
|
|
848
|
+
});
|
|
849
|
+
}, C = r && /* @__PURE__ */ U(jt, {
|
|
850
|
+
onPageChange: (e, t) => {
|
|
851
|
+
n?.({
|
|
852
|
+
offset: e,
|
|
853
|
+
pageSize: t
|
|
854
|
+
}, s ? {
|
|
855
|
+
field: s,
|
|
856
|
+
direction: l
|
|
857
|
+
} : void 0);
|
|
858
|
+
},
|
|
859
|
+
...r,
|
|
860
|
+
langLabel: a,
|
|
861
|
+
visibleCount: e.length
|
|
862
|
+
}), w = s ? x.find((e) => String(e.columnId).startsWith(`${s}_`))?.columnId : void 0, T = r ? Math.max(0, r.pageSize - e.length) : 0, E = [...e, ...Array.from({ length: T }).map((e, t) => ({
|
|
863
|
+
_isFiller: !0,
|
|
864
|
+
id: `filler-${t}`
|
|
865
|
+
}))];
|
|
866
|
+
return /* @__PURE__ */ W("div", {
|
|
867
|
+
className: d.outerWrapper,
|
|
868
|
+
children: [
|
|
869
|
+
r?.position === "top" && C,
|
|
870
|
+
/* @__PURE__ */ U("div", {
|
|
871
|
+
className: d.scrollContainer,
|
|
872
|
+
children: /* @__PURE__ */ W(f, {
|
|
873
|
+
columns: x,
|
|
874
|
+
items: E,
|
|
875
|
+
sortState: {
|
|
876
|
+
sortColumn: w,
|
|
877
|
+
sortDirection: l === "asc" ? "ascending" : "descending"
|
|
878
|
+
},
|
|
879
|
+
style: {
|
|
880
|
+
minWidth: i?.minWidth ?? i?.width,
|
|
881
|
+
whiteSpace: "nowrap",
|
|
882
|
+
width: "100%"
|
|
883
|
+
},
|
|
884
|
+
children: [/* @__PURE__ */ U(h, { children: /* @__PURE__ */ U(_, {
|
|
885
|
+
className: d.headerRow,
|
|
886
|
+
children: ({ renderHeaderCell: e, columnId: n }) => {
|
|
887
|
+
let r = y[parseInt(String(n).split("_").pop() || "0")];
|
|
888
|
+
return /* @__PURE__ */ U(g, {
|
|
889
|
+
className: M(d.headerCell, r.sortable && d.sortableHeader),
|
|
890
|
+
onClick: r.sortable ? () => S(r.field) : void 0,
|
|
891
|
+
sortDirection: r.sortable && s === r.field ? l === "asc" ? "ascending" : "descending" : void 0,
|
|
892
|
+
style: {
|
|
893
|
+
...b(r),
|
|
894
|
+
...r.headerStyle,
|
|
895
|
+
textAlign: r.align
|
|
896
|
+
},
|
|
897
|
+
children: /* @__PURE__ */ U(t, {
|
|
898
|
+
className: d.ellipsis,
|
|
899
|
+
children: e()
|
|
900
|
+
})
|
|
901
|
+
}, n);
|
|
902
|
+
}
|
|
903
|
+
}) }), /* @__PURE__ */ U(p, { children: ({ item: e, rowId: t }) => /* @__PURE__ */ U(_, {
|
|
904
|
+
className: d.row,
|
|
905
|
+
children: ({ renderCell: t, columnId: n }) => {
|
|
906
|
+
let r = y[parseInt(String(n).split("_").pop() || "0")];
|
|
907
|
+
return /* @__PURE__ */ U(m, {
|
|
908
|
+
className: d.cell,
|
|
909
|
+
style: {
|
|
910
|
+
...b(r),
|
|
911
|
+
textAlign: r.align
|
|
912
|
+
},
|
|
913
|
+
children: e._isFiller ? null : t(e)
|
|
914
|
+
}, n);
|
|
915
|
+
}
|
|
916
|
+
}, t) })]
|
|
917
|
+
})
|
|
918
|
+
}),
|
|
919
|
+
(r?.position === "bottom" || !r?.position) && C
|
|
920
|
+
]
|
|
921
|
+
});
|
|
922
|
+
}, Nt = (e, t) => `Carousel slide ${e + 1} of ${t}`, Pt = ({ images: e, langLabel: t }) => /* @__PURE__ */ U("div", {
|
|
923
|
+
style: { width: "100%" },
|
|
924
|
+
children: /* @__PURE__ */ W(i, {
|
|
925
|
+
announcement: Nt,
|
|
926
|
+
circular: !0,
|
|
927
|
+
groupSize: 1,
|
|
928
|
+
children: [/* @__PURE__ */ U(u, {
|
|
929
|
+
style: {
|
|
930
|
+
width: "100%",
|
|
931
|
+
overflow: "hidden"
|
|
932
|
+
},
|
|
933
|
+
children: /* @__PURE__ */ U(l, {
|
|
934
|
+
style: {
|
|
935
|
+
display: "flex",
|
|
936
|
+
flexWrap: "nowrap",
|
|
937
|
+
width: "100%"
|
|
938
|
+
},
|
|
939
|
+
children: e.map((t, n) => /* @__PURE__ */ U(a, {
|
|
940
|
+
"aria-label": `${n + 1} of ${e.length}`,
|
|
941
|
+
id: `carousel-image-${n}`,
|
|
942
|
+
style: {
|
|
943
|
+
aspectRatio: "5/2",
|
|
944
|
+
flexShrink: 0,
|
|
945
|
+
overflow: "hidden",
|
|
946
|
+
width: "100%"
|
|
947
|
+
},
|
|
948
|
+
children: /* @__PURE__ */ U(ne, {
|
|
949
|
+
fit: "cover",
|
|
950
|
+
role: "presentation",
|
|
951
|
+
src: t,
|
|
952
|
+
style: {
|
|
953
|
+
display: "block",
|
|
954
|
+
height: "100%",
|
|
955
|
+
objectFit: "cover",
|
|
956
|
+
width: "100%"
|
|
957
|
+
}
|
|
958
|
+
})
|
|
959
|
+
}, `image-${n}`))
|
|
960
|
+
})
|
|
961
|
+
}), /* @__PURE__ */ U(c, {
|
|
962
|
+
autoplayTooltip: {
|
|
963
|
+
content: t?.autoplay ?? "Autoplay",
|
|
964
|
+
relationship: "label"
|
|
965
|
+
},
|
|
966
|
+
layout: "inline",
|
|
967
|
+
nextTooltip: {
|
|
968
|
+
content: t?.next ?? "Next image",
|
|
969
|
+
relationship: "label"
|
|
970
|
+
},
|
|
971
|
+
prevTooltip: {
|
|
972
|
+
content: t?.previous ?? "Previous image",
|
|
973
|
+
relationship: "label"
|
|
974
|
+
},
|
|
975
|
+
children: /* @__PURE__ */ U(o, { children: (e) => /* @__PURE__ */ U(s, { "aria-label": `Carousel Nav Button ${e}` }) })
|
|
976
|
+
})]
|
|
977
|
+
})
|
|
978
|
+
}), Ft = (e) => {
|
|
979
|
+
let { readOnly: t = !1, onChange: n, className: r, style: i, ...a } = e, o = (e, r) => {
|
|
980
|
+
t || n?.(r);
|
|
981
|
+
};
|
|
982
|
+
return /* @__PURE__ */ U(d, {
|
|
983
|
+
...a,
|
|
984
|
+
className: r,
|
|
985
|
+
onChange: o,
|
|
986
|
+
style: i
|
|
987
|
+
});
|
|
988
|
+
}, It = j({
|
|
989
|
+
drawer: {
|
|
990
|
+
height: "auto",
|
|
991
|
+
maxHeight: "80vh"
|
|
992
|
+
},
|
|
993
|
+
drawerHeader: { paddingBottom: N.spacingVerticalM },
|
|
994
|
+
calendarWrapper: {
|
|
995
|
+
display: "flex",
|
|
996
|
+
justifyContent: "center",
|
|
997
|
+
padding: N.spacingVerticalM
|
|
998
|
+
}
|
|
999
|
+
}), Lt = (e) => e ? e.toLocaleDateString() : "", Rt = (e) => {
|
|
1000
|
+
let { value: t, onChange: n, formatter: r = Lt, className: i, style: a, readOnly: o, ...s } = e;
|
|
1001
|
+
return Y() ? /* @__PURE__ */ U(zt, { ...e }) : o ? /* @__PURE__ */ U(O, {
|
|
1002
|
+
className: i,
|
|
1003
|
+
id: s.id,
|
|
1004
|
+
placeholder: s.placeholder,
|
|
1005
|
+
readOnly: !0,
|
|
1006
|
+
style: {
|
|
1007
|
+
width: "100%",
|
|
1008
|
+
...a
|
|
1009
|
+
},
|
|
1010
|
+
type: "text",
|
|
1011
|
+
value: r(t)
|
|
1012
|
+
}) : /* @__PURE__ */ Oe(Ve, {
|
|
1013
|
+
...s,
|
|
1014
|
+
key: `${s.id}-${t ? "defined" : "undefined"}`,
|
|
1015
|
+
className: i,
|
|
1016
|
+
formatDate: (e) => r(e ?? null),
|
|
1017
|
+
onSelectDate: n,
|
|
1018
|
+
style: {
|
|
1019
|
+
width: "100%",
|
|
1020
|
+
...a
|
|
1021
|
+
},
|
|
1022
|
+
value: t ?? void 0
|
|
1023
|
+
});
|
|
1024
|
+
}, zt = (e) => {
|
|
1025
|
+
let { value: t, onChange: n, formatter: r = Lt, className: i, style: a, drawerTitle: o, readOnly: s, ...c } = e, l = It(), [u, d] = V(!1), f = () => {
|
|
1026
|
+
s || d(!0);
|
|
1027
|
+
}, p = (e) => {
|
|
1028
|
+
n(e), d(!1);
|
|
1029
|
+
}, m = s ? void 0 : /* @__PURE__ */ U(Ae, {
|
|
1030
|
+
onClick: f,
|
|
1031
|
+
style: { cursor: "pointer" }
|
|
1032
|
+
}, `${c.id}-calendar`), h = r(t);
|
|
1033
|
+
return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(O, {
|
|
1034
|
+
...c,
|
|
1035
|
+
autoComplete: "off",
|
|
1036
|
+
className: i,
|
|
1037
|
+
contentAfter: m,
|
|
1038
|
+
onClick: f,
|
|
1039
|
+
onKeyDown: (e) => e.preventDefault(),
|
|
1040
|
+
readOnly: !0,
|
|
1041
|
+
style: a,
|
|
1042
|
+
type: "text",
|
|
1043
|
+
value: h
|
|
1044
|
+
}), /* @__PURE__ */ W(k, {
|
|
1045
|
+
className: l.drawer,
|
|
1046
|
+
onOpenChange: (e, { open: t }) => d(t),
|
|
1047
|
+
open: u,
|
|
1048
|
+
position: "bottom",
|
|
1049
|
+
children: [o && /* @__PURE__ */ U(E, {
|
|
1050
|
+
className: l.drawerHeader,
|
|
1051
|
+
children: /* @__PURE__ */ U(D, { children: o })
|
|
1052
|
+
}), /* @__PURE__ */ U(T, { children: /* @__PURE__ */ U("div", {
|
|
1053
|
+
className: l.calendarWrapper,
|
|
1054
|
+
children: /* @__PURE__ */ U(Be, {
|
|
1055
|
+
onSelectDate: p,
|
|
1056
|
+
value: t ?? void 0
|
|
1057
|
+
}, `${c.id}-${t ? "defined" : "undefined"}`)
|
|
1058
|
+
}) })]
|
|
1059
|
+
})] });
|
|
1060
|
+
}, Bt = Z(Rt), Vt = (e) => {
|
|
1061
|
+
let { value: t, onChange: n, ...r } = e, i = t !== null && !e.readOnly && !e.disabled ? () => n(null) : void 0;
|
|
1062
|
+
return /* @__PURE__ */ U(Bt, {
|
|
1063
|
+
...r,
|
|
1064
|
+
drawerTitle: e.label ?? e.placeholder,
|
|
1065
|
+
onChange: n,
|
|
1066
|
+
onClear: i,
|
|
1067
|
+
value: t
|
|
1068
|
+
});
|
|
1069
|
+
}, Ht = j({
|
|
1070
|
+
arrows: {
|
|
1071
|
+
display: "flex",
|
|
1072
|
+
flexDirection: "column"
|
|
1073
|
+
},
|
|
1074
|
+
arrowsRow: { flexDirection: "row" },
|
|
1075
|
+
arrowIcon: { cursor: "pointer" },
|
|
1076
|
+
arrowIconMobile: {
|
|
1077
|
+
fontSize: N.fontSizeBase500,
|
|
1078
|
+
height: N.fontSizeBase500,
|
|
1079
|
+
width: N.fontSizeBase500
|
|
1080
|
+
},
|
|
1081
|
+
arrowIconDisabled: {
|
|
1082
|
+
cursor: "default",
|
|
1083
|
+
opacity: .4
|
|
1084
|
+
},
|
|
1085
|
+
amPm: {
|
|
1086
|
+
cursor: "pointer",
|
|
1087
|
+
fontWeight: N.fontWeightSemibold,
|
|
1088
|
+
paddingRight: N.spacingHorizontalXS,
|
|
1089
|
+
userSelect: "none"
|
|
1090
|
+
},
|
|
1091
|
+
amPmDisabled: {
|
|
1092
|
+
cursor: "default",
|
|
1093
|
+
opacity: .4
|
|
1094
|
+
}
|
|
1095
|
+
}), Ut = {
|
|
1096
|
+
hour: 0,
|
|
1097
|
+
minute: 0,
|
|
1098
|
+
second: 0
|
|
1099
|
+
}, Wt = (e, t, n) => {
|
|
1100
|
+
if (e === null) return "";
|
|
1101
|
+
let r = n ? e.hour : e.hour % 12 || 12, i = String(r).padStart(2, "0"), a = String(e.minute).padStart(2, "0"), o = String(e.second).padStart(2, "0");
|
|
1102
|
+
return t ? `${i}:${a}:${o}` : `${i}:${a}`;
|
|
1103
|
+
}, Gt = (e, t) => e == null ? t ? "s" : "m" : e < 3 ? "h" : e < 6 ? "m" : "s", $ = (e, t, n, r) => {
|
|
1104
|
+
let i = e ?? Ut;
|
|
1105
|
+
if (t === "s") {
|
|
1106
|
+
let e = i.second + n;
|
|
1107
|
+
return r && e < 0 ? $({
|
|
1108
|
+
...i,
|
|
1109
|
+
second: 59
|
|
1110
|
+
}, "m", -1, r) : r && e >= 60 ? $({
|
|
1111
|
+
...i,
|
|
1112
|
+
second: 0
|
|
1113
|
+
}, "m", 1, r) : {
|
|
1114
|
+
...i,
|
|
1115
|
+
second: (e + 60) % 60
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
if (t === "m") {
|
|
1119
|
+
let e = i.minute + n;
|
|
1120
|
+
return r && e < 0 ? $({
|
|
1121
|
+
...i,
|
|
1122
|
+
minute: 59
|
|
1123
|
+
}, "h", -1, r) : r && e >= 60 ? $({
|
|
1124
|
+
...i,
|
|
1125
|
+
minute: 0
|
|
1126
|
+
}, "h", 1, r) : {
|
|
1127
|
+
...i,
|
|
1128
|
+
minute: (e + 60) % 60
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
return {
|
|
1132
|
+
...i,
|
|
1133
|
+
hour: (i.hour + n + 24) % 24
|
|
1134
|
+
};
|
|
1135
|
+
}, Kt = Z((e) => {
|
|
1136
|
+
let { value: t, onChange: n, in24HourFormat: r = !0, withSeconds: i = !1, cascadeCarry: a = !1, readOnly: o = !1, disabled: s, className: c, style: l, id: u, ...d } = e, f = Ht(), p = Y(), m = B(null), [h, g] = V(null), _ = B(null), v = !o && !s, y = t !== null && t.hour >= 12;
|
|
1137
|
+
R(() => {
|
|
1138
|
+
_.current !== null && m.current && (m.current.setSelectionRange(_.current, _.current), _.current = null);
|
|
1139
|
+
});
|
|
1140
|
+
let b = () => {
|
|
1141
|
+
g(Gt(m.current?.selectionStart, i));
|
|
1142
|
+
}, x = () => {
|
|
1143
|
+
g(Gt(m.current?.selectionStart, i));
|
|
1144
|
+
}, S = () => g(null), C = (e) => {
|
|
1145
|
+
if (!v) return;
|
|
1146
|
+
let r = h ?? (i ? "s" : "m");
|
|
1147
|
+
_.current = m.current?.selectionStart ?? null, n($(t, r, e, a));
|
|
1148
|
+
}, w = () => {
|
|
1149
|
+
if (!v) return;
|
|
1150
|
+
let e = t ?? Ut;
|
|
1151
|
+
n({
|
|
1152
|
+
...e,
|
|
1153
|
+
hour: e.hour >= 12 ? e.hour - 12 : e.hour + 12
|
|
1154
|
+
});
|
|
1155
|
+
}, T = M(f.arrowIcon, p && f.arrowIconMobile, !v && f.arrowIconDisabled), E = /* @__PURE__ */ W("div", {
|
|
1156
|
+
className: M(f.arrows, p && f.arrowsRow),
|
|
1157
|
+
children: [/* @__PURE__ */ U(Fe, {
|
|
1158
|
+
className: T,
|
|
1159
|
+
onClick: () => C(1),
|
|
1160
|
+
onMouseDown: (e) => e.preventDefault()
|
|
1161
|
+
}), /* @__PURE__ */ U(G, {
|
|
1162
|
+
className: T,
|
|
1163
|
+
onClick: () => C(-1),
|
|
1164
|
+
onMouseDown: (e) => e.preventDefault()
|
|
1165
|
+
})]
|
|
1166
|
+
}), D = !r && t !== null ? /* @__PURE__ */ U("span", {
|
|
1167
|
+
className: v ? f.amPm : M(f.amPm, f.amPmDisabled),
|
|
1168
|
+
onClick: v ? w : void 0,
|
|
1169
|
+
onMouseDown: v ? (e) => e.preventDefault() : void 0,
|
|
1170
|
+
children: y ? "PM" : "AM"
|
|
1171
|
+
}) : void 0;
|
|
1172
|
+
return /* @__PURE__ */ U(O, {
|
|
1173
|
+
...d,
|
|
1174
|
+
autoComplete: "off",
|
|
1175
|
+
className: c,
|
|
1176
|
+
contentAfter: E,
|
|
1177
|
+
contentBefore: D,
|
|
1178
|
+
disabled: s,
|
|
1179
|
+
id: u,
|
|
1180
|
+
input: {
|
|
1181
|
+
ref: m,
|
|
1182
|
+
style: { minWidth: i ? "8ch" : "5ch" }
|
|
1183
|
+
},
|
|
1184
|
+
onBlur: S,
|
|
1185
|
+
onClick: b,
|
|
1186
|
+
onFocus: x,
|
|
1187
|
+
onKeyDown: (e) => {
|
|
1188
|
+
e.key !== "Tab" && e.preventDefault();
|
|
1189
|
+
},
|
|
1190
|
+
readOnly: o,
|
|
1191
|
+
style: {
|
|
1192
|
+
width: "100%",
|
|
1193
|
+
...l
|
|
1194
|
+
},
|
|
1195
|
+
type: "text",
|
|
1196
|
+
value: Wt(t, i, r)
|
|
1197
|
+
});
|
|
1198
|
+
}), qt = (e) => {
|
|
1199
|
+
let { value: t, onChange: n, ...r } = e, i = t !== null && !e.readOnly && !e.disabled ? () => n(null) : void 0;
|
|
1200
|
+
return /* @__PURE__ */ U(Kt, {
|
|
1201
|
+
...r,
|
|
1202
|
+
onChange: n,
|
|
1203
|
+
onClear: i,
|
|
1204
|
+
value: t
|
|
1205
|
+
});
|
|
1206
|
+
}, Jt = j({
|
|
1207
|
+
groupRow: {
|
|
1208
|
+
display: "flex",
|
|
1209
|
+
flexDirection: "row",
|
|
1210
|
+
gap: N.spacingHorizontalM,
|
|
1211
|
+
width: "100%"
|
|
1212
|
+
},
|
|
1213
|
+
groupColumn: {
|
|
1214
|
+
display: "flex",
|
|
1215
|
+
flexDirection: "column",
|
|
1216
|
+
gap: N.spacingVerticalXXS,
|
|
1217
|
+
width: "100%"
|
|
1218
|
+
}
|
|
1219
|
+
}), Yt = Z(({ items: e, className: t, style: n }) => {
|
|
1220
|
+
let r = Y(), i = Jt();
|
|
1221
|
+
return /* @__PURE__ */ U("div", {
|
|
1222
|
+
className: `${r ? i.groupColumn : i.groupRow} ${t ?? ""}`,
|
|
1223
|
+
style: n,
|
|
1224
|
+
children: e.map(({ element: e, weight: t = 1 }, n) => {
|
|
1225
|
+
let { label: i, placeholder: a } = e.props, o = a ?? i;
|
|
1226
|
+
return /* @__PURE__ */ U("div", {
|
|
1227
|
+
style: r ? { flex: "1 1 auto" } : {
|
|
1228
|
+
flex: `${t} 1 0px`,
|
|
1229
|
+
minWidth: 0
|
|
1230
|
+
},
|
|
1231
|
+
children: P.cloneElement(e, {
|
|
1232
|
+
label: null,
|
|
1233
|
+
placeholder: o,
|
|
1234
|
+
noMessage: !1
|
|
1235
|
+
})
|
|
1236
|
+
}, n);
|
|
1237
|
+
})
|
|
1238
|
+
});
|
|
1239
|
+
}), Xt = (e) => {
|
|
1240
|
+
let t = Y(), { items: n, className: r, style: i } = e, a = n.some(({ element: e }) => {
|
|
1241
|
+
let t = e.props.value;
|
|
1242
|
+
return t != null && t !== "";
|
|
1243
|
+
}) ? () => n.forEach(({ element: e }) => e.props.onChange(null)) : void 0;
|
|
1244
|
+
return /* @__PURE__ */ U(Yt, {
|
|
1245
|
+
...e,
|
|
1246
|
+
className: r,
|
|
1247
|
+
direction: t ? "vertical" : e.direction,
|
|
1248
|
+
noMessage: !0,
|
|
1249
|
+
onClear: a,
|
|
1250
|
+
style: i
|
|
1251
|
+
});
|
|
1252
|
+
}, Zt = Z((e) => {
|
|
1253
|
+
let { type: t = "text", onChange: r, onKeyDown: i, className: a, style: o, ...s } = e, [c, l] = V(!1), u = t === "email" ? (t) => {
|
|
1254
|
+
t.key === "@" && e.value?.includes("@") && t.preventDefault(), i?.(t);
|
|
1255
|
+
} : i, d = (e) => {
|
|
1256
|
+
r(e ?? null);
|
|
1257
|
+
}, f = () => {
|
|
1258
|
+
l(!c);
|
|
1259
|
+
}, p = t === "password" && c ? "text" : t;
|
|
1260
|
+
return /* @__PURE__ */ U(O, {
|
|
1261
|
+
...s,
|
|
1262
|
+
className: a,
|
|
1263
|
+
contentAfter: t === "password" ? /* @__PURE__ */ U(n, {
|
|
1264
|
+
appearance: "subtle",
|
|
1265
|
+
icon: U(c ? Le : Re, {}),
|
|
1266
|
+
onClick: f,
|
|
1267
|
+
size: "small",
|
|
1268
|
+
type: "button"
|
|
1269
|
+
}) : s.contentAfter,
|
|
1270
|
+
onChange: (e, t) => d(t.value),
|
|
1271
|
+
onKeyDown: u,
|
|
1272
|
+
style: o,
|
|
1273
|
+
type: p,
|
|
1274
|
+
value: e.value ?? ""
|
|
1275
|
+
});
|
|
1276
|
+
}), Qt = (e) => {
|
|
1277
|
+
let { value: t, onChange: n, ...r } = e, i = t !== null && t !== "" ? () => n(null) : void 0;
|
|
1278
|
+
return /* @__PURE__ */ U(Zt, {
|
|
1279
|
+
...r,
|
|
1280
|
+
onChange: n,
|
|
1281
|
+
onClear: i,
|
|
1282
|
+
value: t
|
|
1283
|
+
});
|
|
1284
|
+
}, $t = j({
|
|
1285
|
+
drawerBase: { height: "auto" },
|
|
1286
|
+
drawerMobile: {
|
|
1287
|
+
height: "40vh",
|
|
1288
|
+
maxHeight: "60vh"
|
|
1289
|
+
},
|
|
1290
|
+
drawerDesktop: {
|
|
1291
|
+
width: "40vw",
|
|
1292
|
+
maxWidth: "60vw",
|
|
1293
|
+
maxHeight: "100vh"
|
|
1294
|
+
},
|
|
1295
|
+
drawerBody: {
|
|
1296
|
+
display: "flex",
|
|
1297
|
+
flexDirection: "column",
|
|
1298
|
+
gap: N.spacingVerticalL,
|
|
1299
|
+
padding: N.spacingVerticalL,
|
|
1300
|
+
overflowY: "auto"
|
|
1301
|
+
}
|
|
1302
|
+
}), en = Z((e) => {
|
|
1303
|
+
let { value: t, onChange: r, disabled: i, drawerTitle: a, className: o, readOnly: s, style: c, langLabel: l, textComponent: u = Qt, ...d } = e, f = Y(), p = (l?.languages ?? []).slice(0, 3), m = $t(), [h, g] = V(!1), _ = t ? t.valueInLangOne ?? t.valueInLangTwo ?? t.valueInLangThree ?? "" : "", v = (e) => {
|
|
1304
|
+
if (!t) {
|
|
1305
|
+
r({
|
|
1306
|
+
valueInLangOne: e || null,
|
|
1307
|
+
valueInLangTwo: null,
|
|
1308
|
+
valueInLangThree: null
|
|
1309
|
+
});
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
t.valueInLangOne === null ? t.valueInLangTwo === null ? t.valueInLangThree === null ? r({
|
|
1313
|
+
...t,
|
|
1314
|
+
valueInLangOne: e || null
|
|
1315
|
+
}) : r({
|
|
1316
|
+
...t,
|
|
1317
|
+
valueInLangThree: e || null
|
|
1318
|
+
}) : r({
|
|
1319
|
+
...t,
|
|
1320
|
+
valueInLangTwo: e || null
|
|
1321
|
+
}) : r({
|
|
1322
|
+
...t,
|
|
1323
|
+
valueInLangOne: e || null
|
|
1324
|
+
});
|
|
1325
|
+
}, y = (e, n) => {
|
|
1326
|
+
r({
|
|
1327
|
+
valueInLangOne: t?.valueInLangOne ?? null,
|
|
1328
|
+
valueInLangTwo: t?.valueInLangTwo ?? null,
|
|
1329
|
+
valueInLangThree: t?.valueInLangThree ?? null,
|
|
1330
|
+
[e]: n
|
|
1331
|
+
});
|
|
1332
|
+
}, b = /* @__PURE__ */ U(ze, {
|
|
1333
|
+
onClick: () => g(!0),
|
|
1334
|
+
style: { cursor: "pointer" }
|
|
1335
|
+
}), x = /* @__PURE__ */ W(k, {
|
|
1336
|
+
className: M(m.drawerBase, f ? m.drawerMobile : m.drawerDesktop),
|
|
1337
|
+
onOpenChange: (e, { open: t }) => g(t),
|
|
1338
|
+
open: h,
|
|
1339
|
+
position: f ? "bottom" : "end",
|
|
1340
|
+
children: [/* @__PURE__ */ U(E, { children: /* @__PURE__ */ U(D, {
|
|
1341
|
+
action: /* @__PURE__ */ U(n, {
|
|
1342
|
+
appearance: "subtle",
|
|
1343
|
+
"aria-label": "Close",
|
|
1344
|
+
icon: /* @__PURE__ */ U(K, {}),
|
|
1345
|
+
onClick: () => g(!1)
|
|
1346
|
+
}),
|
|
1347
|
+
children: a
|
|
1348
|
+
}) }), /* @__PURE__ */ W(T, {
|
|
1349
|
+
className: m.drawerBody,
|
|
1350
|
+
children: [
|
|
1351
|
+
/* @__PURE__ */ U(u, {
|
|
1352
|
+
disabled: i,
|
|
1353
|
+
label: p[0] || "Lang One",
|
|
1354
|
+
onChange: (e) => y("valueInLangOne", e),
|
|
1355
|
+
readOnly: s,
|
|
1356
|
+
value: t?.valueInLangOne ?? null
|
|
1357
|
+
}),
|
|
1358
|
+
p[1] && /* @__PURE__ */ U(u, {
|
|
1359
|
+
disabled: i,
|
|
1360
|
+
label: p[1],
|
|
1361
|
+
onChange: (e) => y("valueInLangTwo", e),
|
|
1362
|
+
readOnly: s,
|
|
1363
|
+
value: t?.valueInLangTwo ?? null
|
|
1364
|
+
}),
|
|
1365
|
+
p[2] && /* @__PURE__ */ U(u, {
|
|
1366
|
+
disabled: i,
|
|
1367
|
+
label: p[2],
|
|
1368
|
+
onChange: (e) => y("valueInLangThree", e),
|
|
1369
|
+
readOnly: s,
|
|
1370
|
+
value: t?.valueInLangThree ?? null
|
|
1371
|
+
})
|
|
1372
|
+
]
|
|
1373
|
+
})]
|
|
1374
|
+
});
|
|
1375
|
+
return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(u, {
|
|
1376
|
+
...d,
|
|
1377
|
+
className: o,
|
|
1378
|
+
clearable: !1,
|
|
1379
|
+
contentAfter: p.length > 1 ? b : void 0,
|
|
1380
|
+
disabled: i,
|
|
1381
|
+
label: null,
|
|
1382
|
+
noMessage: !0,
|
|
1383
|
+
onChange: (e) => v(e),
|
|
1384
|
+
readOnly: s,
|
|
1385
|
+
style: c,
|
|
1386
|
+
value: _
|
|
1387
|
+
}), p.length > 1 && x] });
|
|
1388
|
+
}), tn = (e) => {
|
|
1389
|
+
let { value: t, onChange: n } = e, r = t && (t.valueInLangOne || t.valueInLangTwo || t.valueInLangThree) ? () => n(null) : void 0;
|
|
1390
|
+
return /* @__PURE__ */ U(en, {
|
|
1391
|
+
...e,
|
|
1392
|
+
drawerTitle: e.label ?? e.placeholder,
|
|
1393
|
+
onClear: r
|
|
1394
|
+
});
|
|
1395
|
+
}, nn = j({
|
|
1396
|
+
arrows: {
|
|
1397
|
+
display: "flex",
|
|
1398
|
+
flexDirection: "row",
|
|
1399
|
+
gap: N.spacingHorizontalXS
|
|
1400
|
+
},
|
|
1401
|
+
arrowIcon: {
|
|
1402
|
+
cursor: "pointer",
|
|
1403
|
+
fontSize: N.fontSizeBase500,
|
|
1404
|
+
height: N.fontSizeBase500,
|
|
1405
|
+
width: N.fontSizeBase500
|
|
1406
|
+
}
|
|
1407
|
+
}), rn = Z((e) => {
|
|
1408
|
+
let { value: t, onChange: n, precision: r = 0, allowNegative: i = !0, formatter: a, onFocus: o, onBlur: s, step: c, min: l, max: u, className: d, style: f, ...p } = e, m = Y(), h = nn(), [g, _] = V(!1), [v, y] = V(t === null ? "" : t.toString());
|
|
1409
|
+
R(() => {
|
|
1410
|
+
g || y(t === null ? "" : t.toString());
|
|
1411
|
+
}, [t, g]);
|
|
1412
|
+
let b = (e) => {
|
|
1413
|
+
let t = e.key;
|
|
1414
|
+
if (![
|
|
1415
|
+
"Backspace",
|
|
1416
|
+
"Delete",
|
|
1417
|
+
"ArrowLeft",
|
|
1418
|
+
"ArrowRight",
|
|
1419
|
+
"Tab",
|
|
1420
|
+
"Enter",
|
|
1421
|
+
"Escape"
|
|
1422
|
+
].includes(t)) {
|
|
1423
|
+
if (t === "-") {
|
|
1424
|
+
(!i || e.currentTarget.selectionStart !== 0 || v.includes("-")) && e.preventDefault();
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
if (t === ".") {
|
|
1428
|
+
(r <= 0 || v.includes(".")) && e.preventDefault();
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
if (/^[0-9]$/.test(t)) {
|
|
1432
|
+
let t = v.indexOf(".");
|
|
1433
|
+
if (t !== -1) {
|
|
1434
|
+
let n = v.split(".")[1] || "";
|
|
1435
|
+
e.currentTarget.selectionStart > t && n.length >= r && e.preventDefault();
|
|
1436
|
+
}
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
e.preventDefault();
|
|
1440
|
+
}
|
|
1441
|
+
}, x = (e) => {
|
|
1442
|
+
let t = e.target.value;
|
|
1443
|
+
if (t === "" || t === "-" || t === ".") {
|
|
1444
|
+
y(t), n(null);
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1447
|
+
let r = parseFloat(t);
|
|
1448
|
+
isNaN(r) || (y(t), n(r));
|
|
1449
|
+
}, S = (e) => {
|
|
1450
|
+
_(!0), o?.(e);
|
|
1451
|
+
}, C = (e) => {
|
|
1452
|
+
_(!1), v === "-" || v === "." ? (y(""), n(null)) : v.endsWith(".") && y(v.slice(0, -1)), s?.(e);
|
|
1453
|
+
};
|
|
1454
|
+
if (c) {
|
|
1455
|
+
let { appearance: e, size: r, ...i } = p, o = t, s = !g && o !== null ? a ? a(o) : o.toString() : v, _ = (e, t) => {
|
|
1456
|
+
n(t.value ?? null);
|
|
1457
|
+
};
|
|
1458
|
+
if (m) {
|
|
1459
|
+
let e = !i.disabled && !i.readOnly, t = () => {
|
|
1460
|
+
if (!e) return;
|
|
1461
|
+
let t = (o ?? 0) + c;
|
|
1462
|
+
u !== void 0 && t > u || n(t);
|
|
1463
|
+
}, r = () => {
|
|
1464
|
+
if (!e) return;
|
|
1465
|
+
let t = (o ?? 0) - c;
|
|
1466
|
+
l !== void 0 && t < l || n(t);
|
|
1467
|
+
};
|
|
1468
|
+
return /* @__PURE__ */ U(O, {
|
|
1469
|
+
...i,
|
|
1470
|
+
className: d,
|
|
1471
|
+
contentAfter: /* @__PURE__ */ W("div", {
|
|
1472
|
+
className: h.arrows,
|
|
1473
|
+
children: [/* @__PURE__ */ U(Fe, {
|
|
1474
|
+
className: h.arrowIcon,
|
|
1475
|
+
onClick: t,
|
|
1476
|
+
onMouseDown: (e) => e.preventDefault()
|
|
1477
|
+
}), /* @__PURE__ */ U(G, {
|
|
1478
|
+
className: h.arrowIcon,
|
|
1479
|
+
onClick: r,
|
|
1480
|
+
onMouseDown: (e) => e.preventDefault()
|
|
1481
|
+
})]
|
|
1482
|
+
}),
|
|
1483
|
+
onKeyDown: (e) => {
|
|
1484
|
+
e.key !== "Tab" && e.preventDefault();
|
|
1485
|
+
},
|
|
1486
|
+
style: f,
|
|
1487
|
+
type: "text",
|
|
1488
|
+
value: s
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
return /* @__PURE__ */ U(ue, {
|
|
1492
|
+
...i,
|
|
1493
|
+
appearance: e === "filled-darker-shadow" ? "filled-darker" : e === "filled-lighter-shadow" ? "filled-lighter" : e,
|
|
1494
|
+
className: d,
|
|
1495
|
+
displayValue: s,
|
|
1496
|
+
max: u,
|
|
1497
|
+
min: l,
|
|
1498
|
+
onChange: _,
|
|
1499
|
+
onKeyDown: (e) => e.preventDefault(),
|
|
1500
|
+
size: r === "large" ? "medium" : r,
|
|
1501
|
+
step: c,
|
|
1502
|
+
style: f,
|
|
1503
|
+
value: o
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
let w = !g && t !== null ? a ? a(t) : t.toString() : v;
|
|
1507
|
+
return /* @__PURE__ */ U(O, {
|
|
1508
|
+
...p,
|
|
1509
|
+
className: d,
|
|
1510
|
+
onBlur: C,
|
|
1511
|
+
onChange: x,
|
|
1512
|
+
onFocus: S,
|
|
1513
|
+
onKeyDown: b,
|
|
1514
|
+
style: f,
|
|
1515
|
+
type: "text",
|
|
1516
|
+
value: w
|
|
1517
|
+
});
|
|
1518
|
+
}), an = (e) => {
|
|
1519
|
+
let { value: t, onChange: n, ...r } = e, i = t === null ? void 0 : () => n(null);
|
|
1520
|
+
return /* @__PURE__ */ U(rn, {
|
|
1521
|
+
...r,
|
|
1522
|
+
onChange: n,
|
|
1523
|
+
onClear: i,
|
|
1524
|
+
value: t
|
|
1525
|
+
});
|
|
1526
|
+
}, on = Z((e) => {
|
|
1527
|
+
let { onChange: t, className: n, style: r, readOnly: i = !1, ...a } = e, o = (e, n) => {
|
|
1528
|
+
i || t?.(n);
|
|
1529
|
+
};
|
|
1530
|
+
return /* @__PURE__ */ U(le, {
|
|
1531
|
+
...a,
|
|
1532
|
+
className: n,
|
|
1533
|
+
onChange: o,
|
|
1534
|
+
style: r
|
|
1535
|
+
});
|
|
1536
|
+
}), sn = (e) => {
|
|
1537
|
+
let { readOnly: t = !1, onChange: n, className: r, style: i, ...a } = e, o = (e, r) => {
|
|
1538
|
+
t || n(r.checked);
|
|
1539
|
+
};
|
|
1540
|
+
return /* @__PURE__ */ U(fe, {
|
|
1541
|
+
...a,
|
|
1542
|
+
className: r,
|
|
1543
|
+
onChange: o,
|
|
1544
|
+
style: i
|
|
1545
|
+
});
|
|
1546
|
+
}, cn = Z((e) => {
|
|
1547
|
+
let { value: t, onChange: n, className: r, style: i, readOnly: a = !1, ...o } = e;
|
|
1548
|
+
return /* @__PURE__ */ U(he, {
|
|
1549
|
+
...o,
|
|
1550
|
+
className: r,
|
|
1551
|
+
onChange: (e, t) => {
|
|
1552
|
+
a || n(t.value ?? null);
|
|
1553
|
+
},
|
|
1554
|
+
style: i,
|
|
1555
|
+
value: t ?? ""
|
|
1556
|
+
});
|
|
1557
|
+
}), ln = (e) => {
|
|
1558
|
+
let { value: t, maxLength: n, additionalMessage: r, onChange: i, ...a } = e, o = n === void 0 ? void 0 : `${(t ?? "").length}/${n}`, s = t !== null && t !== "" ? () => i(null) : void 0;
|
|
1559
|
+
return /* @__PURE__ */ U(cn, {
|
|
1560
|
+
...a,
|
|
1561
|
+
additionalMessage: r ?? o,
|
|
1562
|
+
maxLength: n,
|
|
1563
|
+
onChange: i,
|
|
1564
|
+
onClear: s,
|
|
1565
|
+
value: t
|
|
1566
|
+
});
|
|
1567
|
+
};
|
|
1568
|
+
//#endregion
|
|
1569
|
+
export { pt as FuiButtonPanel, Dt as FuiColumn, Pt as FuiImageCarousel, Ft as FuiInputCheckbox, Vt as FuiInputDate, wt as FuiInputDropdown, Xt as FuiInputGroup, tn as FuiInputMultiLangText, an as FuiInputNumber, on as FuiInputRadio, sn as FuiInputSwitch, Qt as FuiInputText, ln as FuiInputTextArea, qt as FuiInputTime, gt as FuiTab, _t as FuiTabList, Mt as FuiTable, at as HandyFluentUiProvider, ot as useBreadcrumb, st as useDialog, Y as useIsMobile, J as useLogger, ct as useSpinner, lt as useTheme, ut as useTimeZone, dt as useToast, Z as withInputField };
|
|
1570
|
+
|
|
1571
|
+
//# sourceMappingURL=index.js.map
|