@eifi1/ui-kit 0.8.1 → 0.10.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 +25 -11
- package/dist/components/alert-banner.d.ts +32 -5
- package/dist/components/alert-banner.js +57 -14
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +6 -0
- package/dist/components/breadcrumbs.d.ts +60 -0
- package/dist/components/breadcrumbs.js +88 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/bulk-action-bar.d.ts +66 -0
- package/dist/components/bulk-action-bar.js +149 -0
- package/dist/components/bulk-action-bar.js.map +1 -0
- package/dist/components/calculator.d.ts +6 -0
- package/dist/components/chip.d.ts +58 -10
- package/dist/components/chip.js +91 -7
- package/dist/components/chip.js.map +1 -1
- package/dist/components/copy-button.d.ts +13 -4
- package/dist/components/copy-button.js +17 -4
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +122 -91
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.d.ts +89 -3
- package/dist/components/date-picker.js +163 -68
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/description-list.d.ts +43 -6
- package/dist/components/description-list.js +91 -11
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +7 -0
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/disclosure.d.ts +68 -4
- package/dist/components/disclosure.js +33 -15
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/file-dropzone.d.ts +3 -4
- package/dist/components/file-dropzone.js +2 -1
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/floating-panel.d.ts +29 -2
- package/dist/components/floating-panel.js +16 -2
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/full-bleed-dialog.d.ts +23 -4
- package/dist/components/full-bleed-dialog.js +11 -2
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/list.d.ts +174 -0
- package/dist/components/list.js +215 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/menu-item.d.ts +99 -0
- package/dist/components/menu-item.js +83 -0
- package/dist/components/menu-item.js.map +1 -0
- package/dist/components/modal.d.ts +23 -1
- package/dist/components/modal.js +36 -10
- package/dist/components/modal.js.map +1 -1
- package/dist/components/number-field.d.ts +6 -0
- package/dist/components/number-input.d.ts +6 -0
- package/dist/components/numpad-sheet.d.ts +6 -0
- package/dist/components/page-contents.js +1 -2
- package/dist/components/page-contents.js.map +1 -1
- package/dist/components/page-header.d.ts +37 -0
- package/dist/components/page-header.js +36 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/progress-bar.d.ts +16 -2
- package/dist/components/progress-bar.js +4 -2
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/series-chart-labels.d.ts +3 -0
- package/dist/components/series-chart-labels.js +2 -1
- package/dist/components/series-chart-labels.js.map +1 -1
- package/dist/components/series-chart.d.ts +16 -0
- package/dist/components/series-chart.js +137 -3
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/status-dot.d.ts +49 -0
- package/dist/components/status-dot.js +52 -0
- package/dist/components/status-dot.js.map +1 -0
- package/dist/components/table.d.ts +39 -6
- package/dist/components/table.js +43 -4
- package/dist/components/table.js.map +1 -1
- package/dist/components/text.d.ts +63 -0
- package/dist/components/text.js +23 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/toast.d.ts +167 -0
- package/dist/components/toast.js +226 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toggle-group.d.ts +29 -1
- package/dist/components/toggle-group.js +52 -3
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/tooltip.d.ts +38 -15
- package/dist/components/tooltip.js +85 -47
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/ui.d.ts +139 -16
- package/dist/components/ui.js +136 -26
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +1 -1
- package/dist/{data-table-filters-CF1PXqjQ.d.ts → data-table-filters-Dh9uF_S-.d.ts} +33 -2
- package/dist/data-table.d.ts +1 -1
- package/dist/hooks/use-close-transition.d.ts +7 -1
- package/dist/hooks/use-close-transition.js +5 -2
- package/dist/hooks/use-close-transition.js.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -1
- package/dist/hooks/use-overlay-history.js +84 -4
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/i18n/defaults.d.ts +6 -0
- package/dist/i18n/defaults.js +11 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +11 -0
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/de-CH-informal.d.ts +6 -0
- package/dist/i18n/locales/de-CH.d.ts +6 -0
- package/dist/i18n/locales/de-informal.d.ts +6 -0
- package/dist/i18n/locales/de.d.ts +6 -0
- package/dist/i18n/locales/de.js +31 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +6 -0
- package/dist/i18n/locales/es.js +31 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +6 -0
- package/dist/i18n/locales/fr.js +31 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +6 -0
- package/dist/i18n/locales/hu.js +31 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +6 -0
- package/dist/i18n/locales/it.js +31 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +6 -0
- package/dist/i18n/locales/zh.js +31 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/clipping.d.ts +9 -0
- package/dist/lib/clipping.js +14 -0
- package/dist/lib/clipping.js.map +1 -0
- package/dist/search/command-palette.d.ts +67 -2
- package/dist/search/command-palette.js +147 -33
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search/global-search.d.ts +166 -0
- package/dist/search/global-search.js +293 -0
- package/dist/search/global-search.js.map +1 -0
- package/dist/search/search-index.d.ts +105 -0
- package/dist/search/search-index.js +142 -0
- package/dist/search/search-index.js.map +1 -0
- package/dist/search.d.ts +3 -1
- package/dist/search.js +2 -0
- package/dist/search.js.map +1 -1
- package/dist/wizard/stepper-nav.d.ts +10 -1
- package/dist/wizard/stepper-nav.js +3 -2
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.d.ts +2 -2
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.js +1 -1
- package/dist/wizard/use-wizard.js.map +1 -1
- package/dist/wizard/wizard-summary.js +3 -3
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/package.json +25 -12
- package/src/components/alert-banner.tsx +117 -18
- package/src/components/breadcrumbs.tsx +168 -0
- package/src/components/bulk-action-bar.tsx +256 -0
- package/src/components/chip.tsx +164 -13
- package/src/components/copy-button.tsx +29 -7
- package/src/components/data-table.tsx +81 -5
- package/src/components/date-picker.tsx +377 -118
- package/src/components/description-list.tsx +168 -15
- package/src/components/dialog-frame.tsx +7 -0
- package/src/components/disclosure.tsx +116 -28
- package/src/components/file-dropzone.tsx +9 -10
- package/src/components/floating-panel.tsx +46 -2
- package/src/components/full-bleed-dialog.tsx +42 -5
- package/src/components/list.tsx +417 -0
- package/src/components/menu-item.tsx +214 -0
- package/src/components/modal.tsx +80 -17
- package/src/components/page-contents.tsx +4 -4
- package/src/components/page-header.tsx +68 -0
- package/src/components/progress-bar.tsx +27 -3
- package/src/components/series-chart-labels.ts +4 -0
- package/src/components/series-chart.tsx +253 -3
- package/src/components/status-dot.tsx +99 -0
- package/src/components/table.tsx +91 -6
- package/src/components/text.tsx +89 -0
- package/src/components/toast.tsx +441 -0
- package/src/components/toggle-group.tsx +82 -3
- package/src/components/tooltip.tsx +186 -100
- package/src/components/ui.tsx +321 -41
- package/src/hooks/use-close-transition.ts +14 -5
- package/src/hooks/use-copy-to-clipboard.ts +1 -1
- package/src/hooks/use-overlay-history.ts +181 -4
- package/src/i18n/defaults.ts +10 -0
- package/src/i18n/kit-labels.tsx +10 -0
- package/src/i18n/locales/de.ts +30 -0
- package/src/i18n/locales/es.ts +30 -0
- package/src/i18n/locales/fr.ts +30 -0
- package/src/i18n/locales/hu.ts +30 -0
- package/src/i18n/locales/it.ts +30 -0
- package/src/i18n/locales/zh.ts +30 -0
- package/src/index.ts +30 -0
- package/src/lib/clipping.ts +16 -0
- package/src/search/command-palette.tsx +241 -31
- package/src/search/global-search.tsx +525 -0
- package/src/search/search-index.ts +295 -0
- package/src/search.ts +2 -0
- package/src/wizard/stepper-nav.tsx +13 -2
- package/src/wizard/types.ts +2 -2
- package/src/wizard/use-wizard.ts +3 -3
- package/src/wizard/wizard-summary.tsx +14 -10
- package/tokens.css +97 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createElement } from "react";
|
|
3
4
|
import { Fragment as Fragment2, useEffect, useMemo, useRef, useState } from "react";
|
|
4
5
|
import { createPortal } from "react-dom";
|
|
5
6
|
import {
|
|
@@ -34,6 +35,23 @@ import { resolveDataTableLabels } from "./data-table-labels.js";
|
|
|
34
35
|
import { useKitLabelOverrides, useKitLocale } from "../i18n/kit-labels.js";
|
|
35
36
|
import { Tooltip } from "./tooltip.js";
|
|
36
37
|
import { dirOf, isRtl } from "../lib/direction.js";
|
|
38
|
+
function splitCellProps(props) {
|
|
39
|
+
if (!props) return { attrs: {} };
|
|
40
|
+
const {
|
|
41
|
+
className,
|
|
42
|
+
style,
|
|
43
|
+
role: _role,
|
|
44
|
+
"data-col": _col,
|
|
45
|
+
...attrs
|
|
46
|
+
} = props;
|
|
47
|
+
return { attrs, className, style };
|
|
48
|
+
}
|
|
49
|
+
function dataAttrsOf(props) {
|
|
50
|
+
if (!props) return void 0;
|
|
51
|
+
const out = {};
|
|
52
|
+
for (const [k, v] of Object.entries(props)) if (k.startsWith("data-") && k !== "data-col") out[k] = v;
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
37
55
|
function physicalSwipe(actions, dir) {
|
|
38
56
|
const rtl = dir === "rtl";
|
|
39
57
|
return {
|
|
@@ -495,7 +513,7 @@ function DataTable({
|
|
|
495
513
|
);
|
|
496
514
|
const cardInner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
497
515
|
/* @__PURE__ */ jsx("div", { className: cn("flex min-w-0 flex-1 flex-col", compact ? "gap-1" : "gap-2"), children: mobileCard ? mobileCard(row) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
498
|
-
mobilePrimaryCol && /* @__PURE__ */ jsx("div", { className: "font-medium", children: mobilePrimaryCol.cell(row) }),
|
|
516
|
+
mobilePrimaryCol && /* @__PURE__ */ jsx("div", { ...dataAttrsOf(mobilePrimaryCol.cellProps?.(row)), className: "font-medium", children: mobilePrimaryCol.cell(row) }),
|
|
499
517
|
mobileSecondaryColumns.length > 0 && /* @__PURE__ */ jsx(
|
|
500
518
|
"dl",
|
|
501
519
|
{
|
|
@@ -505,7 +523,14 @@ function DataTable({
|
|
|
505
523
|
),
|
|
506
524
|
children: mobileSecondaryColumns.map((col) => /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
507
525
|
/* @__PURE__ */ jsx("dt", { className: "text-xs uppercase tracking-wide text-[var(--text-muted)] self-center", children: col.header }),
|
|
508
|
-
/* @__PURE__ */ jsx(
|
|
526
|
+
/* @__PURE__ */ jsx(
|
|
527
|
+
"dd",
|
|
528
|
+
{
|
|
529
|
+
...dataAttrsOf(col.cellProps?.(row)),
|
|
530
|
+
className: "min-w-0 text-[var(--text-secondary)] self-center",
|
|
531
|
+
children: col.cell(row)
|
|
532
|
+
}
|
|
533
|
+
)
|
|
509
534
|
] }, col.key))
|
|
510
535
|
}
|
|
511
536
|
)
|
|
@@ -729,16 +754,20 @@ function DataTable({
|
|
|
729
754
|
const headClass = logicalAlign(col.headClassName);
|
|
730
755
|
const isEndAligned = !!headClass && END_ALIGN.test(headClass);
|
|
731
756
|
const width = widths[col.key];
|
|
732
|
-
|
|
757
|
+
const ownHead = splitCellProps(col.headProps);
|
|
758
|
+
const pinnedHead = width ? { width, minWidth: width, maxWidth: width } : void 0;
|
|
759
|
+
return /* @__PURE__ */ createElement(
|
|
733
760
|
"th",
|
|
734
761
|
{
|
|
762
|
+
...ownHead.attrs,
|
|
763
|
+
key: col.key,
|
|
735
764
|
ref: (el) => {
|
|
736
765
|
if (el) headRefs.set(col.key, el);
|
|
737
766
|
else headRefs.delete(col.key);
|
|
738
767
|
},
|
|
739
768
|
scope: "col",
|
|
740
769
|
"aria-sort": sortable ? sortIdx === 0 ? sorts[0].dir === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
741
|
-
style:
|
|
770
|
+
style: ownHead.style || pinnedHead ? { ...ownHead.style, ...pinnedHead } : void 0,
|
|
742
771
|
className: cn(
|
|
743
772
|
"relative font-medium align-middle whitespace-nowrap",
|
|
744
773
|
compact ? "px-2 py-1" : "px-3 py-2",
|
|
@@ -746,93 +775,91 @@ function DataTable({
|
|
|
746
775
|
// Each <th> carries its own bg so the row doesn't render
|
|
747
776
|
// transparent over the data rows underneath.
|
|
748
777
|
"sticky top-0 z-10 bg-[var(--bg-surface-2)] backdrop-blur-sm",
|
|
778
|
+
logicalAlign(ownHead.className),
|
|
749
779
|
headClass
|
|
750
|
-
)
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
780
|
+
)
|
|
781
|
+
},
|
|
782
|
+
/* @__PURE__ */ jsxs(
|
|
783
|
+
"div",
|
|
784
|
+
{
|
|
785
|
+
className: cn(
|
|
786
|
+
"flex items-center gap-1",
|
|
787
|
+
isEndAligned && "flex-row-reverse"
|
|
788
|
+
),
|
|
789
|
+
children: [
|
|
790
|
+
/* @__PURE__ */ jsx(Tooltip, { label: sortable && multiSort ? labels.sortHint : void 0, portal: true, children: /* @__PURE__ */ jsxs(
|
|
791
|
+
"button",
|
|
792
|
+
{
|
|
793
|
+
type: "button",
|
|
794
|
+
onClick: (e) => sortable && toggleSort(col.key, e.shiftKey),
|
|
795
|
+
disabled: !sortable,
|
|
796
|
+
className: cn(
|
|
797
|
+
"flex items-center gap-1 text-start",
|
|
798
|
+
sortable && "hover:text-[var(--text-primary)]"
|
|
799
|
+
),
|
|
800
|
+
children: [
|
|
801
|
+
/* @__PURE__ */ jsx("span", { children: col.header }),
|
|
802
|
+
sortable && /* @__PURE__ */ jsx(Icon, { className: cn("size-3", active ? "opacity-100" : "opacity-40") }),
|
|
803
|
+
active && sorts.length > 1 && /* @__PURE__ */ jsx("span", { className: "text-[9px] font-semibold leading-none text-brand", children: sortIdx + 1 })
|
|
804
|
+
]
|
|
805
|
+
}
|
|
806
|
+
) }),
|
|
807
|
+
filter && /* @__PURE__ */ jsx(
|
|
808
|
+
Popover,
|
|
809
|
+
{
|
|
810
|
+
width: filter.type === "date" ? 420 : void 0,
|
|
811
|
+
labels: { panel: labels.filter },
|
|
812
|
+
trigger: ({ toggle, ref }) => /* @__PURE__ */ jsx(
|
|
761
813
|
"button",
|
|
762
814
|
{
|
|
763
815
|
type: "button",
|
|
764
|
-
|
|
765
|
-
|
|
816
|
+
ref,
|
|
817
|
+
onClick: toggle,
|
|
818
|
+
"aria-label": labels.filter,
|
|
766
819
|
className: cn(
|
|
767
|
-
"
|
|
768
|
-
|
|
820
|
+
"rounded p-1 transition-colors",
|
|
821
|
+
filterActive ? "bg-[var(--brand-bg)] text-[var(--brand-muted)]" : "text-[var(--text-placeholder)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]"
|
|
769
822
|
),
|
|
770
|
-
children:
|
|
771
|
-
/* @__PURE__ */ jsx("span", { children: col.header }),
|
|
772
|
-
sortable && /* @__PURE__ */ jsx(Icon, { className: cn("size-3", active ? "opacity-100" : "opacity-40") }),
|
|
773
|
-
active && sorts.length > 1 && /* @__PURE__ */ jsx("span", { className: "text-[9px] font-semibold leading-none text-brand", children: sortIdx + 1 })
|
|
774
|
-
]
|
|
823
|
+
children: /* @__PURE__ */ jsx(Filter, { className: "size-3" })
|
|
775
824
|
}
|
|
776
|
-
)
|
|
777
|
-
|
|
778
|
-
|
|
825
|
+
),
|
|
826
|
+
children: () => /* @__PURE__ */ jsx(
|
|
827
|
+
FilterPopover,
|
|
779
828
|
{
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
onClick: toggle,
|
|
788
|
-
"aria-label": labels.filter,
|
|
789
|
-
className: cn(
|
|
790
|
-
"rounded p-1 transition-colors",
|
|
791
|
-
filterActive ? "bg-[var(--brand-bg)] text-[var(--brand-muted)]" : "text-[var(--text-placeholder)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]"
|
|
792
|
-
),
|
|
793
|
-
children: /* @__PURE__ */ jsx(Filter, { className: "size-3" })
|
|
794
|
-
}
|
|
795
|
-
),
|
|
796
|
-
children: () => /* @__PURE__ */ jsx(
|
|
797
|
-
FilterPopover,
|
|
798
|
-
{
|
|
799
|
-
column: col,
|
|
800
|
-
state: filterState ?? defaultFilterState(filter),
|
|
801
|
-
onChange: (next) => setFilterValue(col.key, next),
|
|
802
|
-
onClear: () => clearFilter(col.key),
|
|
803
|
-
selectOptions: selectOptionsByKey[col.key] ?? [],
|
|
804
|
-
labels,
|
|
805
|
-
locale
|
|
806
|
-
}
|
|
807
|
-
)
|
|
829
|
+
column: col,
|
|
830
|
+
state: filterState ?? defaultFilterState(filter),
|
|
831
|
+
onChange: (next) => setFilterValue(col.key, next),
|
|
832
|
+
onClear: () => clearFilter(col.key),
|
|
833
|
+
selectOptions: selectOptionsByKey[col.key] ?? [],
|
|
834
|
+
labels,
|
|
835
|
+
locale
|
|
808
836
|
}
|
|
809
837
|
)
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
)
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
col.key
|
|
838
|
+
}
|
|
839
|
+
)
|
|
840
|
+
]
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
resizable && /* @__PURE__ */ jsx(
|
|
844
|
+
"span",
|
|
845
|
+
{
|
|
846
|
+
role: "separator",
|
|
847
|
+
"aria-orientation": "vertical",
|
|
848
|
+
onPointerDown: (e) => startResize(e, col.key),
|
|
849
|
+
onPointerMove: moveResize,
|
|
850
|
+
onPointerUp: (e) => finishResize(e, true),
|
|
851
|
+
onPointerCancel: (e) => finishResize(e, false),
|
|
852
|
+
onDoubleClick: (e) => {
|
|
853
|
+
e.preventDefault();
|
|
854
|
+
setWidths((w) => {
|
|
855
|
+
const next = { ...w };
|
|
856
|
+
delete next[col.key];
|
|
857
|
+
return next;
|
|
858
|
+
});
|
|
859
|
+
},
|
|
860
|
+
className: "absolute end-0 top-0 z-10 h-full w-1.5 -translate-x-1/2 rtl:translate-x-1/2 cursor-col-resize select-none touch-none hover:bg-[var(--brand-bg-hover)]"
|
|
861
|
+
}
|
|
862
|
+
)
|
|
836
863
|
);
|
|
837
864
|
})
|
|
838
865
|
] }) }),
|
|
@@ -927,25 +954,29 @@ function DataTable({
|
|
|
927
954
|
),
|
|
928
955
|
visibleColumns.map((col) => {
|
|
929
956
|
const width = widths[col.key];
|
|
930
|
-
|
|
957
|
+
const own = splitCellProps(col.cellProps?.(row));
|
|
958
|
+
const pinned = width ? { width, minWidth: width, maxWidth: width } : void 0;
|
|
959
|
+
return /* @__PURE__ */ createElement(
|
|
931
960
|
"td",
|
|
932
961
|
{
|
|
962
|
+
...own.attrs,
|
|
963
|
+
key: col.key,
|
|
933
964
|
"data-col": col.key,
|
|
934
|
-
style:
|
|
965
|
+
style: own.style || pinned ? { ...own.style, ...pinned } : void 0,
|
|
935
966
|
className: cn(
|
|
936
967
|
"align-top",
|
|
937
968
|
compact ? "px-2 py-1" : "px-3 py-2",
|
|
938
969
|
width && "overflow-hidden text-ellipsis",
|
|
970
|
+
logicalAlign(own.className),
|
|
939
971
|
logicalAlign(col.className)
|
|
940
|
-
)
|
|
941
|
-
children: col === linkColumn && href ? (
|
|
942
|
-
// No `onActivate`: the click is left to bubble to the
|
|
943
|
-
// <tr> handler above, which already owns expand-vs-select.
|
|
944
|
-
// Calling it here as well would toggle the row twice.
|
|
945
|
-
/* @__PURE__ */ jsx(RowLink, { href, className: "block", "data-row-link": "", children: col.cell(row) })
|
|
946
|
-
) : col.cell(row)
|
|
972
|
+
)
|
|
947
973
|
},
|
|
948
|
-
col
|
|
974
|
+
col === linkColumn && href ? (
|
|
975
|
+
// No `onActivate`: the click is left to bubble to the
|
|
976
|
+
// <tr> handler above, which already owns expand-vs-select.
|
|
977
|
+
// Calling it here as well would toggle the row twice.
|
|
978
|
+
/* @__PURE__ */ jsx(RowLink, { href, className: "block", "data-row-link": "", children: col.cell(row) })
|
|
979
|
+
) : col.cell(row)
|
|
949
980
|
);
|
|
950
981
|
})
|
|
951
982
|
]
|