zaravand-ui 3.1.1 → 3.1.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/index.cjs +1 -1
- package/dist/index.js +309 -299
- 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 !0;
|
|
15113
|
+
let t = hD(e);
|
|
15114
|
+
return !(t.scrollHeight > t.clientHeight) || t.scrollTop > 0;
|
|
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 = r?.onPageChange, S = r?.onLoadMore, C = typeof x == "function", w = typeof S == "function", T = C, E = r != null, D = 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]), O = e.useMemo(() => {
|
|
15121
|
+
if (!T || !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
|
-
]),
|
|
15127
|
+
T
|
|
15128
|
+
]), k = e.useMemo(() => !E || O <= 0 ? 1 : Math.max(1, Math.ceil(O / D)), [
|
|
15129
|
+
E,
|
|
15110
15130
|
D,
|
|
15111
|
-
O
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
if (E && r) {
|
|
15131
|
+
O
|
|
15132
|
+
]), A = e.useMemo(() => {
|
|
15133
|
+
if (T && r) {
|
|
15115
15134
|
let e = Math.floor(r.page);
|
|
15116
|
-
return Math.min(
|
|
15135
|
+
return Math.min(k, Math.max(1, e || 1));
|
|
15117
15136
|
}
|
|
15118
|
-
return Math.min(
|
|
15137
|
+
return Math.min(k, Math.max(1, d));
|
|
15119
15138
|
}, [
|
|
15120
15139
|
d,
|
|
15121
15140
|
r,
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
]),
|
|
15125
|
-
if (!
|
|
15141
|
+
T,
|
|
15142
|
+
k
|
|
15143
|
+
]), j = e.useMemo(() => {
|
|
15144
|
+
if (!E) return n;
|
|
15126
15145
|
if (l === "infinite") {
|
|
15127
|
-
if (
|
|
15128
|
-
let e = p *
|
|
15146
|
+
if (T) return n;
|
|
15147
|
+
let e = p * D;
|
|
15129
15148
|
return n.slice(0, e);
|
|
15130
15149
|
}
|
|
15131
|
-
if (
|
|
15132
|
-
let e = (
|
|
15133
|
-
return n.slice(e, e +
|
|
15150
|
+
if (T) return n;
|
|
15151
|
+
let e = (A - 1) * D;
|
|
15152
|
+
return n.slice(e, e + D);
|
|
15134
15153
|
}, [
|
|
15135
|
-
|
|
15154
|
+
A,
|
|
15136
15155
|
n,
|
|
15137
|
-
|
|
15156
|
+
E,
|
|
15138
15157
|
p,
|
|
15139
15158
|
l,
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
]),
|
|
15159
|
+
D,
|
|
15160
|
+
T
|
|
15161
|
+
]), M = e.useMemo(() => $E(A, k), [A, k]);
|
|
15143
15162
|
e.useEffect(() => {
|
|
15144
|
-
|
|
15145
|
-
}, [
|
|
15146
|
-
|
|
15163
|
+
T || (f((e) => Math.min(k, Math.max(1, e))), m((e) => Math.min(k, Math.max(1, e))));
|
|
15164
|
+
}, [T, k]), e.useEffect(() => {
|
|
15165
|
+
T || (f(1), m(1));
|
|
15147
15166
|
}, [
|
|
15148
15167
|
o,
|
|
15149
|
-
|
|
15168
|
+
T,
|
|
15150
15169
|
s
|
|
15151
15170
|
]);
|
|
15152
|
-
let
|
|
15171
|
+
let N = A > 1, P = A < k, F = E && !t && k > 1, I = F, L = F && l === "pagination", ee = F && l === "infinite", R = ee && (T ? P : p < k), z = e.useMemo(() => {
|
|
15153
15172
|
let e = Math.floor(c ?? 20);
|
|
15154
15173
|
return e > 0 ? e : 20;
|
|
15155
|
-
}, [c]),
|
|
15174
|
+
}, [c]), B = e.useMemo(() => E && !t && l !== "infinite" && j.length > z, [
|
|
15156
15175
|
t,
|
|
15157
|
-
|
|
15176
|
+
E,
|
|
15158
15177
|
l,
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
]),
|
|
15178
|
+
z,
|
|
15179
|
+
j.length
|
|
15180
|
+
]), te = e.useMemo(() => Math.max(1, Math.min(j.length, z)), [z, j.length]), ne = e.useMemo(() => 54 + 52 * te, [te]), V = B ? { maxHeight: `${ne}px` } : void 0, re = e.useCallback(() => {
|
|
15162
15181
|
y.current = !1, g(!1), b.current = null;
|
|
15163
|
-
}, []),
|
|
15182
|
+
}, []), ie = e.useCallback(() => y.current ? !1 : (y.current = !0, g(!0), b.current = {
|
|
15164
15183
|
loading: i,
|
|
15165
|
-
currentPage:
|
|
15184
|
+
currentPage: A,
|
|
15166
15185
|
filteredRowsLength: n.length,
|
|
15167
15186
|
localLoadedPages: p,
|
|
15168
15187
|
pagingMode: l
|
|
15169
15188
|
}, !0), [
|
|
15170
|
-
|
|
15189
|
+
A,
|
|
15171
15190
|
n.length,
|
|
15172
15191
|
i,
|
|
15173
15192
|
p,
|
|
@@ -15177,141 +15196,132 @@ 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
|
+
re();
|
|
15181
15200
|
return;
|
|
15182
15201
|
}
|
|
15183
|
-
(e.loading !== i || e.currentPage !==
|
|
15202
|
+
(e.loading !== i || e.currentPage !== A || e.filteredRowsLength !== n.length || e.localLoadedPages !== p || e.pagingMode !== l) && re();
|
|
15184
15203
|
}, [
|
|
15185
|
-
|
|
15204
|
+
A,
|
|
15186
15205
|
n.length,
|
|
15187
15206
|
i,
|
|
15188
15207
|
p,
|
|
15189
15208
|
l,
|
|
15190
|
-
|
|
15209
|
+
re
|
|
15191
15210
|
]), e.useEffect(() => {
|
|
15192
|
-
l === "infinite" &&
|
|
15211
|
+
l === "infinite" && R || re();
|
|
15193
15212
|
}, [
|
|
15194
|
-
|
|
15213
|
+
R,
|
|
15195
15214
|
l,
|
|
15196
|
-
|
|
15197
|
-
])
|
|
15198
|
-
|
|
15199
|
-
let e = () => {
|
|
15200
|
-
x.current = !0;
|
|
15201
|
-
};
|
|
15202
|
-
return document.addEventListener("scroll", e, {
|
|
15203
|
-
capture: !0,
|
|
15204
|
-
passive: !0
|
|
15205
|
-
}), () => document.removeEventListener("scroll", e, !0);
|
|
15206
|
-
}, [l]);
|
|
15207
|
-
let oe = e.useCallback((e) => {
|
|
15215
|
+
re
|
|
15216
|
+
]);
|
|
15217
|
+
let ae = e.useCallback((e) => {
|
|
15208
15218
|
if (i || a) return;
|
|
15209
|
-
let t = Math.min(
|
|
15210
|
-
if (t !==
|
|
15211
|
-
if (
|
|
15212
|
-
|
|
15219
|
+
let t = Math.min(k, Math.max(1, Math.floor(e)));
|
|
15220
|
+
if (t !== A) {
|
|
15221
|
+
if (T) {
|
|
15222
|
+
x?.(t, l);
|
|
15213
15223
|
return;
|
|
15214
15224
|
}
|
|
15215
15225
|
f(t);
|
|
15216
15226
|
}
|
|
15217
15227
|
}, [
|
|
15218
|
-
|
|
15228
|
+
A,
|
|
15219
15229
|
a,
|
|
15220
15230
|
i,
|
|
15221
|
-
|
|
15231
|
+
x,
|
|
15222
15232
|
l,
|
|
15223
|
-
|
|
15224
|
-
|
|
15225
|
-
]),
|
|
15233
|
+
T,
|
|
15234
|
+
k
|
|
15235
|
+
]), oe = e.useCallback(() => {
|
|
15226
15236
|
let e = l === "pagination" ? "infinite" : "pagination";
|
|
15227
|
-
|
|
15237
|
+
T ? x?.(A, e) : l === "pagination" ? m((e) => Math.max(e, d)) : f((e) => Math.max(1, Math.min(k, Math.max(e, p)))), u(e);
|
|
15228
15238
|
}, [
|
|
15229
|
-
|
|
15239
|
+
A,
|
|
15230
15240
|
d,
|
|
15231
15241
|
p,
|
|
15232
|
-
|
|
15242
|
+
x,
|
|
15233
15243
|
l,
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
]),
|
|
15237
|
-
if (!
|
|
15238
|
-
let e =
|
|
15239
|
-
if (
|
|
15244
|
+
T,
|
|
15245
|
+
k
|
|
15246
|
+
]), se = e.useCallback(async () => {
|
|
15247
|
+
if (!R || i || a || y.current || !gD(_.current) || !ie()) return;
|
|
15248
|
+
let e = A + 1;
|
|
15249
|
+
if (T) {
|
|
15240
15250
|
try {
|
|
15241
|
-
|
|
15251
|
+
w ? await S?.(e) : x?.(e, "infinite");
|
|
15242
15252
|
} catch {
|
|
15243
|
-
|
|
15253
|
+
re();
|
|
15244
15254
|
}
|
|
15245
15255
|
return;
|
|
15246
15256
|
}
|
|
15247
|
-
m((e) => Math.min(
|
|
15257
|
+
m((e) => Math.min(k, e + 1));
|
|
15248
15258
|
}, [
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15259
|
+
R,
|
|
15260
|
+
A,
|
|
15261
|
+
w,
|
|
15252
15262
|
a,
|
|
15253
15263
|
i,
|
|
15254
|
-
ae,
|
|
15255
|
-
C,
|
|
15256
|
-
S,
|
|
15257
15264
|
ie,
|
|
15258
|
-
|
|
15259
|
-
|
|
15260
|
-
|
|
15261
|
-
|
|
15265
|
+
S,
|
|
15266
|
+
x,
|
|
15267
|
+
re,
|
|
15268
|
+
T,
|
|
15269
|
+
k
|
|
15270
|
+
]), ce = e.useCallback((e) => {
|
|
15271
|
+
if (!ee || i || a || !R || y.current) return;
|
|
15262
15272
|
let t = e.currentTarget;
|
|
15263
|
-
t.scrollHeight - t.scrollTop - t.clientHeight <= 104 &&
|
|
15273
|
+
t.scrollHeight - t.scrollTop - t.clientHeight <= 104 && se();
|
|
15264
15274
|
}, [
|
|
15265
|
-
|
|
15266
|
-
|
|
15275
|
+
R,
|
|
15276
|
+
se,
|
|
15267
15277
|
a,
|
|
15268
15278
|
i,
|
|
15269
|
-
|
|
15279
|
+
ee
|
|
15270
15280
|
]);
|
|
15271
15281
|
return e.useEffect(() => {
|
|
15272
|
-
if (!
|
|
15282
|
+
if (!R || i || a || y.current || typeof window > "u" || !("IntersectionObserver" in window)) return;
|
|
15273
15283
|
let e = v.current, t = _.current;
|
|
15274
15284
|
if (!e || !t) return;
|
|
15275
15285
|
let n = new IntersectionObserver((e) => {
|
|
15276
|
-
e.some((e) => e.isIntersecting) &&
|
|
15286
|
+
e.some((e) => e.isIntersecting) && se();
|
|
15277
15287
|
}, {
|
|
15278
15288
|
root: t,
|
|
15279
15289
|
rootMargin: TE
|
|
15280
15290
|
});
|
|
15281
15291
|
return n.observe(e), () => n.disconnect();
|
|
15282
15292
|
}, [
|
|
15283
|
-
|
|
15284
|
-
|
|
15293
|
+
R,
|
|
15294
|
+
se,
|
|
15285
15295
|
a,
|
|
15286
15296
|
i
|
|
15287
15297
|
]), {
|
|
15288
15298
|
pagingMode: l,
|
|
15289
|
-
currentPage:
|
|
15290
|
-
totalPages:
|
|
15291
|
-
resolvedPageSize:
|
|
15292
|
-
visibleRows:
|
|
15293
|
-
paginationTokens:
|
|
15294
|
-
canGoToPreviousPage:
|
|
15295
|
-
canGoToNextPage:
|
|
15296
|
-
canUsePaging:
|
|
15297
|
-
showPagingModeToggle:
|
|
15298
|
-
shouldRenderPagination:
|
|
15299
|
-
shouldRenderInfiniteMode:
|
|
15300
|
-
canLoadMoreInInfiniteMode:
|
|
15301
|
-
shouldUseRemotePaging:
|
|
15302
|
-
shouldUseScrollableRows:
|
|
15299
|
+
currentPage: A,
|
|
15300
|
+
totalPages: k,
|
|
15301
|
+
resolvedPageSize: D,
|
|
15302
|
+
visibleRows: j,
|
|
15303
|
+
paginationTokens: M,
|
|
15304
|
+
canGoToPreviousPage: N,
|
|
15305
|
+
canGoToNextPage: P,
|
|
15306
|
+
canUsePaging: F,
|
|
15307
|
+
showPagingModeToggle: I,
|
|
15308
|
+
shouldRenderPagination: L,
|
|
15309
|
+
shouldRenderInfiniteMode: ee,
|
|
15310
|
+
canLoadMoreInInfiniteMode: R,
|
|
15311
|
+
shouldUseRemotePaging: T,
|
|
15312
|
+
shouldUseScrollableRows: B,
|
|
15303
15313
|
tableScrollViewportRef: _,
|
|
15304
15314
|
infiniteScrollSentinelRef: v,
|
|
15305
|
-
tableScrollViewportStyle:
|
|
15306
|
-
handlePageChange:
|
|
15307
|
-
handlePagingModeToggle:
|
|
15308
|
-
handleTableScrollViewport:
|
|
15315
|
+
tableScrollViewportStyle: V,
|
|
15316
|
+
handlePageChange: ae,
|
|
15317
|
+
handlePagingModeToggle: oe,
|
|
15318
|
+
handleTableScrollViewport: ce,
|
|
15309
15319
|
isInfiniteRequestPending: h
|
|
15310
15320
|
};
|
|
15311
15321
|
}
|
|
15312
15322
|
//#endregion
|
|
15313
15323
|
//#region src/components/Table/hooks/useTableSearch.ts
|
|
15314
|
-
function
|
|
15324
|
+
function vD({ data: t, visibleColumns: n, showSearchInput: r, hasRemoteSearchHandler: i, onSearchChange: a, getRowId: o }) {
|
|
15315
15325
|
let [s, c] = e.useState(""), [l, u] = e.useState(""), d = s.trim().toLocaleLowerCase();
|
|
15316
15326
|
return e.useEffect(() => {
|
|
15317
15327
|
i && a?.(l);
|
|
@@ -15354,9 +15364,9 @@ function hD({ data: t, visibleColumns: n, showSearchInput: r, hasRemoteSearchHan
|
|
|
15354
15364
|
}
|
|
15355
15365
|
//#endregion
|
|
15356
15366
|
//#region src/components/Table/hooks/useTableSort.ts
|
|
15357
|
-
var
|
|
15358
|
-
function
|
|
15359
|
-
let i = r?.onSortChange, a = typeof i == "function", [o, s] = e.useState(void 0), [c, l] = e.useState(
|
|
15367
|
+
var yD = "asc";
|
|
15368
|
+
function bD({ rows: t, columns: n, sortConfig: r }) {
|
|
15369
|
+
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]);
|
|
15360
15370
|
return {
|
|
15361
15371
|
sortedRows: e.useMemo(() => {
|
|
15362
15372
|
if (!u || a) return t;
|
|
@@ -15389,7 +15399,7 @@ function _D({ rows: t, columns: n, sortConfig: r }) {
|
|
|
15389
15399
|
}
|
|
15390
15400
|
//#endregion
|
|
15391
15401
|
//#region src/components/Table/Table.tsx
|
|
15392
|
-
var
|
|
15402
|
+
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) {
|
|
15393
15403
|
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), [
|
|
15394
15404
|
F,
|
|
15395
15405
|
A,
|
|
@@ -15498,18 +15508,18 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15498
15508
|
V,
|
|
15499
15509
|
m,
|
|
15500
15510
|
l
|
|
15501
|
-
]), { searchTerm: ce, normalizedSearchTerm: le, filteredRows: ue, handleSearchInputChange: de } =
|
|
15511
|
+
]), { searchTerm: ce, normalizedSearchTerm: le, filteredRows: ue, handleSearchInputChange: de } = vD({
|
|
15502
15512
|
data: c,
|
|
15503
15513
|
visibleColumns: S,
|
|
15504
15514
|
showSearchInput: k,
|
|
15505
15515
|
hasRemoteSearchHandler: N,
|
|
15506
15516
|
onSearchChange: M,
|
|
15507
15517
|
getRowId: h
|
|
15508
|
-
}), { sortedRows: fe, activeSortKey: pe, activeSortDirection: me, handleSortToggle: he } =
|
|
15518
|
+
}), { sortedRows: fe, activeSortKey: pe, activeSortDirection: me, handleSortToggle: he } = bD({
|
|
15509
15519
|
rows: ue,
|
|
15510
15520
|
columns: s.columns,
|
|
15511
15521
|
sortConfig: s.sort
|
|
15512
|
-
}), { 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 } =
|
|
15522
|
+
}), { 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({
|
|
15513
15523
|
hasChildren: x,
|
|
15514
15524
|
filteredRows: fe,
|
|
15515
15525
|
paginationConfig: j,
|
|
@@ -15550,7 +15560,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15550
15560
|
trigger: /* @__PURE__ */ (0, P.jsx)("span", {
|
|
15551
15561
|
"data-slot": "table-paging-mode-toggle-button",
|
|
15552
15562
|
"aria-label": ze,
|
|
15553
|
-
className:
|
|
15563
|
+
className: xD,
|
|
15554
15564
|
children: /* @__PURE__ */ (0, P.jsx)(ge, {
|
|
15555
15565
|
size: "sm",
|
|
15556
15566
|
variant: "primary",
|
|
@@ -15574,7 +15584,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15574
15584
|
trigger: /* @__PURE__ */ (0, P.jsx)("span", {
|
|
15575
15585
|
"data-slot": "table-action-add-button",
|
|
15576
15586
|
"aria-label": uE,
|
|
15577
|
-
className:
|
|
15587
|
+
className: xD,
|
|
15578
15588
|
children: /* @__PURE__ */ (0, P.jsx)(ge, {
|
|
15579
15589
|
size: "sm",
|
|
15580
15590
|
variant: "primary",
|
|
@@ -15602,7 +15612,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15602
15612
|
showRowBorder: v
|
|
15603
15613
|
}), t),
|
|
15604
15614
|
dir: "rtl",
|
|
15605
|
-
children: x ? y : S.length === 0 ? /* @__PURE__ */ (0, P.jsx)(
|
|
15615
|
+
children: x ? y : S.length === 0 ? /* @__PURE__ */ (0, P.jsx)(wD, { children: /* @__PURE__ */ (0, P.jsx)(ED, { children: /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15606
15616
|
className: "zui:py-7 zui:text-center zui:text-[var(--zui-color-text)]",
|
|
15607
15617
|
children: oE
|
|
15608
15618
|
}) }) }) : /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [
|
|
@@ -15611,20 +15621,20 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15611
15621
|
S.map((e) => /* @__PURE__ */ (0, P.jsx)("col", { style: L[e.key] }, `col-${e.key}`)),
|
|
15612
15622
|
F ? /* @__PURE__ */ (0, P.jsx)("col", { style: ee }) : null
|
|
15613
15623
|
] }),
|
|
15614
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
15615
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15624
|
+
/* @__PURE__ */ (0, P.jsx)(CD, { children: /* @__PURE__ */ (0, P.jsxs)(ED, { children: [
|
|
15625
|
+
A ? /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15616
15626
|
align: "center",
|
|
15617
15627
|
className: D(_E, je ? wE : void 0),
|
|
15618
15628
|
children: lE
|
|
15619
15629
|
}) : null,
|
|
15620
15630
|
S.map((e) => {
|
|
15621
|
-
if (!e.sortable) return /* @__PURE__ */ (0, P.jsx)(
|
|
15631
|
+
if (!e.sortable) return /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15622
15632
|
align: e.align,
|
|
15623
15633
|
className: je ? wE : void 0,
|
|
15624
15634
|
children: Bv({ value: e.label })
|
|
15625
15635
|
}, `head-${e.key}`);
|
|
15626
15636
|
let t = pe === e.key, n = t && me === "asc" ? jE : ME, r = `${NE} ${e.label} (${n})`;
|
|
15627
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15637
|
+
return /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15628
15638
|
align: e.align,
|
|
15629
15639
|
className: je ? wE : void 0,
|
|
15630
15640
|
ariaSort: t ? me === "asc" ? "ascending" : "descending" : "none",
|
|
@@ -15648,25 +15658,25 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15648
15658
|
})
|
|
15649
15659
|
}, `head-${e.key}`);
|
|
15650
15660
|
}),
|
|
15651
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15661
|
+
F ? /* @__PURE__ */ (0, P.jsx)(DD, {
|
|
15652
15662
|
align: "center",
|
|
15653
15663
|
className: D(gE, je ? wE : void 0),
|
|
15654
15664
|
children: cE
|
|
15655
15665
|
}) : null
|
|
15656
15666
|
] }) }),
|
|
15657
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
15667
|
+
/* @__PURE__ */ (0, P.jsx)(wD, { children: Ne ? Array.from({ length: Me }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(ED, {
|
|
15658
15668
|
slot: "table-loading-row",
|
|
15659
15669
|
children: [
|
|
15660
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15670
|
+
A ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15661
15671
|
align: "center",
|
|
15662
15672
|
className: _E,
|
|
15663
15673
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: "zui:mx-auto zui:h-4 zui:w-8" })
|
|
15664
15674
|
}) : null,
|
|
15665
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)(
|
|
15675
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15666
15676
|
align: e.align,
|
|
15667
15677
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: D("zui:max-w-full", QE(e, t)) })
|
|
15668
15678
|
}, `loading-cell-${e.key}-${t}`)),
|
|
15669
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15679
|
+
F ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15670
15680
|
align: "center",
|
|
15671
15681
|
className: gE,
|
|
15672
15682
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -15686,8 +15696,8 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15686
15696
|
normalizedSearchTerm: le
|
|
15687
15697
|
}) : /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [U.map(({ row: e, rowIndex: t, rowId: n }, r) => {
|
|
15688
15698
|
let i = n === void 0 ? `row-${t}` : `row-id-${String(n)}`, a = W ? (ve - 1) * ye + r + 1 : r + 1;
|
|
15689
|
-
return /* @__PURE__ */ (0, P.jsxs)(
|
|
15690
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15699
|
+
return /* @__PURE__ */ (0, P.jsxs)(ED, { children: [
|
|
15700
|
+
A ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15691
15701
|
align: "center",
|
|
15692
15702
|
className: _E,
|
|
15693
15703
|
children: Bv({ value: String(a) })
|
|
@@ -15696,7 +15706,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15696
15706
|
let a = `cell-${r.key}-${i}`;
|
|
15697
15707
|
if (r.viewType === "select") {
|
|
15698
15708
|
let i = R[r.key] ?? [], o = e[r.key], s = typeof o == "string" || typeof o == "number" ? String(o) : "";
|
|
15699
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15709
|
+
return /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15700
15710
|
align: r.align,
|
|
15701
15711
|
children: /* @__PURE__ */ (0, P.jsx)(LT, {
|
|
15702
15712
|
size: "sm",
|
|
@@ -15712,12 +15722,12 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15712
15722
|
})
|
|
15713
15723
|
}, a);
|
|
15714
15724
|
}
|
|
15715
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15725
|
+
return /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15716
15726
|
align: r.align,
|
|
15717
15727
|
children: cD(e[r.key], r)
|
|
15718
15728
|
}, a);
|
|
15719
15729
|
}),
|
|
15720
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15730
|
+
F ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15721
15731
|
align: "center",
|
|
15722
15732
|
className: gE,
|
|
15723
15733
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -15776,19 +15786,19 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15776
15786
|
})
|
|
15777
15787
|
}) : null
|
|
15778
15788
|
] }, i);
|
|
15779
|
-
}), Pe ? Array.from({ length: K }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(
|
|
15789
|
+
}), Pe ? Array.from({ length: K }, (e, t) => /* @__PURE__ */ (0, P.jsxs)(ED, {
|
|
15780
15790
|
slot: "table-loading-row",
|
|
15781
15791
|
children: [
|
|
15782
|
-
A ? /* @__PURE__ */ (0, P.jsx)(
|
|
15792
|
+
A ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15783
15793
|
align: "center",
|
|
15784
15794
|
className: _E,
|
|
15785
15795
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: "zui:mx-auto zui:h-4 zui:w-8" })
|
|
15786
15796
|
}) : null,
|
|
15787
|
-
S.map((e) => /* @__PURE__ */ (0, P.jsx)(
|
|
15797
|
+
S.map((e) => /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15788
15798
|
align: e.align,
|
|
15789
15799
|
children: /* @__PURE__ */ (0, P.jsx)(uT, { className: D("zui:max-w-full", QE(e, t)) })
|
|
15790
15800
|
}, `infinite-loading-cell-${e.key}-${t}`)),
|
|
15791
|
-
F ? /* @__PURE__ */ (0, P.jsx)(
|
|
15801
|
+
F ? /* @__PURE__ */ (0, P.jsx)(OD, {
|
|
15792
15802
|
align: "center",
|
|
15793
15803
|
className: gE,
|
|
15794
15804
|
children: /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -15825,28 +15835,28 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15825
15835
|
})
|
|
15826
15836
|
]
|
|
15827
15837
|
});
|
|
15828
|
-
}),
|
|
15838
|
+
}), CD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15829
15839
|
return /* @__PURE__ */ (0, P.jsx)("thead", {
|
|
15830
15840
|
ref: n,
|
|
15831
15841
|
"data-slot": "table-header",
|
|
15832
15842
|
className: D(LE(), e),
|
|
15833
15843
|
children: t
|
|
15834
15844
|
});
|
|
15835
|
-
}),
|
|
15845
|
+
}), wD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15836
15846
|
return /* @__PURE__ */ (0, P.jsx)("tbody", {
|
|
15837
15847
|
ref: n,
|
|
15838
15848
|
"data-slot": "table-body",
|
|
15839
15849
|
className: D(RE(), e),
|
|
15840
15850
|
children: t
|
|
15841
15851
|
});
|
|
15842
|
-
}),
|
|
15852
|
+
}), TD = e.forwardRef(function({ className: e, children: t }, n) {
|
|
15843
15853
|
return /* @__PURE__ */ (0, P.jsx)("tfoot", {
|
|
15844
15854
|
ref: n,
|
|
15845
15855
|
"data-slot": "table-footer",
|
|
15846
15856
|
className: D(zE(), e),
|
|
15847
15857
|
children: t
|
|
15848
15858
|
});
|
|
15849
|
-
}),
|
|
15859
|
+
}), ED = e.forwardRef(function({ className: e, children: t, state: n, slot: r = "table-row" }, i) {
|
|
15850
15860
|
return /* @__PURE__ */ (0, P.jsx)("tr", {
|
|
15851
15861
|
ref: i,
|
|
15852
15862
|
"data-slot": r,
|
|
@@ -15854,7 +15864,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15854
15864
|
className: D(BE(), e),
|
|
15855
15865
|
children: t
|
|
15856
15866
|
});
|
|
15857
|
-
}),
|
|
15867
|
+
}), DD = e.forwardRef(function({ className: e, children: t, align: n, ariaSort: r }, i) {
|
|
15858
15868
|
return /* @__PURE__ */ (0, P.jsx)("th", {
|
|
15859
15869
|
ref: i,
|
|
15860
15870
|
"data-slot": "table-head",
|
|
@@ -15862,7 +15872,7 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15862
15872
|
className: D(HE({ align: n }), e),
|
|
15863
15873
|
children: t
|
|
15864
15874
|
});
|
|
15865
|
-
}),
|
|
15875
|
+
}), OD = e.forwardRef(function({ className: e, children: t, align: n }, r) {
|
|
15866
15876
|
return /* @__PURE__ */ (0, P.jsx)("td", {
|
|
15867
15877
|
ref: r,
|
|
15868
15878
|
"data-slot": "table-cell",
|
|
@@ -15870,16 +15880,16 @@ var vD = `zui:inline-flex zui:shrink-0 ${ue} zui:[&>button]:!rounded-md zui:[&>b
|
|
|
15870
15880
|
children: t
|
|
15871
15881
|
});
|
|
15872
15882
|
});
|
|
15873
|
-
|
|
15883
|
+
SD.displayName = "Table", CD.displayName = "TableHeader", wD.displayName = "TableBody", TD.displayName = "TableFooter", ED.displayName = "TableRow", DD.displayName = "TableHead", OD.displayName = "TableCell";
|
|
15874
15884
|
//#endregion
|
|
15875
15885
|
//#region src/components/Tabs/Tabs.variant.ts
|
|
15876
|
-
var
|
|
15886
|
+
var kD = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
15877
15887
|
variants: { orientation: {
|
|
15878
15888
|
horizontal: "",
|
|
15879
15889
|
vertical: "zui:flex-row zui:items-start"
|
|
15880
15890
|
} },
|
|
15881
15891
|
defaultVariants: { orientation: "horizontal" }
|
|
15882
|
-
}),
|
|
15892
|
+
}), 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", {
|
|
15883
15893
|
variants: {
|
|
15884
15894
|
orientation: {
|
|
15885
15895
|
horizontal: "zui:w-full zui:flex-row",
|
|
@@ -15918,7 +15928,7 @@ var ED = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15918
15928
|
size: "default",
|
|
15919
15929
|
type: "primary"
|
|
15920
15930
|
}
|
|
15921
|
-
}),
|
|
15931
|
+
}), 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", {
|
|
15922
15932
|
variants: {
|
|
15923
15933
|
ready: {
|
|
15924
15934
|
true: "",
|
|
@@ -15934,7 +15944,7 @@ var ED = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15934
15944
|
ready: !1,
|
|
15935
15945
|
type: "primary"
|
|
15936
15946
|
}
|
|
15937
|
-
}),
|
|
15947
|
+
}), 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", {
|
|
15938
15948
|
variants: {
|
|
15939
15949
|
size: {
|
|
15940
15950
|
sm: "zui:text-xs",
|
|
@@ -15951,13 +15961,13 @@ var ED = q("zui:flex zui:w-full zui:flex-col zui:gap-2", {
|
|
|
15951
15961
|
size: "default",
|
|
15952
15962
|
type: "primary"
|
|
15953
15963
|
}
|
|
15954
|
-
}),
|
|
15955
|
-
function
|
|
15956
|
-
let n = e.useContext(
|
|
15964
|
+
}), 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);
|
|
15965
|
+
function FD(t) {
|
|
15966
|
+
let n = e.useContext(PD);
|
|
15957
15967
|
if (!n) throw Error(`${t} must be used within a <Tabs> component`);
|
|
15958
15968
|
return n;
|
|
15959
15969
|
}
|
|
15960
|
-
var
|
|
15970
|
+
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) {
|
|
15961
15971
|
let [d, f] = e.useState(n), [p, m] = e.useState("default"), h = t !== void 0, g = h ? t : d, _ = e.useCallback((e) => {
|
|
15962
15972
|
h || f(e), r?.(e);
|
|
15963
15973
|
}, [h, r]), v = e.useMemo(() => ({
|
|
@@ -15976,22 +15986,22 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
15976
15986
|
o,
|
|
15977
15987
|
p
|
|
15978
15988
|
]);
|
|
15979
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
15989
|
+
return /* @__PURE__ */ (0, P.jsx)(PD.Provider, {
|
|
15980
15990
|
value: v,
|
|
15981
15991
|
children: /* @__PURE__ */ (0, P.jsx)("div", {
|
|
15982
15992
|
ref: u,
|
|
15983
15993
|
id: s,
|
|
15984
15994
|
dir: a,
|
|
15985
15995
|
"data-slot": "tabs",
|
|
15986
|
-
className: D(
|
|
15996
|
+
className: D(kD({
|
|
15987
15997
|
orientation: i,
|
|
15988
15998
|
className: c
|
|
15989
15999
|
})),
|
|
15990
16000
|
children: l
|
|
15991
16001
|
})
|
|
15992
16002
|
});
|
|
15993
|
-
}),
|
|
15994
|
-
let { orientation: o, dir: s, type: c, value: l, setValue: u, setSize: d } =
|
|
16003
|
+
}), LD = e.forwardRef(function({ size: t = "default", "aria-label": n, className: r, children: i }, a) {
|
|
16004
|
+
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);
|
|
15995
16005
|
e.useImperativeHandle(a, () => f.current), e.useEffect(() => {
|
|
15996
16006
|
d(t ?? "default");
|
|
15997
16007
|
}, [t, d]);
|
|
@@ -16039,7 +16049,7 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16039
16049
|
o,
|
|
16040
16050
|
u
|
|
16041
16051
|
]),
|
|
16042
|
-
className: D(
|
|
16052
|
+
className: D(AD({
|
|
16043
16053
|
orientation: o,
|
|
16044
16054
|
size: t,
|
|
16045
16055
|
type: c,
|
|
@@ -16048,15 +16058,15 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16048
16058
|
children: [/* @__PURE__ */ (0, P.jsx)("span", {
|
|
16049
16059
|
"aria-hidden": "true",
|
|
16050
16060
|
"data-slot": "tabs-indicator",
|
|
16051
|
-
className: D(
|
|
16061
|
+
className: D(jD({
|
|
16052
16062
|
ready: h,
|
|
16053
16063
|
type: c
|
|
16054
16064
|
})),
|
|
16055
16065
|
style: p
|
|
16056
16066
|
}), i]
|
|
16057
16067
|
});
|
|
16058
|
-
}),
|
|
16059
|
-
let { value: c, setValue: l, size: u, type: d } =
|
|
16068
|
+
}), RD = e.forwardRef(function({ value: t, size: n, disabled: r = !1, icon: i, className: a, children: o }, s) {
|
|
16069
|
+
let { value: c, setValue: l, size: u, type: d } = FD("TabsTrigger"), f = c === t, p = e.useRef(null);
|
|
16060
16070
|
return e.useImperativeHandle(s, () => p.current), /* @__PURE__ */ (0, P.jsxs)("button", {
|
|
16061
16071
|
ref: p,
|
|
16062
16072
|
type: "button",
|
|
@@ -16072,7 +16082,7 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16072
16082
|
onClick: () => {
|
|
16073
16083
|
r || l(t);
|
|
16074
16084
|
},
|
|
16075
|
-
className: D(
|
|
16085
|
+
className: D(MD({
|
|
16076
16086
|
size: n ?? u,
|
|
16077
16087
|
type: d,
|
|
16078
16088
|
className: a
|
|
@@ -16082,8 +16092,8 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16082
16092
|
children: i
|
|
16083
16093
|
}) : null, o]
|
|
16084
16094
|
});
|
|
16085
|
-
}),
|
|
16086
|
-
let { value: a } =
|
|
16095
|
+
}), zD = e.forwardRef(function({ value: e, forceMount: t = !1, className: n, children: r }, i) {
|
|
16096
|
+
let { value: a } = FD("TabsContent"), o = a === e;
|
|
16087
16097
|
return !o && !t ? null : /* @__PURE__ */ (0, P.jsx)("div", {
|
|
16088
16098
|
ref: i,
|
|
16089
16099
|
role: "tabpanel",
|
|
@@ -16092,10 +16102,10 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16092
16102
|
tabIndex: 0,
|
|
16093
16103
|
"data-slot": "tabs-content",
|
|
16094
16104
|
"data-state": o ? "active" : "inactive",
|
|
16095
|
-
className: D(
|
|
16105
|
+
className: D(ND(), n),
|
|
16096
16106
|
children: r
|
|
16097
16107
|
});
|
|
16098
|
-
}),
|
|
16108
|
+
}), 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(" "), {
|
|
16099
16109
|
variants: { resize: {
|
|
16100
16110
|
none: "zui:resize-none",
|
|
16101
16111
|
y: "zui:resize-y",
|
|
@@ -16105,39 +16115,39 @@ var ND = e.forwardRef(function({ value: t, defaultValue: n, onValueChange: r, or
|
|
|
16105
16115
|
});
|
|
16106
16116
|
//#endregion
|
|
16107
16117
|
//#region src/components/Textarea/Textarea.tsx
|
|
16108
|
-
function
|
|
16118
|
+
function VD(e) {
|
|
16109
16119
|
return e == null ? !1 : typeof e == "string" ? e.length > 0 : typeof e == "number" ? !0 : Array.isArray(e) ? e.length > 0 : !1;
|
|
16110
16120
|
}
|
|
16111
|
-
function
|
|
16121
|
+
function HD(e) {
|
|
16112
16122
|
return e == null ? "" : Array.isArray(e) ? e.join(", ") : String(e);
|
|
16113
16123
|
}
|
|
16114
|
-
function
|
|
16115
|
-
return Hv({ value:
|
|
16124
|
+
function UD(e) {
|
|
16125
|
+
return Hv({ value: HD(e) });
|
|
16116
16126
|
}
|
|
16117
|
-
function
|
|
16127
|
+
function WD(e) {
|
|
16118
16128
|
return Bv({ value: e });
|
|
16119
16129
|
}
|
|
16120
|
-
var
|
|
16121
|
-
function
|
|
16122
|
-
let x = e.useId(), S = d ?? x, C = i, w = e.useRef(null), [T, E] = e.useState(!1), [O, k] = e.useState(() =>
|
|
16130
|
+
var GD = "این فیلد اجباری است";
|
|
16131
|
+
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 }) {
|
|
16132
|
+
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));
|
|
16123
16133
|
e.useEffect(() => {
|
|
16124
|
-
M && (k(
|
|
16134
|
+
M && (k(VD(y)), j(UD(y)));
|
|
16125
16135
|
}, [M, y]), e.useEffect(() => {
|
|
16126
16136
|
if (M) return;
|
|
16127
16137
|
let e = w.current;
|
|
16128
16138
|
if (!e) return;
|
|
16129
|
-
let t =
|
|
16139
|
+
let t = WD(A);
|
|
16130
16140
|
e.value !== t && (e.value = t);
|
|
16131
16141
|
}, [M, A]);
|
|
16132
16142
|
let I = e.useCallback((e) => {
|
|
16133
16143
|
let t = e.target, n = t.selectionStart, r = t.selectionEnd, i = Hv({ value: t.value });
|
|
16134
|
-
t.value = i, n !== null && t.setSelectionRange(n, r ?? n), M || (k(
|
|
16144
|
+
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);
|
|
16135
16145
|
}, [
|
|
16136
16146
|
M,
|
|
16137
16147
|
T,
|
|
16138
16148
|
s
|
|
16139
16149
|
]), L = e.useCallback((e) => {
|
|
16140
|
-
k(
|
|
16150
|
+
k(VD(e.target.value)), c?.(e);
|
|
16141
16151
|
}, [c]), ee = e.useCallback((e) => {
|
|
16142
16152
|
E(!0), u?.(e);
|
|
16143
16153
|
}, [u]);
|
|
@@ -16156,7 +16166,7 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16156
16166
|
}) : null,
|
|
16157
16167
|
C && a ? /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16158
16168
|
className: "zui:mr-1 zui:text-xs zui:font-normal zui:text-[var(--zui-theme-status-danger)]",
|
|
16159
|
-
children:
|
|
16169
|
+
children: GD
|
|
16160
16170
|
}) : null
|
|
16161
16171
|
]
|
|
16162
16172
|
}) : C && a ? /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
@@ -16166,7 +16176,7 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16166
16176
|
children: "*"
|
|
16167
16177
|
}), /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16168
16178
|
className: "zui:text-xs zui:text-[var(--zui-theme-status-danger)]",
|
|
16169
|
-
children:
|
|
16179
|
+
children: GD
|
|
16170
16180
|
})]
|
|
16171
16181
|
}) : null, /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
16172
16182
|
className: "zui:relative",
|
|
@@ -16195,7 +16205,7 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16195
16205
|
onInvalid: ee,
|
|
16196
16206
|
value: N,
|
|
16197
16207
|
defaultValue: F,
|
|
16198
|
-
className: D(
|
|
16208
|
+
className: D(BD({
|
|
16199
16209
|
resize: n,
|
|
16200
16210
|
className: t
|
|
16201
16211
|
}), "zui:text-right")
|
|
@@ -16205,11 +16215,11 @@ function UD({ className: t, resize: n = "none", title: r, required: i = !1, show
|
|
|
16205
16215
|
}
|
|
16206
16216
|
//#endregion
|
|
16207
16217
|
//#region node_modules/@radix-ui/react-toast/dist/index.mjs
|
|
16208
|
-
var
|
|
16218
|
+
var qD = "ToastProvider", [JD, YD, XD] = vS("Toast"), [ZD, QD] = U("Toast", [XD]), [$D, eO] = ZD(qD), tO = (t) => {
|
|
16209
16219
|
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);
|
|
16210
|
-
return r.trim() || console.error(`Invalid prop \`label\` supplied to \`${
|
|
16220
|
+
return r.trim() || console.error(`Invalid prop \`label\` supplied to \`${qD}\`. Expected non-empty \`string\`.`), /* @__PURE__ */ (0, P.jsx)(JD.Provider, {
|
|
16211
16221
|
scope: n,
|
|
16212
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16222
|
+
children: /* @__PURE__ */ (0, P.jsx)($D, {
|
|
16213
16223
|
scope: n,
|
|
16214
16224
|
label: r,
|
|
16215
16225
|
duration: i,
|
|
@@ -16226,9 +16236,9 @@ var WD = "ToastProvider", [GD, KD, qD] = vS("Toast"), [JD, YD] = U("Toast", [qD]
|
|
|
16226
16236
|
})
|
|
16227
16237
|
});
|
|
16228
16238
|
};
|
|
16229
|
-
|
|
16230
|
-
var
|
|
16231
|
-
let { __scopeToast: r, hotkey: i =
|
|
16239
|
+
tO.displayName = qD;
|
|
16240
|
+
var nO = "ToastViewport", rO = ["F8"], iO = "toast.viewportPause", aO = "toast.viewportResume", oO = e.forwardRef((t, n) => {
|
|
16241
|
+
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;
|
|
16232
16242
|
e.useEffect(() => {
|
|
16233
16243
|
let e = (e) => {
|
|
16234
16244
|
i.length !== 0 && i.every((t) => e[t] || e.code === t) && f.current?.focus();
|
|
@@ -16239,12 +16249,12 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16239
16249
|
if (h && e && t) {
|
|
16240
16250
|
let n = () => {
|
|
16241
16251
|
if (!s.isClosePausedRef.current) {
|
|
16242
|
-
let e = new CustomEvent(
|
|
16252
|
+
let e = new CustomEvent(iO);
|
|
16243
16253
|
t.dispatchEvent(e), s.isClosePausedRef.current = !0;
|
|
16244
16254
|
}
|
|
16245
16255
|
}, r = () => {
|
|
16246
16256
|
if (s.isClosePausedRef.current) {
|
|
16247
|
-
let e = new CustomEvent(
|
|
16257
|
+
let e = new CustomEvent(aO);
|
|
16248
16258
|
t.dispatchEvent(e), s.isClosePausedRef.current = !1;
|
|
16249
16259
|
}
|
|
16250
16260
|
}, i = (t) => {
|
|
@@ -16259,7 +16269,7 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16259
16269
|
}, [h, s.isClosePausedRef]);
|
|
16260
16270
|
let g = e.useCallback(({ tabbingDirection: e }) => {
|
|
16261
16271
|
let t = c().map((t) => {
|
|
16262
|
-
let n = t.ref.current, r = [n, ...
|
|
16272
|
+
let n = t.ref.current, r = [n, ...NO(n)];
|
|
16263
16273
|
return e === "forwards" ? r : r.reverse();
|
|
16264
16274
|
});
|
|
16265
16275
|
return (e === "forwards" ? t.reverse() : t).flat();
|
|
@@ -16276,7 +16286,7 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16276
16286
|
return;
|
|
16277
16287
|
}
|
|
16278
16288
|
let i = g({ tabbingDirection: r ? "backwards" : "forwards" }), a = i.findIndex((e) => e === n);
|
|
16279
|
-
|
|
16289
|
+
PO(i.slice(a + 1)) ? t.preventDefault() : r ? u.current?.focus() : d.current?.focus();
|
|
16280
16290
|
}
|
|
16281
16291
|
};
|
|
16282
16292
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
@@ -16288,13 +16298,13 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16288
16298
|
tabIndex: -1,
|
|
16289
16299
|
style: { pointerEvents: h ? void 0 : "none" },
|
|
16290
16300
|
children: [
|
|
16291
|
-
h && /* @__PURE__ */ (0, P.jsx)(
|
|
16301
|
+
h && /* @__PURE__ */ (0, P.jsx)(cO, {
|
|
16292
16302
|
ref: u,
|
|
16293
16303
|
onFocusFromOutsideViewport: () => {
|
|
16294
|
-
|
|
16304
|
+
PO(g({ tabbingDirection: "forwards" }));
|
|
16295
16305
|
}
|
|
16296
16306
|
}),
|
|
16297
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
16307
|
+
/* @__PURE__ */ (0, P.jsx)(JD.Slot, {
|
|
16298
16308
|
scope: r,
|
|
16299
16309
|
children: /* @__PURE__ */ (0, P.jsx)(K.ol, {
|
|
16300
16310
|
tabIndex: -1,
|
|
@@ -16302,18 +16312,18 @@ var $D = "ToastViewport", eO = ["F8"], tO = "toast.viewportPause", nO = "toast.v
|
|
|
16302
16312
|
ref: p
|
|
16303
16313
|
})
|
|
16304
16314
|
}),
|
|
16305
|
-
h && /* @__PURE__ */ (0, P.jsx)(
|
|
16315
|
+
h && /* @__PURE__ */ (0, P.jsx)(cO, {
|
|
16306
16316
|
ref: d,
|
|
16307
16317
|
onFocusFromOutsideViewport: () => {
|
|
16308
|
-
|
|
16318
|
+
PO(g({ tabbingDirection: "backwards" }));
|
|
16309
16319
|
}
|
|
16310
16320
|
})
|
|
16311
16321
|
]
|
|
16312
16322
|
});
|
|
16313
16323
|
});
|
|
16314
|
-
|
|
16315
|
-
var
|
|
16316
|
-
let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a =
|
|
16324
|
+
oO.displayName = nO;
|
|
16325
|
+
var sO = "ToastFocusProxy", cO = e.forwardRef((e, t) => {
|
|
16326
|
+
let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a = eO(sO, n);
|
|
16317
16327
|
return /* @__PURE__ */ (0, P.jsx)(oy, {
|
|
16318
16328
|
tabIndex: 0,
|
|
16319
16329
|
...i,
|
|
@@ -16325,17 +16335,17 @@ var iO = "ToastFocusProxy", aO = e.forwardRef((e, t) => {
|
|
|
16325
16335
|
}
|
|
16326
16336
|
});
|
|
16327
16337
|
});
|
|
16328
|
-
|
|
16329
|
-
var
|
|
16338
|
+
cO.displayName = sO;
|
|
16339
|
+
var lO = "Toast", uO = "toast.swipeStart", dO = "toast.swipeMove", fO = "toast.swipeCancel", pO = "toast.swipeEnd", mO = e.forwardRef((e, t) => {
|
|
16330
16340
|
let { forceMount: n, open: r, defaultOpen: i, onOpenChange: a, ...o } = e, [s, c] = Se({
|
|
16331
16341
|
prop: r,
|
|
16332
16342
|
defaultProp: i ?? !0,
|
|
16333
16343
|
onChange: a,
|
|
16334
|
-
caller:
|
|
16344
|
+
caller: lO
|
|
16335
16345
|
});
|
|
16336
16346
|
return /* @__PURE__ */ (0, P.jsx)(Oe, {
|
|
16337
16347
|
present: n || s,
|
|
16338
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16348
|
+
children: /* @__PURE__ */ (0, P.jsx)(_O, {
|
|
16339
16349
|
open: s,
|
|
16340
16350
|
...o,
|
|
16341
16351
|
ref: t,
|
|
@@ -16359,9 +16369,9 @@ var oO = "Toast", sO = "toast.swipeStart", cO = "toast.swipeMove", lO = "toast.s
|
|
|
16359
16369
|
})
|
|
16360
16370
|
});
|
|
16361
16371
|
});
|
|
16362
|
-
|
|
16363
|
-
var [
|
|
16364
|
-
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, _ =
|
|
16372
|
+
mO.displayName = lO;
|
|
16373
|
+
var [hO, gO] = ZD(lO, { onClose() {} }), _O = e.forwardRef((t, n) => {
|
|
16374
|
+
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(() => {
|
|
16365
16375
|
v?.contains(document.activeElement) && _.viewport?.focus(), s();
|
|
16366
16376
|
}), A = e.useCallback((e) => {
|
|
16367
16377
|
!e || e === Infinity || (window.clearTimeout(E.current), w.current = (/* @__PURE__ */ new Date()).getTime(), E.current = window.setTimeout(k, e));
|
|
@@ -16375,8 +16385,8 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16375
16385
|
let e = (/* @__PURE__ */ new Date()).getTime() - w.current;
|
|
16376
16386
|
T.current -= e, window.clearTimeout(E.current), l?.();
|
|
16377
16387
|
};
|
|
16378
|
-
return e.addEventListener(
|
|
16379
|
-
e.removeEventListener(
|
|
16388
|
+
return e.addEventListener(iO, n), e.addEventListener(aO, t), () => {
|
|
16389
|
+
e.removeEventListener(iO, n), e.removeEventListener(aO, t);
|
|
16380
16390
|
};
|
|
16381
16391
|
}
|
|
16382
16392
|
}, [
|
|
@@ -16393,16 +16403,16 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16393
16403
|
_.isClosePausedRef,
|
|
16394
16404
|
A
|
|
16395
16405
|
]), e.useEffect(() => (D(), () => O()), [D, O]);
|
|
16396
|
-
let j = e.useMemo(() => v ?
|
|
16397
|
-
return _.viewport ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [j && /* @__PURE__ */ (0, P.jsx)(
|
|
16406
|
+
let j = e.useMemo(() => v ? OO(v) : null, [v]);
|
|
16407
|
+
return _.viewport ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [j && /* @__PURE__ */ (0, P.jsx)(vO, {
|
|
16398
16408
|
__scopeToast: r,
|
|
16399
16409
|
role: "status",
|
|
16400
16410
|
"aria-live": i === "foreground" ? "assertive" : "polite",
|
|
16401
16411
|
children: j
|
|
16402
|
-
}), /* @__PURE__ */ (0, P.jsx)(
|
|
16412
|
+
}), /* @__PURE__ */ (0, P.jsx)(hO, {
|
|
16403
16413
|
scope: r,
|
|
16404
16414
|
onClose: k,
|
|
16405
|
-
children: f.createPortal(/* @__PURE__ */ (0, P.jsx)(
|
|
16415
|
+
children: f.createPortal(/* @__PURE__ */ (0, P.jsx)(JD.ItemSlot, {
|
|
16406
16416
|
scope: r,
|
|
16407
16417
|
children: /* @__PURE__ */ (0, P.jsx)(tn, {
|
|
16408
16418
|
asChild: !0,
|
|
@@ -16438,7 +16448,7 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16438
16448
|
originalEvent: e,
|
|
16439
16449
|
delta: l
|
|
16440
16450
|
};
|
|
16441
|
-
r ? (S.current = l,
|
|
16451
|
+
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);
|
|
16442
16452
|
}),
|
|
16443
16453
|
onPointerUp: W(t.onPointerUp, (e) => {
|
|
16444
16454
|
let t = S.current, n = e.target;
|
|
@@ -16447,16 +16457,16 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16447
16457
|
originalEvent: e,
|
|
16448
16458
|
delta: t
|
|
16449
16459
|
};
|
|
16450
|
-
|
|
16460
|
+
AO(t, _.swipeDirection, _.swipeThreshold) ? kO(pO, h, r, { discrete: !0 }) : kO(fO, m, r, { discrete: !0 }), n.addEventListener("click", (e) => e.preventDefault(), { once: !0 });
|
|
16451
16461
|
}
|
|
16452
16462
|
})
|
|
16453
16463
|
})
|
|
16454
16464
|
})
|
|
16455
16465
|
}), _.viewport)
|
|
16456
16466
|
})] }) : null;
|
|
16457
|
-
}),
|
|
16458
|
-
let { __scopeToast: n, children: r, ...i } = t, a =
|
|
16459
|
-
return
|
|
16467
|
+
}), vO = (t) => {
|
|
16468
|
+
let { __scopeToast: n, children: r, ...i } = t, a = eO(lO, n), [o, s] = e.useState(!1), [c, l] = e.useState(!1);
|
|
16469
|
+
return jO(() => s(!0)), e.useEffect(() => {
|
|
16460
16470
|
let e = window.setTimeout(() => l(!0), 1e3);
|
|
16461
16471
|
return () => window.clearTimeout(e);
|
|
16462
16472
|
}, []), c ? null : /* @__PURE__ */ (0, P.jsx)(ua, {
|
|
@@ -16470,37 +16480,37 @@ var [fO, pO] = JD(oO, { onClose() {} }), mO = e.forwardRef((t, n) => {
|
|
|
16470
16480
|
] })
|
|
16471
16481
|
})
|
|
16472
16482
|
});
|
|
16473
|
-
},
|
|
16483
|
+
}, yO = "ToastTitle", bO = e.forwardRef((e, t) => {
|
|
16474
16484
|
let { __scopeToast: n, ...r } = e;
|
|
16475
16485
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16476
16486
|
...r,
|
|
16477
16487
|
ref: t
|
|
16478
16488
|
});
|
|
16479
16489
|
});
|
|
16480
|
-
|
|
16481
|
-
var
|
|
16490
|
+
bO.displayName = yO;
|
|
16491
|
+
var xO = "ToastDescription", SO = e.forwardRef((e, t) => {
|
|
16482
16492
|
let { __scopeToast: n, ...r } = e;
|
|
16483
16493
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16484
16494
|
...r,
|
|
16485
16495
|
ref: t
|
|
16486
16496
|
});
|
|
16487
16497
|
});
|
|
16488
|
-
|
|
16489
|
-
var
|
|
16498
|
+
SO.displayName = xO;
|
|
16499
|
+
var CO = "ToastAction", wO = e.forwardRef((e, t) => {
|
|
16490
16500
|
let { altText: n, ...r } = e;
|
|
16491
|
-
return n.trim() ? /* @__PURE__ */ (0, P.jsx)(
|
|
16501
|
+
return n.trim() ? /* @__PURE__ */ (0, P.jsx)(DO, {
|
|
16492
16502
|
altText: n,
|
|
16493
16503
|
asChild: !0,
|
|
16494
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16504
|
+
children: /* @__PURE__ */ (0, P.jsx)(EO, {
|
|
16495
16505
|
...r,
|
|
16496
16506
|
ref: t
|
|
16497
16507
|
})
|
|
16498
|
-
}) : (console.error(`Invalid prop \`altText\` supplied to \`${
|
|
16508
|
+
}) : (console.error(`Invalid prop \`altText\` supplied to \`${CO}\`. Expected non-empty \`string\`.`), null);
|
|
16499
16509
|
});
|
|
16500
|
-
|
|
16501
|
-
var
|
|
16502
|
-
let { __scopeToast: n, ...r } = e, i =
|
|
16503
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16510
|
+
wO.displayName = CO;
|
|
16511
|
+
var TO = "ToastClose", EO = e.forwardRef((e, t) => {
|
|
16512
|
+
let { __scopeToast: n, ...r } = e, i = gO(TO, n);
|
|
16513
|
+
return /* @__PURE__ */ (0, P.jsx)(DO, {
|
|
16504
16514
|
asChild: !0,
|
|
16505
16515
|
children: /* @__PURE__ */ (0, P.jsx)(K.button, {
|
|
16506
16516
|
type: "button",
|
|
@@ -16510,8 +16520,8 @@ var SO = "ToastClose", CO = e.forwardRef((e, t) => {
|
|
|
16510
16520
|
})
|
|
16511
16521
|
});
|
|
16512
16522
|
});
|
|
16513
|
-
|
|
16514
|
-
var
|
|
16523
|
+
EO.displayName = TO;
|
|
16524
|
+
var DO = e.forwardRef((e, t) => {
|
|
16515
16525
|
let { __scopeToast: n, altText: r, ...i } = e;
|
|
16516
16526
|
return /* @__PURE__ */ (0, P.jsx)(K.div, {
|
|
16517
16527
|
"data-radix-toast-announce-exclude": "",
|
|
@@ -16520,19 +16530,19 @@ var wO = e.forwardRef((e, t) => {
|
|
|
16520
16530
|
ref: t
|
|
16521
16531
|
});
|
|
16522
16532
|
});
|
|
16523
|
-
function
|
|
16533
|
+
function OO(e) {
|
|
16524
16534
|
let t = [];
|
|
16525
16535
|
return Array.from(e.childNodes).forEach((e) => {
|
|
16526
|
-
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent),
|
|
16536
|
+
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent), MO(e)) {
|
|
16527
16537
|
let n = e.ariaHidden || e.hidden || e.style.display === "none", r = e.dataset.radixToastAnnounceExclude === "";
|
|
16528
16538
|
if (!n) if (r) {
|
|
16529
16539
|
let n = e.dataset.radixToastAnnounceAlt;
|
|
16530
16540
|
n && t.push(n);
|
|
16531
|
-
} else t.push(...
|
|
16541
|
+
} else t.push(...OO(e));
|
|
16532
16542
|
}
|
|
16533
16543
|
}), t;
|
|
16534
16544
|
}
|
|
16535
|
-
function
|
|
16545
|
+
function kO(e, t, n, { discrete: r }) {
|
|
16536
16546
|
let i = n.originalEvent.currentTarget, a = new CustomEvent(e, {
|
|
16537
16547
|
bubbles: !0,
|
|
16538
16548
|
cancelable: !0,
|
|
@@ -16540,11 +16550,11 @@ function EO(e, t, n, { discrete: r }) {
|
|
|
16540
16550
|
});
|
|
16541
16551
|
t && i.addEventListener(e, t, { once: !0 }), r ? ze(i, a) : i.dispatchEvent(a);
|
|
16542
16552
|
}
|
|
16543
|
-
var
|
|
16553
|
+
var AO = (e, t, n = 0) => {
|
|
16544
16554
|
let r = Math.abs(e.x), i = Math.abs(e.y), a = r > i;
|
|
16545
16555
|
return t === "left" || t === "right" ? a && r > n : !a && i > n;
|
|
16546
16556
|
};
|
|
16547
|
-
function
|
|
16557
|
+
function jO(e = () => {}) {
|
|
16548
16558
|
let t = Bt(e);
|
|
16549
16559
|
G(() => {
|
|
16550
16560
|
let e = 0, n = 0;
|
|
@@ -16553,10 +16563,10 @@ function OO(e = () => {}) {
|
|
|
16553
16563
|
};
|
|
16554
16564
|
}, [t]);
|
|
16555
16565
|
}
|
|
16556
|
-
function
|
|
16566
|
+
function MO(e) {
|
|
16557
16567
|
return e.nodeType === e.ELEMENT_NODE;
|
|
16558
16568
|
}
|
|
16559
|
-
function
|
|
16569
|
+
function NO(e) {
|
|
16560
16570
|
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
|
|
16561
16571
|
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
16562
16572
|
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
@@ -16564,11 +16574,11 @@ function AO(e) {
|
|
|
16564
16574
|
for (; n.nextNode();) t.push(n.currentNode);
|
|
16565
16575
|
return t;
|
|
16566
16576
|
}
|
|
16567
|
-
function
|
|
16577
|
+
function PO(e) {
|
|
16568
16578
|
let t = document.activeElement;
|
|
16569
16579
|
return e.some((e) => e === t ? !0 : (e.focus(), document.activeElement !== t));
|
|
16570
16580
|
}
|
|
16571
|
-
var
|
|
16581
|
+
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`, {
|
|
16572
16582
|
variants: { variant: {
|
|
16573
16583
|
default: "zui:border-[var(--zui-theme-border-default)]",
|
|
16574
16584
|
info: "zui:border-[var(--zui-theme-status-info)]",
|
|
@@ -16578,49 +16588,49 @@ var MO = QD, NO = rO, PO = dO, FO = _O, IO = yO, LO = xO, RO = CO, zO = q(`zui:f
|
|
|
16578
16588
|
destructive: "zui:border-[var(--zui-theme-status-danger)]"
|
|
16579
16589
|
} },
|
|
16580
16590
|
defaultVariants: { variant: "default" }
|
|
16581
|
-
}),
|
|
16591
|
+
}), 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");
|
|
16582
16592
|
//#endregion
|
|
16583
16593
|
//#region src/components/Toast/Toast.tsx
|
|
16584
|
-
function
|
|
16585
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16594
|
+
function JO(e) {
|
|
16595
|
+
return /* @__PURE__ */ (0, P.jsx)(FO, {
|
|
16586
16596
|
"data-slot": "toast-provider",
|
|
16587
16597
|
...e
|
|
16588
16598
|
});
|
|
16589
16599
|
}
|
|
16590
|
-
var
|
|
16591
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16600
|
+
var YO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16601
|
+
return /* @__PURE__ */ (0, P.jsx)(IO, {
|
|
16592
16602
|
ref: n,
|
|
16593
16603
|
"data-slot": "toast-viewport",
|
|
16594
16604
|
"data-zui-toast-viewport": "",
|
|
16595
|
-
className: D(
|
|
16605
|
+
className: D(HO(), e),
|
|
16596
16606
|
...t
|
|
16597
16607
|
});
|
|
16598
16608
|
});
|
|
16599
|
-
function
|
|
16600
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16609
|
+
function XO({ className: e, variant: t, ...n }) {
|
|
16610
|
+
return /* @__PURE__ */ (0, P.jsx)(LO, {
|
|
16601
16611
|
"data-slot": "toast",
|
|
16602
16612
|
"data-zui-toast-root": "",
|
|
16603
16613
|
dir: "rtl",
|
|
16604
|
-
className: D(
|
|
16614
|
+
className: D(UO({ variant: t }), "zui:text-right", e),
|
|
16605
16615
|
...n
|
|
16606
16616
|
});
|
|
16607
16617
|
}
|
|
16608
|
-
var
|
|
16609
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16618
|
+
var ZO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16619
|
+
return /* @__PURE__ */ (0, P.jsx)(BO, {
|
|
16610
16620
|
ref: n,
|
|
16611
16621
|
"data-slot": "toast-action",
|
|
16612
|
-
className: D(
|
|
16622
|
+
className: D(WO(), e),
|
|
16613
16623
|
...t
|
|
16614
16624
|
});
|
|
16615
|
-
}),
|
|
16625
|
+
}), QO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16616
16626
|
return /* @__PURE__ */ (0, P.jsx)(Jy, {
|
|
16617
16627
|
text: "بستن",
|
|
16618
16628
|
position: "top",
|
|
16619
|
-
trigger: /* @__PURE__ */ (0, P.jsx)(
|
|
16629
|
+
trigger: /* @__PURE__ */ (0, P.jsx)(VO, {
|
|
16620
16630
|
ref: n,
|
|
16621
16631
|
"data-slot": "toast-close",
|
|
16622
16632
|
"aria-label": "بستن",
|
|
16623
|
-
className: D(
|
|
16633
|
+
className: D(GO(), e),
|
|
16624
16634
|
...t,
|
|
16625
16635
|
children: /* @__PURE__ */ (0, P.jsx)(Mt, {
|
|
16626
16636
|
className: "zui:size-[1.92rem] zui:text-current",
|
|
@@ -16628,44 +16638,44 @@ var JO = e.forwardRef(function({ className: e, ...t }, n) {
|
|
|
16628
16638
|
})
|
|
16629
16639
|
})
|
|
16630
16640
|
});
|
|
16631
|
-
}),
|
|
16632
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16641
|
+
}), $O = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16642
|
+
return /* @__PURE__ */ (0, P.jsx)(RO, {
|
|
16633
16643
|
ref: n,
|
|
16634
16644
|
"data-slot": "toast-title",
|
|
16635
|
-
className: D(
|
|
16645
|
+
className: D(KO(), e),
|
|
16636
16646
|
...t
|
|
16637
16647
|
});
|
|
16638
|
-
}),
|
|
16639
|
-
return /* @__PURE__ */ (0, P.jsx)(
|
|
16648
|
+
}), ek = e.forwardRef(function({ className: e, ...t }, n) {
|
|
16649
|
+
return /* @__PURE__ */ (0, P.jsx)(zO, {
|
|
16640
16650
|
ref: n,
|
|
16641
16651
|
"data-slot": "toast-description",
|
|
16642
|
-
className: D(
|
|
16652
|
+
className: D(qO(), e),
|
|
16643
16653
|
...t
|
|
16644
16654
|
});
|
|
16645
|
-
}),
|
|
16646
|
-
function
|
|
16655
|
+
}), tk = 2147483647, nk = /* @__PURE__ */ new Set();
|
|
16656
|
+
function rk(e) {
|
|
16647
16657
|
return e === "succes" ? "success" : e;
|
|
16648
16658
|
}
|
|
16649
|
-
function
|
|
16650
|
-
return
|
|
16651
|
-
|
|
16659
|
+
function ik(e) {
|
|
16660
|
+
return nk.add(e), () => {
|
|
16661
|
+
nk.delete(e);
|
|
16652
16662
|
};
|
|
16653
16663
|
}
|
|
16654
|
-
function
|
|
16655
|
-
let { safeDuration: i, isPersistent: a } =
|
|
16664
|
+
function ak({ title: e, message: t, duration: n, type: r }) {
|
|
16665
|
+
let { safeDuration: i, isPersistent: a } = ok(n), o = {
|
|
16656
16666
|
title: e,
|
|
16657
16667
|
message: t,
|
|
16658
16668
|
duration: i,
|
|
16659
16669
|
isPersistent: a,
|
|
16660
|
-
type:
|
|
16670
|
+
type: rk(r)
|
|
16661
16671
|
};
|
|
16662
|
-
|
|
16672
|
+
nk.forEach((e) => {
|
|
16663
16673
|
e(o);
|
|
16664
16674
|
});
|
|
16665
16675
|
}
|
|
16666
|
-
function
|
|
16676
|
+
function ok(e) {
|
|
16667
16677
|
return e == null || !Number.isFinite(e) || e <= 0 ? {
|
|
16668
|
-
safeDuration:
|
|
16678
|
+
safeDuration: tk,
|
|
16669
16679
|
isPersistent: !0
|
|
16670
16680
|
} : {
|
|
16671
16681
|
safeDuration: e,
|
|
@@ -16674,7 +16684,7 @@ function rk(e) {
|
|
|
16674
16684
|
}
|
|
16675
16685
|
//#endregion
|
|
16676
16686
|
//#region src/components/Toast/function/toastVisual.ts
|
|
16677
|
-
var
|
|
16687
|
+
var sk = {
|
|
16678
16688
|
info: {
|
|
16679
16689
|
Icon: Tt,
|
|
16680
16690
|
iconClassName: "zui:text-[var(--zui-theme-status-info)]",
|
|
@@ -16696,23 +16706,23 @@ var ik = {
|
|
|
16696
16706
|
progressClassName: "zui:bg-[var(--zui-theme-status-danger)]"
|
|
16697
16707
|
}
|
|
16698
16708
|
};
|
|
16699
|
-
function
|
|
16700
|
-
return
|
|
16709
|
+
function ck(e) {
|
|
16710
|
+
return sk[e];
|
|
16701
16711
|
}
|
|
16702
16712
|
//#endregion
|
|
16703
16713
|
//#region src/components/Toast/ToastHost.tsx
|
|
16704
|
-
var
|
|
16705
|
-
function
|
|
16714
|
+
var lk = 5, uk = 420;
|
|
16715
|
+
function dk() {
|
|
16706
16716
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
16707
16717
|
}
|
|
16708
|
-
function
|
|
16718
|
+
function fk() {
|
|
16709
16719
|
let [e, t] = d([]), n = u(/* @__PURE__ */ new Map());
|
|
16710
|
-
s(() =>
|
|
16720
|
+
s(() => ik((e) => {
|
|
16711
16721
|
t((t) => [{
|
|
16712
|
-
id:
|
|
16722
|
+
id: dk(),
|
|
16713
16723
|
open: !0,
|
|
16714
16724
|
...e
|
|
16715
|
-
}, ...t].slice(0,
|
|
16725
|
+
}, ...t].slice(0, lk));
|
|
16716
16726
|
}), []), s(() => {
|
|
16717
16727
|
let e = n.current;
|
|
16718
16728
|
return () => {
|
|
@@ -16730,10 +16740,10 @@ function lk() {
|
|
|
16730
16740
|
} : t));
|
|
16731
16741
|
let a = window.setTimeout(() => {
|
|
16732
16742
|
n.current.delete(e), t((t) => t.filter((t) => t.id !== e));
|
|
16733
|
-
},
|
|
16743
|
+
}, uk);
|
|
16734
16744
|
n.current.set(e, a);
|
|
16735
16745
|
}, []);
|
|
16736
|
-
return /* @__PURE__ */ (0, P.jsxs)(
|
|
16746
|
+
return /* @__PURE__ */ (0, P.jsxs)(JO, { children: [e.map((e) => /* @__PURE__ */ (0, P.jsxs)(XO, {
|
|
16737
16747
|
open: e.open,
|
|
16738
16748
|
duration: e.isPersistent ? Infinity : e.duration,
|
|
16739
16749
|
variant: e.type,
|
|
@@ -16743,29 +16753,29 @@ function lk() {
|
|
|
16743
16753
|
className: "zui:flex zui:items-start zui:gap-3",
|
|
16744
16754
|
children: [/* @__PURE__ */ (0, P.jsx)("span", {
|
|
16745
16755
|
className: "zui:mt-0.5 zui:shrink-0",
|
|
16746
|
-
children: /* @__PURE__ */ (0, P.jsx)(
|
|
16756
|
+
children: /* @__PURE__ */ (0, P.jsx)(pk, { type: e.type })
|
|
16747
16757
|
}), /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
16748
16758
|
className: "zui:grid zui:gap-1",
|
|
16749
|
-
children: [/* @__PURE__ */ (0, P.jsx)(
|
|
16759
|
+
children: [/* @__PURE__ */ (0, P.jsx)($O, { children: e.title }), /* @__PURE__ */ (0, P.jsx)(ek, { children: e.message })]
|
|
16750
16760
|
})]
|
|
16751
16761
|
}),
|
|
16752
|
-
/* @__PURE__ */ (0, P.jsx)(
|
|
16753
|
-
!e.isPersistent && /* @__PURE__ */ (0, P.jsx)(
|
|
16762
|
+
/* @__PURE__ */ (0, P.jsx)(QO, {}),
|
|
16763
|
+
!e.isPersistent && /* @__PURE__ */ (0, P.jsx)(mk, {
|
|
16754
16764
|
duration: e.duration,
|
|
16755
16765
|
type: e.type
|
|
16756
16766
|
})
|
|
16757
16767
|
]
|
|
16758
|
-
}, e.id)), /* @__PURE__ */ (0, P.jsx)(
|
|
16768
|
+
}, e.id)), /* @__PURE__ */ (0, P.jsx)(YO, {})] });
|
|
16759
16769
|
}
|
|
16760
|
-
function
|
|
16761
|
-
let { Icon: t, iconClassName: n } =
|
|
16770
|
+
function pk({ type: e }) {
|
|
16771
|
+
let { Icon: t, iconClassName: n } = ck(e);
|
|
16762
16772
|
return /* @__PURE__ */ (0, P.jsx)(t, {
|
|
16763
16773
|
className: `zui:size-5 ${n}`,
|
|
16764
16774
|
"aria-hidden": "true"
|
|
16765
16775
|
});
|
|
16766
16776
|
}
|
|
16767
|
-
function
|
|
16768
|
-
let { progressClassName: n } =
|
|
16777
|
+
function mk({ duration: e, type: t }) {
|
|
16778
|
+
let { progressClassName: n } = ck(t);
|
|
16769
16779
|
return /* @__PURE__ */ (0, P.jsx)("span", {
|
|
16770
16780
|
className: `zui:pointer-events-none zui:absolute zui:right-0 zui:bottom-0 zui:left-0 zui:h-1 zui:origin-right ${n}`,
|
|
16771
16781
|
style: { animation: `zui-toast-progress ${e}ms linear forwards` },
|
|
@@ -16773,4 +16783,4 @@ function dk({ duration: e, type: t }) {
|
|
|
16773
16783
|
});
|
|
16774
16784
|
}
|
|
16775
16785
|
//#endregion
|
|
16776
|
-
export { ge as Button, zt as Checkbox, Bb as DatePicker, Hx as Dialog, tS as Input,
|
|
16786
|
+
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 };
|