@igne-agency/react-web-ui 0.5.0 → 0.6.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/dist/components/accordion/accordion.css +21 -21
- package/dist/components/accordion/accordion.d.ts +17 -4
- package/dist/components/accordion/accordion.js +83 -36
- package/dist/components/accordion/accordion.module.js +6 -6
- package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
- package/dist/components/attachment-tile/attachment-preview.js +388 -119
- package/dist/components/attachment-tile/attachment-tile.css +31 -25
- package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
- package/dist/components/attachment-tile/attachment-tile.js +160 -43
- package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/avatar/avatar.css +9 -9
- package/dist/components/avatar/avatar.d.ts +50 -5
- package/dist/components/avatar/avatar.js +178 -64
- package/dist/components/avatar/avatar.module.js +3 -3
- package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
- package/dist/components/avatar-group/avatar-group-context.js +2 -2
- package/dist/components/avatar-group/avatar-group.css +26 -20
- package/dist/components/avatar-group/avatar-group.d.ts +85 -27
- package/dist/components/avatar-group/avatar-group.js +400 -246
- package/dist/components/avatar-group/avatar-group.module.js +8 -8
- package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
- package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
- package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
- package/dist/components/button/button.css +29 -31
- package/dist/components/button/button.d.ts +20 -16
- package/dist/components/button/button.js +140 -145
- package/dist/components/button/button.module.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/checkbox-field/checkbox-field.js +63 -49
- package/dist/components/checkbox-field/checkbox.css +105 -56
- package/dist/components/checkbox-field/checkbox.d.ts +3 -2
- package/dist/components/checkbox-field/checkbox.js +12 -9
- package/dist/components/checkbox-field/checkbox.module.js +4 -4
- package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
- package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
- package/dist/components/collapsible/collapsible.css +20 -20
- package/dist/components/collapsible/collapsible.d.ts +17 -4
- package/dist/components/collapsible/collapsible.js +83 -36
- package/dist/components/collapsible/collapsible.module.js +5 -5
- package/dist/components/combobox-field/combobox-field.js +206 -158
- package/dist/components/combobox-field/combobox.css +492 -277
- package/dist/components/combobox-field/combobox.d.ts +148 -39
- package/dist/components/combobox-field/combobox.js +506 -206
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/value-state-view.css +5 -5
- package/dist/components/combobox-field/value-state-view.module.js +4 -4
- package/dist/components/composer/composer-attachments.d.ts +30 -11
- package/dist/components/composer/composer-attachments.js +45 -40
- package/dist/components/composer/composer-editor.css +40 -35
- package/dist/components/composer/composer-editor.d.ts +14 -4
- package/dist/components/composer/composer-editor.js +134 -44
- package/dist/components/composer/composer-editor.module.js +5 -5
- package/dist/components/composer/composer.css +22 -22
- package/dist/components/composer/composer.d.ts +13 -2
- package/dist/components/composer/composer.js +78 -63
- package/dist/components/composer/composer.module.js +5 -5
- package/dist/components/composer/index.d.ts +2 -2
- package/dist/components/composer/mention-text.css +5 -5
- package/dist/components/composer/mention-text.module.js +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
- package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
- package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
- package/dist/components/conversation/conversation.css +52 -52
- package/dist/components/conversation/conversation.d.ts +43 -18
- package/dist/components/conversation/conversation.js +120 -78
- package/dist/components/conversation/conversation.module.js +15 -15
- package/dist/components/date-field/date-field.d.ts +1 -1
- package/dist/components/date-field/date-field.js +202 -100
- package/dist/components/date-field/date-input.d.ts +73 -37
- package/dist/components/date-field/date-input.js +72 -45
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.js +219 -107
- package/dist/components/date-range-field/date-range-input.d.ts +84 -40
- package/dist/components/date-range-field/date-range-input.js +83 -48
- package/dist/components/dialog/dialog.css +32 -32
- package/dist/components/dialog/dialog.d.ts +8 -7
- package/dist/components/dialog/dialog.js +8 -26
- package/dist/components/dialog/dialog.module.js +6 -6
- package/dist/components/divider/divider.css +6 -6
- package/dist/components/divider/divider.d.ts +36 -2
- package/dist/components/divider/divider.js +195 -29
- package/dist/components/divider/divider.module.js +3 -3
- package/dist/components/drawer/drawer.css +55 -56
- package/dist/components/drawer/drawer.d.ts +8 -7
- package/dist/components/drawer/drawer.js +8 -26
- package/dist/components/drawer/drawer.module.js +6 -6
- package/dist/components/field/field.css +34 -24
- package/dist/components/field/field.d.ts +60 -37
- package/dist/components/field/field.js +242 -157
- package/dist/components/field/field.module.js +12 -10
- package/dist/components/field/input-parts.d.ts +11 -13
- package/dist/components/field/input-parts.js +23 -42
- package/dist/components/field-placeholder/field-placeholder.css +6 -6
- package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
- package/dist/components/fieldset/field-group.d.ts +1 -1
- package/dist/components/fieldset/field-group.js +48 -42
- package/dist/components/fieldset/fieldset-root.d.ts +1 -1
- package/dist/components/fieldset/fieldset-root.js +19 -17
- package/dist/components/fieldset/fieldset.d.ts +2 -2
- package/dist/components/fieldset/fieldset.js +2 -2
- package/dist/components/file-field/file-field.css +126 -60
- package/dist/components/file-field/file-field.js +201 -109
- package/dist/components/file-field/file-field.module.js +4 -4
- package/dist/components/file-field/file-input.d.ts +66 -40
- package/dist/components/file-field/file-input.js +188 -132
- package/dist/components/filter-bar/filter-bar.css +8 -8
- package/dist/components/filter-bar/filter-bar.d.ts +12 -3
- package/dist/components/filter-bar/filter-bar.js +23 -25
- package/dist/components/filter-bar/filter-bar.module.js +5 -5
- package/dist/components/form/form.d.ts +19 -7
- package/dist/components/form/form.js +80 -29
- package/dist/components/icon/icon.css +2 -2
- package/dist/components/icon/icon.module.js +1 -1
- package/dist/components/link/link.css +6 -5
- package/dist/components/link/link.module.js +1 -1
- package/dist/components/menu/menu.css +52 -47
- package/dist/components/menu/menu.d.ts +32 -25
- package/dist/components/menu/menu.js +75 -124
- package/dist/components/menu/menu.module.js +8 -8
- package/dist/components/nav/nav-context.d.ts +1 -1
- package/dist/components/nav/nav-item-view.d.ts +10 -13
- package/dist/components/nav/nav-item-view.js +42 -54
- package/dist/components/nav/nav.css +150 -119
- package/dist/components/nav/nav.d.ts +61 -17
- package/dist/components/nav/nav.js +271 -176
- package/dist/components/nav/nav.module.js +17 -15
- package/dist/components/number-field/number-field.css +153 -64
- package/dist/components/number-field/number-field.d.ts +2 -2
- package/dist/components/number-field/number-field.js +112 -91
- package/dist/components/number-field/number-field.module.js +6 -6
- package/dist/components/number-field/number-input.d.ts +43 -23
- package/dist/components/number-field/number-input.js +179 -125
- package/dist/components/otp-field/otp-field.css +153 -60
- package/dist/components/otp-field/otp-field.d.ts +2 -2
- package/dist/components/otp-field/otp-field.js +62 -46
- package/dist/components/otp-field/otp-field.module.js +4 -4
- package/dist/components/otp-field/otp-input.d.ts +8 -6
- package/dist/components/otp-field/otp-input.js +92 -92
- package/dist/components/pagination/pagination.d.ts +46 -15
- package/dist/components/pagination/pagination.js +217 -224
- package/dist/components/password-field/password-field.css +23 -23
- package/dist/components/password-field/password-field.js +107 -85
- package/dist/components/password-field/password-field.module.js +8 -8
- package/dist/components/password-field/password-strength.d.ts +107 -3
- package/dist/components/password-field/password-strength.js +569 -92
- package/dist/components/photo-field/photo-field.js +137 -112
- package/dist/components/photo-field/photo-input.css +67 -44
- package/dist/components/photo-field/photo-input.d.ts +59 -15
- package/dist/components/photo-field/photo-input.js +173 -86
- package/dist/components/photo-field/photo-input.module.js +10 -8
- package/dist/components/popover/popover.css +41 -41
- package/dist/components/popover/popover.d.ts +66 -25
- package/dist/components/popover/popover.js +332 -217
- package/dist/components/popover/popover.module.js +15 -19
- package/dist/components/radio-group-field/radio-group-field.js +80 -71
- package/dist/components/radio-group-field/radio-group.css +112 -60
- package/dist/components/radio-group-field/radio-group.d.ts +19 -3
- package/dist/components/radio-group-field/radio-group.js +66 -23
- package/dist/components/radio-group-field/radio-group.module.js +4 -4
- package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
- package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
- package/dist/components/segmented-control-field/segmented-control.css +132 -79
- package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
- package/dist/components/segmented-control-field/segmented-control.js +124 -41
- package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
- package/dist/components/select-field/select.css +214 -101
- package/dist/components/select-field/select.d.ts +43 -11
- package/dist/components/select-field/select.js +194 -109
- package/dist/components/select-field/select.module.js +14 -14
- package/dist/components/skeleton/skeleton.css +4 -4
- package/dist/components/skeleton/skeleton.module.js +3 -3
- package/dist/components/stale/stale.css +15 -15
- package/dist/components/stale/stale.d.ts +27 -3
- package/dist/components/stale/stale.js +147 -66
- package/dist/components/stale/stale.module.js +6 -6
- package/dist/components/status-message/status-message.css +22 -22
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/switch-field/switch-field.js +77 -57
- package/dist/components/switch-field/switch.css +112 -63
- package/dist/components/switch-field/switch.d.ts +20 -3
- package/dist/components/switch-field/switch.js +70 -27
- package/dist/components/switch-field/switch.module.js +4 -4
- package/dist/components/tabs/tabs.css +32 -32
- package/dist/components/tabs/tabs.d.ts +21 -7
- package/dist/components/tabs/tabs.js +73 -14
- package/dist/components/tabs/tabs.module.js +7 -7
- package/dist/components/tag/tag.css +84 -84
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +94 -94
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.css +159 -82
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.js +139 -110
- package/dist/components/text-field/text-field.module.js +9 -9
- package/dist/components/text-field/text-input.d.ts +81 -45
- package/dist/components/text-field/text-input.js +366 -217
- package/dist/components/textarea-field/textarea-field.css +7 -2
- package/dist/components/textarea-field/textarea-field.js +72 -56
- package/dist/components/textarea-field/textarea-field.module.js +2 -2
- package/dist/components/time-field/time-field.js +153 -60
- package/dist/components/time-field/time-input.d.ts +21 -10
- package/dist/components/time-field/time-input.js +22 -11
- package/dist/components/toast/toast-provider.css +34 -31
- package/dist/components/toast/toast-provider.d.ts +63 -14
- package/dist/components/toast/toast-provider.js +174 -111
- package/dist/components/toast/toast-provider.module.js +7 -7
- package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
- package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
- package/dist/components/toggle-group-field/toggle-group.css +117 -67
- package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group-field/toggle-group.js +2 -2
- package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/components/tooltip/tooltip.module.js +1 -1
- package/dist/data-table/data-table-content.js +6 -5
- package/dist/data-table/data-table-parts.d.ts +41 -13
- package/dist/data-table/data-table-parts.js +213 -172
- package/dist/data-table/data-table-selection.d.ts +105 -3
- package/dist/data-table/data-table-selection.js +654 -145
- package/dist/data-table/data-table.css +125 -128
- package/dist/data-table/data-table.d.ts +21 -26
- package/dist/data-table/data-table.js +20 -23
- package/dist/data-table/data-table.module.js +32 -34
- package/dist/data-table/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
- package/dist/lib/calendar/calendar-navigation.js +185 -118
- package/dist/lib/calendar/calendar-parts.d.ts +143 -0
- package/dist/lib/calendar/calendar-parts.js +540 -0
- package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
- package/dist/lib/calendar/calendar-prefab.js +311 -0
- package/dist/lib/calendar/calendar-year.d.ts +3 -1
- package/dist/lib/calendar/calendar-year.js +139 -131
- package/dist/lib/calendar/temporal.css +325 -232
- package/dist/lib/calendar/temporal.d.ts +67 -82
- package/dist/lib/calendar/temporal.js +258 -569
- package/dist/lib/calendar/temporal.module.js +38 -38
- package/dist/lib/forms/use-connected-field.d.ts +1 -1
- package/dist/lib/forms/use-connected-field.js +1 -1
- package/dist/lib/render-as.d.ts +13 -0
- package/dist/lib/render-as.js +46 -0
- package/dist/tokens.css +6 -3
- package/package.json +1 -1
- package/tokens/dark.tokens.json +6 -0
- package/tokens/sys.tokens.json +7 -0
- package/dist/components/button/close-button.d.ts +0 -16
- package/dist/components/button/close-button.js +0 -30
|
@@ -19,12 +19,25 @@ export declare const RefreshFailed: ({ render, className, ref, ...props }: DataT
|
|
|
19
19
|
export type DataTableFrameProps = useRender.ComponentProps<"div">;
|
|
20
20
|
/**
|
|
21
21
|
* The frame that stays put around the scroller: it measures the pinned columns
|
|
22
|
-
* and
|
|
22
|
+
* and is the `Stale.Root` of the rows, so it takes a `Scroller` and a
|
|
23
|
+
* `StaleOverlay`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <DataTable.Frame>
|
|
27
|
+
* <DataTable.Scroller>…</DataTable.Scroller>
|
|
28
|
+
* <DataTable.StaleOverlay>…</DataTable.StaleOverlay>
|
|
29
|
+
* </DataTable.Frame>
|
|
23
30
|
*/
|
|
24
|
-
export declare const Frame: ({ render, className, ref,
|
|
31
|
+
export declare const Frame: ({ render, className, ref, ...props }: DataTableFrameProps) => ReactNode;
|
|
25
32
|
export type DataTableScrollerProps = useRender.ComponentProps<"div">;
|
|
26
|
-
/**
|
|
27
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The scrolling card that holds the `Table`: the `Stale.Content` of the rows,
|
|
35
|
+
* dimmed while they are stale.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <DataTable.Scroller><DataTable.Table>…</DataTable.Table></DataTable.Scroller>
|
|
39
|
+
*/
|
|
40
|
+
export declare const Scroller: ({ className, ...props }: DataTableScrollerProps) => ReactNode;
|
|
28
41
|
/** What covers the table once a refresh is slow: its `Stale.Message` and `Stale.Retry`. */
|
|
29
42
|
export declare const StaleOverlay: ({ className, ...props }: StaleOverlayProps) => ReactNode;
|
|
30
43
|
export type DataTableTableProps = useRender.ComponentProps<"table">;
|
|
@@ -51,19 +64,34 @@ export declare const HeaderCell: <TData extends Record<string, unknown>>({ heade
|
|
|
51
64
|
export type DataTableSortButtonProps<TData extends Record<string, unknown>> = Omit<ComponentProps<"button">, "ref"> & Readonly<{
|
|
52
65
|
/** The header whose column this sorts. */
|
|
53
66
|
header: TableHeader<DataTableFeatures, TData>;
|
|
54
|
-
/** The glyph while the column sorts ascending. */
|
|
55
|
-
sortAscendingIcon?: ReactNode;
|
|
56
|
-
/** The glyph while the column sorts descending. */
|
|
57
|
-
sortDescendingIcon?: ReactNode;
|
|
58
|
-
/** The glyph while the column is not sorted. */
|
|
59
|
-
unsortedIcon?: ReactNode;
|
|
60
67
|
}>;
|
|
61
68
|
/**
|
|
62
69
|
* The header's sort toggle, which returns the table to its first page. It
|
|
63
|
-
* draws the column's header unless given children,
|
|
64
|
-
*
|
|
70
|
+
* draws the column's header unless given children, such as the header and a
|
|
71
|
+
* `SortIcon`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <DataTable.SortButton header={header} />
|
|
75
|
+
*/
|
|
76
|
+
export declare const SortButton: <TData extends Record<string, unknown>>({ header, className, children, onClick, ...props }: DataTableSortButtonProps<TData>) => ReactNode;
|
|
77
|
+
/** Which way a column sorts, or `none`, as a `SortIcon` hands it to its children. */
|
|
78
|
+
export type DataTableSort = "asc" | "desc" | "none";
|
|
79
|
+
export type DataTableSortIconProps<TData extends Record<string, unknown>> = Omit<useRender.ComponentProps<"span">, "children"> & Readonly<{
|
|
80
|
+
/** The header whose column's sort this shows. */
|
|
81
|
+
header: TableHeader<DataTableFeatures, TData>;
|
|
82
|
+
/** The glyph for the column's sort. Nothing returned, nothing drawn. */
|
|
83
|
+
children: (sort: DataTableSort) => ReactNode;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* The glyph for a column's sort, beside the header in a `SortButton`, set as
|
|
87
|
+
* `data-sort`. Renders nothing for a sort without a glyph.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* <DataTable.SortIcon header={header}>
|
|
91
|
+
* {sort => (sort === "asc" ? <ArrowUpwardIcon /> : sort === "desc" ? <ArrowDownwardIcon /> : null)}
|
|
92
|
+
* </DataTable.SortIcon>
|
|
65
93
|
*/
|
|
66
|
-
export declare const
|
|
94
|
+
export declare const SortIcon: <TData extends Record<string, unknown>>({ header, render, className, ref, children, ...props }: DataTableSortIconProps<TData>) => ReactElement | null;
|
|
67
95
|
export type DataTableBodyProps = useRender.ComponentProps<"tbody">;
|
|
68
96
|
/** The body: the page's `Row`s, the `PlaceholderRows` or a `StateRow`. */
|
|
69
97
|
export declare const Body: ({ render, ref, ...props }: DataTableBodyProps) => ReactElement;
|
|
@@ -161,158 +161,137 @@ var RefreshFailed = (t0) => {
|
|
|
161
161
|
};
|
|
162
162
|
/**
|
|
163
163
|
* The frame that stays put around the scroller: it measures the pinned columns
|
|
164
|
-
* and
|
|
164
|
+
* and is the `Stale.Root` of the rows, so it takes a `Scroller` and a
|
|
165
|
+
* `StaleOverlay`.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* <DataTable.Frame>
|
|
169
|
+
* <DataTable.Scroller>…</DataTable.Scroller>
|
|
170
|
+
* <DataTable.StaleOverlay>…</DataTable.StaleOverlay>
|
|
171
|
+
* </DataTable.Frame>
|
|
165
172
|
*/
|
|
166
173
|
var Frame = (t0) => {
|
|
167
|
-
const $ = c(
|
|
168
|
-
let children;
|
|
174
|
+
const $ = c(23);
|
|
169
175
|
let className;
|
|
170
176
|
let props;
|
|
171
177
|
let ref;
|
|
172
178
|
let render;
|
|
173
179
|
if ($[0] !== t0) {
|
|
174
|
-
({render, className, ref,
|
|
180
|
+
({render, className, ref, ...props} = t0);
|
|
175
181
|
$[0] = t0;
|
|
176
|
-
$[1] =
|
|
177
|
-
$[2] =
|
|
178
|
-
$[3] =
|
|
179
|
-
$[4] =
|
|
180
|
-
$[5] = render;
|
|
182
|
+
$[1] = className;
|
|
183
|
+
$[2] = props;
|
|
184
|
+
$[3] = ref;
|
|
185
|
+
$[4] = render;
|
|
181
186
|
} else {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
render = $[5];
|
|
187
|
+
className = $[1];
|
|
188
|
+
props = $[2];
|
|
189
|
+
ref = $[3];
|
|
190
|
+
render = $[4];
|
|
187
191
|
}
|
|
188
192
|
const { table } = useDataTable();
|
|
189
193
|
const { stale } = useDataTableView();
|
|
190
194
|
let t1;
|
|
191
195
|
let t2;
|
|
192
|
-
if ($[
|
|
196
|
+
if ($[5] !== table) {
|
|
193
197
|
const columns = table.getAllLeafColumns();
|
|
194
198
|
t1 = useStickyOffsets;
|
|
195
199
|
t2 = columns.filter(_temp).map(_temp2).join(",");
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
200
|
+
$[5] = table;
|
|
201
|
+
$[6] = t1;
|
|
202
|
+
$[7] = t2;
|
|
199
203
|
} else {
|
|
200
|
-
t1 = $[
|
|
201
|
-
t2 = $[
|
|
204
|
+
t1 = $[6];
|
|
205
|
+
t2 = $[7];
|
|
202
206
|
}
|
|
203
207
|
const frameRef = t1(t2);
|
|
204
208
|
let t3;
|
|
205
|
-
if ($[
|
|
209
|
+
if ($[8] !== frameRef || $[9] !== ref) {
|
|
206
210
|
t3 = ref === void 0 ? frameRef : [frameRef, ref];
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
} else t3 = $[
|
|
211
|
+
$[8] = frameRef;
|
|
212
|
+
$[9] = ref;
|
|
213
|
+
$[10] = t3;
|
|
214
|
+
} else t3 = $[10];
|
|
211
215
|
let t4;
|
|
212
|
-
if ($[
|
|
216
|
+
if ($[11] !== className) {
|
|
213
217
|
t4 = clsx(data_table_module_default.scrollFrame, className);
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
} else t4 = $[
|
|
218
|
+
$[11] = className;
|
|
219
|
+
$[12] = t4;
|
|
220
|
+
} else t4 = $[12];
|
|
217
221
|
let t5;
|
|
218
|
-
if ($[
|
|
219
|
-
t5 =
|
|
220
|
-
busy: stale,
|
|
221
|
-
className: data_table_module_default.stale,
|
|
222
|
-
children
|
|
223
|
-
});
|
|
224
|
-
$[14] = children;
|
|
225
|
-
$[15] = stale;
|
|
226
|
-
$[16] = t5;
|
|
227
|
-
} else t5 = $[16];
|
|
228
|
-
let t6;
|
|
229
|
-
if ($[17] !== props || $[18] !== t4 || $[19] !== t5) {
|
|
230
|
-
t6 = {
|
|
222
|
+
if ($[13] !== props || $[14] !== t4) {
|
|
223
|
+
t5 = {
|
|
231
224
|
...props,
|
|
232
|
-
className: t4
|
|
233
|
-
children: t5
|
|
225
|
+
className: t4
|
|
234
226
|
};
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
t7 = {
|
|
227
|
+
$[13] = props;
|
|
228
|
+
$[14] = t4;
|
|
229
|
+
$[15] = t5;
|
|
230
|
+
} else t5 = $[15];
|
|
231
|
+
let t6;
|
|
232
|
+
if ($[16] !== render || $[17] !== t3 || $[18] !== t5) {
|
|
233
|
+
t6 = {
|
|
243
234
|
defaultTagName: "div",
|
|
244
235
|
render,
|
|
245
236
|
ref: t3,
|
|
246
|
-
props:
|
|
237
|
+
props: t5
|
|
247
238
|
};
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
} else
|
|
253
|
-
|
|
239
|
+
$[16] = render;
|
|
240
|
+
$[17] = t3;
|
|
241
|
+
$[18] = t5;
|
|
242
|
+
$[19] = t6;
|
|
243
|
+
} else t6 = $[19];
|
|
244
|
+
const element = useRender(t6);
|
|
245
|
+
let t7;
|
|
246
|
+
if ($[20] !== element || $[21] !== stale) {
|
|
247
|
+
t7 = /* @__PURE__ */ jsx(Stale.Root, {
|
|
248
|
+
busy: stale,
|
|
249
|
+
render: element
|
|
250
|
+
});
|
|
251
|
+
$[20] = element;
|
|
252
|
+
$[21] = stale;
|
|
253
|
+
$[22] = t7;
|
|
254
|
+
} else t7 = $[22];
|
|
255
|
+
return t7;
|
|
254
256
|
};
|
|
255
|
-
/**
|
|
257
|
+
/**
|
|
258
|
+
* The scrolling card that holds the `Table`: the `Stale.Content` of the rows,
|
|
259
|
+
* dimmed while they are stale.
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* <DataTable.Scroller><DataTable.Table>…</DataTable.Table></DataTable.Scroller>
|
|
263
|
+
*/
|
|
256
264
|
var Scroller = (t0) => {
|
|
257
|
-
const $ = c(
|
|
265
|
+
const $ = c(8);
|
|
258
266
|
let className;
|
|
259
267
|
let props;
|
|
260
|
-
let ref;
|
|
261
|
-
let render;
|
|
262
268
|
if ($[0] !== t0) {
|
|
263
|
-
({
|
|
269
|
+
({className, ...props} = t0);
|
|
264
270
|
$[0] = t0;
|
|
265
271
|
$[1] = className;
|
|
266
272
|
$[2] = props;
|
|
267
|
-
$[3] = ref;
|
|
268
|
-
$[4] = render;
|
|
269
273
|
} else {
|
|
270
274
|
className = $[1];
|
|
271
275
|
props = $[2];
|
|
272
|
-
ref = $[3];
|
|
273
|
-
render = $[4];
|
|
274
276
|
}
|
|
275
277
|
let t1;
|
|
276
|
-
if ($[
|
|
278
|
+
if ($[3] !== className) {
|
|
277
279
|
t1 = clsx(data_table_module_default.contentWrap, className);
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
} else t1 = $[
|
|
280
|
+
$[3] = className;
|
|
281
|
+
$[4] = t1;
|
|
282
|
+
} else t1 = $[4];
|
|
281
283
|
let t2;
|
|
282
|
-
if ($[
|
|
283
|
-
t2 = {
|
|
284
|
-
...props,
|
|
284
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
285
|
+
t2 = /* @__PURE__ */ jsx(Stale.Content, {
|
|
285
286
|
"data-scroller": true,
|
|
287
|
+
...props,
|
|
286
288
|
className: t1
|
|
287
|
-
};
|
|
288
|
-
$[7] = props;
|
|
289
|
-
$[8] = t1;
|
|
290
|
-
$[9] = t2;
|
|
291
|
-
} else t2 = $[9];
|
|
292
|
-
let t3;
|
|
293
|
-
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
294
|
-
t3 = {
|
|
295
|
-
defaultTagName: "div",
|
|
296
|
-
render,
|
|
297
|
-
ref,
|
|
298
|
-
props: t2
|
|
299
|
-
};
|
|
300
|
-
$[10] = ref;
|
|
301
|
-
$[11] = render;
|
|
302
|
-
$[12] = t2;
|
|
303
|
-
$[13] = t3;
|
|
304
|
-
} else t3 = $[13];
|
|
305
|
-
const element = useRender(t3);
|
|
306
|
-
let t4;
|
|
307
|
-
if ($[14] !== element) {
|
|
308
|
-
t4 = /* @__PURE__ */ jsx(Stale.Content, {
|
|
309
|
-
className: data_table_module_default.stale,
|
|
310
|
-
children: element
|
|
311
289
|
});
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
|
|
315
|
-
|
|
290
|
+
$[5] = props;
|
|
291
|
+
$[6] = t1;
|
|
292
|
+
$[7] = t2;
|
|
293
|
+
} else t2 = $[7];
|
|
294
|
+
return t2;
|
|
316
295
|
};
|
|
317
296
|
/** What covers the table once a refresh is slow: its `Stale.Message` and `Stale.Retry`. */
|
|
318
297
|
var StaleOverlay = (t0) => {
|
|
@@ -639,105 +618,167 @@ var HeaderCell = (t0) => {
|
|
|
639
618
|
};
|
|
640
619
|
/**
|
|
641
620
|
* The header's sort toggle, which returns the table to its first page. It
|
|
642
|
-
* draws the column's header unless given children,
|
|
643
|
-
*
|
|
621
|
+
* draws the column's header unless given children, such as the header and a
|
|
622
|
+
* `SortIcon`.
|
|
623
|
+
*
|
|
624
|
+
* @example
|
|
625
|
+
* <DataTable.SortButton header={header} />
|
|
644
626
|
*/
|
|
645
627
|
var SortButton = (t0) => {
|
|
646
|
-
const $ = c(
|
|
628
|
+
const $ = c(21);
|
|
647
629
|
let children;
|
|
648
630
|
let className;
|
|
649
631
|
let header;
|
|
650
632
|
let onClick;
|
|
651
633
|
let props;
|
|
652
|
-
let sortAscendingIcon;
|
|
653
|
-
let sortDescendingIcon;
|
|
654
|
-
let unsortedIcon;
|
|
655
634
|
if ($[0] !== t0) {
|
|
656
|
-
({header,
|
|
635
|
+
({header, className, children, onClick, ...props} = t0);
|
|
657
636
|
$[0] = t0;
|
|
658
637
|
$[1] = children;
|
|
659
638
|
$[2] = className;
|
|
660
639
|
$[3] = header;
|
|
661
640
|
$[4] = onClick;
|
|
662
641
|
$[5] = props;
|
|
663
|
-
$[6] = sortAscendingIcon;
|
|
664
|
-
$[7] = sortDescendingIcon;
|
|
665
|
-
$[8] = unsortedIcon;
|
|
666
642
|
} else {
|
|
667
643
|
children = $[1];
|
|
668
644
|
className = $[2];
|
|
669
645
|
header = $[3];
|
|
670
646
|
onClick = $[4];
|
|
671
647
|
props = $[5];
|
|
672
|
-
sortAscendingIcon = $[6];
|
|
673
|
-
sortDescendingIcon = $[7];
|
|
674
|
-
unsortedIcon = $[8];
|
|
675
648
|
}
|
|
676
|
-
const { table
|
|
649
|
+
const { table } = useDataTable();
|
|
677
650
|
let t1;
|
|
678
|
-
if ($[
|
|
679
|
-
t1 =
|
|
680
|
-
$[
|
|
681
|
-
$[
|
|
682
|
-
|
|
683
|
-
} else t1 = $[11];
|
|
684
|
-
const sorted = t1;
|
|
685
|
-
const icon = sorted === "asc" ? sortAscendingIcon : sorted === "desc" ? sortDescendingIcon : unsortedIcon;
|
|
651
|
+
if ($[6] !== className) {
|
|
652
|
+
t1 = clsx(data_table_module_default.sortToggle, className);
|
|
653
|
+
$[6] = className;
|
|
654
|
+
$[7] = t1;
|
|
655
|
+
} else t1 = $[7];
|
|
686
656
|
let t2;
|
|
687
|
-
if ($[
|
|
688
|
-
t2 =
|
|
689
|
-
$[12] = className;
|
|
690
|
-
$[13] = t2;
|
|
691
|
-
} else t2 = $[13];
|
|
692
|
-
let t3;
|
|
693
|
-
if ($[14] !== header.column || $[15] !== onClick || $[16] !== table) {
|
|
694
|
-
t3 = (event) => {
|
|
657
|
+
if ($[8] !== header || $[9] !== onClick || $[10] !== table) {
|
|
658
|
+
t2 = (event) => {
|
|
695
659
|
onClick?.(event);
|
|
696
660
|
header.column.toggleSorting();
|
|
697
661
|
table.setPageIndex(0);
|
|
698
662
|
};
|
|
699
|
-
$[
|
|
700
|
-
$[
|
|
701
|
-
$[
|
|
702
|
-
$[
|
|
703
|
-
} else
|
|
663
|
+
$[8] = header;
|
|
664
|
+
$[9] = onClick;
|
|
665
|
+
$[10] = table;
|
|
666
|
+
$[11] = t2;
|
|
667
|
+
} else t2 = $[11];
|
|
668
|
+
let t3;
|
|
669
|
+
if ($[12] !== children || $[13] !== header || $[14] !== table) {
|
|
670
|
+
t3 = children ?? /* @__PURE__ */ jsx(table.FlexRender, { header });
|
|
671
|
+
$[12] = children;
|
|
672
|
+
$[13] = header;
|
|
673
|
+
$[14] = table;
|
|
674
|
+
$[15] = t3;
|
|
675
|
+
} else t3 = $[15];
|
|
704
676
|
let t4;
|
|
705
|
-
if ($[
|
|
706
|
-
t4 =
|
|
707
|
-
$[18] = children;
|
|
708
|
-
$[19] = header;
|
|
709
|
-
$[20] = table;
|
|
710
|
-
$[21] = t4;
|
|
711
|
-
} else t4 = $[21];
|
|
712
|
-
let t5;
|
|
713
|
-
if ($[22] !== icon || $[23] !== sorted) {
|
|
714
|
-
t5 = icon === void 0 || icon === null ? null : /* @__PURE__ */ jsx("span", {
|
|
715
|
-
className: data_table_module_default.sortIcon,
|
|
716
|
-
"data-sort": sorted === false ? "none" : sorted,
|
|
717
|
-
"aria-hidden": "true",
|
|
718
|
-
children: icon
|
|
719
|
-
});
|
|
720
|
-
$[22] = icon;
|
|
721
|
-
$[23] = sorted;
|
|
722
|
-
$[24] = t5;
|
|
723
|
-
} else t5 = $[24];
|
|
724
|
-
let t6;
|
|
725
|
-
if ($[25] !== props || $[26] !== t2 || $[27] !== t3 || $[28] !== t4 || $[29] !== t5) {
|
|
726
|
-
t6 = /* @__PURE__ */ jsxs("button", {
|
|
677
|
+
if ($[16] !== props || $[17] !== t1 || $[18] !== t2 || $[19] !== t3) {
|
|
678
|
+
t4 = /* @__PURE__ */ jsx("button", {
|
|
727
679
|
type: "button",
|
|
728
680
|
...props,
|
|
729
|
-
className:
|
|
730
|
-
onClick:
|
|
731
|
-
children:
|
|
681
|
+
className: t1,
|
|
682
|
+
onClick: t2,
|
|
683
|
+
children: t3
|
|
732
684
|
});
|
|
733
|
-
$[
|
|
734
|
-
$[
|
|
735
|
-
$[
|
|
736
|
-
$[
|
|
737
|
-
$[
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
685
|
+
$[16] = props;
|
|
686
|
+
$[17] = t1;
|
|
687
|
+
$[18] = t2;
|
|
688
|
+
$[19] = t3;
|
|
689
|
+
$[20] = t4;
|
|
690
|
+
} else t4 = $[20];
|
|
691
|
+
return t4;
|
|
692
|
+
};
|
|
693
|
+
/**
|
|
694
|
+
* The glyph for a column's sort, beside the header in a `SortButton`, set as
|
|
695
|
+
* `data-sort`. Renders nothing for a sort without a glyph.
|
|
696
|
+
*
|
|
697
|
+
* @example
|
|
698
|
+
* <DataTable.SortIcon header={header}>
|
|
699
|
+
* {sort => (sort === "asc" ? <ArrowUpwardIcon /> : sort === "desc" ? <ArrowDownwardIcon /> : null)}
|
|
700
|
+
* </DataTable.SortIcon>
|
|
701
|
+
*/
|
|
702
|
+
var SortIcon = (t0) => {
|
|
703
|
+
const $ = c(24);
|
|
704
|
+
let children;
|
|
705
|
+
let className;
|
|
706
|
+
let header;
|
|
707
|
+
let props;
|
|
708
|
+
let ref;
|
|
709
|
+
let render;
|
|
710
|
+
if ($[0] !== t0) {
|
|
711
|
+
({header, render, className, ref, children, ...props} = t0);
|
|
712
|
+
$[0] = t0;
|
|
713
|
+
$[1] = children;
|
|
714
|
+
$[2] = className;
|
|
715
|
+
$[3] = header;
|
|
716
|
+
$[4] = props;
|
|
717
|
+
$[5] = ref;
|
|
718
|
+
$[6] = render;
|
|
719
|
+
} else {
|
|
720
|
+
children = $[1];
|
|
721
|
+
className = $[2];
|
|
722
|
+
header = $[3];
|
|
723
|
+
props = $[4];
|
|
724
|
+
ref = $[5];
|
|
725
|
+
render = $[6];
|
|
726
|
+
}
|
|
727
|
+
const { sorting } = useDataTable();
|
|
728
|
+
let sort;
|
|
729
|
+
let t1;
|
|
730
|
+
if ($[7] !== children || $[8] !== header.column.id || $[9] !== sorting) {
|
|
731
|
+
const sorted = sortOf(sorting, header.column.id);
|
|
732
|
+
sort = sorted === false ? "none" : sorted;
|
|
733
|
+
t1 = children(sort);
|
|
734
|
+
$[7] = children;
|
|
735
|
+
$[8] = header.column.id;
|
|
736
|
+
$[9] = sorting;
|
|
737
|
+
$[10] = sort;
|
|
738
|
+
$[11] = t1;
|
|
739
|
+
} else {
|
|
740
|
+
sort = $[10];
|
|
741
|
+
t1 = $[11];
|
|
742
|
+
}
|
|
743
|
+
const icon = t1;
|
|
744
|
+
const t2 = icon !== void 0 && icon !== null;
|
|
745
|
+
let t3;
|
|
746
|
+
if ($[12] !== className) {
|
|
747
|
+
t3 = clsx(data_table_module_default.sortIcon, className);
|
|
748
|
+
$[12] = className;
|
|
749
|
+
$[13] = t3;
|
|
750
|
+
} else t3 = $[13];
|
|
751
|
+
let t4;
|
|
752
|
+
if ($[14] !== icon || $[15] !== props || $[16] !== sort || $[17] !== t3) {
|
|
753
|
+
t4 = {
|
|
754
|
+
"aria-hidden": true,
|
|
755
|
+
...props,
|
|
756
|
+
"data-sort": sort,
|
|
757
|
+
className: t3,
|
|
758
|
+
children: icon
|
|
759
|
+
};
|
|
760
|
+
$[14] = icon;
|
|
761
|
+
$[15] = props;
|
|
762
|
+
$[16] = sort;
|
|
763
|
+
$[17] = t3;
|
|
764
|
+
$[18] = t4;
|
|
765
|
+
} else t4 = $[18];
|
|
766
|
+
let t5;
|
|
767
|
+
if ($[19] !== ref || $[20] !== render || $[21] !== t2 || $[22] !== t4) {
|
|
768
|
+
t5 = {
|
|
769
|
+
defaultTagName: "span",
|
|
770
|
+
render,
|
|
771
|
+
ref,
|
|
772
|
+
enabled: t2,
|
|
773
|
+
props: t4
|
|
774
|
+
};
|
|
775
|
+
$[19] = ref;
|
|
776
|
+
$[20] = render;
|
|
777
|
+
$[21] = t2;
|
|
778
|
+
$[22] = t4;
|
|
779
|
+
$[23] = t5;
|
|
780
|
+
} else t5 = $[23];
|
|
781
|
+
return useRender(t5);
|
|
741
782
|
};
|
|
742
783
|
/** The body: the page's `Row`s, the `PlaceholderRows` or a `StateRow`. */
|
|
743
784
|
var Body = (t0) => {
|
|
@@ -1179,4 +1220,4 @@ function _temp(column) {
|
|
|
1179
1220
|
function _temp2(column_0) {
|
|
1180
1221
|
return `${column_0.id}:${column_0.columnDef.meta?.sticky}`;
|
|
1181
1222
|
}
|
|
1182
|
-
export { Body, Cell, ErrorMessage, Frame, Head, HeaderCell, HeaderRow, LoadingCaption, PlaceholderRows, RefreshFailed, Row, Scroller, SortButton, StaleOverlay, StateRow, SubRow, Table, useDataTableView };
|
|
1223
|
+
export { Body, Cell, ErrorMessage, Frame, Head, HeaderCell, HeaderRow, LoadingCaption, PlaceholderRows, RefreshFailed, Row, Scroller, SortButton, SortIcon, StaleOverlay, StateRow, SubRow, Table, useDataTableView };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
1
2
|
import type { ColumnDef } from "@tanstack/react-table";
|
|
2
|
-
import { type ReactNode } from "react";
|
|
3
|
+
import { type ComponentPropsWithRef, type ReactElement, type ReactNode } from "react";
|
|
3
4
|
import type { DataTableColumnMeta, DataTableFeatures } from "./table-features.ts";
|
|
4
5
|
export type SelectionColumnOptions = Readonly<{
|
|
5
6
|
sticky?: DataTableColumnMeta["sticky"];
|
|
@@ -24,6 +25,86 @@ export type SelectionColumnOptions = Readonly<{
|
|
|
24
25
|
* ];
|
|
25
26
|
*/
|
|
26
27
|
export declare const selectionColumn: <TRow extends Record<string, unknown>>({ sticky, selectPageLabel, selectRowLabel, checkIcon, indeterminateIcon, }: SelectionColumnOptions) => ColumnDef<DataTableFeatures, TRow>;
|
|
28
|
+
export type DataTableSelectionBarRootProps = useRender.ComponentProps<"div"> & Readonly<{
|
|
29
|
+
/** How many rows match, selected or not. */
|
|
30
|
+
totalRows: number;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* The bar above a selectable table, holding the selection for the parts inside
|
|
34
|
+
* it and marked `data-selected` while any row is. It sits in a container that
|
|
35
|
+
* lets it wrap where it is narrow.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <DataTable.SelectionBar.Root totalRows={30}>…</DataTable.SelectionBar.Root>
|
|
39
|
+
*/
|
|
40
|
+
declare const SelectionBarRoot: ({ totalRows, render, className, ref, ...props }: DataTableSelectionBarRootProps) => ReactNode;
|
|
41
|
+
export type DataTableSelectionBarSummaryProps = Omit<useRender.ComponentProps<"span">, "children"> & Readonly<{
|
|
42
|
+
/** What the bar says while nothing is selected, such as "30 invoices". */
|
|
43
|
+
total?: ReactNode;
|
|
44
|
+
/** How many of the matching rows are selected, such as "3 of 30 selected". */
|
|
45
|
+
countLabel: (selected: number, total: number) => string;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* What the bar shows, hidden from assistive tech: the total while nothing is
|
|
49
|
+
* selected, crossing over to the selected count, at the width of the longest
|
|
50
|
+
* count.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* <DataTable.SelectionBar.Summary total="30 invoices" countLabel={(n, total) => `${n} of ${total} selected`} />
|
|
54
|
+
*/
|
|
55
|
+
declare const SelectionBarSummary: ({ total, countLabel, render, className, ref, ...props }: DataTableSelectionBarSummaryProps) => ReactElement;
|
|
56
|
+
export type DataTableSelectionBarStatusProps = DataTableSelectionBarSummaryProps;
|
|
57
|
+
/**
|
|
58
|
+
* The hidden live region that announces the total while nothing is selected,
|
|
59
|
+
* and the selected count once something is.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* <DataTable.SelectionBar.Status total="30 invoices" countLabel={(n, total) => `${n} of ${total} selected`} />
|
|
63
|
+
*/
|
|
64
|
+
declare const SelectionBarStatus: ({ total, countLabel, render, className, ref, ...props }: DataTableSelectionBarStatusProps) => ReactElement;
|
|
65
|
+
export type DataTableSelectionBarActionsProps = useRender.ComponentProps<"div">;
|
|
66
|
+
/**
|
|
67
|
+
* The row of actions on the selection, `Clear`, `SelectAll` and `Bulk`, out of
|
|
68
|
+
* reach while nothing is selected.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* <DataTable.SelectionBar.Actions>
|
|
72
|
+
* <DataTable.SelectionBar.Clear render={<Button variant="tertiary">Clear selection</Button>} />
|
|
73
|
+
* </DataTable.SelectionBar.Actions>
|
|
74
|
+
*/
|
|
75
|
+
declare const SelectionBarActions: ({ render, className, ref, ...props }: DataTableSelectionBarActionsProps) => ReactElement;
|
|
76
|
+
/** The props of a selection bar button part: the button's own, but the click, which the part owns. */
|
|
77
|
+
type SelectionButtonProps = Omit<ComponentPropsWithRef<"button">, "onClick" | "type" | "children"> & Readonly<{
|
|
78
|
+
/** The button to render, such as `<Button variant="tertiary">Clear selection</Button>`. */
|
|
79
|
+
render: useRender.RenderProp;
|
|
80
|
+
}>;
|
|
81
|
+
export type DataTableSelectionBarClearProps = SelectionButtonProps;
|
|
82
|
+
/**
|
|
83
|
+
* The button that clears the selection and returns focus to the bar. It
|
|
84
|
+
* renders whichever button it is given.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* <DataTable.SelectionBar.Clear render={<Button variant="tertiary">Clear selection</Button>} />
|
|
88
|
+
*/
|
|
89
|
+
declare const SelectionBarClear: ({ render, ref, ...props }: DataTableSelectionBarClearProps) => ReactElement;
|
|
90
|
+
export type DataTableSelectionBarSelectAllProps = SelectionButtonProps;
|
|
91
|
+
/**
|
|
92
|
+
* The offer to select every matching row, fading in while some but not all are
|
|
93
|
+
* selected, then handing focus to `Clear`. It renders whichever button it is
|
|
94
|
+
* given.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* <DataTable.SelectionBar.SelectAll render={<Button variant="tertiary">Select all 30</Button>} />
|
|
98
|
+
*/
|
|
99
|
+
declare const SelectionBarSelectAll: ({ render, className, ref, ...props }: DataTableSelectionBarSelectAllProps) => ReactElement | null;
|
|
100
|
+
export type DataTableSelectionBarBulkProps = useRender.ComponentProps<"div">;
|
|
101
|
+
/**
|
|
102
|
+
* The caller's bulk actions for the selection, at the end of the `Actions`.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* <DataTable.SelectionBar.Bulk><Button>Export</Button></DataTable.SelectionBar.Bulk>
|
|
106
|
+
*/
|
|
107
|
+
declare const SelectionBarBulk: ({ render, className, ref, ...props }: DataTableSelectionBarBulkProps) => ReactElement;
|
|
27
108
|
export type DataTableSelectionBarProps = Readonly<{
|
|
28
109
|
/** What the bar says while nothing is selected, such as "30 invoices". */
|
|
29
110
|
total?: ReactNode;
|
|
@@ -38,9 +119,30 @@ export type DataTableSelectionBarProps = Readonly<{
|
|
|
38
119
|
children?: ReactNode;
|
|
39
120
|
className?: string;
|
|
40
121
|
}>;
|
|
122
|
+
declare const SelectionBarPrefab: ({ total, totalRows, countLabel, clearLabel, selectAllLabel, children, className, }: DataTableSelectionBarProps) => ReactNode;
|
|
123
|
+
/** The parts of a selection bar, hanging off its prefab. */
|
|
124
|
+
export type DataTableSelectionBarParts = typeof SelectionBarPrefab & Readonly<{
|
|
125
|
+
Root: typeof SelectionBarRoot;
|
|
126
|
+
Summary: typeof SelectionBarSummary;
|
|
127
|
+
Status: typeof SelectionBarStatus;
|
|
128
|
+
Actions: typeof SelectionBarActions;
|
|
129
|
+
Clear: typeof SelectionBarClear;
|
|
130
|
+
SelectAll: typeof SelectionBarSelectAll;
|
|
131
|
+
Bulk: typeof SelectionBarBulk;
|
|
132
|
+
}>;
|
|
41
133
|
/**
|
|
42
134
|
* The bar above a selectable table: the total while nothing is selected, then
|
|
43
135
|
* the selected count, a clear button, the offer to select every matching row,
|
|
44
|
-
* and the caller's bulk actions.
|
|
136
|
+
* and the caller's bulk actions. Its parts compose another bar.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* <DataTable.SelectionBar
|
|
140
|
+
* totalRows={30}
|
|
141
|
+
* total="30 invoices"
|
|
142
|
+
* countLabel={(n, total) => `${n} of ${total} selected`}
|
|
143
|
+
* clearLabel="Clear selection"
|
|
144
|
+
* selectAllLabel={total => `Select all ${total}`}
|
|
145
|
+
* />
|
|
45
146
|
*/
|
|
46
|
-
export declare const DataTableSelectionBar:
|
|
147
|
+
export declare const DataTableSelectionBar: DataTableSelectionBarParts;
|
|
148
|
+
export {};
|