zaravand-ui 3.0.1 → 3.0.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/components/Table/Table.constants.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +2 -0
- package/dist/components/Table/Table.interface.d.ts +10 -1
- package/dist/components/Table/Table.utils.d.ts +2 -0
- package/dist/components/Table/Table.variant.d.ts +6 -2
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +452 -397
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -253,7 +253,7 @@ var M = /* @__PURE__ */ h(((e) => {
|
|
|
253
253
|
var m = Object.keys(n).filter(function(e) {
|
|
254
254
|
return e !== "key";
|
|
255
255
|
});
|
|
256
|
-
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
256
|
+
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", L[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), L[p + o] = !0);
|
|
257
257
|
}
|
|
258
258
|
if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
259
259
|
else i = n;
|
|
@@ -271,13 +271,13 @@ var M = /* @__PURE__ */ h(((e) => {
|
|
|
271
271
|
m = { react_stack_bottom_frame: function(e) {
|
|
272
272
|
return e();
|
|
273
273
|
} };
|
|
274
|
-
var P, F = {},
|
|
274
|
+
var P, F = {}, ee = m.react_stack_bottom_frame.bind(m, o)(), I = N(i(o)), L = {};
|
|
275
275
|
e.Fragment = v, e.jsx = function(e, t, n) {
|
|
276
276
|
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
277
|
-
return d(e, t, n, !1, r ? Error("react-stack-top-frame") :
|
|
277
|
+
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : ee, r ? N(i(e)) : I);
|
|
278
278
|
}, e.jsxs = function(e, t, n) {
|
|
279
279
|
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
280
|
-
return d(e, t, n, !0, r ? Error("react-stack-top-frame") :
|
|
280
|
+
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : ee, r ? N(i(e)) : I);
|
|
281
281
|
};
|
|
282
282
|
})();
|
|
283
283
|
})), P = (/* @__PURE__ */ h(((e, t) => {
|
|
@@ -300,10 +300,10 @@ function F({ className: e, size: t = "default", variant: n = "default" }) {
|
|
|
300
300
|
}
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region src/components/shared/responsiveScale.ts
|
|
303
|
-
var
|
|
304
|
-
sm:
|
|
305
|
-
default:
|
|
306
|
-
lg:
|
|
303
|
+
var ee = "zui:h-[4.608rem]", I = "zui:h-[5.184rem]", L = "zui:h-[5.76rem]", R = {
|
|
304
|
+
sm: ee,
|
|
305
|
+
default: I,
|
|
306
|
+
lg: L
|
|
307
307
|
}, z = "zui:px-[1.2rem]", B = "zui:py-[1.2rem]", te = "zui:px-[1.6rem]", ne = "zui:min-h-[7.68rem]", V = "zui:h-[5.6rem]", re = "zui:text-[1.4rem]", ie = "zui:size-[3.2rem]", ae = "zui:size-[2.8rem]", oe = "zui:h-[3.2rem]", se = "zui:p-[2.4rem]", ce = "zui:p-[1.6rem]", le = "zui:w-[10.4rem]", ue = "zui:[&>button]:!h-[4.608rem] zui:[&>button]:!w-[4.608rem]", de = `zui-button zui:inline-flex zui:w-full zui:items-center zui:justify-center zui:gap-2 zui:rounded-md ${te} zui:text-sm zui:font-medium zui:leading-none zui:whitespace-nowrap zui:focus-visible:outline-none zui:focus-visible:ring-2 zui:focus-visible:ring-[var(--zui-color-primary)] zui:focus-visible:ring-offset-2 zui:focus-visible:ring-offset-[var(--zui-color-surface)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:opacity-65`, fe = R, pe = {
|
|
308
308
|
confirm: {
|
|
309
309
|
primary: "zui:bg-[var(--zui-color-primary)] zui:text-[var(--zui-color-on-solid)] zui:hover:brightness-105 zui:hover:shadow-sm zui:active:shadow-sm",
|
|
@@ -335,19 +335,19 @@ var he = 140, ge = i(function({ size: e = "default", variant: t = "primary", kin
|
|
|
335
335
|
disabled: C
|
|
336
336
|
}), E && "zui-button--icon-only", m), N = a(() => {
|
|
337
337
|
j.current !== null && (window.clearTimeout(j.current), j.current = null);
|
|
338
|
-
}, []),
|
|
338
|
+
}, []), ee = a(() => {
|
|
339
339
|
C || (N(), A.current = window.performance.now(), k(!0));
|
|
340
|
-
}, [N, C]),
|
|
340
|
+
}, [N, C]), I = a(() => {
|
|
341
341
|
N();
|
|
342
342
|
let e = window.performance.now() - A.current, t = Math.max(he - e, 0);
|
|
343
343
|
j.current = window.setTimeout(() => {
|
|
344
344
|
k(!1), j.current = null;
|
|
345
345
|
}, t);
|
|
346
|
-
}, [N]),
|
|
347
|
-
y?.(e), !e.defaultPrevented && (e.repeat || e.key !== " " && e.key !== "Enter" ||
|
|
348
|
-
}, [y,
|
|
349
|
-
b?.(e), !e.defaultPrevented && (e.key !== " " && e.key !== "Enter" ||
|
|
350
|
-
}, [b,
|
|
346
|
+
}, [N]), L = a((e) => {
|
|
347
|
+
y?.(e), !e.defaultPrevented && (e.repeat || e.key !== " " && e.key !== "Enter" || ee());
|
|
348
|
+
}, [y, ee]), R = a((e) => {
|
|
349
|
+
b?.(e), !e.defaultPrevented && (e.key !== " " && e.key !== "Enter" || I());
|
|
350
|
+
}, [b, I]);
|
|
351
351
|
return s(() => {
|
|
352
352
|
C && (N(), k(!1));
|
|
353
353
|
}, [N, C]), s(() => N, [N]), /* @__PURE__ */ (0, P.jsxs)("button", {
|
|
@@ -358,18 +358,18 @@ var he = 140, ge = i(function({ size: e = "default", variant: t = "primary", kin
|
|
|
358
358
|
"aria-busy": i || void 0,
|
|
359
359
|
"data-pressed": O ? "true" : void 0,
|
|
360
360
|
onPointerDown: (e) => {
|
|
361
|
-
h?.(e), !e.defaultPrevented &&
|
|
361
|
+
h?.(e), !e.defaultPrevented && ee();
|
|
362
362
|
},
|
|
363
363
|
onPointerUp: (e) => {
|
|
364
|
-
g?.(e),
|
|
364
|
+
g?.(e), I();
|
|
365
365
|
},
|
|
366
366
|
onPointerCancel: (e) => {
|
|
367
|
-
_?.(e),
|
|
367
|
+
_?.(e), I();
|
|
368
368
|
},
|
|
369
369
|
onPointerLeave: (e) => {
|
|
370
|
-
v?.(e),
|
|
370
|
+
v?.(e), I();
|
|
371
371
|
},
|
|
372
|
-
onKeyDown:
|
|
372
|
+
onKeyDown: L,
|
|
373
373
|
onKeyUp: R,
|
|
374
374
|
onClick: C ? void 0 : p,
|
|
375
375
|
className: M,
|
|
@@ -2669,7 +2669,7 @@ var Yi = "PopperContent", [Xi, Zi] = Hi(Yi), Qi = e.forwardRef((t, n) => {
|
|
|
2669
2669
|
padding: D,
|
|
2670
2670
|
boundary: O.filter(na),
|
|
2671
2671
|
altBoundary: k
|
|
2672
|
-
}, { refs: j, floatingStyles: M, placement: N, isPositioned: F, middlewareData:
|
|
2672
|
+
}, { refs: j, floatingStyles: M, placement: N, isPositioned: F, middlewareData: ee } = ki({
|
|
2673
2673
|
strategy: "fixed",
|
|
2674
2674
|
placement: E,
|
|
2675
2675
|
whileElementsMounted: (...e) => hi(...e, { animationFrame: m === "always" }),
|
|
@@ -2706,11 +2706,11 @@ var Yi = "PopperContent", [Xi, Zi] = Hi(Yi), Qi = e.forwardRef((t, n) => {
|
|
|
2706
2706
|
...A
|
|
2707
2707
|
})
|
|
2708
2708
|
]
|
|
2709
|
-
}), [
|
|
2709
|
+
}), [I, L] = ia(N), R = Bt(h);
|
|
2710
2710
|
G(() => {
|
|
2711
2711
|
F && R?.();
|
|
2712
2712
|
}, [F, R]);
|
|
2713
|
-
let z =
|
|
2713
|
+
let z = ee.arrow?.x, B = ee.arrow?.y, te = ee.arrow?.centerOffset !== 0, [ne, V] = e.useState();
|
|
2714
2714
|
return G(() => {
|
|
2715
2715
|
v && V(window.getComputedStyle(v).zIndex);
|
|
2716
2716
|
}, [v]), /* @__PURE__ */ (0, P.jsx)("div", {
|
|
@@ -2721,8 +2721,8 @@ var Yi = "PopperContent", [Xi, Zi] = Hi(Yi), Qi = e.forwardRef((t, n) => {
|
|
|
2721
2721
|
transform: F ? M.transform : "translate(0, -200%)",
|
|
2722
2722
|
minWidth: "max-content",
|
|
2723
2723
|
zIndex: ne,
|
|
2724
|
-
"--radix-popper-transform-origin": [
|
|
2725
|
-
...
|
|
2724
|
+
"--radix-popper-transform-origin": [ee.transformOrigin?.x, ee.transformOrigin?.y].join(" "),
|
|
2725
|
+
...ee.hide?.referenceHidden && {
|
|
2726
2726
|
visibility: "hidden",
|
|
2727
2727
|
pointerEvents: "none"
|
|
2728
2728
|
}
|
|
@@ -2730,14 +2730,14 @@ var Yi = "PopperContent", [Xi, Zi] = Hi(Yi), Qi = e.forwardRef((t, n) => {
|
|
|
2730
2730
|
dir: t.dir,
|
|
2731
2731
|
children: /* @__PURE__ */ (0, P.jsx)(Xi, {
|
|
2732
2732
|
scope: r,
|
|
2733
|
-
placedSide:
|
|
2733
|
+
placedSide: I,
|
|
2734
2734
|
onArrowChange: S,
|
|
2735
2735
|
arrowX: z,
|
|
2736
2736
|
arrowY: B,
|
|
2737
2737
|
shouldHideArrow: te,
|
|
2738
2738
|
children: /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
2739
|
-
"data-side":
|
|
2740
|
-
"data-align":
|
|
2739
|
+
"data-side": I,
|
|
2740
|
+
"data-align": L,
|
|
2741
2741
|
...g,
|
|
2742
2742
|
ref: b,
|
|
2743
2743
|
style: {
|
|
@@ -6076,10 +6076,10 @@ function sd(e) {
|
|
|
6076
6076
|
n.formatters,
|
|
6077
6077
|
n.labels,
|
|
6078
6078
|
n.classNames
|
|
6079
|
-
]), { captionLayout: f, mode: p, navLayout: m, numberOfMonths: h = 1, onDayBlur: g, onDayClick: _, onDayFocus: v, onDayKeyDown: y, onDayMouseEnter: b, onDayMouseLeave: x, onNextClick: S, onPrevClick: C, showWeekNumber: w, styles: T } = n, { formatCaption: E, formatDay: D, formatMonthDropdown: O, formatWeekNumber: k, formatWeekNumberHeader: A, formatWeekdayName: j, formatYearDropdown: M } = i, N = Ku(n, s), { days: P, months: F, navStart:
|
|
6080
|
-
|
|
6079
|
+
]), { captionLayout: f, mode: p, navLayout: m, numberOfMonths: h = 1, onDayBlur: g, onDayClick: _, onDayFocus: v, onDayKeyDown: y, onDayMouseEnter: b, onDayMouseLeave: x, onNextClick: S, onPrevClick: C, showWeekNumber: w, styles: T } = n, { formatCaption: E, formatDay: D, formatMonthDropdown: O, formatWeekNumber: k, formatWeekNumberHeader: A, formatWeekdayName: j, formatYearDropdown: M } = i, N = Ku(n, s), { days: P, months: F, navStart: ee, navEnd: I, previousMonth: L, nextMonth: R, goToMonth: z } = N, B = Jl(P, n, ee, I, s), { isSelected: te, select: ne, selected: V } = od(n, s) ?? {}, { blur: re, focused: ie, isFocusTarget: ae, moveFocus: oe, setFocused: se } = Qu(n, N, B, te ?? (() => !1), s), { labelDayButton: ce, labelGridcell: le, labelGrid: ue, labelMonthDropdown: de, labelNav: fe, labelPrevious: pe, labelNext: me, labelWeekday: he, labelWeekNumber: ge, labelWeekNumberHeader: _e, labelYearDropdown: ve } = o, H = l(() => fu(s, n.ISOWeek), [s, n.ISOWeek]), ye = p !== void 0 || _ !== void 0, U = a(() => {
|
|
6080
|
+
L && (z(L), C?.(L));
|
|
6081
6081
|
}, [
|
|
6082
|
-
|
|
6082
|
+
L,
|
|
6083
6083
|
z,
|
|
6084
6084
|
C
|
|
6085
6085
|
]), be = a(() => {
|
|
@@ -6154,7 +6154,7 @@ function sd(e) {
|
|
|
6154
6154
|
isSelected: te,
|
|
6155
6155
|
months: F,
|
|
6156
6156
|
nextMonth: R,
|
|
6157
|
-
previousMonth:
|
|
6157
|
+
previousMonth: L,
|
|
6158
6158
|
goToMonth: z,
|
|
6159
6159
|
getModifiers: B,
|
|
6160
6160
|
components: r,
|
|
@@ -6186,7 +6186,7 @@ function sd(e) {
|
|
|
6186
6186
|
"aria-label": fe(),
|
|
6187
6187
|
onPreviousClick: U,
|
|
6188
6188
|
onNextClick: be,
|
|
6189
|
-
previousMonth:
|
|
6189
|
+
previousMonth: L,
|
|
6190
6190
|
nextMonth: R
|
|
6191
6191
|
}), F.map((e, a) => t.createElement(r.Month, {
|
|
6192
6192
|
"data-animated-month": n.animate ? "true" : void 0,
|
|
@@ -6198,13 +6198,13 @@ function sd(e) {
|
|
|
6198
6198
|
}, m === "around" && !n.hideNavigation && a === 0 && t.createElement(r.PreviousMonthButton, {
|
|
6199
6199
|
type: "button",
|
|
6200
6200
|
className: d[J.PreviousMonthButton],
|
|
6201
|
-
tabIndex:
|
|
6202
|
-
"aria-disabled":
|
|
6203
|
-
"aria-label": pe(
|
|
6201
|
+
tabIndex: L ? void 0 : -1,
|
|
6202
|
+
"aria-disabled": L ? void 0 : !0,
|
|
6203
|
+
"aria-label": pe(L),
|
|
6204
6204
|
onClick: U,
|
|
6205
6205
|
"data-animated-button": n.animate ? "true" : void 0
|
|
6206
6206
|
}, t.createElement(r.Chevron, {
|
|
6207
|
-
disabled:
|
|
6207
|
+
disabled: L ? void 0 : !0,
|
|
6208
6208
|
className: d[J.Chevron],
|
|
6209
6209
|
orientation: n.dir === "rtl" ? "right" : "left"
|
|
6210
6210
|
})), t.createElement(r.MonthCaption, {
|
|
@@ -6225,7 +6225,7 @@ function sd(e) {
|
|
|
6225
6225
|
components: r,
|
|
6226
6226
|
disabled: !!n.disableNavigation,
|
|
6227
6227
|
onChange: Te(e.date),
|
|
6228
|
-
options: uu(e.date,
|
|
6228
|
+
options: uu(e.date, ee, I, i, s),
|
|
6229
6229
|
style: T?.[J.Dropdown],
|
|
6230
6230
|
value: s.getMonth(e.date)
|
|
6231
6231
|
}) : t.createElement("span", { key: "month" }, O(e.date, s)), o = f === "dropdown" || f === "dropdown-years" ? t.createElement(r.YearsDropdown, {
|
|
@@ -6236,7 +6236,7 @@ function sd(e) {
|
|
|
6236
6236
|
components: r,
|
|
6237
6237
|
disabled: !!n.disableNavigation,
|
|
6238
6238
|
onChange: Ee(e.date),
|
|
6239
|
-
options: pu(
|
|
6239
|
+
options: pu(ee, I, i, s, !!n.reverseYears),
|
|
6240
6240
|
style: T?.[J.Dropdown],
|
|
6241
6241
|
value: s.getYear(e.date)
|
|
6242
6242
|
}) : t.createElement("span", { key: "year" }, M(e.date, s));
|
|
@@ -6279,7 +6279,7 @@ function sd(e) {
|
|
|
6279
6279
|
"aria-label": fe(),
|
|
6280
6280
|
onPreviousClick: U,
|
|
6281
6281
|
onNextClick: be,
|
|
6282
|
-
previousMonth:
|
|
6282
|
+
previousMonth: L,
|
|
6283
6283
|
nextMonth: R
|
|
6284
6284
|
}), t.createElement(r.MonthGrid, {
|
|
6285
6285
|
role: "grid",
|
|
@@ -11547,7 +11547,7 @@ function zb(e) {
|
|
|
11547
11547
|
return gb(e, "shamsi");
|
|
11548
11548
|
}
|
|
11549
11549
|
function Bb({ className: t, size: n = "default", title: r, required: i = !1, showRequiredMessage: a = !1, placeholder: o, mode: s = "single", allowManualInput: c = !1, value: l, defaultValue: u, onChange: d, typeDateExport: f, typeDateOutput: p = "object", fromDate: m, toDate: h, disabledDates: g, numberOfMonths: _ = 2, calendarSystem: v, defaultCalendarSystem: y = "shamsi", onCalendarSystemChange: b, open: x, onOpenChange: S, onInvalid: C, disabled: w = !1, id: T }) {
|
|
11550
|
-
let E = e.useId(), O = T ?? E, k = i, A = s === "range", j = l !== void 0, M = x !== void 0, N = v !== void 0, [F,
|
|
11550
|
+
let E = e.useId(), O = T ?? E, k = i, A = s === "range", j = l !== void 0, M = x !== void 0, N = v !== void 0, [F, ee] = e.useState(!1), [I, L] = e.useState(u instanceof Date ? u : void 0), [R, z] = e.useState(lb(u) ? u : void 0), [B, te] = e.useState("day"), [ne, V] = e.useState(!1), [re, ie] = e.useState(""), [ae, oe] = e.useState(!1), [se, ce] = e.useState(""), [ue, de] = e.useState(""), [fe, pe] = e.useState(!1), [me, he] = e.useState(!1), [ge, _e] = e.useState(y), ve = N ? v : ge, H = f ?? ve, ye = $y[ve], U = ye.dateLib, be = e.useMemo(() => m ? U.startOfMonth(m) : void 0, [m, U]), W = e.useMemo(() => h ? U.startOfMonth(h) : void 0, [U, h]), [G, xe] = e.useState(() => pb(db(A, l, u) ?? /* @__PURE__ */ new Date(), be, W, U)), [Se, Ce] = e.useState(() => fb(U.getYear(G))), we = e.useRef(ve), Te = e.useRef(null), Ee = e.useRef(null), De = e.useRef(null), Oe = e.useRef(null), ke = M ? x : F, Ae = !A && j && l instanceof Date ? l : !A && !j ? I : void 0, je = A && j && lb(l) ? l : A && !j ? R : void 0, Me = ub(A, Ae, je), Ne = A ? c ? 1 : Math.max(1, _) : 1, Pe = U.getYear(G), Fe = U.getMonth(G), Ie = A ? !!je?.from : Ae instanceof Date, Le = A ? gb(je, ve) : Ae ? hb(Ae, ve) : null, Re = o ?? (ve === "miladi" ? "Select date" : nb), K = c, ze = e.useMemo(() => ye.monthFormatter.format(G), [G, ye]), Be = e.useMemo(() => ye.yearFormatter.format(G), [G, ye]), Ve = e.useMemo(() => Array.from({ length: 12 }, (e, t) => {
|
|
11551
11551
|
let n = U.newDate(Pe, t, 1);
|
|
11552
11552
|
return {
|
|
11553
11553
|
value: t,
|
|
@@ -11629,7 +11629,7 @@ function Bb({ className: t, size: n = "default", title: r, required: i = !1, sho
|
|
|
11629
11629
|
!ne || !Ie || V(!1);
|
|
11630
11630
|
}, [Ie, ne]);
|
|
11631
11631
|
let Ye = e.useCallback((e) => {
|
|
11632
|
-
M ||
|
|
11632
|
+
M || ee(e), S?.(e);
|
|
11633
11633
|
}, [M, S]), Xe = e.useCallback(() => {
|
|
11634
11634
|
let e = mb(ve);
|
|
11635
11635
|
N || _e(e), b?.(e);
|
|
@@ -11638,7 +11638,7 @@ function Bb({ className: t, size: n = "default", title: r, required: i = !1, sho
|
|
|
11638
11638
|
b,
|
|
11639
11639
|
ve
|
|
11640
11640
|
]), Ze = e.useCallback((e) => {
|
|
11641
|
-
ne && V(!1), j ||
|
|
11641
|
+
ne && V(!1), j || L(e), d?.(Lb(e, "single", H, p)), e && Ye(!1);
|
|
11642
11642
|
}, [
|
|
11643
11643
|
Ye,
|
|
11644
11644
|
ne,
|
|
@@ -12508,13 +12508,13 @@ function $x(e, t) {
|
|
|
12508
12508
|
}
|
|
12509
12509
|
var eS = "این فیلد اجباری است";
|
|
12510
12510
|
function tS({ className: t, size: n = "default", type: r = "text", title: i, required: a = !1, showRequiredMessage: o = !1, characterLimit: s, placeholder: c, onChange: l, onBlur: u, onFocus: d, onInvalid: f, id: p, name: m, disabled: h = !1, readOnly: g = !1, autoComplete: _, "aria-label": v, value: y, defaultValue: b, maxLength: x }) {
|
|
12511
|
-
let [S, C] = e.useState(!1), [w, T] = e.useState(() => Wx(y ?? b)), [E, O] = e.useState(() => Xx(y ?? b, r === "money")), [k, A] = e.useState(!1), j = e.useId(), M = p ?? j, N = e.useRef(null), F = r === "search",
|
|
12511
|
+
let [S, C] = e.useState(!1), [w, T] = e.useState(() => Wx(y ?? b)), [E, O] = e.useState(() => Xx(y ?? b, r === "money")), [k, A] = e.useState(!1), j = e.useId(), M = p ?? j, N = e.useRef(null), F = r === "search", ee = r === "password", I = r === "money", L = r === "username", R = r === "number", z = a, B = ee || R || I || L, te = !(ee && !S), ne = ee ? S ? "text" : "password" : I || L || R ? "text" : r, V = y !== void 0, re = y === void 0 ? y : Zx(Xx(y, I), te), ie = b === void 0 ? b : Zx(Xx(b, I), te);
|
|
12512
12512
|
e.useEffect(() => {
|
|
12513
|
-
V && (T(Wx(y)), O(Xx(y,
|
|
12513
|
+
V && (T(Wx(y)), O(Xx(y, I)));
|
|
12514
12514
|
}, [
|
|
12515
12515
|
V,
|
|
12516
12516
|
y,
|
|
12517
|
-
|
|
12517
|
+
I
|
|
12518
12518
|
]), e.useEffect(() => {
|
|
12519
12519
|
if (V) return;
|
|
12520
12520
|
let e = N.current;
|
|
@@ -12547,7 +12547,7 @@ function tS({ className: t, size: n = "default", type: r = "text", title: i, req
|
|
|
12547
12547
|
if (!e) return;
|
|
12548
12548
|
let t = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
12549
12549
|
t ? t.call(e, "") : e.value = "", T(!1), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus();
|
|
12550
|
-
}, []), de = D(Ux({ size: n }), B ? "zui:text-center" : "zui:text-right", F ? "input-search-cancel zui:pr-10 zui:pl-10" : void 0,
|
|
12550
|
+
}, []), de = D(Ux({ size: n }), B ? "zui:text-center" : "zui:text-right", F ? "input-search-cancel zui:pr-10 zui:pl-10" : void 0, ee ? "zui:pl-10" : void 0);
|
|
12551
12551
|
return /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
12552
12552
|
"data-slot": "input-field",
|
|
12553
12553
|
dir: "rtl",
|
|
@@ -12592,7 +12592,7 @@ function tS({ className: t, size: n = "default", type: r = "text", title: i, req
|
|
|
12592
12592
|
id: M,
|
|
12593
12593
|
"data-slot": "input",
|
|
12594
12594
|
type: ne,
|
|
12595
|
-
inputMode:
|
|
12595
|
+
inputMode: I || R ? "numeric" : void 0,
|
|
12596
12596
|
maxLength: s ?? x,
|
|
12597
12597
|
required: z,
|
|
12598
12598
|
"aria-invalid": k || void 0,
|
|
@@ -12603,7 +12603,7 @@ function tS({ className: t, size: n = "default", type: r = "text", title: i, req
|
|
|
12603
12603
|
readOnly: g,
|
|
12604
12604
|
autoComplete: _,
|
|
12605
12605
|
"aria-label": v,
|
|
12606
|
-
onChange:
|
|
12606
|
+
onChange: I ? se : oe,
|
|
12607
12607
|
onBlur: ce,
|
|
12608
12608
|
onFocus: d,
|
|
12609
12609
|
onInvalid: le,
|
|
@@ -12627,7 +12627,7 @@ function tS({ className: t, size: n = "default", type: r = "text", title: i, req
|
|
|
12627
12627
|
})
|
|
12628
12628
|
})
|
|
12629
12629
|
}) : null,
|
|
12630
|
-
|
|
12630
|
+
ee ? /* @__PURE__ */ (0, P.jsx)("button", {
|
|
12631
12631
|
type: "button",
|
|
12632
12632
|
onClick: () => C((e) => !e),
|
|
12633
12633
|
className: "zui:absolute zui:left-3 zui:top-1/2 zui:-translate-y-1/2 zui:cursor-pointer zui:text-[var(--zui-color-text)] zui:transition-opacity zui:hover:opacity-80 zui:focus-visible:outline-none",
|
|
@@ -13484,7 +13484,7 @@ var JC = 10, [YC, XC] = AC(KC), ZC = "SelectContentImpl", QC = /* @__PURE__ */ M
|
|
|
13484
13484
|
e.useEffect(() => {
|
|
13485
13485
|
A && F();
|
|
13486
13486
|
}, [A, F]);
|
|
13487
|
-
let { onOpenChange:
|
|
13487
|
+
let { onOpenChange: ee, triggerPointerDownPosRef: I } = y;
|
|
13488
13488
|
e.useEffect(() => {
|
|
13489
13489
|
if (b) {
|
|
13490
13490
|
let e = {
|
|
@@ -13492,13 +13492,13 @@ var JC = 10, [YC, XC] = AC(KC), ZC = "SelectContentImpl", QC = /* @__PURE__ */ M
|
|
|
13492
13492
|
y: 0
|
|
13493
13493
|
}, t = (t) => {
|
|
13494
13494
|
e = {
|
|
13495
|
-
x: Math.abs(Math.round(t.pageX) - (
|
|
13496
|
-
y: Math.abs(Math.round(t.pageY) - (
|
|
13495
|
+
x: Math.abs(Math.round(t.pageX) - (I.current?.x ?? 0)),
|
|
13496
|
+
y: Math.abs(Math.round(t.pageY) - (I.current?.y ?? 0))
|
|
13497
13497
|
};
|
|
13498
13498
|
}, n = (n) => {
|
|
13499
|
-
e.x <= 10 && e.y <= 10 ? n.preventDefault() : b.contains(n.target) ||
|
|
13499
|
+
e.x <= 10 && e.y <= 10 ? n.preventDefault() : b.contains(n.target) || ee(!1), document.removeEventListener("pointermove", t), I.current = null;
|
|
13500
13500
|
};
|
|
13501
|
-
return
|
|
13501
|
+
return I.current !== null && (document.addEventListener("pointermove", t), document.addEventListener("pointerup", n, {
|
|
13502
13502
|
capture: !0,
|
|
13503
13503
|
once: !0
|
|
13504
13504
|
})), () => {
|
|
@@ -13507,15 +13507,15 @@ var JC = 10, [YC, XC] = AC(KC), ZC = "SelectContentImpl", QC = /* @__PURE__ */ M
|
|
|
13507
13507
|
}
|
|
13508
13508
|
}, [
|
|
13509
13509
|
b,
|
|
13510
|
-
|
|
13511
|
-
|
|
13510
|
+
ee,
|
|
13511
|
+
I
|
|
13512
13512
|
]), e.useEffect(() => {
|
|
13513
|
-
let e = () =>
|
|
13513
|
+
let e = () => ee(!1);
|
|
13514
13514
|
return window.addEventListener("blur", e), window.addEventListener("resize", e), () => {
|
|
13515
13515
|
window.removeEventListener("blur", e), window.removeEventListener("resize", e);
|
|
13516
13516
|
};
|
|
13517
|
-
}, [
|
|
13518
|
-
let [
|
|
13517
|
+
}, [ee]);
|
|
13518
|
+
let [L, R] = Pw((e) => {
|
|
13519
13519
|
let t = k().filter((e) => !e.disabled), n = Fw(t, e, t.find((e) => e.ref.current === document.activeElement));
|
|
13520
13520
|
n && setTimeout(() => n.ref.current.focus());
|
|
13521
13521
|
}), z = e.useCallback((e, t, n) => {
|
|
@@ -13549,7 +13549,7 @@ var JC = 10, [YC, XC] = AC(KC), ZC = "SelectContentImpl", QC = /* @__PURE__ */ M
|
|
|
13549
13549
|
selectedItemText: D,
|
|
13550
13550
|
position: i,
|
|
13551
13551
|
isPositioned: A,
|
|
13552
|
-
searchRef:
|
|
13552
|
+
searchRef: L,
|
|
13553
13553
|
children: /* @__PURE__ */ (0, P.jsx)(ko, {
|
|
13554
13554
|
as: QC,
|
|
13555
13555
|
allowPinchZoom: !0,
|
|
@@ -13984,7 +13984,7 @@ var Lw = LC, Rw = zC, zw = VC, Bw = UC, Vw = GC, Hw = qC, Uw = sw, Ww = dw, Gw =
|
|
|
13984
13984
|
false: "zui:p-1"
|
|
13985
13985
|
} },
|
|
13986
13986
|
defaultVariants: { hasSearch: !1 }
|
|
13987
|
-
}), $w = q("zui:relative zui:flex zui:w-full zui:cursor-pointer zui:items-center zui:border-b zui:border-[var(--zui-color-border)] zui:py-1.5 zui:pl-8 zui:pr-2 zui:text-right zui:text-sm zui:text-[var(--zui-color-text)] zui:outline-none zui:select-none zui:transition-[background-color,color] zui:duration-150 zui:last:border-b-0 zui:data-[disabled]:pointer-events-none zui:data-[disabled]:cursor-not-allowed zui:data-[disabled]:opacity-45 zui:data-[highlighted]:bg-[var(--zui-theme-bg-muted)] zui:data-[highlighted]:text-[var(--zui-color-text)] zui:data-[state=checked]:bg-transparent"), eT = q("zui:px-2 zui:py-1.5 zui:text-right zui:text-xs zui:font-semibold zui:text-[var(--zui-color-text)]"), tT = q("zui:my-1 zui:h-px zui:bg-[var(--zui-color-border)]"), nT = q([`zui:file:text-[var(--zui-color-text)] zui:placeholder:text-[var(--zui-color-border)] zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:flex ${
|
|
13987
|
+
}), $w = q("zui:relative zui:flex zui:w-full zui:cursor-pointer zui:items-center zui:border-b zui:border-[var(--zui-color-border)] zui:py-1.5 zui:pl-8 zui:pr-2 zui:text-right zui:text-sm zui:text-[var(--zui-color-text)] zui:outline-none zui:select-none zui:transition-[background-color,color] zui:duration-150 zui:last:border-b-0 zui:data-[disabled]:pointer-events-none zui:data-[disabled]:cursor-not-allowed zui:data-[disabled]:opacity-45 zui:data-[highlighted]:bg-[var(--zui-theme-bg-muted)] zui:data-[highlighted]:text-[var(--zui-color-text)] zui:data-[state=checked]:bg-transparent"), eT = q("zui:px-2 zui:py-1.5 zui:text-right zui:text-xs zui:font-semibold zui:text-[var(--zui-color-text)]"), tT = q("zui:my-1 zui:h-px zui:bg-[var(--zui-color-border)]"), nT = q([`zui:file:text-[var(--zui-color-text)] zui:placeholder:text-[var(--zui-color-border)] zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:flex ${ee} zui:w-full zui:min-w-0 radius-xs zui:border zui:border-[var(--zui-color-border)] zui:bg-transparent ${z} zui:py-2 zui:text-right zui:text-sm zui:text-[var(--zui-color-text)] zui:outline-none`, Uv].join(" "));
|
|
13988
13988
|
//#endregion
|
|
13989
13989
|
//#region src/components/Select/Select.filter.ts
|
|
13990
13990
|
function rT(t) {
|
|
@@ -14124,16 +14124,16 @@ function FT(t) {
|
|
|
14124
14124
|
}
|
|
14125
14125
|
var IT = "این فیلد اجباری است";
|
|
14126
14126
|
function LT({ type: t = "single", title: n, required: r = !1, showRequiredMessage: i = !1, placeholder: a, options: o, remoteOptions: s, isSearch: c = !1, size: l = "default", disabled: u = !1, disable: d = !1, onValueChange: f, onChange: p, onInvalid: m, onOpenChange: h, open: g, defaultOpen: _, id: v, value: y, defaultValue: b, children: x, selectAllLabel: S = dT, selectedCountLabel: C, ...w }) {
|
|
14127
|
-
let T = e.useId(), E = v ?? T, O = r, k = u || d, A = t === "multi", j = e.useRef(null), [M, N] = e.useState(""), [F,
|
|
14127
|
+
let T = e.useId(), E = v ?? T, O = r, k = u || d, A = t === "multi", j = e.useRef(null), [M, N] = e.useState(""), [F, ee] = e.useState(!!_), [I, L] = e.useState(!1), R = !A && typeof y == "string" ? y : void 0, z = !A && typeof b == "string" ? b : void 0, [B, te] = e.useState(z), [ne, V] = e.useState(() => TT(b)), [re, ie] = e.useState(() => TT(b)), ae = e.useRef(!1), oe = e.useMemo(() => ET(o), [o]), se = typeof g == "boolean", ce = se ? g : F, le = !A && typeof R == "string", ue = A && Array.isArray(y), de = e.useMemo(() => TT(y), [y]), fe = le ? R : B, pe = ue ? de : ne, me = A ? pe.length > 0 : wT(fe), he = e.useMemo(() => !A || pe.length === 0 ? "" : typeof C == "function" ? C(pe.length) : `${pe.length} مورد انتخاب شده`, [
|
|
14128
14128
|
A,
|
|
14129
14129
|
pe.length,
|
|
14130
14130
|
C
|
|
14131
14131
|
]), ge = e.useCallback((e) => {
|
|
14132
|
-
se ||
|
|
14132
|
+
se || ee(e), e || N(""), h?.(e);
|
|
14133
14133
|
}, [se, h]), _e = e.useCallback((e) => {
|
|
14134
|
-
le || te(e),
|
|
14134
|
+
le || te(e), I && L(!1), f?.(e), p?.(e);
|
|
14135
14135
|
}, [
|
|
14136
|
-
|
|
14136
|
+
I,
|
|
14137
14137
|
le,
|
|
14138
14138
|
p,
|
|
14139
14139
|
f
|
|
@@ -14146,14 +14146,14 @@ function LT({ type: t = "single", title: n, required: r = !1, showRequiredMessag
|
|
|
14146
14146
|
f
|
|
14147
14147
|
]), H = e.useCallback((e) => {
|
|
14148
14148
|
let t = TT(e);
|
|
14149
|
-
ue || V(t),
|
|
14149
|
+
ue || V(t), I && L(!1), f?.(t), p?.(t);
|
|
14150
14150
|
}, [
|
|
14151
|
-
|
|
14151
|
+
I,
|
|
14152
14152
|
ue,
|
|
14153
14153
|
p,
|
|
14154
14154
|
f
|
|
14155
14155
|
]), ye = e.useCallback((e) => {
|
|
14156
|
-
|
|
14156
|
+
L(!0), m?.(e);
|
|
14157
14157
|
}, [m]);
|
|
14158
14158
|
e.useEffect(() => {
|
|
14159
14159
|
le && te(R);
|
|
@@ -14162,8 +14162,8 @@ function LT({ type: t = "single", title: n, required: r = !1, showRequiredMessag
|
|
|
14162
14162
|
}, [de, ue]), e.useEffect(() => {
|
|
14163
14163
|
c || N("");
|
|
14164
14164
|
}, [c]), e.useEffect(() => {
|
|
14165
|
-
|
|
14166
|
-
}, [me,
|
|
14165
|
+
I && me && L(!1);
|
|
14166
|
+
}, [me, I]), e.useEffect(() => {
|
|
14167
14167
|
if (!A) {
|
|
14168
14168
|
ie([]), ae.current = !1;
|
|
14169
14169
|
return;
|
|
@@ -14220,7 +14220,7 @@ function LT({ type: t = "single", title: n, required: r = !1, showRequiredMessag
|
|
|
14220
14220
|
searchTerm: M,
|
|
14221
14221
|
setSearchTerm: N,
|
|
14222
14222
|
hasValue: me,
|
|
14223
|
-
isInvalid:
|
|
14223
|
+
isInvalid: I,
|
|
14224
14224
|
selectType: t,
|
|
14225
14225
|
isOpen: ce,
|
|
14226
14226
|
setOpen: ge,
|
|
@@ -14239,7 +14239,7 @@ function LT({ type: t = "single", title: n, required: r = !1, showRequiredMessag
|
|
|
14239
14239
|
H,
|
|
14240
14240
|
ge,
|
|
14241
14241
|
me,
|
|
14242
|
-
|
|
14242
|
+
I,
|
|
14243
14243
|
k,
|
|
14244
14244
|
c,
|
|
14245
14245
|
he,
|
|
@@ -14400,7 +14400,7 @@ function zT({ className: t, placeholder: n, children: r, ...i }) {
|
|
|
14400
14400
|
});
|
|
14401
14401
|
}
|
|
14402
14402
|
var BT = e.forwardRef(function({ className: t, children: n, position: r = "popper", sideOffset: i = 6, dir: a, ...o }, s) {
|
|
14403
|
-
let c = e.useContext(CT), l = c?.selectType === "multi", u = l ? c?.isSearch ?? !1 : !0, d = c?.searchTerm ?? "", f = c?.setSearchTerm, p = c?.isOpen ?? !1, m = e.useRef(null), h = e.useRef(null), g = c?.multiSelectedValues, _ = c?.multiPinnedSelectedValues, v = c?.options, y = e.useMemo(() => g ?? [], [g]), b = e.useMemo(() => _ ?? [], [_]), x = e.useMemo(() => v ?? [], [v]), S = c?.remoteOptions, C = typeof S?.loadOptions == "function" && S.enabled !== !1, w = OT(S?.pageSize), T = e.useRef(null), E = e.useRef(null), O = e.useRef([]), k = e.useRef(0), A = e.useRef(!1), [j, M] = e.useState([]), [N, F] = e.useState(""), [
|
|
14403
|
+
let c = e.useContext(CT), l = c?.selectType === "multi", u = l ? c?.isSearch ?? !1 : !0, d = c?.searchTerm ?? "", f = c?.setSearchTerm, p = c?.isOpen ?? !1, m = e.useRef(null), h = e.useRef(null), g = c?.multiSelectedValues, _ = c?.multiPinnedSelectedValues, v = c?.options, y = e.useMemo(() => g ?? [], [g]), b = e.useMemo(() => _ ?? [], [_]), x = e.useMemo(() => v ?? [], [v]), S = c?.remoteOptions, C = typeof S?.loadOptions == "function" && S.enabled !== !1, w = OT(S?.pageSize), T = e.useRef(null), E = e.useRef(null), O = e.useRef([]), k = e.useRef(0), A = e.useRef(!1), [j, M] = e.useState([]), [N, F] = e.useState(""), [ee, I] = e.useState(mT), [L, R] = e.useState(!0), [z, B] = e.useState(!1), [te, ne] = e.useState(null), V = e.useMemo(() => new Set(y), [y]), re = e.useMemo(() => new Set(b), [b]), ie = e.useCallback(async (e, t, n) => {
|
|
14404
14404
|
if (!C || !S || t === "append" && A.current) return;
|
|
14405
14405
|
let r = k.current + 1;
|
|
14406
14406
|
k.current = r, A.current = !0, B(!0), ne(null);
|
|
@@ -14412,7 +14412,7 @@ var BT = e.forwardRef(function({ className: t, children: n, position: r = "poppe
|
|
|
14412
14412
|
});
|
|
14413
14413
|
if (r !== k.current) return;
|
|
14414
14414
|
let a = ET(i.options), o = t === "append" ? DT(O.current, a) : a;
|
|
14415
|
-
O.current = o, M(o),
|
|
14415
|
+
O.current = o, M(o), I(AT(i, e)), R(kT(i, o.length, a.length, w));
|
|
14416
14416
|
} catch (e) {
|
|
14417
14417
|
r === k.current && (ne(jT(e)), R(!1));
|
|
14418
14418
|
} finally {
|
|
@@ -14437,7 +14437,7 @@ var BT = e.forwardRef(function({ className: t, children: n, position: r = "poppe
|
|
|
14437
14437
|
}, gT);
|
|
14438
14438
|
return () => window.clearTimeout(e);
|
|
14439
14439
|
}, [C, d]), e.useEffect(() => {
|
|
14440
|
-
!C || !p || (O.current = [], M([]),
|
|
14440
|
+
!C || !p || (O.current = [], M([]), I(mT), R(!0), ne(null), ie(mT, "replace", N));
|
|
14441
14441
|
}, [
|
|
14442
14442
|
p,
|
|
14443
14443
|
C,
|
|
@@ -14449,12 +14449,12 @@ var BT = e.forwardRef(function({ className: t, children: n, position: r = "poppe
|
|
|
14449
14449
|
C,
|
|
14450
14450
|
j,
|
|
14451
14451
|
N.length
|
|
14452
|
-
]), oe = e.useMemo(() => MT(ae), [ae]), se = ae.length > 0 || C ? oe : n, ce = C && p &&
|
|
14453
|
-
ce && ie(
|
|
14452
|
+
]), oe = e.useMemo(() => MT(ae), [ae]), se = ae.length > 0 || C ? oe : n, ce = C && p && L && !z && te === null, le = e.useCallback(() => {
|
|
14453
|
+
ce && ie(ee, "append", N);
|
|
14454
14454
|
}, [
|
|
14455
14455
|
ce,
|
|
14456
14456
|
ie,
|
|
14457
|
-
|
|
14457
|
+
ee,
|
|
14458
14458
|
N
|
|
14459
14459
|
]), ue = e.useCallback((e) => {
|
|
14460
14460
|
if (!ce) return;
|
|
@@ -14881,7 +14881,7 @@ function iE({ open: e, defaultOpen: t, onOpenChange: n, modal: r = !0, dir: i =
|
|
|
14881
14881
|
}
|
|
14882
14882
|
//#endregion
|
|
14883
14883
|
//#region src/components/Table/Table.constants.ts
|
|
14884
|
-
var aE = "دادهای برای نمایش وجود ندارد.", oE = "ستون قابلنمایشی تعریف نشده است.", sE = "دادهای مطابق جستجو پیدا نشد.", cE = "عملیات", lE = "ردیف", uE = "افزودن", dE = "ویرایش", fE = "حذف", pE = "zui:size-4", mE = "zui:size-6", hE = "zui:cursor-pointer zui:border-0 zui:bg-transparent zui:shadow-none zui:hover:bg-transparent zui:hover:shadow-none zui:active:bg-transparent zui:focus-visible:ring-0 zui:disabled:cursor-not-allowed", gE = "zui:px-3
|
|
14884
|
+
var aE = "دادهای برای نمایش وجود ندارد.", oE = "ستون قابلنمایشی تعریف نشده است.", sE = "دادهای مطابق جستجو پیدا نشد.", cE = "عملیات", lE = "ردیف", uE = "افزودن", dE = "ویرایش", fE = "حذف", pE = "zui:size-4", mE = "zui:size-6", hE = "zui:cursor-pointer zui:border-0 zui:bg-transparent zui:shadow-none zui:hover:bg-transparent zui:hover:shadow-none zui:active:bg-transparent zui:focus-visible:ring-0 zui:disabled:cursor-not-allowed", gE = "zui:px-3", _E = "zui:px-3", vE = "جستجو کنید", yE = "جستجوی جدول", bE = "تغییر به پیمایش بینهایت", xE = "تغییر به صفحهبندی", SE = "صفحه قبل", CE = "صفحه بعد", wE = "zui:sticky zui:top-0 zui:z-20 zui:bg-[var(--zui-color-primary)]", TE = "208px 0px", EE = "در حال بارگذاری ردیفهای بیشتر...", DE = "برای بارگذاری بیشتر به پایین اسکرول کنید.", OE = "همه ردیفها نمایش داده شد.", kE = new Intl.DateTimeFormat("fa-IR", { dateStyle: "medium" }), AE = q("zui:relative zui:w-full zui:min-w-0 zui:overflow-hidden"), jE = q(`zui:w-full zui:table-fixed ${re}`, {
|
|
14885
14885
|
variants: {
|
|
14886
14886
|
showColumnBorder: {
|
|
14887
14887
|
true: "zui:[&_th]:border-l zui:[&_td]:border-l zui:[&_th]:border-[var(--zui-theme-border-default)] zui:[&_td]:border-[var(--zui-theme-border-default)] zui:[&_tr>*:last-child]:border-l-0",
|
|
@@ -14896,22 +14896,32 @@ var aE = "دادهای برای نمایش وجود ندارد.", oE = "ست
|
|
|
14896
14896
|
showColumnBorder: !1,
|
|
14897
14897
|
showRowBorder: !1
|
|
14898
14898
|
}
|
|
14899
|
-
}), ME = q(""), NE = q("zui:[&>tr:first-child>td]:pt-5 zui:[&>tr:nth-child(odd)>td]:bg-[var(--zui-color-muted-surface)] zui:[&>tr:nth-child(even)>td]:bg-[var(--zui-color-surface)]"), PE = q("zui:bg-[var(--zui-color-surface)] zui:font-medium zui:text-[var(--zui-color-text)]"), FE = q("zui:cursor-default"), IE =
|
|
14899
|
+
}), ME = q(""), NE = q("zui:[&>tr:first-child>td]:pt-5 zui:[&>tr:nth-child(odd)>td]:bg-[var(--zui-color-muted-surface)] zui:[&>tr:nth-child(even)>td]:bg-[var(--zui-color-surface)]"), PE = q("zui:bg-[var(--zui-color-surface)] zui:font-medium zui:text-[var(--zui-color-text)]"), FE = q("zui:cursor-default"), IE = {
|
|
14900
|
+
start: "zui:text-start",
|
|
14901
|
+
center: "zui:text-center",
|
|
14902
|
+
end: "zui:text-end"
|
|
14903
|
+
}, LE = q(`zui:relative ${V} zui:whitespace-normal zui:break-words zui:bg-[var(--zui-color-primary)] ${z} zui:align-middle zui:font-medium zui:text-[var(--zui-color-surface)] zui:[&:has([role=checkbox])]:pr-0 zui:[&>[role=checkbox]]:translate-y-[2px]`, {
|
|
14904
|
+
variants: { align: IE },
|
|
14905
|
+
defaultVariants: { align: "start" }
|
|
14906
|
+
}), RE = q(`${z} ${B} zui:whitespace-normal zui:break-words zui:align-middle zui:text-[var(--zui-color-text)] zui:[&:has([role=checkbox])]:pr-0 zui:[&>[role=checkbox]]:translate-y-[2px]`, {
|
|
14907
|
+
variants: { align: IE },
|
|
14908
|
+
defaultVariants: { align: "start" }
|
|
14909
|
+
});
|
|
14900
14910
|
//#endregion
|
|
14901
14911
|
//#region src/components/Table/TableEmptyState.tsx
|
|
14902
|
-
function
|
|
14912
|
+
function zE({ colSpan: e, showSearchInput: t, normalizedSearchTerm: n }) {
|
|
14903
14913
|
return /* @__PURE__ */ (0, P.jsx)("tr", {
|
|
14904
14914
|
className: FE(),
|
|
14905
14915
|
children: /* @__PURE__ */ (0, P.jsx)("td", {
|
|
14906
14916
|
colSpan: e,
|
|
14907
|
-
className: D(
|
|
14917
|
+
className: D(RE(), "zui:py-7 zui:text-center zui:text-[var(--zui-color-text)]"),
|
|
14908
14918
|
children: t && n.length > 0 ? sE : aE
|
|
14909
14919
|
})
|
|
14910
14920
|
});
|
|
14911
14921
|
}
|
|
14912
14922
|
//#endregion
|
|
14913
14923
|
//#region src/components/Table/TablePaginationControls.tsx
|
|
14914
|
-
function
|
|
14924
|
+
function BE({ shouldRenderInfiniteMode: e, shouldShowInfiniteLoadingStatus: t, shouldShowInfiniteReadyStatus: n, shouldShowInfiniteCompletedStatus: r, shouldRenderPagination: i, loading: a, isRowActionBusy: o, currentPage: s, totalPages: c, onPageChange: l }) {
|
|
14915
14925
|
return /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [e ? /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
14916
14926
|
"data-slot": "table-infinite-scroll-status",
|
|
14917
14927
|
className: "zui:mt-2 zui:flex zui:min-h-6 zui:items-center zui:justify-center zui:gap-2 zui:text-xs zui:text-[var(--zui-theme-text-secondary)]",
|
|
@@ -14942,17 +14952,17 @@ function zE({ shouldRenderInfiniteMode: e, shouldShowInfiniteLoadingStatus: t, s
|
|
|
14942
14952
|
}
|
|
14943
14953
|
//#endregion
|
|
14944
14954
|
//#region src/components/Table/Table.utils.ts
|
|
14945
|
-
var
|
|
14946
|
-
function
|
|
14955
|
+
var VE = 96, HE = 56, UE = 112;
|
|
14956
|
+
function WE(e) {
|
|
14947
14957
|
if (typeof e == "number" && Number.isFinite(e) && e > 0) return e;
|
|
14948
14958
|
if (typeof e == "string") {
|
|
14949
14959
|
let t = Number.parseFloat(e);
|
|
14950
14960
|
if (Number.isFinite(t) && t > 0) return e.trim().endsWith("rem") ? t * 16 : t;
|
|
14951
14961
|
}
|
|
14952
|
-
return
|
|
14962
|
+
return VE;
|
|
14953
14963
|
}
|
|
14954
|
-
function
|
|
14955
|
-
let r = t ?
|
|
14964
|
+
function GE(e, t, n) {
|
|
14965
|
+
let r = t ? HE : 0, i = n ? UE : 0, a = e.map((e) => WE(e.width)), o = r + i + a.reduce((e, t) => e + t, 0);
|
|
14956
14966
|
if (o <= 0) return {
|
|
14957
14967
|
rowNumberColumnStyle: void 0,
|
|
14958
14968
|
columnStyleByKey: {},
|
|
@@ -14965,24 +14975,37 @@ function WE(e, t, n) {
|
|
|
14965
14975
|
actionsColumnStyle: n ? s(i) : void 0
|
|
14966
14976
|
};
|
|
14967
14977
|
}
|
|
14968
|
-
function
|
|
14978
|
+
function KE(e, t) {
|
|
14969
14979
|
return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.min(12, Math.max(1, Math.floor(e))) : t > 0 ? Math.min(12, t) : 6;
|
|
14970
14980
|
}
|
|
14971
|
-
function
|
|
14981
|
+
function qE(e, t) {
|
|
14972
14982
|
let n = t % 3;
|
|
14973
|
-
return e.type === "checkbox" ? "zui:size-4" : e.type === "number" ? n === 0 ? "zui:h-4 zui:w-16" : n === 1 ? "zui:h-4 zui:w-12" : "zui:h-4 zui:w-20" : e.type === "date" ? n === 0 ? "zui:h-4 zui:w-28" : n === 1 ? "zui:h-4 zui:w-24" : "zui:h-4 zui:w-32" : e.type === "textarea" ? n === 0 ? "zui:h-4 zui:w-[92%]" : n === 1 ? "zui:h-4 zui:w-[76%]" : "zui:h-4 zui:w-[84%]" : n === 0 ? "zui:h-4 zui:w-[78%]" : n === 1 ? "zui:h-4 zui:w-[62%]" : "zui:h-4 zui:w-[86%]";
|
|
14983
|
+
return e.type === "checkbox" ? "zui:size-4" : e.type === "number" || e.type === "money" ? n === 0 ? "zui:h-4 zui:w-16" : n === 1 ? "zui:h-4 zui:w-12" : "zui:h-4 zui:w-20" : e.type === "date" ? n === 0 ? "zui:h-4 zui:w-28" : n === 1 ? "zui:h-4 zui:w-24" : "zui:h-4 zui:w-32" : e.type === "textarea" ? n === 0 ? "zui:h-4 zui:w-[92%]" : n === 1 ? "zui:h-4 zui:w-[76%]" : "zui:h-4 zui:w-[84%]" : n === 0 ? "zui:h-4 zui:w-[78%]" : n === 1 ? "zui:h-4 zui:w-[62%]" : "zui:h-4 zui:w-[86%]";
|
|
14974
14984
|
}
|
|
14975
|
-
function
|
|
14985
|
+
function JE(e, t) {
|
|
14976
14986
|
if (t <= 7) return Array.from({ length: t }, (e, t) => t + 1);
|
|
14977
14987
|
let n = [1], r = Math.max(2, e - 1), i = Math.min(t - 1, e + 1);
|
|
14978
14988
|
r > 2 && n.push("ellipsis-start");
|
|
14979
14989
|
for (let e = r; e <= i; e += 1) n.push(e);
|
|
14980
14990
|
return i < t - 1 && n.push("ellipsis-end"), n.push(t), n;
|
|
14981
14991
|
}
|
|
14982
|
-
function
|
|
14992
|
+
function YE(e) {
|
|
14983
14993
|
return e == null ? !0 : typeof e == "string" ? e.trim().length === 0 : !1;
|
|
14984
14994
|
}
|
|
14985
|
-
function
|
|
14995
|
+
function XE(e) {
|
|
14996
|
+
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
14997
|
+
if (typeof e == "string") {
|
|
14998
|
+
let t = e.replace(/,/g, "").trim();
|
|
14999
|
+
if (t.length === 0) return null;
|
|
15000
|
+
let n = Number(t);
|
|
15001
|
+
return Number.isFinite(n) ? n : null;
|
|
15002
|
+
}
|
|
15003
|
+
return null;
|
|
15004
|
+
}
|
|
15005
|
+
function ZE(e) {
|
|
15006
|
+
return e.toLocaleString("en-US");
|
|
15007
|
+
}
|
|
15008
|
+
function QE(e) {
|
|
14986
15009
|
if (e instanceof Date && !Number.isNaN(e.getTime())) return e;
|
|
14987
15010
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
14988
15011
|
let t = new Date(e);
|
|
@@ -14990,13 +15013,13 @@ function YE(e) {
|
|
|
14990
15013
|
}
|
|
14991
15014
|
return null;
|
|
14992
15015
|
}
|
|
14993
|
-
function
|
|
15016
|
+
function $E(e) {
|
|
14994
15017
|
return typeof e.placeholder == "string" && e.placeholder.trim().length > 0 ? e.placeholder : "---";
|
|
14995
15018
|
}
|
|
14996
|
-
function
|
|
14997
|
-
return typeof e.displayPlaceholder == "string" && e.displayPlaceholder.trim().length > 0 ? e.displayPlaceholder :
|
|
15019
|
+
function eD(e) {
|
|
15020
|
+
return typeof e.displayPlaceholder == "string" && e.displayPlaceholder.trim().length > 0 ? e.displayPlaceholder : $E(e);
|
|
14998
15021
|
}
|
|
14999
|
-
function
|
|
15022
|
+
function tD(e, t) {
|
|
15000
15023
|
if (t.type !== "select" && t.type !== "radio" || !Array.isArray(t.options) || t.options.length === 0) return null;
|
|
15001
15024
|
let n = String(e).trim();
|
|
15002
15025
|
if (n.length === 0) return null;
|
|
@@ -15018,19 +15041,23 @@ function QE(e, t) {
|
|
|
15018
15041
|
let l = c.label.trim();
|
|
15019
15042
|
return l.length > 0 ? l : null;
|
|
15020
15043
|
}
|
|
15021
|
-
function
|
|
15022
|
-
if (
|
|
15044
|
+
function nD(e, t) {
|
|
15045
|
+
if (YE(e)) return eD(t);
|
|
15023
15046
|
if (t.type === "checkbox") return e === !0 ? "بله" : "خیر";
|
|
15024
15047
|
if (t.type === "date") {
|
|
15025
|
-
let n =
|
|
15026
|
-
return n ? kE.format(n) :
|
|
15048
|
+
let n = QE(e);
|
|
15049
|
+
return n ? kE.format(n) : eD(t);
|
|
15027
15050
|
}
|
|
15028
|
-
|
|
15051
|
+
if (t.type === "money") {
|
|
15052
|
+
let n = XE(e);
|
|
15053
|
+
return n === null ? eD(t) : ZE(n);
|
|
15054
|
+
}
|
|
15055
|
+
return typeof e == "string" || typeof e == "number" ? tD(e, t) || (t.type === "select" && t.optionsSource ? eD(t) : String(e)) : eD(t);
|
|
15029
15056
|
}
|
|
15030
|
-
function
|
|
15031
|
-
return Bv({ value:
|
|
15057
|
+
function rD(e, t) {
|
|
15058
|
+
return Bv({ value: nD(e, t) });
|
|
15032
15059
|
}
|
|
15033
|
-
function
|
|
15060
|
+
function iD(e, t, n) {
|
|
15034
15061
|
if (typeof n != "function") return;
|
|
15035
15062
|
let r = n(e, t);
|
|
15036
15063
|
if (typeof r == "number") return Number.isFinite(r) ? r : void 0;
|
|
@@ -15039,26 +15066,26 @@ function tD(e, t, n) {
|
|
|
15039
15066
|
return e.length > 0 ? e : void 0;
|
|
15040
15067
|
}
|
|
15041
15068
|
}
|
|
15042
|
-
function
|
|
15069
|
+
function aD(e, t, n, r) {
|
|
15043
15070
|
if (n !== void 0 && typeof r == "function") {
|
|
15044
|
-
let t = e.findIndex((e, t) =>
|
|
15071
|
+
let t = e.findIndex((e, t) => iD(e, t, r) === n);
|
|
15045
15072
|
if (t >= 0) return t;
|
|
15046
15073
|
}
|
|
15047
15074
|
return t >= 0 && t < e.length ? t : -1;
|
|
15048
15075
|
}
|
|
15049
|
-
function
|
|
15050
|
-
let a =
|
|
15076
|
+
function oD(e, t, n, r, i) {
|
|
15077
|
+
let a = aD(e, t, n, r);
|
|
15051
15078
|
if (a < 0) return e;
|
|
15052
15079
|
let o = [...e];
|
|
15053
15080
|
return o[a] = i, o;
|
|
15054
15081
|
}
|
|
15055
15082
|
//#endregion
|
|
15056
15083
|
//#region src/components/Table/hooks/useTablePagination.ts
|
|
15057
|
-
function
|
|
15058
|
-
let [c, l] = e.useState("pagination"), [u, d] = e.useState(1), [f, p] = e.useState(1), [m, h] = e.useState(!1), g = e.useRef(null), _ = e.useRef(null), v = e.useRef(!1), y = e.useRef(null), b = r?.onPageChange, x = r?.onLoadMore, S = typeof b == "function", C = typeof x == "function", w = S, T = e.useMemo(() => {
|
|
15084
|
+
function sD({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i, isRowActionBusy: a, searchKey: o, maxVisibleRowsBeforeScroll: s }) {
|
|
15085
|
+
let [c, l] = e.useState("pagination"), [u, d] = e.useState(1), [f, p] = e.useState(1), [m, h] = e.useState(!1), g = e.useRef(null), _ = e.useRef(null), v = e.useRef(!1), y = e.useRef(null), b = r?.onPageChange, x = r?.onLoadMore, S = typeof b == "function", C = typeof x == "function", w = S, T = r != null, E = e.useMemo(() => {
|
|
15059
15086
|
let e = Math.floor(r?.pageSize ?? 10);
|
|
15060
15087
|
return e > 0 ? e : 10;
|
|
15061
|
-
}, [r?.pageSize]),
|
|
15088
|
+
}, [r?.pageSize]), D = e.useMemo(() => {
|
|
15062
15089
|
if (!w || !r) return n.length;
|
|
15063
15090
|
let e = Math.floor(r.totalItems);
|
|
15064
15091
|
return e > 0 ? e : 0;
|
|
@@ -15066,56 +15093,63 @@ function iD({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i,
|
|
|
15066
15093
|
n.length,
|
|
15067
15094
|
r,
|
|
15068
15095
|
w
|
|
15069
|
-
]),
|
|
15096
|
+
]), O = e.useMemo(() => !T || D <= 0 ? 1 : Math.max(1, Math.ceil(D / E)), [
|
|
15097
|
+
T,
|
|
15098
|
+
E,
|
|
15099
|
+
D
|
|
15100
|
+
]), k = e.useMemo(() => {
|
|
15070
15101
|
if (w && r) {
|
|
15071
15102
|
let e = Math.floor(r.page);
|
|
15072
|
-
return Math.min(
|
|
15103
|
+
return Math.min(O, Math.max(1, e || 1));
|
|
15073
15104
|
}
|
|
15074
|
-
return Math.min(
|
|
15105
|
+
return Math.min(O, Math.max(1, u));
|
|
15075
15106
|
}, [
|
|
15076
15107
|
u,
|
|
15077
15108
|
r,
|
|
15078
15109
|
w,
|
|
15079
|
-
|
|
15080
|
-
]),
|
|
15110
|
+
O
|
|
15111
|
+
]), A = e.useMemo(() => {
|
|
15112
|
+
if (!T) return n;
|
|
15081
15113
|
if (c === "infinite") {
|
|
15082
15114
|
if (w) return n;
|
|
15083
|
-
let e = f *
|
|
15115
|
+
let e = f * E;
|
|
15084
15116
|
return n.slice(0, e);
|
|
15085
15117
|
}
|
|
15086
15118
|
if (w) return n;
|
|
15087
|
-
let e = (
|
|
15088
|
-
return n.slice(e, e +
|
|
15119
|
+
let e = (k - 1) * E;
|
|
15120
|
+
return n.slice(e, e + E);
|
|
15089
15121
|
}, [
|
|
15090
|
-
|
|
15122
|
+
k,
|
|
15091
15123
|
n,
|
|
15124
|
+
T,
|
|
15092
15125
|
f,
|
|
15093
15126
|
c,
|
|
15094
|
-
|
|
15127
|
+
E,
|
|
15095
15128
|
w
|
|
15096
|
-
]),
|
|
15129
|
+
]), j = e.useMemo(() => JE(k, O), [k, O]);
|
|
15097
15130
|
e.useEffect(() => {
|
|
15098
|
-
w || (d((e) => Math.min(
|
|
15099
|
-
}, [w,
|
|
15131
|
+
w || (d((e) => Math.min(O, Math.max(1, e))), p((e) => Math.min(O, Math.max(1, e))));
|
|
15132
|
+
}, [w, O]), e.useEffect(() => {
|
|
15100
15133
|
w || (d(1), p(1));
|
|
15101
15134
|
}, [o, w]);
|
|
15102
|
-
let
|
|
15135
|
+
let M = k > 1, N = k < O, P = T && !t && O > 1, F = P, ee = P && c === "pagination", I = P && c === "infinite", L = I && (w ? N : f < O), R = e.useMemo(() => {
|
|
15103
15136
|
let e = Math.floor(s ?? 20);
|
|
15104
15137
|
return e > 0 ? e : 20;
|
|
15105
|
-
}, [s]),
|
|
15138
|
+
}, [s]), z = e.useMemo(() => T && !t && A.length > R, [
|
|
15106
15139
|
t,
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
15140
|
+
T,
|
|
15141
|
+
R,
|
|
15142
|
+
A.length
|
|
15143
|
+
]), B = e.useMemo(() => Math.max(1, Math.min(A.length, R)), [R, A.length]), te = e.useMemo(() => 54 + 52 * B, [B]), ne = z ? { maxHeight: `${te}px` } : void 0, V = e.useCallback(() => {
|
|
15110
15144
|
v.current = !1, h(!1), y.current = null;
|
|
15111
|
-
}, []),
|
|
15145
|
+
}, []), re = e.useCallback(() => v.current ? !1 : (v.current = !0, h(!0), y.current = {
|
|
15112
15146
|
loading: i,
|
|
15113
|
-
currentPage:
|
|
15147
|
+
currentPage: k,
|
|
15114
15148
|
filteredRowsLength: n.length,
|
|
15115
15149
|
localLoadedPages: f,
|
|
15116
15150
|
pagingMode: c
|
|
15117
15151
|
}, !0), [
|
|
15118
|
-
|
|
15152
|
+
k,
|
|
15119
15153
|
n.length,
|
|
15120
15154
|
i,
|
|
15121
15155
|
f,
|
|
@@ -15125,28 +15159,28 @@ function iD({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i,
|
|
|
15125
15159
|
if (!v.current) return;
|
|
15126
15160
|
let e = y.current;
|
|
15127
15161
|
if (!e) {
|
|
15128
|
-
|
|
15162
|
+
V();
|
|
15129
15163
|
return;
|
|
15130
15164
|
}
|
|
15131
|
-
(e.loading !== i || e.currentPage !==
|
|
15165
|
+
(e.loading !== i || e.currentPage !== k || e.filteredRowsLength !== n.length || e.localLoadedPages !== f || e.pagingMode !== c) && V();
|
|
15132
15166
|
}, [
|
|
15133
|
-
|
|
15167
|
+
k,
|
|
15134
15168
|
n.length,
|
|
15135
15169
|
i,
|
|
15136
15170
|
f,
|
|
15137
15171
|
c,
|
|
15138
|
-
|
|
15172
|
+
V
|
|
15139
15173
|
]), e.useEffect(() => {
|
|
15140
|
-
c === "infinite" && L ||
|
|
15174
|
+
c === "infinite" && L || V();
|
|
15141
15175
|
}, [
|
|
15142
15176
|
L,
|
|
15143
15177
|
c,
|
|
15144
|
-
|
|
15178
|
+
V
|
|
15145
15179
|
]);
|
|
15146
|
-
let
|
|
15180
|
+
let ie = e.useCallback((e) => {
|
|
15147
15181
|
if (i || a) return;
|
|
15148
|
-
let t = Math.min(
|
|
15149
|
-
if (t !==
|
|
15182
|
+
let t = Math.min(O, Math.max(1, Math.floor(e)));
|
|
15183
|
+
if (t !== k) {
|
|
15150
15184
|
if (w) {
|
|
15151
15185
|
b?.(t, c);
|
|
15152
15186
|
return;
|
|
@@ -15154,55 +15188,55 @@ function iD({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i,
|
|
|
15154
15188
|
d(t);
|
|
15155
15189
|
}
|
|
15156
15190
|
}, [
|
|
15157
|
-
|
|
15191
|
+
k,
|
|
15158
15192
|
a,
|
|
15159
15193
|
i,
|
|
15160
15194
|
b,
|
|
15161
15195
|
c,
|
|
15162
15196
|
w,
|
|
15163
|
-
|
|
15164
|
-
]),
|
|
15197
|
+
O
|
|
15198
|
+
]), ae = e.useCallback(() => {
|
|
15165
15199
|
let e = c === "pagination" ? "infinite" : "pagination";
|
|
15166
|
-
w ? b?.(
|
|
15200
|
+
w ? b?.(k, e) : c === "pagination" ? p((e) => Math.max(e, u)) : d((e) => Math.max(1, Math.min(O, Math.max(e, f)))), l(e);
|
|
15167
15201
|
}, [
|
|
15168
|
-
|
|
15202
|
+
k,
|
|
15169
15203
|
u,
|
|
15170
15204
|
f,
|
|
15171
15205
|
b,
|
|
15172
15206
|
c,
|
|
15173
15207
|
w,
|
|
15174
|
-
|
|
15175
|
-
]),
|
|
15176
|
-
if (!L || i || a || v.current || !
|
|
15177
|
-
let e =
|
|
15208
|
+
O
|
|
15209
|
+
]), oe = e.useCallback(async () => {
|
|
15210
|
+
if (!L || i || a || v.current || !re()) return;
|
|
15211
|
+
let e = k + 1;
|
|
15178
15212
|
if (w) {
|
|
15179
15213
|
try {
|
|
15180
15214
|
C ? await x?.(e) : b?.(e, "infinite");
|
|
15181
15215
|
} catch {
|
|
15182
|
-
|
|
15216
|
+
V();
|
|
15183
15217
|
}
|
|
15184
15218
|
return;
|
|
15185
15219
|
}
|
|
15186
|
-
p((e) => Math.min(
|
|
15220
|
+
p((e) => Math.min(O, e + 1));
|
|
15187
15221
|
}, [
|
|
15188
15222
|
L,
|
|
15189
|
-
|
|
15223
|
+
k,
|
|
15190
15224
|
C,
|
|
15191
15225
|
a,
|
|
15192
15226
|
i,
|
|
15193
|
-
|
|
15227
|
+
re,
|
|
15194
15228
|
x,
|
|
15195
15229
|
b,
|
|
15196
|
-
|
|
15230
|
+
V,
|
|
15197
15231
|
w,
|
|
15198
|
-
|
|
15199
|
-
]),
|
|
15232
|
+
O
|
|
15233
|
+
]), se = e.useCallback((e) => {
|
|
15200
15234
|
if (!I || i || a || !L || v.current) return;
|
|
15201
15235
|
let t = e.currentTarget;
|
|
15202
|
-
t.scrollHeight - t.scrollTop - t.clientHeight <= 104 &&
|
|
15236
|
+
t.scrollHeight - t.scrollTop - t.clientHeight <= 104 && oe();
|
|
15203
15237
|
}, [
|
|
15204
15238
|
L,
|
|
15205
|
-
|
|
15239
|
+
oe,
|
|
15206
15240
|
a,
|
|
15207
15241
|
i,
|
|
15208
15242
|
I
|
|
@@ -15212,7 +15246,7 @@ function iD({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i,
|
|
|
15212
15246
|
let e = _.current, t = g.current;
|
|
15213
15247
|
if (!e || !t) return;
|
|
15214
15248
|
let n = new IntersectionObserver((e) => {
|
|
15215
|
-
e.some((e) => e.isIntersecting) &&
|
|
15249
|
+
e.some((e) => e.isIntersecting) && oe();
|
|
15216
15250
|
}, {
|
|
15217
15251
|
root: t,
|
|
15218
15252
|
rootMargin: TE
|
|
@@ -15220,37 +15254,37 @@ function iD({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i,
|
|
|
15220
15254
|
return n.observe(e), () => n.disconnect();
|
|
15221
15255
|
}, [
|
|
15222
15256
|
L,
|
|
15223
|
-
|
|
15257
|
+
oe,
|
|
15224
15258
|
a,
|
|
15225
15259
|
i
|
|
15226
15260
|
]), {
|
|
15227
15261
|
pagingMode: c,
|
|
15228
|
-
currentPage:
|
|
15229
|
-
totalPages:
|
|
15230
|
-
resolvedPageSize:
|
|
15231
|
-
visibleRows:
|
|
15232
|
-
paginationTokens:
|
|
15233
|
-
canGoToPreviousPage:
|
|
15234
|
-
canGoToNextPage:
|
|
15235
|
-
canUsePaging:
|
|
15236
|
-
showPagingModeToggle:
|
|
15237
|
-
shouldRenderPagination:
|
|
15262
|
+
currentPage: k,
|
|
15263
|
+
totalPages: O,
|
|
15264
|
+
resolvedPageSize: E,
|
|
15265
|
+
visibleRows: A,
|
|
15266
|
+
paginationTokens: j,
|
|
15267
|
+
canGoToPreviousPage: M,
|
|
15268
|
+
canGoToNextPage: N,
|
|
15269
|
+
canUsePaging: P,
|
|
15270
|
+
showPagingModeToggle: F,
|
|
15271
|
+
shouldRenderPagination: ee,
|
|
15238
15272
|
shouldRenderInfiniteMode: I,
|
|
15239
15273
|
canLoadMoreInInfiniteMode: L,
|
|
15240
15274
|
shouldUseRemotePaging: w,
|
|
15241
|
-
shouldUseScrollableRows:
|
|
15275
|
+
shouldUseScrollableRows: z,
|
|
15242
15276
|
tableScrollViewportRef: g,
|
|
15243
15277
|
infiniteScrollSentinelRef: _,
|
|
15244
|
-
tableScrollViewportStyle:
|
|
15245
|
-
handlePageChange:
|
|
15246
|
-
handlePagingModeToggle:
|
|
15247
|
-
handleTableScrollViewport:
|
|
15278
|
+
tableScrollViewportStyle: ne,
|
|
15279
|
+
handlePageChange: ie,
|
|
15280
|
+
handlePagingModeToggle: ae,
|
|
15281
|
+
handleTableScrollViewport: se,
|
|
15248
15282
|
isInfiniteRequestPending: m
|
|
15249
15283
|
};
|
|
15250
15284
|
}
|
|
15251
15285
|
//#endregion
|
|
15252
15286
|
//#region src/components/Table/hooks/useTableSearch.ts
|
|
15253
|
-
function
|
|
15287
|
+
function cD({ data: t, visibleColumns: n, showSearchInput: r, hasRemoteSearchHandler: i, onSearchChange: a, getRowId: o }) {
|
|
15254
15288
|
let [s, c] = e.useState(""), [l, u] = e.useState(""), d = s.trim().toLocaleLowerCase();
|
|
15255
15289
|
return e.useEffect(() => {
|
|
15256
15290
|
i && a?.(l);
|
|
@@ -15271,10 +15305,10 @@ function aD({ data: t, visibleColumns: n, showSearchInput: r, hasRemoteSearchHan
|
|
|
15271
15305
|
let e = t.map((e, t) => ({
|
|
15272
15306
|
row: e,
|
|
15273
15307
|
rowIndex: t,
|
|
15274
|
-
rowId:
|
|
15308
|
+
rowId: iD(e, t, o)
|
|
15275
15309
|
}));
|
|
15276
15310
|
return i || !r || d.length === 0 ? e : e.filter(({ row: e }) => n.some((t) => {
|
|
15277
|
-
let n =
|
|
15311
|
+
let n = rD(e[t.key], t), r = e[t.key], i = r == null ? "" : String(r);
|
|
15278
15312
|
return n.toLocaleLowerCase().includes(d) || i.toLocaleLowerCase().includes(d);
|
|
15279
15313
|
}));
|
|
15280
15314
|
}, [
|
|
@@ -15293,8 +15327,8 @@ function aD({ data: t, visibleColumns: n, showSearchInput: r, hasRemoteSearchHan
|
|
|
15293
15327
|
}
|
|
15294
15328
|
//#endregion
|
|
15295
15329
|
//#region src/components/Table/Table.tsx
|
|
15296
|
-
var
|
|
15297
|
-
let x = e.Children.count(y) > 0, S = e.useMemo(() => s.columns.filter((e) => e.view), [s.columns]), C = typeof u == "function", w = typeof d == "function", T = typeof f == "function", E = p ?? [], O = E.length > 0, k = s.searchable ?? !1, A = g && !x, j = s.pagination, M = j?.onSearchChange, N = typeof M == "function", F = w || T || O, { rowNumberColumnStyle:
|
|
15330
|
+
var lD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>button]:!p-0`, uD = e.forwardRef(function({ className: t, containerClassName: n, loading: r = !1, isMutating: i = !1, stickyHeaderOnScroll: a = !0, maxVisibleRowsBeforeScroll: o, schema: s, data: c, setData: l, onAdd: u, onEdit: d, onDelete: f, actions: p, onCellSelectChange: m, getRowId: h, showNumberRow: g = !1, showColumnBorder: _ = !1, showRowBorder: v = !1, children: y }, b) {
|
|
15331
|
+
let x = e.Children.count(y) > 0, S = e.useMemo(() => s.columns.filter((e) => e.view), [s.columns]), C = typeof u == "function", w = typeof d == "function", T = typeof f == "function", E = p ?? [], O = E.length > 0, k = s.searchable ?? !1, A = g && !x, j = s.pagination, M = j?.onSearchChange, N = typeof M == "function", F = w || T || O, { rowNumberColumnStyle: ee, columnStyleByKey: I, actionsColumnStyle: L } = e.useMemo(() => GE(S, A, F), [
|
|
15298
15332
|
F,
|
|
15299
15333
|
A,
|
|
15300
15334
|
S
|
|
@@ -15332,7 +15366,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15332
15366
|
await d({
|
|
15333
15367
|
row: e,
|
|
15334
15368
|
rowIndex: t,
|
|
15335
|
-
rowId: n ??
|
|
15369
|
+
rowId: n ?? iD(e, t, h)
|
|
15336
15370
|
});
|
|
15337
15371
|
} finally {
|
|
15338
15372
|
B(!1);
|
|
@@ -15349,7 +15383,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15349
15383
|
await f({
|
|
15350
15384
|
row: e,
|
|
15351
15385
|
rowIndex: t,
|
|
15352
|
-
rowId: n ??
|
|
15386
|
+
rowId: n ?? iD(e, t, h)
|
|
15353
15387
|
});
|
|
15354
15388
|
} finally {
|
|
15355
15389
|
B(!1);
|
|
@@ -15363,7 +15397,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15363
15397
|
if (!V) {
|
|
15364
15398
|
B(!0);
|
|
15365
15399
|
try {
|
|
15366
|
-
let i = r ??
|
|
15400
|
+
let i = r ?? iD(t, n, h);
|
|
15367
15401
|
await e.onClick({
|
|
15368
15402
|
row: t,
|
|
15369
15403
|
rowIndex: n,
|
|
@@ -15377,7 +15411,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15377
15411
|
if (V) return;
|
|
15378
15412
|
let a = i.trim(), o = a.length > 0 ? a : null;
|
|
15379
15413
|
if (e[r] === o) return;
|
|
15380
|
-
let s = n ??
|
|
15414
|
+
let s = n ?? iD(e, t, h), c = {
|
|
15381
15415
|
...e,
|
|
15382
15416
|
[r]: o
|
|
15383
15417
|
};
|
|
@@ -15391,7 +15425,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15391
15425
|
columnKey: r,
|
|
15392
15426
|
value: a
|
|
15393
15427
|
}) === !1) return;
|
|
15394
|
-
l((e) =>
|
|
15428
|
+
l((e) => oD(e, t, s, h, c));
|
|
15395
15429
|
} catch {
|
|
15396
15430
|
return;
|
|
15397
15431
|
} finally {
|
|
@@ -15402,14 +15436,14 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15402
15436
|
V,
|
|
15403
15437
|
m,
|
|
15404
15438
|
l
|
|
15405
|
-
]), { searchTerm: ce, normalizedSearchTerm: le, filteredRows: ue, handleSearchInputChange: de } =
|
|
15439
|
+
]), { searchTerm: ce, normalizedSearchTerm: le, filteredRows: ue, handleSearchInputChange: de } = cD({
|
|
15406
15440
|
data: c,
|
|
15407
15441
|
visibleColumns: S,
|
|
15408
15442
|
showSearchInput: k,
|
|
15409
15443
|
hasRemoteSearchHandler: N,
|
|
15410
15444
|
onSearchChange: M,
|
|
15411
15445
|
getRowId: h
|
|
15412
|
-
}), { pagingMode: fe, currentPage: pe, totalPages: me, resolvedPageSize: he, visibleRows: _e, showPagingModeToggle: ve, shouldRenderPagination: H, shouldRenderInfiniteMode: ye, canLoadMoreInInfiniteMode: U, shouldUseRemotePaging: be, shouldUseScrollableRows: W, tableScrollViewportRef: G, infiniteScrollSentinelRef: xe, tableScrollViewportStyle: Se, handlePageChange: Ce, handlePagingModeToggle: we, handleTableScrollViewport: Te, isInfiniteRequestPending: Ee } =
|
|
15446
|
+
}), { pagingMode: fe, currentPage: pe, totalPages: me, resolvedPageSize: he, visibleRows: _e, showPagingModeToggle: ve, shouldRenderPagination: H, shouldRenderInfiniteMode: ye, canLoadMoreInInfiniteMode: U, shouldUseRemotePaging: be, shouldUseScrollableRows: W, tableScrollViewportRef: G, infiniteScrollSentinelRef: xe, tableScrollViewportStyle: Se, handlePageChange: Ce, handlePagingModeToggle: we, handleTableScrollViewport: Te, isInfiniteRequestPending: Ee } = sD({
|
|
15413
15447
|
hasChildren: x,
|
|
15414
15448
|
filteredRows: ue,
|
|
15415
15449
|
paginationConfig: j,
|
|
@@ -15417,7 +15451,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15417
15451
|
isRowActionBusy: V,
|
|
15418
15452
|
searchKey: le,
|
|
15419
15453
|
maxVisibleRowsBeforeScroll: o
|
|
15420
|
-
}), De = W && a, Oe = e.useMemo(() =>
|
|
15454
|
+
}), De = W && a, Oe = e.useMemo(() => KE(s.pagination?.pageSize, c.length), [c.length, s.pagination?.pageSize]), ke = r && (_e.length === 0 || be && fe === "pagination"), Ae = ye && r && _e.length > 0, je = ye && _e.length > 0, Me = je && (r || Ee), Ne = je && U && !r && !Ee, Pe = je && !U && !r && !Ee, Fe = Math.min(Oe, Math.max(1, Math.min(he, 3))), Ie = fe === "pagination" ? bE : xE;
|
|
15421
15455
|
return /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
15422
15456
|
"data-slot": "table-container",
|
|
15423
15457
|
dir: "rtl",
|
|
@@ -15449,7 +15483,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15449
15483
|
trigger: /* @__PURE__ */ (0, P.jsx)("span", {
|
|
15450
15484
|
"data-slot": "table-paging-mode-toggle-button",
|
|
15451
15485
|
"aria-label": Ie,
|
|
15452
|
-
className:
|
|
15486
|
+
className: lD,
|
|
15453
15487
|
children: /* @__PURE__ */ (0, P.jsx)(ge, {
|
|
15454
15488
|
size: "sm",
|
|
15455
15489
|
variant: "primary",
|
|
@@ -15473,7 +15507,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15473
15507
|
trigger: /* @__PURE__ */ (0, P.jsx)("span", {
|
|
15474
15508
|
"data-slot": "table-action-add-button",
|
|
15475
15509
|
"aria-label": uE,
|
|
15476
|
-
className:
|
|
15510
|
+
className: lD,
|
|
15477
15511
|
children: /* @__PURE__ */ (0, P.jsx)(ge, {
|
|
15478
15512
|
size: "sm",
|
|
15479
15513
|
variant: "primary",
|
|
@@ -15501,38 +15535,46 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15501
15535
|
showRowBorder: v
|
|
15502
15536
|
}), t),
|
|
15503
15537
|
dir: "rtl",
|
|
15504
|
-
children: x ? y : S.length === 0 ? /* @__PURE__ */ (0, P.jsx)(
|
|
15538
|
+
children: x ? y : S.length === 0 ? /* @__PURE__ */ (0, P.jsx)(fD, { children: /* @__PURE__ */ (0, P.jsx)(mD, { children: /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15505
15539
|
className: "zui:py-7 zui:text-center zui:text-[var(--zui-color-text)]",
|
|
15506
15540
|
children: oE
|
|
15507
15541
|
}) }) }) : /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [
|
|
15508
15542
|
/* @__PURE__ */ (0, P.jsxs)("colgroup", { children: [
|
|
15509
|
-
A ? /* @__PURE__ */ (0, P.jsx)("col", { style:
|
|
15510
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)("col", { style:
|
|
15511
|
-
F ? /* @__PURE__ */ (0, P.jsx)("col", { style:
|
|
15543
|
+
A ? /* @__PURE__ */ (0, P.jsx)("col", { style: ee }) : null,
|
|
15544
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)("col", { style: I[e.key] }, `col-${e.key}`)),
|
|
15545
|
+
F ? /* @__PURE__ */ (0, P.jsx)("col", { style: L }) : null
|
|
15512
15546
|
] }),
|
|
15513
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
15514
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15547
|
+
/* @__PURE__ */ (0, P.jsx)(dD, { children: /* @__PURE__ */ (0, P.jsxs)(mD, { children: [
|
|
15548
|
+
A ? /* @__PURE__ */ (0, P.jsx)(hD, {
|
|
15549
|
+
align: "center",
|
|
15515
15550
|
className: D(_E, De ? wE : void 0),
|
|
15516
15551
|
children: lE
|
|
15517
15552
|
}) : null,
|
|
15518
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)(
|
|
15553
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)(hD, {
|
|
15554
|
+
align: e.align,
|
|
15519
15555
|
className: De ? wE : void 0,
|
|
15520
15556
|
children: Bv({ value: e.label })
|
|
15521
15557
|
}, `head-${e.key}`)),
|
|
15522
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15558
|
+
F ? /* @__PURE__ */ (0, P.jsx)(hD, {
|
|
15559
|
+
align: "center",
|
|
15523
15560
|
className: D(gE, De ? wE : void 0),
|
|
15524
15561
|
children: cE
|
|
15525
15562
|
}) : null
|
|
15526
15563
|
] }) }),
|
|
15527
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
15564
|
+
/* @__PURE__ */ (0, P.jsx)(fD, { children: ke ? Array.from({ length: Oe }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(mD, {
|
|
15528
15565
|
slot: "table-loading-row",
|
|
15529
15566
|
children: [
|
|
15530
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15567
|
+
A ? /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15568
|
+
align: "center",
|
|
15531
15569
|
className: _E,
|
|
15532
15570
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: "zui:mx-auto zui:h-4 zui:w-8" })
|
|
15533
15571
|
}) : null,
|
|
15534
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)(
|
|
15535
|
-
|
|
15572
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15573
|
+
align: e.align,
|
|
15574
|
+
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: D("zui:max-w-full", qE(e, t)) })
|
|
15575
|
+
}, `loading-cell-${e.key}-${t}`)),
|
|
15576
|
+
F ? /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15577
|
+
align: "center",
|
|
15536
15578
|
className: gE,
|
|
15537
15579
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
15538
15580
|
"data-slot": "table-row-actions-skeleton",
|
|
@@ -15545,14 +15587,15 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15545
15587
|
})
|
|
15546
15588
|
}) : null
|
|
15547
15589
|
]
|
|
15548
|
-
}, `loading-row-${t}`)) : _e.length === 0 ? /* @__PURE__ */ (0, P.jsx)(
|
|
15590
|
+
}, `loading-row-${t}`)) : _e.length === 0 ? /* @__PURE__ */ (0, P.jsx)(zE, {
|
|
15549
15591
|
colSpan: S.length + +!!F + +!!A,
|
|
15550
15592
|
showSearchInput: k,
|
|
15551
15593
|
normalizedSearchTerm: le
|
|
15552
15594
|
}) : /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [_e.map(({ row: e, rowIndex: t, rowId: n }, r) => {
|
|
15553
15595
|
let i = n === void 0 ? `row-${t}` : `row-id-${String(n)}`, a = H ? (pe - 1) * he + r + 1 : r + 1;
|
|
15554
|
-
return /* @__PURE__ */ (0, P.jsxs)(
|
|
15555
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15596
|
+
return /* @__PURE__ */ (0, P.jsxs)(mD, { children: [
|
|
15597
|
+
A ? /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15598
|
+
align: "center",
|
|
15556
15599
|
className: _E,
|
|
15557
15600
|
children: Bv({ value: String(a) })
|
|
15558
15601
|
}) : null,
|
|
@@ -15560,22 +15603,29 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15560
15603
|
let a = `cell-${r.key}-${i}`;
|
|
15561
15604
|
if (r.viewType === "select") {
|
|
15562
15605
|
let i = R[r.key] ?? [], o = e[r.key], s = typeof o == "string" || typeof o == "number" ? String(o) : "";
|
|
15563
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15564
|
-
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15606
|
+
return /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15607
|
+
align: r.align,
|
|
15608
|
+
children: /* @__PURE__ */ (0, P.jsx)(LT, {
|
|
15609
|
+
size: "sm",
|
|
15610
|
+
disabled: V || i.length === 0 && !r.optionsSource,
|
|
15611
|
+
placeholder: $E(r),
|
|
15612
|
+
options: i,
|
|
15613
|
+
remoteOptions: r.optionsSource,
|
|
15614
|
+
value: s,
|
|
15615
|
+
onValueChange: (i) => {
|
|
15616
|
+
let a = Array.isArray(i) ? i[0] ?? "" : i;
|
|
15617
|
+
se(e, t, n, r.key, a);
|
|
15618
|
+
}
|
|
15619
|
+
})
|
|
15620
|
+
}, a);
|
|
15575
15621
|
}
|
|
15576
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15622
|
+
return /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15623
|
+
align: r.align,
|
|
15624
|
+
children: rD(e[r.key], r)
|
|
15625
|
+
}, a);
|
|
15577
15626
|
}),
|
|
15578
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15627
|
+
F ? /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15628
|
+
align: "center",
|
|
15579
15629
|
className: gE,
|
|
15580
15630
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
15581
15631
|
"data-slot": "table-row-actions",
|
|
@@ -15633,15 +15683,20 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15633
15683
|
})
|
|
15634
15684
|
}) : null
|
|
15635
15685
|
] }, i);
|
|
15636
|
-
}), Ae ? Array.from({ length: Fe }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(
|
|
15686
|
+
}), Ae ? Array.from({ length: Fe }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(mD, {
|
|
15637
15687
|
slot: "table-loading-row",
|
|
15638
15688
|
children: [
|
|
15639
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15689
|
+
A ? /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15690
|
+
align: "center",
|
|
15640
15691
|
className: _E,
|
|
15641
15692
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: "zui:mx-auto zui:h-4 zui:w-8" })
|
|
15642
15693
|
}) : null,
|
|
15643
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)(
|
|
15644
|
-
|
|
15694
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15695
|
+
align: e.align,
|
|
15696
|
+
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: D("zui:max-w-full", qE(e, t)) })
|
|
15697
|
+
}, `infinite-loading-cell-${e.key}-${t}`)),
|
|
15698
|
+
F ? /* @__PURE__ */ (0, P.jsx)(gD, {
|
|
15699
|
+
align: "center",
|
|
15645
15700
|
className: gE,
|
|
15646
15701
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
15647
15702
|
"data-slot": "table-row-actions-skeleton",
|
|
@@ -15663,7 +15718,7 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15663
15718
|
className: "zui:h-px zui:w-full"
|
|
15664
15719
|
}) : null]
|
|
15665
15720
|
}),
|
|
15666
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
15721
|
+
/* @__PURE__ */ (0, P.jsx)(BE, {
|
|
15667
15722
|
shouldRenderInfiniteMode: ye,
|
|
15668
15723
|
shouldShowInfiniteLoadingStatus: Me,
|
|
15669
15724
|
shouldShowInfiniteReadyStatus: Ne,
|
|
@@ -15677,28 +15732,28 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15677
15732
|
})
|
|
15678
15733
|
]
|
|
15679
15734
|
});
|
|
15680
|
-
}),
|
|
15735
|
+
}), dD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15681
15736
|
return /* @__PURE__ */ (0, P.jsx)("thead", {
|
|
15682
15737
|
ref: n,
|
|
15683
15738
|
"data-slot": "table-header",
|
|
15684
15739
|
className: D(ME(), e),
|
|
15685
15740
|
children: t
|
|
15686
15741
|
});
|
|
15687
|
-
}),
|
|
15742
|
+
}), fD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15688
15743
|
return /* @__PURE__ */ (0, P.jsx)("tbody", {
|
|
15689
15744
|
ref: n,
|
|
15690
15745
|
"data-slot": "table-body",
|
|
15691
15746
|
className: D(NE(), e),
|
|
15692
15747
|
children: t
|
|
15693
15748
|
});
|
|
15694
|
-
}),
|
|
15749
|
+
}), pD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15695
15750
|
return /* @__PURE__ */ (0, P.jsx)("tfoot", {
|
|
15696
15751
|
ref: n,
|
|
15697
15752
|
"data-slot": "table-footer",
|
|
15698
15753
|
className: D(PE(), e),
|
|
15699
15754
|
children: t
|
|
15700
15755
|
});
|
|
15701
|
-
}),
|
|
15756
|
+
}), mD = e.forwardRef(function({ className: e, children: t, state: n, slot: r = "table-row" }, i) {
|
|
15702
15757
|
return /* @__PURE__ */ (0, P.jsx)("tr", {
|
|
15703
15758
|
ref: i,
|
|
15704
15759
|
"data-slot": r,
|
|
@@ -15706,31 +15761,31 @@ var oD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15706
15761
|
className: D(FE(), e),
|
|
15707
15762
|
children: t
|
|
15708
15763
|
});
|
|
15709
|
-
}),
|
|
15764
|
+
}), hD = e.forwardRef(function({ className: e, children: t, align: n }, r) {
|
|
15710
15765
|
return /* @__PURE__ */ (0, P.jsx)("th", {
|
|
15711
|
-
ref:
|
|
15766
|
+
ref: r,
|
|
15712
15767
|
"data-slot": "table-head",
|
|
15713
|
-
className: D(
|
|
15768
|
+
className: D(LE({ align: n }), e),
|
|
15714
15769
|
children: t
|
|
15715
15770
|
});
|
|
15716
|
-
}),
|
|
15771
|
+
}), gD = e.forwardRef(function({ className: e, children: t, align: n }, r) {
|
|
15717
15772
|
return /* @__PURE__ */ (0, P.jsx)("td", {
|
|
15718
|
-
ref:
|
|
15773
|
+
ref: r,
|
|
15719
15774
|
"data-slot": "table-cell",
|
|
15720
|
-
className: D(
|
|
15775
|
+
className: D(RE({ align: n }), e),
|
|
15721
15776
|
children: t
|
|
15722
15777
|
});
|
|
15723
15778
|
});
|
|
15724
|
-
|
|
15779
|
+
uD.displayName = "Table", dD.displayName = "TableHeader", fD.displayName = "TableBody", pD.displayName = "TableFooter", mD.displayName = "TableRow", hD.displayName = "TableHead", gD.displayName = "TableCell";
|
|
15725
15780
|
//#endregion
|
|
15726
15781
|
//#region src/components/Tabs/Tabs.variant.ts
|
|
15727
|
-
var
|
|
15782
|
+
var _D = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
15728
15783
|
variants: { orientation: {
|
|
15729
15784
|
horizontal: "",
|
|
15730
15785
|
vertical: "zui:flex-row zui:items-start"
|
|
15731
15786
|
} },
|
|
15732
15787
|
defaultVariants: { orientation: "horizontal" }
|
|
15733
|
-
}),
|
|
15788
|
+
}), vD = q("zui:relative zui:inline-flex zui:items-center zui:gap-1 zui:rounded-md zui:border zui:border-[var(--zui-color-border)] zui:p-1", {
|
|
15734
15789
|
variants: {
|
|
15735
15790
|
orientation: {
|
|
15736
15791
|
horizontal: "zui:w-full zui:flex-row",
|
|
@@ -15751,17 +15806,17 @@ var mD = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15751
15806
|
{
|
|
15752
15807
|
orientation: "horizontal",
|
|
15753
15808
|
size: "sm",
|
|
15754
|
-
className:
|
|
15809
|
+
className: ee
|
|
15755
15810
|
},
|
|
15756
15811
|
{
|
|
15757
15812
|
orientation: "horizontal",
|
|
15758
15813
|
size: "default",
|
|
15759
|
-
className:
|
|
15814
|
+
className: I
|
|
15760
15815
|
},
|
|
15761
15816
|
{
|
|
15762
15817
|
orientation: "horizontal",
|
|
15763
15818
|
size: "lg",
|
|
15764
|
-
className:
|
|
15819
|
+
className: L
|
|
15765
15820
|
}
|
|
15766
15821
|
],
|
|
15767
15822
|
defaultVariants: {
|
|
@@ -15769,7 +15824,7 @@ var mD = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15769
15824
|
size: "default",
|
|
15770
15825
|
type: "primary"
|
|
15771
15826
|
}
|
|
15772
|
-
}),
|
|
15827
|
+
}), yD = q("zui:pointer-events-none zui:absolute zui:z-0 zui:rounded-md zui:shadow-[0_6px_16px_-10px_var(--zui-effect-shadow-ink-35)] zui:transition-[transform,width,height] zui:duration-300 zui:ease-out", {
|
|
15773
15828
|
variants: {
|
|
15774
15829
|
ready: {
|
|
15775
15830
|
true: "",
|
|
@@ -15785,7 +15840,7 @@ var mD = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15785
15840
|
ready: !1,
|
|
15786
15841
|
type: "primary"
|
|
15787
15842
|
}
|
|
15788
|
-
}),
|
|
15843
|
+
}), bD = q("zui:group/tab zui:relative zui:z-10 zui:inline-flex zui:h-full zui:flex-1 zui:cursor-pointer zui:select-none zui:items-center zui:justify-center zui:gap-1.5 zui:rounded-md zui:whitespace-nowrap zui:px-3 zui:font-medium zui:leading-none zui:text-[var(--zui-color-text)] zui:outline-none zui:transition-colors zui:duration-200 zui:ease-out zui:focus-visible:ring-2 zui:focus-visible:ring-[var(--zui-color-primary)] zui:focus-visible:ring-offset-1 zui:focus-visible:ring-offset-[var(--zui-color-tooltip-surface)] zui:disabled:pointer-events-none zui:disabled:opacity-50", {
|
|
15789
15844
|
variants: {
|
|
15790
15845
|
size: {
|
|
15791
15846
|
sm: "zui:text-xs",
|
|
@@ -15802,13 +15857,13 @@ var mD = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15802
15857
|
size: "default",
|
|
15803
15858
|
type: "primary"
|
|
15804
15859
|
}
|
|
15805
|
-
}),
|
|
15806
|
-
function
|
|
15807
|
-
let n = e.useContext(
|
|
15860
|
+
}), xD = q("zui:mt-3 zui:w-full zui:outline-none zui:data-[state=inactive]:hidden zui:data-[state=active]:animate-in zui:data-[state=active]:fade-in-0 zui:data-[state=active]:slide-in-from-bottom-1 zui:data-[state=active]:duration-300"), SD = e.createContext(null);
|
|
15861
|
+
function CD(t) {
|
|
15862
|
+
let n = e.useContext(SD);
|
|
15808
15863
|
if (!n) throw Error(`${t} must be used within a <Tabs> component`);
|
|
15809
15864
|
return n;
|
|
15810
15865
|
}
|
|
15811
|
-
var
|
|
15866
|
+
var wD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", dir: a = "rtl", type: o = "primary", id: s, className: c, children: l }, u) {
|
|
15812
15867
|
let [d, f] = e.useState(n), [p, m] = e.useState("default"), h = t !== void 0, g = h ? t : d, _ = e.useCallback((e) => {
|
|
15813
15868
|
h || f(e), r?.(e);
|
|
15814
15869
|
}, [h, r]), v = e.useMemo(() => ({
|
|
@@ -15827,22 +15882,22 @@ var xD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15827
15882
|
o,
|
|
15828
15883
|
p
|
|
15829
15884
|
]);
|
|
15830
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15885
|
+
return /* @__PURE__ */ (0, P.jsx)(SD.Provider, {
|
|
15831
15886
|
value: v,
|
|
15832
15887
|
children: /* @__PURE__ */ (0, P.jsx)("div", {
|
|
15833
15888
|
ref: u,
|
|
15834
15889
|
id: s,
|
|
15835
15890
|
dir: a,
|
|
15836
15891
|
"data-slot": "tabs",
|
|
15837
|
-
className: D(
|
|
15892
|
+
className: D(_D({
|
|
15838
15893
|
orientation: i,
|
|
15839
15894
|
className: c
|
|
15840
15895
|
})),
|
|
15841
15896
|
children: l
|
|
15842
15897
|
})
|
|
15843
15898
|
});
|
|
15844
|
-
}),
|
|
15845
|
-
let { orientation: o, dir: s, type: c, value: l, setValue: u, setSize: d } =
|
|
15899
|
+
}), TD = e.forwardRef(function({ size: t = "default", "aria-label": n, className: r, children: i }, a) {
|
|
15900
|
+
let { orientation: o, dir: s, type: c, value: l, setValue: u, setSize: d } = CD("TabsList"), f = e.useRef(null), [p, m] = e.useState({}), [h, g] = e.useState(!1);
|
|
15846
15901
|
e.useImperativeHandle(a, () => f.current), e.useEffect(() => {
|
|
15847
15902
|
d(t ?? "default");
|
|
15848
15903
|
}, [t, d]);
|
|
@@ -15890,7 +15945,7 @@ var xD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15890
15945
|
o,
|
|
15891
15946
|
u
|
|
15892
15947
|
]),
|
|
15893
|
-
className: D(
|
|
15948
|
+
className: D(vD({
|
|
15894
15949
|
orientation: o,
|
|
15895
15950
|
size: t,
|
|
15896
15951
|
type: c,
|
|
@@ -15899,15 +15954,15 @@ var xD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15899
15954
|
children: [/* @__PURE__ */ (0, P.jsx)("span", {
|
|
15900
15955
|
"aria-hidden": "true",
|
|
15901
15956
|
"data-slot": "tabs-indicator",
|
|
15902
|
-
className: D(
|
|
15957
|
+
className: D(yD({
|
|
15903
15958
|
ready: h,
|
|
15904
15959
|
type: c
|
|
15905
15960
|
})),
|
|
15906
15961
|
style: p
|
|
15907
15962
|
}), i]
|
|
15908
15963
|
});
|
|
15909
|
-
}),
|
|
15910
|
-
let { value: c, setValue: l, size: u, type: d } =
|
|
15964
|
+
}), ED = e.forwardRef(function({ value: t, size: n, disabled: r = !1, icon: i, className: a, children: o }, s) {
|
|
15965
|
+
let { value: c, setValue: l, size: u, type: d } = CD("TabsTrigger"), f = c === t, p = e.useRef(null);
|
|
15911
15966
|
return e.useImperativeHandle(s, () => p.current), /* @__PURE__ */ (0, P.jsxs)("button", {
|
|
15912
15967
|
ref: p,
|
|
15913
15968
|
type: "button",
|
|
@@ -15923,7 +15978,7 @@ var xD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15923
15978
|
onClick: () => {
|
|
15924
15979
|
r || l(t);
|
|
15925
15980
|
},
|
|
15926
|
-
className: D(
|
|
15981
|
+
className: D(bD({
|
|
15927
15982
|
size: n ?? u,
|
|
15928
15983
|
type: d,
|
|
15929
15984
|
className: a
|
|
@@ -15933,8 +15988,8 @@ var xD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15933
15988
|
children: i
|
|
15934
15989
|
}) : null, o]
|
|
15935
15990
|
});
|
|
15936
|
-
}),
|
|
15937
|
-
let { value: a } =
|
|
15991
|
+
}), DD = e.forwardRef(function({ value: e, forceMount: t = !1, className: n, children: r }, i) {
|
|
15992
|
+
let { value: a } = CD("TabsContent"), o = a === e;
|
|
15938
15993
|
return !o && !t ? null : /* @__PURE__ */ (0, P.jsx)("div", {
|
|
15939
15994
|
ref: i,
|
|
15940
15995
|
role: "tabpanel",
|
|
@@ -15943,10 +15998,10 @@ var xD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15943
15998
|
tabIndex: 0,
|
|
15944
15999
|
"data-slot": "tabs-content",
|
|
15945
16000
|
"data-state": o ? "active" : "inactive",
|
|
15946
|
-
className: D(
|
|
16001
|
+
className: D(xD(), n),
|
|
15947
16002
|
children: r
|
|
15948
16003
|
});
|
|
15949
|
-
}),
|
|
16004
|
+
}), OD = q([`zui:placeholder:text-[var(--zui-color-border)] zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:field-sizing-content zui:flex ${ne} zui:w-full radius-xs zui:border zui:border-[var(--zui-color-border)] zui:bg-transparent ${z} zui:py-2 zui:text-base zui:text-[var(--zui-color-text)] zui:outline-none zui:data-[has-value=true]:border-[var(--zui-theme-action-primary)] zui:[&:not(:focus):not(:focus-visible):not([data-has-value=true])]:border-[var(--zui-color-border)] zui:disabled:cursor-not-allowed zui:disabled:bg-[var(--zui-color-muted-surface)] zui:disabled:opacity-50 zui:md:text-sm`, Uv].join(" "), {
|
|
15950
16005
|
variants: { resize: {
|
|
15951
16006
|
none: "zui:resize-none",
|
|
15952
16007
|
y: "zui:resize-y",
|
|
@@ -15956,40 +16011,40 @@ var xD = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15956
16011
|
});
|
|
15957
16012
|
//#endregion
|
|
15958
16013
|
//#region src/components/Textarea/Textarea.tsx
|
|
15959
|
-
function
|
|
16014
|
+
function kD(e) {
|
|
15960
16015
|
return e == null ? !1 : typeof e == "string" ? e.length > 0 : typeof e == "number" ? !0 : Array.isArray(e) ? e.length > 0 : !1;
|
|
15961
16016
|
}
|
|
15962
|
-
function
|
|
16017
|
+
function AD(e) {
|
|
15963
16018
|
return e == null ? "" : Array.isArray(e) ? e.join(", ") : String(e);
|
|
15964
16019
|
}
|
|
15965
|
-
function
|
|
15966
|
-
return Hv({ value:
|
|
16020
|
+
function jD(e) {
|
|
16021
|
+
return Hv({ value: AD(e) });
|
|
15967
16022
|
}
|
|
15968
|
-
function
|
|
16023
|
+
function MD(e) {
|
|
15969
16024
|
return Bv({ value: e });
|
|
15970
16025
|
}
|
|
15971
|
-
var
|
|
15972
|
-
function
|
|
15973
|
-
let x = e.useId(), S = d ?? x, C = i, w = e.useRef(null), [T, E] = e.useState(!1), [O, k] = e.useState(() =>
|
|
16026
|
+
var ND = "این فیلد اجباری است";
|
|
16027
|
+
function PD({ className: t, resize: n = "none", title: r, required: i = !1, showRequiredMessage: a = !1, placeholder: o, onChange: s, onBlur: c, onFocus: l, onInvalid: u, id: d, name: f, disabled: p = !1, readOnly: m = !1, autoComplete: h, rows: g, maxLength: _, "aria-label": v, value: y, defaultValue: b }) {
|
|
16028
|
+
let x = e.useId(), S = d ?? x, C = i, w = e.useRef(null), [T, E] = e.useState(!1), [O, k] = e.useState(() => kD(y ?? b)), [A, j] = e.useState(() => jD(y ?? b)), M = y !== void 0, N = y === void 0 ? y : MD(jD(y)), F = b === void 0 ? b : MD(jD(b));
|
|
15974
16029
|
e.useEffect(() => {
|
|
15975
|
-
M && (k(
|
|
16030
|
+
M && (k(kD(y)), j(jD(y)));
|
|
15976
16031
|
}, [M, y]), e.useEffect(() => {
|
|
15977
16032
|
if (M) return;
|
|
15978
16033
|
let e = w.current;
|
|
15979
16034
|
if (!e) return;
|
|
15980
|
-
let t =
|
|
16035
|
+
let t = MD(A);
|
|
15981
16036
|
e.value !== t && (e.value = t);
|
|
15982
16037
|
}, [M, A]);
|
|
15983
|
-
let
|
|
16038
|
+
let ee = e.useCallback((e) => {
|
|
15984
16039
|
let t = e.target, n = t.selectionStart, r = t.selectionEnd, i = Hv({ value: t.value });
|
|
15985
|
-
t.value = i, n !== null && t.setSelectionRange(n, r ?? n), M || (k(
|
|
16040
|
+
t.value = i, n !== null && t.setSelectionRange(n, r ?? n), M || (k(kD(i)), j(i)), T && E(!1), s?.(e), t.value = Bv({ value: i }), n !== null && t.setSelectionRange(n, r ?? n);
|
|
15986
16041
|
}, [
|
|
15987
16042
|
M,
|
|
15988
16043
|
T,
|
|
15989
16044
|
s
|
|
15990
|
-
]),
|
|
15991
|
-
k(
|
|
15992
|
-
}, [c]),
|
|
16045
|
+
]), I = e.useCallback((e) => {
|
|
16046
|
+
k(kD(e.target.value)), c?.(e);
|
|
16047
|
+
}, [c]), L = e.useCallback((e) => {
|
|
15993
16048
|
E(!0), u?.(e);
|
|
15994
16049
|
}, [u]);
|
|
15995
16050
|
return /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -16007,7 +16062,7 @@ function jD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16007
16062
|
}) : null,
|
|
16008
16063
|
C && a ? /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16009
16064
|
className: "zui:mr-1 zui:text-xs zui:font-normal zui:text-[var(--zui-theme-status-danger)]",
|
|
16010
|
-
children:
|
|
16065
|
+
children: ND
|
|
16011
16066
|
}) : null
|
|
16012
16067
|
]
|
|
16013
16068
|
}) : C && a ? /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -16017,7 +16072,7 @@ function jD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16017
16072
|
children: "*"
|
|
16018
16073
|
}), /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16019
16074
|
className: "zui:text-xs zui:text-[var(--zui-theme-status-danger)]",
|
|
16020
|
-
children:
|
|
16075
|
+
children: ND
|
|
16021
16076
|
})]
|
|
16022
16077
|
}) : null, /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
16023
16078
|
className: "zui:relative",
|
|
@@ -16040,13 +16095,13 @@ function jD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16040
16095
|
rows: g,
|
|
16041
16096
|
maxLength: _,
|
|
16042
16097
|
"aria-label": v,
|
|
16043
|
-
onChange:
|
|
16044
|
-
onBlur:
|
|
16098
|
+
onChange: ee,
|
|
16099
|
+
onBlur: I,
|
|
16045
16100
|
onFocus: l,
|
|
16046
|
-
onInvalid:
|
|
16101
|
+
onInvalid: L,
|
|
16047
16102
|
value: N,
|
|
16048
16103
|
defaultValue: F,
|
|
16049
|
-
className: D(
|
|
16104
|
+
className: D(OD({
|
|
16050
16105
|
resize: n,
|
|
16051
16106
|
className: t
|
|
16052
16107
|
}), "zui:text-right")
|
|
@@ -16056,11 +16111,11 @@ function jD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16056
16111
|
}
|
|
16057
16112
|
//#endregion
|
|
16058
16113
|
//#region node_modules/@radix-ui/react-toast/dist/index.mjs
|
|
16059
|
-
var
|
|
16114
|
+
var FD = "ToastProvider", [ID, LD, RD] = vS("Toast"), [zD, BD] = U("Toast", [RD]), [VD, HD] = zD(FD), UD = (t) => {
|
|
16060
16115
|
let { __scopeToast: n, label: r = "Notification", duration: i = 5e3, swipeDirection: a = "right", swipeThreshold: o = 50, children: s } = t, [c, l] = e.useState(null), [u, d] = e.useState(0), f = e.useRef(!1), p = e.useRef(!1);
|
|
16061
|
-
return r.trim() || console.error(`Invalid prop \`label\` supplied to \`${
|
|
16116
|
+
return r.trim() || console.error(`Invalid prop \`label\` supplied to \`${FD}\`. Expected non-empty \`string\`.`), /* @__PURE__ */ (0, P.jsx)(ID.Provider, {
|
|
16062
16117
|
scope: n,
|
|
16063
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16118
|
+
children: /* @__PURE__ */ (0, P.jsx)(VD, {
|
|
16064
16119
|
scope: n,
|
|
16065
16120
|
label: r,
|
|
16066
16121
|
duration: i,
|
|
@@ -16077,9 +16132,9 @@ var MD = "ToastProvider", [ND, PD, FD] = vS("Toast"), [ID, LD] = U("Toast", [FD]
|
|
|
16077
16132
|
})
|
|
16078
16133
|
});
|
|
16079
16134
|
};
|
|
16080
|
-
|
|
16081
|
-
var
|
|
16082
|
-
let { __scopeToast: r, hotkey: i =
|
|
16135
|
+
UD.displayName = FD;
|
|
16136
|
+
var WD = "ToastViewport", GD = ["F8"], KD = "toast.viewportPause", qD = "toast.viewportResume", JD = e.forwardRef((t, n) => {
|
|
16137
|
+
let { __scopeToast: r, hotkey: i = GD, label: a = "Notifications ({hotkey})", ...o } = t, s = HD(WD, r), c = LD(r), l = e.useRef(null), u = e.useRef(null), d = e.useRef(null), f = e.useRef(null), p = H(n, f, s.onViewportChange), m = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), h = s.toastCount > 0;
|
|
16083
16138
|
e.useEffect(() => {
|
|
16084
16139
|
let e = (e) => {
|
|
16085
16140
|
i.length !== 0 && i.every((t) => e[t] || e.code === t) && f.current?.focus();
|
|
@@ -16090,12 +16145,12 @@ var VD = "ToastViewport", HD = ["F8"], UD = "toast.viewportPause", WD = "toast.v
|
|
|
16090
16145
|
if (h && e && t) {
|
|
16091
16146
|
let n = () => {
|
|
16092
16147
|
if (!s.isClosePausedRef.current) {
|
|
16093
|
-
let e = new CustomEvent(
|
|
16148
|
+
let e = new CustomEvent(KD);
|
|
16094
16149
|
t.dispatchEvent(e), s.isClosePausedRef.current = !0;
|
|
16095
16150
|
}
|
|
16096
16151
|
}, r = () => {
|
|
16097
16152
|
if (s.isClosePausedRef.current) {
|
|
16098
|
-
let e = new CustomEvent(
|
|
16153
|
+
let e = new CustomEvent(qD);
|
|
16099
16154
|
t.dispatchEvent(e), s.isClosePausedRef.current = !1;
|
|
16100
16155
|
}
|
|
16101
16156
|
}, i = (t) => {
|
|
@@ -16110,7 +16165,7 @@ var VD = "ToastViewport", HD = ["F8"], UD = "toast.viewportPause", WD = "toast.v
|
|
|
16110
16165
|
}, [h, s.isClosePausedRef]);
|
|
16111
16166
|
let g = e.useCallback(({ tabbingDirection: e }) => {
|
|
16112
16167
|
let t = c().map((t) => {
|
|
16113
|
-
let n = t.ref.current, r = [n, ...
|
|
16168
|
+
let n = t.ref.current, r = [n, ...xO(n)];
|
|
16114
16169
|
return e === "forwards" ? r : r.reverse();
|
|
16115
16170
|
});
|
|
16116
16171
|
return (e === "forwards" ? t.reverse() : t).flat();
|
|
@@ -16127,7 +16182,7 @@ var VD = "ToastViewport", HD = ["F8"], UD = "toast.viewportPause", WD = "toast.v
|
|
|
16127
16182
|
return;
|
|
16128
16183
|
}
|
|
16129
16184
|
let i = g({ tabbingDirection: r ? "backwards" : "forwards" }), a = i.findIndex((e) => e === n);
|
|
16130
|
-
|
|
16185
|
+
SO(i.slice(a + 1)) ? t.preventDefault() : r ? u.current?.focus() : d.current?.focus();
|
|
16131
16186
|
}
|
|
16132
16187
|
};
|
|
16133
16188
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
@@ -16139,13 +16194,13 @@ var VD = "ToastViewport", HD = ["F8"], UD = "toast.viewportPause", WD = "toast.v
|
|
|
16139
16194
|
tabIndex: -1,
|
|
16140
16195
|
style: { pointerEvents: h ? void 0 : "none" },
|
|
16141
16196
|
children: [
|
|
16142
|
-
h && /* @__PURE__ */ (0, P.jsx)(
|
|
16197
|
+
h && /* @__PURE__ */ (0, P.jsx)(XD, {
|
|
16143
16198
|
ref: u,
|
|
16144
16199
|
onFocusFromOutsideViewport: () => {
|
|
16145
|
-
|
|
16200
|
+
SO(g({ tabbingDirection: "forwards" }));
|
|
16146
16201
|
}
|
|
16147
16202
|
}),
|
|
16148
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
16203
|
+
/* @__PURE__ */ (0, P.jsx)(ID.Slot, {
|
|
16149
16204
|
scope: r,
|
|
16150
16205
|
children: /* @__PURE__ */ (0, P.jsx)(K.ol, {
|
|
16151
16206
|
tabIndex: -1,
|
|
@@ -16153,18 +16208,18 @@ var VD = "ToastViewport", HD = ["F8"], UD = "toast.viewportPause", WD = "toast.v
|
|
|
16153
16208
|
ref: p
|
|
16154
16209
|
})
|
|
16155
16210
|
}),
|
|
16156
|
-
h && /* @__PURE__ */ (0, P.jsx)(
|
|
16211
|
+
h && /* @__PURE__ */ (0, P.jsx)(XD, {
|
|
16157
16212
|
ref: d,
|
|
16158
16213
|
onFocusFromOutsideViewport: () => {
|
|
16159
|
-
|
|
16214
|
+
SO(g({ tabbingDirection: "backwards" }));
|
|
16160
16215
|
}
|
|
16161
16216
|
})
|
|
16162
16217
|
]
|
|
16163
16218
|
});
|
|
16164
16219
|
});
|
|
16165
|
-
|
|
16166
|
-
var
|
|
16167
|
-
let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a =
|
|
16220
|
+
JD.displayName = WD;
|
|
16221
|
+
var YD = "ToastFocusProxy", XD = e.forwardRef((e, t) => {
|
|
16222
|
+
let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a = HD(YD, n);
|
|
16168
16223
|
return /* @__PURE__ */ (0, P.jsx)(oy, {
|
|
16169
16224
|
tabIndex: 0,
|
|
16170
16225
|
...i,
|
|
@@ -16176,17 +16231,17 @@ var KD = "ToastFocusProxy", qD = e.forwardRef((e, t) => {
|
|
|
16176
16231
|
}
|
|
16177
16232
|
});
|
|
16178
16233
|
});
|
|
16179
|
-
|
|
16180
|
-
var
|
|
16234
|
+
XD.displayName = YD;
|
|
16235
|
+
var ZD = "Toast", QD = "toast.swipeStart", $D = "toast.swipeMove", eO = "toast.swipeCancel", tO = "toast.swipeEnd", nO = e.forwardRef((e, t) => {
|
|
16181
16236
|
let { forceMount: n, open: r, defaultOpen: i, onOpenChange: a, ...o } = e, [s, c] = Se({
|
|
16182
16237
|
prop: r,
|
|
16183
16238
|
defaultProp: i ?? !0,
|
|
16184
16239
|
onChange: a,
|
|
16185
|
-
caller:
|
|
16240
|
+
caller: ZD
|
|
16186
16241
|
});
|
|
16187
16242
|
return /* @__PURE__ */ (0, P.jsx)(Oe, {
|
|
16188
16243
|
present: n || s,
|
|
16189
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16244
|
+
children: /* @__PURE__ */ (0, P.jsx)(aO, {
|
|
16190
16245
|
open: s,
|
|
16191
16246
|
...o,
|
|
16192
16247
|
ref: t,
|
|
@@ -16210,9 +16265,9 @@ var JD = "Toast", YD = "toast.swipeStart", XD = "toast.swipeMove", ZD = "toast.s
|
|
|
16210
16265
|
})
|
|
16211
16266
|
});
|
|
16212
16267
|
});
|
|
16213
|
-
|
|
16214
|
-
var [
|
|
16215
|
-
let { __scopeToast: r, type: i = "foreground", duration: a, open: o, onClose: s, onEscapeKeyDown: c, onPause: l, onResume: u, onSwipeStart: d, onSwipeMove: p, onSwipeCancel: m, onSwipeEnd: h, ...g } = t, _ =
|
|
16268
|
+
nO.displayName = ZD;
|
|
16269
|
+
var [rO, iO] = zD(ZD, { onClose() {} }), aO = e.forwardRef((t, n) => {
|
|
16270
|
+
let { __scopeToast: r, type: i = "foreground", duration: a, open: o, onClose: s, onEscapeKeyDown: c, onPause: l, onResume: u, onSwipeStart: d, onSwipeMove: p, onSwipeCancel: m, onSwipeEnd: h, ...g } = t, _ = HD(ZD, r), [v, y] = e.useState(null), b = H(n, (e) => y(e)), x = e.useRef(null), S = e.useRef(null), C = a || _.duration, w = e.useRef(0), T = e.useRef(C), E = e.useRef(0), { onToastAdd: D, onToastRemove: O } = _, k = Bt(() => {
|
|
16216
16271
|
v?.contains(document.activeElement) && _.viewport?.focus(), s();
|
|
16217
16272
|
}), A = e.useCallback((e) => {
|
|
16218
16273
|
!e || e === Infinity || (window.clearTimeout(E.current), w.current = (/* @__PURE__ */ new Date()).getTime(), E.current = window.setTimeout(k, e));
|
|
@@ -16226,8 +16281,8 @@ var [eO, tO] = ID(JD, { onClose() {} }), nO = e.forwardRef((t, n) => {
|
|
|
16226
16281
|
let e = (/* @__PURE__ */ new Date()).getTime() - w.current;
|
|
16227
16282
|
T.current -= e, window.clearTimeout(E.current), l?.();
|
|
16228
16283
|
};
|
|
16229
|
-
return e.addEventListener(
|
|
16230
|
-
e.removeEventListener(
|
|
16284
|
+
return e.addEventListener(KD, n), e.addEventListener(qD, t), () => {
|
|
16285
|
+
e.removeEventListener(KD, n), e.removeEventListener(qD, t);
|
|
16231
16286
|
};
|
|
16232
16287
|
}
|
|
16233
16288
|
}, [
|
|
@@ -16244,16 +16299,16 @@ var [eO, tO] = ID(JD, { onClose() {} }), nO = e.forwardRef((t, n) => {
|
|
|
16244
16299
|
_.isClosePausedRef,
|
|
16245
16300
|
A
|
|
16246
16301
|
]), e.useEffect(() => (D(), () => O()), [D, O]);
|
|
16247
|
-
let j = e.useMemo(() => v ?
|
|
16248
|
-
return _.viewport ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [j && /* @__PURE__ */ (0, P.jsx)(
|
|
16302
|
+
let j = e.useMemo(() => v ? gO(v) : null, [v]);
|
|
16303
|
+
return _.viewport ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [j && /* @__PURE__ */ (0, P.jsx)(oO, {
|
|
16249
16304
|
__scopeToast: r,
|
|
16250
16305
|
role: "status",
|
|
16251
16306
|
"aria-live": i === "foreground" ? "assertive" : "polite",
|
|
16252
16307
|
children: j
|
|
16253
|
-
}), /* @__PURE__ */ (0, P.jsx)(
|
|
16308
|
+
}), /* @__PURE__ */ (0, P.jsx)(rO, {
|
|
16254
16309
|
scope: r,
|
|
16255
16310
|
onClose: k,
|
|
16256
|
-
children: f.createPortal(/* @__PURE__ */ (0, P.jsx)(
|
|
16311
|
+
children: f.createPortal(/* @__PURE__ */ (0, P.jsx)(ID.ItemSlot, {
|
|
16257
16312
|
scope: r,
|
|
16258
16313
|
children: /* @__PURE__ */ (0, P.jsx)(tn, {
|
|
16259
16314
|
asChild: !0,
|
|
@@ -16289,7 +16344,7 @@ var [eO, tO] = ID(JD, { onClose() {} }), nO = e.forwardRef((t, n) => {
|
|
|
16289
16344
|
originalEvent: e,
|
|
16290
16345
|
delta: l
|
|
16291
16346
|
};
|
|
16292
|
-
r ? (S.current = l,
|
|
16347
|
+
r ? (S.current = l, _O($D, p, u, { discrete: !1 })) : vO(l, _.swipeDirection, c) ? (S.current = l, _O(QD, d, u, { discrete: !1 }), e.target.setPointerCapture(e.pointerId)) : (Math.abs(t) > c || Math.abs(n) > c) && (x.current = null);
|
|
16293
16348
|
}),
|
|
16294
16349
|
onPointerUp: W(t.onPointerUp, (e) => {
|
|
16295
16350
|
let t = S.current, n = e.target;
|
|
@@ -16298,16 +16353,16 @@ var [eO, tO] = ID(JD, { onClose() {} }), nO = e.forwardRef((t, n) => {
|
|
|
16298
16353
|
originalEvent: e,
|
|
16299
16354
|
delta: t
|
|
16300
16355
|
};
|
|
16301
|
-
|
|
16356
|
+
vO(t, _.swipeDirection, _.swipeThreshold) ? _O(tO, h, r, { discrete: !0 }) : _O(eO, m, r, { discrete: !0 }), n.addEventListener("click", (e) => e.preventDefault(), { once: !0 });
|
|
16302
16357
|
}
|
|
16303
16358
|
})
|
|
16304
16359
|
})
|
|
16305
16360
|
})
|
|
16306
16361
|
}), _.viewport)
|
|
16307
16362
|
})] }) : null;
|
|
16308
|
-
}),
|
|
16309
|
-
let { __scopeToast: n, children: r, ...i } = t, a =
|
|
16310
|
-
return
|
|
16363
|
+
}), oO = (t) => {
|
|
16364
|
+
let { __scopeToast: n, children: r, ...i } = t, a = HD(ZD, n), [o, s] = e.useState(!1), [c, l] = e.useState(!1);
|
|
16365
|
+
return yO(() => s(!0)), e.useEffect(() => {
|
|
16311
16366
|
let e = window.setTimeout(() => l(!0), 1e3);
|
|
16312
16367
|
return () => window.clearTimeout(e);
|
|
16313
16368
|
}, []), c ? null : /* @__PURE__ */ (0, P.jsx)(ua, {
|
|
@@ -16321,37 +16376,37 @@ var [eO, tO] = ID(JD, { onClose() {} }), nO = e.forwardRef((t, n) => {
|
|
|
16321
16376
|
] })
|
|
16322
16377
|
})
|
|
16323
16378
|
});
|
|
16324
|
-
},
|
|
16379
|
+
}, sO = "ToastTitle", cO = e.forwardRef((e, t) => {
|
|
16325
16380
|
let { __scopeToast: n, ...r } = e;
|
|
16326
16381
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16327
16382
|
...r,
|
|
16328
16383
|
ref: t
|
|
16329
16384
|
});
|
|
16330
16385
|
});
|
|
16331
|
-
|
|
16332
|
-
var
|
|
16386
|
+
cO.displayName = sO;
|
|
16387
|
+
var lO = "ToastDescription", uO = e.forwardRef((e, t) => {
|
|
16333
16388
|
let { __scopeToast: n, ...r } = e;
|
|
16334
16389
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16335
16390
|
...r,
|
|
16336
16391
|
ref: t
|
|
16337
16392
|
});
|
|
16338
16393
|
});
|
|
16339
|
-
|
|
16340
|
-
var
|
|
16394
|
+
uO.displayName = lO;
|
|
16395
|
+
var dO = "ToastAction", fO = e.forwardRef((e, t) => {
|
|
16341
16396
|
let { altText: n, ...r } = e;
|
|
16342
|
-
return n.trim() ? /* @__PURE__ */ (0, P.jsx)(
|
|
16397
|
+
return n.trim() ? /* @__PURE__ */ (0, P.jsx)(hO, {
|
|
16343
16398
|
altText: n,
|
|
16344
16399
|
asChild: !0,
|
|
16345
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16400
|
+
children: /* @__PURE__ */ (0, P.jsx)(mO, {
|
|
16346
16401
|
...r,
|
|
16347
16402
|
ref: t
|
|
16348
16403
|
})
|
|
16349
|
-
}) : (console.error(`Invalid prop \`altText\` supplied to \`${
|
|
16404
|
+
}) : (console.error(`Invalid prop \`altText\` supplied to \`${dO}\`. Expected non-empty \`string\`.`), null);
|
|
16350
16405
|
});
|
|
16351
|
-
|
|
16352
|
-
var
|
|
16353
|
-
let { __scopeToast: n, ...r } = e, i =
|
|
16354
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16406
|
+
fO.displayName = dO;
|
|
16407
|
+
var pO = "ToastClose", mO = e.forwardRef((e, t) => {
|
|
16408
|
+
let { __scopeToast: n, ...r } = e, i = iO(pO, n);
|
|
16409
|
+
return /* @__PURE__ */ (0, P.jsx)(hO, {
|
|
16355
16410
|
asChild: !0,
|
|
16356
16411
|
children: /* @__PURE__ */ (0, P.jsx)(K.button, {
|
|
16357
16412
|
type: "button",
|
|
@@ -16361,8 +16416,8 @@ var uO = "ToastClose", dO = e.forwardRef((e, t) => {
|
|
|
16361
16416
|
})
|
|
16362
16417
|
});
|
|
16363
16418
|
});
|
|
16364
|
-
|
|
16365
|
-
var
|
|
16419
|
+
mO.displayName = pO;
|
|
16420
|
+
var hO = e.forwardRef((e, t) => {
|
|
16366
16421
|
let { __scopeToast: n, altText: r, ...i } = e;
|
|
16367
16422
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16368
16423
|
"data-radix-toast-announce-exclude": "",
|
|
@@ -16371,19 +16426,19 @@ var fO = e.forwardRef((e, t) => {
|
|
|
16371
16426
|
ref: t
|
|
16372
16427
|
});
|
|
16373
16428
|
});
|
|
16374
|
-
function
|
|
16429
|
+
function gO(e) {
|
|
16375
16430
|
let t = [];
|
|
16376
16431
|
return Array.from(e.childNodes).forEach((e) => {
|
|
16377
|
-
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent),
|
|
16432
|
+
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent), bO(e)) {
|
|
16378
16433
|
let n = e.ariaHidden || e.hidden || e.style.display === "none", r = e.dataset.radixToastAnnounceExclude === "";
|
|
16379
16434
|
if (!n) if (r) {
|
|
16380
16435
|
let n = e.dataset.radixToastAnnounceAlt;
|
|
16381
16436
|
n && t.push(n);
|
|
16382
|
-
} else t.push(...
|
|
16437
|
+
} else t.push(...gO(e));
|
|
16383
16438
|
}
|
|
16384
16439
|
}), t;
|
|
16385
16440
|
}
|
|
16386
|
-
function
|
|
16441
|
+
function _O(e, t, n, { discrete: r }) {
|
|
16387
16442
|
let i = n.originalEvent.currentTarget, a = new CustomEvent(e, {
|
|
16388
16443
|
bubbles: !0,
|
|
16389
16444
|
cancelable: !0,
|
|
@@ -16391,11 +16446,11 @@ function mO(e, t, n, { discrete: r }) {
|
|
|
16391
16446
|
});
|
|
16392
16447
|
t && i.addEventListener(e, t, { once: !0 }), r ? ze(i, a) : i.dispatchEvent(a);
|
|
16393
16448
|
}
|
|
16394
|
-
var
|
|
16449
|
+
var vO = (e, t, n = 0) => {
|
|
16395
16450
|
let r = Math.abs(e.x), i = Math.abs(e.y), a = r > i;
|
|
16396
16451
|
return t === "left" || t === "right" ? a && r > n : !a && i > n;
|
|
16397
16452
|
};
|
|
16398
|
-
function
|
|
16453
|
+
function yO(e = () => {}) {
|
|
16399
16454
|
let t = Bt(e);
|
|
16400
16455
|
G(() => {
|
|
16401
16456
|
let e = 0, n = 0;
|
|
@@ -16404,10 +16459,10 @@ function gO(e = () => {}) {
|
|
|
16404
16459
|
};
|
|
16405
16460
|
}, [t]);
|
|
16406
16461
|
}
|
|
16407
|
-
function
|
|
16462
|
+
function bO(e) {
|
|
16408
16463
|
return e.nodeType === e.ELEMENT_NODE;
|
|
16409
16464
|
}
|
|
16410
|
-
function
|
|
16465
|
+
function xO(e) {
|
|
16411
16466
|
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
|
|
16412
16467
|
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
16413
16468
|
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
@@ -16415,11 +16470,11 @@ function vO(e) {
|
|
|
16415
16470
|
for (; n.nextNode();) t.push(n.currentNode);
|
|
16416
16471
|
return t;
|
|
16417
16472
|
}
|
|
16418
|
-
function
|
|
16473
|
+
function SO(e) {
|
|
16419
16474
|
let t = document.activeElement;
|
|
16420
16475
|
return e.some((e) => e === t ? !0 : (e.focus(), document.activeElement !== t));
|
|
16421
16476
|
}
|
|
16422
|
-
var
|
|
16477
|
+
var CO = UD, wO = JD, TO = nO, EO = cO, DO = uO, OO = fO, kO = mO, AO = q(`zui:fixed zui:left-0 zui:bottom-0 zui:z-[100] zui:flex zui:max-h-screen zui:w-full zui:flex-col-reverse zui:gap-3 ${ce} zui:sm:flex-col zui:md:max-w-[420px]`), jO = q(`zui:group zui:pointer-events-auto zui:relative zui:flex zui:w-full zui:items-center zui:justify-between zui:gap-4 zui:overflow-hidden zui:rounded-[var(--zui-radius-xs)] zui:border zui:bg-[var(--zui-color-surface)] ${ce} zui:pl-6 zui:text-[var(--zui-theme-text-primary)] zui:shadow-[0_6px_18px_-14px_var(--zui-effect-shadow-ink-35)] zui:transition-all zui:data-[state=open]:animate-in zui:data-[state=closed]:animate-out zui:data-[state=closed]:fill-mode-forwards zui:data-[state=closed]:fade-out-80 zui:data-[state=closed]:slide-out-to-left-[130%] zui:data-[state=closed]:[animation-duration:var(--zui-motion-duration-toast-close)] zui:data-[state=closed]:[animation-timing-function:var(--zui-motion-ease-toast-close)] zui:data-[state=open]:slide-in-from-bottom-full zui:data-[swipe=cancel]:translate-x-0 zui:data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] zui:data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] zui:data-[swipe=move]:transition-none`, {
|
|
16423
16478
|
variants: { variant: {
|
|
16424
16479
|
default: "zui:border-[var(--zui-theme-border-default)]",
|
|
16425
16480
|
info: "zui:border-[var(--zui-theme-status-info)]",
|
|
@@ -16429,49 +16484,49 @@ var bO = BD, xO = GD, SO = $D, CO = aO, wO = sO, TO = lO, EO = dO, DO = q(`zui:f
|
|
|
16429
16484
|
destructive: "zui:border-[var(--zui-theme-status-danger)]"
|
|
16430
16485
|
} },
|
|
16431
16486
|
defaultVariants: { variant: "default" }
|
|
16432
|
-
}),
|
|
16487
|
+
}), MO = q("zui:inline-flex zui:h-8 zui:shrink-0 zui:items-center zui:justify-center zui:rounded-[var(--zui-radius-xs)] zui:border zui:border-[var(--zui-theme-border-default)] zui:bg-transparent zui:px-3 zui:text-sm zui:font-medium zui:text-[var(--zui-theme-text-primary)] zui:transition-colors zui:hover:bg-[var(--zui-theme-action-ghost-hover)] zui:focus-visible:outline-none zui:focus-visible:ring-2 zui:focus-visible:ring-[var(--zui-theme-action-secondary)] zui:disabled:pointer-events-none zui:disabled:opacity-50"), NO = q("zui:absolute zui:top-2 zui:left-2 zui:inline-flex zui:size-7 zui:items-center zui:justify-center zui:bg-transparent zui:p-0 zui:text-[var(--zui-theme-text-primary)] zui:opacity-100 zui:transition-transform zui:duration-200 zui:ease-out zui:hover:scale-110 zui:hover:cursor-pointer zui:hover:bg-transparent zui:hover:text-[var(--zui-theme-text-primary)] zui:focus-visible:outline-none zui:focus-visible:ring-2 zui:focus-visible:ring-[var(--zui-theme-action-secondary)]"), PO = q("zui:text-sm zui:font-semibold zui:text-current"), FO = q("zui:text-sm zui:text-current");
|
|
16433
16488
|
//#endregion
|
|
16434
16489
|
//#region src/components/Toast/Toast.tsx
|
|
16435
|
-
function
|
|
16436
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16490
|
+
function IO(e) {
|
|
16491
|
+
return /* @__PURE__ */ (0, P.jsx)(CO, {
|
|
16437
16492
|
"data-slot": "toast-provider",
|
|
16438
16493
|
...e
|
|
16439
16494
|
});
|
|
16440
16495
|
}
|
|
16441
|
-
var
|
|
16442
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16496
|
+
var LO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16497
|
+
return /* @__PURE__ */ (0, P.jsx)(wO, {
|
|
16443
16498
|
ref: n,
|
|
16444
16499
|
"data-slot": "toast-viewport",
|
|
16445
16500
|
"data-zui-toast-viewport": "",
|
|
16446
|
-
className: D(
|
|
16501
|
+
className: D(AO(), e),
|
|
16447
16502
|
...t
|
|
16448
16503
|
});
|
|
16449
16504
|
});
|
|
16450
|
-
function
|
|
16451
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16505
|
+
function RO({ className: e, variant: t, ...n }) {
|
|
16506
|
+
return /* @__PURE__ */ (0, P.jsx)(TO, {
|
|
16452
16507
|
"data-slot": "toast",
|
|
16453
16508
|
"data-zui-toast-root": "",
|
|
16454
16509
|
dir: "rtl",
|
|
16455
|
-
className: D(
|
|
16510
|
+
className: D(jO({ variant: t }), "zui:text-right", e),
|
|
16456
16511
|
...n
|
|
16457
16512
|
});
|
|
16458
16513
|
}
|
|
16459
|
-
var
|
|
16460
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16514
|
+
var zO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16515
|
+
return /* @__PURE__ */ (0, P.jsx)(OO, {
|
|
16461
16516
|
ref: n,
|
|
16462
16517
|
"data-slot": "toast-action",
|
|
16463
|
-
className: D(
|
|
16518
|
+
className: D(MO(), e),
|
|
16464
16519
|
...t
|
|
16465
16520
|
});
|
|
16466
|
-
}),
|
|
16521
|
+
}), BO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16467
16522
|
return /* @__PURE__ */ (0, P.jsx)(Jy, {
|
|
16468
16523
|
text: "بستن",
|
|
16469
16524
|
position: "top",
|
|
16470
|
-
trigger: /* @__PURE__ */ (0, P.jsx)(
|
|
16525
|
+
trigger: /* @__PURE__ */ (0, P.jsx)(kO, {
|
|
16471
16526
|
ref: n,
|
|
16472
16527
|
"data-slot": "toast-close",
|
|
16473
16528
|
"aria-label": "بستن",
|
|
16474
|
-
className: D(
|
|
16529
|
+
className: D(NO(), e),
|
|
16475
16530
|
...t,
|
|
16476
16531
|
children: /* @__PURE__ */ (0, P.jsx)(Mt, {
|
|
16477
16532
|
className: "zui:size-[1.92rem] zui:text-current",
|
|
@@ -16479,44 +16534,44 @@ var IO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
|
16479
16534
|
})
|
|
16480
16535
|
})
|
|
16481
16536
|
});
|
|
16482
|
-
}),
|
|
16483
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16537
|
+
}), VO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16538
|
+
return /* @__PURE__ */ (0, P.jsx)(EO, {
|
|
16484
16539
|
ref: n,
|
|
16485
16540
|
"data-slot": "toast-title",
|
|
16486
|
-
className: D(
|
|
16541
|
+
className: D(PO(), e),
|
|
16487
16542
|
...t
|
|
16488
16543
|
});
|
|
16489
|
-
}),
|
|
16490
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16544
|
+
}), HO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16545
|
+
return /* @__PURE__ */ (0, P.jsx)(DO, {
|
|
16491
16546
|
ref: n,
|
|
16492
16547
|
"data-slot": "toast-description",
|
|
16493
|
-
className: D(
|
|
16548
|
+
className: D(FO(), e),
|
|
16494
16549
|
...t
|
|
16495
16550
|
});
|
|
16496
|
-
}),
|
|
16497
|
-
function
|
|
16551
|
+
}), UO = 2147483647, WO = /* @__PURE__ */ new Set();
|
|
16552
|
+
function GO(e) {
|
|
16498
16553
|
return e === "succes" ? "success" : e;
|
|
16499
16554
|
}
|
|
16500
|
-
function
|
|
16501
|
-
return
|
|
16502
|
-
|
|
16555
|
+
function KO(e) {
|
|
16556
|
+
return WO.add(e), () => {
|
|
16557
|
+
WO.delete(e);
|
|
16503
16558
|
};
|
|
16504
16559
|
}
|
|
16505
|
-
function
|
|
16506
|
-
let { safeDuration: i, isPersistent: a } =
|
|
16560
|
+
function qO({ title: e, message: t, duration: n, type: r }) {
|
|
16561
|
+
let { safeDuration: i, isPersistent: a } = JO(n), o = {
|
|
16507
16562
|
title: e,
|
|
16508
16563
|
message: t,
|
|
16509
16564
|
duration: i,
|
|
16510
16565
|
isPersistent: a,
|
|
16511
|
-
type:
|
|
16566
|
+
type: GO(r)
|
|
16512
16567
|
};
|
|
16513
|
-
|
|
16568
|
+
WO.forEach((e) => {
|
|
16514
16569
|
e(o);
|
|
16515
16570
|
});
|
|
16516
16571
|
}
|
|
16517
|
-
function
|
|
16572
|
+
function JO(e) {
|
|
16518
16573
|
return e == null || !Number.isFinite(e) || e <= 0 ? {
|
|
16519
|
-
safeDuration:
|
|
16574
|
+
safeDuration: UO,
|
|
16520
16575
|
isPersistent: !0
|
|
16521
16576
|
} : {
|
|
16522
16577
|
safeDuration: e,
|
|
@@ -16525,7 +16580,7 @@ function GO(e) {
|
|
|
16525
16580
|
}
|
|
16526
16581
|
//#endregion
|
|
16527
16582
|
//#region src/components/Toast/function/toastVisual.ts
|
|
16528
|
-
var
|
|
16583
|
+
var YO = {
|
|
16529
16584
|
info: {
|
|
16530
16585
|
Icon: Tt,
|
|
16531
16586
|
iconClassName: "zui:text-[var(--zui-theme-status-info)]",
|
|
@@ -16547,23 +16602,23 @@ var KO = {
|
|
|
16547
16602
|
progressClassName: "zui:bg-[var(--zui-theme-status-danger)]"
|
|
16548
16603
|
}
|
|
16549
16604
|
};
|
|
16550
|
-
function
|
|
16551
|
-
return
|
|
16605
|
+
function XO(e) {
|
|
16606
|
+
return YO[e];
|
|
16552
16607
|
}
|
|
16553
16608
|
//#endregion
|
|
16554
16609
|
//#region src/components/Toast/ToastHost.tsx
|
|
16555
|
-
var
|
|
16556
|
-
function
|
|
16610
|
+
var ZO = 5, QO = 420;
|
|
16611
|
+
function $O() {
|
|
16557
16612
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
16558
16613
|
}
|
|
16559
|
-
function
|
|
16614
|
+
function ek() {
|
|
16560
16615
|
let [e, t] = d([]), n = u(/* @__PURE__ */ new Map());
|
|
16561
|
-
s(() =>
|
|
16616
|
+
s(() => KO((e) => {
|
|
16562
16617
|
t((t) => [{
|
|
16563
|
-
id:
|
|
16618
|
+
id: $O(),
|
|
16564
16619
|
open: !0,
|
|
16565
16620
|
...e
|
|
16566
|
-
}, ...t].slice(0,
|
|
16621
|
+
}, ...t].slice(0, ZO));
|
|
16567
16622
|
}), []), s(() => {
|
|
16568
16623
|
let e = n.current;
|
|
16569
16624
|
return () => {
|
|
@@ -16581,10 +16636,10 @@ function ZO() {
|
|
|
16581
16636
|
} : t));
|
|
16582
16637
|
let a = window.setTimeout(() => {
|
|
16583
16638
|
n.current.delete(e), t((t) => t.filter((t) => t.id !== e));
|
|
16584
|
-
},
|
|
16639
|
+
}, QO);
|
|
16585
16640
|
n.current.set(e, a);
|
|
16586
16641
|
}, []);
|
|
16587
|
-
return /* @__PURE__ */ (0, P.jsxs)(
|
|
16642
|
+
return /* @__PURE__ */ (0, P.jsxs)(IO, { children: [e.map((e) => /* @__PURE__ */ (0, P.jsxs)(RO, {
|
|
16588
16643
|
open: e.open,
|
|
16589
16644
|
duration: e.isPersistent ? Infinity : e.duration,
|
|
16590
16645
|
variant: e.type,
|
|
@@ -16594,29 +16649,29 @@ function ZO() {
|
|
|
16594
16649
|
className: "zui:flex zui:items-start zui:gap-3",
|
|
16595
16650
|
children: [/* @__PURE__ */ (0, P.jsx)("span", {
|
|
16596
16651
|
className: "zui:mt-0.5 zui:shrink-0",
|
|
16597
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16652
|
+
children: /* @__PURE__ */ (0, P.jsx)(tk, { type: e.type })
|
|
16598
16653
|
}), /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
16599
16654
|
className: "zui:grid zui:gap-1",
|
|
16600
|
-
children: [/* @__PURE__ */ (0, P.jsx)(
|
|
16655
|
+
children: [/* @__PURE__ */ (0, P.jsx)(VO, { children: e.title }), /* @__PURE__ */ (0, P.jsx)(HO, { children: e.message })]
|
|
16601
16656
|
})]
|
|
16602
16657
|
}),
|
|
16603
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
16604
|
-
!e.isPersistent && /* @__PURE__ */ (0, P.jsx)(
|
|
16658
|
+
/* @__PURE__ */ (0, P.jsx)(BO, {}),
|
|
16659
|
+
!e.isPersistent && /* @__PURE__ */ (0, P.jsx)(nk, {
|
|
16605
16660
|
duration: e.duration,
|
|
16606
16661
|
type: e.type
|
|
16607
16662
|
})
|
|
16608
16663
|
]
|
|
16609
|
-
}, e.id)), /* @__PURE__ */ (0, P.jsx)(
|
|
16664
|
+
}, e.id)), /* @__PURE__ */ (0, P.jsx)(LO, {})] });
|
|
16610
16665
|
}
|
|
16611
|
-
function
|
|
16612
|
-
let { Icon: t, iconClassName: n } =
|
|
16666
|
+
function tk({ type: e }) {
|
|
16667
|
+
let { Icon: t, iconClassName: n } = XO(e);
|
|
16613
16668
|
return /* @__PURE__ */ (0, P.jsx)(t, {
|
|
16614
16669
|
className: `zui:size-5 ${n}`,
|
|
16615
16670
|
"aria-hidden": "true"
|
|
16616
16671
|
});
|
|
16617
16672
|
}
|
|
16618
|
-
function
|
|
16619
|
-
let { progressClassName: n } =
|
|
16673
|
+
function nk({ duration: e, type: t }) {
|
|
16674
|
+
let { progressClassName: n } = XO(t);
|
|
16620
16675
|
return /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16621
16676
|
className: `zui:pointer-events-none zui:absolute zui:right-0 zui:bottom-0 zui:left-0 zui:h-1 zui:origin-right ${n}`,
|
|
16622
16677
|
style: { animation: `zui-toast-progress ${e}ms linear forwards` },
|
|
@@ -16624,4 +16679,4 @@ function $O({ duration: e, type: t }) {
|
|
|
16624
16679
|
});
|
|
16625
16680
|
}
|
|
16626
16681
|
//#endregion
|
|
16627
|
-
export { ge as Button, zt as Checkbox, Bb as DatePicker, Hx as Dialog, tS as Input,
|
|
16682
|
+
export { ge as Button, zt as Checkbox, Bb as DatePicker, Hx as Dialog, tS as Input, UO as PERSISTENT_DURATION, _S as Pagination, xC as RadioGroup, SC as RadioGroupItem, LT as Select, BT as SelectContent, VT as SelectGroup, UT as SelectItem, HT as SelectLabel, WT as SelectSeparator, RT as SelectTrigger, zT as SelectValue, iE as Sheet, uT as Skeleton, F as Spinner, uD as Table, fD as TableBody, gD as TableCell, pD as TableFooter, hD as TableHead, dD as TableHeader, mD as TableRow, wD as Tabs, DD as TabsContent, TD as TabsList, ED as TabsTrigger, PD as Textarea, RO as Toast, zO as ToastAction, BO as ToastClose, HO as ToastDescription, ek as ToastHost, IO as ToastProvider, VO as ToastTitle, LO as ToastViewport, Jy as Tooltip, T as applyTheme, w as createThemeCssVariables, Rb as formatPersianDate, zb as formatPersianDateRangeLabel, C as resolveTheme, qO as showToast, KO as subscribeToast, x as theme, S as themeCssVariables };
|