@nxgt/material 3.68.0 → 3.71.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 +84 -0
- package/README.md +13 -9
- package/dist/{alert-dialog-BhARh_qC.js → alert-dialog-y2pbowVh.js} +1 -1
- package/dist/{async-slice-CHyRU5V3.js → async-slice-CGfWBOaV.js} +1 -1
- package/dist/{button-Du7fJ9i_.js → button-D54Hrjo0.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-BVB6UYl-.js → chip-B5MhXBfm.js} +2 -2
- package/dist/{code-editor-D-GBs2yu.js → code-editor-mULs4SL8.js} +5 -5
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-xrgq1Am0.js → code-language-items-BWDnqUqn.js} +2 -2
- package/dist/components/ui/collections/server-table/server-table-phone-row.css +6 -0
- package/dist/components/ui/display/code/code-moonlight.css +37 -0
- package/dist/{components-iNCh4A6M.js → components-B_taYVcd.js} +19740 -18682
- package/dist/components.js +28 -28
- package/dist/{dialog-DFY_nsqF.js → dialog-AjCYZ2Vz.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-B6Yh4XJu.js → dropdown-menu-LN60hu_3.js} +1 -1
- package/dist/editor.js +673 -673
- package/dist/{empty-state-DGtwE50c.js → empty-state-Bo8G8W8G.js} +2 -2
- package/dist/{field-blur-Br7ij-a1.js → field-blur-Cnd6FfCH.js} +1 -1
- package/dist/{field-blur-context-CucMAZLj.js → field-blur-context-bUFZj8iN.js} +1 -1
- package/dist/{hooks-CYQJkKGc.js → hooks-Dt4PkQiZ.js} +2 -2
- package/dist/hooks.js +3 -3
- package/dist/{hover-card-C2J0GwWf.js → hover-card-QtGnvsnc.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-LzO5K6Wu.js → icon-badge-DLbpCQIm.js} +3 -3
- package/dist/{icon-button-vLJ4YrEW.js → icon-button-C59DqL7L.js} +1 -1
- package/dist/lib/components/ui/actions/fab/fab-dock-inset.d.ts +29 -0
- package/dist/lib/components/ui/actions/fab/fab-dock.d.ts +6 -1
- package/dist/lib/components/ui/collections/data-table/select-checkbox.d.ts +3 -2
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +3 -3
- package/dist/lib/components/ui/collections/index.d.ts +1 -0
- package/dist/lib/components/ui/collections/record-actions-menu/index.d.ts +2 -0
- package/dist/lib/components/ui/collections/record-actions-menu/record-actions-dialogs.d.ts +15 -0
- package/dist/lib/components/ui/collections/record-actions-menu/record-actions-menu.d.ts +72 -0
- package/dist/lib/components/ui/collections/record-actions-menu/record-actions-rules.d.ts +68 -0
- package/dist/lib/components/ui/collections/record-actions-menu/record-actions-words.d.ts +52 -0
- package/dist/lib/components/ui/collections/record-actions-menu/use-record-actions.d.ts +51 -0
- package/dist/lib/components/ui/collections/record-actions-menu/use-record-flight.d.ts +16 -0
- package/dist/lib/components/ui/collections/row-menu/row-menu-column.d.ts +4 -0
- package/dist/lib/components/ui/collections/row-menu/row-menu.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/partials/server-table-band-classes.d.ts +7 -5
- package/dist/lib/components/ui/collections/server-table/partials/server-table-column-sorting.d.ts +7 -0
- package/dist/lib/components/ui/collections/server-table/types.d.ts +3 -1
- package/dist/lib/components/ui/display/markdown/markdown.d.ts +12 -1
- package/dist/lib/components/ui/display/markdown/markdown.utils.d.ts +2 -0
- package/dist/lib/components/ui/display/markdown/mermaid-csp-scope.d.ts +8 -0
- package/dist/lib/components/ui/display/markdown/mermaid-markup.d.ts +20 -0
- package/dist/lib/components/ui/display/markdown/partials/markdown-code.d.ts +5 -1
- package/dist/lib/components/ui/feedback/confirm-dialog/action-refusal.d.ts +24 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-alert.d.ts +17 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-description.d.ts +10 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +24 -2
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-refusal.d.ts +7 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/use-confirm-action.d.ts +6 -0
- package/dist/lib/components/ui/feedback/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/stale-notice/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/stale-notice/stale-notice.d.ts +15 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/country-field/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/country-field/iso-countries.d.ts +2 -0
- package/dist/lib/components/ui/fields/index.d.ts +1 -0
- package/dist/lib/components/ui/fields/phone-field/index.d.ts +1 -1
- package/dist/lib/components/ui/fields/phone-field/parse-phone.d.ts +2 -0
- package/dist/lib/components/ui/fields/phone-field/phone-field.d.ts +8 -1
- package/dist/lib/components/ui/fields/phone-field/phone-form-field.d.ts +8 -1
- package/dist/lib/components/ui/fields/phone-field/use-phone-value.d.ts +2 -1
- package/dist/lib/components/ui/fields/postal-address/utils.d.ts +15 -0
- package/dist/lib/components/ui/fields/quantity-field/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-field.d.ts +8 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-form-field.d.ts +8 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-row.d.ts +13 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-unit.d.ts +12 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-value.d.ts +9 -0
- package/dist/lib/components/ui/fields/quantity-field/types.d.ts +45 -0
- package/dist/lib/components/ui/forms/index.d.ts +1 -0
- package/dist/lib/components/ui/forms/use-server-field-errors.d.ts +21 -0
- package/dist/lib/components/ui/layout/index.d.ts +1 -0
- package/dist/lib/components/ui/layout/record-page/index.d.ts +2 -0
- package/dist/lib/components/ui/layout/record-page/record-details.d.ts +40 -0
- package/dist/lib/components/ui/layout/record-page/record-page.d.ts +27 -0
- package/dist/lib/components/ui/media/upload/index.d.ts +1 -0
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.d.ts +6 -1
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.errors.d.ts +8 -0
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.utils.d.ts +2 -7
- package/dist/lib/components/ui/media/upload/network-upload-field/use-start-upload.d.ts +7 -3
- package/dist/lib/components/ui/media/upload/network-upload-field/use-upload-item-handlers.d.ts +2 -1
- package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.d.ts +2 -5
- package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.utils.d.ts +26 -1
- package/dist/lib/components/ui/media/upload/upload-error.d.ts +33 -0
- package/dist/lib/components/ui/selection/autocomplete/autocomplete-enter.d.ts +18 -0
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chip-input.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-text-input.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/types.d.ts +3 -1
- package/dist/lib/components/ui/widgets/chat/chat-conversation-item.d.ts +8 -2
- package/dist/lib/components/ui/widgets/chat/chat-markdown.d.ts +4 -0
- package/dist/lib/components/ui/widgets/chat/chat-message-list.d.ts +8 -1
- package/dist/lib/components/ui/widgets/chat/index.d.ts +2 -0
- package/dist/lib/components/ui/widgets/chat/partials/chat-conversation-item-text.d.ts +2 -1
- package/dist/lib/components/ui/widgets/chat/partials/chat-empty-thread.d.ts +2 -0
- package/dist/lib/components/ui/widgets/chat/proposal/chat-action-proposal-parts.d.ts +24 -0
- package/dist/lib/components/ui/widgets/chat/proposal/chat-action-proposal.d.ts +39 -0
- package/dist/lib/components/ui/widgets/chat/proposal/chat-action-proposal.rules.d.ts +17 -0
- package/dist/lib/components/ui/widgets/chat/proposal/chat-tool-activity.d.ts +16 -0
- package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/types.d.ts +10 -0
- package/dist/lib/i18n/resources/en/en.d.ts +49 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +50 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +49 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +50 -1
- package/dist/lib/i18n/resources/resources.d.ts +98 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/print/output/to-pdf-element.d.ts +6 -0
- package/dist/lib.js +1 -1
- package/dist/main.js +42 -42
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +135 -131
- package/dist/{public-BHthpdpe.js → public-BSaSCwy7.js} +9 -9
- package/dist/{rich-code-block-DoW7l2ND.js → rich-code-block-BFVj1GWz.js} +5 -5
- package/dist/{sortable-provider-FLNMfr0o.js → sortable-provider-REwyjiOZ.js} +2 -2
- package/dist/{spinner-DCgDw8eq.js → spinner-BFZxqdWC.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-BMDAwMLh.js → theme-toggle-BHi6miz-.js} +1 -1
- package/dist/{toolbar-items-CkPEhQq7.js → toolbar-items-BTtoKVlx.js} +3 -3
- package/dist/{translate-material-DkcuQBNr.js → translate-material-R-uLthBy.js} +1 -1
- package/dist/{translator-DXdVRdMm.js → translator-ClbXOGQO.js} +100 -2
- package/dist/{typography-BNS_IbFI.js → typography-v-PJ4Zco.js} +1 -1
- package/dist/{use-chat-composer-B-tGRLkI.js → use-chat-composer-Rhan4Xv0.js} +2463 -2405
- package/dist/{use-heading-spy-DaqibCCm.js → use-heading-spy-CJnBkCY0.js} +179 -87
- package/dist/{use-material-translation-Bxl8sv1n.js → use-material-translation-CCWUeiEn.js} +1 -1
- package/dist/{use-return-focus-Y_Kx0QlW.js → use-return-focus-Duk40DZI.js} +1 -1
- package/docs/components/buttons-and-actions.md +24 -0
- package/docs/components/data-display.md +33 -0
- package/docs/components/data-table-filter-and-lists.md +117 -5
- package/docs/components/feedback-and-status.md +58 -2
- package/docs/components/form-fields.md +97 -3
- package/docs/components/media-and-files.md +55 -9
- package/docs/components/navigation-and-layout.md +58 -0
- package/docs/components/rich-widgets.md +37 -3
- package/docs/components/selection-and-choice.md +10 -3
- package/docs/guides/cards-and-tiles.md +4 -2
- package/docs/guides/csp.md +44 -6
- package/docs/guides/forms.md +55 -7
- package/docs/guides/i18n.md +6 -5
- package/docs/guides/printing.md +17 -7
- package/docs/previews/data-table-filter-lists-recordactionsmenu.webp +0 -0
- package/docs/previews/feedback-status-stalenotice.webp +0 -0
- package/docs/previews/form-fields-quantityfield.webp +0 -0
- package/docs/previews/media-files-networkuploadfield.webp +0 -0
- package/docs/previews/media-files-s3uploadfield.webp +0 -0
- package/docs/previews/media-files-uploadfield.webp +0 -0
- package/docs/previews/navigation-layout-recordpage.webp +0 -0
- package/docs/previews/rich-widgets-chat-action-proposal.webp +0 -0
- package/docs/roadmap.md +14 -1
- package/docs/troubleshooting.md +58 -11
- package/lib/components/ui/collections/server-table/server-table-phone-row.css +6 -0
- package/lib/components/ui/display/code/code-moonlight.css +37 -0
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** An action offered beside a message: a link (`href`, a full page load) or a handler (`onAction`, for client-side navigation), with its label. `onAction` wins when both are given. */
|
|
3
|
+
export type RecordAction = {
|
|
4
|
+
label: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
onAction?: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A refusal that carries an action ("Remove the 3 invoices", "View what
|
|
10
|
+
* blocks it") and optional details. An `onConfirm` (or a record action's `send`) rejects with it; a plain
|
|
11
|
+
* `Error` keeps showing its message only.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ActionRefusal extends Error {
|
|
14
|
+
readonly action: RecordAction;
|
|
15
|
+
readonly details?: ReactNode;
|
|
16
|
+
constructor(message: string, options: {
|
|
17
|
+
action: RecordAction;
|
|
18
|
+
details?: ReactNode;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Whether `thrown` is an `ActionRefusal` (also one from another copy of the package). */
|
|
22
|
+
export declare function isActionRefusal(thrown: unknown): thrown is ActionRefusal;
|
|
23
|
+
/** The action a refusal carries, if any. */
|
|
24
|
+
export declare function refusalActionOf(thrown: unknown): RecordAction | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** What `ConfirmDialog`'s `refusal` receives when `onConfirm` has refused. */
|
|
3
|
+
export interface ConfirmRefusalContext {
|
|
4
|
+
/** The thrown error's message, or the translated `material.confirm-dialog.failed` text. */
|
|
5
|
+
message: string;
|
|
6
|
+
/** What `onConfirm` threw. */
|
|
7
|
+
cause: unknown;
|
|
8
|
+
/** Closes the dialog, so a link in the refusal can dismiss it on navigation. */
|
|
9
|
+
close: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The error alert of a refused confirm: the message, or what `refusal` makes
|
|
13
|
+
* of it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ConfirmAlert({ message, cause, close, refusal, }: ConfirmRefusalContext & {
|
|
16
|
+
refusal?: (refusal: ConfirmRefusalContext) => ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What describes a confirm dialog (`aria-describedby`): the description and
|
|
4
|
+
* the `details` note. A plain string alone is a paragraph; block content or a
|
|
5
|
+
* note goes in a `div`, so block children are valid HTML.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ConfirmDescription({ children, details, }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
details?: ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { ButtonVariant } from '../../actions/button/button.js';
|
|
3
|
+
import { ConfirmRefusalContext } from './confirm-alert.js';
|
|
4
|
+
export type { ConfirmRefusalContext };
|
|
2
5
|
export interface ConfirmDialogProps {
|
|
3
6
|
open: boolean;
|
|
4
7
|
onOpenChange: (open: boolean) => void;
|
|
5
8
|
title: string;
|
|
6
|
-
|
|
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;
|
|
7
21
|
confirmLabel?: string;
|
|
8
22
|
cancelLabel?: string;
|
|
9
23
|
/**
|
|
@@ -28,6 +42,14 @@ export interface ConfirmDialogProps {
|
|
|
28
42
|
* dialog reopens. Off by default: the refused action may be retried.
|
|
29
43
|
*/
|
|
30
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;
|
|
31
53
|
/**
|
|
32
54
|
* Called as the dialog closes, before the focus goes back to what opened
|
|
33
55
|
* it. `event.preventDefault()` places the focus yourself, for example
|
|
@@ -36,4 +58,4 @@ export interface ConfirmDialogProps {
|
|
|
36
58
|
*/
|
|
37
59
|
onCloseAutoFocus?: (event: Event) => void;
|
|
38
60
|
}
|
|
39
|
-
export declare function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, cancelVariant, onConfirm, variant, loading, confirmDisabled, lockOnRefusal, onCloseAutoFocus, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
61
|
+
export declare function ConfirmDialog({ open, onOpenChange, title, description, details, confirmLabel, cancelLabel, cancelVariant, onConfirm, variant, loading, confirmDisabled, lockOnRefusal, refusal, onCloseAutoFocus, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ConfirmRefusalContext } from './confirm-alert.js';
|
|
2
|
+
/**
|
|
3
|
+
* The default refusal of `ConfirmDialog`: the message, and for an
|
|
4
|
+
* `ActionRefusal` its details and its action. Any other error is its
|
|
5
|
+
* message alone.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ConfirmRefusal({ message, cause, close, }: ConfirmRefusalContext): import("react").JSX.Element;
|
|
@@ -11,6 +11,12 @@ export declare function useConfirmAction({ open, onOpenChange, onConfirm, }: {
|
|
|
11
11
|
}): {
|
|
12
12
|
pending: boolean;
|
|
13
13
|
error: string | null;
|
|
14
|
+
cause: unknown;
|
|
14
15
|
handleOpenChange: (value: boolean) => void;
|
|
15
16
|
handleConfirm: (event: MouseEvent<HTMLButtonElement>) => Promise<void>;
|
|
16
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* A ref for a modal's content that takes the focus while `pending`: the
|
|
20
|
+
* buttons it disables would otherwise drop the focus to the page behind it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useKeepFocusWhile(pending: boolean): import('react').RefObject<HTMLDivElement | null>;
|
|
@@ -18,6 +18,7 @@ export * from './progress/index.js';
|
|
|
18
18
|
export * from './scroll-progress/index.js';
|
|
19
19
|
export * from './skeleton/index.js';
|
|
20
20
|
export * from './spinner/index.js';
|
|
21
|
+
export * from './stale-notice/index.js';
|
|
21
22
|
export * from './step-dots/index.js';
|
|
22
23
|
export * from './step-up-dialog/index.js';
|
|
23
24
|
export * from './toast/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './stale-notice.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface StaleNoticeProps {
|
|
2
|
+
/** Runs on "Reload the record": read the record again. */
|
|
3
|
+
onReload: () => void;
|
|
4
|
+
/** Shows the reload button as loading while the record is read again. */
|
|
5
|
+
busy?: boolean;
|
|
6
|
+
/** Replaces the description (translated by default). */
|
|
7
|
+
message?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Another write came first (a `stale-version` refusal): what was typed stays,
|
|
12
|
+
* a warning alert takes the focus and scrolls into view when it mounts, and
|
|
13
|
+
* the only way out is to read the record again. There is no "overwrite".
|
|
14
|
+
*/
|
|
15
|
+
export declare function StaleNotice({ onReload, busy, message, className, }: StaleNoticeProps): import("react").JSX.Element;
|