zaravand-ui 3.1.0 → 3.1.2
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/index.cjs +1 -1
- package/dist/index.js +319 -290
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15094,80 +15094,99 @@ function pD(e, t, n, r, i) {
|
|
|
15094
15094
|
}
|
|
15095
15095
|
//#endregion
|
|
15096
15096
|
//#region src/components/Table/hooks/useTablePagination.ts
|
|
15097
|
-
|
|
15098
|
-
|
|
15097
|
+
var mD = new Set([
|
|
15098
|
+
"auto",
|
|
15099
|
+
"scroll",
|
|
15100
|
+
"overlay"
|
|
15101
|
+
]);
|
|
15102
|
+
function hD(e) {
|
|
15103
|
+
let t = e.parentElement;
|
|
15104
|
+
for (; t && t !== document.body;) {
|
|
15105
|
+
let e = window.getComputedStyle(t).overflowY;
|
|
15106
|
+
if (mD.has(e) && t.scrollHeight > t.clientHeight) return t;
|
|
15107
|
+
t = t.parentElement;
|
|
15108
|
+
}
|
|
15109
|
+
return document.scrollingElement ?? document.documentElement;
|
|
15110
|
+
}
|
|
15111
|
+
function gD(e) {
|
|
15112
|
+
if (typeof window > "u" || !e) return !1;
|
|
15113
|
+
let t = hD(e);
|
|
15114
|
+
return t.scrollHeight > t.clientHeight;
|
|
15115
|
+
}
|
|
15116
|
+
function _D({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i, isRowActionBusy: a, searchKey: o, sortKey: s, maxVisibleRowsBeforeScroll: c }) {
|
|
15117
|
+
let [l, u] = e.useState("pagination"), [d, f] = e.useState(1), [p, m] = e.useState(1), [h, g] = e.useState(!1), _ = e.useRef(null), v = e.useRef(null), y = e.useRef(!1), b = e.useRef(null), x = e.useRef(!1), S = r?.onPageChange, C = r?.onLoadMore, w = typeof S == "function", T = typeof C == "function", E = w, D = r != null, O = e.useMemo(() => {
|
|
15099
15118
|
let e = Math.floor(r?.pageSize ?? 10);
|
|
15100
15119
|
return e > 0 ? e : 10;
|
|
15101
|
-
}, [r?.pageSize]),
|
|
15102
|
-
if (!
|
|
15120
|
+
}, [r?.pageSize]), k = e.useMemo(() => {
|
|
15121
|
+
if (!E || !r) return n.length;
|
|
15103
15122
|
let e = Math.floor(r.totalItems);
|
|
15104
15123
|
return e > 0 ? e : 0;
|
|
15105
15124
|
}, [
|
|
15106
15125
|
n.length,
|
|
15107
15126
|
r,
|
|
15108
|
-
|
|
15109
|
-
]),
|
|
15110
|
-
E,
|
|
15127
|
+
E
|
|
15128
|
+
]), A = e.useMemo(() => !D || k <= 0 ? 1 : Math.max(1, Math.ceil(k / O)), [
|
|
15111
15129
|
D,
|
|
15112
|
-
O
|
|
15113
|
-
|
|
15114
|
-
|
|
15130
|
+
O,
|
|
15131
|
+
k
|
|
15132
|
+
]), j = e.useMemo(() => {
|
|
15133
|
+
if (E && r) {
|
|
15115
15134
|
let e = Math.floor(r.page);
|
|
15116
|
-
return Math.min(
|
|
15135
|
+
return Math.min(A, Math.max(1, e || 1));
|
|
15117
15136
|
}
|
|
15118
|
-
return Math.min(
|
|
15137
|
+
return Math.min(A, Math.max(1, d));
|
|
15119
15138
|
}, [
|
|
15120
15139
|
d,
|
|
15121
15140
|
r,
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
]),
|
|
15125
|
-
if (!
|
|
15141
|
+
E,
|
|
15142
|
+
A
|
|
15143
|
+
]), M = e.useMemo(() => {
|
|
15144
|
+
if (!D) return n;
|
|
15126
15145
|
if (l === "infinite") {
|
|
15127
|
-
if (
|
|
15128
|
-
let e = p *
|
|
15146
|
+
if (E) return n;
|
|
15147
|
+
let e = p * O;
|
|
15129
15148
|
return n.slice(0, e);
|
|
15130
15149
|
}
|
|
15131
|
-
if (
|
|
15132
|
-
let e = (
|
|
15133
|
-
return n.slice(e, e +
|
|
15150
|
+
if (E) return n;
|
|
15151
|
+
let e = (j - 1) * O;
|
|
15152
|
+
return n.slice(e, e + O);
|
|
15134
15153
|
}, [
|
|
15135
|
-
|
|
15154
|
+
j,
|
|
15136
15155
|
n,
|
|
15137
|
-
|
|
15156
|
+
D,
|
|
15138
15157
|
p,
|
|
15139
15158
|
l,
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
]),
|
|
15159
|
+
O,
|
|
15160
|
+
E
|
|
15161
|
+
]), N = e.useMemo(() => $E(j, A), [j, A]);
|
|
15143
15162
|
e.useEffect(() => {
|
|
15144
|
-
|
|
15145
|
-
}, [
|
|
15146
|
-
|
|
15163
|
+
E || (f((e) => Math.min(A, Math.max(1, e))), m((e) => Math.min(A, Math.max(1, e))));
|
|
15164
|
+
}, [E, A]), e.useEffect(() => {
|
|
15165
|
+
E || (f(1), m(1));
|
|
15147
15166
|
}, [
|
|
15148
15167
|
o,
|
|
15149
|
-
|
|
15168
|
+
E,
|
|
15150
15169
|
s
|
|
15151
15170
|
]);
|
|
15152
|
-
let
|
|
15171
|
+
let P = j > 1, F = j < A, I = D && !t && A > 1, L = I, ee = I && l === "pagination", R = I && l === "infinite", z = R && (E ? F : p < A), B = e.useMemo(() => {
|
|
15153
15172
|
let e = Math.floor(c ?? 20);
|
|
15154
15173
|
return e > 0 ? e : 20;
|
|
15155
|
-
}, [c]),
|
|
15174
|
+
}, [c]), te = e.useMemo(() => D && !t && l !== "infinite" && M.length > B, [
|
|
15156
15175
|
t,
|
|
15157
|
-
|
|
15176
|
+
D,
|
|
15158
15177
|
l,
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
]),
|
|
15178
|
+
B,
|
|
15179
|
+
M.length
|
|
15180
|
+
]), ne = e.useMemo(() => Math.max(1, Math.min(M.length, B)), [B, M.length]), V = e.useMemo(() => 54 + 52 * ne, [ne]), re = te ? { maxHeight: `${V}px` } : void 0, ie = e.useCallback(() => {
|
|
15162
15181
|
y.current = !1, g(!1), b.current = null;
|
|
15163
|
-
}, []),
|
|
15182
|
+
}, []), ae = e.useCallback(() => y.current ? !1 : (y.current = !0, g(!0), b.current = {
|
|
15164
15183
|
loading: i,
|
|
15165
|
-
currentPage:
|
|
15184
|
+
currentPage: j,
|
|
15166
15185
|
filteredRowsLength: n.length,
|
|
15167
15186
|
localLoadedPages: p,
|
|
15168
15187
|
pagingMode: l
|
|
15169
15188
|
}, !0), [
|
|
15170
|
-
|
|
15189
|
+
j,
|
|
15171
15190
|
n.length,
|
|
15172
15191
|
i,
|
|
15173
15192
|
p,
|
|
@@ -15177,132 +15196,142 @@ function mD({ hasChildren: t, filteredRows: n, paginationConfig: r, loading: i,
|
|
|
15177
15196
|
if (!y.current) return;
|
|
15178
15197
|
let e = b.current;
|
|
15179
15198
|
if (!e) {
|
|
15180
|
-
|
|
15199
|
+
ie();
|
|
15181
15200
|
return;
|
|
15182
15201
|
}
|
|
15183
|
-
(e.loading !== i || e.currentPage !==
|
|
15202
|
+
(e.loading !== i || e.currentPage !== j || e.filteredRowsLength !== n.length || e.localLoadedPages !== p || e.pagingMode !== l) && ie();
|
|
15184
15203
|
}, [
|
|
15185
|
-
|
|
15204
|
+
j,
|
|
15186
15205
|
n.length,
|
|
15187
15206
|
i,
|
|
15188
15207
|
p,
|
|
15189
15208
|
l,
|
|
15190
|
-
|
|
15209
|
+
ie
|
|
15191
15210
|
]), e.useEffect(() => {
|
|
15192
|
-
l === "infinite" &&
|
|
15211
|
+
l === "infinite" && z || ie();
|
|
15193
15212
|
}, [
|
|
15194
|
-
|
|
15213
|
+
z,
|
|
15195
15214
|
l,
|
|
15196
|
-
|
|
15197
|
-
])
|
|
15198
|
-
|
|
15215
|
+
ie
|
|
15216
|
+
]), e.useEffect(() => {
|
|
15217
|
+
if (x.current = !1, l !== "infinite" || typeof document > "u") return;
|
|
15218
|
+
let e = () => {
|
|
15219
|
+
x.current = !0;
|
|
15220
|
+
};
|
|
15221
|
+
return document.addEventListener("scroll", e, {
|
|
15222
|
+
capture: !0,
|
|
15223
|
+
passive: !0
|
|
15224
|
+
}), () => document.removeEventListener("scroll", e, !0);
|
|
15225
|
+
}, [l]);
|
|
15226
|
+
let oe = e.useCallback((e) => {
|
|
15199
15227
|
if (i || a) return;
|
|
15200
|
-
let t = Math.min(
|
|
15201
|
-
if (t !==
|
|
15202
|
-
if (
|
|
15203
|
-
|
|
15228
|
+
let t = Math.min(A, Math.max(1, Math.floor(e)));
|
|
15229
|
+
if (t !== j) {
|
|
15230
|
+
if (E) {
|
|
15231
|
+
S?.(t, l);
|
|
15204
15232
|
return;
|
|
15205
15233
|
}
|
|
15206
15234
|
f(t);
|
|
15207
15235
|
}
|
|
15208
15236
|
}, [
|
|
15209
|
-
|
|
15237
|
+
j,
|
|
15210
15238
|
a,
|
|
15211
15239
|
i,
|
|
15212
|
-
|
|
15240
|
+
S,
|
|
15213
15241
|
l,
|
|
15214
|
-
|
|
15215
|
-
|
|
15216
|
-
]),
|
|
15242
|
+
E,
|
|
15243
|
+
A
|
|
15244
|
+
]), se = e.useCallback(() => {
|
|
15217
15245
|
let e = l === "pagination" ? "infinite" : "pagination";
|
|
15218
|
-
|
|
15246
|
+
E ? S?.(j, e) : l === "pagination" ? m((e) => Math.max(e, d)) : f((e) => Math.max(1, Math.min(A, Math.max(e, p)))), u(e);
|
|
15219
15247
|
}, [
|
|
15220
|
-
|
|
15248
|
+
j,
|
|
15221
15249
|
d,
|
|
15222
15250
|
p,
|
|
15223
|
-
|
|
15251
|
+
S,
|
|
15224
15252
|
l,
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
-
]),
|
|
15228
|
-
|
|
15229
|
-
|
|
15230
|
-
|
|
15253
|
+
E,
|
|
15254
|
+
A
|
|
15255
|
+
]), ce = e.useCallback(async () => {
|
|
15256
|
+
let e = x.current || !gD(_.current);
|
|
15257
|
+
if (!z || i || a || y.current || !e || !ae()) return;
|
|
15258
|
+
let t = j + 1;
|
|
15259
|
+
if (E) {
|
|
15231
15260
|
try {
|
|
15232
|
-
|
|
15261
|
+
T ? await C?.(t) : S?.(t, "infinite");
|
|
15233
15262
|
} catch {
|
|
15234
|
-
|
|
15263
|
+
ie();
|
|
15235
15264
|
}
|
|
15236
15265
|
return;
|
|
15237
15266
|
}
|
|
15238
|
-
m((e) => Math.min(
|
|
15267
|
+
m((e) => Math.min(A, e + 1));
|
|
15239
15268
|
}, [
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
|
|
15269
|
+
z,
|
|
15270
|
+
j,
|
|
15271
|
+
T,
|
|
15243
15272
|
a,
|
|
15244
15273
|
i,
|
|
15245
|
-
|
|
15274
|
+
ae,
|
|
15275
|
+
C,
|
|
15246
15276
|
S,
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
if (!ee || i || a || !R || y.current) return;
|
|
15277
|
+
ie,
|
|
15278
|
+
E,
|
|
15279
|
+
A
|
|
15280
|
+
]), le = e.useCallback((e) => {
|
|
15281
|
+
if (!R || i || a || !z || y.current) return;
|
|
15253
15282
|
let t = e.currentTarget;
|
|
15254
|
-
t.scrollHeight - t.scrollTop - t.clientHeight <= 104 &&
|
|
15283
|
+
t.scrollHeight - t.scrollTop - t.clientHeight <= 104 && ce();
|
|
15255
15284
|
}, [
|
|
15256
|
-
|
|
15257
|
-
|
|
15285
|
+
z,
|
|
15286
|
+
ce,
|
|
15258
15287
|
a,
|
|
15259
15288
|
i,
|
|
15260
|
-
|
|
15289
|
+
R
|
|
15261
15290
|
]);
|
|
15262
15291
|
return e.useEffect(() => {
|
|
15263
|
-
if (!
|
|
15292
|
+
if (!z || i || a || y.current || typeof window > "u" || !("IntersectionObserver" in window)) return;
|
|
15264
15293
|
let e = v.current, t = _.current;
|
|
15265
15294
|
if (!e || !t) return;
|
|
15266
15295
|
let n = new IntersectionObserver((e) => {
|
|
15267
|
-
e.some((e) => e.isIntersecting) &&
|
|
15296
|
+
e.some((e) => e.isIntersecting) && ce();
|
|
15268
15297
|
}, {
|
|
15269
15298
|
root: t,
|
|
15270
15299
|
rootMargin: TE
|
|
15271
15300
|
});
|
|
15272
15301
|
return n.observe(e), () => n.disconnect();
|
|
15273
15302
|
}, [
|
|
15274
|
-
|
|
15275
|
-
|
|
15303
|
+
z,
|
|
15304
|
+
ce,
|
|
15276
15305
|
a,
|
|
15277
15306
|
i
|
|
15278
15307
|
]), {
|
|
15279
15308
|
pagingMode: l,
|
|
15280
|
-
currentPage:
|
|
15281
|
-
totalPages:
|
|
15282
|
-
resolvedPageSize:
|
|
15283
|
-
visibleRows:
|
|
15284
|
-
paginationTokens:
|
|
15285
|
-
canGoToPreviousPage:
|
|
15286
|
-
canGoToNextPage:
|
|
15287
|
-
canUsePaging:
|
|
15288
|
-
showPagingModeToggle:
|
|
15289
|
-
shouldRenderPagination:
|
|
15290
|
-
shouldRenderInfiniteMode:
|
|
15291
|
-
canLoadMoreInInfiniteMode:
|
|
15292
|
-
shouldUseRemotePaging:
|
|
15293
|
-
shouldUseScrollableRows:
|
|
15309
|
+
currentPage: j,
|
|
15310
|
+
totalPages: A,
|
|
15311
|
+
resolvedPageSize: O,
|
|
15312
|
+
visibleRows: M,
|
|
15313
|
+
paginationTokens: N,
|
|
15314
|
+
canGoToPreviousPage: P,
|
|
15315
|
+
canGoToNextPage: F,
|
|
15316
|
+
canUsePaging: I,
|
|
15317
|
+
showPagingModeToggle: L,
|
|
15318
|
+
shouldRenderPagination: ee,
|
|
15319
|
+
shouldRenderInfiniteMode: R,
|
|
15320
|
+
canLoadMoreInInfiniteMode: z,
|
|
15321
|
+
shouldUseRemotePaging: E,
|
|
15322
|
+
shouldUseScrollableRows: te,
|
|
15294
15323
|
tableScrollViewportRef: _,
|
|
15295
15324
|
infiniteScrollSentinelRef: v,
|
|
15296
|
-
tableScrollViewportStyle:
|
|
15297
|
-
handlePageChange:
|
|
15298
|
-
handlePagingModeToggle:
|
|
15299
|
-
handleTableScrollViewport:
|
|
15325
|
+
tableScrollViewportStyle: re,
|
|
15326
|
+
handlePageChange: oe,
|
|
15327
|
+
handlePagingModeToggle: se,
|
|
15328
|
+
handleTableScrollViewport: le,
|
|
15300
15329
|
isInfiniteRequestPending: h
|
|
15301
15330
|
};
|
|
15302
15331
|
}
|
|
15303
15332
|
//#endregion
|
|
15304
15333
|
//#region src/components/Table/hooks/useTableSearch.ts
|
|
15305
|
-
function
|
|
15334
|
+
function vD({ data: t, visibleColumns: n, showSearchInput: r, hasRemoteSearchHandler: i, onSearchChange: a, getRowId: o }) {
|
|
15306
15335
|
let [s, c] = e.useState(""), [l, u] = e.useState(""), d = s.trim().toLocaleLowerCase();
|
|
15307
15336
|
return e.useEffect(() => {
|
|
15308
15337
|
i && a?.(l);
|
|
@@ -15345,9 +15374,9 @@ function hD({ data: t, visibleColumns: n, showSearchInput: r, hasRemoteSearchHan
|
|
|
15345
15374
|
}
|
|
15346
15375
|
//#endregion
|
|
15347
15376
|
//#region src/components/Table/hooks/useTableSort.ts
|
|
15348
|
-
var
|
|
15349
|
-
function
|
|
15350
|
-
let i = r?.onSortChange, a = typeof i == "function", [o, s] = e.useState(void 0), [c, l] = e.useState(
|
|
15377
|
+
var yD = "asc";
|
|
15378
|
+
function bD({ rows: t, columns: n, sortConfig: r }) {
|
|
15379
|
+
let i = r?.onSortChange, a = typeof i == "function", [o, s] = e.useState(void 0), [c, l] = e.useState(yD), u = a ? r?.sortKey : o, d = a ? r?.sortDirection ?? yD : c, f = e.useMemo(() => new Map(n.map((e) => [e.key, e])), [n]);
|
|
15351
15380
|
return {
|
|
15352
15381
|
sortedRows: e.useMemo(() => {
|
|
15353
15382
|
if (!u || a) return t;
|
|
@@ -15380,7 +15409,7 @@ function _D({ rows: t, columns: n, sortConfig: r }) {
|
|
|
15380
15409
|
}
|
|
15381
15410
|
//#endregion
|
|
15382
15411
|
//#region src/components/Table/Table.tsx
|
|
15383
|
-
var
|
|
15412
|
+
var xD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>button]:!p-0`, SD = 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) {
|
|
15384
15413
|
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: I, columnStyleByKey: L, actionsColumnStyle: ee } = e.useMemo(() => XE(S, A, F), [
|
|
15385
15414
|
F,
|
|
15386
15415
|
A,
|
|
@@ -15489,18 +15518,18 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15489
15518
|
V,
|
|
15490
15519
|
m,
|
|
15491
15520
|
l
|
|
15492
|
-
]), { searchTerm: ce, normalizedSearchTerm: le, filteredRows: ue, handleSearchInputChange: de } =
|
|
15521
|
+
]), { searchTerm: ce, normalizedSearchTerm: le, filteredRows: ue, handleSearchInputChange: de } = vD({
|
|
15493
15522
|
data: c,
|
|
15494
15523
|
visibleColumns: S,
|
|
15495
15524
|
showSearchInput: k,
|
|
15496
15525
|
hasRemoteSearchHandler: N,
|
|
15497
15526
|
onSearchChange: M,
|
|
15498
15527
|
getRowId: h
|
|
15499
|
-
}), { sortedRows: fe, activeSortKey: pe, activeSortDirection: me, handleSortToggle: he } =
|
|
15528
|
+
}), { sortedRows: fe, activeSortKey: pe, activeSortDirection: me, handleSortToggle: he } = bD({
|
|
15500
15529
|
rows: ue,
|
|
15501
15530
|
columns: s.columns,
|
|
15502
15531
|
sortConfig: s.sort
|
|
15503
|
-
}), { pagingMode: _e, currentPage: ve, totalPages: H, resolvedPageSize: ye, visibleRows: U, showPagingModeToggle: be, shouldRenderPagination: W, shouldRenderInfiniteMode: G, canLoadMoreInInfiniteMode: xe, shouldUseRemotePaging: Se, shouldUseScrollableRows: Ce, tableScrollViewportRef: we, infiniteScrollSentinelRef: Te, tableScrollViewportStyle: Ee, handlePageChange: De, handlePagingModeToggle: Oe, handleTableScrollViewport: ke, isInfiniteRequestPending: Ae } =
|
|
15532
|
+
}), { pagingMode: _e, currentPage: ve, totalPages: H, resolvedPageSize: ye, visibleRows: U, showPagingModeToggle: be, shouldRenderPagination: W, shouldRenderInfiniteMode: G, canLoadMoreInInfiniteMode: xe, shouldUseRemotePaging: Se, shouldUseScrollableRows: Ce, tableScrollViewportRef: we, infiniteScrollSentinelRef: Te, tableScrollViewportStyle: Ee, handlePageChange: De, handlePagingModeToggle: Oe, handleTableScrollViewport: ke, isInfiniteRequestPending: Ae } = _D({
|
|
15504
15533
|
hasChildren: x,
|
|
15505
15534
|
filteredRows: fe,
|
|
15506
15535
|
paginationConfig: j,
|
|
@@ -15541,7 +15570,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15541
15570
|
trigger: /* @__PURE__ */ (0, P.jsx)("span", {
|
|
15542
15571
|
"data-slot": "table-paging-mode-toggle-button",
|
|
15543
15572
|
"aria-label": ze,
|
|
15544
|
-
className:
|
|
15573
|
+
className: xD,
|
|
15545
15574
|
children: /* @__PURE__ */ (0, P.jsx)(ge, {
|
|
15546
15575
|
size: "sm",
|
|
15547
15576
|
variant: "primary",
|
|
@@ -15565,7 +15594,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15565
15594
|
trigger: /* @__PURE__ */ (0, P.jsx)("span", {
|
|
15566
15595
|
"data-slot": "table-action-add-button",
|
|
15567
15596
|
"aria-label": uE,
|
|
15568
|
-
className:
|
|
15597
|
+
className: xD,
|
|
15569
15598
|
children: /* @__PURE__ */ (0, P.jsx)(ge, {
|
|
15570
15599
|
size: "sm",
|
|
15571
15600
|
variant: "primary",
|
|
@@ -15593,7 +15622,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15593
15622
|
showRowBorder: v
|
|
15594
15623
|
}), t),
|
|
15595
15624
|
dir: "rtl",
|
|
15596
|
-
children: x ? y : S.length === 0 ? /* @__PURE__ */ (0, P.jsx)(
|
|
15625
|
+
children: x ? y : S.length === 0 ? /* @__PURE__ */ (0, P.jsx)(wD, { children: /* @__PURE__ */ (0, P.jsx)(ED, { children: /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15597
15626
|
className: "zui:py-7 zui:text-center zui:text-[var(--zui-color-text)]",
|
|
15598
15627
|
children: oE
|
|
15599
15628
|
}) }) }) : /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [
|
|
@@ -15602,20 +15631,20 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15602
15631
|
S.map((e) => /* @__PURE__ */ (0, P.jsx)("col", { style: L[e.key] }, `col-${e.key}`)),
|
|
15603
15632
|
F ? /* @__PURE__ */ (0, P.jsx)("col", { style: ee }) : null
|
|
15604
15633
|
] }),
|
|
15605
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
15606
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15634
|
+
/* @__PURE__ */ (0, P.jsx)(CD, { children: /* @__PURE__ */ (0, P.jsxs)(ED, { children: [
|
|
15635
|
+
A ? /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15607
15636
|
align: "center",
|
|
15608
15637
|
className: D(_E, je ? wE : void 0),
|
|
15609
15638
|
children: lE
|
|
15610
15639
|
}) : null,
|
|
15611
15640
|
S.map((e) => {
|
|
15612
|
-
if (!e.sortable) return /* @__PURE__ */ (0, P.jsx)(
|
|
15641
|
+
if (!e.sortable) return /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15613
15642
|
align: e.align,
|
|
15614
15643
|
className: je ? wE : void 0,
|
|
15615
15644
|
children: Bv({ value: e.label })
|
|
15616
15645
|
}, `head-${e.key}`);
|
|
15617
15646
|
let t = pe === e.key, n = t && me === "asc" ? jE : ME, r = `${NE} ${e.label} (${n})`;
|
|
15618
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15647
|
+
return /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15619
15648
|
align: e.align,
|
|
15620
15649
|
className: je ? wE : void 0,
|
|
15621
15650
|
ariaSort: t ? me === "asc" ? "ascending" : "descending" : "none",
|
|
@@ -15639,25 +15668,25 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15639
15668
|
})
|
|
15640
15669
|
}, `head-${e.key}`);
|
|
15641
15670
|
}),
|
|
15642
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15671
|
+
F ? /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15643
15672
|
align: "center",
|
|
15644
15673
|
className: D(gE, je ? wE : void 0),
|
|
15645
15674
|
children: cE
|
|
15646
15675
|
}) : null
|
|
15647
15676
|
] }) }),
|
|
15648
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
15677
|
+
/* @__PURE__ */ (0, P.jsx)(wD, { children: Ne ? Array.from({ length: Me }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(ED, {
|
|
15649
15678
|
slot: "table-loading-row",
|
|
15650
15679
|
children: [
|
|
15651
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15680
|
+
A ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15652
15681
|
align: "center",
|
|
15653
15682
|
className: _E,
|
|
15654
15683
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: "zui:mx-auto zui:h-4 zui:w-8" })
|
|
15655
15684
|
}) : null,
|
|
15656
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)(
|
|
15685
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15657
15686
|
align: e.align,
|
|
15658
15687
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: D("zui:max-w-full", QE(e, t)) })
|
|
15659
15688
|
}, `loading-cell-${e.key}-${t}`)),
|
|
15660
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15689
|
+
F ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15661
15690
|
align: "center",
|
|
15662
15691
|
className: gE,
|
|
15663
15692
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -15677,8 +15706,8 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15677
15706
|
normalizedSearchTerm: le
|
|
15678
15707
|
}) : /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [U.map(({ row: e, rowIndex: t, rowId: n }, r) => {
|
|
15679
15708
|
let i = n === void 0 ? `row-${t}` : `row-id-${String(n)}`, a = W ? (ve - 1) * ye + r + 1 : r + 1;
|
|
15680
|
-
return /* @__PURE__ */ (0, P.jsxs)(
|
|
15681
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15709
|
+
return /* @__PURE__ */ (0, P.jsxs)(ED, { children: [
|
|
15710
|
+
A ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15682
15711
|
align: "center",
|
|
15683
15712
|
className: _E,
|
|
15684
15713
|
children: Bv({ value: String(a) })
|
|
@@ -15687,7 +15716,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15687
15716
|
let a = `cell-${r.key}-${i}`;
|
|
15688
15717
|
if (r.viewType === "select") {
|
|
15689
15718
|
let i = R[r.key] ?? [], o = e[r.key], s = typeof o == "string" || typeof o == "number" ? String(o) : "";
|
|
15690
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15719
|
+
return /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15691
15720
|
align: r.align,
|
|
15692
15721
|
children: /* @__PURE__ */ (0, P.jsx)(LT, {
|
|
15693
15722
|
size: "sm",
|
|
@@ -15703,12 +15732,12 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15703
15732
|
})
|
|
15704
15733
|
}, a);
|
|
15705
15734
|
}
|
|
15706
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15735
|
+
return /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15707
15736
|
align: r.align,
|
|
15708
15737
|
children: cD(e[r.key], r)
|
|
15709
15738
|
}, a);
|
|
15710
15739
|
}),
|
|
15711
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15740
|
+
F ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15712
15741
|
align: "center",
|
|
15713
15742
|
className: gE,
|
|
15714
15743
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -15767,19 +15796,19 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15767
15796
|
})
|
|
15768
15797
|
}) : null
|
|
15769
15798
|
] }, i);
|
|
15770
|
-
}), Pe ? Array.from({ length: K }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(
|
|
15799
|
+
}), Pe ? Array.from({ length: K }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(ED, {
|
|
15771
15800
|
slot: "table-loading-row",
|
|
15772
15801
|
children: [
|
|
15773
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15802
|
+
A ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15774
15803
|
align: "center",
|
|
15775
15804
|
className: _E,
|
|
15776
15805
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: "zui:mx-auto zui:h-4 zui:w-8" })
|
|
15777
15806
|
}) : null,
|
|
15778
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)(
|
|
15807
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15779
15808
|
align: e.align,
|
|
15780
15809
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: D("zui:max-w-full", QE(e, t)) })
|
|
15781
15810
|
}, `infinite-loading-cell-${e.key}-${t}`)),
|
|
15782
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15811
|
+
F ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15783
15812
|
align: "center",
|
|
15784
15813
|
className: gE,
|
|
15785
15814
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -15816,28 +15845,28 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15816
15845
|
})
|
|
15817
15846
|
]
|
|
15818
15847
|
});
|
|
15819
|
-
}),
|
|
15848
|
+
}), CD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15820
15849
|
return /* @__PURE__ */ (0, P.jsx)("thead", {
|
|
15821
15850
|
ref: n,
|
|
15822
15851
|
"data-slot": "table-header",
|
|
15823
15852
|
className: D(LE(), e),
|
|
15824
15853
|
children: t
|
|
15825
15854
|
});
|
|
15826
|
-
}),
|
|
15855
|
+
}), wD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15827
15856
|
return /* @__PURE__ */ (0, P.jsx)("tbody", {
|
|
15828
15857
|
ref: n,
|
|
15829
15858
|
"data-slot": "table-body",
|
|
15830
15859
|
className: D(RE(), e),
|
|
15831
15860
|
children: t
|
|
15832
15861
|
});
|
|
15833
|
-
}),
|
|
15862
|
+
}), TD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15834
15863
|
return /* @__PURE__ */ (0, P.jsx)("tfoot", {
|
|
15835
15864
|
ref: n,
|
|
15836
15865
|
"data-slot": "table-footer",
|
|
15837
15866
|
className: D(zE(), e),
|
|
15838
15867
|
children: t
|
|
15839
15868
|
});
|
|
15840
|
-
}),
|
|
15869
|
+
}), ED = e.forwardRef(function({ className: e, children: t, state: n, slot: r = "table-row" }, i) {
|
|
15841
15870
|
return /* @__PURE__ */ (0, P.jsx)("tr", {
|
|
15842
15871
|
ref: i,
|
|
15843
15872
|
"data-slot": r,
|
|
@@ -15845,7 +15874,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15845
15874
|
className: D(BE(), e),
|
|
15846
15875
|
children: t
|
|
15847
15876
|
});
|
|
15848
|
-
}),
|
|
15877
|
+
}), DD = e.forwardRef(function({ className: e, children: t, align: n, ariaSort: r }, i) {
|
|
15849
15878
|
return /* @__PURE__ */ (0, P.jsx)("th", {
|
|
15850
15879
|
ref: i,
|
|
15851
15880
|
"data-slot": "table-head",
|
|
@@ -15853,7 +15882,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15853
15882
|
className: D(HE({ align: n }), e),
|
|
15854
15883
|
children: t
|
|
15855
15884
|
});
|
|
15856
|
-
}),
|
|
15885
|
+
}), OD = e.forwardRef(function({ className: e, children: t, align: n }, r) {
|
|
15857
15886
|
return /* @__PURE__ */ (0, P.jsx)("td", {
|
|
15858
15887
|
ref: r,
|
|
15859
15888
|
"data-slot": "table-cell",
|
|
@@ -15861,16 +15890,16 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15861
15890
|
children: t
|
|
15862
15891
|
});
|
|
15863
15892
|
});
|
|
15864
|
-
|
|
15893
|
+
SD.displayName = "Table", CD.displayName = "TableHeader", wD.displayName = "TableBody", TD.displayName = "TableFooter", ED.displayName = "TableRow", DD.displayName = "TableHead", OD.displayName = "TableCell";
|
|
15865
15894
|
//#endregion
|
|
15866
15895
|
//#region src/components/Tabs/Tabs.variant.ts
|
|
15867
|
-
var
|
|
15896
|
+
var kD = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
15868
15897
|
variants: { orientation: {
|
|
15869
15898
|
horizontal: "",
|
|
15870
15899
|
vertical: "zui:flex-row zui:items-start"
|
|
15871
15900
|
} },
|
|
15872
15901
|
defaultVariants: { orientation: "horizontal" }
|
|
15873
|
-
}),
|
|
15902
|
+
}), AD = 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", {
|
|
15874
15903
|
variants: {
|
|
15875
15904
|
orientation: {
|
|
15876
15905
|
horizontal: "zui:w-full zui:flex-row",
|
|
@@ -15909,7 +15938,7 @@ var ED = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15909
15938
|
size: "default",
|
|
15910
15939
|
type: "primary"
|
|
15911
15940
|
}
|
|
15912
|
-
}),
|
|
15941
|
+
}), jD = 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", {
|
|
15913
15942
|
variants: {
|
|
15914
15943
|
ready: {
|
|
15915
15944
|
true: "",
|
|
@@ -15925,7 +15954,7 @@ var ED = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15925
15954
|
ready: !1,
|
|
15926
15955
|
type: "primary"
|
|
15927
15956
|
}
|
|
15928
|
-
}),
|
|
15957
|
+
}), MD = 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", {
|
|
15929
15958
|
variants: {
|
|
15930
15959
|
size: {
|
|
15931
15960
|
sm: "zui:text-xs",
|
|
@@ -15942,13 +15971,13 @@ var ED = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15942
15971
|
size: "default",
|
|
15943
15972
|
type: "primary"
|
|
15944
15973
|
}
|
|
15945
|
-
}),
|
|
15946
|
-
function
|
|
15947
|
-
let n = e.useContext(
|
|
15974
|
+
}), ND = 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"), PD = e.createContext(null);
|
|
15975
|
+
function FD(t) {
|
|
15976
|
+
let n = e.useContext(PD);
|
|
15948
15977
|
if (!n) throw Error(`${t} must be used within a <Tabs> component`);
|
|
15949
15978
|
return n;
|
|
15950
15979
|
}
|
|
15951
|
-
var
|
|
15980
|
+
var ID = 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) {
|
|
15952
15981
|
let [d, f] = e.useState(n), [p, m] = e.useState("default"), h = t !== void 0, g = h ? t : d, _ = e.useCallback((e) => {
|
|
15953
15982
|
h || f(e), r?.(e);
|
|
15954
15983
|
}, [h, r]), v = e.useMemo(() => ({
|
|
@@ -15967,22 +15996,22 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15967
15996
|
o,
|
|
15968
15997
|
p
|
|
15969
15998
|
]);
|
|
15970
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15999
|
+
return /* @__PURE__ */ (0, P.jsx)(PD.Provider, {
|
|
15971
16000
|
value: v,
|
|
15972
16001
|
children: /* @__PURE__ */ (0, P.jsx)("div", {
|
|
15973
16002
|
ref: u,
|
|
15974
16003
|
id: s,
|
|
15975
16004
|
dir: a,
|
|
15976
16005
|
"data-slot": "tabs",
|
|
15977
|
-
className: D(
|
|
16006
|
+
className: D(kD({
|
|
15978
16007
|
orientation: i,
|
|
15979
16008
|
className: c
|
|
15980
16009
|
})),
|
|
15981
16010
|
children: l
|
|
15982
16011
|
})
|
|
15983
16012
|
});
|
|
15984
|
-
}),
|
|
15985
|
-
let { orientation: o, dir: s, type: c, value: l, setValue: u, setSize: d } =
|
|
16013
|
+
}), LD = e.forwardRef(function({ size: t = "default", "aria-label": n, className: r, children: i }, a) {
|
|
16014
|
+
let { orientation: o, dir: s, type: c, value: l, setValue: u, setSize: d } = FD("TabsList"), f = e.useRef(null), [p, m] = e.useState({}), [h, g] = e.useState(!1);
|
|
15986
16015
|
e.useImperativeHandle(a, () => f.current), e.useEffect(() => {
|
|
15987
16016
|
d(t ?? "default");
|
|
15988
16017
|
}, [t, d]);
|
|
@@ -16030,7 +16059,7 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16030
16059
|
o,
|
|
16031
16060
|
u
|
|
16032
16061
|
]),
|
|
16033
|
-
className: D(
|
|
16062
|
+
className: D(AD({
|
|
16034
16063
|
orientation: o,
|
|
16035
16064
|
size: t,
|
|
16036
16065
|
type: c,
|
|
@@ -16039,15 +16068,15 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16039
16068
|
children: [/* @__PURE__ */ (0, P.jsx)("span", {
|
|
16040
16069
|
"aria-hidden": "true",
|
|
16041
16070
|
"data-slot": "tabs-indicator",
|
|
16042
|
-
className: D(
|
|
16071
|
+
className: D(jD({
|
|
16043
16072
|
ready: h,
|
|
16044
16073
|
type: c
|
|
16045
16074
|
})),
|
|
16046
16075
|
style: p
|
|
16047
16076
|
}), i]
|
|
16048
16077
|
});
|
|
16049
|
-
}),
|
|
16050
|
-
let { value: c, setValue: l, size: u, type: d } =
|
|
16078
|
+
}), RD = e.forwardRef(function({ value: t, size: n, disabled: r = !1, icon: i, className: a, children: o }, s) {
|
|
16079
|
+
let { value: c, setValue: l, size: u, type: d } = FD("TabsTrigger"), f = c === t, p = e.useRef(null);
|
|
16051
16080
|
return e.useImperativeHandle(s, () => p.current), /* @__PURE__ */ (0, P.jsxs)("button", {
|
|
16052
16081
|
ref: p,
|
|
16053
16082
|
type: "button",
|
|
@@ -16063,7 +16092,7 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16063
16092
|
onClick: () => {
|
|
16064
16093
|
r || l(t);
|
|
16065
16094
|
},
|
|
16066
|
-
className: D(
|
|
16095
|
+
className: D(MD({
|
|
16067
16096
|
size: n ?? u,
|
|
16068
16097
|
type: d,
|
|
16069
16098
|
className: a
|
|
@@ -16073,8 +16102,8 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16073
16102
|
children: i
|
|
16074
16103
|
}) : null, o]
|
|
16075
16104
|
});
|
|
16076
|
-
}),
|
|
16077
|
-
let { value: a } =
|
|
16105
|
+
}), zD = e.forwardRef(function({ value: e, forceMount: t = !1, className: n, children: r }, i) {
|
|
16106
|
+
let { value: a } = FD("TabsContent"), o = a === e;
|
|
16078
16107
|
return !o && !t ? null : /* @__PURE__ */ (0, P.jsx)("div", {
|
|
16079
16108
|
ref: i,
|
|
16080
16109
|
role: "tabpanel",
|
|
@@ -16083,10 +16112,10 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16083
16112
|
tabIndex: 0,
|
|
16084
16113
|
"data-slot": "tabs-content",
|
|
16085
16114
|
"data-state": o ? "active" : "inactive",
|
|
16086
|
-
className: D(
|
|
16115
|
+
className: D(ND(), n),
|
|
16087
16116
|
children: r
|
|
16088
16117
|
});
|
|
16089
|
-
}),
|
|
16118
|
+
}), BD = 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(" "), {
|
|
16090
16119
|
variants: { resize: {
|
|
16091
16120
|
none: "zui:resize-none",
|
|
16092
16121
|
y: "zui:resize-y",
|
|
@@ -16096,39 +16125,39 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16096
16125
|
});
|
|
16097
16126
|
//#endregion
|
|
16098
16127
|
//#region src/components/Textarea/Textarea.tsx
|
|
16099
|
-
function
|
|
16128
|
+
function VD(e) {
|
|
16100
16129
|
return e == null ? !1 : typeof e == "string" ? e.length > 0 : typeof e == "number" ? !0 : Array.isArray(e) ? e.length > 0 : !1;
|
|
16101
16130
|
}
|
|
16102
|
-
function
|
|
16131
|
+
function HD(e) {
|
|
16103
16132
|
return e == null ? "" : Array.isArray(e) ? e.join(", ") : String(e);
|
|
16104
16133
|
}
|
|
16105
|
-
function
|
|
16106
|
-
return Hv({ value:
|
|
16134
|
+
function UD(e) {
|
|
16135
|
+
return Hv({ value: HD(e) });
|
|
16107
16136
|
}
|
|
16108
|
-
function
|
|
16137
|
+
function WD(e) {
|
|
16109
16138
|
return Bv({ value: e });
|
|
16110
16139
|
}
|
|
16111
|
-
var
|
|
16112
|
-
function
|
|
16113
|
-
let x = e.useId(), S = d ?? x, C = i, w = e.useRef(null), [T, E] = e.useState(!1), [O, k] = e.useState(() =>
|
|
16140
|
+
var GD = "این فیلد اجباری است";
|
|
16141
|
+
function KD({ 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 }) {
|
|
16142
|
+
let x = e.useId(), S = d ?? x, C = i, w = e.useRef(null), [T, E] = e.useState(!1), [O, k] = e.useState(() => VD(y ?? b)), [A, j] = e.useState(() => UD(y ?? b)), M = y !== void 0, N = y === void 0 ? y : WD(UD(y)), F = b === void 0 ? b : WD(UD(b));
|
|
16114
16143
|
e.useEffect(() => {
|
|
16115
|
-
M && (k(
|
|
16144
|
+
M && (k(VD(y)), j(UD(y)));
|
|
16116
16145
|
}, [M, y]), e.useEffect(() => {
|
|
16117
16146
|
if (M) return;
|
|
16118
16147
|
let e = w.current;
|
|
16119
16148
|
if (!e) return;
|
|
16120
|
-
let t =
|
|
16149
|
+
let t = WD(A);
|
|
16121
16150
|
e.value !== t && (e.value = t);
|
|
16122
16151
|
}, [M, A]);
|
|
16123
16152
|
let I = e.useCallback((e) => {
|
|
16124
16153
|
let t = e.target, n = t.selectionStart, r = t.selectionEnd, i = Hv({ value: t.value });
|
|
16125
|
-
t.value = i, n !== null && t.setSelectionRange(n, r ?? n), M || (k(
|
|
16154
|
+
t.value = i, n !== null && t.setSelectionRange(n, r ?? n), M || (k(VD(i)), j(i)), T && E(!1), s?.(e), t.value = Bv({ value: i }), n !== null && t.setSelectionRange(n, r ?? n);
|
|
16126
16155
|
}, [
|
|
16127
16156
|
M,
|
|
16128
16157
|
T,
|
|
16129
16158
|
s
|
|
16130
16159
|
]), L = e.useCallback((e) => {
|
|
16131
|
-
k(
|
|
16160
|
+
k(VD(e.target.value)), c?.(e);
|
|
16132
16161
|
}, [c]), ee = e.useCallback((e) => {
|
|
16133
16162
|
E(!0), u?.(e);
|
|
16134
16163
|
}, [u]);
|
|
@@ -16147,7 +16176,7 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16147
16176
|
}) : null,
|
|
16148
16177
|
C && a ? /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16149
16178
|
className: "zui:mr-1 zui:text-xs zui:font-normal zui:text-[var(--zui-theme-status-danger)]",
|
|
16150
|
-
children:
|
|
16179
|
+
children: GD
|
|
16151
16180
|
}) : null
|
|
16152
16181
|
]
|
|
16153
16182
|
}) : C && a ? /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -16157,7 +16186,7 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16157
16186
|
children: "*"
|
|
16158
16187
|
}), /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16159
16188
|
className: "zui:text-xs zui:text-[var(--zui-theme-status-danger)]",
|
|
16160
|
-
children:
|
|
16189
|
+
children: GD
|
|
16161
16190
|
})]
|
|
16162
16191
|
}) : null, /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
16163
16192
|
className: "zui:relative",
|
|
@@ -16186,7 +16215,7 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16186
16215
|
onInvalid: ee,
|
|
16187
16216
|
value: N,
|
|
16188
16217
|
defaultValue: F,
|
|
16189
|
-
className: D(
|
|
16218
|
+
className: D(BD({
|
|
16190
16219
|
resize: n,
|
|
16191
16220
|
className: t
|
|
16192
16221
|
}), "zui:text-right")
|
|
@@ -16196,11 +16225,11 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16196
16225
|
}
|
|
16197
16226
|
//#endregion
|
|
16198
16227
|
//#region node_modules/@radix-ui/react-toast/dist/index.mjs
|
|
16199
|
-
var
|
|
16228
|
+
var qD = "ToastProvider", [JD, YD, XD] = vS("Toast"), [ZD, QD] = U("Toast", [XD]), [$D, eO] = ZD(qD), tO = (t) => {
|
|
16200
16229
|
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);
|
|
16201
|
-
return r.trim() || console.error(`Invalid prop \`label\` supplied to \`${
|
|
16230
|
+
return r.trim() || console.error(`Invalid prop \`label\` supplied to \`${qD}\`. Expected non-empty \`string\`.`), /* @__PURE__ */ (0, P.jsx)(JD.Provider, {
|
|
16202
16231
|
scope: n,
|
|
16203
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16232
|
+
children: /* @__PURE__ */ (0, P.jsx)($D, {
|
|
16204
16233
|
scope: n,
|
|
16205
16234
|
label: r,
|
|
16206
16235
|
duration: i,
|
|
@@ -16217,9 +16246,9 @@ var WD = "ToastProvider", [GD, KD, qD] = vS("Toast"), [JD, YD] = U("Toast", [qD]
|
|
|
16217
16246
|
})
|
|
16218
16247
|
});
|
|
16219
16248
|
};
|
|
16220
|
-
|
|
16221
|
-
var
|
|
16222
|
-
let { __scopeToast: r, hotkey: i =
|
|
16249
|
+
tO.displayName = qD;
|
|
16250
|
+
var nO = "ToastViewport", rO = ["F8"], iO = "toast.viewportPause", aO = "toast.viewportResume", oO = e.forwardRef((t, n) => {
|
|
16251
|
+
let { __scopeToast: r, hotkey: i = rO, label: a = "Notifications ({hotkey})", ...o } = t, s = eO(nO, r), c = YD(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;
|
|
16223
16252
|
e.useEffect(() => {
|
|
16224
16253
|
let e = (e) => {
|
|
16225
16254
|
i.length !== 0 && i.every((t) => e[t] || e.code === t) && f.current?.focus();
|
|
@@ -16230,12 +16259,12 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16230
16259
|
if (h && e && t) {
|
|
16231
16260
|
let n = () => {
|
|
16232
16261
|
if (!s.isClosePausedRef.current) {
|
|
16233
|
-
let e = new CustomEvent(
|
|
16262
|
+
let e = new CustomEvent(iO);
|
|
16234
16263
|
t.dispatchEvent(e), s.isClosePausedRef.current = !0;
|
|
16235
16264
|
}
|
|
16236
16265
|
}, r = () => {
|
|
16237
16266
|
if (s.isClosePausedRef.current) {
|
|
16238
|
-
let e = new CustomEvent(
|
|
16267
|
+
let e = new CustomEvent(aO);
|
|
16239
16268
|
t.dispatchEvent(e), s.isClosePausedRef.current = !1;
|
|
16240
16269
|
}
|
|
16241
16270
|
}, i = (t) => {
|
|
@@ -16250,7 +16279,7 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16250
16279
|
}, [h, s.isClosePausedRef]);
|
|
16251
16280
|
let g = e.useCallback(({ tabbingDirection: e }) => {
|
|
16252
16281
|
let t = c().map((t) => {
|
|
16253
|
-
let n = t.ref.current, r = [n, ...
|
|
16282
|
+
let n = t.ref.current, r = [n, ...NO(n)];
|
|
16254
16283
|
return e === "forwards" ? r : r.reverse();
|
|
16255
16284
|
});
|
|
16256
16285
|
return (e === "forwards" ? t.reverse() : t).flat();
|
|
@@ -16267,7 +16296,7 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16267
16296
|
return;
|
|
16268
16297
|
}
|
|
16269
16298
|
let i = g({ tabbingDirection: r ? "backwards" : "forwards" }), a = i.findIndex((e) => e === n);
|
|
16270
|
-
|
|
16299
|
+
PO(i.slice(a + 1)) ? t.preventDefault() : r ? u.current?.focus() : d.current?.focus();
|
|
16271
16300
|
}
|
|
16272
16301
|
};
|
|
16273
16302
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
@@ -16279,13 +16308,13 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16279
16308
|
tabIndex: -1,
|
|
16280
16309
|
style: { pointerEvents: h ? void 0 : "none" },
|
|
16281
16310
|
children: [
|
|
16282
|
-
h && /* @__PURE__ */ (0, P.jsx)(
|
|
16311
|
+
h && /* @__PURE__ */ (0, P.jsx)(cO, {
|
|
16283
16312
|
ref: u,
|
|
16284
16313
|
onFocusFromOutsideViewport: () => {
|
|
16285
|
-
|
|
16314
|
+
PO(g({ tabbingDirection: "forwards" }));
|
|
16286
16315
|
}
|
|
16287
16316
|
}),
|
|
16288
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
16317
|
+
/* @__PURE__ */ (0, P.jsx)(JD.Slot, {
|
|
16289
16318
|
scope: r,
|
|
16290
16319
|
children: /* @__PURE__ */ (0, P.jsx)(K.ol, {
|
|
16291
16320
|
tabIndex: -1,
|
|
@@ -16293,18 +16322,18 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16293
16322
|
ref: p
|
|
16294
16323
|
})
|
|
16295
16324
|
}),
|
|
16296
|
-
h && /* @__PURE__ */ (0, P.jsx)(
|
|
16325
|
+
h && /* @__PURE__ */ (0, P.jsx)(cO, {
|
|
16297
16326
|
ref: d,
|
|
16298
16327
|
onFocusFromOutsideViewport: () => {
|
|
16299
|
-
|
|
16328
|
+
PO(g({ tabbingDirection: "backwards" }));
|
|
16300
16329
|
}
|
|
16301
16330
|
})
|
|
16302
16331
|
]
|
|
16303
16332
|
});
|
|
16304
16333
|
});
|
|
16305
|
-
|
|
16306
|
-
var
|
|
16307
|
-
let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a =
|
|
16334
|
+
oO.displayName = nO;
|
|
16335
|
+
var sO = "ToastFocusProxy", cO = e.forwardRef((e, t) => {
|
|
16336
|
+
let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a = eO(sO, n);
|
|
16308
16337
|
return /* @__PURE__ */ (0, P.jsx)(oy, {
|
|
16309
16338
|
tabIndex: 0,
|
|
16310
16339
|
...i,
|
|
@@ -16316,17 +16345,17 @@ var iO = "ToastFocusProxy", aO = e.forwardRef((e, t) => {
|
|
|
16316
16345
|
}
|
|
16317
16346
|
});
|
|
16318
16347
|
});
|
|
16319
|
-
|
|
16320
|
-
var
|
|
16348
|
+
cO.displayName = sO;
|
|
16349
|
+
var lO = "Toast", uO = "toast.swipeStart", dO = "toast.swipeMove", fO = "toast.swipeCancel", pO = "toast.swipeEnd", mO = e.forwardRef((e, t) => {
|
|
16321
16350
|
let { forceMount: n, open: r, defaultOpen: i, onOpenChange: a, ...o } = e, [s, c] = Se({
|
|
16322
16351
|
prop: r,
|
|
16323
16352
|
defaultProp: i ?? !0,
|
|
16324
16353
|
onChange: a,
|
|
16325
|
-
caller:
|
|
16354
|
+
caller: lO
|
|
16326
16355
|
});
|
|
16327
16356
|
return /* @__PURE__ */ (0, P.jsx)(Oe, {
|
|
16328
16357
|
present: n || s,
|
|
16329
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16358
|
+
children: /* @__PURE__ */ (0, P.jsx)(_O, {
|
|
16330
16359
|
open: s,
|
|
16331
16360
|
...o,
|
|
16332
16361
|
ref: t,
|
|
@@ -16350,9 +16379,9 @@ var oO = "Toast", sO = "toast.swipeStart", cO = "toast.swipeMove", lO = "toast.s
|
|
|
16350
16379
|
})
|
|
16351
16380
|
});
|
|
16352
16381
|
});
|
|
16353
|
-
|
|
16354
|
-
var [
|
|
16355
|
-
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, _ =
|
|
16382
|
+
mO.displayName = lO;
|
|
16383
|
+
var [hO, gO] = ZD(lO, { onClose() {} }), _O = e.forwardRef((t, n) => {
|
|
16384
|
+
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, _ = eO(lO, 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(() => {
|
|
16356
16385
|
v?.contains(document.activeElement) && _.viewport?.focus(), s();
|
|
16357
16386
|
}), A = e.useCallback((e) => {
|
|
16358
16387
|
!e || e === Infinity || (window.clearTimeout(E.current), w.current = (/* @__PURE__ */ new Date()).getTime(), E.current = window.setTimeout(k, e));
|
|
@@ -16366,8 +16395,8 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16366
16395
|
let e = (/* @__PURE__ */ new Date()).getTime() - w.current;
|
|
16367
16396
|
T.current -= e, window.clearTimeout(E.current), l?.();
|
|
16368
16397
|
};
|
|
16369
|
-
return e.addEventListener(
|
|
16370
|
-
e.removeEventListener(
|
|
16398
|
+
return e.addEventListener(iO, n), e.addEventListener(aO, t), () => {
|
|
16399
|
+
e.removeEventListener(iO, n), e.removeEventListener(aO, t);
|
|
16371
16400
|
};
|
|
16372
16401
|
}
|
|
16373
16402
|
}, [
|
|
@@ -16384,16 +16413,16 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16384
16413
|
_.isClosePausedRef,
|
|
16385
16414
|
A
|
|
16386
16415
|
]), e.useEffect(() => (D(), () => O()), [D, O]);
|
|
16387
|
-
let j = e.useMemo(() => v ?
|
|
16388
|
-
return _.viewport ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [j && /* @__PURE__ */ (0, P.jsx)(
|
|
16416
|
+
let j = e.useMemo(() => v ? OO(v) : null, [v]);
|
|
16417
|
+
return _.viewport ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [j && /* @__PURE__ */ (0, P.jsx)(vO, {
|
|
16389
16418
|
__scopeToast: r,
|
|
16390
16419
|
role: "status",
|
|
16391
16420
|
"aria-live": i === "foreground" ? "assertive" : "polite",
|
|
16392
16421
|
children: j
|
|
16393
|
-
}), /* @__PURE__ */ (0, P.jsx)(
|
|
16422
|
+
}), /* @__PURE__ */ (0, P.jsx)(hO, {
|
|
16394
16423
|
scope: r,
|
|
16395
16424
|
onClose: k,
|
|
16396
|
-
children: f.createPortal(/* @__PURE__ */ (0, P.jsx)(
|
|
16425
|
+
children: f.createPortal(/* @__PURE__ */ (0, P.jsx)(JD.ItemSlot, {
|
|
16397
16426
|
scope: r,
|
|
16398
16427
|
children: /* @__PURE__ */ (0, P.jsx)(tn, {
|
|
16399
16428
|
asChild: !0,
|
|
@@ -16429,7 +16458,7 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16429
16458
|
originalEvent: e,
|
|
16430
16459
|
delta: l
|
|
16431
16460
|
};
|
|
16432
|
-
r ? (S.current = l,
|
|
16461
|
+
r ? (S.current = l, kO(dO, p, u, { discrete: !1 })) : AO(l, _.swipeDirection, c) ? (S.current = l, kO(uO, d, u, { discrete: !1 }), e.target.setPointerCapture(e.pointerId)) : (Math.abs(t) > c || Math.abs(n) > c) && (x.current = null);
|
|
16433
16462
|
}),
|
|
16434
16463
|
onPointerUp: W(t.onPointerUp, (e) => {
|
|
16435
16464
|
let t = S.current, n = e.target;
|
|
@@ -16438,16 +16467,16 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16438
16467
|
originalEvent: e,
|
|
16439
16468
|
delta: t
|
|
16440
16469
|
};
|
|
16441
|
-
|
|
16470
|
+
AO(t, _.swipeDirection, _.swipeThreshold) ? kO(pO, h, r, { discrete: !0 }) : kO(fO, m, r, { discrete: !0 }), n.addEventListener("click", (e) => e.preventDefault(), { once: !0 });
|
|
16442
16471
|
}
|
|
16443
16472
|
})
|
|
16444
16473
|
})
|
|
16445
16474
|
})
|
|
16446
16475
|
}), _.viewport)
|
|
16447
16476
|
})] }) : null;
|
|
16448
|
-
}),
|
|
16449
|
-
let { __scopeToast: n, children: r, ...i } = t, a =
|
|
16450
|
-
return
|
|
16477
|
+
}), vO = (t) => {
|
|
16478
|
+
let { __scopeToast: n, children: r, ...i } = t, a = eO(lO, n), [o, s] = e.useState(!1), [c, l] = e.useState(!1);
|
|
16479
|
+
return jO(() => s(!0)), e.useEffect(() => {
|
|
16451
16480
|
let e = window.setTimeout(() => l(!0), 1e3);
|
|
16452
16481
|
return () => window.clearTimeout(e);
|
|
16453
16482
|
}, []), c ? null : /* @__PURE__ */ (0, P.jsx)(ua, {
|
|
@@ -16461,37 +16490,37 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16461
16490
|
] })
|
|
16462
16491
|
})
|
|
16463
16492
|
});
|
|
16464
|
-
},
|
|
16493
|
+
}, yO = "ToastTitle", bO = e.forwardRef((e, t) => {
|
|
16465
16494
|
let { __scopeToast: n, ...r } = e;
|
|
16466
16495
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16467
16496
|
...r,
|
|
16468
16497
|
ref: t
|
|
16469
16498
|
});
|
|
16470
16499
|
});
|
|
16471
|
-
|
|
16472
|
-
var
|
|
16500
|
+
bO.displayName = yO;
|
|
16501
|
+
var xO = "ToastDescription", SO = e.forwardRef((e, t) => {
|
|
16473
16502
|
let { __scopeToast: n, ...r } = e;
|
|
16474
16503
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16475
16504
|
...r,
|
|
16476
16505
|
ref: t
|
|
16477
16506
|
});
|
|
16478
16507
|
});
|
|
16479
|
-
|
|
16480
|
-
var
|
|
16508
|
+
SO.displayName = xO;
|
|
16509
|
+
var CO = "ToastAction", wO = e.forwardRef((e, t) => {
|
|
16481
16510
|
let { altText: n, ...r } = e;
|
|
16482
|
-
return n.trim() ? /* @__PURE__ */ (0, P.jsx)(
|
|
16511
|
+
return n.trim() ? /* @__PURE__ */ (0, P.jsx)(DO, {
|
|
16483
16512
|
altText: n,
|
|
16484
16513
|
asChild: !0,
|
|
16485
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16514
|
+
children: /* @__PURE__ */ (0, P.jsx)(EO, {
|
|
16486
16515
|
...r,
|
|
16487
16516
|
ref: t
|
|
16488
16517
|
})
|
|
16489
|
-
}) : (console.error(`Invalid prop \`altText\` supplied to \`${
|
|
16518
|
+
}) : (console.error(`Invalid prop \`altText\` supplied to \`${CO}\`. Expected non-empty \`string\`.`), null);
|
|
16490
16519
|
});
|
|
16491
|
-
|
|
16492
|
-
var
|
|
16493
|
-
let { __scopeToast: n, ...r } = e, i =
|
|
16494
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16520
|
+
wO.displayName = CO;
|
|
16521
|
+
var TO = "ToastClose", EO = e.forwardRef((e, t) => {
|
|
16522
|
+
let { __scopeToast: n, ...r } = e, i = gO(TO, n);
|
|
16523
|
+
return /* @__PURE__ */ (0, P.jsx)(DO, {
|
|
16495
16524
|
asChild: !0,
|
|
16496
16525
|
children: /* @__PURE__ */ (0, P.jsx)(K.button, {
|
|
16497
16526
|
type: "button",
|
|
@@ -16501,8 +16530,8 @@ var SO = "ToastClose", CO = e.forwardRef((e, t) => {
|
|
|
16501
16530
|
})
|
|
16502
16531
|
});
|
|
16503
16532
|
});
|
|
16504
|
-
|
|
16505
|
-
var
|
|
16533
|
+
EO.displayName = TO;
|
|
16534
|
+
var DO = e.forwardRef((e, t) => {
|
|
16506
16535
|
let { __scopeToast: n, altText: r, ...i } = e;
|
|
16507
16536
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16508
16537
|
"data-radix-toast-announce-exclude": "",
|
|
@@ -16511,19 +16540,19 @@ var wO = e.forwardRef((e, t) => {
|
|
|
16511
16540
|
ref: t
|
|
16512
16541
|
});
|
|
16513
16542
|
});
|
|
16514
|
-
function
|
|
16543
|
+
function OO(e) {
|
|
16515
16544
|
let t = [];
|
|
16516
16545
|
return Array.from(e.childNodes).forEach((e) => {
|
|
16517
|
-
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent),
|
|
16546
|
+
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent), MO(e)) {
|
|
16518
16547
|
let n = e.ariaHidden || e.hidden || e.style.display === "none", r = e.dataset.radixToastAnnounceExclude === "";
|
|
16519
16548
|
if (!n) if (r) {
|
|
16520
16549
|
let n = e.dataset.radixToastAnnounceAlt;
|
|
16521
16550
|
n && t.push(n);
|
|
16522
|
-
} else t.push(...
|
|
16551
|
+
} else t.push(...OO(e));
|
|
16523
16552
|
}
|
|
16524
16553
|
}), t;
|
|
16525
16554
|
}
|
|
16526
|
-
function
|
|
16555
|
+
function kO(e, t, n, { discrete: r }) {
|
|
16527
16556
|
let i = n.originalEvent.currentTarget, a = new CustomEvent(e, {
|
|
16528
16557
|
bubbles: !0,
|
|
16529
16558
|
cancelable: !0,
|
|
@@ -16531,11 +16560,11 @@ function EO(e, t, n, { discrete: r }) {
|
|
|
16531
16560
|
});
|
|
16532
16561
|
t && i.addEventListener(e, t, { once: !0 }), r ? ze(i, a) : i.dispatchEvent(a);
|
|
16533
16562
|
}
|
|
16534
|
-
var
|
|
16563
|
+
var AO = (e, t, n = 0) => {
|
|
16535
16564
|
let r = Math.abs(e.x), i = Math.abs(e.y), a = r > i;
|
|
16536
16565
|
return t === "left" || t === "right" ? a && r > n : !a && i > n;
|
|
16537
16566
|
};
|
|
16538
|
-
function
|
|
16567
|
+
function jO(e = () => {}) {
|
|
16539
16568
|
let t = Bt(e);
|
|
16540
16569
|
G(() => {
|
|
16541
16570
|
let e = 0, n = 0;
|
|
@@ -16544,10 +16573,10 @@ function OO(e = () => {}) {
|
|
|
16544
16573
|
};
|
|
16545
16574
|
}, [t]);
|
|
16546
16575
|
}
|
|
16547
|
-
function
|
|
16576
|
+
function MO(e) {
|
|
16548
16577
|
return e.nodeType === e.ELEMENT_NODE;
|
|
16549
16578
|
}
|
|
16550
|
-
function
|
|
16579
|
+
function NO(e) {
|
|
16551
16580
|
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
|
|
16552
16581
|
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
16553
16582
|
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
@@ -16555,11 +16584,11 @@ function AO(e) {
|
|
|
16555
16584
|
for (; n.nextNode();) t.push(n.currentNode);
|
|
16556
16585
|
return t;
|
|
16557
16586
|
}
|
|
16558
|
-
function
|
|
16587
|
+
function PO(e) {
|
|
16559
16588
|
let t = document.activeElement;
|
|
16560
16589
|
return e.some((e) => e === t ? !0 : (e.focus(), document.activeElement !== t));
|
|
16561
16590
|
}
|
|
16562
|
-
var
|
|
16591
|
+
var FO = tO, IO = oO, LO = mO, RO = bO, zO = SO, BO = wO, VO = EO, HO = 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]`), UO = 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`, {
|
|
16563
16592
|
variants: { variant: {
|
|
16564
16593
|
default: "zui:border-[var(--zui-theme-border-default)]",
|
|
16565
16594
|
info: "zui:border-[var(--zui-theme-status-info)]",
|
|
@@ -16569,49 +16598,49 @@ var MO = QD, NO = rO, PO = dO, FO = _O, IO = yO, LO = xO, RO = CO, zO = q(`zui:f
|
|
|
16569
16598
|
destructive: "zui:border-[var(--zui-theme-status-danger)]"
|
|
16570
16599
|
} },
|
|
16571
16600
|
defaultVariants: { variant: "default" }
|
|
16572
|
-
}),
|
|
16601
|
+
}), WO = 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"), GO = 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)]"), KO = q("zui:text-sm zui:font-semibold zui:text-current"), qO = q("zui:text-sm zui:text-current");
|
|
16573
16602
|
//#endregion
|
|
16574
16603
|
//#region src/components/Toast/Toast.tsx
|
|
16575
|
-
function
|
|
16576
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16604
|
+
function JO(e) {
|
|
16605
|
+
return /* @__PURE__ */ (0, P.jsx)(FO, {
|
|
16577
16606
|
"data-slot": "toast-provider",
|
|
16578
16607
|
...e
|
|
16579
16608
|
});
|
|
16580
16609
|
}
|
|
16581
|
-
var
|
|
16582
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16610
|
+
var YO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16611
|
+
return /* @__PURE__ */ (0, P.jsx)(IO, {
|
|
16583
16612
|
ref: n,
|
|
16584
16613
|
"data-slot": "toast-viewport",
|
|
16585
16614
|
"data-zui-toast-viewport": "",
|
|
16586
|
-
className: D(
|
|
16615
|
+
className: D(HO(), e),
|
|
16587
16616
|
...t
|
|
16588
16617
|
});
|
|
16589
16618
|
});
|
|
16590
|
-
function
|
|
16591
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16619
|
+
function XO({ className: e, variant: t, ...n }) {
|
|
16620
|
+
return /* @__PURE__ */ (0, P.jsx)(LO, {
|
|
16592
16621
|
"data-slot": "toast",
|
|
16593
16622
|
"data-zui-toast-root": "",
|
|
16594
16623
|
dir: "rtl",
|
|
16595
|
-
className: D(
|
|
16624
|
+
className: D(UO({ variant: t }), "zui:text-right", e),
|
|
16596
16625
|
...n
|
|
16597
16626
|
});
|
|
16598
16627
|
}
|
|
16599
|
-
var
|
|
16600
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16628
|
+
var ZO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16629
|
+
return /* @__PURE__ */ (0, P.jsx)(BO, {
|
|
16601
16630
|
ref: n,
|
|
16602
16631
|
"data-slot": "toast-action",
|
|
16603
|
-
className: D(
|
|
16632
|
+
className: D(WO(), e),
|
|
16604
16633
|
...t
|
|
16605
16634
|
});
|
|
16606
|
-
}),
|
|
16635
|
+
}), QO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16607
16636
|
return /* @__PURE__ */ (0, P.jsx)(Jy, {
|
|
16608
16637
|
text: "بستن",
|
|
16609
16638
|
position: "top",
|
|
16610
|
-
trigger: /* @__PURE__ */ (0, P.jsx)(
|
|
16639
|
+
trigger: /* @__PURE__ */ (0, P.jsx)(VO, {
|
|
16611
16640
|
ref: n,
|
|
16612
16641
|
"data-slot": "toast-close",
|
|
16613
16642
|
"aria-label": "بستن",
|
|
16614
|
-
className: D(
|
|
16643
|
+
className: D(GO(), e),
|
|
16615
16644
|
...t,
|
|
16616
16645
|
children: /* @__PURE__ */ (0, P.jsx)(Mt, {
|
|
16617
16646
|
className: "zui:size-[1.92rem] zui:text-current",
|
|
@@ -16619,44 +16648,44 @@ var JO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
|
16619
16648
|
})
|
|
16620
16649
|
})
|
|
16621
16650
|
});
|
|
16622
|
-
}),
|
|
16623
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16651
|
+
}), $O = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16652
|
+
return /* @__PURE__ */ (0, P.jsx)(RO, {
|
|
16624
16653
|
ref: n,
|
|
16625
16654
|
"data-slot": "toast-title",
|
|
16626
|
-
className: D(
|
|
16655
|
+
className: D(KO(), e),
|
|
16627
16656
|
...t
|
|
16628
16657
|
});
|
|
16629
|
-
}),
|
|
16630
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16658
|
+
}), ek = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16659
|
+
return /* @__PURE__ */ (0, P.jsx)(zO, {
|
|
16631
16660
|
ref: n,
|
|
16632
16661
|
"data-slot": "toast-description",
|
|
16633
|
-
className: D(
|
|
16662
|
+
className: D(qO(), e),
|
|
16634
16663
|
...t
|
|
16635
16664
|
});
|
|
16636
|
-
}),
|
|
16637
|
-
function
|
|
16665
|
+
}), tk = 2147483647, nk = /* @__PURE__ */ new Set();
|
|
16666
|
+
function rk(e) {
|
|
16638
16667
|
return e === "succes" ? "success" : e;
|
|
16639
16668
|
}
|
|
16640
|
-
function
|
|
16641
|
-
return
|
|
16642
|
-
|
|
16669
|
+
function ik(e) {
|
|
16670
|
+
return nk.add(e), () => {
|
|
16671
|
+
nk.delete(e);
|
|
16643
16672
|
};
|
|
16644
16673
|
}
|
|
16645
|
-
function
|
|
16646
|
-
let { safeDuration: i, isPersistent: a } =
|
|
16674
|
+
function ak({ title: e, message: t, duration: n, type: r }) {
|
|
16675
|
+
let { safeDuration: i, isPersistent: a } = ok(n), o = {
|
|
16647
16676
|
title: e,
|
|
16648
16677
|
message: t,
|
|
16649
16678
|
duration: i,
|
|
16650
16679
|
isPersistent: a,
|
|
16651
|
-
type:
|
|
16680
|
+
type: rk(r)
|
|
16652
16681
|
};
|
|
16653
|
-
|
|
16682
|
+
nk.forEach((e) => {
|
|
16654
16683
|
e(o);
|
|
16655
16684
|
});
|
|
16656
16685
|
}
|
|
16657
|
-
function
|
|
16686
|
+
function ok(e) {
|
|
16658
16687
|
return e == null || !Number.isFinite(e) || e <= 0 ? {
|
|
16659
|
-
safeDuration:
|
|
16688
|
+
safeDuration: tk,
|
|
16660
16689
|
isPersistent: !0
|
|
16661
16690
|
} : {
|
|
16662
16691
|
safeDuration: e,
|
|
@@ -16665,7 +16694,7 @@ function rk(e) {
|
|
|
16665
16694
|
}
|
|
16666
16695
|
//#endregion
|
|
16667
16696
|
//#region src/components/Toast/function/toastVisual.ts
|
|
16668
|
-
var
|
|
16697
|
+
var sk = {
|
|
16669
16698
|
info: {
|
|
16670
16699
|
Icon: Tt,
|
|
16671
16700
|
iconClassName: "zui:text-[var(--zui-theme-status-info)]",
|
|
@@ -16687,23 +16716,23 @@ var ik = {
|
|
|
16687
16716
|
progressClassName: "zui:bg-[var(--zui-theme-status-danger)]"
|
|
16688
16717
|
}
|
|
16689
16718
|
};
|
|
16690
|
-
function
|
|
16691
|
-
return
|
|
16719
|
+
function ck(e) {
|
|
16720
|
+
return sk[e];
|
|
16692
16721
|
}
|
|
16693
16722
|
//#endregion
|
|
16694
16723
|
//#region src/components/Toast/ToastHost.tsx
|
|
16695
|
-
var
|
|
16696
|
-
function
|
|
16724
|
+
var lk = 5, uk = 420;
|
|
16725
|
+
function dk() {
|
|
16697
16726
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
16698
16727
|
}
|
|
16699
|
-
function
|
|
16728
|
+
function fk() {
|
|
16700
16729
|
let [e, t] = d([]), n = u(/* @__PURE__ */ new Map());
|
|
16701
|
-
s(() =>
|
|
16730
|
+
s(() => ik((e) => {
|
|
16702
16731
|
t((t) => [{
|
|
16703
|
-
id:
|
|
16732
|
+
id: dk(),
|
|
16704
16733
|
open: !0,
|
|
16705
16734
|
...e
|
|
16706
|
-
}, ...t].slice(0,
|
|
16735
|
+
}, ...t].slice(0, lk));
|
|
16707
16736
|
}), []), s(() => {
|
|
16708
16737
|
let e = n.current;
|
|
16709
16738
|
return () => {
|
|
@@ -16721,10 +16750,10 @@ function lk() {
|
|
|
16721
16750
|
} : t));
|
|
16722
16751
|
let a = window.setTimeout(() => {
|
|
16723
16752
|
n.current.delete(e), t((t) => t.filter((t) => t.id !== e));
|
|
16724
|
-
},
|
|
16753
|
+
}, uk);
|
|
16725
16754
|
n.current.set(e, a);
|
|
16726
16755
|
}, []);
|
|
16727
|
-
return /* @__PURE__ */ (0, P.jsxs)(
|
|
16756
|
+
return /* @__PURE__ */ (0, P.jsxs)(JO, { children: [e.map((e) => /* @__PURE__ */ (0, P.jsxs)(XO, {
|
|
16728
16757
|
open: e.open,
|
|
16729
16758
|
duration: e.isPersistent ? Infinity : e.duration,
|
|
16730
16759
|
variant: e.type,
|
|
@@ -16734,29 +16763,29 @@ function lk() {
|
|
|
16734
16763
|
className: "zui:flex zui:items-start zui:gap-3",
|
|
16735
16764
|
children: [/* @__PURE__ */ (0, P.jsx)("span", {
|
|
16736
16765
|
className: "zui:mt-0.5 zui:shrink-0",
|
|
16737
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16766
|
+
children: /* @__PURE__ */ (0, P.jsx)(pk, { type: e.type })
|
|
16738
16767
|
}), /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
16739
16768
|
className: "zui:grid zui:gap-1",
|
|
16740
|
-
children: [/* @__PURE__ */ (0, P.jsx)(
|
|
16769
|
+
children: [/* @__PURE__ */ (0, P.jsx)($O, { children: e.title }), /* @__PURE__ */ (0, P.jsx)(ek, { children: e.message })]
|
|
16741
16770
|
})]
|
|
16742
16771
|
}),
|
|
16743
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
16744
|
-
!e.isPersistent && /* @__PURE__ */ (0, P.jsx)(
|
|
16772
|
+
/* @__PURE__ */ (0, P.jsx)(QO, {}),
|
|
16773
|
+
!e.isPersistent && /* @__PURE__ */ (0, P.jsx)(mk, {
|
|
16745
16774
|
duration: e.duration,
|
|
16746
16775
|
type: e.type
|
|
16747
16776
|
})
|
|
16748
16777
|
]
|
|
16749
|
-
}, e.id)), /* @__PURE__ */ (0, P.jsx)(
|
|
16778
|
+
}, e.id)), /* @__PURE__ */ (0, P.jsx)(YO, {})] });
|
|
16750
16779
|
}
|
|
16751
|
-
function
|
|
16752
|
-
let { Icon: t, iconClassName: n } =
|
|
16780
|
+
function pk({ type: e }) {
|
|
16781
|
+
let { Icon: t, iconClassName: n } = ck(e);
|
|
16753
16782
|
return /* @__PURE__ */ (0, P.jsx)(t, {
|
|
16754
16783
|
className: `zui:size-5 ${n}`,
|
|
16755
16784
|
"aria-hidden": "true"
|
|
16756
16785
|
});
|
|
16757
16786
|
}
|
|
16758
|
-
function
|
|
16759
|
-
let { progressClassName: n } =
|
|
16787
|
+
function mk({ duration: e, type: t }) {
|
|
16788
|
+
let { progressClassName: n } = ck(t);
|
|
16760
16789
|
return /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16761
16790
|
className: `zui:pointer-events-none zui:absolute zui:right-0 zui:bottom-0 zui:left-0 zui:h-1 zui:origin-right ${n}`,
|
|
16762
16791
|
style: { animation: `zui-toast-progress ${e}ms linear forwards` },
|
|
@@ -16764,4 +16793,4 @@ function dk({ duration: e, type: t }) {
|
|
|
16764
16793
|
});
|
|
16765
16794
|
}
|
|
16766
16795
|
//#endregion
|
|
16767
|
-
export { ge as Button, zt as Checkbox, Bb as DatePicker, Hx as Dialog, tS as Input,
|
|
16796
|
+
export { ge as Button, zt as Checkbox, Bb as DatePicker, Hx as Dialog, tS as Input, tk 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, SD as Table, wD as TableBody, OD as TableCell, TD as TableFooter, DD as TableHead, CD as TableHeader, ED as TableRow, ID as Tabs, zD as TabsContent, LD as TabsList, RD as TabsTrigger, KD as Textarea, XO as Toast, ZO as ToastAction, QO as ToastClose, ek as ToastDescription, fk as ToastHost, JO as ToastProvider, $O as ToastTitle, YO as ToastViewport, Jy as Tooltip, T as applyTheme, w as createThemeCssVariables, Rb as formatPersianDate, zb as formatPersianDateRangeLabel, C as resolveTheme, ak as showToast, ik as subscribeToast, x as theme, S as themeCssVariables };
|