@eifi1/ui-kit 0.44.0 → 0.46.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 +29 -14
- package/dist/admin/admin-action-log-labels.js +9 -0
- package/dist/admin/admin-action-log-labels.js.map +1 -1
- package/dist/admin/admin-action-log.d.ts +18 -1
- package/dist/admin/admin-action-log.js +25 -16
- package/dist/admin/admin-action-log.js.map +1 -1
- package/dist/admin/admin-area-labels.d.ts +15 -0
- package/dist/admin/admin-area-labels.js +6 -1
- package/dist/admin/admin-area-labels.js.map +1 -1
- package/dist/admin/admin-overview.d.ts +16 -1
- package/dist/admin/admin-overview.js +12 -1
- package/dist/admin/admin-overview.js.map +1 -1
- package/dist/admin/mail-test-card-labels.d.ts +3 -0
- package/dist/admin/mail-test-card-labels.js +17 -0
- package/dist/admin/mail-test-card-labels.js.map +1 -0
- package/dist/admin/mail-test-card.d.ts +75 -0
- package/dist/admin/mail-test-card.js +82 -0
- package/dist/admin/mail-test-card.js.map +1 -0
- package/dist/components/appearance-labels.d.ts +10 -0
- package/dist/components/appearance-labels.js +6 -1
- package/dist/components/appearance-labels.js.map +1 -1
- package/dist/components/data-table-column-settings.js +2 -2
- package/dist/components/data-table-column-settings.js.map +1 -1
- package/dist/components/data-table-head.js +2 -2
- package/dist/components/data-table-head.js.map +1 -1
- package/dist/components/data-table-mobile.js +17 -2
- package/dist/components/data-table-mobile.js.map +1 -1
- package/dist/components/data-table-row-actions.d.ts +18 -2
- package/dist/components/data-table-row-actions.js +86 -2
- package/dist/components/data-table-row-actions.js.map +1 -1
- package/dist/components/data-table-shared.d.ts +2 -0
- package/dist/components/data-table-shared.js +17 -2
- package/dist/components/data-table-shared.js.map +1 -1
- package/dist/components/data-table.d.ts +43 -2
- package/dist/components/data-table.js +10 -10
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-format-setting.d.ts +29 -0
- package/dist/components/date-format-setting.js +36 -0
- package/dist/components/date-format-setting.js.map +1 -0
- package/dist/components/swipeable-row.d.ts +8 -0
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/tabs.d.ts +3 -2
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/translation-review-editor.js +1 -0
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review-labels.d.ts +5 -0
- package/dist/components/translation-review-labels.js +2 -0
- package/dist/components/translation-review-labels.js.map +1 -1
- package/dist/components/translation-review.d.ts +18 -8
- package/dist/components/translation-review.js +64 -7
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/write-lock-labels.js +2 -1
- package/dist/components/write-lock-labels.js.map +1 -1
- package/dist/components/write-lock.d.ts +33 -3
- package/dist/components/write-lock.js +9 -0
- package/dist/components/write-lock.js.map +1 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/feedback/feedback-row-detail.d.ts +4 -2
- package/dist/feedback/feedback-row-detail.js +17 -26
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-swipe.d.ts +18 -0
- package/dist/feedback/feedback-swipe.js +10 -1
- package/dist/feedback/feedback-swipe.js.map +1 -1
- package/dist/i18n/defaults.js +9 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +81 -5
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +25 -1
- package/dist/i18n/kit-labels.js +8 -2
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/en.js +97 -7
- package/dist/i18n/locales/en.js.map +3 -3
- package/dist/i18n/locales/es.js +81 -5
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +81 -5
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +81 -5
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +81 -5
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +81 -5
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.js +16 -2
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/date-format.d.ts +81 -0
- package/dist/lib/date-format.js +56 -0
- package/dist/lib/date-format.js.map +1 -0
- package/dist/lib/format.d.ts +5 -1
- package/dist/lib/format.js +11 -5
- package/dist/lib/format.js.map +1 -1
- package/dist/notifications/device-zone-report.d.ts +27 -0
- package/dist/notifications/device-zone-report.js +24 -0
- package/dist/notifications/device-zone-report.js.map +1 -0
- package/dist/notifications/feedback-notification-types-labels.d.ts +7 -1
- package/dist/notifications/feedback-notification-types-labels.js +4 -1
- package/dist/notifications/feedback-notification-types-labels.js.map +1 -1
- package/dist/notifications/feedback-notification-types.d.ts +11 -5
- package/dist/notifications/feedback-notification-types.js +2 -1
- package/dist/notifications/feedback-notification-types.js.map +1 -1
- package/dist/notifications/notification-bell.d.ts +33 -0
- package/dist/notifications/notification-bell.js +74 -0
- package/dist/notifications/notification-bell.js.map +1 -0
- package/dist/notifications/notification-inbox.d.ts +77 -0
- package/dist/notifications/notification-inbox.js +206 -0
- package/dist/notifications/notification-inbox.js.map +1 -0
- package/dist/notifications/notification-types-setting.d.ts +6 -4
- package/dist/notifications/notification-types-setting.js +103 -45
- package/dist/notifications/notification-types-setting.js.map +1 -1
- package/dist/notifications/notification-types.d.ts +19 -7
- package/dist/notifications/notifications-labels.d.ts +41 -7
- package/dist/notifications/notifications-labels.js +18 -1
- package/dist/notifications/notifications-labels.js.map +1 -1
- package/dist/notifications/push-devices-setting.d.ts +20 -3
- package/dist/notifications/push-devices-setting.js +93 -33
- package/dist/notifications/push-devices-setting.js.map +1 -1
- package/dist/notifications/push-worker.d.ts +108 -0
- package/dist/notifications/push-worker.js +62 -0
- package/dist/notifications/push-worker.js.map +1 -0
- package/dist/notifications/quiet-hours-setting.d.ts +29 -17
- package/dist/notifications/quiet-hours-setting.js +9 -41
- package/dist/notifications/quiet-hours-setting.js.map +1 -1
- package/dist/notifications/time-zone-select.d.ts +5 -2
- package/dist/notifications/time-zone-select.js.map +1 -1
- package/dist/notifications/use-push-device.d.ts +4 -17
- package/dist/notifications/use-push-device.js +7 -15
- package/dist/notifications/use-push-device.js.map +1 -1
- package/dist/offline/local-first.d.ts +33 -0
- package/dist/offline/local-first.js +39 -0
- package/dist/offline/local-first.js.map +1 -0
- package/dist/offline/pwa-update-prompt-labels.d.ts +2 -0
- package/dist/offline/pwa-update-prompt-labels.js +9 -0
- package/dist/offline/pwa-update-prompt-labels.js.map +1 -0
- package/dist/offline/pwa-update-prompt.d.ts +32 -0
- package/dist/offline/pwa-update-prompt.js +36 -0
- package/dist/offline/pwa-update-prompt.js.map +1 -0
- package/dist/offline/query-persistence.d.ts +125 -0
- package/dist/offline/query-persistence.js +183 -0
- package/dist/offline/query-persistence.js.map +1 -0
- package/dist/offline/service-worker-updates.d.ts +46 -0
- package/dist/offline/service-worker-updates.js +39 -0
- package/dist/offline/service-worker-updates.js.map +1 -0
- package/dist/offline/shared-computer-labels.d.ts +2 -0
- package/dist/offline/shared-computer-labels.js +9 -0
- package/dist/offline/shared-computer-labels.js.map +1 -0
- package/dist/offline/shared-computer.d.ts +44 -0
- package/dist/offline/shared-computer.js +51 -0
- package/dist/offline/shared-computer.js.map +1 -0
- package/dist/offline/sign-out-pending-dialog-labels.d.ts +2 -0
- package/dist/offline/sign-out-pending-dialog-labels.js +14 -0
- package/dist/offline/sign-out-pending-dialog-labels.js.map +1 -0
- package/dist/offline/sign-out-pending-dialog.d.ts +58 -0
- package/dist/offline/sign-out-pending-dialog.js +66 -0
- package/dist/offline/sign-out-pending-dialog.js.map +1 -0
- package/dist/offline.d.ts +11 -0
- package/dist/offline.js +33 -0
- package/dist/offline.js.map +1 -0
- package/dist/push-worker.d.ts +2 -0
- package/dist/push-worker.js +14 -0
- package/dist/push-worker.js.map +1 -0
- package/dist/shell/account-menu-text-size.d.ts +33 -0
- package/dist/shell/account-menu-text-size.js +51 -0
- package/dist/shell/account-menu-text-size.js.map +1 -0
- package/dist/shell/admin-menu.d.ts +24 -0
- package/dist/shell/admin-menu.js +12 -3
- package/dist/shell/admin-menu.js.map +1 -1
- package/dist/shell/top-bar-actions.d.ts +6 -2
- package/dist/shell/top-bar-actions.js +1 -0
- package/dist/shell/top-bar-actions.js.map +1 -1
- package/dist/shell.d.ts +4 -0
- package/dist/shell.js +4 -0
- package/dist/shell.js.map +1 -1
- package/dist/sync/db.d.ts +76 -0
- package/dist/sync/db.js +24 -0
- package/dist/sync/db.js.map +1 -0
- package/dist/sync/engine.d.ts +124 -0
- package/dist/sync/engine.js +474 -0
- package/dist/sync/engine.js.map +1 -0
- package/dist/sync/hooks.d.ts +30 -0
- package/dist/sync/hooks.js +67 -0
- package/dist/sync/hooks.js.map +1 -0
- package/dist/sync/testing.d.ts +28 -0
- package/dist/sync/testing.js +41 -0
- package/dist/sync/testing.js.map +1 -0
- package/dist/sync/wire.d.ts +50 -0
- package/dist/sync/wire.js +2 -0
- package/dist/sync/wire.js.map +1 -0
- package/dist/sync.d.ts +7 -0
- package/dist/sync.js +22 -0
- package/dist/sync.js.map +1 -0
- package/dist/tour/tour-catalogue.d.ts +7 -1
- package/dist/tour/tour-catalogue.js.map +1 -1
- package/dist/tour/tour-labels.js +1 -0
- package/dist/tour/tour-labels.js.map +1 -1
- package/dist/tour/tour.d.ts +30 -0
- package/dist/tour/tour.js +54 -8
- package/dist/tour/tour.js.map +1 -1
- package/dist/tour/use-tour-progress.d.ts +99 -1
- package/dist/tour/use-tour-progress.js +228 -12
- package/dist/tour/use-tour-progress.js.map +1 -1
- package/dist/tour.d.ts +2 -0
- package/dist/tour.js +2 -0
- package/dist/tour.js.map +1 -1
- package/package.json +43 -1
- package/src/admin/admin-action-log-labels.ts +9 -0
- package/src/admin/admin-action-log.tsx +41 -5
- package/src/admin/admin-area-labels.ts +20 -0
- package/src/admin/admin-overview.tsx +37 -2
- package/src/admin/mail-test-card-labels.ts +19 -0
- package/src/admin/mail-test-card.tsx +190 -0
- package/src/components/appearance-labels.ts +16 -0
- package/src/components/data-table-column-settings.tsx +2 -2
- package/src/components/data-table-head.tsx +2 -2
- package/src/components/data-table-mobile.tsx +26 -3
- package/src/components/data-table-row-actions.tsx +118 -2
- package/src/components/data-table-shared.tsx +39 -3
- package/src/components/data-table.tsx +52 -21
- package/src/components/date-format-setting.tsx +64 -0
- package/src/components/swipeable-row.tsx +8 -0
- package/src/components/tabs.tsx +4 -3
- package/src/components/translation-review-editor.tsx +2 -0
- package/src/components/translation-review-labels.ts +7 -0
- package/src/components/translation-review.tsx +102 -14
- package/src/components/write-lock-labels.ts +1 -0
- package/src/components/write-lock.tsx +36 -3
- package/src/data-table.ts +1 -0
- package/src/feedback/feedback-row-detail.tsx +18 -23
- package/src/feedback/feedback-swipe.tsx +28 -1
- package/src/i18n/defaults.ts +8 -0
- package/src/i18n/german.ts +90 -4
- package/src/i18n/kit-labels.tsx +31 -1
- package/src/i18n/locales/en.ts +13 -0
- package/src/i18n/locales/es.ts +90 -4
- package/src/i18n/locales/fr.ts +90 -4
- package/src/i18n/locales/hu.ts +86 -4
- package/src/i18n/locales/it.ts +90 -4
- package/src/i18n/locales/zh.ts +84 -2
- package/src/i18n/review.ts +15 -1
- package/src/index.ts +45 -0
- package/src/lib/date-format.ts +151 -0
- package/src/lib/format.ts +23 -6
- package/src/notifications/device-zone-report.ts +54 -0
- package/src/notifications/feedback-notification-types-labels.ts +10 -1
- package/src/notifications/feedback-notification-types.ts +12 -5
- package/src/notifications/notification-bell.tsx +116 -0
- package/src/notifications/notification-inbox.tsx +304 -0
- package/src/notifications/notification-types-setting.tsx +151 -55
- package/src/notifications/notification-types.ts +20 -8
- package/src/notifications/notifications-labels.ts +69 -11
- package/src/notifications/push-devices-setting.tsx +123 -34
- package/src/notifications/push-worker.ts +160 -0
- package/src/notifications/quiet-hours-setting.tsx +41 -58
- package/src/notifications/time-zone-select.tsx +5 -2
- package/src/notifications/use-push-device.ts +20 -33
- package/src/offline/local-first.ts +76 -0
- package/src/offline/pwa-update-prompt-labels.ts +9 -0
- package/src/offline/pwa-update-prompt.tsx +72 -0
- package/src/offline/query-persistence.ts +356 -0
- package/src/offline/service-worker-updates.ts +81 -0
- package/src/offline/shared-computer-labels.ts +8 -0
- package/src/offline/shared-computer.tsx +87 -0
- package/src/offline/sign-out-pending-dialog-labels.ts +21 -0
- package/src/offline/sign-out-pending-dialog.tsx +135 -0
- package/src/offline.ts +32 -0
- package/src/push-worker.ts +25 -0
- package/src/shell/account-menu-text-size.tsx +77 -0
- package/src/shell/admin-menu.tsx +40 -3
- package/src/shell/top-bar-actions.tsx +6 -1
- package/src/shell.ts +7 -0
- package/src/sync/db.ts +103 -0
- package/src/sync/engine.ts +699 -0
- package/src/sync/hooks.ts +93 -0
- package/src/sync/testing.ts +73 -0
- package/src/sync/wire.ts +61 -0
- package/src/sync.ts +29 -0
- package/src/tour/tour-catalogue.tsx +7 -1
- package/src/tour/tour-labels.ts +1 -0
- package/src/tour/tour.tsx +105 -9
- package/src/tour/use-tour-progress.ts +378 -12
- package/src/tour.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/data-table-mobile.tsx"],"sourcesContent":["import { Fragment, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown, ChevronRight, Filter } from \"lucide-react\";\nimport { FOCUS_RING } from \"./focus-ring\";\nimport { IconButton } from \"./icon-button\";\nimport { Select } from \"./select\";\nimport { cn } from \"../lib/cn\";\nimport { dirOf, type Direction } from \"../lib/direction\";\nimport { defaultFilterState, isFilterActive, resolveFilter } from \"./data-table-filters\";\nimport type { ColumnFilter, FilterValue } from \"./data-table-filters\";\nimport type { SortCycle, SortState } from \"./data-table-sort\";\nimport { FilterPopover } from \"./data-table-filter-popover\";\nimport { SwipeableRow, type SwipeAction } from \"./swipeable-row\";\nimport { DialogFrame } from \"./dialog-frame\";\nimport { Checkbox } from \"./checkbox\";\nimport { useLongPress } from \"../hooks/use-long-press\";\nimport type { DataTableLabels } from \"./data-table-labels\";\nimport { RowLink, cleanAttrs, columnLabel, fromOutside } from \"./data-table-shared\";\nimport type {\n DataTableCellProps,\n DataTableColumn,\n DataTableProps,\n DataTableSortLabels,\n FilterState,\n MobileSwipeActions,\n} from \"./data-table\";\n\n// DataTable's phone layout: the card a row becomes, the fields inside it, and the sort\n// and filter controls above the card list. Moved out of data-table.tsx whole (refactor\n// audit 2026-10, MOD-3 step 4); the list itself, its pager and its row dialog stay in\n// DataTable, which owns the state they share with the wide-screen table.\n\n/** Only the `data-*` attributes of a cell's props — what a phone card field takes. */\nfunction dataAttrsOf(props: DataTableCellProps | undefined): Record<string, unknown> | undefined {\n if (!props) return undefined;\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(props)) if (k.startsWith(\"data-\") && k !== \"data-col\") out[k] = v;\n return out;\n}\n\n/** The logical sides onto the physical drag directions {@link SwipeableRow} takes. */\nfunction physicalSwipe(\n actions: MobileSwipeActions,\n dir: Direction,\n): { left?: SwipeAction[]; right?: SwipeAction[] } {\n const rtl = dir === \"rtl\";\n return {\n left: (rtl ? actions.end : actions.start) ?? actions.left,\n right: (rtl ? actions.start : actions.end) ?? actions.right,\n };\n}\n\n// ---------- Phone card at Large (0.32) ----------\n\n/**\n * §4 \"nothing truncates\" in a phone card at Large and Extra large: a cell's own\n * `truncate` (a kit cell, a chip, the app's span) wraps instead — and breaks inside a\n * word too long for the card rather than running out of it. A descendant rule, so it\n * reaches the cells without the table knowing what they render; `large:`, so Normal\n * keeps every ellipsis it had.\n */\nconst CARD_NO_TRUNCATE =\n \"large:[&_.truncate]:whitespace-normal large:[&_.truncate]:[overflow-wrap:anywhere]\";\n\n/**\n * Columns as label-above-value pairs: the phone card's fields at Large (§4), and the\n * opened row's `mobileDetailsInRow` at every size. Each pair is a `<div>` in the\n * `<dl>` — the grouping HTML allows — so a pair keeps together and the gap falls\n * BETWEEN facts rather than between a label and its own value. `relative` holds a\n * header's `sr-only` text (an actions column's), as every kit container must.\n */\nexport function StackedFields<T>({ columns, row, compact }: { columns: DataTableColumn<T>[]; row: T; compact: boolean }) {\n return (\n <dl\n data-card-fields=\"stacked\"\n className={cn(\"relative flex min-w-0 flex-col\", compact ? \"gap-1.5 text-xs\" : \"gap-2.5 text-sm\", CARD_NO_TRUNCATE)}\n >\n {columns.map((col) => (\n <div key={col.key} className=\"min-w-0\">\n <dt className=\"text-xs uppercase tracking-wide text-muted\">{col.header}</dt>\n <dd\n {...dataAttrsOf(col.cellProps?.(row))}\n className=\"mt-0.5 min-w-0 break-words text-secondary\"\n >\n {col.cell(row)}\n </dd>\n </div>\n ))}\n </dl>\n );\n}\n\n// ---------- Phone sort control (keksdose K10) ----------\n\n/**\n * The card list's sort control: a \"Sort by\" select and a direction button.\n *\n * keksdose K10 (inputs audit 2026-10-02 §5; its aggregated report tables, #258): a\n * table is sorted by its header row and the phone card list has none, so the two\n * decisions the header carries — which column, which direction — were unreachable\n * below the breakpoint. keksdose hand-built this row over its DataTable to answer\n * \"who did I pay the most\" on the device it was asked on; this is that row, driven by\n * the SAME sort state as the headers (controlled `sorts` included), so turning the\n * phone sideways keeps the order and a sort chosen here is the one the URL and the\n * storage key hold.\n *\n * The rules are the header's: a newly picked column starts in its `firstSort`, the\n * direction button flips the primary sort (secondary ones stay), and \"Default order\"\n * — the third click of a `\"tri\"` cycle — is offered only under `\"tri\"`, since a\n * `\"toggle\"` table promises it is always ranked by something. The select's label is\n * a real `<label>` beside it, and the button sits outside that label: a click inside\n * a label is forwarded to the control it names, so a nested button would flip AND\n * open the select.\n */\nexport function MobileSort<T>({\n columns,\n sorts,\n sortCycle,\n compact,\n labels,\n onPick,\n onFlip,\n}: {\n columns: DataTableColumn<T>[];\n sorts: SortState[];\n sortCycle: SortCycle;\n compact: boolean;\n labels: DataTableLabels;\n onPick: (key: string | null) => void;\n onFlip: () => void;\n}) {\n const selectId = useId();\n const sortLabels: DataTableSortLabels = labels;\n if (columns.length === 0) return null;\n // A persisted or URL sort can name a column with no `sortBy` (or a hidden one): the\n // sort chain drops it, and so does the control rather than claiming it.\n const primary = sorts[0] && columns.some((c) => c.key === sorts[0].key) ? sorts[0] : null;\n const offerDefault = sortCycle === \"tri\" || primary === null;\n const desc = primary?.dir === \"desc\";\n return (\n <div\n data-table-mobile-sort=\"\"\n className={cn(\n // At Large the direction button shows its words (IconButton's label, §4); the\n // row wraps so the select keeps a usable width on a 240 px card.\n \"flex flex-wrap items-center gap-2 border-b border-subtle\",\n compact ? \"px-3 py-1.5\" : \"px-4 py-2\",\n )}\n >\n <label htmlFor={selectId} className=\"shrink-0 text-xs text-muted\">\n {sortLabels.sortBy}\n </label>\n <Select\n id={selectId}\n size={compact ? \"sm\" : \"md\"}\n className=\"min-w-0 flex-1 large:basis-40\"\n value={primary?.key ?? \"\"}\n onChange={(e) => onPick(e.target.value || null)}\n >\n {offerDefault && <option value=\"\">{sortLabels.sortDefault}</option>}\n {columns.map((col) => (\n <option key={col.key} value={col.key}>\n {columnLabel(col, labels)}\n </option>\n ))}\n </Select>\n <IconButton\n size={compact ? \"xs\" : \"md\"}\n variant=\"secondary\"\n label={desc ? sortLabels.sortDescending : sortLabels.sortAscending}\n disabled={primary === null}\n onClick={onFlip}\n >\n {desc ? <ArrowDownWideNarrow /> : <ArrowUpNarrowWide />}\n </IconButton>\n </div>\n );\n}\n\n// ---------- Phone card ----------\n\n/** One phone card: what DataTable's card list draws for a row. */\nexport interface MobileRowProps<T> {\n row: T;\n isExpanded: DataTableProps<T>[\"isExpanded\"];\n /** What the row shows when opened — DataTable's `openedRowContent`. */\n openedRowContent: (row: T) => ReactNode;\n /** Whether an opened row has anything to show at all. */\n opensRow: boolean;\n rowClassName: DataTableProps<T>[\"rowClassName\"];\n rowAttributes: DataTableProps<T>[\"rowAttributes\"];\n onRowClick: DataTableProps<T>[\"onRowClick\"];\n rowHref: DataTableProps<T>[\"rowHref\"];\n /** `mobileSwipeActions`, or the swipes derived from `rowActions`. */\n swipeActionsFor: ((row: T) => MobileSwipeActions | null) | undefined;\n /** The card list's reading direction, for which physical drag a swipe side means. */\n mobileDir: Direction;\n /** No column the card renders owns a link, so the card itself may be one. */\n mobileCardLinkable: boolean;\n mobileCard: DataTableProps<T>[\"mobileCard\"];\n mobilePrimaryCol: DataTableColumn<T> | null;\n mobileSecondaryColumns: DataTableColumn<T>[];\n mobileExpandAsDialog: boolean;\n compact: boolean;\n /** The text size is Large or Extra large (§4). */\n large: boolean;\n /** Phone selection (0.40, keksdose live #421); null without DataTable's `selection`. */\n select: MobileRowSelect | null;\n}\n\n/** A phone card's part in DataTable's `selection` (0.40, keksdose live #421). */\nexport interface MobileRowSelect {\n /** The card list is in selection mode: the card shows its box and a tap toggles it. */\n active: boolean;\n /** `selection.isSelectable` for this row. */\n selectable: boolean;\n selected: boolean;\n onToggle: (checked: boolean) => void;\n /** A long press outside the mode: enter it with this row selected. */\n onLongPress: () => void;\n}\n\n/** One mobile card. Shared by the flat list and the grouped list, so both draw\n * identical row markup. */\nexport function MobileRow<T>({\n row,\n isExpanded,\n openedRowContent,\n opensRow,\n rowClassName,\n rowAttributes,\n onRowClick,\n rowHref,\n swipeActionsFor,\n mobileDir,\n mobileCardLinkable,\n mobileCard,\n mobilePrimaryCol,\n mobileSecondaryColumns,\n mobileExpandAsDialog,\n compact,\n large,\n select,\n}: MobileRowProps<T>) {\n const expanded = isExpanded?.(row) ?? false;\n // Selection mode (#421): the whole card is the row's checkbox — a tap toggles it\n // instead of opening the row, and the swipe and the long press stand down, so no\n // gesture means two things at once (keksdose's register list, its feedback #153).\n const selecting = !!select?.active;\n // Not on an open card, as in kk's register: its editor and a selection are two modes\n // fighting over the same row.\n const pressable = !!select && select.selectable && !selecting && !expanded;\n const longPress = useLongPress(() => select?.onLongPress(), { enabled: pressable });\n const expansion = expanded ? openedRowContent(row) : null;\n const tint = rowClassName?.(row);\n // Use div+role=\"button\" rather than a real <button> so cells that\n // contain their own interactive controls (status toggles, action\n // icons) don't end up as illegal nested buttons.\n const interactive = !!onRowClick;\n // Say that the card OPENS something (Keksdose feedback #163). A phone card had\n // only a cursor and a tap-tint to advertise its editor — on the invoice review\n // screen, whose entire purpose is correcting mis-read lines, that read as \"these\n // values are not editable\". A chevron is the affordance every list on a phone\n // uses for exactly this, and it points the way the row actually opens: right into\n // a sheet, or down into an inline panel that flips it when expanded.\n const opensDetail = interactive && opensRow;\n const swipeActions = swipeActionsFor?.(row);\n const swipe = swipeActions ? physicalSwipe(swipeActions, mobileDir) : null;\n // An OPEN card swipes too (0.40, keksdose live #416, Marcel: \"faster than scrolling\n // down to the buttons\"). Only the card's header — the summary line — is inside\n // SwipeableRow; the opened body below is a sibling, so its fields, sliders and\n // scrolling never meet the gesture. Until 0.40 an open card silently lost it.\n // In selection mode a sideways drag would be a second meaning for a selecting touch.\n const swipeEnabled = !!swipe && !selecting;\n const href = mobileCardLinkable ? rowHref?.(row) : undefined;\n const cardClass = cn(\n \"w-full text-start flex items-center\",\n // §4: more room per row at Large — a taller row is a bigger tap target too.\n compact ? \"px-3 py-2 gap-2 text-sm large:py-3\" : \"px-4 py-3 gap-3 large:py-4\",\n // Live #320's other half: the card acknowledges the touch before the sheet\n // arrives. On a cold route the data can take a beat, and an unacknowledged tap\n // reads as \"did that register?\" — which is most of what \"abrupt\" means here.\n // `origin-center` + a 0.5% squeeze is deliberately almost subliminal: this fires\n // on every row of a long list, so anything larger becomes the list's personality\n // rather than feedback. `transition-transform` alone, so the existing background\n // flip stays instant.\n interactive &&\n \"cursor-pointer transition-transform duration-100 active:scale-[0.995] active:bg-active motion-reduce:transition-none motion-reduce:active:scale-100\",\n // The keyboard's frame drawn INSIDE the card, as the desktop row's is (keksdose live\n // #394): the browser's own ring and tap highlight sit on the card's outer edge, and\n // three ancestors clip it — SwipeableRow's `overflow-hidden`, the card list, and\n // AppShell main's `overflow-x-clip` — so the frame went missing on one side. A press\n // keeps the fill and the squeeze above; an outline on every tap of a long list would\n // be louder than the acknowledgement it replaces.\n (interactive || selecting) && cn(\"[-webkit-tap-highlight-color:transparent] focus-visible:ring-inset\", FOCUS_RING),\n selecting && \"cursor-pointer\",\n select?.selected && selecting && \"bg-brand-soft\",\n // A 500 ms hold would otherwise start a text selection, and iOS's link callout —\n // which only yields to this CSS. The trade kk made on its register: the card's text\n // is not selectable on a phone where the table offers selection.\n select && \"select-none [-webkit-touch-callout:none]\",\n );\n // The card's content is written once and worn by either tag below. Note that\n // the primary cell is rendered RAW here, never through `linkColumn` — the card\n // itself is the anchor, and routing it through `linkColumn` too would nest an\n // <a> inside an <a>. Desktop and mobile are mutually exclusive (`isMdUp`), so\n // exactly one anchor exists per row.\n const cardInner = (\n <>\n {/* The card's own content keeps the column it always had; the chevron sits\n beside it rather than inside, so a caller's `mobileCard` is untouched. */}\n <div\n className={cn(\n \"flex min-w-0 flex-1 flex-col\",\n compact ? \"gap-1 large:gap-2\" : \"gap-2 large:gap-3\",\n // §4 \"nothing truncates\": at Large a cell's own `truncate` wraps instead —\n // the reader who chose bigger type is the one an ellipsis fails. A caller's\n // `mobileCard` is its own layout and keeps what it chose.\n !mobileCard && CARD_NO_TRUNCATE,\n )}\n >\n {mobileCard ? (\n mobileCard(row)\n ) : (\n <>\n {/* Only the `data-*` half of `cellProps` — see its note. */}\n {mobilePrimaryCol && (\n <div {...dataAttrsOf(mobilePrimaryCol.cellProps?.(row))} className=\"min-w-0 break-words font-medium\">\n {mobilePrimaryCol.cell(row)}\n </div>\n )}\n {mobileSecondaryColumns.length > 0 && large ? (\n // §4: each label ABOVE its value at Large. Side by side, a label column\n // sized to the widest label leaves a value a sliver of a 240 px card.\n <StackedFields columns={mobileSecondaryColumns} row={row} compact={compact} />\n ) : mobileSecondaryColumns.length > 0 && (\n <dl\n className={cn(\n \"grid grid-cols-[auto_1fr] gap-x-3\",\n compact ? \"gap-y-0.5 text-xs\" : \"gap-y-1 text-sm\",\n )}\n >\n {mobileSecondaryColumns.map((col) => (\n <Fragment key={col.key}>\n <dt className=\"text-xs uppercase tracking-wide text-muted self-center\">\n {col.header}\n </dt>\n <dd\n {...dataAttrsOf(col.cellProps?.(row))}\n className=\"min-w-0 text-secondary self-center\"\n >\n {col.cell(row)}\n </dd>\n </Fragment>\n ))}\n </dl>\n )}\n </>\n )}\n </div>\n {opensDetail && !selecting &&\n // `aria-hidden`: the row already announces itself as a button with\n // `aria-expanded`, so the icon would only add a second, wordless stop.\n (mobileExpandAsDialog ? (\n // Points INTO the sheet, which is the reading-forward direction.\n <ChevronRight\n aria-hidden\n className=\"size-4 shrink-0 text-placeholder rtl:-scale-x-100\"\n />\n ) : (\n <ChevronDown\n aria-hidden\n className={cn(\n \"size-4 shrink-0 text-placeholder transition-transform\",\n expanded && \"rotate-180\",\n )}\n />\n ))}\n </>\n );\n // The long press rides the card itself; the click it leaves behind is swallowed on\n // the `<li>` below, in the capture phase, before the card (or RowLink) sees it.\n // Attached whenever the table selects, the hook's `enabled` deciding whether a press\n // arms: its pointerdown also clears a stale swallow latch, which must happen in the\n // mode too, or a long press whose click never came would eat the first toggle.\n const press = select ? longPress.handlers : undefined;\n const body = selecting ? (\n // In the mode a card is a toggle — kk's register row: `role=\"button\"` with\n // `aria-pressed`, the box beside it only a picture of that state (the card is the\n // one control, so the two can never fight or fire twice).\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- role=\"button\",\n tabIndex 0 and Enter/Space are all here; the rule cannot follow the conditional role. */\n <div\n role={select!.selectable ? \"button\" : undefined}\n tabIndex={select!.selectable ? 0 : undefined}\n aria-pressed={select!.selectable ? select!.selected : undefined}\n aria-disabled={select!.selectable ? undefined : true}\n data-card-selecting=\"\"\n {...press}\n onClick={(e) => {\n if (!select!.selectable || fromOutside(e.target, e.currentTarget)) return;\n select!.onToggle(!select!.selected);\n }}\n onKeyDown={(e) => {\n if (!select!.selectable || e.target !== e.currentTarget) return;\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n select!.onToggle(!select!.selected);\n }\n }}\n className={cardClass}\n >\n <Checkbox\n readOnly\n tabIndex={-1}\n aria-hidden\n checked={select!.selected}\n disabled={!select!.selectable}\n className=\"pointer-events-none shrink-0 self-center\"\n inputClassName=\"pointer-events-none\"\n />\n {cardInner}\n </div>\n ) : interactive && href ? (\n // A card with a URL of its own is a LINK, not a div wearing role=\"button\"\n // (feedback #451): the phone's long-press \"open in new tab\" and a screen\n // reader's link semantics both come free, and the fake role goes away.\n <RowLink\n href={href}\n {...press}\n onActivate={() => onRowClick!(row)}\n aria-expanded={opensRow ? expanded : undefined}\n className={cardClass}\n // Enter already activates a link natively, and that routes through\n // RowLink's own onClick — handling it here too would open the row twice.\n // Space is the only key left, and only so it opens the row instead of\n // scrolling the list.\n onKeyDown={(e) => {\n if (e.key !== \" \") return;\n e.preventDefault();\n onRowClick!(row);\n }}\n >\n {cardInner}\n </RowLink>\n ) : (\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- the handlers are\n only attached when `interactive`, and then so are role=\"button\", tabIndex 0 and the\n Enter/Space handler below; the rule cannot follow the conditional role. */\n <div\n {...press}\n role={interactive ? \"button\" : undefined}\n tabIndex={interactive ? 0 : undefined}\n onClick={\n interactive\n ? (e) => {\n if (fromOutside(e.target, e.currentTarget)) return;\n onRowClick!(row);\n }\n : undefined\n }\n onKeyDown={\n interactive\n ? (e) => {\n // A key press inside a nested control is that control's.\n if (e.target !== e.currentTarget) return;\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onRowClick!(row);\n }\n }\n : undefined\n }\n aria-expanded={opensRow ? expanded : undefined}\n className={cardClass}\n >\n {cardInner}\n </div>\n );\n return (\n <li\n className={cn(tint)}\n {...cleanAttrs(rowAttributes?.(row))}\n data-selected={selecting && select!.selected ? \"\" : undefined}\n onClickCapture={\n select\n ? (e) => {\n if (!longPress.consumeClick()) return;\n e.preventDefault();\n e.stopPropagation();\n }\n : undefined\n }\n >\n {swipeEnabled ? (\n <SwipeableRow enabled left={swipe!.left} right={swipe!.right}>\n {body}\n </SwipeableRow>\n ) : (\n body\n )}\n {expansion && !mobileExpandAsDialog && (\n <div\n className={cn(\n \"bg-surface-2 border-t border-subtle\",\n compact ? \"px-3 py-2\" : \"px-4 py-3\",\n )}\n >\n {expansion}\n </div>\n )}\n </li>\n );\n}\n\n// ---------- Phone selection bar (0.40, keksdose live #421) ----------\n\n/**\n * The card list's way into and out of selection mode for a keyboard and a screen\n * reader — the long press is a touch gesture, and a gesture alone is no path at all.\n *\n * Outside the mode it is one button, \"Select rows\", visually hidden until it takes\n * focus (SwipeableRow's keyboard buttons, the same rule): the card list keeps the look\n * kk's register has, where the long press is the way in, and Tab or a screen reader's\n * cursor still finds it. In the mode it is a visible row: \"Select all rows\" — the\n * desktop header's box — and Cancel, which clears the selection and leaves, as the\n * bulk bar's Clear does. The owner's bulk bar is the owner's, as on desktop: it\n * appears because the selection is no longer empty.\n */\nexport function MobileSelectBar({\n active,\n allSelected,\n someSelected,\n compact,\n labels,\n onEnter,\n onToggleAll,\n onCancel,\n}: {\n active: boolean;\n allSelected: boolean;\n someSelected: boolean;\n compact: boolean;\n labels: DataTableLabels;\n onEnter: () => void;\n onToggleAll: (checked: boolean) => void;\n onCancel: () => void;\n}) {\n // The control that was pressed unmounts with the mode it switched, so focus is\n // handed across: into the bar's box on the way in, back to the button on the way out.\n const handOff = useRef(false);\n const allBox = useRef<HTMLInputElement>(null);\n const enterButton = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (!handOff.current) return;\n handOff.current = false;\n (active ? allBox.current : enterButton.current)?.focus();\n }, [active]);\n if (!active)\n return (\n <button\n ref={enterButton}\n type=\"button\"\n data-table-mobile-select=\"\"\n onClick={() => {\n handOff.current = true;\n onEnter();\n }}\n className={cn(\n \"sr-only rounded-md text-sm font-medium text-secondary\",\n // Padding only once shown: unconditional, it beats sr-only's `padding: 0`\n // (SwipeableRow's 0.32.1 note).\n \"focus:not-sr-only focus:m-2 focus:inline-flex focus:px-2 focus:py-1\",\n FOCUS_RING,\n )}\n >\n {labels.selectRows}\n </button>\n );\n return (\n <div\n data-table-mobile-select=\"\"\n className={cn(\n \"flex flex-wrap items-center justify-between gap-2 border-b border-subtle\",\n compact ? \"px-3 py-1.5\" : \"px-4 py-2\",\n )}\n >\n <Checkbox\n ref={allBox}\n label={labels.selectAllRows}\n checked={allSelected}\n indeterminate={someSelected && !allSelected}\n onChange={(e) => onToggleAll(e.target.checked)}\n />\n <button\n type=\"button\"\n onClick={() => {\n handOff.current = true;\n onCancel();\n }}\n className={cn(\"rounded-md px-2 py-1 text-sm text-muted hover:text-secondary\", FOCUS_RING)}\n >\n {labels.cancelSelection}\n </button>\n </div>\n );\n}\n\n// ---------- Mobile filter sheet ----------\n\n/**\n * Filter access for the mobile card list (feedback #299). The desktop table\n * houses per-column filters in its header; the card list has no header, so the\n * same filters were unreachable on phones. This renders a compact \"Filters\" bar\n * that opens a bottom sheet listing each filterable column as a collapsible\n * section, reusing the very same {@link FilterPopover} and filter state the\n * desktop table drives — so it filters identically and stays URL-synced.\n *\n * The sheet is a {@link DialogFrame} (round 0.34 BUG-7b = DUP-6). It was the last\n * hand-rolled modal in the kit: `role=\"dialog\" aria-modal=\"true\"` on the backdrop, with\n * copies of the scroll lock, the backdrop close and the Back entry — and no name, no\n * focus moved in, no trap and no Escape, so a reader was told the page was hidden while\n * focus stayed on it. On a phone `Modal` is a bottom sheet already; it now brings all\n * of that, and the exit motion, from the one place every other dialog gets it.\n */\nexport function MobileFilters<T>({\n columns,\n filters,\n selectOptionsByKey,\n isServer,\n hasFilterCallback,\n onSetFilter,\n onClearFilter,\n onClearAll,\n labels,\n locale,\n}: {\n columns: DataTableColumn<T>[];\n filters: FilterState;\n selectOptionsByKey: Record<string, { value: string; label: string }[]>;\n isServer: boolean;\n hasFilterCallback: boolean;\n onSetFilter: (key: string, value: FilterValue) => void;\n onClearFilter: (key: string) => void;\n onClearAll: () => void;\n labels: DataTableLabels;\n locale?: string;\n}) {\n const [open, setOpen] = useState(false);\n // The sheet is portalled to <body>, out from under whatever `dir` the table sits\n // in, so it carries the trigger's direction with it — read at the moment of opening,\n // from the element the user actually pressed.\n const [dir, setDir] = useState<Direction>(\"ltr\");\n const [expanded, setExpanded] = useState<string | null>(null);\n\n const filterable = useMemo(\n () =>\n columns\n .map((col) => ({ col, filter: !isServer || hasFilterCallback ? resolveFilter(col) : null }))\n .filter((x): x is { col: DataTableColumn<T>; filter: ColumnFilter<T> } => !!x.filter),\n [columns, isServer, hasFilterCallback],\n );\n\n if (filterable.length === 0) return null;\n\n const activeCount = filterable.filter(({ col }) => {\n const s = filters[col.key];\n return s && isFilterActive(s);\n }).length;\n\n return (\n <div className=\"flex items-center justify-between gap-2 border-b border-subtle px-4 py-2\">\n <button\n type=\"button\"\n onClick={(e) => {\n setDir(dirOf(e.currentTarget));\n setOpen(true);\n }}\n className=\"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-secondary hover:bg-hover\"\n >\n <Filter className=\"size-4\" />\n <span>{labels.filters}</span>\n {activeCount > 0 && (\n <span className=\"inline-flex min-w-4 items-center justify-center rounded-full bg-info-soft px-1 text-caption font-semibold text-info\">\n {activeCount}\n </span>\n )}\n </button>\n {activeCount > 0 && (\n <button\n type=\"button\"\n onClick={onClearAll}\n className=\"text-xs text-muted hover:text-secondary\"\n >\n {labels.clearAll}\n </button>\n )}\n {/* Escape, the backdrop, Back (Keksdose feedback #172: the filters are already\n in the URL, so closing never loses anything), the scroll lock, focus in and\n back to this bar's button — all `Modal`'s. `fullBleed` lets the sheet meet the\n screen's edges on a phone, as it always did. */}\n <DialogFrame\n open={open}\n onClose={() => setOpen(false)}\n title={labels.filters}\n closeButton\n closeLabel={labels.close}\n headerDivider\n fullBleed\n // Portalled to <body>, so the direction read from the button goes with it.\n dir={dir}\n className=\"max-h-[85vh] rounded-b-none md:rounded-b-lg\"\n // The sections run edge to edge with a rule between them, as before.\n bodyClassName=\"space-y-0 divide-y divide-subtle px-0 pt-0 pb-0\"\n actions={(close) => (\n <>\n <button\n type=\"button\"\n onClick={onClearAll}\n disabled={activeCount === 0}\n // `me-auto` keeps Clear all at the start and Done at the end.\n className=\"me-auto text-sm text-muted hover:text-secondary disabled:opacity-40\"\n >\n {labels.clearAll}\n </button>\n <button\n type=\"button\"\n onClick={close}\n className=\"rounded-md bg-inverse px-4 py-2 text-sm font-medium text-inverse\"\n >\n {labels.done}\n </button>\n </>\n )}\n >\n {filterable.map(({ col, filter }) => {\n const state = filters[col.key];\n const active = !!state && isFilterActive(state);\n const isItemOpen = expanded === col.key;\n return (\n <div key={col.key}>\n <button\n type=\"button\"\n onClick={() => setExpanded(isItemOpen ? null : col.key)}\n aria-expanded={isItemOpen}\n className=\"flex w-full items-center justify-between gap-2 px-4 py-3 text-start\"\n >\n <span className=\"flex items-center gap-2 text-sm font-medium text-secondary\">\n {col.header}\n {active && <span className=\"size-1.5 rounded-full bg-brand\" />}\n </span>\n <ChevronDown\n className={cn(\n \"size-4 shrink-0 text-placeholder transition-transform\",\n isItemOpen && \"rotate-180\",\n )}\n />\n </button>\n {isItemOpen && (\n <div className=\"px-4 pb-3\">\n <FilterPopover\n column={col}\n state={state ?? defaultFilterState(filter)}\n onChange={(next) => onSetFilter(col.key, next)}\n onClear={() => onClearFilter(col.key)}\n selectOptions={selectOptionsByKey[col.key] ?? []}\n labels={labels}\n locale={locale}\n />\n </div>\n )}\n </div>\n );\n })}\n </DialogFrame>\n </div>\n );\n}\n"],"mappings":";AA8EQ,SAsPE,UArPA,KADF;AA9ER,SAAS,YAAAA,WAAU,WAAW,OAAO,SAAS,QAAQ,gBAAgB;AAEtE,SAAS,qBAAqB,mBAAmB,aAAa,cAAc,cAAc;AAC1F,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS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I;AACpC,iBACE,qBAAC,SACC;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS,MAAM,YAAY,aAAa,OAAO,IAAI,GAAG;AAAA,gBACtD,iBAAe;AAAA,gBACf,WAAU;AAAA,gBAEV;AAAA,uCAAC,UAAK,WAAU,8DACb;AAAA,wBAAI;AAAA,oBACJ,UAAU,oBAAC,UAAK,WAAU,kCAAiC;AAAA,qBAC9D;AAAA,kBACA;AAAA,oBAAC;AAAA;AAAA,sBACC,WAAW;AAAA,wBACT;AAAA,wBACA,cAAc;AAAA,sBAChB;AAAA;AAAA,kBACF;AAAA;AAAA;AAAA,YACF;AAAA,YACC,cACC,oBAAC,SAAI,WAAU,aACb;AAAA,cAAC;AAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,OAAO,SAAS,mBAAmB,MAAM;AAAA,gBACzC,UAAU,CAAC,SAAS,YAAY,IAAI,KAAK,IAAI;AAAA,gBAC7C,SAAS,MAAM,cAAc,IAAI,GAAG;AAAA,gBACpC,eAAe,mBAAmB,IAAI,GAAG,KAAK,CAAC;AAAA,gBAC/C;AAAA,gBACA;AAAA;AAAA,YACF,GACF;AAAA,eA7BM,IAAI,GA+Bd;AAAA,QAEJ,CAAC;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;","names":["Fragment"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/data-table-mobile.tsx"],"sourcesContent":["import { Fragment, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport type { MouseEvent as ReactMouseEvent, PointerEvent as ReactPointerEvent, ReactNode } from \"react\";\nimport { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown, ChevronRight, Filter } from \"lucide-react\";\nimport { FOCUS_RING } from \"./focus-ring\";\nimport { IconButton } from \"./icon-button\";\nimport { Select } from \"./select\";\nimport { cn } from \"../lib/cn\";\nimport { dirOf, type Direction } from \"../lib/direction\";\nimport { defaultFilterState, isFilterActive, resolveFilter } from \"./data-table-filters\";\nimport type { ColumnFilter, FilterValue } from \"./data-table-filters\";\nimport type { SortCycle, SortState } from \"./data-table-sort\";\nimport { FilterPopover } from \"./data-table-filter-popover\";\nimport { SwipeableRow, type SwipeAction } from \"./swipeable-row\";\nimport { DialogFrame } from \"./dialog-frame\";\nimport { Checkbox } from \"./checkbox\";\nimport { useLongPress } from \"../hooks/use-long-press\";\nimport type { DataTableLabels } from \"./data-table-labels\";\nimport { RowLink, cleanAttrs, columnLabel, fromOutside, fromOwnControl } from \"./data-table-shared\";\nimport type {\n DataTableCellProps,\n DataTableColumn,\n DataTableProps,\n DataTableSortLabels,\n FilterState,\n MobileSwipeActions,\n} from \"./data-table\";\n\n// DataTable's phone layout: the card a row becomes, the fields inside it, and the sort\n// and filter controls above the card list. Moved out of data-table.tsx whole (refactor\n// audit 2026-10, MOD-3 step 4); the list itself, its pager and its row dialog stay in\n// DataTable, which owns the state they share with the wide-screen table.\n\n/** Only the `data-*` attributes of a cell's props — what a phone card field takes. */\nfunction dataAttrsOf(props: DataTableCellProps | undefined): Record<string, unknown> | undefined {\n if (!props) return undefined;\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(props)) if (k.startsWith(\"data-\") && k !== \"data-col\") out[k] = v;\n return out;\n}\n\n/** The logical sides onto the physical drag directions {@link SwipeableRow} takes. */\nfunction physicalSwipe(\n actions: MobileSwipeActions,\n dir: Direction,\n): { left?: SwipeAction[]; right?: SwipeAction[] } {\n const rtl = dir === \"rtl\";\n return {\n left: (rtl ? actions.end : actions.start) ?? actions.left,\n right: (rtl ? actions.start : actions.end) ?? actions.right,\n };\n}\n\n// ---------- Phone card at Large (0.32) ----------\n\n/**\n * §4 \"nothing truncates\" in a phone card at Large and Extra large: a cell's own\n * `truncate` (a kit cell, a chip, the app's span) wraps instead — and breaks inside a\n * word too long for the card rather than running out of it. A descendant rule, so it\n * reaches the cells without the table knowing what they render; `large:`, so Normal\n * keeps every ellipsis it had.\n */\nconst CARD_NO_TRUNCATE =\n \"large:[&_.truncate]:whitespace-normal large:[&_.truncate]:[overflow-wrap:anywhere]\";\n\n/**\n * Columns as label-above-value pairs: the phone card's fields at Large (§4), and the\n * opened row's `mobileDetailsInRow` at every size. Each pair is a `<div>` in the\n * `<dl>` — the grouping HTML allows — so a pair keeps together and the gap falls\n * BETWEEN facts rather than between a label and its own value. `relative` holds a\n * header's `sr-only` text (an actions column's), as every kit container must.\n */\nexport function StackedFields<T>({ columns, row, compact }: { columns: DataTableColumn<T>[]; row: T; compact: boolean }) {\n return (\n <dl\n data-card-fields=\"stacked\"\n className={cn(\"relative flex min-w-0 flex-col\", compact ? \"gap-1.5 text-xs\" : \"gap-2.5 text-sm\", CARD_NO_TRUNCATE)}\n >\n {columns.map((col) => (\n <div key={col.key} className=\"min-w-0\">\n <dt className=\"text-xs uppercase tracking-wide text-muted\">{col.header}</dt>\n <dd\n {...dataAttrsOf(col.cellProps?.(row))}\n className=\"mt-0.5 min-w-0 break-words text-secondary\"\n >\n {col.cell(row)}\n </dd>\n </div>\n ))}\n </dl>\n );\n}\n\n// ---------- Phone sort control (keksdose K10) ----------\n\n/**\n * The card list's sort control: a \"Sort by\" select and a direction button.\n *\n * keksdose K10 (inputs audit 2026-10-02 §5; its aggregated report tables, #258): a\n * table is sorted by its header row and the phone card list has none, so the two\n * decisions the header carries — which column, which direction — were unreachable\n * below the breakpoint. keksdose hand-built this row over its DataTable to answer\n * \"who did I pay the most\" on the device it was asked on; this is that row, driven by\n * the SAME sort state as the headers (controlled `sorts` included), so turning the\n * phone sideways keeps the order and a sort chosen here is the one the URL and the\n * storage key hold.\n *\n * The rules are the header's: a newly picked column starts in its `firstSort`, the\n * direction button flips the primary sort (secondary ones stay), and \"Default order\"\n * — the third click of a `\"tri\"` cycle — is offered only under `\"tri\"`, since a\n * `\"toggle\"` table promises it is always ranked by something. The select's label is\n * a real `<label>` beside it, and the button sits outside that label: a click inside\n * a label is forwarded to the control it names, so a nested button would flip AND\n * open the select.\n */\nexport function MobileSort<T>({\n columns,\n sorts,\n sortCycle,\n compact,\n labels,\n onPick,\n onFlip,\n}: {\n columns: DataTableColumn<T>[];\n sorts: SortState[];\n sortCycle: SortCycle;\n compact: boolean;\n labels: DataTableLabels;\n onPick: (key: string | null) => void;\n onFlip: () => void;\n}) {\n const selectId = useId();\n const sortLabels: DataTableSortLabels = labels;\n if (columns.length === 0) return null;\n // A persisted or URL sort can name a column with no `sortBy` (or a hidden one): the\n // sort chain drops it, and so does the control rather than claiming it.\n const primary = sorts[0] && columns.some((c) => c.key === sorts[0].key) ? sorts[0] : null;\n const offerDefault = sortCycle === \"tri\" || primary === null;\n const desc = primary?.dir === \"desc\";\n return (\n <div\n data-table-mobile-sort=\"\"\n className={cn(\n // At Large the direction button shows its words (IconButton's label, §4); the\n // row wraps so the select keeps a usable width on a 240 px card.\n \"flex flex-wrap items-center gap-2 border-b border-subtle\",\n compact ? \"px-3 py-1.5\" : \"px-4 py-2\",\n )}\n >\n <label htmlFor={selectId} className=\"shrink-0 text-xs text-muted\">\n {sortLabels.sortBy}\n </label>\n <Select\n id={selectId}\n size={compact ? \"sm\" : \"md\"}\n className=\"min-w-0 flex-1 large:basis-40\"\n value={primary?.key ?? \"\"}\n onChange={(e) => onPick(e.target.value || null)}\n >\n {offerDefault && <option value=\"\">{sortLabels.sortDefault}</option>}\n {columns.map((col) => (\n <option key={col.key} value={col.key}>\n {columnLabel(col, labels)}\n </option>\n ))}\n </Select>\n <IconButton\n size={compact ? \"xs\" : \"md\"}\n variant=\"secondary\"\n label={desc ? sortLabels.sortDescending : sortLabels.sortAscending}\n disabled={primary === null}\n onClick={onFlip}\n >\n {desc ? <ArrowDownWideNarrow /> : <ArrowUpNarrowWide />}\n </IconButton>\n </div>\n );\n}\n\n// ---------- Phone card ----------\n\n/** One phone card: what DataTable's card list draws for a row. */\nexport interface MobileRowProps<T> {\n row: T;\n isExpanded: DataTableProps<T>[\"isExpanded\"];\n /** What the row shows when opened — DataTable's `openedRowContent`. */\n openedRowContent: (row: T) => ReactNode;\n /** Whether an opened row has anything to show at all. */\n opensRow: boolean;\n rowClassName: DataTableProps<T>[\"rowClassName\"];\n rowAttributes: DataTableProps<T>[\"rowAttributes\"];\n onRowClick: DataTableProps<T>[\"onRowClick\"];\n rowHref: DataTableProps<T>[\"rowHref\"];\n /** `mobileSwipeActions`, or the swipes derived from `rowActions`. */\n swipeActionsFor: ((row: T) => MobileSwipeActions | null) | undefined;\n /** The card list's reading direction, for which physical drag a swipe side means. */\n mobileDir: Direction;\n /** No column the card renders owns a link, so the card itself may be one. */\n mobileCardLinkable: boolean;\n mobileCard: DataTableProps<T>[\"mobileCard\"];\n mobilePrimaryCol: DataTableColumn<T> | null;\n mobileSecondaryColumns: DataTableColumn<T>[];\n mobileExpandAsDialog: boolean;\n compact: boolean;\n /** The text size is Large or Extra large (§4). */\n large: boolean;\n /** Phone selection (0.40, keksdose live #421); null without DataTable's `selection`. */\n select: MobileRowSelect | null;\n}\n\n/** A phone card's part in DataTable's `selection` (0.40, keksdose live #421). */\nexport interface MobileRowSelect {\n /** The card list is in selection mode: the card shows its box and a tap toggles it. */\n active: boolean;\n /** `selection.isSelectable` for this row. */\n selectable: boolean;\n selected: boolean;\n onToggle: (checked: boolean) => void;\n /** A long press outside the mode: enter it with this row selected. */\n onLongPress: () => void;\n}\n\n/** One mobile card. Shared by the flat list and the grouped list, so both draw\n * identical row markup. */\nexport function MobileRow<T>({\n row,\n isExpanded,\n openedRowContent,\n opensRow,\n rowClassName,\n rowAttributes,\n onRowClick,\n rowHref,\n swipeActionsFor,\n mobileDir,\n mobileCardLinkable,\n mobileCard,\n mobilePrimaryCol,\n mobileSecondaryColumns,\n mobileExpandAsDialog,\n compact,\n large,\n select,\n}: MobileRowProps<T>) {\n const expanded = isExpanded?.(row) ?? false;\n // Selection mode (#421): the whole card is the row's checkbox — a tap toggles it\n // instead of opening the row, and the swipe and the long press stand down, so no\n // gesture means two things at once (keksdose's register list, its feedback #153).\n const selecting = !!select?.active;\n // Not on an open card, as in kk's register: its editor and a selection are two modes\n // fighting over the same row.\n const pressable = !!select && select.selectable && !selecting && !expanded;\n const longPress = useLongPress(() => select?.onLongPress(), { enabled: pressable });\n const expansion = expanded ? openedRowContent(row) : null;\n const tint = rowClassName?.(row);\n // Use div+role=\"button\" rather than a real <button> so cells that\n // contain their own interactive controls (status toggles, action\n // icons) don't end up as illegal nested buttons.\n const interactive = !!onRowClick;\n // Say that the card OPENS something (Keksdose feedback #163). A phone card had\n // only a cursor and a tap-tint to advertise its editor — on the invoice review\n // screen, whose entire purpose is correcting mis-read lines, that read as \"these\n // values are not editable\". A chevron is the affordance every list on a phone\n // uses for exactly this, and it points the way the row actually opens: right into\n // a sheet, or down into an inline panel that flips it when expanded.\n const opensDetail = interactive && opensRow;\n const swipeActions = swipeActionsFor?.(row);\n const swipe = swipeActions ? physicalSwipe(swipeActions, mobileDir) : null;\n // An OPEN card swipes too (0.40, keksdose live #416, Marcel: \"faster than scrolling\n // down to the buttons\"). Only the card's header — the summary line — is inside\n // SwipeableRow; the opened body below is a sibling, so its fields, sliders and\n // scrolling never meet the gesture. Until 0.40 an open card silently lost it.\n // In selection mode a sideways drag would be a second meaning for a selecting touch.\n const swipeEnabled = !!swipe && !selecting;\n const href = mobileCardLinkable ? rowHref?.(row) : undefined;\n const cardClass = cn(\n \"w-full text-start flex items-center\",\n // §4: more room per row at Large — a taller row is a bigger tap target too.\n compact ? \"px-3 py-2 gap-2 text-sm large:py-3\" : \"px-4 py-3 gap-3 large:py-4\",\n // Live #320's other half: the card acknowledges the touch before the sheet\n // arrives. On a cold route the data can take a beat, and an unacknowledged tap\n // reads as \"did that register?\" — which is most of what \"abrupt\" means here.\n // `origin-center` + a 0.5% squeeze is deliberately almost subliminal: this fires\n // on every row of a long list, so anything larger becomes the list's personality\n // rather than feedback. `transition-transform` alone, so the existing background\n // flip stays instant.\n interactive &&\n \"cursor-pointer transition-transform duration-100 active:scale-[0.995] active:bg-active motion-reduce:transition-none motion-reduce:active:scale-100\",\n // The keyboard's frame drawn INSIDE the card, as the desktop row's is (keksdose live\n // #394): the browser's own ring and tap highlight sit on the card's outer edge, and\n // three ancestors clip it — SwipeableRow's `overflow-hidden`, the card list, and\n // AppShell main's `overflow-x-clip` — so the frame went missing on one side. A press\n // keeps the fill and the squeeze above; an outline on every tap of a long list would\n // be louder than the acknowledgement it replaces.\n (interactive || selecting) && cn(\"[-webkit-tap-highlight-color:transparent] focus-visible:ring-inset\", FOCUS_RING),\n selecting && \"cursor-pointer\",\n select?.selected && selecting && \"bg-brand-soft\",\n // A 500 ms hold would otherwise start a text selection, and iOS's link callout —\n // which only yields to this CSS. The trade kk made on its register: the card's text\n // is not selectable on a phone where the table offers selection.\n select && \"select-none [-webkit-touch-callout:none]\",\n );\n // The card's content is written once and worn by either tag below. Note that\n // the primary cell is rendered RAW here, never through `linkColumn` — the card\n // itself is the anchor, and routing it through `linkColumn` too would nest an\n // <a> inside an <a>. Desktop and mobile are mutually exclusive (`isMdUp`), so\n // exactly one anchor exists per row.\n const cardInner = (\n <>\n {/* The card's own content keeps the column it always had; the chevron sits\n beside it rather than inside, so a caller's `mobileCard` is untouched. */}\n <div\n className={cn(\n \"flex min-w-0 flex-1 flex-col\",\n compact ? \"gap-1 large:gap-2\" : \"gap-2 large:gap-3\",\n // §4 \"nothing truncates\": at Large a cell's own `truncate` wraps instead —\n // the reader who chose bigger type is the one an ellipsis fails. A caller's\n // `mobileCard` is its own layout and keeps what it chose.\n !mobileCard && CARD_NO_TRUNCATE,\n )}\n >\n {mobileCard ? (\n mobileCard(row)\n ) : (\n <>\n {/* Only the `data-*` half of `cellProps` — see its note. */}\n {mobilePrimaryCol && (\n <div {...dataAttrsOf(mobilePrimaryCol.cellProps?.(row))} className=\"min-w-0 break-words font-medium\">\n {mobilePrimaryCol.cell(row)}\n </div>\n )}\n {mobileSecondaryColumns.length > 0 && large ? (\n // §4: each label ABOVE its value at Large. Side by side, a label column\n // sized to the widest label leaves a value a sliver of a 240 px card.\n <StackedFields columns={mobileSecondaryColumns} row={row} compact={compact} />\n ) : mobileSecondaryColumns.length > 0 && (\n <dl\n className={cn(\n \"grid grid-cols-[auto_1fr] gap-x-3\",\n compact ? \"gap-y-0.5 text-xs\" : \"gap-y-1 text-sm\",\n )}\n >\n {mobileSecondaryColumns.map((col) => (\n <Fragment key={col.key}>\n <dt className=\"text-xs uppercase tracking-wide text-muted self-center\">\n {col.header}\n </dt>\n <dd\n {...dataAttrsOf(col.cellProps?.(row))}\n className=\"min-w-0 text-secondary self-center\"\n >\n {col.cell(row)}\n </dd>\n </Fragment>\n ))}\n </dl>\n )}\n </>\n )}\n </div>\n {opensDetail && !selecting &&\n // `aria-hidden`: the row already announces itself as a button with\n // `aria-expanded`, so the icon would only add a second, wordless stop.\n (mobileExpandAsDialog ? (\n // Points INTO the sheet, which is the reading-forward direction.\n <ChevronRight\n aria-hidden\n className=\"size-4 shrink-0 text-placeholder rtl:-scale-x-100\"\n />\n ) : (\n <ChevronDown\n aria-hidden\n className={cn(\n \"size-4 shrink-0 text-placeholder transition-transform\",\n expanded && \"rotate-180\",\n )}\n />\n ))}\n </>\n );\n // The long press rides the card itself; the click it leaves behind is swallowed on\n // the `<li>` below, in the capture phase, before the card (or RowLink) sees it.\n // Attached whenever the table selects, the hook's `enabled` deciding whether a press\n // arms: its pointerdown also clears a stale swallow latch, which must happen in the\n // mode too, or a long press whose click never came would eat the first toggle.\n //\n // A press that starts on a control in a cell (or in a portal one opened) is that\n // control's, not a way into the mode (keksdose live #428): it only clears the latch.\n const press = select\n ? {\n ...longPress.handlers,\n onPointerDown: (e: ReactPointerEvent<HTMLElement>) => {\n if (fromOutside(e.target, e.currentTarget) || fromOwnControl(e.target, e.currentTarget)) {\n longPress.consumeClick();\n return;\n }\n longPress.handlers.onPointerDown(e);\n },\n onContextMenu: (e: ReactMouseEvent<HTMLElement>) => {\n if (fromOutside(e.target, e.currentTarget) || fromOwnControl(e.target, e.currentTarget)) return;\n longPress.handlers.onContextMenu(e);\n },\n }\n : undefined;\n const body = selecting ? (\n // In the mode a card is a toggle — kk's register row: `role=\"button\"` with\n // `aria-pressed`, the box beside it only a picture of that state (the card is the\n // one control, so the two can never fight or fire twice).\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- role=\"button\",\n tabIndex 0 and Enter/Space are all here; the rule cannot follow the conditional role. */\n <div\n role={select!.selectable ? \"button\" : undefined}\n tabIndex={select!.selectable ? 0 : undefined}\n aria-pressed={select!.selectable ? select!.selected : undefined}\n aria-disabled={select!.selectable ? undefined : true}\n data-card-selecting=\"\"\n {...press}\n onClick={(e) => {\n if (!select!.selectable || fromOutside(e.target, e.currentTarget)) return;\n // A tap on a control in a cell is that control's (keksdose live #428).\n if (fromOwnControl(e.target, e.currentTarget)) return;\n select!.onToggle(!select!.selected);\n }}\n onKeyDown={(e) => {\n if (!select!.selectable || e.target !== e.currentTarget) return;\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n select!.onToggle(!select!.selected);\n }\n }}\n className={cardClass}\n >\n <Checkbox\n readOnly\n tabIndex={-1}\n aria-hidden\n checked={select!.selected}\n disabled={!select!.selectable}\n className=\"pointer-events-none shrink-0 self-center\"\n inputClassName=\"pointer-events-none\"\n />\n {cardInner}\n </div>\n ) : interactive && href ? (\n // A card with a URL of its own is a LINK, not a div wearing role=\"button\"\n // (feedback #451): the phone's long-press \"open in new tab\" and a screen\n // reader's link semantics both come free, and the fake role goes away.\n <RowLink\n href={href}\n {...press}\n onActivate={() => onRowClick!(row)}\n aria-expanded={opensRow ? expanded : undefined}\n className={cardClass}\n // Enter already activates a link natively, and that routes through\n // RowLink's own onClick — handling it here too would open the row twice.\n // Space is the only key left, and only so it opens the row instead of\n // scrolling the list.\n onKeyDown={(e) => {\n if (e.key !== \" \") return;\n e.preventDefault();\n onRowClick!(row);\n }}\n >\n {cardInner}\n </RowLink>\n ) : (\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- the handlers are\n only attached when `interactive`, and then so are role=\"button\", tabIndex 0 and the\n Enter/Space handler below; the rule cannot follow the conditional role. */\n <div\n {...press}\n role={interactive ? \"button\" : undefined}\n tabIndex={interactive ? 0 : undefined}\n onClick={\n interactive\n ? (e) => {\n if (fromOutside(e.target, e.currentTarget)) return;\n // A tap on a control in a cell (a select, a button) is that\n // control's, as on the desktop `<tr>` (keksdose live #428).\n if (fromOwnControl(e.target, e.currentTarget)) return;\n onRowClick!(row);\n }\n : undefined\n }\n onKeyDown={\n interactive\n ? (e) => {\n // A key press inside a nested control is that control's.\n if (e.target !== e.currentTarget) return;\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onRowClick!(row);\n }\n }\n : undefined\n }\n aria-expanded={opensRow ? expanded : undefined}\n className={cardClass}\n >\n {cardInner}\n </div>\n );\n return (\n <li\n className={cn(tint)}\n {...cleanAttrs(rowAttributes?.(row))}\n data-selected={selecting && select!.selected ? \"\" : undefined}\n onClickCapture={\n select\n ? (e) => {\n if (!longPress.consumeClick()) return;\n e.preventDefault();\n e.stopPropagation();\n }\n : undefined\n }\n >\n {swipeEnabled ? (\n <SwipeableRow enabled left={swipe!.left} right={swipe!.right}>\n {body}\n </SwipeableRow>\n ) : (\n body\n )}\n {expansion && !mobileExpandAsDialog && (\n <div\n className={cn(\n \"bg-surface-2 border-t border-subtle\",\n compact ? \"px-3 py-2\" : \"px-4 py-3\",\n )}\n >\n {expansion}\n </div>\n )}\n </li>\n );\n}\n\n// ---------- Phone selection bar (0.40, keksdose live #421) ----------\n\n/**\n * The card list's way into and out of selection mode for a keyboard and a screen\n * reader — the long press is a touch gesture, and a gesture alone is no path at all.\n *\n * Outside the mode it is one button, \"Select rows\", visually hidden until it takes\n * focus (SwipeableRow's keyboard buttons, the same rule): the card list keeps the look\n * kk's register has, where the long press is the way in, and Tab or a screen reader's\n * cursor still finds it. In the mode it is a visible row: \"Select all rows\" — the\n * desktop header's box — and Cancel, which clears the selection and leaves, as the\n * bulk bar's Clear does. The owner's bulk bar is the owner's, as on desktop: it\n * appears because the selection is no longer empty.\n */\nexport function MobileSelectBar({\n active,\n allSelected,\n someSelected,\n compact,\n labels,\n onEnter,\n onToggleAll,\n onCancel,\n}: {\n active: boolean;\n allSelected: boolean;\n someSelected: boolean;\n compact: boolean;\n labels: DataTableLabels;\n onEnter: () => void;\n onToggleAll: (checked: boolean) => void;\n onCancel: () => void;\n}) {\n // The control that was pressed unmounts with the mode it switched, so focus is\n // handed across: into the bar's box on the way in, back to the button on the way out.\n const handOff = useRef(false);\n const allBox = useRef<HTMLInputElement>(null);\n const enterButton = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (!handOff.current) return;\n handOff.current = false;\n (active ? allBox.current : enterButton.current)?.focus();\n }, [active]);\n if (!active)\n return (\n <button\n ref={enterButton}\n type=\"button\"\n data-table-mobile-select=\"\"\n onClick={() => {\n handOff.current = true;\n onEnter();\n }}\n className={cn(\n \"sr-only rounded-md text-sm font-medium text-secondary\",\n // Padding only once shown: unconditional, it beats sr-only's `padding: 0`\n // (SwipeableRow's 0.32.1 note).\n \"focus:not-sr-only focus:m-2 focus:inline-flex focus:px-2 focus:py-1\",\n FOCUS_RING,\n )}\n >\n {labels.selectRows}\n </button>\n );\n return (\n <div\n data-table-mobile-select=\"\"\n className={cn(\n \"flex flex-wrap items-center justify-between gap-2 border-b border-subtle\",\n compact ? \"px-3 py-1.5\" : \"px-4 py-2\",\n )}\n >\n <Checkbox\n ref={allBox}\n label={labels.selectAllRows}\n checked={allSelected}\n indeterminate={someSelected && !allSelected}\n onChange={(e) => onToggleAll(e.target.checked)}\n />\n <button\n type=\"button\"\n onClick={() => {\n handOff.current = true;\n onCancel();\n }}\n className={cn(\"rounded-md px-2 py-1 text-sm text-muted hover:text-secondary\", FOCUS_RING)}\n >\n {labels.cancelSelection}\n </button>\n </div>\n );\n}\n\n// ---------- Mobile filter sheet ----------\n\n/**\n * Filter access for the mobile card list (feedback #299). The desktop table\n * houses per-column filters in its header; the card list has no header, so the\n * same filters were unreachable on phones. This renders a compact \"Filters\" bar\n * that opens a bottom sheet listing each filterable column as a collapsible\n * section, reusing the very same {@link FilterPopover} and filter state the\n * desktop table drives — so it filters identically and stays URL-synced.\n *\n * The sheet is a {@link DialogFrame} (round 0.34 BUG-7b = DUP-6). It was the last\n * hand-rolled modal in the kit: `role=\"dialog\" aria-modal=\"true\"` on the backdrop, with\n * copies of the scroll lock, the backdrop close and the Back entry — and no name, no\n * focus moved in, no trap and no Escape, so a reader was told the page was hidden while\n * focus stayed on it. On a phone `Modal` is a bottom sheet already; it now brings all\n * of that, and the exit motion, from the one place every other dialog gets it.\n */\nexport function MobileFilters<T>({\n columns,\n filters,\n selectOptionsByKey,\n isServer,\n hasFilterCallback,\n onSetFilter,\n onClearFilter,\n onClearAll,\n labels,\n locale,\n}: {\n columns: DataTableColumn<T>[];\n filters: FilterState;\n selectOptionsByKey: Record<string, { value: string; label: string }[]>;\n isServer: boolean;\n hasFilterCallback: boolean;\n onSetFilter: (key: string, value: FilterValue) => void;\n onClearFilter: (key: string) => void;\n onClearAll: () => void;\n labels: DataTableLabels;\n locale?: string;\n}) {\n const [open, setOpen] = useState(false);\n // The sheet is portalled to <body>, out from under whatever `dir` the table sits\n // in, so it carries the trigger's direction with it — read at the moment of opening,\n // from the element the user actually pressed.\n const [dir, setDir] = useState<Direction>(\"ltr\");\n const [expanded, setExpanded] = useState<string | null>(null);\n\n const filterable = useMemo(\n () =>\n columns\n .map((col) => ({ col, filter: !isServer || hasFilterCallback ? resolveFilter(col) : null }))\n .filter((x): x is { col: DataTableColumn<T>; filter: ColumnFilter<T> } => !!x.filter),\n [columns, isServer, hasFilterCallback],\n );\n\n if (filterable.length === 0) return null;\n\n const activeCount = filterable.filter(({ col }) => {\n const s = filters[col.key];\n return s && isFilterActive(s);\n }).length;\n\n return (\n <div className=\"flex items-center justify-between gap-2 border-b border-subtle px-4 py-2\">\n <button\n type=\"button\"\n onClick={(e) => {\n setDir(dirOf(e.currentTarget));\n setOpen(true);\n }}\n className=\"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-secondary hover:bg-hover\"\n >\n <Filter className=\"size-4\" />\n <span>{labels.filters}</span>\n {activeCount > 0 && (\n <span className=\"inline-flex min-w-4 items-center justify-center rounded-full bg-info-soft px-1 text-caption font-semibold text-info\">\n {activeCount}\n </span>\n )}\n </button>\n {activeCount > 0 && (\n <button\n type=\"button\"\n onClick={onClearAll}\n className=\"text-xs text-muted hover:text-secondary\"\n >\n {labels.clearAll}\n </button>\n )}\n {/* Escape, the backdrop, Back (Keksdose feedback #172: the filters are already\n in the URL, so closing never loses anything), the scroll lock, focus in and\n back to this bar's button — all `Modal`'s. `fullBleed` lets the sheet meet the\n screen's edges on a phone, as it always did. */}\n <DialogFrame\n open={open}\n onClose={() => setOpen(false)}\n title={labels.filters}\n closeButton\n closeLabel={labels.close}\n headerDivider\n fullBleed\n // Portalled to <body>, so the direction read from the button goes with it.\n dir={dir}\n className=\"max-h-[85vh] rounded-b-none md:rounded-b-lg\"\n // The sections run edge to edge with a rule between them, as before.\n bodyClassName=\"space-y-0 divide-y divide-subtle px-0 pt-0 pb-0\"\n actions={(close) => (\n <>\n <button\n type=\"button\"\n onClick={onClearAll}\n disabled={activeCount === 0}\n // `me-auto` keeps Clear all at the start and Done at the end.\n className=\"me-auto text-sm text-muted hover:text-secondary disabled:opacity-40\"\n >\n {labels.clearAll}\n </button>\n <button\n type=\"button\"\n onClick={close}\n className=\"rounded-md bg-inverse px-4 py-2 text-sm font-medium text-inverse\"\n >\n {labels.done}\n </button>\n </>\n )}\n >\n {filterable.map(({ col, filter }) => {\n const state = filters[col.key];\n const active = !!state && isFilterActive(state);\n const isItemOpen = expanded === col.key;\n return (\n <div key={col.key}>\n <button\n type=\"button\"\n onClick={() => setExpanded(isItemOpen ? null : col.key)}\n aria-expanded={isItemOpen}\n className=\"flex w-full items-center justify-between gap-2 px-4 py-3 text-start\"\n >\n <span className=\"flex items-center gap-2 text-sm font-medium text-secondary\">\n {col.header}\n {active && <span className=\"size-1.5 rounded-full bg-brand\" />}\n </span>\n <ChevronDown\n className={cn(\n \"size-4 shrink-0 text-placeholder transition-transform\",\n isItemOpen && \"rotate-180\",\n )}\n />\n </button>\n {isItemOpen && (\n <div className=\"px-4 pb-3\">\n <FilterPopover\n column={col}\n state={state ?? defaultFilterState(filter)}\n onChange={(next) => onSetFilter(col.key, next)}\n onClear={() => onClearFilter(col.key)}\n selectOptions={selectOptionsByKey[col.key] ?? []}\n labels={labels}\n locale={locale}\n />\n </div>\n )}\n </div>\n );\n })}\n </DialogFrame>\n </div>\n );\n}\n"],"mappings":";AA8EQ,SAsPE,UArPA,KADF;AA9ER,SAAS,YAAAA,WAAU,WAAW,OAAO,SAAS,QAAQ,gBAAgB;AAEtE,SAAS,qBAAqB,mBAAmB,aAAa,cAAc,cAAc;AAC1F,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,aAA6B;AACtC,SAAS,oBAAoB,gBAAgB,qBAAqB;AAGlE,SAAS,qBAAqB;AAC9B,SAAS,oBAAsC;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAE7B,SAAS,SAAS,YAAY,aAAa,aAAa,sBAAsB;AAgB9E,SAAS,YAAY,OAA4E;AAC/F,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,MAA+B,CAAC;AACtC,aAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAK,EAAG,KAAI,EAAE,WAAW,OAAO,KAAK,MAAM,WAAY,KAAI,CAAC,IAAI;AACpG,SAAO;AACT;AAGA,SAAS,cACP,SACA,KACiD;AACjD,QAAM,MAAM,QAAQ;AACpB,SAAO;AAAA,IACL,OAAO,MAAM,QAAQ,MAAM,QAAQ,UAAU,QAAQ;AAAA,IACrD,QAAQ,MAAM,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ;AAAA,EACxD;AACF;AAWA,MAAM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AAA,gBACf,WAAU;AAAA,gBAEV;AAAA,uCAAC,UAAK,WAAU,8DACb;AAAA,wBAAI;AAAA,oBACJ,UAAU,oBAAC,UAAK,WAAU,kCAAiC;AAAA,qBAC9D;AAAA,kBACA;AAAA,oBAAC;AAAA;AAAA,sBACC,WAAW;AAAA,wBACT;AAAA,wBACA,cAAc;AAAA,sBAChB;AAAA;AAAA,kBACF;AAAA;AAAA;AAAA,YACF;AAAA,YACC,cACC,oBAAC,SAAI,WAAU,aACb;AAAA,cAAC;AAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,OAAO,SAAS,mBAAmB,MAAM;AAAA,gBACzC,UAAU,CAAC,SAAS,YAAY,IAAI,KAAK,IAAI;AAAA,gBAC7C,SAAS,MAAM,cAAc,IAAI,GAAG;AAAA,gBACpC,eAAe,mBAAmB,IAAI,GAAG,KAAK,CAAC;AAAA,gBAC/C;AAAA,gBACA;AAAA;AAAA,YACF,GACF;AAAA,eA7BM,IAAI,GA+Bd;AAAA,QAEJ,CAAC;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;","names":["Fragment"]}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
import { type RowAction } from "./row-actions.js";
|
|
1
2
|
import type { DataTableLabels } from "./data-table-labels.js";
|
|
2
|
-
import type { DataTableColumn, DataTableDensity, DataTableProps, MobileSwipeActions } from "./data-table.js";
|
|
3
|
+
import type { DataTableColumn, DataTableDensity, DataTableDesktopSwipeActions, DataTableProps, MobileSwipeActions } from "./data-table.js";
|
|
3
4
|
/** The actions column's key. Not a column a caller declares, so it is kept out of the
|
|
4
5
|
* column-settings panel. */
|
|
5
6
|
export declare const ROW_ACTIONS_KEY = "__rowActions";
|
|
7
|
+
/** The key of the column derived from `mobileSwipeActions` (0.46, dev#598) — the
|
|
8
|
+
* table's own too. */
|
|
9
|
+
export declare const SWIPE_ACTIONS_KEY = "__swipeActions";
|
|
10
|
+
/** A column the TABLE adds, not the caller: out of the column settings and the count,
|
|
11
|
+
* never resized, never the totals row's header. */
|
|
12
|
+
export declare function isTableOwnColumn(key: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* A row's swipe plan as desktop row actions (dev#598): `end` then `start` — the physical
|
|
15
|
+
* `right` / `left` only where the logical side is missing, as the card reads them — each
|
|
16
|
+
* action once, told apart by its `id`, else by its label (two stages with one label would
|
|
17
|
+
* be one button twice).
|
|
18
|
+
*/
|
|
19
|
+
export declare function swipePlanRowActions<T>(plan: MobileSwipeActions | null | undefined, row: T, options?: Pick<DataTableDesktopSwipeActions<T>, "omit" | "commit">): RowAction[];
|
|
6
20
|
/**
|
|
7
21
|
* The caller's columns with the actions column appended, and the same actions as a
|
|
8
22
|
* phone card's swipes (`swipesFromActions`; DataTable uses it unless the caller passes
|
|
@@ -12,12 +26,14 @@ export declare const ROW_ACTIONS_KEY = "__rowActions";
|
|
|
12
26
|
* second special case beside the selection column: it then gets the cell padding,
|
|
13
27
|
* the widths and the phone rules (`mobileHidden`) every other column gets.
|
|
14
28
|
*/
|
|
15
|
-
export declare function useRowActionColumn<T>({ columns: columnsProp, rowActions, rowName, labels, density, }: {
|
|
29
|
+
export declare function useRowActionColumn<T>({ columns: columnsProp, rowActions, rowName, labels, density, mobileSwipeActions, desktopSwipeActions, }: {
|
|
16
30
|
columns: DataTableColumn<T>[];
|
|
17
31
|
rowActions: DataTableProps<T>["rowActions"];
|
|
18
32
|
rowName: DataTableProps<T>["rowName"];
|
|
19
33
|
labels: DataTableLabels;
|
|
20
34
|
density: DataTableDensity;
|
|
35
|
+
mobileSwipeActions?: DataTableProps<T>["mobileSwipeActions"];
|
|
36
|
+
desktopSwipeActions?: DataTableProps<T>["desktopSwipeActions"];
|
|
21
37
|
}): {
|
|
22
38
|
columns: DataTableColumn<T>[];
|
|
23
39
|
swipesFromActions: (row: T) => MobileSwipeActions | null;
|
|
@@ -4,6 +4,41 @@ import { isValidElement, useCallback, useMemo } from "react";
|
|
|
4
4
|
import { Pencil, Trash2 } from "lucide-react";
|
|
5
5
|
import { RowActions } from "./row-actions.js";
|
|
6
6
|
const ROW_ACTIONS_KEY = "__rowActions";
|
|
7
|
+
const SWIPE_ACTIONS_KEY = "__swipeActions";
|
|
8
|
+
function isTableOwnColumn(key) {
|
|
9
|
+
return key === ROW_ACTIONS_KEY || key === SWIPE_ACTIONS_KEY;
|
|
10
|
+
}
|
|
11
|
+
function swipeTone(action) {
|
|
12
|
+
switch (action.tone) {
|
|
13
|
+
case "danger":
|
|
14
|
+
case "warning":
|
|
15
|
+
case "info":
|
|
16
|
+
return action.tone;
|
|
17
|
+
default:
|
|
18
|
+
return "muted";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function swipePlanRowActions(plan, row, options = {}) {
|
|
22
|
+
if (!plan) return [];
|
|
23
|
+
const out = [];
|
|
24
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25
|
+
for (const action of [...plan.end ?? plan.right ?? [], ...plan.start ?? plan.left ?? []]) {
|
|
26
|
+
const key = action.id ?? action.label;
|
|
27
|
+
if (seen.has(key)) continue;
|
|
28
|
+
seen.add(key);
|
|
29
|
+
if (options.omit?.(action, row)) continue;
|
|
30
|
+
const commit = typeof options.commit === "function" ? options.commit(action, row) : options.commit;
|
|
31
|
+
out.push({
|
|
32
|
+
key,
|
|
33
|
+
label: action.label,
|
|
34
|
+
icon: isValidElement(action.icon) ? action.icon : action.icon != null && action.icon !== false ? /* @__PURE__ */ jsx(Fragment, { children: action.icon }) : void 0,
|
|
35
|
+
tone: swipeTone(action),
|
|
36
|
+
commit,
|
|
37
|
+
onSelect: action.onCommit
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
7
42
|
function resolveRowAction(action, index, labels) {
|
|
8
43
|
const tone = action.tone ?? (action.kind === "delete" ? "danger" : "default");
|
|
9
44
|
return {
|
|
@@ -34,13 +69,55 @@ function useRowActionColumn({
|
|
|
34
69
|
rowActions,
|
|
35
70
|
rowName,
|
|
36
71
|
labels,
|
|
37
|
-
density
|
|
72
|
+
density,
|
|
73
|
+
mobileSwipeActions,
|
|
74
|
+
desktopSwipeActions
|
|
38
75
|
}) {
|
|
39
76
|
const rowActionsFor = useCallback(
|
|
40
77
|
(row) => rowActions ? (typeof rowActions === "function" ? rowActions(row) : rowActions).filter((a) => !a.hidden?.(row)).map((a, i) => resolveRowAction(a, i, labels)) : [],
|
|
41
78
|
[rowActions, labels]
|
|
42
79
|
);
|
|
43
|
-
const
|
|
80
|
+
const swipeOptions = typeof desktopSwipeActions === "object" ? desktopSwipeActions : void 0;
|
|
81
|
+
const swipeColumnOn = !!mobileSwipeActions && (desktopSwipeActions === void 0 ? !rowActions : desktopSwipeActions !== false);
|
|
82
|
+
const swipeOmit = swipeOptions?.omit;
|
|
83
|
+
const swipeName = swipeOptions?.name;
|
|
84
|
+
const swipeCollapse = swipeOptions?.collapse;
|
|
85
|
+
const swipeCommit = swipeOptions?.commit;
|
|
86
|
+
const swipeColumn = useMemo(
|
|
87
|
+
() => swipeColumnOn ? {
|
|
88
|
+
key: SWIPE_ACTIONS_KEY,
|
|
89
|
+
header: /* @__PURE__ */ jsx("span", { className: "sr-only", children: labels.actions }),
|
|
90
|
+
cell: (row) => /* @__PURE__ */ jsx(
|
|
91
|
+
RowActions,
|
|
92
|
+
{
|
|
93
|
+
actions: swipePlanRowActions(mobileSwipeActions(row), row, { omit: swipeOmit, commit: swipeCommit }),
|
|
94
|
+
name: (swipeName ?? rowName)?.(row),
|
|
95
|
+
collapse: swipeCollapse,
|
|
96
|
+
size: density === "compact" ? "2xs" : "xs",
|
|
97
|
+
tooltipSide: "start",
|
|
98
|
+
labels: { actions: labels.actions },
|
|
99
|
+
className: "justify-end"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
className: "w-px whitespace-nowrap text-end",
|
|
103
|
+
headClassName: "w-px",
|
|
104
|
+
// On a phone the same actions are the card's swipes.
|
|
105
|
+
mobileHidden: true,
|
|
106
|
+
noRowLink: true
|
|
107
|
+
} : null,
|
|
108
|
+
[
|
|
109
|
+
swipeColumnOn,
|
|
110
|
+
mobileSwipeActions,
|
|
111
|
+
swipeOmit,
|
|
112
|
+
swipeCommit,
|
|
113
|
+
swipeName,
|
|
114
|
+
rowName,
|
|
115
|
+
swipeCollapse,
|
|
116
|
+
density,
|
|
117
|
+
labels.actions
|
|
118
|
+
]
|
|
119
|
+
);
|
|
120
|
+
const actionColumns = useMemo(
|
|
44
121
|
() => rowActions ? [
|
|
45
122
|
...columnsProp,
|
|
46
123
|
{
|
|
@@ -70,6 +147,10 @@ function useRowActionColumn({
|
|
|
70
147
|
] : columnsProp,
|
|
71
148
|
[columnsProp, rowActions, rowActionsFor, rowName, labels.actions, density]
|
|
72
149
|
);
|
|
150
|
+
const columns = useMemo(
|
|
151
|
+
() => swipeColumn ? [...actionColumns, swipeColumn] : actionColumns,
|
|
152
|
+
[actionColumns, swipeColumn]
|
|
153
|
+
);
|
|
73
154
|
const swipesFromActions = (row) => {
|
|
74
155
|
const swipes = rowActionsFor(row).filter((a) => a.swipe && !a.action.disabledReason?.(row));
|
|
75
156
|
if (!swipes.length) return null;
|
|
@@ -90,6 +171,9 @@ function useRowActionColumn({
|
|
|
90
171
|
}
|
|
91
172
|
export {
|
|
92
173
|
ROW_ACTIONS_KEY,
|
|
174
|
+
SWIPE_ACTIONS_KEY,
|
|
175
|
+
isTableOwnColumn,
|
|
176
|
+
swipePlanRowActions,
|
|
93
177
|
useRowActionColumn
|
|
94
178
|
};
|
|
95
179
|
//# sourceMappingURL=data-table-row-actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/data-table-row-actions.tsx"],"sourcesContent":["import { isValidElement, useCallback, useMemo } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { Pencil, Trash2 } from \"lucide-react\";\nimport { RowActions, type RowAction } from \"./row-actions\";\nimport type { SwipeAction } from \"./swipeable-row\";\nimport type { DataTableLabels } from \"./data-table-labels\";\nimport type {\n DataTableColumn,\n DataTableDensity,\n DataTableProps,\n DataTableRowAction,\n MobileSwipeActions,\n} from \"./data-table\";\n\n// DataTable's per-row actions (`rowActions`): the actions column on a wide screen and\n// the swipes on a phone card. Moved out of data-table.tsx whole (refactor audit\n// 2026-10, MOD-3 step 1); internal — the public types stay in data-table.tsx.\n\n/** The actions column's key. Not a column a caller declares, so it is kept out of the\n * column-settings panel. */\nexport const ROW_ACTIONS_KEY = \"__rowActions\";\n\ninterface ResolvedRowAction<T> {\n key: string;\n label: string;\n icon: ReactNode;\n tone: \"default\" | \"danger\";\n swipe: \"start\" | \"end\" | false;\n action: DataTableRowAction<T>;\n}\n\nfunction resolveRowAction<T>(\n action: DataTableRowAction<T>,\n index: number,\n labels: DataTableLabels,\n): ResolvedRowAction<T> {\n const tone = action.tone ?? (action.kind === \"delete\" ? \"danger\" : \"default\");\n return {\n key: action.kind ?? `${index}:${action.label ?? \"\"}`,\n label: action.label ?? (action.kind === \"edit\" ? labels.edit : action.kind === \"delete\" ? labels.delete : \"\"),\n icon:\n action.icon ??\n (action.kind === \"edit\" ? <Pencil /> : action.kind === \"delete\" ? <Trash2 /> : null),\n tone,\n swipe: action.swipe ?? (tone === \"danger\" ? \"start\" : \"end\"),\n action,\n };\n}\n\n/** Ask, then act. */\nasync function runRowAction<T>(action: DataTableRowAction<T>, row: T): Promise<void> {\n if (action.confirm && !(await action.confirm(row))) return;\n action.onAction(row);\n}\n\n/** A resolved row action as {@link RowActions} takes it. Its `icon` is any node; a\n * non-element one (a string glyph) is wrapped, since RowAction wants an element. */\nfunction toRowAction<T>(a: ResolvedRowAction<T>, row: T): RowAction {\n return {\n key: a.key,\n label: a.label,\n icon: isValidElement(a.icon) ? a.icon : a.icon != null && a.icon !== false ? <>{a.icon}</> : undefined,\n tone: a.tone,\n disabledReason: a.action.disabledReason?.(row),\n onSelect: () => void runRowAction(a.action, row),\n };\n}\n\n/**\n * The caller's columns with the actions column appended, and the same actions as a\n * phone card's swipes (`swipesFromActions`; DataTable uses it unless the caller passes\n * `mobileSwipeActions`). Without `rowActions` the columns come back as given.\n *\n * The actions column is appended to the caller's columns rather than drawn as a\n * second special case beside the selection column: it then gets the cell padding,\n * the widths and the phone rules (`mobileHidden`) every other column gets.\n */\nexport function useRowActionColumn<T>({\n columns: columnsProp,\n rowActions,\n rowName,\n labels,\n density,\n}: {\n columns: DataTableColumn<T>[];\n rowActions: DataTableProps<T>[\"rowActions\"];\n rowName: DataTableProps<T>[\"rowName\"];\n labels: DataTableLabels;\n density: DataTableDensity;\n}): {\n columns: DataTableColumn<T>[];\n swipesFromActions: (row: T) => MobileSwipeActions | null;\n} {\n const rowActionsFor = useCallback(\n (row: T): ResolvedRowAction<T>[] =>\n rowActions\n ? (typeof rowActions === \"function\" ? rowActions(row) : rowActions)\n .filter((a) => !a.hidden?.(row))\n .map((a, i) => resolveRowAction(a, i, labels))\n : [],\n [rowActions, labels],\n );\n const columns = useMemo<DataTableColumn<T>[]>(\n () =>\n rowActions\n ? [\n ...columnsProp,\n {\n key: ROW_ACTIONS_KEY,\n header: <span className=\"sr-only\">{labels.actions}</span>,\n // Through RowActions (0.32, §10.8): the icons inline at Normal, one \"⋯\"\n // menu at Large once there are two — every label at once does not fit a\n // row. Each control stops its own click: the row's handler already skips\n // its controls, and this is for the caller who wraps the table in a\n // clickable element of their own.\n cell: (row) => (\n <RowActions\n actions={rowActionsFor(row).map((a) => toRowAction(a, row))}\n name={rowName?.(row)}\n size={density === \"compact\" ? \"2xs\" : \"xs\"}\n labels={{ actions: labels.actions }}\n className=\"justify-end\"\n />\n ),\n className: \"w-px whitespace-nowrap text-end\",\n headClassName: \"w-px\",\n // On a phone the same actions are the card's swipes.\n mobileHidden: true,\n noRowLink: true,\n },\n ]\n : columnsProp,\n [columnsProp, rowActions, rowActionsFor, rowName, labels.actions, density],\n );\n const swipesFromActions = (row: T): MobileSwipeActions | null => {\n const swipes = rowActionsFor(row).filter((a) => a.swipe && !a.action.disabledReason?.(row));\n if (!swipes.length) return null;\n const toSwipe = (a: ResolvedRowAction<T>): SwipeAction => ({\n label: a.label,\n icon: a.icon,\n onCommit: () => void runRowAction(a.action, row),\n // The row action's tone, painted by SwipeableRow: its soft wash idle, its fill\n // and that fill's foreground armed (0.33).\n tone: a.tone === \"danger\" ? \"danger\" : \"brand\",\n });\n return {\n start: swipes.filter((a) => a.swipe === \"start\").map(toSwipe),\n end: swipes.filter((a) => a.swipe === \"end\").map(toSwipe),\n };\n };\n return { columns, swipesFromActions };\n}\n"],"mappings":";AA0CgC,SAmBiD,UAnBjD;AA1ChC,SAAS,gBAAgB,aAAa,eAAe;AAErD,SAAS,QAAQ,cAAc;AAC/B,SAAS,kBAAkC;AAiBpC,MAAM,kBAAkB;AAW/B,SAAS,iBACP,QACA,OACA,QACsB;AACtB,QAAM,OAAO,OAAO,SAAS,OAAO,SAAS,WAAW,WAAW;AACnE,SAAO;AAAA,IACL,KAAK,OAAO,QAAQ,GAAG,KAAK,IAAI,OAAO,SAAS,EAAE;AAAA,IAClD,OAAO,OAAO,UAAU,OAAO,SAAS,SAAS,OAAO,OAAO,OAAO,SAAS,WAAW,OAAO,SAAS;AAAA,IAC1G,MACE,OAAO,SACN,OAAO,SAAS,SAAS,oBAAC,UAAO,IAAK,OAAO,SAAS,WAAW,oBAAC,UAAO,IAAK;AAAA,IACjF;AAAA,IACA,OAAO,OAAO,UAAU,SAAS,WAAW,UAAU;AAAA,IACtD;AAAA,EACF;AACF;AAGA,eAAe,aAAgB,QAA+B,KAAuB;AACnF,MAAI,OAAO,WAAW,CAAE,MAAM,OAAO,QAAQ,GAAG,EAAI;AACpD,SAAO,SAAS,GAAG;AACrB;AAIA,SAAS,YAAe,GAAyB,KAAmB;AAClE,SAAO;AAAA,IACL,KAAK,EAAE;AAAA,IACP,OAAO,EAAE;AAAA,IACT,MAAM,eAAe,EAAE,IAAI,IAAI,EAAE,OAAO,EAAE,QAAQ,QAAQ,EAAE,SAAS,QAAQ,gCAAG,YAAE,MAAK,IAAM;AAAA,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AG,CAAC;AAC1F,QAAI,CAAC,OAAO,OAAQ,QAAO;AAC3B,UAAM,UAAU,CAAC,OAA0C;AAAA,MACzD,OAAO,EAAE;AAAA,MACT,MAAM,EAAE;AAAA,MACR,UAAU,MAAM,KAAK,aAAa,EAAE,QAAQ,GAAG;AAAA;AAAA;AAAA,MAG/C,MAAM,EAAE,SAAS,WAAW,WAAW;AAAA,IACzC;AACA,WAAO;AAAA,MACL,OAAO,OAAO,OAAO,CAAC,MAAM,EAAE,UAAU,OAAO,EAAE,IAAI,OAAO;AAAA,MAC5D,KAAK,OAAO,OAAO,CAAC,MAAM,EAAE,UAAU,KAAK,EAAE,IAAI,OAAO;AAAA,IAC1D;AAAA,EACF;AACA,SAAO,EAAE,SAAS,kBAAkB;AACtC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/data-table-row-actions.tsx"],"sourcesContent":["import { isValidElement, useCallback, useMemo } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { Pencil, Trash2 } from \"lucide-react\";\nimport { RowActions, type RowAction, type RowActionTone } from \"./row-actions\";\nimport type { SwipeAction } from \"./swipeable-row\";\nimport type { DataTableLabels } from \"./data-table-labels\";\nimport type {\n DataTableColumn,\n DataTableDensity,\n DataTableDesktopSwipeActions,\n DataTableProps,\n DataTableRowAction,\n MobileSwipeActions,\n} from \"./data-table\";\n\n// DataTable's per-row actions (`rowActions`): the actions column on a wide screen and\n// the swipes on a phone card. Moved out of data-table.tsx whole (refactor audit\n// 2026-10, MOD-3 step 1); internal — the public types stay in data-table.tsx.\n\n/** The actions column's key. Not a column a caller declares, so it is kept out of the\n * column-settings panel. */\nexport const ROW_ACTIONS_KEY = \"__rowActions\";\n\n/** The key of the column derived from `mobileSwipeActions` (0.46, dev#598) — the\n * table's own too. */\nexport const SWIPE_ACTIONS_KEY = \"__swipeActions\";\n\n/** A column the TABLE adds, not the caller: out of the column settings and the count,\n * never resized, never the totals row's header. */\nexport function isTableOwnColumn(key: string): boolean {\n return key === ROW_ACTIONS_KEY || key === SWIPE_ACTIONS_KEY;\n}\n\n/** A curtain's tone, as an icon button's (keksdose's `toneOf`): only the tones that MEAN\n * something on a quiet icon carry over; a status colour, a hue or an app's `paint` stays\n * on the curtain and reads muted. */\nfunction swipeTone(action: SwipeAction): RowActionTone {\n switch (action.tone) {\n case \"danger\":\n case \"warning\":\n case \"info\":\n return action.tone;\n default:\n return \"muted\";\n }\n}\n\n/**\n * A row's swipe plan as desktop row actions (dev#598): `end` then `start` — the physical\n * `right` / `left` only where the logical side is missing, as the card reads them — each\n * action once, told apart by its `id`, else by its label (two stages with one label would\n * be one button twice).\n */\nexport function swipePlanRowActions<T>(\n plan: MobileSwipeActions | null | undefined,\n row: T,\n options: Pick<DataTableDesktopSwipeActions<T>, \"omit\" | \"commit\"> = {},\n): RowAction[] {\n if (!plan) return [];\n const out: RowAction[] = [];\n const seen = new Set<string>();\n for (const action of [...(plan.end ?? plan.right ?? []), ...(plan.start ?? plan.left ?? [])]) {\n const key = action.id ?? action.label;\n if (seen.has(key)) continue;\n seen.add(key);\n if (options.omit?.(action, row)) continue;\n const commit = typeof options.commit === \"function\" ? options.commit(action, row) : options.commit;\n out.push({\n key,\n label: action.label,\n icon: isValidElement(action.icon)\n ? action.icon\n : action.icon != null && action.icon !== false\n ? <>{action.icon}</>\n : undefined,\n tone: swipeTone(action),\n commit,\n onSelect: action.onCommit,\n });\n }\n return out;\n}\n\ninterface ResolvedRowAction<T> {\n key: string;\n label: string;\n icon: ReactNode;\n tone: \"default\" | \"danger\";\n swipe: \"start\" | \"end\" | false;\n action: DataTableRowAction<T>;\n}\n\nfunction resolveRowAction<T>(\n action: DataTableRowAction<T>,\n index: number,\n labels: DataTableLabels,\n): ResolvedRowAction<T> {\n const tone = action.tone ?? (action.kind === \"delete\" ? \"danger\" : \"default\");\n return {\n key: action.kind ?? `${index}:${action.label ?? \"\"}`,\n label: action.label ?? (action.kind === \"edit\" ? labels.edit : action.kind === \"delete\" ? labels.delete : \"\"),\n icon:\n action.icon ??\n (action.kind === \"edit\" ? <Pencil /> : action.kind === \"delete\" ? <Trash2 /> : null),\n tone,\n swipe: action.swipe ?? (tone === \"danger\" ? \"start\" : \"end\"),\n action,\n };\n}\n\n/** Ask, then act. */\nasync function runRowAction<T>(action: DataTableRowAction<T>, row: T): Promise<void> {\n if (action.confirm && !(await action.confirm(row))) return;\n action.onAction(row);\n}\n\n/** A resolved row action as {@link RowActions} takes it. Its `icon` is any node; a\n * non-element one (a string glyph) is wrapped, since RowAction wants an element. */\nfunction toRowAction<T>(a: ResolvedRowAction<T>, row: T): RowAction {\n return {\n key: a.key,\n label: a.label,\n icon: isValidElement(a.icon) ? a.icon : a.icon != null && a.icon !== false ? <>{a.icon}</> : undefined,\n tone: a.tone,\n disabledReason: a.action.disabledReason?.(row),\n onSelect: () => void runRowAction(a.action, row),\n };\n}\n\n/**\n * The caller's columns with the actions column appended, and the same actions as a\n * phone card's swipes (`swipesFromActions`; DataTable uses it unless the caller passes\n * `mobileSwipeActions`). Without `rowActions` the columns come back as given.\n *\n * The actions column is appended to the caller's columns rather than drawn as a\n * second special case beside the selection column: it then gets the cell padding,\n * the widths and the phone rules (`mobileHidden`) every other column gets.\n */\nexport function useRowActionColumn<T>({\n columns: columnsProp,\n rowActions,\n rowName,\n labels,\n density,\n mobileSwipeActions,\n desktopSwipeActions,\n}: {\n columns: DataTableColumn<T>[];\n rowActions: DataTableProps<T>[\"rowActions\"];\n rowName: DataTableProps<T>[\"rowName\"];\n labels: DataTableLabels;\n density: DataTableDensity;\n mobileSwipeActions?: DataTableProps<T>[\"mobileSwipeActions\"];\n desktopSwipeActions?: DataTableProps<T>[\"desktopSwipeActions\"];\n}): {\n columns: DataTableColumn<T>[];\n swipesFromActions: (row: T) => MobileSwipeActions | null;\n} {\n const rowActionsFor = useCallback(\n (row: T): ResolvedRowAction<T>[] =>\n rowActions\n ? (typeof rowActions === \"function\" ? rowActions(row) : rowActions)\n .filter((a) => !a.hidden?.(row))\n .map((a, i) => resolveRowAction(a, i, labels))\n : [],\n [rowActions, labels],\n );\n // dev#598: the desktop half of the caller's swipes. On by default, except beside\n // `rowActions`, whose column already is the desktop's (and whose swipes these usually\n // are). The options object is often a fresh literal per render; its parts are the deps.\n const swipeOptions = typeof desktopSwipeActions === \"object\" ? desktopSwipeActions : undefined;\n const swipeColumnOn =\n !!mobileSwipeActions && (desktopSwipeActions === undefined ? !rowActions : desktopSwipeActions !== false);\n const swipeOmit = swipeOptions?.omit;\n const swipeName = swipeOptions?.name;\n const swipeCollapse = swipeOptions?.collapse;\n const swipeCommit = swipeOptions?.commit;\n const swipeColumn = useMemo<DataTableColumn<T> | null>(\n () =>\n swipeColumnOn\n ? {\n key: SWIPE_ACTIONS_KEY,\n header: <span className=\"sr-only\">{labels.actions}</span>,\n cell: (row) => (\n <RowActions\n actions={swipePlanRowActions(mobileSwipeActions!(row), row, { omit: swipeOmit, commit: swipeCommit })}\n name={(swipeName ?? rowName)?.(row)}\n collapse={swipeCollapse}\n size={density === \"compact\" ? \"2xs\" : \"xs\"}\n // The last column's tooltips open toward the row's start.\n tooltipSide=\"start\"\n labels={{ actions: labels.actions }}\n className=\"justify-end\"\n />\n ),\n className: \"w-px whitespace-nowrap text-end\",\n headClassName: \"w-px\",\n // On a phone the same actions are the card's swipes.\n mobileHidden: true,\n noRowLink: true,\n }\n : null,\n [\n swipeColumnOn,\n mobileSwipeActions,\n swipeOmit,\n swipeCommit,\n swipeName,\n rowName,\n swipeCollapse,\n density,\n labels.actions,\n ],\n );\n const actionColumns = useMemo<DataTableColumn<T>[]>(\n () =>\n rowActions\n ? [\n ...columnsProp,\n {\n key: ROW_ACTIONS_KEY,\n header: <span className=\"sr-only\">{labels.actions}</span>,\n // Through RowActions (0.32, §10.8): the icons inline at Normal, one \"⋯\"\n // menu at Large once there are two — every label at once does not fit a\n // row. Each control stops its own click: the row's handler already skips\n // its controls, and this is for the caller who wraps the table in a\n // clickable element of their own.\n cell: (row) => (\n <RowActions\n actions={rowActionsFor(row).map((a) => toRowAction(a, row))}\n name={rowName?.(row)}\n size={density === \"compact\" ? \"2xs\" : \"xs\"}\n labels={{ actions: labels.actions }}\n className=\"justify-end\"\n />\n ),\n className: \"w-px whitespace-nowrap text-end\",\n headClassName: \"w-px\",\n // On a phone the same actions are the card's swipes.\n mobileHidden: true,\n noRowLink: true,\n },\n ]\n : columnsProp,\n [columnsProp, rowActions, rowActionsFor, rowName, labels.actions, density],\n );\n const columns = useMemo(\n () => (swipeColumn ? [...actionColumns, swipeColumn] : actionColumns),\n [actionColumns, swipeColumn],\n );\n const swipesFromActions = (row: T): MobileSwipeActions | null => {\n const swipes = rowActionsFor(row).filter((a) => a.swipe && !a.action.disabledReason?.(row));\n if (!swipes.length) return null;\n const toSwipe = (a: ResolvedRowAction<T>): SwipeAction => ({\n label: a.label,\n icon: a.icon,\n onCommit: () => void runRowAction(a.action, row),\n // The row action's tone, painted by SwipeableRow: its soft wash idle, its fill\n // and that fill's foreground armed (0.33).\n tone: a.tone === \"danger\" ? \"danger\" : \"brand\",\n });\n return {\n start: swipes.filter((a) => a.swipe === \"start\").map(toSwipe),\n end: swipes.filter((a) => a.swipe === \"end\").map(toSwipe),\n };\n };\n return { columns, swipesFromActions };\n}\n"],"mappings":";AAyEY;AAzEZ,SAAS,gBAAgB,aAAa,eAAe;AAErD,SAAS,QAAQ,cAAc;AAC/B,SAAS,kBAAsD;AAkBxD,MAAM,kBAAkB;AAIxB,MAAM,oBAAoB;AAI1B,SAAS,iBAAiB,KAAsB;AACrD,SAAO,QAAQ,mBAAmB,QAAQ;AAC5C;AAKA,SAAS,UAAU,QAAoC;AACrD,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,OAAO;AAAA,IAChB;AACE,aAAO;AAAA,EACX;AACF;AAQO,SAAS,oBACd,MACA,KACA,UAAoE,CAAC,GACxD;AACb,MAAI,CAAC,KAAM,QAAO,CAAC;AACnB,QAAM,M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AO,iBAAiB,GAAG,CAAC;AAC1F,QAAI,CAAC,OAAO,OAAQ,QAAO;AAC3B,UAAM,UAAU,CAAC,OAA0C;AAAA,MACzD,OAAO,EAAE;AAAA,MACT,MAAM,EAAE;AAAA,MACR,UAAU,MAAM,KAAK,aAAa,EAAE,QAAQ,GAAG;AAAA;AAAA;AAAA,MAG/C,MAAM,EAAE,SAAS,WAAW,WAAW;AAAA,IACzC;AACA,WAAO;AAAA,MACL,OAAO,OAAO,OAAO,CAAC,MAAM,EAAE,UAAU,OAAO,EAAE,IAAI,OAAO;AAAA,MAC5D,KAAK,OAAO,OAAO,CAAC,MAAM,EAAE,UAAU,KAAK,EAAE,IAAI,OAAO;AAAA,IAC1D;AAAA,EACF;AACA,SAAO,EAAE,SAAS,kBAAkB;AACtC;","names":[]}
|
|
@@ -64,6 +64,8 @@ export declare function resolveDataTableLabels(...layers: (LabelOverride<DataTab
|
|
|
64
64
|
* feedback page did, round its comments). The row owns the clicks on the row.
|
|
65
65
|
*/
|
|
66
66
|
export declare function fromOutside(target: EventTarget | null, row: HTMLElement): boolean;
|
|
67
|
+
/** Whether an event on `row` started on a control nested inside it. */
|
|
68
|
+
export declare function fromOwnControl(target: EventTarget | null, row: HTMLElement): boolean;
|
|
67
69
|
/**
|
|
68
70
|
* The anchor a linkable row is opened through (Keksdose feedback #451).
|
|
69
71
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { isTableOwnColumn } from "./data-table-row-actions.js";
|
|
4
4
|
import { DEFAULT_DATA_TABLE_LABELS } from "./data-table-labels.js";
|
|
5
5
|
function splitCellProps(props) {
|
|
6
6
|
if (!props) return { attrs: {} };
|
|
@@ -30,7 +30,7 @@ function cleanAttrs(attrs) {
|
|
|
30
30
|
return out;
|
|
31
31
|
}
|
|
32
32
|
function columnLabel(col, labels) {
|
|
33
|
-
if (col.key
|
|
33
|
+
if (isTableOwnColumn(col.key) && labels) return labels.actions;
|
|
34
34
|
return col.headerText ?? (typeof col.header === "string" ? col.header : col.key);
|
|
35
35
|
}
|
|
36
36
|
function resolveDataTableLabels(...layers) {
|
|
@@ -56,6 +56,18 @@ function resolveDataTableLabels(...layers) {
|
|
|
56
56
|
function fromOutside(target, row) {
|
|
57
57
|
return !(target instanceof Node) || !row.contains(target);
|
|
58
58
|
}
|
|
59
|
+
const OWN_CONTROL = 'a[href],button,input,select,textarea,label,summary,[role="button"],[role="link"],[role="checkbox"],[role="switch"],[role="menuitem"],[role="option"],[contenteditable=""],[contenteditable="true"],[tabindex]:not([tabindex="-1"])';
|
|
60
|
+
function fromOwnControl(target, row) {
|
|
61
|
+
if (!(target instanceof Element)) return false;
|
|
62
|
+
const hit = target.closest(OWN_CONTROL);
|
|
63
|
+
return !!hit && hit !== row && row.contains(hit) && !hit.hasAttribute("data-row-link");
|
|
64
|
+
}
|
|
65
|
+
const OWN_DEFAULT = 'input[type="checkbox"],input[type="radio"],label,summary';
|
|
66
|
+
function onOwnDefault(target, link) {
|
|
67
|
+
if (!(target instanceof Element)) return false;
|
|
68
|
+
const hit = target.closest(OWN_DEFAULT);
|
|
69
|
+
return !!hit && hit !== link && link.contains(hit);
|
|
70
|
+
}
|
|
59
71
|
const isPlainLeftClick = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
|
|
60
72
|
function RowLink({
|
|
61
73
|
href,
|
|
@@ -73,6 +85,7 @@ function RowLink({
|
|
|
73
85
|
className,
|
|
74
86
|
onClickCapture: (e) => {
|
|
75
87
|
if (fromOutside(e.target, e.currentTarget)) return;
|
|
88
|
+
if (onOwnDefault(e.target, e.currentTarget)) return;
|
|
76
89
|
if (isPlainLeftClick(e)) e.preventDefault();
|
|
77
90
|
},
|
|
78
91
|
onClick: (e) => {
|
|
@@ -81,6 +94,7 @@ function RowLink({
|
|
|
81
94
|
e.stopPropagation();
|
|
82
95
|
return;
|
|
83
96
|
}
|
|
97
|
+
if (fromOwnControl(e.target, e.currentTarget)) return;
|
|
84
98
|
onActivate?.();
|
|
85
99
|
},
|
|
86
100
|
children
|
|
@@ -92,6 +106,7 @@ export {
|
|
|
92
106
|
cleanAttrs,
|
|
93
107
|
columnLabel,
|
|
94
108
|
fromOutside,
|
|
109
|
+
fromOwnControl,
|
|
95
110
|
logicalAlign,
|
|
96
111
|
resolveDataTableLabels,
|
|
97
112
|
splitCellProps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/data-table-shared.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { ROW_ACTIONS_KEY } from \"./data-table-row-actions\";\nimport { DEFAULT_DATA_TABLE_LABELS, type DataTableLabels } from \"./data-table-labels\";\nimport type { DataTableCellProps, DataTableColumn, DataTableHeadProps } from \"./data-table\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\n\n// What DataTable shares with its header (data-table-head.tsx), its column panel and its\n// phone layout (data-table-mobile.tsx): the cell-attribute and alignment rules, a\n// column's plain-text name, and the row link. Moved out of data-table.tsx unchanged\n// (refactor audit 2026-10, MOD-3), into a module of their own so none of those has to\n// import data-table.tsx at run time — which imports them. Since 0.35 also the table's\n// label resolver, which DataTable and its FilterPopover share and the barrel no longer\n// exports (round 0.35 R1).\n\n/**\n * Split a caller's cell attributes into what may reach the element and what the kit\n * owns. `role` and `data-col` are dropped outright (see `cellProps`); `className` and\n * `style` come back separately so the kit can merge rather than replace them.\n */\nexport function splitCellProps(\n props: DataTableCellProps | DataTableHeadProps | undefined,\n): { attrs: Record<string, unknown>; className?: string; style?: CSSProperties } {\n if (!props) return { attrs: {} };\n const {\n className,\n style,\n role: _role,\n \"data-col\": _col,\n ...attrs\n } = props as DataTableCellProps & { \"data-col\"?: unknown };\n return { attrs, className, style };\n}\n\n// A bare `text-right` / `text-left` token, with or without variant prefixes\n// (`md:text-right`). Deliberately NOT `text-right-…` or an arbitrary value.\nconst PHYSICAL_ALIGN = /(^|\\s)((?:[\\w-]+:)*)text-(left|right)(?=\\s|$)/g;\n\n/**\n * A column's `className`/`headClassName` with physical text alignment rewritten to\n * logical: `text-right` → `text-end`, `text-left` → `text-start`.\n *\n * Every numeric column written before 0.7.0 says `text-right`, and that is what it\n * MEANT: the end of the line, where digits line up. Rendered as written, a\n * right-to-left table puts those numbers on the far side from their own header's\n * sort button. Rewriting keeps each existing call site correct in both directions\n * with no change on its side; a caller who genuinely wants the physical side in RTL\n * too can say `ltr:text-right rtl:text-right`, which this leaves alone.\n */\nexport function logicalAlign(className: string | undefined): string | undefined {\n return className?.replace(\n PHYSICAL_ALIGN,\n (token: string, lead: string, variants: string, side: string) =>\n // Already scoped to one direction: that is a caller choosing the physical side.\n /(^|:)(ltr|rtl):/.test(variants)\n ? token\n : `${lead}${variants}text-${side === \"right\" ? \"end\" : \"start\"}`,\n );\n}\n\n/** Drop the undefined entries of a {@link DataTableProps.rowAttributes} map, so a\n * caller can write `{ \"data-x\": cond ? \"y\" : undefined }` and get no attribute\n * at all rather than the string \"undefined\" in the DOM. */\nexport function cleanAttrs(\n attrs: Record<string, string | undefined> | undefined,\n): Record<string, string> | undefined {\n if (!attrs) return undefined;\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(attrs)) if (v !== undefined) out[k] = v;\n return out;\n}\n\n/**\n * A column's name as a plain string.\n *\n * `header` is a ReactNode — an icon, a unit suffix, a tooltip-wrapped span — and\n * neither a live region nor the column-settings checklist can speak a React element.\n * The `key` fallback is the one the settings panel has always used; a column whose\n * header is not a string and whose key is not human-readable is a call site that\n * should pass a string header, and that is visible in what gets announced.\n */\nexport function columnLabel<T>(col: DataTableColumn<T>, labels?: DataTableLabels): string {\n if (col.key === ROW_ACTIONS_KEY && labels) return labels.actions;\n return col.headerText ?? (typeof col.header === \"string\" ? col.header : col.key);\n}\n\n/**\n * The table's labels: caller overrides merged onto the English defaults (presets merged\n * too, key by key, as the provider merges them — so the parameter is a\n * {@link LabelOverride}).\n *\n * DataTable's own, and FilterPopover's: public until 0.35, when it left the barrel for\n * DataTable's `labels` and the provider's `dataTable`, which it serves (round 0.35 R1,\n * refactor audit 2026-10 API-6a). It stays a resolver rather than `useKitLabels` for the\n * two keys it derives (`columnsCount`, `filterColumn`), which a plain merge would not.\n *\n * Lenient on purpose — a table with no labels at all still renders — so a translated app\n * finds out what fell back to English from `missingKitLabels(labels,\n * DEFAULT_UI_KIT_LABELS)` in its own test, where the answer is actionable.\n */\nexport function resolveDataTableLabels(\n ...layers: (LabelOverride<DataTableLabels> | undefined)[]\n): DataTableLabels {\n if (!layers.some(Boolean)) return DEFAULT_DATA_TABLE_LABELS;\n // The layers in order, the provider's then the prop's, later winning key by key. An\n // `undefined` key is skipped, as `useKitLabels` skips it, rather than blanking the word\n // under it: DataTable spread `{ ...provider, ...prop }`, so `labels={{ autoSize:\n // undefined }}` blanked the provider's word and the English one (round 0.35). `presets`\n // is a record and is merged the same way, so renaming one keeps the other ten.\n const partial: Partial<Omit<DataTableLabels, \"presets\">> = {};\n const presets = { ...DEFAULT_DATA_TABLE_LABELS.presets };\n for (const layer of layers) {\n for (const [key, value] of Object.entries(layer ?? {})) {\n if (value === undefined) continue;\n if (key !== \"presets\") Object.assign(partial, { [key]: value });\n else for (const [preset, text] of Object.entries(value)) if (text !== undefined) presets[preset] = text;\n }\n }\n const merged: DataTableLabels = { ...DEFAULT_DATA_TABLE_LABELS, ...partial, presets };\n // `columnsCount` was split out of `columns` + a template literal. Consumers have\n // been translating `columns` since 0.1, and backfilling the English default over\n // that would hand them \"Columns (4/9)\" back for having translated the key that\n // existed at the time. So the count is derived from the RESOLVED `columns` unless the\n // caller states the whole sentence, which is the escape hatch for a language where\n // the parenthetical does not fit.\n if (partial.columns !== undefined && partial.columnsCount === undefined) {\n merged.columnsCount = (visible, total) => `${merged.columns} (${visible}/${total})`;\n }\n // The same for `filterColumn` (0.34), from a translated `filter`: the app's own word\n // with the column, rather than English for having translated the key that existed.\n if (partial.filter !== undefined && partial.filterColumn === undefined) {\n merged.filterColumn = (column) => `${merged.filter}: ${column}`;\n }\n return merged;\n}\n\n/**\n * Whether a click that reached `row`'s handler did not start in the row's own DOM.\n *\n * React bubbles an event through the COMPONENT tree, portals included: a popover, a\n * menu or a dialog a cell (or the expansion under it) opens renders at `<body>` but\n * still reports its clicks to every React ancestor — the row among them. So a click\n * in a cell's portalled date picker opened the row it came from, and a page wrapped\n * such content in `<div onClick={(e) => e.stopPropagation()}>` to stop it (kastlan's\n * feedback page did, round its comments). The row owns the clicks on the row.\n */\nexport function fromOutside(target: EventTarget | null, row: HTMLElement): boolean {\n return !(target instanceof Node) || !row.contains(target);\n}\n\n/** A click the APP owns. Anything else — middle, ⌘/Ctrl, Shift, Alt — belongs to\n * the browser, and the whole feature is not touching it. */\nconst isPlainLeftClick = (e: React.MouseEvent) =>\n e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;\n\n/**\n * The anchor a linkable row is opened through (Keksdose feedback #451).\n *\n * The plain left click is OURS: cancelled, then handed to the row's own handler, so\n * clicking a row still expands it in place instead of reloading the page. Every\n * other click — middle, ⌘/Ctrl, Shift, Alt — is left completely untouched, which is\n * the entire point of using an anchor rather than an `onAuxClick` + `window.open`:\n * that imitation buys back the middle click and still loses ⌘/Ctrl-click, \"copy link\n * address\", the status-bar preview and the phone's long-press menu.\n *\n * Modified clicks DO stop propagating: on a table with `selection`, ⌘/Ctrl-click and\n * Shift-click on a row mean \"select\" (feedback #289), and a row must not change its\n * selection while the browser is opening a tab. The rest of the row still selects —\n * the link is one cell, not the row.\n *\n * `draggable={false}` because an anchor otherwise hijacks a horizontal mouse drag as\n * a link-drag: that is both drag-to-select-text on the desktop table and the mouse\n * path through SwipeableRow's gesture on the mobile card.\n */\nexport function RowLink({\n href,\n onActivate,\n className,\n children,\n ...rest\n}: {\n href: string;\n /** Runs on a plain left click. Omit it where an ANCESTOR already handles the\n * click (the desktop `<tr>`), or the row would toggle twice. */\n onActivate?: () => void;\n className?: string;\n children: ReactNode;\n} & Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n \"href\" | \"className\" | \"children\" | \"onClick\" | \"onClickCapture\"\n>) {\n return (\n <a\n {...rest}\n href={href}\n draggable={false}\n className={className}\n // CAPTURE phase, and it has to be: on the mobile card the whole card is the\n // anchor, so a nested control sits INSIDE it — and the ones that matter\n // (the feedback row's status toggles) stop the click propagating so the row\n // won't also expand. A bubble-phase handler would never run for those, and\n // the browser would follow the link out from under the button press. Cancelling\n // here happens before any descendant can silence the event; `stopPropagation`\n // does not undo a `preventDefault`.\n onClickCapture={(e) => {\n // A click in a portal a descendant opened is not a click on the link: leave\n // it (and a link inside it) alone. See `fromOutside`.\n if (fromOutside(e.target, e.currentTarget)) return;\n if (isPlainLeftClick(e)) e.preventDefault();\n }}\n onClick={(e) => {\n if (fromOutside(e.target, e.currentTarget)) return;\n if (!isPlainLeftClick(e)) {\n e.stopPropagation();\n return;\n }\n // Already cancelled above; this phase only decides what opens. A nested\n // control that stopped propagation deliberately never reaches it, which is\n // exactly how the row behaved before it became a link.\n onActivate?.();\n }}\n >\n {children}\n </a>\n );\n}\n"],"mappings":";AA+LI;AA9LJ,SAAS,uBAAuB;AAChC,SAAS,iCAAuD;AAiBzD,SAAS,eACd,OAC+E;AAC/E,MAAI,CAAC,MAAO,QAAO,EAAE,OAAO,CAAC,EAAE;AAC/B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,GAAG;AAAA,EACL,IAAI;AACJ,SAAO,EAAE,OAAO,WAAW,MAAM;AACnC;AAIA,MAAM,iBAAiB;AAahB,SAAS,aAAa,WAAmD;AAC9E,SAAO,WAAW;AAAA,IAChB;AAAA,IACA,CAAC,OAAe,MAAc,UAAkB;AAAA;AAAA,MAE9C,kBAAkB,KAAK,QAAQ,IAC3B,QACA,GAAG,IAAI,GAAG,QAAQ,QAAQ,SAAS,UAAU,QAAQ,OAAO;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jF,SAAO,EAAE,kBAAkB,SAAS,CAAC,IAAI,SAAS,MAAM;AAC1D;AAIA,MAAM,mBAAmB,CAAC,MACxB,EAAE,WAAW,KAAK,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,EAAE;AAqB3D,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAUG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MAQA,gBAAgB,CAAC,MAAM;AAGrB,YAAI,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAG;AAC5C,YAAI,iBAAiB,CAAC,EAAG,GAAE,eAAe;AAAA,MAC5C;AAAA,MACA,SAAS,CAAC,MAAM;AACd,YAAI,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAG;AAC5C,YAAI,CAAC,iBAAiB,CAAC,GAAG;AACxB,YAAE,gBAAgB;AAClB;AAAA,QACF;AAIA,qBAAa;AAAA,MACf;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/data-table-shared.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { isTableOwnColumn } from \"./data-table-row-actions\";\nimport { DEFAULT_DATA_TABLE_LABELS, type DataTableLabels } from \"./data-table-labels\";\nimport type { DataTableCellProps, DataTableColumn, DataTableHeadProps } from \"./data-table\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\n\n// What DataTable shares with its header (data-table-head.tsx), its column panel and its\n// phone layout (data-table-mobile.tsx): the cell-attribute and alignment rules, a\n// column's plain-text name, and the row link. Moved out of data-table.tsx unchanged\n// (refactor audit 2026-10, MOD-3), into a module of their own so none of those has to\n// import data-table.tsx at run time — which imports them. Since 0.35 also the table's\n// label resolver, which DataTable and its FilterPopover share and the barrel no longer\n// exports (round 0.35 R1).\n\n/**\n * Split a caller's cell attributes into what may reach the element and what the kit\n * owns. `role` and `data-col` are dropped outright (see `cellProps`); `className` and\n * `style` come back separately so the kit can merge rather than replace them.\n */\nexport function splitCellProps(\n props: DataTableCellProps | DataTableHeadProps | undefined,\n): { attrs: Record<string, unknown>; className?: string; style?: CSSProperties } {\n if (!props) return { attrs: {} };\n const {\n className,\n style,\n role: _role,\n \"data-col\": _col,\n ...attrs\n } = props as DataTableCellProps & { \"data-col\"?: unknown };\n return { attrs, className, style };\n}\n\n// A bare `text-right` / `text-left` token, with or without variant prefixes\n// (`md:text-right`). Deliberately NOT `text-right-…` or an arbitrary value.\nconst PHYSICAL_ALIGN = /(^|\\s)((?:[\\w-]+:)*)text-(left|right)(?=\\s|$)/g;\n\n/**\n * A column's `className`/`headClassName` with physical text alignment rewritten to\n * logical: `text-right` → `text-end`, `text-left` → `text-start`.\n *\n * Every numeric column written before 0.7.0 says `text-right`, and that is what it\n * MEANT: the end of the line, where digits line up. Rendered as written, a\n * right-to-left table puts those numbers on the far side from their own header's\n * sort button. Rewriting keeps each existing call site correct in both directions\n * with no change on its side; a caller who genuinely wants the physical side in RTL\n * too can say `ltr:text-right rtl:text-right`, which this leaves alone.\n */\nexport function logicalAlign(className: string | undefined): string | undefined {\n return className?.replace(\n PHYSICAL_ALIGN,\n (token: string, lead: string, variants: string, side: string) =>\n // Already scoped to one direction: that is a caller choosing the physical side.\n /(^|:)(ltr|rtl):/.test(variants)\n ? token\n : `${lead}${variants}text-${side === \"right\" ? \"end\" : \"start\"}`,\n );\n}\n\n/** Drop the undefined entries of a {@link DataTableProps.rowAttributes} map, so a\n * caller can write `{ \"data-x\": cond ? \"y\" : undefined }` and get no attribute\n * at all rather than the string \"undefined\" in the DOM. */\nexport function cleanAttrs(\n attrs: Record<string, string | undefined> | undefined,\n): Record<string, string> | undefined {\n if (!attrs) return undefined;\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(attrs)) if (v !== undefined) out[k] = v;\n return out;\n}\n\n/**\n * A column's name as a plain string.\n *\n * `header` is a ReactNode — an icon, a unit suffix, a tooltip-wrapped span — and\n * neither a live region nor the column-settings checklist can speak a React element.\n * The `key` fallback is the one the settings panel has always used; a column whose\n * header is not a string and whose key is not human-readable is a call site that\n * should pass a string header, and that is visible in what gets announced.\n */\nexport function columnLabel<T>(col: DataTableColumn<T>, labels?: DataTableLabels): string {\n if (isTableOwnColumn(col.key) && labels) return labels.actions;\n return col.headerText ?? (typeof col.header === \"string\" ? col.header : col.key);\n}\n\n/**\n * The table's labels: caller overrides merged onto the English defaults (presets merged\n * too, key by key, as the provider merges them — so the parameter is a\n * {@link LabelOverride}).\n *\n * DataTable's own, and FilterPopover's: public until 0.35, when it left the barrel for\n * DataTable's `labels` and the provider's `dataTable`, which it serves (round 0.35 R1,\n * refactor audit 2026-10 API-6a). It stays a resolver rather than `useKitLabels` for the\n * two keys it derives (`columnsCount`, `filterColumn`), which a plain merge would not.\n *\n * Lenient on purpose — a table with no labels at all still renders — so a translated app\n * finds out what fell back to English from `missingKitLabels(labels,\n * DEFAULT_UI_KIT_LABELS)` in its own test, where the answer is actionable.\n */\nexport function resolveDataTableLabels(\n ...layers: (LabelOverride<DataTableLabels> | undefined)[]\n): DataTableLabels {\n if (!layers.some(Boolean)) return DEFAULT_DATA_TABLE_LABELS;\n // The layers in order, the provider's then the prop's, later winning key by key. An\n // `undefined` key is skipped, as `useKitLabels` skips it, rather than blanking the word\n // under it: DataTable spread `{ ...provider, ...prop }`, so `labels={{ autoSize:\n // undefined }}` blanked the provider's word and the English one (round 0.35). `presets`\n // is a record and is merged the same way, so renaming one keeps the other ten.\n const partial: Partial<Omit<DataTableLabels, \"presets\">> = {};\n const presets = { ...DEFAULT_DATA_TABLE_LABELS.presets };\n for (const layer of layers) {\n for (const [key, value] of Object.entries(layer ?? {})) {\n if (value === undefined) continue;\n if (key !== \"presets\") Object.assign(partial, { [key]: value });\n else for (const [preset, text] of Object.entries(value)) if (text !== undefined) presets[preset] = text;\n }\n }\n const merged: DataTableLabels = { ...DEFAULT_DATA_TABLE_LABELS, ...partial, presets };\n // `columnsCount` was split out of `columns` + a template literal. Consumers have\n // been translating `columns` since 0.1, and backfilling the English default over\n // that would hand them \"Columns (4/9)\" back for having translated the key that\n // existed at the time. So the count is derived from the RESOLVED `columns` unless the\n // caller states the whole sentence, which is the escape hatch for a language where\n // the parenthetical does not fit.\n if (partial.columns !== undefined && partial.columnsCount === undefined) {\n merged.columnsCount = (visible, total) => `${merged.columns} (${visible}/${total})`;\n }\n // The same for `filterColumn` (0.34), from a translated `filter`: the app's own word\n // with the column, rather than English for having translated the key that existed.\n if (partial.filter !== undefined && partial.filterColumn === undefined) {\n merged.filterColumn = (column) => `${merged.filter}: ${column}`;\n }\n return merged;\n}\n\n/**\n * Whether a click that reached `row`'s handler did not start in the row's own DOM.\n *\n * React bubbles an event through the COMPONENT tree, portals included: a popover, a\n * menu or a dialog a cell (or the expansion under it) opens renders at `<body>` but\n * still reports its clicks to every React ancestor — the row among them. So a click\n * in a cell's portalled date picker opened the row it came from, and a page wrapped\n * such content in `<div onClick={(e) => e.stopPropagation()}>` to stop it (kastlan's\n * feedback page did, round its comments). The row owns the clicks on the row.\n */\nexport function fromOutside(target: EventTarget | null, row: HTMLElement): boolean {\n return !(target instanceof Node) || !row.contains(target);\n}\n\n/**\n * What counts as a control of its own inside a clickable row: a click or key press\n * that lands on one of these belongs to it, not to the row's `onRowClick`. The row's\n * own link (`rowHref`, marked `data-row-link`) is the exception — it IS the row.\n */\nconst OWN_CONTROL =\n 'a[href],button,input,select,textarea,label,summary,[role=\"button\"],[role=\"link\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"menuitem\"],[role=\"option\"],[contenteditable=\"\"],[contenteditable=\"true\"],[tabindex]:not([tabindex=\"-1\"])';\n\n/** Whether an event on `row` started on a control nested inside it. */\nexport function fromOwnControl(target: EventTarget | null, row: HTMLElement): boolean {\n if (!(target instanceof Element)) return false;\n const hit = target.closest(OWN_CONTROL);\n return !!hit && hit !== row && row.contains(hit) && !hit.hasAttribute(\"data-row-link\");\n}\n\n/**\n * The controls whose own default IS the click — a native checkbox's or radio's toggle, a\n * label's click through to its field, a summary's disclosure (0.46, the 0.45 note from\n * UM): cancelling the click undoes it. Each is the click's own activation target, so a\n * click on one does not follow the link around it, and {@link RowLink} leaves its\n * default alone.\n */\nconst OWN_DEFAULT = 'input[type=\"checkbox\"],input[type=\"radio\"],label,summary';\n\n/** Whether a click inside `link` landed on (or in) one of {@link OWN_DEFAULT}. */\nfunction onOwnDefault(target: EventTarget | null, link: HTMLElement): boolean {\n if (!(target instanceof Element)) return false;\n const hit = target.closest(OWN_DEFAULT);\n return !!hit && hit !== link && link.contains(hit);\n}\n\n/** A click the APP owns. Anything else — middle, ⌘/Ctrl, Shift, Alt — belongs to\n * the browser, and the whole feature is not touching it. */\nconst isPlainLeftClick = (e: React.MouseEvent) =>\n e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;\n\n/**\n * The anchor a linkable row is opened through (Keksdose feedback #451).\n *\n * The plain left click is OURS: cancelled, then handed to the row's own handler, so\n * clicking a row still expands it in place instead of reloading the page. Every\n * other click — middle, ⌘/Ctrl, Shift, Alt — is left completely untouched, which is\n * the entire point of using an anchor rather than an `onAuxClick` + `window.open`:\n * that imitation buys back the middle click and still loses ⌘/Ctrl-click, \"copy link\n * address\", the status-bar preview and the phone's long-press menu.\n *\n * Modified clicks DO stop propagating: on a table with `selection`, ⌘/Ctrl-click and\n * Shift-click on a row mean \"select\" (feedback #289), and a row must not change its\n * selection while the browser is opening a tab. The rest of the row still selects —\n * the link is one cell, not the row.\n *\n * `draggable={false}` because an anchor otherwise hijacks a horizontal mouse drag as\n * a link-drag: that is both drag-to-select-text on the desktop table and the mouse\n * path through SwipeableRow's gesture on the mobile card.\n */\nexport function RowLink({\n href,\n onActivate,\n className,\n children,\n ...rest\n}: {\n href: string;\n /** Runs on a plain left click. Omit it where an ANCESTOR already handles the\n * click (the desktop `<tr>`), or the row would toggle twice. */\n onActivate?: () => void;\n className?: string;\n children: ReactNode;\n} & Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n \"href\" | \"className\" | \"children\" | \"onClick\" | \"onClickCapture\"\n>) {\n return (\n <a\n {...rest}\n href={href}\n draggable={false}\n className={className}\n // CAPTURE phase, and it has to be: on the mobile card the whole card is the\n // anchor, so a nested control sits INSIDE it — and the ones that matter\n // (the feedback row's status toggles) stop the click propagating so the row\n // won't also expand. A bubble-phase handler would never run for those, and\n // the browser would follow the link out from under the button press. Cancelling\n // here happens before any descendant can silence the event; `stopPropagation`\n // does not undo a `preventDefault`.\n onClickCapture={(e) => {\n // A click in a portal a descendant opened is not a click on the link: leave\n // it (and a link inside it) alone. See `fromOutside`.\n if (fromOutside(e.target, e.currentTarget)) return;\n // A checkbox, a radio, a label or a summary keeps its own default: cancelling\n // it would undo the toggle, and the link is not followed from it anyway.\n if (onOwnDefault(e.target, e.currentTarget)) return;\n if (isPlainLeftClick(e)) e.preventDefault();\n }}\n onClick={(e) => {\n if (fromOutside(e.target, e.currentTarget)) return;\n if (!isPlainLeftClick(e)) {\n e.stopPropagation();\n return;\n }\n // Already cancelled above; this phase only decides what opens. A nested\n // control that stopped propagation deliberately never reaches it, which is\n // exactly how the row behaved before it became a link — and one that did not\n // (a select in a phone card's cell, keksdose live #428) is still its own.\n if (fromOwnControl(e.target, e.currentTarget)) return;\n onActivate?.();\n }}\n >\n {children}\n </a>\n );\n}\n"],"mappings":";AA8NI;AA7NJ,SAAS,wBAAwB;AACjC,SAAS,iCAAuD;AAiBzD,SAAS,eACd,OAC+E;AAC/E,MAAI,CAAC,MAAO,QAAO,EAAE,OAAO,CAAC,EAAE;AAC/B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,GAAG;AAAA,EACL,IAAI;AACJ,SAAO,EAAE,OAAO,WAAW,MAAM;AACnC;AAIA,MAAM,iBAAiB;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