@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
|
@@ -2,6 +2,8 @@ import type { ReactNode, TdHTMLAttributes, ThHTMLAttributes } from "react";
|
|
|
2
2
|
import type { ColumnFilter, FilterValue } from "./data-table-filters.js";
|
|
3
3
|
import type { SortCycle, SortDir, SortState } from "./data-table-sort.js";
|
|
4
4
|
import type { SwipeAction } from "./swipeable-row.js";
|
|
5
|
+
import type { RowActionsCollapse } from "./row-actions.js";
|
|
6
|
+
import type { CommitScope } from "./write-lock.js";
|
|
5
7
|
import { type DataTableLabels } from "./data-table-labels.js";
|
|
6
8
|
import { type LabelOverride } from "../i18n/kit-labels.js";
|
|
7
9
|
export interface DataTableColumn<T> {
|
|
@@ -431,9 +433,28 @@ export interface DataTableProps<T> {
|
|
|
431
433
|
* Mobile only, and deliberately so: the desktop table already has room for an
|
|
432
434
|
* actions column, and a drag gesture on a pointer device is a worse version of a
|
|
433
435
|
* button. Wraps only the row body, so an expansion panel below stays put while the
|
|
434
|
-
* row above it slides.
|
|
436
|
+
* row above it slides. The desktop's buttons for the same actions come with it — see
|
|
437
|
+
* {@link DataTableProps.desktopSwipeActions}.
|
|
435
438
|
*/
|
|
436
439
|
mobileSwipeActions?: (row: T) => MobileSwipeActions | null;
|
|
440
|
+
/**
|
|
441
|
+
* The desktop half of `mobileSwipeActions` (0.46, keksdose dev#598 — Marcel: every
|
|
442
|
+
* table whose phone cards swipe gets a desktop actions column with the same actions):
|
|
443
|
+
* an actions column DERIVED from the very plan the card swipes with, so the two
|
|
444
|
+
* viewports offer the same functions and cannot drift. Each button runs the swipe's own
|
|
445
|
+
* `onCommit` — the same confirm, the same undo toast. The reading-end side's actions
|
|
446
|
+
* first, then the start side's, each once (by `SwipeAction.id`, else by label); a row
|
|
447
|
+
* whose plan is `null` gets an empty cell. The column is hidden on the phone, where the
|
|
448
|
+
* actions are the swipes, kept off the column settings, and its tooltips open toward
|
|
449
|
+
* the row's start.
|
|
450
|
+
*
|
|
451
|
+
* On by default wherever `mobileSwipeActions` is given, so a new swipeable table cannot
|
|
452
|
+
* forget it — except beside `rowActions`, whose column is the desktop's already (pass
|
|
453
|
+
* `true` or options to add this one too). `false` where the desktop row carries every
|
|
454
|
+
* one of those actions as its own buttons; say so at the call site. Options:
|
|
455
|
+
* {@link DataTableDesktopSwipeActions}.
|
|
456
|
+
*/
|
|
457
|
+
desktopSwipeActions?: boolean | DataTableDesktopSwipeActions<T>;
|
|
437
458
|
/**
|
|
438
459
|
* Renders as a full-width row above the data rows in the desktop table
|
|
439
460
|
* (mobile has no equivalent list-row slot, so it's desktop-only). For a
|
|
@@ -616,6 +637,26 @@ export interface MobileSwipeActions {
|
|
|
616
637
|
/** Committed by dragging physically RIGHT, whatever the direction. */
|
|
617
638
|
right?: SwipeAction[];
|
|
618
639
|
}
|
|
640
|
+
/** How {@link DataTableProps.desktopSwipeActions} draws the column (0.46, dev#598). */
|
|
641
|
+
export interface DataTableDesktopSwipeActions<T> {
|
|
642
|
+
/** Leave an action out because the row already has its own button for it — keksdose's
|
|
643
|
+
* feedback inbox, whose status cell offers `advance` and `wont_do`
|
|
644
|
+
* (`feedbackSwipeOmitShown`). Match on `action.id` rather than the translated label. */
|
|
645
|
+
omit?: (action: SwipeAction, row: T) => boolean;
|
|
646
|
+
/** The row's name for the "⋯" menu ("Actions for …"). Default: the table's `rowName`. */
|
|
647
|
+
name?: (row: T) => string | null | undefined;
|
|
648
|
+
/** {@link RowActionsCollapse}; default `"auto"`. A table whose rows offer more than two
|
|
649
|
+
* actions passes `"menu"`, so the column does not switch between icons and a menu. */
|
|
650
|
+
collapse?: RowActionsCollapse;
|
|
651
|
+
/**
|
|
652
|
+
* Whether an action COMMITS, refused with the reason under a locked
|
|
653
|
+
* `WriteLockProvider` ({@link CommitScope}) — a swipe has no such state, so a plan
|
|
654
|
+
* usually returns nothing for a locked row and the desktop shows nothing either; with
|
|
655
|
+
* this the plan can stay and the desktop says why. Per action as a function. Default:
|
|
656
|
+
* no commit scope (the plan decides).
|
|
657
|
+
*/
|
|
658
|
+
commit?: CommitScope | ((action: SwipeAction, row: T) => CommitScope | undefined);
|
|
659
|
+
}
|
|
619
660
|
/**
|
|
620
661
|
* The phone sort control's strings (keksdose K10). They are `dataTable` strings —
|
|
621
662
|
* read from the table's resolved labels, so the `labels` prop and the provider's
|
|
@@ -637,4 +678,4 @@ export interface DataTableSortLabels {
|
|
|
637
678
|
* (DataTableLabels extends DataTableSortLabels; one source for the English). */
|
|
638
679
|
export declare const DEFAULT_DATA_TABLE_SORT_LABELS: DataTableSortLabels;
|
|
639
680
|
import { type TableUrlSync } from "./use-table-state.js";
|
|
640
|
-
export declare function DataTable<T>({ rows, columns: columnsProp, rowKey, defaultPageSize, onRowClick, rowHref, expandedRow, isExpanded, rowClassName, rowAttributes, paginated, empty, storageKey, urlSync, fillHeight, maxBodyHeight, serverPagination, filters: filtersProp, onFiltersChange, sorts: sortsProp, onSortsChange, pageSize: pageSizeProp, onPageSizeChange, selection, labels: labelsProp, locale: localeProp, storageKeyPrefix: storageKeyPrefixProp, mobileExpandAsDialog, mobileDetailsInRow, rowName, mobileDialogBackCloses, mobileGroupBy, mobileGroupLabel, mobileCard, mobileSort, mobileSwipeActions, leadingRow, density, sortCycle, chrome, columnSettings: columnSettingsProp, resizable: resizableProp, multiSort: multiSortProp, frame, edgeFade, className, rowActions, toolbar, footerLabel, footer: footerProp, }: DataTableProps<T>): import("react").JSX.Element;
|
|
681
|
+
export declare function DataTable<T>({ rows, columns: columnsProp, rowKey, defaultPageSize, onRowClick, rowHref, expandedRow, isExpanded, rowClassName, rowAttributes, paginated, empty, storageKey, urlSync, fillHeight, maxBodyHeight, serverPagination, filters: filtersProp, onFiltersChange, sorts: sortsProp, onSortsChange, pageSize: pageSizeProp, onPageSizeChange, selection, labels: labelsProp, locale: localeProp, storageKeyPrefix: storageKeyPrefixProp, mobileExpandAsDialog, mobileDetailsInRow, rowName, mobileDialogBackCloses, mobileGroupBy, mobileGroupLabel, mobileCard, mobileSort, mobileSwipeActions, desktopSwipeActions, leadingRow, density, sortCycle, chrome, columnSettings: columnSettingsProp, resizable: resizableProp, multiSort: multiSortProp, frame, edgeFade, className, rowActions, toolbar, footerLabel, footer: footerProp, }: DataTableProps<T>): import("react").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { createElement } from "react";
|
|
|
4
4
|
import { Fragment, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { Card } from "./card.js";
|
|
6
6
|
import { Spinner } from "./spinner.js";
|
|
7
|
-
import {
|
|
7
|
+
import { isTableOwnColumn, useRowActionColumn } from "./data-table-row-actions.js";
|
|
8
8
|
import { useColumnResize } from "./data-table-resize.js";
|
|
9
9
|
import { useRangeSelection } from "./data-table-selection.js";
|
|
10
10
|
import {
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
cleanAttrs,
|
|
13
13
|
columnLabel,
|
|
14
14
|
fromOutside,
|
|
15
|
+
fromOwnControl,
|
|
15
16
|
logicalAlign,
|
|
16
17
|
resolveDataTableLabels,
|
|
17
18
|
splitCellProps
|
|
@@ -39,12 +40,6 @@ const DEFAULT_DATA_TABLE_SORT_LABELS = {
|
|
|
39
40
|
sortDescending: DEFAULT_DATA_TABLE_LABELS.sortDescending
|
|
40
41
|
};
|
|
41
42
|
const flipDir = (d) => d === "asc" ? "desc" : "asc";
|
|
42
|
-
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"])';
|
|
43
|
-
function fromOwnControl(target, row) {
|
|
44
|
-
if (!(target instanceof Element)) return false;
|
|
45
|
-
const hit = target.closest(OWN_CONTROL);
|
|
46
|
-
return !!hit && hit !== row && row.contains(hit) && !hit.hasAttribute("data-row-link");
|
|
47
|
-
}
|
|
48
43
|
function moveRowFocus(from, key) {
|
|
49
44
|
if (!(key in ROW_NAV_KEYS)) return false;
|
|
50
45
|
const body = from.parentElement;
|
|
@@ -97,6 +92,7 @@ function DataTable({
|
|
|
97
92
|
mobileCard,
|
|
98
93
|
mobileSort = false,
|
|
99
94
|
mobileSwipeActions,
|
|
95
|
+
desktopSwipeActions,
|
|
100
96
|
leadingRow,
|
|
101
97
|
density = "comfortable",
|
|
102
98
|
sortCycle = "tri",
|
|
@@ -129,7 +125,9 @@ function DataTable({
|
|
|
129
125
|
rowActions,
|
|
130
126
|
rowName,
|
|
131
127
|
labels,
|
|
132
|
-
density
|
|
128
|
+
density,
|
|
129
|
+
mobileSwipeActions,
|
|
130
|
+
desktopSwipeActions
|
|
133
131
|
});
|
|
134
132
|
const swipeActionsFor = mobileSwipeActions ?? (rowActions ? swipesFromActions : void 0);
|
|
135
133
|
const { announce, regionProps } = useAnnounce();
|
|
@@ -314,11 +312,13 @@ function DataTable({
|
|
|
314
312
|
const totalColSpan = visibleCount + (selection ? 1 : 0);
|
|
315
313
|
const hasFooterColumns = columns.some((c) => c.footer);
|
|
316
314
|
const showFooter = footerProp !== false && hasFooterColumns && sorted.length > 0;
|
|
317
|
-
const footerLabelCol = showFooter ? visibleColumns.find((c) => !c.footer && c.key
|
|
315
|
+
const footerLabelCol = showFooter ? visibleColumns.find((c) => !c.footer && !isTableOwnColumn(c.key)) ?? visibleColumns[0] : void 0;
|
|
318
316
|
const footerValue = (col) => col.footer?.(sorted, slice);
|
|
319
317
|
const footerHeadingId = useId();
|
|
320
318
|
const detailIdBase = useId();
|
|
321
|
-
const
|
|
319
|
+
const ownColumns = columns.filter((c) => isTableOwnColumn(c.key)).length;
|
|
320
|
+
const ownVisible = visibleColumns.filter((c) => isTableOwnColumn(c.key)).length;
|
|
321
|
+
const columnsCountLabel = labels.columnsCount(visibleCount - ownVisible, totalCount - ownColumns);
|
|
322
322
|
const isMdUp = !usePhoneLayout();
|
|
323
323
|
const desktopScroller = useRef(null);
|
|
324
324
|
const edgeFadeProps = useEdgeFade(desktopScroller, edgeFade && isMdUp);
|