@nxgt/material 3.92.0 → 3.93.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 +40 -0
- package/README.md +2 -2
- package/dist/{alert-dialog-Bz5PlYKp.js → alert-dialog-D37eph4I.js} +1 -1
- package/dist/{async-slice-veSVxKqt.js → async-slice-BSqwhAj-.js} +1 -1
- package/dist/{button-a3tH3pq4.js → button-CG9SBAT-.js} +1 -1
- package/dist/{calculator-BtuKV3PK.js → calculator-YD3I3y-I.js} +10 -10
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-CyB9IhEq.js → calculator-segment-Cjec9zi7.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-BwGvGx_S.js → chip-BbUSBl3i.js} +2 -2
- package/dist/{code-editor-BLkmEoCi.js → code-editor-ZEM7AAcs.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-DhAC_tCs.js → code-language-items-CAuHPrHd.js} +2 -2
- package/dist/components/components.css +1 -0
- package/dist/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
- package/dist/{components-DX4aHtgP.js → components-CuFTrmGy.js} +19654 -19043
- package/dist/components.js +38 -38
- package/dist/{conversion-variant-C4t7aH9d.js → conversion-variant-DmEtTCSP.js} +3 -3
- package/dist/{currency-field-D0UQb5pn.js → currency-field-CabGnVO9.js} +5 -5
- package/dist/{dialog-vQMypIOm.js → dialog-Jhpx6ulb.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-B2ctUFti.js → dropdown-menu-nl0Q3tQ2.js} +1 -1
- package/dist/editor.js +7 -7
- package/dist/{empty-state-Bs44jnWk.js → empty-state-mrJuqph3.js} +1 -1
- package/dist/{financial-variant-B5iZ3pYf.js → financial-variant-P8gFA9aI.js} +5 -5
- package/dist/{hooks-CJtRFDYD.js → hooks-CjSpziWf.js} +2 -2
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-B8PYUsv_.js → hover-card-BNb1M8ij.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-YT98b2Vx.js → icon-badge-CVMHwdFm.js} +1 -1
- package/dist/{icon-button-BylI02aX.js → icon-button-Ch0PThsa.js} +1 -1
- package/dist/{input-group-CiayHfBN.js → input-group-CPMSQcBx.js} +1 -1
- package/dist/lib/components/ui/collections/day-grouped-list/index.d.ts +6 -0
- package/dist/lib/components/ui/display/entity-header/entity-metadata.d.ts +2 -0
- package/dist/lib/components/ui/display/event-chip/event-chip-badges.d.ts +21 -0
- package/dist/lib/components/ui/display/event-chip/event-chip-content.d.ts +5 -7
- package/dist/lib/components/ui/display/event-chip/event-chip-title.d.ts +9 -0
- package/dist/lib/components/ui/display/event-chip/event-chip.classes.d.ts +9 -0
- package/dist/lib/components/ui/display/event-chip/event-chip.d.ts +15 -2
- package/dist/lib/components/ui/fields/attributes/attribute-values-form-field-set/attribute-values-form-field-set.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/choice-list-control.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/choice-list-field.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/choice-list-focus.d.ts +6 -3
- package/dist/lib/components/ui/fields/choice-list/choice-list-form-field.d.ts +2 -2
- package/dist/lib/components/ui/fields/choice-list/choice-list-names.d.ts +2 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list.utils.d.ts +2 -0
- package/dist/lib/components/ui/fields/choice-list/index.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/partials/choice-row.d.ts +9 -3
- package/dist/lib/components/ui/fields/choice-list/types.d.ts +20 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/layout/record-page/record-details.d.ts +6 -6
- package/dist/lib/components/ui/widgets/event-calendar/backdrop.types.d.ts +75 -0
- package/dist/lib/components/ui/widgets/event-calendar/chrome.types.d.ts +12 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-context.d.ts +8 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-events.utils.d.ts +3 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-shell.d.ts +1 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.backdrop.d.ts +38 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.badges.d.ts +14 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.labels.d.ts +14 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.lanes.d.ts +9 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.read-only.d.ts +57 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.resources.d.ts +6 -1
- package/dist/lib/components/ui/widgets/event-calendar/index.d.ts +2 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/all-day-bars.d.ts +14 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bands.d.ts +11 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bar.d.ts +11 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-cell.d.ts +13 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-row.d.ts +8 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-badge.d.ts +16 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-cell.d.ts +4 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-parts.d.ts +12 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/resource-header.d.ts +2 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/span-event.d.ts +3 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-header-day.d.ts +3 -6
- package/dist/lib/components/ui/widgets/event-calendar/partials/zone-corner.d.ts +10 -2
- package/dist/lib/components/ui/widgets/event-calendar/template.types.d.ts +7 -2
- package/dist/lib/components/ui/widgets/event-calendar/types.d.ts +25 -13
- package/dist/lib/components/ui/widgets/event-calendar/use-backdrops.d.ts +8 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-badges.d.ts +5 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +3 -2
- package/dist/lib/components/ui/widgets/event-calendar/use-month-day.d.ts +6 -1
- package/dist/lib/components/ui/widgets/event-calendar/use-time-column.d.ts +1 -0
- package/dist/lib/i18n/resources/en/en.d.ts +7 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +7 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +7 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +7 -0
- package/dist/lib/i18n/resources/resources.d.ts +14 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +54 -54
- package/dist/map.js +7 -7
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-DuoZieW9.js → percent-field-TWyupyr_.js} +1 -1
- package/dist/{picker-surface-BKzM6TWN.js → picker-surface-CoNsDWxX.js} +4 -4
- package/dist/{popover-ukgGm5B6.js → popover-BA1U82Wk.js} +1 -1
- package/dist/{pos-types-BNXbls3v.js → pos-types-BQqv-kb6.js} +1 -1
- package/dist/{pos-variant-CZ3OZtPq.js → pos-variant-D043n5y8.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-DVu-pYhB.js → programmer-variant-jneMqtLs.js} +2 -2
- package/dist/{public-DtXwn8bx.js → public-DgrbdeZj.js} +9 -9
- package/dist/{rich-code-block-DUaSLxLT.js → rich-code-block-CGNjHawR.js} +5 -5
- package/dist/{scientific-variant-Ku9feVN1.js → scientific-variant-1L7brNNT.js} +2 -2
- package/dist/{sortable-provider-DIb1HgZA.js → sortable-provider-DZLV_svg.js} +2 -2
- package/dist/{spinner-CHWFXCfd.js → spinner-CQqRWxAW.js} +1 -1
- package/dist/{tabs-BideU0Rb.js → tabs-DQTx3C8e.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-DUQTEe1y.js → theme-toggle-3NQ3VmJH.js} +1 -1
- package/dist/{toolbar-items-azkXY5w2.js → toolbar-items-BYCdJGUf.js} +4 -4
- package/dist/{translate-material-d8Q5K5a_.js → translate-material-jxfcGlD5.js} +1 -1
- package/dist/{translator-CxyFsfO0.js → translator-6XuDmqUJ.js} +10 -0
- package/dist/{use-chat-composer-FACltVyX.js → use-chat-composer-1eb4I1kM.js} +16 -16
- package/dist/{use-heading-spy-DHd5TScW.js → use-heading-spy-CzPujlKr.js} +4 -4
- package/dist/{use-material-translation-DA5ECZfA.js → use-material-translation-BUPqNmAg.js} +1 -1
- package/dist/{use-return-focus-CAAvJ6p5.js → use-return-focus-B_enQxp5.js} +1 -1
- package/docs/README.md +1 -0
- package/docs/components/data-display.md +6 -1
- package/docs/components/data-table-filter-and-lists.md +3 -0
- package/docs/components/form-fields.md +38 -5
- package/docs/components/navigation-and-layout.md +1 -0
- package/docs/components/rich-widgets.md +58 -5
- package/docs/guides/event-calendar.md +163 -0
- package/docs/guides/forms.md +2 -1
- package/docs/guides/i18n.md +2 -0
- package/docs/previews/data-display-eventchip.webp +0 -0
- package/docs/previews/rich-widgets-eventcalendar.webp +0 -0
- package/docs/roadmap.md +12 -0
- package/lib/components/components.css +1 -0
- package/lib/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
- package/package.json +1 -1
|
@@ -10,4 +10,4 @@ export type { ChoiceListFieldProps } from './types.js';
|
|
|
10
10
|
* new one, with one call of `onAssignIds` (default: `onChange`) on mount.
|
|
11
11
|
* `ChoiceListFormField` wires it to react-hook-form.
|
|
12
12
|
*/
|
|
13
|
-
export declare function ChoiceListField({ value, onChange, onAssignIds, selection, rowLabel, reorderable, rowErrors, disabled, onBlur, ref, ...props }: ChoiceListFieldProps): import("react").JSX.Element;
|
|
13
|
+
export declare function ChoiceListField({ value, onChange, onAssignIds, selection, rowLabel, reorderable, rowErrors, rowDetail, rowDetailErrors, disabled, onBlur, ref, ...props }: ChoiceListFieldProps): import("react").JSX.Element;
|
|
@@ -10,6 +10,9 @@ export type ArrayError = {
|
|
|
10
10
|
text?: {
|
|
11
11
|
message?: string;
|
|
12
12
|
};
|
|
13
|
+
explanation?: {
|
|
14
|
+
message?: string;
|
|
15
|
+
};
|
|
13
16
|
} | undefined;
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
@@ -43,7 +46,7 @@ export declare function useRefusedFocus(error: () => ArrayError | undefined, bla
|
|
|
43
46
|
};
|
|
44
47
|
/**
|
|
45
48
|
* The handle React Hook Form gets as the `ref` of a row path
|
|
46
|
-
* (`choices.<i>.text`): `setFocus` and `setError(…, { shouldFocus })` on that
|
|
47
|
-
* path call its `focus()`, which goes to the row's text input.
|
|
49
|
+
* (`choices.<i>.text`, or `.explanation`): `setFocus` and `setError(…, { shouldFocus })` on that
|
|
50
|
+
* path call its `focus()`, which goes to the row's text input (the detail textarea for `.explanation`).
|
|
48
51
|
*/
|
|
49
|
-
export declare function rowFocus(list: RefObject<Element | null>, position: number): FocusHandle;
|
|
52
|
+
export declare function rowFocus(list: RefObject<Element | null>, position: number, field?: 'text' | 'explanation'): FocusHandle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
2
|
import { ChoiceListFieldProps } from './types.js';
|
|
3
|
-
export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'onBlur'> & {
|
|
3
|
+
export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'rowDetailErrors' | 'onBlur'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The built-in rules ask for one marked row at least. `false` lets a list
|
|
6
6
|
* with none pass (a poll). Default true.
|
|
@@ -16,4 +16,4 @@ export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseController
|
|
|
16
16
|
* way: `choices.2.text` under row 3, `choices` under the list. Ids given on
|
|
17
17
|
* mount do not make the form dirty when a `FormProvider` is above.
|
|
18
18
|
*/
|
|
19
|
-
export declare function ChoiceListFormField<T extends FieldValues>({ control, name, min, selection, requireCorrect, rowLabel, disabled, ...props }: ChoiceListFormFieldProps<T>): import("react").JSX.Element;
|
|
19
|
+
export declare function ChoiceListFormField<T extends FieldValues>({ control, name, min, selection, requireCorrect, rowLabel, disabled, rowDetail, ...props }: ChoiceListFormFieldProps<T>): import("react").JSX.Element;
|
|
@@ -5,6 +5,8 @@ type Translate = ReturnType<typeof useMaterialTranslation>['t'];
|
|
|
5
5
|
export declare const defaultRowLabel: (t: Translate) => string;
|
|
6
6
|
/** A row's text field label: "Answer 2". */
|
|
7
7
|
export declare const textLabel: (label: string, position: number) => string;
|
|
8
|
+
/** A row's detail textarea label: "Explanation 2". */
|
|
9
|
+
export declare const detailLabel: (label: string | undefined, t: Translate, position: number) => string;
|
|
8
10
|
/** The visible word beside the mark. */
|
|
9
11
|
export declare const correctText: (t: Translate) => string;
|
|
10
12
|
/** The mark's accessible name, which starts with its visible word. */
|
|
@@ -12,6 +12,8 @@ export declare function setCorrect(rows: readonly ChoiceRow[], id: string, corre
|
|
|
12
12
|
/** The rows with one more at the end; in `single` it is marked when none is. */
|
|
13
13
|
export declare function addChoice(rows: readonly ChoiceRow[], selection: ChoiceListSelection): ChoiceRow[];
|
|
14
14
|
export declare function setText(rows: readonly ChoiceRow[], id: string, text: string): ChoiceRow[];
|
|
15
|
+
/** Sets a row's detail text, keeping its other fields. */
|
|
16
|
+
export declare function setExplanation(rows: readonly ChoiceRow[], id: string, explanation: string): ChoiceRow[];
|
|
15
17
|
export declare const removeAt: (rows: readonly ChoiceRow[], index: number) => ChoiceRow[];
|
|
16
18
|
export declare function moveRow(rows: readonly ChoiceRow[], from: number, to: number): ChoiceRow[];
|
|
17
19
|
export type ChoiceListIssue = 'too-few' | 'too-many' | 'none-correct' | 'blank';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ChoiceListSelection, ChoiceRow as Row } from '../types.js';
|
|
2
|
+
import { ChoiceListSelection, ChoiceRowDetail, ChoiceRow as Row } from '../types.js';
|
|
3
3
|
export type ChoiceRowProps = {
|
|
4
4
|
row: Row;
|
|
5
5
|
position: number;
|
|
@@ -7,6 +7,11 @@ export type ChoiceRowProps = {
|
|
|
7
7
|
selection: ChoiceListSelection;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
error?: ReactNode;
|
|
10
|
+
/** The detail textarea under the row; absent: none. */
|
|
11
|
+
detail?: ChoiceRowDetail & {
|
|
12
|
+
name: string;
|
|
13
|
+
error?: ReactNode;
|
|
14
|
+
};
|
|
10
15
|
names: {
|
|
11
16
|
text: (position: number) => string;
|
|
12
17
|
correctText: string;
|
|
@@ -14,6 +19,7 @@ export type ChoiceRowProps = {
|
|
|
14
19
|
};
|
|
15
20
|
onText: (text: string) => void;
|
|
16
21
|
onCorrect: (correct: boolean) => void;
|
|
22
|
+
onDetail?: (explanation: string) => void;
|
|
17
23
|
};
|
|
18
|
-
/** One row's fields: the answer's text, then its
|
|
19
|
-
export declare function ChoiceListRow({ row, position, radioName, selection, disabled, error, names, onText, onCorrect, }: ChoiceRowProps): import("react").JSX.Element;
|
|
24
|
+
/** One row's fields: the answer's text, its mark, then its detail when asked. */
|
|
25
|
+
export declare function ChoiceListRow({ row, position, radioName, selection, disabled, error, detail, names, onText, onCorrect, onDetail, }: ChoiceRowProps): import("react").JSX.Element;
|
|
@@ -6,6 +6,19 @@ export type ChoiceRow = {
|
|
|
6
6
|
id: string;
|
|
7
7
|
text: string;
|
|
8
8
|
correct: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A detail about the choice (why it is right or wrong), edited when the
|
|
11
|
+
* list has `rowDetail`. Absent until a user types in it.
|
|
12
|
+
*/
|
|
13
|
+
explanation?: string;
|
|
14
|
+
};
|
|
15
|
+
/** The optional detail textarea under each row (`ChoiceRow.explanation`). */
|
|
16
|
+
export type ChoiceRowDetail = {
|
|
17
|
+
/** The textarea's label, before the row's number. Default "Explanation", translated. */
|
|
18
|
+
label?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/** Limits the text and shows a counter. */
|
|
21
|
+
maxLength?: number;
|
|
9
22
|
};
|
|
10
23
|
/**
|
|
11
24
|
* `single` marks one row (radios; marking a row unmarks the others) and
|
|
@@ -35,6 +48,13 @@ export type ChoiceListFieldProps = Omit<ComponentProps<'div'>, 'children' | 'onC
|
|
|
35
48
|
error?: ReactNode;
|
|
36
49
|
/** An error per row, by id: `{ [row.id]: 'Enter the answer' }`. */
|
|
37
50
|
rowErrors?: Readonly<Record<string, ReactNode>>;
|
|
51
|
+
/**
|
|
52
|
+
* Adds a textarea under each row, stored as `ChoiceRow.explanation`
|
|
53
|
+
* (`true` for its defaults). Absent: no detail, rows unchanged.
|
|
54
|
+
*/
|
|
55
|
+
rowDetail?: boolean | ChoiceRowDetail;
|
|
56
|
+
/** An error per row's detail, by id. */
|
|
57
|
+
rowDetailErrors?: Readonly<Record<string, ReactNode>>;
|
|
38
58
|
/**
|
|
39
59
|
* Called when the focus leaves the whole list, for a field used alone;
|
|
40
60
|
* inside a `FieldBlur` the list's root is registered and this is not
|