@nxgt/material 3.86.2 → 3.87.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 +16 -0
- package/README.md +1 -0
- package/dist/{alert-dialog-DZnt8PYE.js → alert-dialog-DC_9MW49.js} +1 -1
- package/dist/{async-slice-D3OdV2BS.js → async-slice-C6XbESai.js} +1 -1
- package/dist/{button-MAL5an7L.js → button-BksHtogl.js} +1 -1
- package/dist/{calculator-C3a8YMwl.js → calculator-C_dTrMWE.js} +10 -10
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-BigMpjhn.js → calculator-segment-FOUl66f6.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-DKAKoNxq.js → chip-BWaC87zs.js} +2 -2
- package/dist/{code-editor-B6dFQSUJ.js → code-editor-ddbQ0pEc.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-CXEMiWoF.js → code-language-items-jRlQfjAm.js} +2 -2
- package/dist/components/components.css +2 -0
- package/dist/components/ui/collections/marking-list/marking-list.css +16 -0
- package/dist/components/ui/primitives/toggle-group/toggle-group-connected.css +1 -1
- package/dist/components/ui/primitives/toggle-group/toggle-group-segmented.css +1 -1
- package/dist/components/ui/primitives/toggle-group/toggle-group-separate.css +1 -1
- package/dist/components/ui/primitives/toggle-group/toggle-group.css +12 -1
- package/dist/{components-BTukNsPn.js → components-B5p3JKhQ.js} +15864 -15487
- package/dist/components.js +37 -37
- package/dist/{conversion-variant-BT5n4-jm.js → conversion-variant-Cauk0BMS.js} +3 -3
- package/dist/{currency-field-t41sFYg_.js → currency-field-Dy2e9kSr.js} +4 -4
- package/dist/{dialog-BjKiRXJg.js → dialog-DNDT81SC.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-IRFp4CH9.js → dropdown-menu-DtVC2xQW.js} +1 -1
- package/dist/editor.js +7 -7
- package/dist/{empty-state-C70prDDr.js → empty-state-Dfsp5UF4.js} +1 -1
- package/dist/{financial-variant-BIpzs8IL.js → financial-variant-0fJAMale.js} +5 -5
- package/dist/{hooks-CjO11MS7.js → hooks-kPRle6lM.js} +2 -2
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-cU_aJa18.js → hover-card-CsxW7S7D.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-D3KO6uEQ.js → icon-badge-8CPy2xAU.js} +1 -1
- package/dist/{icon-button-DrqNk1Ww.js → icon-button-caFcCpXV.js} +1 -1
- package/dist/lib/components/ui/collections/filter/sections/filter-sections-classes.d.ts +4 -3
- package/dist/lib/components/ui/collections/index.d.ts +1 -0
- package/dist/lib/components/ui/collections/marking-list/index.d.ts +2 -0
- package/dist/lib/components/ui/collections/marking-list/marking-list.d.ts +11 -0
- package/dist/lib/components/ui/collections/marking-list/marking-list.utils.d.ts +18 -0
- package/dist/lib/components/ui/collections/marking-list/partials/marking-row-item.d.ts +16 -0
- package/dist/lib/components/ui/collections/marking-list/partials/marking-segments.d.ts +20 -0
- package/dist/lib/components/ui/collections/marking-list/partials/marking-set-remaining.d.ts +11 -0
- package/dist/lib/components/ui/collections/marking-list/partials/marking-tally.d.ts +14 -0
- package/dist/lib/components/ui/collections/marking-list/types.d.ts +74 -0
- package/dist/lib/components/ui/collections/marking-list/use-marking-expanded.d.ts +9 -0
- package/dist/lib/components/ui/collections/marking-list/use-marking-focus.d.ts +22 -0
- package/dist/lib/components/ui/collections/marking-list/use-marking-handlers.d.ts +11 -0
- package/dist/lib/components/ui/collections/marking-list/use-tally-speech.d.ts +16 -0
- package/dist/lib/components/ui/collections/page-footer/page-footer.d.ts +5 -1
- package/dist/lib/components/ui/collections/server-table/index.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/server-table-paging.d.ts +8 -0
- package/dist/lib/components/ui/collections/server-table/types-paging.d.ts +6 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/i18n/resources/en/en.d.ts +10 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +10 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +10 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +10 -0
- package/dist/lib/i18n/resources/resources.d.ts +20 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +53 -53
- package/dist/map.js +7 -7
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-D47IlaPF.js → percent-field-B6mJfY_p.js} +1 -1
- package/dist/{picker-surface-Cg4V4-E0.js → picker-surface-CVAW0t-r.js} +4 -4
- package/dist/{popover-Dzk4-l9U.js → popover-DhRPftzZ.js} +1 -1
- package/dist/{pos-types-JOXMY4Y2.js → pos-types-QcM9WTr0.js} +1 -1
- package/dist/{pos-variant-B2mS8bMB.js → pos-variant-BeON2e_Q.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-C_Tl0P4_.js → programmer-variant-3cEMiII7.js} +2 -2
- package/dist/{public-ByAsqBOf.js → public-DezkDXv3.js} +10 -10
- package/dist/{rich-code-block-CJAfqk6b.js → rich-code-block-DloPqrFQ.js} +5 -5
- package/dist/{scientific-variant-CskM4MLV.js → scientific-variant-0Fq8HLiY.js} +2 -2
- package/dist/{sortable-provider-ICS_vkLA.js → sortable-provider-OB35mdNh.js} +2 -2
- package/dist/{spinner-CweqX5A9.js → spinner-CngjH5-n.js} +1 -1
- package/dist/{tabs-95Y2LmnV.js → tabs-C0CPqX5U.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-WAFkncYx.js → theme-toggle-BfXRbCwj.js} +1 -1
- package/dist/{toolbar-items-BsgzHSNf.js → toolbar-items-BU5_H3UA.js} +4 -4
- package/dist/{translate-material-DTIAPmlU.js → translate-material-B1wzg7uX.js} +1 -1
- package/dist/{translator-BRZNhsy5.js → translator-BwUYrek9.js} +20 -0
- package/dist/{use-chat-composer-CleSUh_y.js → use-chat-composer-Bsc1gCRQ.js} +15 -15
- package/dist/{use-heading-spy-D8WbHJuK.js → use-heading-spy-BpeWvZ2y.js} +4 -4
- package/dist/{use-material-translation-CCy1Me0h.js → use-material-translation-BDVGF7-Z.js} +1 -1
- package/dist/{use-return-focus-BA8G1qVU.js → use-return-focus-BttT8j1o.js} +1 -1
- package/docs/components/data-table-filter-and-lists.md +103 -0
- package/docs/components/primitives.md +4 -1
- package/docs/guides/theming.md +1 -1
- package/docs/previews/data-table-filter-lists-markinglist.webp +0 -0
- package/docs/roadmap.md +7 -2
- package/lib/components/components.css +2 -0
- package/lib/components/ui/collections/marking-list/marking-list.css +16 -0
- package/lib/components/ui/primitives/toggle-group/toggle-group-connected.css +1 -1
- package/lib/components/ui/primitives/toggle-group/toggle-group-segmented.css +1 -1
- package/lib/components/ui/primitives/toggle-group/toggle-group-separate.css +1 -1
- package/lib/components/ui/primitives/toggle-group/toggle-group.css +12 -1
- package/package.json +2 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Tone } from '../../tones.js';
|
|
3
|
+
/** One choice of the segmented control every row shares: "Present", "Absent". */
|
|
4
|
+
export type MarkingChoice = {
|
|
5
|
+
/** Stable id, the value a row holds and the callbacks hand back. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** The visible label. */
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The label as plain text, for the tally and the accessible names when
|
|
11
|
+
* `label` is not a string. Defaults to `label` when that is a string.
|
|
12
|
+
*/
|
|
13
|
+
text?: string;
|
|
14
|
+
/** Colours the chosen segment and its tally figure (`data-tone`). */
|
|
15
|
+
tone?: Tone;
|
|
16
|
+
/** A leading icon; decorative, the label names the choice. */
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
/** One person of the list. */
|
|
20
|
+
export type MarkingRow = {
|
|
21
|
+
/** Stable id, the key of `value` and of the callbacks. */
|
|
22
|
+
id: string;
|
|
23
|
+
/** The person's name. It names the row's choice group. */
|
|
24
|
+
name: string;
|
|
25
|
+
/** A line under the name: a class, a number, a status. */
|
|
26
|
+
description?: ReactNode;
|
|
27
|
+
/** Before the name: an `Avatar`. */
|
|
28
|
+
leading?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Locks the row: its choice is read-only (the segments stay focusable, with
|
|
31
|
+
* `aria-disabled`, and each one is described by this reason) and the reason is
|
|
32
|
+
* shown under the name ("Excused by the office"). A value it holds still counts
|
|
33
|
+
* in the tally; a locked row with none counts as `locked`, not `unmarked`.
|
|
34
|
+
*/
|
|
35
|
+
locked?: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
/** The choice of each row, by row id; a missing id or `null` is unmarked. */
|
|
38
|
+
export type MarkingValue = Record<string, string | null | undefined>;
|
|
39
|
+
export type MarkingListProps = Omit<ComponentProps<'div'>, 'children' | 'onChange'> & {
|
|
40
|
+
/** The choice set, shared by every row, in display order. */
|
|
41
|
+
choices: readonly MarkingChoice[];
|
|
42
|
+
/** The people, in display order. */
|
|
43
|
+
rows: readonly MarkingRow[];
|
|
44
|
+
/** The choice of each row (controlled). */
|
|
45
|
+
value: MarkingValue;
|
|
46
|
+
/** A segment was pressed; `null` when the chosen segment is pressed again. */
|
|
47
|
+
onValueChange: (rowId: string, choiceId: string | null) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Shows the "Set remaining to" buttons. Pressing one hands the choice and the
|
|
50
|
+
* ids of the unmarked, unlocked rows; apply it in one update.
|
|
51
|
+
*/
|
|
52
|
+
onSetRemaining?: (choiceId: string, rowIds: string[]) => void;
|
|
53
|
+
/** Names the list ("Roll call, class 6A"). Required for assistive technology. */
|
|
54
|
+
label: string;
|
|
55
|
+
/** Shows the live tally above the rows. Default `true`. */
|
|
56
|
+
tally?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The detail of a row, shown on demand: with it every row gets an expand
|
|
59
|
+
* button, reached with Right past the last segment. Called only while the row
|
|
60
|
+
* is expanded. Keep it stable (`useCallback`) so closed rows do not re-render.
|
|
61
|
+
*/
|
|
62
|
+
renderDetail?: (row: MarkingRow) => ReactNode;
|
|
63
|
+
/** Ids of the rows whose detail is open at first (uncontrolled). */
|
|
64
|
+
defaultExpanded?: readonly string[];
|
|
65
|
+
/** The ids of the open rows (controlled); pair it with `onExpandedChange`. */
|
|
66
|
+
expanded?: readonly string[];
|
|
67
|
+
/** The open rows changed. */
|
|
68
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
69
|
+
/**
|
|
70
|
+
* The choices "Set remaining to" offers, by id. Default: all of them. Offer
|
|
71
|
+
* "Present" alone when the others are not a sensible default.
|
|
72
|
+
*/
|
|
73
|
+
setRemainingChoices?: readonly string[];
|
|
74
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Which rows are open: controlled by `expanded`, else its own state from `initial`. */
|
|
2
|
+
export declare function useMarkingExpanded({ expanded, initial, onChange, }: {
|
|
3
|
+
expanded?: readonly string[];
|
|
4
|
+
initial?: readonly string[];
|
|
5
|
+
onChange?: (ids: string[]) => void;
|
|
6
|
+
}): {
|
|
7
|
+
ids: readonly string[];
|
|
8
|
+
toggle: (rowId: string) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Roving focus over every row's cells: the segments, then the expand button
|
|
4
|
+
* when the list has details. One tab stop for the whole list. Left and Right
|
|
5
|
+
* move across a row (Right past the last segment reaches the expand button),
|
|
6
|
+
* Up and Down to the same cell of the previous or next row, stopping at the
|
|
7
|
+
* first and the last. Home and End go to a row's first and last segment.
|
|
8
|
+
* Locked rows stay on the path: their segments are focusable. Space and Enter
|
|
9
|
+
* press the cell (a button), so moving never marks anyone.
|
|
10
|
+
*
|
|
11
|
+
* `cols` is the number of cells in a row, `segments` how many of them are
|
|
12
|
+
* choices. A stop whose column no longer exists (the choices shrank) falls
|
|
13
|
+
* back to the last one, so the list keeps exactly one tab stop.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMarkingFocus(rows: readonly {
|
|
16
|
+
id: string;
|
|
17
|
+
}[], cols: number, segments: number, chosenCol: (rowId: string) => number): {
|
|
18
|
+
/** The tab stop's column in a row, `-1` for every other row. */
|
|
19
|
+
tabbableCol: (rowId: string) => number;
|
|
20
|
+
onFocusCell: (row: string, col: number) => void;
|
|
21
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MarkingBulk } from './use-tally-speech.js';
|
|
2
|
+
/**
|
|
3
|
+
* The list's callbacks as stable functions, so a parent's new closure does not
|
|
4
|
+
* re-render closed rows, and the record of the last "Set remaining to" the
|
|
5
|
+
* tally says once.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMarkingHandlers(onValueChange: (rowId: string, choiceId: string | null) => void, onSetRemaining?: (choiceId: string, rowIds: string[]) => void): {
|
|
8
|
+
onPress: (rowId: string, choiceId: string | null) => void;
|
|
9
|
+
setRemaining: ((choiceId: string, rowIds: string[]) => void) | undefined;
|
|
10
|
+
bulk: import('react').RefObject<MarkingBulk | null>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { MarkingTally } from './marking-list.utils.js';
|
|
3
|
+
import { MarkingChoice } from './types.js';
|
|
4
|
+
/** A "Set remaining to" the list just applied, recorded for the tally to say. */
|
|
5
|
+
export type MarkingBulk = {
|
|
6
|
+
choiceId: string;
|
|
7
|
+
count: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* What the tally says aloud, apart from what it shows. A "Set remaining to"
|
|
11
|
+
* is said at once ("33 marked Present"); only that, so loading a saved
|
|
12
|
+
* register stays silent. Single taps are summed up once the marking pauses
|
|
13
|
+
* ("Unmarked: 3"), compared with the last count spoken, so a change in
|
|
14
|
+
* another row within the pause does not lose it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useTallySpeech(choices: readonly MarkingChoice[], tally: MarkingTally, bulk: RefObject<MarkingBulk | null>): string | null;
|
|
@@ -20,6 +20,10 @@ export type PageFooterProps = {
|
|
|
20
20
|
pageHref?: (params: URLSearchParams) => string;
|
|
21
21
|
/** The cursor's search param names. Default `after` and `trail`. */
|
|
22
22
|
pagingNames?: Partial<PagingNames>;
|
|
23
|
+
/** How many earlier pages' cursors the URL keeps. Past it the oldest are
|
|
24
|
+
* dropped into a counted cut mark (`trail=~3,c4,c5`): the range stays exact,
|
|
25
|
+
* and « Previous » from the cut goes to the first page. Default `20`. */
|
|
26
|
+
maxTrail?: number;
|
|
23
27
|
/** `'icon'`: icon-only Previous / Next with a tooltip, named "Previous
|
|
24
28
|
* page" / "Next page". Default `'labelled'`. */
|
|
25
29
|
pageControls?: 'labelled' | 'icon';
|
|
@@ -42,4 +46,4 @@ export type PageFooterProps = {
|
|
|
42
46
|
* `ServerTable` draws. Renders nothing for an empty result. Without a
|
|
43
47
|
* `totalCount` (a cursor feed with no total) it is the Previous / Next alone.
|
|
44
48
|
*/
|
|
45
|
-
export declare function PageFooter({ pageInfo, totalCount, params, pageSize, count, pageHref, pagingNames, pageControls, live, disabled, hideOnSinglePage, linkComponent, className, ...props }: PageFooterProps): import("react").JSX.Element | null;
|
|
49
|
+
export declare function PageFooter({ pageInfo, totalCount, params, pageSize, count, pageHref, pagingNames, maxTrail, pageControls, live, disabled, hideOnSinglePage, linkComponent, className, ...props }: PageFooterProps): import("react").JSX.Element | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { defineFilterModel, effectiveConditions, type FilterCodecOptions, type FilterCondition, type FilterFieldError, type FilterFieldErrors, type FilterLockedCondition, type FilterModel, type FilterQuery, type FilterSplitErrors, parseFilterQuery, serializeFilterQuery, splitFilterErrors, } from '@nxgt/material-core/filter';
|
|
2
|
-
export { type CursorConnection, createSorting, FIRST_PAGE, firstPage, isFiltered, isNewQuery, nextPage, type PageCursor, type PagingNames, pagingNames, paramsFromQuery, previousPage, queryFromParams, queryKey, type RouterQuery, readCursor, type ServerPagination, type ServerPaginationOptions, type SortingOptions, serverPagination, type TableFilterBinding, type TableFilterOptions, type TableSort, type TableSorting, tableFilters, withoutFilters, } from '@nxgt/material-core/table-url';
|
|
2
|
+
export { CUT_MARK, type CursorConnection, createSorting, FIRST_PAGE, firstPage, isFiltered, isNewQuery, nextPage, type PageCursor, type PagingNames, type PagingOptions, pageIndex, pageOffset, pagingNames, paramsFromQuery, previousPage, queryFromParams, queryKey, type RouterQuery, readCursor, type ServerPagination, type ServerPaginationOptions, type SortingOptions, serverPagination, type TableFilterBinding, type TableFilterOptions, type TableSort, type TableSorting, tableFilters, withoutFilters, } from '@nxgt/material-core/table-url';
|
|
3
3
|
export * from './server-table.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { ServerTableProps } from './types.js';
|
|
3
|
+
/** The footer's place (offset, Previous, Next, the trail capped by `maxTrail`)
|
|
4
|
+
* and the first page's href, the way back from an empty page. */
|
|
5
|
+
export declare function serverTablePaging<T extends RowData>(props: ServerTableProps<T>, params: URLSearchParams, heading: URLSearchParams | string): {
|
|
6
|
+
place: import('@nxgt/material-core/table-url').ServerPagination;
|
|
7
|
+
firstPageHref: string;
|
|
8
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { PagingNames } from '@nxgt/material-core/table-url';
|
|
2
|
+
/** The cursors `ServerTable` and `PageFooter` keep in the URL by default. */
|
|
3
|
+
export declare const DEFAULT_MAX_TRAIL = 20;
|
|
2
4
|
/** The footer and paging props of `ServerTable`, apart from the page's data. */
|
|
3
5
|
export type ServerTablePagingProps = {
|
|
4
6
|
/** `'paging'` (default): Previous / Next over the URL's cursor. `'load-more'`: `LoadMoreFooter` ("Showing N of M" from `rows.length` and `totalCount`, the load button while `pageInfo.hasNextPage`, a failed alert with a retry) in place of them, for a list that grows: the page keeps the loaded rows in `rows` and fetches the next itself (`onLoadMore`), so the cursor params are not used. */
|
|
@@ -24,4 +26,8 @@ export type ServerTablePagingProps = {
|
|
|
24
26
|
pageHref?: (params: URLSearchParams) => string;
|
|
25
27
|
/** The cursor's search param names. Default `after` and `trail`. */
|
|
26
28
|
pagingNames?: Partial<PagingNames>;
|
|
29
|
+
/** How many earlier pages' cursors the URL keeps. Past it the oldest are
|
|
30
|
+
* dropped into a counted cut mark (`trail=~3,c4,c5`): the range stays exact,
|
|
31
|
+
* and « Previous » from the cut goes to the first page. Default `20`. */
|
|
32
|
+
maxTrail?: number;
|
|
27
33
|
};
|