@optimum-intelligence/opti-ui 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/README.md +3 -3
- package/dist/components/app-shell/AppShell.d.ts +6 -1
- package/dist/components/app-shell/AppShell.js +99 -94
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +6 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +42 -40
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/calendar/Calendar.js +29 -17
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +1 -1
- package/dist/components/combobox/Combobox.js +38 -29
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +13 -4
- package/dist/components/command-palette/CommandPalette.js +91 -89
- package/dist/components/command-palette/CommandPalette.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +38 -13
- package/dist/components/data-table/DataTable.js +421 -266
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableContent.d.ts +7 -1
- package/dist/components/data-table/DataTableContent.js +246 -210
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +4 -3
- package/dist/components/data-table/DataTableFilters.js +311 -194
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/DataTableRow.js +76 -72
- package/dist/components/data-table/DataTableRow.js.map +1 -1
- package/dist/components/data-table/layout.d.ts +5 -0
- package/dist/components/data-table/layout.js +23 -1
- package/dist/components/data-table/layout.js.map +1 -1
- package/dist/components/data-table/types.d.ts +57 -3
- package/dist/components/data-table/useDataTable.d.ts +1 -1
- package/dist/components/data-table/useDataTable.js +396 -351
- package/dist/components/data-table/useDataTable.js.map +1 -1
- package/dist/components/dialog/ConfirmDialog.d.ts +6 -1
- package/dist/components/dialog/ConfirmDialog.js +88 -85
- package/dist/components/dialog/ConfirmDialog.js.map +1 -1
- package/dist/components/progress/Progress.d.ts +2 -1
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/stat-card/StatCard.d.ts +7 -2
- package/dist/components/stat-card/StatCard.js +1 -1
- package/dist/components/stat-card/StatCard.js.map +1 -1
- package/dist/components/table/Table.d.ts +5 -1
- package/dist/components/table/Table.js +2 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components.json +124 -18
- package/dist/fonts/JetBrainsMono-OFL.txt +93 -0
- package/dist/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/dist/fonts.css +22 -1
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +12 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/labels/Labels.d.ts +9 -1
- package/dist/labels/Labels.js +4 -0
- package/dist/labels/Labels.js.map +1 -1
- package/dist/labels/hu.d.ts +17 -0
- package/dist/labels/hu.js +124 -0
- package/dist/labels/hu.js.map +1 -0
- package/dist/llms-full.txt +60 -17
- package/dist/llms.txt +2 -1
- package/dist/opti-ui.css +303 -70
- package/dist/utils/scroll-fade.d.ts +5 -1
- package/dist/utils/scroll-fade.js +11 -1
- package/dist/utils/scroll-fade.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cx } from "../../utils/cx.js";
|
|
3
3
|
import { createPrimitive } from "../../utils/primitive.js";
|
|
4
|
-
import { DownloadIcon, FilterIcon } from "../../icons/index.js";
|
|
4
|
+
import { ColumnsIcon, DownloadIcon, FilterIcon } from "../../icons/index.js";
|
|
5
5
|
import { Spinner } from "../spinner/Spinner.js";
|
|
6
6
|
import { Button, IconButton } from "../button/Button.js";
|
|
7
|
+
import { Menu } from "../menu/Menu.js";
|
|
7
8
|
import { SearchInput } from "../search-input/SearchInput.js";
|
|
8
9
|
import { NARROW_SCREEN, useMediaQuery } from "../../utils/media.js";
|
|
9
10
|
import { Drawer } from "../drawer/Drawer.js";
|
|
@@ -223,9 +224,12 @@ function DataTableLoading(t0) {
|
|
|
223
224
|
} else t3 = $[11];
|
|
224
225
|
return t3;
|
|
225
226
|
}
|
|
226
|
-
/**
|
|
227
|
+
/**
|
|
228
|
+
* Matching rows of all rows (`"3 / 10"`), or the number of selected rows. In server mode, where the total
|
|
229
|
+
* before filters is not known, the `count` label. The default table shows it in the footer.
|
|
230
|
+
*/
|
|
227
231
|
function DataTableSummary(t0) {
|
|
228
|
-
const $ = c(
|
|
232
|
+
const $ = c(19);
|
|
229
233
|
let className;
|
|
230
234
|
let props;
|
|
231
235
|
if ($[0] !== t0) {
|
|
@@ -253,29 +257,30 @@ function DataTableSummary(t0) {
|
|
|
253
257
|
$[6] = t2;
|
|
254
258
|
} else t2 = $[6];
|
|
255
259
|
let t3;
|
|
256
|
-
if ($[7] !== selected || $[8] !== table.count || $[9] !== table.
|
|
257
|
-
t3 = table.selectable && selected ? text.selected(selected) : table.pending ? null : table.
|
|
260
|
+
if ($[7] !== selected || $[8] !== table.count || $[9] !== table.mode || $[10] !== table.pending || $[11] !== table.selectable || $[12] !== table.totalCount || $[13] !== text) {
|
|
261
|
+
t3 = table.selectable && selected ? text.selected(selected) : table.pending ? null : table.mode === "server" ? text.count(table.count) : text.filteredCount(table.count, table.totalCount);
|
|
258
262
|
$[7] = selected;
|
|
259
263
|
$[8] = table.count;
|
|
260
|
-
$[9] = table.
|
|
261
|
-
$[10] = table.
|
|
262
|
-
$[11] = table.
|
|
263
|
-
$[12] =
|
|
264
|
-
$[13] =
|
|
265
|
-
|
|
264
|
+
$[9] = table.mode;
|
|
265
|
+
$[10] = table.pending;
|
|
266
|
+
$[11] = table.selectable;
|
|
267
|
+
$[12] = table.totalCount;
|
|
268
|
+
$[13] = text;
|
|
269
|
+
$[14] = t3;
|
|
270
|
+
} else t3 = $[14];
|
|
266
271
|
let t4;
|
|
267
|
-
if ($[
|
|
272
|
+
if ($[15] !== props || $[16] !== t2 || $[17] !== t3) {
|
|
268
273
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
269
274
|
className: t2,
|
|
270
275
|
"aria-live": "polite",
|
|
271
276
|
...props,
|
|
272
277
|
children: t3
|
|
273
278
|
});
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
} else t4 = $[
|
|
279
|
+
$[15] = props;
|
|
280
|
+
$[16] = t2;
|
|
281
|
+
$[17] = t3;
|
|
282
|
+
$[18] = t4;
|
|
283
|
+
} else t4 = $[18];
|
|
279
284
|
return t4;
|
|
280
285
|
}
|
|
281
286
|
/** Page navigation of the table. Renders nothing when there are no rows, or the table is not paginated. */
|
|
@@ -326,12 +331,13 @@ function DataTablePagination(t0) {
|
|
|
326
331
|
return t2;
|
|
327
332
|
}
|
|
328
333
|
/**
|
|
329
|
-
* The phone toolbar's
|
|
330
|
-
*
|
|
331
|
-
*
|
|
334
|
+
* The phone toolbar's filter button: an icon with the number of active filters, so the search next to it
|
|
335
|
+
* keeps the width. It opens a bottom sheet holding every filter and the `children`. Filters apply as they
|
|
336
|
+
* change. The footer keeps a clear button (disabled while no filter is set, so nothing moves when one is)
|
|
337
|
+
* and a button that closes the sheet on the result count.
|
|
332
338
|
*/
|
|
333
339
|
function DataTableFilterSheet(t0) {
|
|
334
|
-
const $ = c(
|
|
340
|
+
const $ = c(31);
|
|
335
341
|
const { size: t1, children } = t0;
|
|
336
342
|
const size = t1 === void 0 ? "md" : t1;
|
|
337
343
|
const table = useDataTableContext();
|
|
@@ -341,110 +347,270 @@ function DataTableFilterSheet(t0) {
|
|
|
341
347
|
if (!table.filters.length && !children) return null;
|
|
342
348
|
const t2 = text.filters;
|
|
343
349
|
const t3 = text.close;
|
|
344
|
-
const t4 = active ?
|
|
345
|
-
|
|
350
|
+
const t4 = active ? `${text.filters} (${active})` : text.filters;
|
|
351
|
+
const t5 = active ? "" : void 0;
|
|
352
|
+
let t6;
|
|
346
353
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
347
|
-
|
|
348
|
-
$[0] =
|
|
349
|
-
} else
|
|
350
|
-
const t6 = active ? `${text.filters} (${active})` : text.filters;
|
|
354
|
+
t6 = /* @__PURE__ */ jsx(FilterIcon, {});
|
|
355
|
+
$[0] = t6;
|
|
356
|
+
} else t6 = $[0];
|
|
351
357
|
let t7;
|
|
352
|
-
if ($[1] !==
|
|
353
|
-
t7 = /* @__PURE__ */
|
|
358
|
+
if ($[1] !== active) {
|
|
359
|
+
t7 = active > 0 && /* @__PURE__ */ jsx("span", {
|
|
360
|
+
className: "oui-data-table__filter-badge",
|
|
361
|
+
"aria-hidden": true,
|
|
362
|
+
children: active
|
|
363
|
+
});
|
|
364
|
+
$[1] = active;
|
|
365
|
+
$[2] = t7;
|
|
366
|
+
} else t7 = $[2];
|
|
367
|
+
let t8;
|
|
368
|
+
if ($[3] !== size || $[4] !== t4 || $[5] !== t5 || $[6] !== t7) {
|
|
369
|
+
t8 = /* @__PURE__ */ jsxs(IconButton, {
|
|
354
370
|
variant: "secondary",
|
|
355
|
-
shape: "rounded",
|
|
356
371
|
size,
|
|
357
372
|
className: "oui-data-table__sheet-trigger",
|
|
358
|
-
"
|
|
359
|
-
|
|
373
|
+
"aria-label": t4,
|
|
374
|
+
"data-active": t5,
|
|
375
|
+
children: [t6, t7]
|
|
360
376
|
});
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
377
|
+
$[3] = size;
|
|
378
|
+
$[4] = t4;
|
|
379
|
+
$[5] = t5;
|
|
380
|
+
$[6] = t7;
|
|
381
|
+
$[7] = t8;
|
|
382
|
+
} else t8 = $[7];
|
|
383
|
+
const t9 = !active;
|
|
384
|
+
let t10;
|
|
385
|
+
if ($[8] !== t9 || $[9] !== table.clearFilters || $[10] !== text.clearFilters) {
|
|
386
|
+
t10 = /* @__PURE__ */ jsx(Button, {
|
|
370
387
|
variant: "secondary",
|
|
371
|
-
disabled:
|
|
388
|
+
disabled: t9,
|
|
372
389
|
onClick: table.clearFilters,
|
|
373
390
|
children: text.clearFilters
|
|
374
391
|
});
|
|
375
|
-
$[5] = t8;
|
|
376
|
-
$[6] = table.clearFilters;
|
|
377
|
-
$[7] = text.clearFilters;
|
|
378
392
|
$[8] = t9;
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
$[9] = t10;
|
|
384
|
-
} else t10 = $[9];
|
|
393
|
+
$[9] = table.clearFilters;
|
|
394
|
+
$[10] = text.clearFilters;
|
|
395
|
+
$[11] = t10;
|
|
396
|
+
} else t10 = $[11];
|
|
385
397
|
let t11;
|
|
386
|
-
if ($[
|
|
387
|
-
t11 =
|
|
388
|
-
$[10] = table.count;
|
|
389
|
-
$[11] = text;
|
|
398
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
399
|
+
t11 = () => setOpen(false);
|
|
390
400
|
$[12] = t11;
|
|
391
401
|
} else t11 = $[12];
|
|
392
402
|
let t12;
|
|
393
|
-
if ($[13] !==
|
|
394
|
-
t12 =
|
|
403
|
+
if ($[13] !== table.count || $[14] !== text) {
|
|
404
|
+
t12 = text.showResults(table.count);
|
|
405
|
+
$[13] = table.count;
|
|
406
|
+
$[14] = text;
|
|
407
|
+
$[15] = t12;
|
|
408
|
+
} else t12 = $[15];
|
|
409
|
+
let t13;
|
|
410
|
+
if ($[16] !== t12) {
|
|
411
|
+
t13 = /* @__PURE__ */ jsx(Button, {
|
|
395
412
|
className: "oui-data-table__sheet-done",
|
|
396
|
-
onClick:
|
|
397
|
-
children:
|
|
413
|
+
onClick: t11,
|
|
414
|
+
children: t12
|
|
398
415
|
});
|
|
399
|
-
$[
|
|
400
|
-
$[14] = t12;
|
|
401
|
-
} else t12 = $[14];
|
|
402
|
-
let t13;
|
|
403
|
-
if ($[15] !== t12 || $[16] !== t9) {
|
|
404
|
-
t13 = /* @__PURE__ */ jsxs(Fragment, { children: [t9, t12] });
|
|
405
|
-
$[15] = t12;
|
|
406
|
-
$[16] = t9;
|
|
416
|
+
$[16] = t12;
|
|
407
417
|
$[17] = t13;
|
|
408
418
|
} else t13 = $[17];
|
|
409
419
|
let t14;
|
|
410
|
-
if ($[18]
|
|
411
|
-
t14 = /* @__PURE__ */
|
|
412
|
-
$[18] =
|
|
413
|
-
|
|
420
|
+
if ($[18] !== t10 || $[19] !== t13) {
|
|
421
|
+
t14 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t13] });
|
|
422
|
+
$[18] = t10;
|
|
423
|
+
$[19] = t13;
|
|
424
|
+
$[20] = t14;
|
|
425
|
+
} else t14 = $[20];
|
|
414
426
|
let t15;
|
|
415
|
-
if ($[
|
|
416
|
-
t15 =
|
|
427
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
428
|
+
t15 = /* @__PURE__ */ jsx(DataTableFilters, { stacked: true });
|
|
429
|
+
$[21] = t15;
|
|
430
|
+
} else t15 = $[21];
|
|
431
|
+
let t16;
|
|
432
|
+
if ($[22] !== children) {
|
|
433
|
+
t16 = children && /* @__PURE__ */ jsx("div", {
|
|
417
434
|
className: "oui-data-table__sheet-extra",
|
|
418
435
|
children
|
|
419
436
|
});
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
} else
|
|
423
|
-
let
|
|
424
|
-
if ($[
|
|
425
|
-
|
|
437
|
+
$[22] = children;
|
|
438
|
+
$[23] = t16;
|
|
439
|
+
} else t16 = $[23];
|
|
440
|
+
let t17;
|
|
441
|
+
if ($[24] !== open || $[25] !== t14 || $[26] !== t16 || $[27] !== t8 || $[28] !== text.close || $[29] !== text.filters) {
|
|
442
|
+
t17 = /* @__PURE__ */ jsxs(Drawer, {
|
|
426
443
|
side: "bottom",
|
|
427
444
|
className: "oui-data-table__sheet",
|
|
428
445
|
title: t2,
|
|
429
446
|
closeLabel: t3,
|
|
430
447
|
open,
|
|
431
448
|
onOpenChange: setOpen,
|
|
432
|
-
trigger:
|
|
433
|
-
footer:
|
|
434
|
-
children: [
|
|
449
|
+
trigger: t8,
|
|
450
|
+
footer: t14,
|
|
451
|
+
children: [t15, t16]
|
|
435
452
|
});
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
} else
|
|
444
|
-
return
|
|
453
|
+
$[24] = open;
|
|
454
|
+
$[25] = t14;
|
|
455
|
+
$[26] = t16;
|
|
456
|
+
$[27] = t8;
|
|
457
|
+
$[28] = text.close;
|
|
458
|
+
$[29] = text.filters;
|
|
459
|
+
$[30] = t17;
|
|
460
|
+
} else t17 = $[30];
|
|
461
|
+
return t17;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Icon button with a menu of checkboxes that show or hide columns. Columns with `hidden` or
|
|
465
|
+
* `hideable: false` are not listed. The choice is in `table.hiddenColumns`; keep it across visits with
|
|
466
|
+
* `hiddenColumns` and `onHiddenColumnsChange`.
|
|
467
|
+
*/
|
|
468
|
+
function DataTableColumnsMenu(t0) {
|
|
469
|
+
const $ = c(40);
|
|
470
|
+
const { size: t1, className } = t0;
|
|
471
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
472
|
+
const table = useDataTableContext();
|
|
473
|
+
const text = table.labels;
|
|
474
|
+
const t2 = table.columns;
|
|
475
|
+
let T0;
|
|
476
|
+
let T1;
|
|
477
|
+
let T2;
|
|
478
|
+
let t3;
|
|
479
|
+
let t4;
|
|
480
|
+
let t5;
|
|
481
|
+
let t6;
|
|
482
|
+
let t7;
|
|
483
|
+
if ($[0] !== className || $[1] !== size || $[2] !== table || $[3] !== text) {
|
|
484
|
+
t7 = Symbol.for("react.early_return_sentinel");
|
|
485
|
+
bb0: {
|
|
486
|
+
const columns = t2.filter(_temp);
|
|
487
|
+
if (!columns.length) {
|
|
488
|
+
t7 = null;
|
|
489
|
+
break bb0;
|
|
490
|
+
}
|
|
491
|
+
T2 = Menu.Root;
|
|
492
|
+
const t8 = text.columns;
|
|
493
|
+
let t9;
|
|
494
|
+
if ($[12] !== className) {
|
|
495
|
+
t9 = cx("oui-data-table__columns-button", className);
|
|
496
|
+
$[12] = className;
|
|
497
|
+
$[13] = t9;
|
|
498
|
+
} else t9 = $[13];
|
|
499
|
+
let t10;
|
|
500
|
+
if ($[14] !== size || $[15] !== t9 || $[16] !== text.columns) {
|
|
501
|
+
t10 = /* @__PURE__ */ jsx(IconButton, {
|
|
502
|
+
variant: "secondary",
|
|
503
|
+
size,
|
|
504
|
+
className: t9,
|
|
505
|
+
"aria-label": text.columns
|
|
506
|
+
});
|
|
507
|
+
$[14] = size;
|
|
508
|
+
$[15] = t9;
|
|
509
|
+
$[16] = text.columns;
|
|
510
|
+
$[17] = t10;
|
|
511
|
+
} else t10 = $[17];
|
|
512
|
+
let t11;
|
|
513
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
514
|
+
t11 = /* @__PURE__ */ jsx(ColumnsIcon, {});
|
|
515
|
+
$[18] = t11;
|
|
516
|
+
} else t11 = $[18];
|
|
517
|
+
let t12;
|
|
518
|
+
if ($[19] !== t10) {
|
|
519
|
+
t12 = /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
520
|
+
render: t10,
|
|
521
|
+
children: t11
|
|
522
|
+
});
|
|
523
|
+
$[19] = t10;
|
|
524
|
+
$[20] = t12;
|
|
525
|
+
} else t12 = $[20];
|
|
526
|
+
if ($[21] !== t12 || $[22] !== text.columns) {
|
|
527
|
+
t6 = /* @__PURE__ */ jsx(Tooltip, {
|
|
528
|
+
content: t8,
|
|
529
|
+
children: t12
|
|
530
|
+
});
|
|
531
|
+
$[21] = t12;
|
|
532
|
+
$[22] = text.columns;
|
|
533
|
+
$[23] = t6;
|
|
534
|
+
} else t6 = $[23];
|
|
535
|
+
T1 = Menu.Content;
|
|
536
|
+
t5 = "end";
|
|
537
|
+
T0 = Menu.Group;
|
|
538
|
+
if ($[24] !== text.columns) {
|
|
539
|
+
t3 = /* @__PURE__ */ jsx(Menu.GroupLabel, { children: text.columns });
|
|
540
|
+
$[24] = text.columns;
|
|
541
|
+
$[25] = t3;
|
|
542
|
+
} else t3 = $[25];
|
|
543
|
+
let t13;
|
|
544
|
+
if ($[26] !== table) {
|
|
545
|
+
t13 = (column_0) => /* @__PURE__ */ jsx(Menu.CheckboxItem, {
|
|
546
|
+
closeOnClick: false,
|
|
547
|
+
checked: !table.hiddenColumns.includes(column_0.id),
|
|
548
|
+
onCheckedChange: (checked) => table.setColumnHidden(column_0.id, !checked),
|
|
549
|
+
children: column_0.label ?? column_0.header
|
|
550
|
+
}, column_0.id);
|
|
551
|
+
$[26] = table;
|
|
552
|
+
$[27] = t13;
|
|
553
|
+
} else t13 = $[27];
|
|
554
|
+
t4 = columns.map(t13);
|
|
555
|
+
}
|
|
556
|
+
$[0] = className;
|
|
557
|
+
$[1] = size;
|
|
558
|
+
$[2] = table;
|
|
559
|
+
$[3] = text;
|
|
560
|
+
$[4] = T0;
|
|
561
|
+
$[5] = T1;
|
|
562
|
+
$[6] = T2;
|
|
563
|
+
$[7] = t3;
|
|
564
|
+
$[8] = t4;
|
|
565
|
+
$[9] = t5;
|
|
566
|
+
$[10] = t6;
|
|
567
|
+
$[11] = t7;
|
|
568
|
+
} else {
|
|
569
|
+
T0 = $[4];
|
|
570
|
+
T1 = $[5];
|
|
571
|
+
T2 = $[6];
|
|
572
|
+
t3 = $[7];
|
|
573
|
+
t4 = $[8];
|
|
574
|
+
t5 = $[9];
|
|
575
|
+
t6 = $[10];
|
|
576
|
+
t7 = $[11];
|
|
577
|
+
}
|
|
578
|
+
if (t7 !== Symbol.for("react.early_return_sentinel")) return t7;
|
|
579
|
+
let t8;
|
|
580
|
+
if ($[28] !== T0 || $[29] !== t3 || $[30] !== t4) {
|
|
581
|
+
t8 = /* @__PURE__ */ jsxs(T0, { children: [t3, t4] });
|
|
582
|
+
$[28] = T0;
|
|
583
|
+
$[29] = t3;
|
|
584
|
+
$[30] = t4;
|
|
585
|
+
$[31] = t8;
|
|
586
|
+
} else t8 = $[31];
|
|
587
|
+
let t9;
|
|
588
|
+
if ($[32] !== T1 || $[33] !== t5 || $[34] !== t8) {
|
|
589
|
+
t9 = /* @__PURE__ */ jsx(T1, {
|
|
590
|
+
align: t5,
|
|
591
|
+
children: t8
|
|
592
|
+
});
|
|
593
|
+
$[32] = T1;
|
|
594
|
+
$[33] = t5;
|
|
595
|
+
$[34] = t8;
|
|
596
|
+
$[35] = t9;
|
|
597
|
+
} else t9 = $[35];
|
|
598
|
+
let t10;
|
|
599
|
+
if ($[36] !== T2 || $[37] !== t6 || $[38] !== t9) {
|
|
600
|
+
t10 = /* @__PURE__ */ jsxs(T2, { children: [t6, t9] });
|
|
601
|
+
$[36] = T2;
|
|
602
|
+
$[37] = t6;
|
|
603
|
+
$[38] = t9;
|
|
604
|
+
$[39] = t10;
|
|
605
|
+
} else t10 = $[39];
|
|
606
|
+
return t10;
|
|
607
|
+
}
|
|
608
|
+
function _temp(column) {
|
|
609
|
+
return !column.hidden && column.hideable !== false;
|
|
445
610
|
}
|
|
446
611
|
function DataTableComponent(t0) {
|
|
447
|
-
const $ = c(
|
|
612
|
+
const $ = c(53);
|
|
613
|
+
let bulkActions;
|
|
448
614
|
let className;
|
|
449
615
|
let controlSize;
|
|
450
616
|
let density;
|
|
@@ -460,153 +626,138 @@ function DataTableComponent(t0) {
|
|
|
460
626
|
let striped;
|
|
461
627
|
let t1;
|
|
462
628
|
let t2;
|
|
629
|
+
let t3;
|
|
463
630
|
let tableProps;
|
|
464
631
|
let toolbar;
|
|
465
632
|
let virtualized;
|
|
466
633
|
if ($[0] !== t0) {
|
|
467
|
-
({density, striped, stickyHeader, layout, maxHeight, virtualized, onEndReached, stickyFirstColumn, empty, tableProps, pageSizeOptions, controlSize, toolbar,
|
|
634
|
+
({density, striped, stickyHeader, layout, maxHeight, virtualized, onEndReached, stickyFirstColumn, empty, tableProps, pageSizeOptions, controlSize, toolbar, bulkActions, columnsMenu: t1, showToolbar: t2, exportName, fill: t3, className, ...options} = t0);
|
|
468
635
|
$[0] = t0;
|
|
469
|
-
$[1] =
|
|
470
|
-
$[2] =
|
|
471
|
-
$[3] =
|
|
472
|
-
$[4] =
|
|
473
|
-
$[5] =
|
|
474
|
-
$[6] =
|
|
475
|
-
$[7] =
|
|
476
|
-
$[8] =
|
|
477
|
-
$[9] =
|
|
478
|
-
$[10] =
|
|
479
|
-
$[11] =
|
|
480
|
-
$[12] =
|
|
481
|
-
$[13] =
|
|
482
|
-
$[14] =
|
|
483
|
-
$[15] =
|
|
484
|
-
$[16] =
|
|
485
|
-
$[17] =
|
|
486
|
-
$[18] =
|
|
636
|
+
$[1] = bulkActions;
|
|
637
|
+
$[2] = className;
|
|
638
|
+
$[3] = controlSize;
|
|
639
|
+
$[4] = density;
|
|
640
|
+
$[5] = empty;
|
|
641
|
+
$[6] = exportName;
|
|
642
|
+
$[7] = layout;
|
|
643
|
+
$[8] = maxHeight;
|
|
644
|
+
$[9] = onEndReached;
|
|
645
|
+
$[10] = options;
|
|
646
|
+
$[11] = pageSizeOptions;
|
|
647
|
+
$[12] = stickyFirstColumn;
|
|
648
|
+
$[13] = stickyHeader;
|
|
649
|
+
$[14] = striped;
|
|
650
|
+
$[15] = t1;
|
|
651
|
+
$[16] = t2;
|
|
652
|
+
$[17] = t3;
|
|
653
|
+
$[18] = tableProps;
|
|
654
|
+
$[19] = toolbar;
|
|
655
|
+
$[20] = virtualized;
|
|
487
656
|
} else {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
657
|
+
bulkActions = $[1];
|
|
658
|
+
className = $[2];
|
|
659
|
+
controlSize = $[3];
|
|
660
|
+
density = $[4];
|
|
661
|
+
empty = $[5];
|
|
662
|
+
exportName = $[6];
|
|
663
|
+
layout = $[7];
|
|
664
|
+
maxHeight = $[8];
|
|
665
|
+
onEndReached = $[9];
|
|
666
|
+
options = $[10];
|
|
667
|
+
pageSizeOptions = $[11];
|
|
668
|
+
stickyFirstColumn = $[12];
|
|
669
|
+
stickyHeader = $[13];
|
|
670
|
+
striped = $[14];
|
|
671
|
+
t1 = $[15];
|
|
672
|
+
t2 = $[16];
|
|
673
|
+
t3 = $[17];
|
|
674
|
+
tableProps = $[18];
|
|
675
|
+
toolbar = $[19];
|
|
676
|
+
virtualized = $[20];
|
|
506
677
|
}
|
|
507
|
-
const
|
|
508
|
-
const
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
678
|
+
const columnsMenu = t1 === void 0 ? false : t1;
|
|
679
|
+
const showToolbar = t2 === void 0 ? true : t2;
|
|
680
|
+
const fill = t3 === void 0 ? false : t3;
|
|
681
|
+
const t4 = options.paginated ?? !virtualized;
|
|
682
|
+
let t5;
|
|
683
|
+
if ($[21] !== options || $[22] !== t4) {
|
|
684
|
+
t5 = {
|
|
513
685
|
...options,
|
|
514
|
-
paginated:
|
|
686
|
+
paginated: t4
|
|
515
687
|
};
|
|
516
|
-
$[
|
|
517
|
-
$[
|
|
518
|
-
$[
|
|
519
|
-
} else
|
|
520
|
-
const table = useDataTable(
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
table
|
|
529
|
-
}) : toolbar;
|
|
530
|
-
$[22] = table;
|
|
531
|
-
$[23] = toolbar;
|
|
532
|
-
$[24] = rows;
|
|
533
|
-
$[25] = t5;
|
|
534
|
-
} else {
|
|
535
|
-
rows = $[24];
|
|
536
|
-
t5 = $[25];
|
|
537
|
-
}
|
|
538
|
-
const extra = t5;
|
|
688
|
+
$[21] = options;
|
|
689
|
+
$[22] = t4;
|
|
690
|
+
$[23] = t5;
|
|
691
|
+
} else t5 = $[23];
|
|
692
|
+
const table = useDataTable(t5);
|
|
693
|
+
const rows = table.rows.map(_temp2);
|
|
694
|
+
const context = {
|
|
695
|
+
rows,
|
|
696
|
+
selection: table.selection,
|
|
697
|
+
table
|
|
698
|
+
};
|
|
699
|
+
const extra = typeof toolbar === "function" ? toolbar(context) : toolbar;
|
|
539
700
|
const narrow = useMediaQuery(NARROW_SCREEN);
|
|
540
701
|
const [filtersOpen, setFiltersOpen] = React.useState(false);
|
|
541
702
|
const selecting = table.selectable && table.selection.length > 0;
|
|
542
|
-
const showSummary = showToolbar &&
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
703
|
+
const showSummary = showToolbar && !table.paginated && !selecting;
|
|
704
|
+
const exportButton = exportName && /* @__PURE__ */ jsx(Tooltip, {
|
|
705
|
+
content: table.labels.export,
|
|
706
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
707
|
+
variant: "secondary",
|
|
708
|
+
size: controlSize,
|
|
709
|
+
"aria-label": table.labels.export,
|
|
710
|
+
disabled: !rows.length,
|
|
711
|
+
onClick: () => downloadCsv(table.columns, rows, exportName),
|
|
712
|
+
children: /* @__PURE__ */ jsx(DownloadIcon, {})
|
|
713
|
+
})
|
|
714
|
+
});
|
|
715
|
+
const T0 = DataTableRoot;
|
|
716
|
+
const t6 = fill || void 0;
|
|
717
|
+
const t7 = showToolbar && (narrow ? /* @__PURE__ */ jsxs(DataTableToolbar, {
|
|
718
|
+
"data-layout": "narrow",
|
|
719
|
+
children: [
|
|
720
|
+
table.searchable && /* @__PURE__ */ jsx(DataTableSearch, { size: controlSize }),
|
|
721
|
+
/* @__PURE__ */ jsx(DataTableFilterSheet, {
|
|
549
722
|
size: controlSize,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
723
|
+
children: extra
|
|
724
|
+
}),
|
|
725
|
+
exportButton
|
|
726
|
+
]
|
|
727
|
+
}) : /* @__PURE__ */ jsxs(DataTableToolbar, {
|
|
728
|
+
"data-size": controlSize,
|
|
729
|
+
children: [/* @__PURE__ */ jsxs(DataTableControls, { children: [
|
|
730
|
+
table.searchable && /* @__PURE__ */ jsx(DataTableSearch, { size: controlSize }),
|
|
731
|
+
/* @__PURE__ */ jsx(DataTableFilterPanel, {
|
|
732
|
+
size: controlSize,
|
|
733
|
+
open: filtersOpen,
|
|
734
|
+
onOpenChange: setFiltersOpen
|
|
735
|
+
}),
|
|
736
|
+
/* @__PURE__ */ jsx(DataTableFilters, {
|
|
737
|
+
size: controlSize,
|
|
738
|
+
quick: true
|
|
739
|
+
}),
|
|
740
|
+
/* @__PURE__ */ jsx(DataTableClearFilters, { keepSpace: true })
|
|
741
|
+
] }), /* @__PURE__ */ jsxs(DataTableActions, { children: [
|
|
742
|
+
/* @__PURE__ */ jsx(DataTableLoading, {}),
|
|
743
|
+
extra,
|
|
744
|
+
columnsMenu && /* @__PURE__ */ jsx(DataTableColumnsMenu, { size: controlSize }),
|
|
745
|
+
exportButton
|
|
746
|
+
] })]
|
|
747
|
+
}));
|
|
565
748
|
let t8;
|
|
566
|
-
if ($[
|
|
567
|
-
t8 = showToolbar &&
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
children: extra
|
|
574
|
-
}),
|
|
575
|
-
exportButton
|
|
576
|
-
]
|
|
577
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(DataTableToolbar, {
|
|
578
|
-
"data-size": controlSize,
|
|
579
|
-
children: [/* @__PURE__ */ jsxs(DataTableControls, { children: [
|
|
580
|
-
table.searchable && /* @__PURE__ */ jsx(DataTableSearch, { size: controlSize }),
|
|
581
|
-
/* @__PURE__ */ jsx(DataTableFilters, {
|
|
582
|
-
size: controlSize,
|
|
583
|
-
quick: true
|
|
584
|
-
}),
|
|
585
|
-
/* @__PURE__ */ jsx(DataTableFilterPanel, {
|
|
586
|
-
size: controlSize,
|
|
587
|
-
open: filtersOpen,
|
|
588
|
-
onOpenChange: setFiltersOpen
|
|
589
|
-
}),
|
|
590
|
-
/* @__PURE__ */ jsx(DataTableClearFilters, { keepSpace: true })
|
|
591
|
-
] }), /* @__PURE__ */ jsxs(DataTableActions, { children: [
|
|
592
|
-
/* @__PURE__ */ jsx(DataTableLoading, {}),
|
|
593
|
-
extra,
|
|
594
|
-
exportButton
|
|
595
|
-
] })]
|
|
596
|
-
}), /* @__PURE__ */ jsx(DataTableActiveFilters, { onEdit: () => setFiltersOpen(true) })] }));
|
|
597
|
-
$[32] = controlSize;
|
|
598
|
-
$[33] = exportButton;
|
|
599
|
-
$[34] = extra;
|
|
600
|
-
$[35] = filtersOpen;
|
|
601
|
-
$[36] = narrow;
|
|
602
|
-
$[37] = showToolbar;
|
|
603
|
-
$[38] = table.searchable;
|
|
604
|
-
$[39] = t8;
|
|
605
|
-
} else t8 = $[39];
|
|
749
|
+
if ($[24] !== narrow || $[25] !== showToolbar) {
|
|
750
|
+
t8 = showToolbar && !narrow && /* @__PURE__ */ jsx(DataTableActiveFilters, { onEdit: () => setFiltersOpen(true) });
|
|
751
|
+
$[24] = narrow;
|
|
752
|
+
$[25] = showToolbar;
|
|
753
|
+
$[26] = t8;
|
|
754
|
+
} else t8 = $[26];
|
|
755
|
+
const T1 = DataTableContent;
|
|
606
756
|
const t9 = fill ? maxHeight ?? "none" : maxHeight;
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
757
|
+
const t10 = bulkActions?.(context);
|
|
758
|
+
let t11;
|
|
759
|
+
if ($[27] !== T1 || $[28] !== density || $[29] !== empty || $[30] !== layout || $[31] !== onEndReached || $[32] !== stickyFirstColumn || $[33] !== stickyHeader || $[34] !== striped || $[35] !== t10 || $[36] !== t9 || $[37] !== tableProps || $[38] !== virtualized) {
|
|
760
|
+
t11 = /* @__PURE__ */ jsx(T1, {
|
|
610
761
|
density,
|
|
611
762
|
striped,
|
|
612
763
|
stickyHeader,
|
|
@@ -616,56 +767,58 @@ function DataTableComponent(t0) {
|
|
|
616
767
|
onEndReached,
|
|
617
768
|
stickyFirstColumn,
|
|
618
769
|
empty,
|
|
619
|
-
tableProps
|
|
770
|
+
tableProps,
|
|
771
|
+
selectionActions: t10
|
|
620
772
|
});
|
|
621
|
-
$[
|
|
622
|
-
$[
|
|
623
|
-
$[
|
|
624
|
-
$[
|
|
625
|
-
$[
|
|
626
|
-
$[
|
|
627
|
-
$[
|
|
628
|
-
$[
|
|
629
|
-
$[
|
|
630
|
-
$[
|
|
631
|
-
$[
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
773
|
+
$[27] = T1;
|
|
774
|
+
$[28] = density;
|
|
775
|
+
$[29] = empty;
|
|
776
|
+
$[30] = layout;
|
|
777
|
+
$[31] = onEndReached;
|
|
778
|
+
$[32] = stickyFirstColumn;
|
|
779
|
+
$[33] = stickyHeader;
|
|
780
|
+
$[34] = striped;
|
|
781
|
+
$[35] = t10;
|
|
782
|
+
$[36] = t9;
|
|
783
|
+
$[37] = tableProps;
|
|
784
|
+
$[38] = virtualized;
|
|
785
|
+
$[39] = t11;
|
|
786
|
+
} else t11 = $[39];
|
|
787
|
+
let t12;
|
|
788
|
+
if ($[40] !== pageSizeOptions || $[41] !== showSummary || $[42] !== table.paginated) {
|
|
789
|
+
t12 = (showSummary || table.paginated) && /* @__PURE__ */ jsxs("div", {
|
|
636
790
|
className: "oui-data-table__footer",
|
|
637
|
-
children: [showSummary && /* @__PURE__ */ jsx(DataTableSummary, {}), /* @__PURE__ */ jsx(DataTablePagination, {
|
|
638
|
-
pageSizeOptions,
|
|
639
|
-
hideRange: selecting
|
|
640
|
-
})]
|
|
791
|
+
children: [showSummary && /* @__PURE__ */ jsx(DataTableSummary, {}), /* @__PURE__ */ jsx(DataTablePagination, { pageSizeOptions })]
|
|
641
792
|
});
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
t12 = /* @__PURE__ */ jsxs(DataTableRoot, {
|
|
793
|
+
$[40] = pageSizeOptions;
|
|
794
|
+
$[41] = showSummary;
|
|
795
|
+
$[42] = table.paginated;
|
|
796
|
+
$[43] = t12;
|
|
797
|
+
} else t12 = $[43];
|
|
798
|
+
let t13;
|
|
799
|
+
if ($[44] !== T0 || $[45] !== className || $[46] !== t11 || $[47] !== t12 || $[48] !== t6 || $[49] !== t7 || $[50] !== t8 || $[51] !== table) {
|
|
800
|
+
t13 = /* @__PURE__ */ jsxs(T0, {
|
|
651
801
|
table,
|
|
652
802
|
className,
|
|
653
|
-
"data-fill":
|
|
803
|
+
"data-fill": t6,
|
|
654
804
|
children: [
|
|
805
|
+
t7,
|
|
655
806
|
t8,
|
|
656
|
-
|
|
657
|
-
|
|
807
|
+
t11,
|
|
808
|
+
t12
|
|
658
809
|
]
|
|
659
810
|
});
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
663
|
-
$[
|
|
664
|
-
$[
|
|
665
|
-
$[
|
|
666
|
-
$[
|
|
667
|
-
|
|
668
|
-
|
|
811
|
+
$[44] = T0;
|
|
812
|
+
$[45] = className;
|
|
813
|
+
$[46] = t11;
|
|
814
|
+
$[47] = t12;
|
|
815
|
+
$[48] = t6;
|
|
816
|
+
$[49] = t7;
|
|
817
|
+
$[50] = t8;
|
|
818
|
+
$[51] = table;
|
|
819
|
+
$[52] = t13;
|
|
820
|
+
} else t13 = $[52];
|
|
821
|
+
return t13;
|
|
669
822
|
}
|
|
670
823
|
/**
|
|
671
824
|
* `<DataTable data={…} columns={…} />` renders a complete table with search,
|
|
@@ -681,13 +834,14 @@ function DataTableComponent(t0) {
|
|
|
681
834
|
* (the "Filters" button and panel for the other filters),
|
|
682
835
|
* `DataTable.ActiveFilters` (their tags), `DataTable.FilterSheet` (the phone
|
|
683
836
|
* filter button and sheet), `DataTable.ClearFilters`, `DataTable.Actions`,
|
|
837
|
+
* `DataTable.ColumnsMenu`,
|
|
684
838
|
* `DataTable.Loading`, `DataTable.Summary`, `DataTable.Content`,
|
|
685
839
|
* `DataTable.Pagination`.
|
|
686
840
|
*
|
|
687
841
|
* On phones (below 640px) columns with `priority: 'low'` are hidden, and
|
|
688
842
|
* `stickyFirstColumn` keeps each row's name in view while the rest scrolls.
|
|
689
843
|
*/
|
|
690
|
-
function
|
|
844
|
+
function _temp2(t0) {
|
|
691
845
|
const { row } = t0;
|
|
692
846
|
return row;
|
|
693
847
|
}
|
|
@@ -703,6 +857,7 @@ var DataTable = Object.assign(DataTableComponent, {
|
|
|
703
857
|
ActiveFilters: DataTableActiveFilters,
|
|
704
858
|
Actions: DataTableActions,
|
|
705
859
|
ClearFilters: DataTableClearFilters,
|
|
860
|
+
ColumnsMenu: DataTableColumnsMenu,
|
|
706
861
|
Loading: DataTableLoading,
|
|
707
862
|
Summary: DataTableSummary,
|
|
708
863
|
Content: DataTableContent,
|