@scattered-light/loomiere-base-ui 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -2
- package/dist/{chunk-JUUPOOQQ.js → chunk-LJQ3RZDJ.js} +51 -3
- package/dist/chunk-LJQ3RZDJ.js.map +1 -0
- package/dist/custom/collection/index.d.ts +6 -1
- package/dist/custom/collection/index.js +18 -12
- package/dist/custom/collection/index.js.map +1 -1
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +1 -1
- package/dist/design-system/components/ContextMenu/README.md +1 -1
- package/dist/design-system/components/ContextMenu/preview.html +1 -1
- package/dist/design-system/components/DataList/README.md +1 -1
- package/dist/design-system/components/DataList/preview.html +1 -1
- package/dist/design-system/components/DataTable/README.md +1 -1
- package/dist/design-system/components/DataTable/preview.html +38 -38
- package/dist/design-system/components/DescriptionList/README.md +41 -0
- package/dist/design-system/components/DescriptionList/preview.html +19 -0
- package/dist/design-system/components/Drawer/README.md +1 -1
- package/dist/design-system/components/ScrollArea/preview.html +2 -2
- package/dist/design-system/components/Sheet/README.md +46 -0
- package/dist/design-system/components/Sheet/preview.html +19 -0
- package/dist/design-system/components/StatFigure/README.md +38 -0
- package/dist/design-system/components/StatFigure/preview.html +19 -0
- package/dist/design-system/components/Table/README.md +2 -2
- package/dist/design-system/components/Table/preview.html +2 -2
- package/dist/design-system/components/bundle.js +7 -7
- package/dist/design-system/components/index.d.ts +1 -1
- package/dist/design-system/components/styles.css +370 -56
- package/dist/{index-ChJXlxzq.d.ts → index-CBAo353T.d.ts} +55 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/components/Accordion.css +1 -1
- package/dist/styles/components/AlertDialog.css +1 -1
- package/dist/styles/components/Autocomplete.css +1 -1
- package/dist/styles/components/Avatar.css +1 -1
- package/dist/styles/components/Button.css +1 -1
- package/dist/styles/components/Checkbox.css +1 -1
- package/dist/styles/components/CheckboxGroup.css +1 -1
- package/dist/styles/components/Collapsible.css +1 -1
- package/dist/styles/components/Combobox.css +1 -1
- package/dist/styles/components/ContextMenu.css +1 -1
- package/dist/styles/components/Dialog.css +1 -1
- package/dist/styles/components/Drawer.css +8 -2
- package/dist/styles/components/Field.css +1 -1
- package/dist/styles/components/Fieldset.css +1 -1
- package/dist/styles/components/Form.css +1 -1
- package/dist/styles/components/Input.css +1 -1
- package/dist/styles/components/Menu.css +1 -1
- package/dist/styles/components/Menubar.css +1 -1
- package/dist/styles/components/Meter.css +1 -1
- package/dist/styles/components/NavigationMenu.css +1 -1
- package/dist/styles/components/NumberField.css +1 -1
- package/dist/styles/components/OTPField.css +1 -1
- package/dist/styles/components/Popover.css +1 -1
- package/dist/styles/components/PreviewCard.css +1 -1
- package/dist/styles/components/Progress.css +1 -1
- package/dist/styles/components/Radio.css +1 -1
- package/dist/styles/components/ScrollArea.css +1 -1
- package/dist/styles/components/Select.css +1 -1
- package/dist/styles/components/Separator.css +1 -1
- package/dist/styles/components/Slider.css +1 -1
- package/dist/styles/components/Switch.css +1 -1
- package/dist/styles/components/Tabs.css +1 -1
- package/dist/styles/components/Toast.css +1 -1
- package/dist/styles/components/Toggle.css +1 -1
- package/dist/styles/components/ToggleGroup.css +1 -1
- package/dist/styles/components/Toolbar.css +1 -1
- package/dist/styles/components/Tooltip.css +1 -1
- package/dist/styles/custom/Badge.css +1 -1
- package/dist/styles/custom/Collection.css +1 -1
- package/dist/styles/custom/CollectionPagination.css +1 -1
- package/dist/styles/custom/CollectionToolbar.css +1 -1
- package/dist/styles/custom/DataList.css +19 -1
- package/dist/styles/custom/DataTable.css +1 -1
- package/dist/styles/custom/DatePicker.css +1 -1
- package/dist/styles/custom/DescriptionList.css +75 -0
- package/dist/styles/custom/EditableList.css +1 -1
- package/dist/styles/custom/EmptyState.css +1 -1
- package/dist/styles/custom/ListDetail.css +1 -1
- package/dist/styles/custom/MoneyField.css +1 -1
- package/dist/styles/custom/Sheet.css +90 -0
- package/dist/styles/custom/Splitter.css +1 -1
- package/dist/styles/custom/StatFigure.css +60 -0
- package/dist/styles/custom/Table.css +63 -1
- package/dist/styles/index.css +4 -1
- package/dist/styles/reset/accessibility.css +1 -1
- package/dist/styles/reset/reset-accessibility.css +1 -1
- package/dist/styles/reset/reset-tailwind.css +2 -2
- package/dist/styles/reset/reset.css +2 -2
- package/dist/styles/tailwind.css +4 -1
- package/package.json +2 -2
- package/dist/chunk-JUUPOOQQ.js.map +0 -1
|
@@ -432,12 +432,17 @@ interface DataTableProps<T> extends CollectionViewProps<T> {
|
|
|
432
432
|
/** 'scroll' keeps the table. 'list' swaps in DataList when the table is narrower than collection.narrow-width. */
|
|
433
433
|
narrow?: 'scroll' | 'list';
|
|
434
434
|
size?: 'sm' | 'md';
|
|
435
|
+
/**
|
|
436
|
+
* How the footer's totals row looks. 'band' (the default) is the header tray. 'subtotal' rules
|
|
437
|
+
* a single line above it; 'grand' adds a double rule under it, as on a working paper.
|
|
438
|
+
*/
|
|
439
|
+
totalStyle?: 'band' | 'subtotal' | 'grand';
|
|
435
440
|
}
|
|
436
441
|
/**
|
|
437
442
|
* A data table, the APG pattern: one tab stop for the rows, headers announce sort, and it is
|
|
438
443
|
* not a grid. A grid would say this is a spreadsheet, and it is not. AG Grid is that tool.
|
|
439
444
|
*/
|
|
440
|
-
declare function DataTable<T>({ collection, label, caption, onRowActivate, getRowHref, activeRowId, rowActions, empty, loading, stickyHeader, stickyRowHeader, narrow, size, rowNavigation, className, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
445
|
+
declare function DataTable<T>({ collection, label, caption, onRowActivate, getRowHref, activeRowId, rowActions, empty, loading, stickyHeader, stickyRowHeader, narrow, size, totalStyle, rowNavigation, className, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
441
446
|
|
|
442
447
|
interface CollectionPaginationProps {
|
|
443
448
|
/** 1-based. */
|
|
@@ -443,6 +443,7 @@ function DataTable({
|
|
|
443
443
|
stickyRowHeader = false,
|
|
444
444
|
narrow = "scroll",
|
|
445
445
|
size = "sm",
|
|
446
|
+
totalStyle = "band",
|
|
446
447
|
rowNavigation,
|
|
447
448
|
className
|
|
448
449
|
}) {
|
|
@@ -487,6 +488,7 @@ function DataTable({
|
|
|
487
488
|
stickyHeader,
|
|
488
489
|
stickyRowHeader,
|
|
489
490
|
size,
|
|
491
|
+
totalStyle,
|
|
490
492
|
className,
|
|
491
493
|
onRowActivate,
|
|
492
494
|
getRowHref,
|
|
@@ -496,7 +498,7 @@ function DataTable({
|
|
|
496
498
|
);
|
|
497
499
|
return /* @__PURE__ */ jsx("div", { ref: narrowWidth.ref, className: cn("CollectionView", asList ? className : void 0), "data-narrow": narrowWidth.under ? "" : void 0, children: view });
|
|
498
500
|
}
|
|
499
|
-
function TableView({ collection, columns, label, caption, colSpan, leaves, navigate, allSelected, someSelected, loading, empty, stickyHeader, stickyRowHeader, size, className, onRowActivate, getRowHref, activeRowId, rowActions }) {
|
|
501
|
+
function TableView({ collection, columns, label, caption, colSpan, leaves, navigate, allSelected, someSelected, loading, empty, stickyHeader, stickyRowHeader, size, totalStyle, className, onRowActivate, getRowHref, activeRowId, rowActions }) {
|
|
500
502
|
const roving = useRovingRows(leaves.length, navigate);
|
|
501
503
|
const scrollerRef = React4.useRef(null);
|
|
502
504
|
const [overflows, setOverflows] = React4.useState(false);
|
|
@@ -524,6 +526,7 @@ function TableView({ collection, columns, label, caption, colSpan, leaves, navig
|
|
|
524
526
|
}, [stickyHeader, leaves.length, columns.length]);
|
|
525
527
|
const filteredEmpty = collection.totalCount > 0 && collection.filteredCount === 0;
|
|
526
528
|
const text = collection.messages;
|
|
529
|
+
const ruled = totalStyle !== "band";
|
|
527
530
|
return /* @__PURE__ */ jsxs(
|
|
528
531
|
"div",
|
|
529
532
|
{
|
|
@@ -570,17 +573,20 @@ function TableView({ collection, columns, label, caption, colSpan, leaves, navig
|
|
|
570
573
|
rowActions ? /* @__PURE__ */ jsx("th", { scope: "col", "data-width": "min", children: /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: "Actions" }) }) : null
|
|
571
574
|
] }) }),
|
|
572
575
|
collection.pageEntries.some((entry) => entry.kind === "group") ? groupedBodies({ collection, columns, leaves, roving, navigate, onRowActivate, getRowHref, activeRowId, rowActions, colSpan, filteredEmpty, empty, loading }) : /* @__PURE__ */ jsx("tbody", { children: bodyRows({ collection, columns, leaves, roving, navigate, onRowActivate, getRowHref, activeRowId, rowActions, colSpan, filteredEmpty, empty, loading }) }),
|
|
573
|
-
Object.keys(collection.totals).length ? /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
574
|
-
collection.canSelect ? /* @__PURE__ */ jsx("td", {}) : null,
|
|
575
|
-
columns.map((column, index) =>
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
"
|
|
579
|
-
collection.
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
576
|
+
Object.keys(collection.totals).length ? /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", { "data-total": ruled ? totalStyle : void 0, children: [
|
|
577
|
+
collection.canSelect ? /* @__PURE__ */ jsx("td", { "data-rule": ruled ? "none" : void 0 }) : null,
|
|
578
|
+
columns.map((column, index) => (
|
|
579
|
+
// Ruled totals draw their lines under the figures only, not the label or blank cells.
|
|
580
|
+
/* @__PURE__ */ jsxs("td", { "data-align": alignOf(column), "data-rule": ruled && (index === 0 || !column.total) ? "none" : void 0, children: [
|
|
581
|
+
index === 0 ? text.total : typeof column.total === "function" ? column.total(collection.filteredRows) : collection.totals[column.id] ?? "",
|
|
582
|
+
index === 0 && collection.isFiltered ? /* @__PURE__ */ jsxs("span", { className: "visually-hidden", children: [
|
|
583
|
+
" of ",
|
|
584
|
+
collection.filteredCount,
|
|
585
|
+
" filtered rows"
|
|
586
|
+
] }) : null
|
|
587
|
+
] }, column.id)
|
|
588
|
+
)),
|
|
589
|
+
rowActions ? /* @__PURE__ */ jsx("td", { "data-rule": ruled ? "none" : void 0 }) : null
|
|
584
590
|
] }) }) : null
|
|
585
591
|
]
|
|
586
592
|
}
|