@nxgt/material 3.101.0 → 3.104.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/CHANGELOG.md +82 -0
- package/README.md +37 -5
- package/dist/{alert-dialog-DYzxchiS.js → alert-dialog-CK_47jfm.js} +1 -1
- package/dist/{async-slice-drJyPvuM.js → async-slice-1ZNMiwyJ.js} +1 -1
- package/dist/{bubble-input-CQwVSoU3.js → bubble-input-BxI1WmNs.js} +17 -5
- package/dist/{button-GeIsUekU.js → button-YfEMZbRO.js} +2 -2
- package/dist/{calculator-BS4PAm6l.js → calculator-BmYZId4c.js} +261 -460
- package/dist/calculator-field.js +7 -7
- package/dist/{calculator-segment-CEdwE24M.js → calculator-segment-DJ08DJ-n.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +819 -764
- package/dist/{chip-BdEtFQ85.js → chip-DPj6e-3v.js} +2 -2
- package/dist/{code-editor-BByXZOGy.js → code-editor-CZg3nLZO.js} +178 -177
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-CSZX5zxD.js → code-language-items-Nq1iOGId.js} +14 -5
- package/dist/components/ui/actions/action-card/action-card-tile.css +47 -0
- package/dist/components/ui/display/chip/chip-soft.css +27 -2
- package/dist/components/ui/display/code/code-moonlight.css +10 -10
- package/dist/components/ui/primitives/collapsible/collapsible.css +9 -0
- package/dist/{components-DQ4MljCr.js → components-B2wrH_W0.js} +19302 -18583
- package/dist/components.js +38 -37
- package/dist/{conversion-variant-DTQqAyDt.js → conversion-variant-C-LPx5ek.js} +5 -5
- package/dist/{currency-field-Dnju7ss2.js → currency-field-DnsRIA80.js} +24 -23
- package/dist/{dialog-5_2__tu8.js → dialog-BKBsDGFc.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-FdGC5kIP.js → dropdown-menu-QMDbRidH.js} +1 -1
- package/dist/editor.js +9 -9
- package/dist/{empty-state-BoepPG5v.js → empty-state-BLIJ6znY.js} +1 -1
- package/dist/{field-blur-DkiZOVNV.js → field-blur-DMJwPLsg.js} +9 -9
- package/dist/field-blur-context-3rKussBQ.js +29 -0
- package/dist/{financial-variant-BhqJp5C-.js → financial-variant-Ws0Jp01H.js} +5 -5
- package/dist/{hooks-DjcbJZiO.js → hooks-C3vkQmzh.js} +106 -61
- package/dist/hooks.js +3 -3
- package/dist/{hover-card-CmHJeBeY.js → hover-card-Df649U6I.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-LGUPQh_c.js → icon-badge-Cma1qOOJ.js} +1 -1
- package/dist/{icon-button-BSVpO1jP.js → icon-button-CpKxV264.js} +1 -1
- package/dist/key-layout-D2goCDkD.js +31 -0
- package/dist/keypad.js +551 -0
- package/dist/label-DR-zZyGQ.js +47 -0
- package/dist/lib/components/ui/actions/index.d.ts +1 -0
- package/dist/lib/components/ui/actions/product-tile/index.d.ts +1 -0
- package/dist/lib/components/ui/actions/product-tile/product-tile-link.d.ts +16 -0
- package/dist/lib/components/ui/actions/product-tile/product-tile.d.ts +41 -0
- package/dist/lib/components/ui/collections/data-table/data-table-density.d.ts +1 -1
- package/dist/lib/components/ui/collections/data-table/partials/data-table-scroll-region.d.ts +4 -1
- package/dist/lib/components/ui/collections/data-table/partials/layouts/data-table-list-bar.d.ts +6 -3
- package/dist/lib/components/ui/collections/data-table/partials/layouts/list-bar-in-row.d.ts +2 -1
- package/dist/lib/components/ui/collections/data-table/types.d.ts +11 -8
- package/dist/lib/components/ui/collections/data-table/virtual-option.d.ts +9 -3
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +2 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-passed-through.d.ts +1 -0
- package/dist/lib/components/ui/collections/server-table/types.d.ts +1 -1
- package/dist/lib/components/ui/display/chip/chip.variants.d.ts +5 -4
- package/dist/lib/components/ui/display/code/code-block-parts.d.ts +1 -1
- package/dist/lib/components/ui/display/code/code-block.d.ts +4 -1
- package/dist/lib/components/ui/display/code/languages.d.ts +2 -0
- package/dist/lib/components/ui/display/code/moonlight-tokens.d.ts +10 -10
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-props.d.ts +73 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.d.ts +12 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +5 -61
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-footer.d.ts +12 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-phrase.d.ts +26 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/use-confirm-action.d.ts +1 -1
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/index.d.ts +1 -0
- package/dist/lib/components/ui/fields/quantity-field/types.d.ts +1 -1
- package/dist/lib/components/ui/fields/quantity-stepper/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper-model.d.ts +9 -0
- package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper-value.d.ts +15 -0
- package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper.d.ts +9 -0
- package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper.types.d.ts +35 -0
- package/dist/lib/components/ui/fields/quantity-stepper/use-quantity-stepper.d.ts +28 -0
- package/dist/lib/components/ui/layout/index.d.ts +1 -0
- package/dist/lib/components/ui/layout/pane-layout/pane-layout.d.ts +8 -3
- package/dist/lib/components/ui/layout/pane-layout/partials/pane-layout-classes.d.ts +2 -2
- package/dist/lib/components/ui/layout/pane-layout/partials/pane-layout-context.d.ts +9 -0
- package/dist/lib/components/ui/layout/pane-layout/partials/use-pane-layout-state.d.ts +7 -2
- package/dist/lib/components/ui/layout/panel-card/index.d.ts +1 -0
- package/dist/lib/components/ui/layout/panel-card/panel-card.d.ts +23 -0
- package/dist/lib/components/ui/primitives/collapsible/collapsible.d.ts +9 -1
- package/dist/lib/components/ui/primitives/tabs/partials/tabs-list.d.ts +6 -1
- package/dist/lib/components/ui/primitives/tabs/tabs-classes.d.ts +1 -0
- package/dist/lib/components/ui/selection/chip-group-field/chip-group-field.d.ts +8 -0
- package/dist/lib/components/ui/selection/chip-group-field/chip-group-field.types.d.ts +6 -0
- package/dist/lib/components/ui/selection/chip-group-field/partials/chip-group-reasons.d.ts +10 -0
- package/dist/lib/components/ui/selection/chip-group-field/partials/use-chip-rail.d.ts +12 -0
- package/dist/lib/components/ui/selection/choice-group/choice-group-root.d.ts +5 -2
- package/dist/lib/components/ui/selection/index.d.ts +1 -0
- package/dist/lib/components/ui/selection/status-menu/index.d.ts +3 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-confirm.d.ts +12 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-icon.d.ts +6 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-items.d.ts +18 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-menu-list.d.ts +14 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-sheet-row.d.ts +11 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-sheet.d.ts +21 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-trigger.d.ts +18 -0
- package/dist/lib/components/ui/selection/status-menu/status-menu-data.d.ts +12 -0
- package/dist/lib/components/ui/selection/status-menu/status-menu-form-field.d.ts +20 -0
- package/dist/lib/components/ui/selection/status-menu/status-menu.d.ts +13 -0
- package/dist/lib/components/ui/selection/status-menu/types.d.ts +76 -0
- package/dist/lib/components/ui/selection/status-menu/use-status-change.d.ts +18 -0
- package/dist/lib/components/ui/selection/status-menu/use-status-menu.d.ts +30 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +1 -5
- package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +3 -49
- package/dist/lib/components/ui/widgets/keypad/cash-model.d.ts +16 -0
- package/dist/lib/components/ui/widgets/keypad/index.d.ts +5 -0
- package/dist/lib/components/ui/widgets/keypad/key-layout.d.ts +56 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-binding.d.ts +32 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-cash.d.ts +28 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-display.d.ts +11 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-entry.d.ts +39 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-grid.d.ts +27 -0
- package/dist/lib/components/ui/widgets/{calculator/partials/calculator-key.d.ts → keypad/keypad-key.d.ts} +6 -3
- package/dist/lib/components/ui/widgets/keypad/keypad-layout.d.ts +19 -0
- package/dist/lib/components/ui/widgets/{calculator/partials → keypad}/keypad-navigation.d.ts +1 -1
- package/dist/lib/components/ui/widgets/keypad/keypad.d.ts +9 -0
- package/dist/lib/components/ui/widgets/keypad/keypad.types.d.ts +91 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-cash.d.ts +14 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-keyboard.d.ts +7 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-number.d.ts +10 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-quantity.d.ts +16 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-value.d.ts +17 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad.d.ts +23 -0
- package/dist/lib/components/ui/widgets/native-charts/core/label-placement.d.ts +25 -0
- package/dist/lib/components/ui/widgets/native-charts/core/reference-geometry.d.ts +3 -2
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/use-barcode-scanner.d.ts +39 -0
- package/dist/lib/i18n/resources/en/en.d.ts +28 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +30 -2
- package/dist/lib/i18n/resources/fr/fr.d.ts +28 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +30 -2
- package/dist/lib/i18n/resources/resources.d.ts +56 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/keypad/index.d.ts +20 -0
- package/dist/lib/print/output/csv.d.ts +37 -0
- package/dist/lib/print/output/index.d.ts +1 -0
- package/dist/lib.js +1 -1
- package/dist/main.js +54 -53
- package/dist/map.js +9 -9
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-DGlU_xii.js → percent-field-sAq7BaxN.js} +15 -14
- package/dist/{picker-surface-CGhqNR8a.js → picker-surface--6E-nvpU.js} +4 -4
- package/dist/{popover-ZxL7ktKk.js → popover-bEB8I_-w.js} +1 -1
- package/dist/{pos-types-BQ0QpYMp.js → pos-types-Cpdc4E33.js} +1 -1
- package/dist/{pos-variant-CKy8h_5i.js → pos-variant-ClMGu59I.js} +25 -25
- package/dist/print.js +146 -127
- package/dist/{programmer-variant-CbHstE28.js → programmer-variant-ChzgyA7x.js} +30 -30
- package/dist/{public-D-tdOz4b.js → public-BY8N5NDT.js} +9 -9
- package/dist/{rich-code-block-CTPj1LuD.js → rich-code-block-D2GiWuqD.js} +18 -18
- package/dist/{scientific-variant-B8U9h3II.js → scientific-variant-31_93gcZ.js} +8 -8
- package/dist/{sortable-provider-CSoWE7Ce.js → sortable-provider-DGiVn72t.js} +2 -2
- package/dist/{spinner-ffuwBXHl.js → spinner-CEVomQ5K.js} +1 -1
- package/dist/standard-layout-DTr9yy8Z.js +48 -0
- package/dist/{tabs-JgRq6ZJx.js → tabs-B8MXBbPW.js} +14 -14
- package/dist/{text-field-DURkIP-v.js → text-field-DN88qD0Q.js} +16 -15
- package/dist/theme-picker.js +13 -13
- package/dist/{theme-toggle-n_Zg7JAA.js → theme-toggle-C7pnu1Xh.js} +1 -1
- package/dist/{toolbar-items-IANZdcw4.js → toolbar-items-BDfoh8QB.js} +4 -4
- package/dist/{translate-material-CMHUH5Ha.js → translate-material-s_lxIV43.js} +1 -1
- package/dist/{translator-9zA-Um3W.js → translator-Cgql9srO.js} +56 -4
- package/dist/use-calculator-keyboard-DysnFK8m.js +222 -0
- package/dist/{use-chat-composer-BoIN7RCA.js → use-chat-composer-xCcp9fVc.js} +2250 -2195
- package/dist/{use-heading-spy-Ciw9GBHL.js → use-heading-spy-FIZlf9qj.js} +235 -154
- package/dist/{use-material-translation-CLNaMhUf.js → use-material-translation-xNzbSVgS.js} +1 -1
- package/dist/{use-return-focus-DWhbTGVe.js → use-return-focus-CW9KkDkp.js} +1 -1
- package/docs/README.md +2 -1
- package/docs/components/README.md +2 -0
- package/docs/components/buttons-and-actions.md +81 -2
- package/docs/components/data-display.md +6 -3
- package/docs/components/data-table-filter-and-lists.md +19 -6
- package/docs/components/feedback-and-status.md +20 -0
- package/docs/components/form-fields.md +60 -7
- package/docs/components/navigation-and-layout.md +48 -2
- package/docs/components/primitives.md +44 -2
- package/docs/components/rich-widgets.md +28 -0
- package/docs/components/selection-and-choice.md +176 -1
- package/docs/guides/calculator.md +1 -1
- package/docs/guides/cards-and-tiles.md +31 -24
- package/docs/guides/csp.md +4 -3
- package/docs/guides/data-grid.md +5 -4
- package/docs/guides/field-look-refined.md +2 -2
- package/docs/guides/forms.md +1 -0
- package/docs/guides/helpers.md +49 -0
- package/docs/guides/keypad.md +233 -0
- package/docs/guides/printing.md +51 -1
- package/docs/previews/buttons-actions-producttile.webp +0 -0
- package/docs/previews/data-display-codeblock.webp +0 -0
- package/docs/previews/data-display-codegroup.webp +0 -0
- package/docs/previews/data-display-jsonviewer.webp +0 -0
- package/docs/previews/form-fields-quantitystepper.webp +0 -0
- package/docs/previews/navigation-layout-panelcard.webp +0 -0
- package/docs/previews/rich-widgets-keypad.webp +0 -0
- package/docs/previews/selection-choice-statusmenu.webp +0 -0
- package/docs/roadmap.md +21 -0
- package/docs/troubleshooting.md +68 -4
- package/lib/components/ui/actions/action-card/action-card-tile.css +47 -0
- package/lib/components/ui/display/chip/chip-soft.css +27 -2
- package/lib/components/ui/display/code/code-moonlight.css +10 -10
- package/lib/components/ui/primitives/collapsible/collapsible.css +9 -0
- package/lib/components/ui/widgets/calculator/calculator-keys.css +3 -0
- package/lib/components/ui/widgets/calculator/calculator.css +118 -0
- package/package.json +7 -2
- package/dist/field-blur-context-BLGgf_3z.js +0 -73
- package/dist/key-layout-cR79xfGE.js +0 -38
- package/dist/standard-layout-BuSRr3TY.js +0 -40
package/dist/lib/components/ui/collections/data-table/partials/layouts/data-table-list-bar.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { RefObject } from 'react';
|
|
|
3
3
|
import { DataTableTable } from '../../types.js';
|
|
4
4
|
/** Whether the table has a `select` column ("Select all on this page"). */
|
|
5
5
|
export declare const isSelectable: <TData extends RowData>(table: DataTableTable<TData>) => boolean;
|
|
6
|
-
/** Whether the cards have a list bar: a `select` column, or a sortable column
|
|
7
|
-
|
|
6
|
+
/** Whether the cards have a list bar: a `select` column, or a sortable column
|
|
7
|
+
* whose sort control is shown (`showSort`). */
|
|
8
|
+
export declare const hasListBar: <TData extends RowData>(table: DataTableTable<TData>, showSort?: boolean) => boolean;
|
|
8
9
|
/**
|
|
9
10
|
* The list's header row, where a table's header row would be (the cards'
|
|
10
11
|
* `showHeader`): "Select all on this page" and, beside it, "N rows selected"
|
|
@@ -24,8 +25,10 @@ export declare const hasListBar: <TData extends RowData>(table: DataTableTable<T
|
|
|
24
25
|
* count replaces in place while rows are selected, and the sort to its sort
|
|
25
26
|
* slot (#1719). The names and the behaviour are the same.
|
|
26
27
|
*/
|
|
27
|
-
export declare function DataTableListBar<TData extends RowData>({ table, rootRef, }: {
|
|
28
|
+
export declare function DataTableListBar<TData extends RowData>({ table, rootRef, showSort, }: {
|
|
28
29
|
table: DataTableTable<TData>;
|
|
30
|
+
/** `false`: no sort control (`DataTable`'s `showSort`). */
|
|
31
|
+
showSort?: boolean;
|
|
29
32
|
/** The list's root, where the focus goes once "Clear selection" is gone. */
|
|
30
33
|
rootRef?: RefObject<HTMLElement | null>;
|
|
31
34
|
}): import("react").JSX.Element;
|
|
@@ -8,11 +8,12 @@ import { DataTableTable } from '../../types.js';
|
|
|
8
8
|
* replaces in place, and "Clear selection") goes to the host's start slot,
|
|
9
9
|
* the sort to its sort slot.
|
|
10
10
|
*/
|
|
11
|
-
export declare function ListBarInRow<TData extends RowData>({ table, slots, count, countText, selectAll, clear, }: {
|
|
11
|
+
export declare function ListBarInRow<TData extends RowData>({ table, slots, count, countText, selectAll, clear, showSort, }: {
|
|
12
12
|
table: DataTableTable<TData>;
|
|
13
13
|
slots: DataTableListSlots;
|
|
14
14
|
count: number;
|
|
15
15
|
countText: string;
|
|
16
16
|
selectAll: (visibleLabel?: string) => ReactNode;
|
|
17
17
|
clear: ReactNode;
|
|
18
|
+
showSort?: boolean;
|
|
18
19
|
}): import("react").JSX.Element;
|
|
@@ -37,19 +37,22 @@ export interface DataTableProps<TData extends RowData> extends DataTableEmptyPro
|
|
|
37
37
|
/** The header row (column names, sorting, "Select all"). Shown at every
|
|
38
38
|
* width; `false` hides it. */
|
|
39
39
|
showHeader?: boolean;
|
|
40
|
+
/** `false`: `cards` and `tiles` drop their sort control (phone too); columns
|
|
41
|
+
* stay sortable, header sorting unchanged. Default: shown. */
|
|
42
|
+
showSort?: boolean;
|
|
40
43
|
/** Caps the table's height (`400`, `'60vh'`); the rows then scroll inside
|
|
41
44
|
* it. Default: none — the table is as tall as its rows, and the page
|
|
42
45
|
* scrolls. */
|
|
43
46
|
maxHeight?: number | string;
|
|
47
|
+
/** `maxHeight` as a Tailwind class (`'max-h-[28rem]'`): no inline `style`,
|
|
48
|
+
* server included (strict CSP). Wins over `maxHeight`. */
|
|
49
|
+
maxHeightClassName?: string;
|
|
44
50
|
/** Renders only the rows in view (and a few around them), for long
|
|
45
|
-
* lists. Needs `maxHeight
|
|
46
|
-
* development.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* widths with `meta.className`. `renderExpandedRow` is ignored while it
|
|
51
|
-
* is on. The server renders the first `ssrRows` rows, with no inline
|
|
52
|
-
* `style`. */
|
|
51
|
+
* lists. Needs `maxHeight` or `maxHeightClassName`, else it is off and
|
|
52
|
+
* warns in development. Client mode: every filtered and sorted row in one
|
|
53
|
+
* list, no paging; `manual`: the rows given. Adds `aria-rowcount`,
|
|
54
|
+
* `aria-rowindex` and `table-fixed` (widths in `meta.className`).
|
|
55
|
+
* `renderExpandedRow` is ignored. The server renders `ssrRows` rows. */
|
|
53
56
|
virtual?: DataTableVirtual;
|
|
54
57
|
/** The name of the scroll region the table becomes while it overflows.
|
|
55
58
|
* Default: "Scrollable table" (`material.table.labels.scroll-region`). */
|
|
@@ -7,9 +7,15 @@ export type DataTableVirtualOptions = {
|
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* `DataTable`'s `virtual`, or `undefined` when it is off. It needs
|
|
10
|
-
* `maxHeight` (the rows scroll inside the table, not
|
|
11
|
-
* it stays off and warns. `renderExpandedRow` is ignored while it is on —
|
|
10
|
+
* `maxHeight` or `maxHeightClassName` (the rows scroll inside the table, not
|
|
11
|
+
* the page): without either, it stays off and warns. `renderExpandedRow` is ignored while it is on —
|
|
12
12
|
* an expanded row changes its row's height under the virtualizer — and
|
|
13
13
|
* warns too.
|
|
14
14
|
*/
|
|
15
|
-
export declare function resolveVirtual(virtual: DataTableVirtual | undefined,
|
|
15
|
+
export declare function resolveVirtual(virtual: DataTableVirtual | undefined, capped: boolean, expandable: boolean): DataTableVirtualOptions | undefined;
|
|
16
|
+
/** Whether the table's height is capped, by `maxHeight` or by
|
|
17
|
+
* `maxHeightClassName`: the rows then scroll inside it. */
|
|
18
|
+
export declare function isCapped(props: {
|
|
19
|
+
maxHeight?: number | string;
|
|
20
|
+
maxHeightClassName?: string;
|
|
21
|
+
}): boolean;
|
|
@@ -2326,6 +2326,7 @@ export declare function useFilterFieldConfig({ field, value, onChange, error, di
|
|
|
2326
2326
|
label?: import('react').ReactNode;
|
|
2327
2327
|
columns?: import('../../selection/index.js').ChipGroupColumns | undefined;
|
|
2328
2328
|
content?: string | undefined | undefined;
|
|
2329
|
+
overflow?: "wrap" | "scroll" | undefined;
|
|
2329
2330
|
size?: import('../../display/index.js').ChipSize | undefined;
|
|
2330
2331
|
translate?: "yes" | "no" | undefined | undefined;
|
|
2331
2332
|
color?: string | undefined | undefined;
|
|
@@ -2623,6 +2624,7 @@ export declare function useFilterFieldConfig({ field, value, onChange, error, di
|
|
|
2623
2624
|
label?: import('react').ReactNode;
|
|
2624
2625
|
columns?: import('../../selection/index.js').ChipGroupColumns | undefined;
|
|
2625
2626
|
content?: string | undefined | undefined;
|
|
2627
|
+
overflow?: "wrap" | "scroll" | undefined;
|
|
2626
2628
|
size?: import('../../display/index.js').ChipSize | undefined;
|
|
2627
2629
|
translate?: "yes" | "no" | undefined | undefined;
|
|
2628
2630
|
color?: string | undefined | undefined;
|
package/dist/lib/components/ui/collections/server-table/partials/server-table-passed-through.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare function passedThrough<T extends RowData>(props: ServerTableProps
|
|
|
19
19
|
expandedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
20
20
|
}, T, any>[];
|
|
21
21
|
maxHeight: string | number | undefined;
|
|
22
|
+
maxHeightClassName: string | undefined;
|
|
22
23
|
scrollLabel: string | undefined;
|
|
23
24
|
showViewOptions: boolean | undefined;
|
|
24
25
|
renderExpandedRow: ((row: import('@tanstack/table-core').Row<{
|
|
@@ -15,7 +15,7 @@ export type ServerTableSelection = {
|
|
|
15
15
|
deselect(ids: readonly string[]): void;
|
|
16
16
|
};
|
|
17
17
|
/** The `DataTable` props `ServerTable` passes through as they are. */
|
|
18
|
-
export type PassedThrough<T extends RowData> = Pick<DataTableProps<T>, 'columns' | 'maxHeight' | 'scrollLabel' | 'showViewOptions' | 'renderExpandedRow' | 'options' | 'loading' | 'loadingRows' | 'getRowHref' | 'onRowClick' | 'linkComponent' | 'density' | 'layout' | 'cardDensity' | 'renderCard' | 'renderTile' | 'focusRef' | 'enableRowSelection' | 'rowSelectionDisabledReason'>;
|
|
18
|
+
export type PassedThrough<T extends RowData> = Pick<DataTableProps<T>, 'columns' | 'maxHeight' | 'maxHeightClassName' | 'scrollLabel' | 'showViewOptions' | 'renderExpandedRow' | 'options' | 'loading' | 'loadingRows' | 'getRowHref' | 'onRowClick' | 'linkComponent' | 'density' | 'layout' | 'cardDensity' | 'renderCard' | 'renderTile' | 'focusRef' | 'enableRowSelection' | 'rowSelectionDisabledReason'>;
|
|
19
19
|
export type ServerTableProps<T extends RowData> = PassedThrough<T> & ServerTablePagingProps & {
|
|
20
20
|
/** The URL's search params, as the router reads them. */
|
|
21
21
|
params: URLSearchParams;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Tone } from '../../tones.js';
|
|
1
2
|
/**
|
|
2
3
|
* A `Chip`'s look. `outlined` (the default) is a neutral hairline pill;
|
|
3
4
|
* `tonal` and `filled` a soft tonal fill; `tag` a compact tag led by a
|
|
@@ -10,8 +11,8 @@ export type ChipVariant = 'outlined' | 'tonal' | 'filled' | 'tag' | 'dashed'
|
|
|
10
11
|
| 'ghost'
|
|
11
12
|
/** @deprecated A Button variant: draws the hairline look, as `outlined`. */
|
|
12
13
|
| 'link';
|
|
13
|
-
/** A `Chip`'s tone: `default` (and nothing) is neutral. */
|
|
14
|
-
export type ChipColor = 'default' |
|
|
14
|
+
/** A `Chip`'s tone: `default` (and nothing) is neutral; else a tone `Badge` takes, an app's own included. */
|
|
15
|
+
export type ChipColor = 'default' | Tone;
|
|
15
16
|
/**
|
|
16
17
|
* A `Chip`'s density: `default` 28px, `sm` 24px (the 24px target kept), `lg`
|
|
17
18
|
* 44px (the touch target, drawn at every pointer).
|
|
@@ -21,7 +22,7 @@ export type ChipLook = 'hairline' | 'soft' | 'tag';
|
|
|
21
22
|
/** The look a variant draws. */
|
|
22
23
|
export declare function chipLook(variant: ChipVariant | null | undefined): ChipLook;
|
|
23
24
|
/** The tone a colour draws: no colour, and `default`, are neutral. */
|
|
24
|
-
export declare function chipTone(color: ChipColor | null | undefined):
|
|
25
|
+
export declare function chipTone(color: ChipColor | null | undefined): Tone;
|
|
25
26
|
/** The data attributes a chip's root carries, and the look and tone they name. */
|
|
26
27
|
export declare function chipAttributes({ variant, size, color, selected, }: {
|
|
27
28
|
variant: ChipVariant;
|
|
@@ -30,6 +31,6 @@ export declare function chipAttributes({ variant, size, color, selected, }: {
|
|
|
30
31
|
selected?: boolean;
|
|
31
32
|
}): {
|
|
32
33
|
look: ChipLook;
|
|
33
|
-
tone:
|
|
34
|
+
tone: Tone;
|
|
34
35
|
attributes: Record<string, string | undefined>;
|
|
35
36
|
};
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
/** The bar over the code: the file name, the language and the copy button. */
|
|
3
3
|
export declare function CodeBlockHeader({ filename, label, code, }: {
|
|
4
4
|
filename: ReactNode;
|
|
5
|
-
label:
|
|
5
|
+
label: ReactNode | false;
|
|
6
6
|
code: string;
|
|
7
7
|
}): import("react").JSX.Element;
|
|
8
8
|
/** The scrollable code: the line numbers beside the highlighted lines. */
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type CodeBlockProps = {
|
|
3
3
|
code: string;
|
|
4
|
+
/** A language id or alias; `text` shows the code as is, without highlighting. */
|
|
4
5
|
language?: string;
|
|
6
|
+
/** Replaces the language label; `false` hides it. */
|
|
7
|
+
label?: ReactNode | false;
|
|
5
8
|
filename?: ReactNode;
|
|
6
9
|
showLineNumbers?: boolean;
|
|
7
10
|
highlightLines?: number[];
|
|
@@ -9,4 +12,4 @@ export type CodeBlockProps = {
|
|
|
9
12
|
scheme?: 'dark' | 'light';
|
|
10
13
|
className?: string;
|
|
11
14
|
};
|
|
12
|
-
export declare function CodeBlock({ code, language, filename, showLineNumbers, highlightLines, maxHeight, scheme, className, }: CodeBlockProps): import("react").JSX.Element;
|
|
15
|
+
export declare function CodeBlock({ code, language, label: labelProp, filename, showLineNumbers, highlightLines, maxHeight, scheme, className, }: CodeBlockProps): import("react").JSX.Element;
|
|
@@ -7,3 +7,5 @@ export declare const CODE_LANGUAGES: {
|
|
|
7
7
|
export declare function resolveCodeLanguage(value?: string): CodeLanguageId;
|
|
8
8
|
/** The language's name, or its id when the list does not know it. */
|
|
9
9
|
export declare function codeLanguageLabel(language: string): string;
|
|
10
|
+
/** `text`, `plaintext`, `plain` or `txt`: shown as is, without highlighting. */
|
|
11
|
+
export declare function isPlainTextLanguage(value?: string): boolean;
|
|
@@ -2,7 +2,7 @@ export declare const MOONLIGHT_DARK: {
|
|
|
2
2
|
readonly bg: "#222436";
|
|
3
3
|
readonly bgElevated: "#1e2030";
|
|
4
4
|
readonly fg: "#c8d3f5";
|
|
5
|
-
readonly comment: "#
|
|
5
|
+
readonly comment: "#8f9ad6";
|
|
6
6
|
readonly blue: "#82aaff";
|
|
7
7
|
readonly cyan: "#86e1fc";
|
|
8
8
|
readonly green: "#c3e88d";
|
|
@@ -17,15 +17,15 @@ export declare const MOONLIGHT_DAY: {
|
|
|
17
17
|
readonly bg: "#f5f7ff";
|
|
18
18
|
readonly bgElevated: "#eceff8";
|
|
19
19
|
readonly fg: "#383a51";
|
|
20
|
-
readonly comment: "#
|
|
21
|
-
readonly blue: "#
|
|
22
|
-
readonly cyan: "#
|
|
23
|
-
readonly green: "#
|
|
24
|
-
readonly orange: "#
|
|
25
|
-
readonly yellow: "#
|
|
26
|
-
readonly red: "#
|
|
27
|
-
readonly magenta: "#
|
|
28
|
-
readonly pink: "#
|
|
20
|
+
readonly comment: "#4356ba";
|
|
21
|
+
readonly blue: "#2a56ca";
|
|
22
|
+
readonly cyan: "#08658a";
|
|
23
|
+
readonly green: "#2d6a4c";
|
|
24
|
+
readonly orange: "#a33f1c";
|
|
25
|
+
readonly yellow: "#765a00";
|
|
26
|
+
readonly red: "#ac3337";
|
|
27
|
+
readonly magenta: "#5d36f3";
|
|
28
|
+
readonly pink: "#924080";
|
|
29
29
|
readonly selection: "#d4daf0";
|
|
30
30
|
};
|
|
31
31
|
export type MoonlightTokens = {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonVariant } from '../../actions/button/button.js';
|
|
3
|
+
import { ConfirmRefusalContext } from './confirm-alert.js';
|
|
4
|
+
import { ConfirmPhraseMatch } from './confirm-dialog-rules.js';
|
|
5
|
+
export interface ConfirmDialogProps {
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* The text under the title. A string renders in a paragraph; any other node
|
|
11
|
+
* (several paragraphs, a list, a link) renders in a `div`, so block children
|
|
12
|
+
* are valid HTML. Either way it names the dialog (`aria-describedby`).
|
|
13
|
+
*/
|
|
14
|
+
description: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* A note under the description, for what the user should know before
|
|
17
|
+
* confirming (what else is affected, what cannot be undone). It is part of
|
|
18
|
+
* what describes the dialog.
|
|
19
|
+
*/
|
|
20
|
+
details?: ReactNode;
|
|
21
|
+
confirmLabel?: string;
|
|
22
|
+
cancelLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The variant of the Cancel button. Default `'tonal'`; `'outlined'` or
|
|
25
|
+
* `'ghost'` restores the earlier look.
|
|
26
|
+
*/
|
|
27
|
+
cancelVariant?: ButtonVariant;
|
|
28
|
+
/**
|
|
29
|
+
* Runs when the user confirms. The dialog stays open, with its buttons
|
|
30
|
+
* disabled, until the returned promise settles. It closes on success; on
|
|
31
|
+
* a throw or a rejection it stays open and shows the error's message, so
|
|
32
|
+
* the user can retry or cancel (or only cancel, with `lockOnRefusal`).
|
|
33
|
+
*/
|
|
34
|
+
onConfirm: () => void | Promise<void>;
|
|
35
|
+
variant?: 'default' | 'destructive';
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
/** Disables the confirm button, for example while an error of yours stands. */
|
|
38
|
+
confirmDisabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Disables the confirm button once `onConfirm` has refused (thrown), so a
|
|
41
|
+
* retry that cannot succeed is not invited. Cancel stays. It clears when the
|
|
42
|
+
* dialog reopens. Off by default: the refused action may be retried.
|
|
43
|
+
*/
|
|
44
|
+
lockOnRefusal?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Renders the refusal inside the dialog's error alert instead of the plain
|
|
47
|
+
* message, so it can carry a link (to the records that block a delete, for
|
|
48
|
+
* example). Receives the message, what `onConfirm` threw and `close()`. The alert keeps `role="alert"`.
|
|
49
|
+
* By default an `ActionRefusal` thrown by `onConfirm` shows its details and
|
|
50
|
+
* its action under the message; any other error shows its message.
|
|
51
|
+
*/
|
|
52
|
+
refusal?: (refusal: ConfirmRefusalContext) => ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Asks the user to type this text before Confirm enables, for a deletion
|
|
55
|
+
* worth a second thought. A field labelled "Type {phrase} to confirm"
|
|
56
|
+
* (translated, the phrase in code style) takes the focus on open and starts
|
|
57
|
+
* empty each time the dialog opens; paste is allowed. Enter in it confirms
|
|
58
|
+
* only once it matches. Unset or empty: no field.
|
|
59
|
+
*/
|
|
60
|
+
confirmPhrase?: string;
|
|
61
|
+
/**
|
|
62
|
+
* How the typed text is compared with `confirmPhrase`: `'exact'` (default),
|
|
63
|
+
* `'trim'` (spaces around the text ignored) or `'trim-case-insensitive'`.
|
|
64
|
+
*/
|
|
65
|
+
confirmPhraseMatch?: ConfirmPhraseMatch;
|
|
66
|
+
/**
|
|
67
|
+
* Called as the dialog closes, before the focus goes back to what opened
|
|
68
|
+
* it. `event.preventDefault()` places the focus yourself, for example
|
|
69
|
+
* `ctx.focusTrigger()` of a ServerTable bulk action, whose button a redraw
|
|
70
|
+
* may have replaced.
|
|
71
|
+
*/
|
|
72
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
73
|
+
}
|
|
@@ -15,3 +15,15 @@ export declare function confirmIsDisabled({ busy, confirmDisabled, lockOnRefusal
|
|
|
15
15
|
lockOnRefusal?: boolean;
|
|
16
16
|
error: string | null;
|
|
17
17
|
}): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* How the typed text is compared with `confirmPhrase`: `'exact'` (the
|
|
20
|
+
* default) character for character, `'trim'` ignoring spaces around the text,
|
|
21
|
+
* `'trim-case-insensitive'` ignoring those and the letter case.
|
|
22
|
+
*/
|
|
23
|
+
export type ConfirmPhraseMatch = 'exact' | 'trim' | 'trim-case-insensitive';
|
|
24
|
+
/**
|
|
25
|
+
* Whether the typed text satisfies the phrase. An empty phrase never asks for
|
|
26
|
+
* anything (always true); the phrase itself is trimmed the same way as the
|
|
27
|
+
* input in the `trim` modes.
|
|
28
|
+
*/
|
|
29
|
+
export declare function confirmPhraseMatches(typed: string, phrase: string, mode?: ConfirmPhraseMatch): boolean;
|
|
@@ -1,61 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type {
|
|
5
|
-
export
|
|
6
|
-
open: boolean;
|
|
7
|
-
onOpenChange: (open: boolean) => void;
|
|
8
|
-
title: string;
|
|
9
|
-
/**
|
|
10
|
-
* The text under the title. A string renders in a paragraph; any other node
|
|
11
|
-
* (several paragraphs, a list, a link) renders in a `div`, so block children
|
|
12
|
-
* are valid HTML. Either way it names the dialog (`aria-describedby`).
|
|
13
|
-
*/
|
|
14
|
-
description: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* A note under the description, for what the user should know before
|
|
17
|
-
* confirming (what else is affected, what cannot be undone). It is part of
|
|
18
|
-
* what describes the dialog.
|
|
19
|
-
*/
|
|
20
|
-
details?: ReactNode;
|
|
21
|
-
confirmLabel?: string;
|
|
22
|
-
cancelLabel?: string;
|
|
23
|
-
/**
|
|
24
|
-
* The variant of the Cancel button. Default `'tonal'`; `'outlined'` or
|
|
25
|
-
* `'ghost'` restores the earlier look.
|
|
26
|
-
*/
|
|
27
|
-
cancelVariant?: ButtonVariant;
|
|
28
|
-
/**
|
|
29
|
-
* Runs when the user confirms. The dialog stays open, with its buttons
|
|
30
|
-
* disabled, until the returned promise settles. It closes on success; on
|
|
31
|
-
* a throw or a rejection it stays open and shows the error's message, so
|
|
32
|
-
* the user can retry or cancel (or only cancel, with `lockOnRefusal`).
|
|
33
|
-
*/
|
|
34
|
-
onConfirm: () => void | Promise<void>;
|
|
35
|
-
variant?: 'default' | 'destructive';
|
|
36
|
-
loading?: boolean;
|
|
37
|
-
/** Disables the confirm button, for example while an error of yours stands. */
|
|
38
|
-
confirmDisabled?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Disables the confirm button once `onConfirm` has refused (thrown), so a
|
|
41
|
-
* retry that cannot succeed is not invited. Cancel stays. It clears when the
|
|
42
|
-
* dialog reopens. Off by default: the refused action may be retried.
|
|
43
|
-
*/
|
|
44
|
-
lockOnRefusal?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Renders the refusal inside the dialog's error alert instead of the plain
|
|
47
|
-
* message, so it can carry a link (to the records that block a delete, for
|
|
48
|
-
* example). Receives the message, what `onConfirm` threw and `close()`. The alert keeps `role="alert"`.
|
|
49
|
-
* By default an `ActionRefusal` thrown by `onConfirm` shows its details and
|
|
50
|
-
* its action under the message; any other error shows its message.
|
|
51
|
-
*/
|
|
52
|
-
refusal?: (refusal: ConfirmRefusalContext) => ReactNode;
|
|
53
|
-
/**
|
|
54
|
-
* Called as the dialog closes, before the focus goes back to what opened
|
|
55
|
-
* it. `event.preventDefault()` places the focus yourself, for example
|
|
56
|
-
* `ctx.focusTrigger()` of a ServerTable bulk action, whose button a redraw
|
|
57
|
-
* may have replaced.
|
|
58
|
-
*/
|
|
59
|
-
onCloseAutoFocus?: (event: Event) => void;
|
|
60
|
-
}
|
|
61
|
-
export declare function ConfirmDialog({ open, onOpenChange, title: titleProp, description: descriptionProp, details: detailsProp, confirmLabel: confirmLabelProp, cancelLabel: cancelLabelProp, cancelVariant, onConfirm, variant: variantProp, loading, confirmDisabled, lockOnRefusal, refusal, onCloseAutoFocus, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
1
|
+
import { ConfirmDialogProps } from './confirm-dialog-props.js';
|
|
2
|
+
export type { ConfirmRefusalContext } from './confirm-alert.js';
|
|
3
|
+
export type { ConfirmPhraseMatch } from './confirm-dialog-rules.js';
|
|
4
|
+
export type { ConfirmDialogProps };
|
|
5
|
+
export declare function ConfirmDialog(props: ConfirmDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { ButtonVariant } from '../../actions/button/button.js';
|
|
3
|
+
/** A confirm dialog's Cancel and Confirm buttons. */
|
|
4
|
+
export declare function ConfirmFooter({ variant, busy, disabled, cancelLabel, confirmLabel, cancelVariant, onConfirm, }: {
|
|
5
|
+
variant: 'default' | 'destructive';
|
|
6
|
+
busy: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
confirmLabel?: string;
|
|
10
|
+
cancelVariant?: ButtonVariant;
|
|
11
|
+
onConfirm: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { ConfirmPhraseMatch } from './confirm-dialog-rules.js';
|
|
3
|
+
/**
|
|
4
|
+
* The "type the value to confirm" field of a `ConfirmDialog`: a label that
|
|
5
|
+
* shows the phrase in code style, and an input that takes any paste. The
|
|
6
|
+
* dialog owns the value; Enter is handed back only while it matches.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ConfirmPhraseField({ phrase, value, onValueChange, onEnter, disabled, inputRef, }: {
|
|
9
|
+
phrase: string;
|
|
10
|
+
value: string;
|
|
11
|
+
onValueChange: (value: string) => void;
|
|
12
|
+
onEnter: () => void;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
inputRef: Ref<HTMLInputElement>;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* The typed text of a `ConfirmDialog`'s phrase field: it starts empty each
|
|
18
|
+
* time the dialog opens, `missing` says Confirm must wait, and `ref` is the
|
|
19
|
+
* input the dialog focuses on open.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useConfirmPhrase(open: boolean, phrase: string | undefined, match: ConfirmPhraseMatch): {
|
|
22
|
+
ref: import('react').RefObject<HTMLInputElement | null>;
|
|
23
|
+
typed: string;
|
|
24
|
+
setTyped: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
25
|
+
missing: boolean;
|
|
26
|
+
};
|
|
@@ -13,7 +13,7 @@ export declare function useConfirmAction({ open, onOpenChange, onConfirm, }: {
|
|
|
13
13
|
error: string | null;
|
|
14
14
|
cause: unknown;
|
|
15
15
|
handleOpenChange: (value: boolean) => void;
|
|
16
|
-
handleConfirm: (event: MouseEvent
|
|
16
|
+
handleConfirm: (event: Pick<MouseEvent, "preventDefault">) => Promise<void>;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* A ref for a modal's content that takes the focus while `pending`: the
|