@nxgt/material 3.50.0 → 3.52.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 +28 -0
- package/dist/{async-slice-3loEtzUY.js → async-slice-BGtmF3K5.js} +2 -2
- package/dist/{button-BRUaHD8z.js → button-Ct0KRBsN.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-DneTrtNj.js → chip-Ca1SEd70.js} +2 -2
- package/dist/{code-editor-R_nPN_-d.js → code-editor-DtwRhK8B.js} +6 -6
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-BKEUhQlF.js → code-language-items-CEclGxhA.js} +2 -2
- package/dist/components/ui/layout/app-shell/activity-backdrop-shapes.css +14 -9
- package/dist/components/ui/layout/auth-card/auth-card-backdrop.css +2 -2
- package/dist/{components-D6xFLcoE.js → components-CzELzsOi.js} +6006 -5824
- package/dist/components.js +19 -19
- package/dist/{dialog-S7dLsYRZ.js → dialog-BIy04Hpd.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-XLlxfDgq.js → dropdown-menu-B0Kd8x3G.js} +1 -1
- package/dist/editor.js +9 -9
- package/dist/{empty-state-Dsf6R-Zo.js → empty-state-CKxORwFE.js} +2 -2
- package/dist/{escape-owner-B9eCwjLw.js → escape-owner-BGKjiglh.js} +1 -1
- package/dist/{field-blur-5uRDFHvB.js → field-blur-Dz1zPaYK.js} +1 -1
- package/dist/{field-blur-context-Cwt4TuBq.js → field-blur-context-1T6GkSNc.js} +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-PHUgRSjJ.js → hover-card-BwQ9IRxa.js} +2 -2
- package/dist/{i18n-provider-DPM_ALQ4.js → i18n-provider-BFNrM0Qu.js} +14 -12
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-Dh6-FNOF.js → icon-badge-D5Ns7ndZ.js} +3 -3
- package/dist/{icon-button-DSC2-IAG.js → icon-button-VzdqY_Tv.js} +1 -1
- package/dist/lib/components/ui/collections/data-table/data-table-selection-host.d.ts +7 -0
- package/dist/lib/components/ui/collections/data-table/internal.d.ts +1 -0
- package/dist/lib/components/ui/collections/data-table/partials/layouts/data-table-list-bar.d.ts +2 -1
- package/dist/lib/components/ui/collections/server-table/partials/filtered-server-table.d.ts +9 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-band-view.d.ts +18 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-band.d.ts +10 -1
- package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-buttons.d.ts +3 -2
- package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-more.d.ts +4 -2
- package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk.d.ts +2 -1
- package/dist/lib/components/ui/collections/server-table/partials/server-table-controls.d.ts +16 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-grid.d.ts +3 -1
- package/dist/lib/components/ui/collections/server-table/partials/server-table-selection-bar.d.ts +17 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-view.d.ts +15 -0
- package/dist/lib/components/ui/collections/server-table/partials/use-server-table-list-root.d.ts +10 -0
- package/dist/lib/components/ui/collections/server-table/partials/use-server-table-phone-row.d.ts +15 -0
- package/dist/lib/components/ui/collections/server-table/partials/use-server-table-selection-slots.d.ts +24 -0
- package/dist/lib/components/ui/collections/server-table/use-selection-band.d.ts +14 -0
- package/dist/lib/components/ui/display/change-history/types.d.ts +2 -1
- package/dist/lib/components/ui/display/description/description.d.ts +2 -2
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/verification-code/use-resend-focus.d.ts +4 -1
- package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +12 -1
- package/dist/lib/components/ui/primitives/tabs/tabs-overflow-classes.d.ts +8 -5
- package/dist/lib/components/ui/primitives/tabs/use-tabs-overflow.d.ts +4 -3
- package/dist/lib/i18n/i18n-provider.d.ts +14 -3
- package/dist/lib/i18n/resources/en/en.d.ts +3 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +4 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +3 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -1
- package/dist/lib/i18n/resources/resources.d.ts +6 -0
- package/dist/lib/i18n/translate-material.d.ts +7 -1
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/i18n/types.d.ts +6 -0
- package/dist/lib/i18n/use-material-translation.d.ts +4 -0
- package/dist/lib.js +1 -1
- package/dist/main.js +25 -25
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +5 -4
- package/dist/{public-vxiijIJF.js → public-D-J3nZFm.js} +9 -9
- package/dist/{rich-code-block-BwvCXPqq.js → rich-code-block-Ig0ERAa2.js} +5 -5
- package/dist/{sortable-provider-D2pAFWQB.js → sortable-provider-DfPkSN90.js} +2 -2
- package/dist/{spinner-BpVwI1ps.js → spinner-KQb3YuR_.js} +1 -1
- package/dist/{stored-language-Beyj2ult.js → stored-language-Cb9FMEwk.js} +8 -2
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-BTYRPkP4.js → theme-toggle-BY-SpsFV.js} +1 -1
- package/dist/{toolbar-items-CIMo4F9q.js → toolbar-items-30w9rG5h.js} +4 -4
- package/dist/translate-material-BPl8TQLg.js +20 -0
- package/dist/{translator-CBgIb3zP.js → translator-BnQXtpSZ.js} +1 -1
- package/dist/{use-chat-composer-D8UAsX0f.js → use-chat-composer-BSKJRYMB.js} +1678 -1656
- package/dist/{use-heading-spy-C5LXtA8Z.js → use-heading-spy-BgXA8uz6.js} +1 -1
- package/dist/use-material-translation-ByM3gD9R.js +14 -0
- package/docs/components/data-display.md +3 -3
- package/docs/components/data-table-filter-and-lists.md +38 -5
- package/docs/components/primitives.md +1 -1
- package/docs/guides/backgrounds.md +3 -1
- package/docs/guides/cards-and-tiles.md +3 -0
- package/docs/guides/helpers.md +1 -1
- package/docs/guides/i18n.md +30 -8
- package/docs/guides/two-factor.md +2 -1
- package/docs/previews/guides-i18n-i18nprovider.webp +0 -0
- package/docs/previews/guides-i18n-translated-components.webp +0 -0
- package/docs/troubleshooting.md +3 -2
- package/lib/components/ui/layout/app-shell/activity-backdrop-shapes.css +14 -9
- package/lib/components/ui/layout/auth-card/auth-card-backdrop.css +2 -2
- package/package.json +1 -1
- package/dist/translate-material-DEUlaL_1.js +0 -12
- package/dist/use-material-translation-DWWeeg-B.js +0 -14
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ResourceBundle } from './merge-resources.js';
|
|
2
3
|
import { I18nContextValue, Language } from './types.js';
|
|
3
4
|
export type I18nProviderProps = {
|
|
4
5
|
children: ReactNode;
|
|
@@ -18,6 +19,14 @@ export type I18nProviderProps = {
|
|
|
18
19
|
* agree and no hydration guard is needed downstream.
|
|
19
20
|
*/
|
|
20
21
|
initialLanguage?: Language;
|
|
22
|
+
/**
|
|
23
|
+
* The app's resources, `mergeResources(materialResources, appResources)`.
|
|
24
|
+
* The components translate their `material.*` words through them, so an app
|
|
25
|
+
* override reaches them; leave it out and they read the base bundle. Pass a
|
|
26
|
+
* stable object (module scope): a new object on each render rebuilds the
|
|
27
|
+
* translators.
|
|
28
|
+
*/
|
|
29
|
+
resources?: ResourceBundle;
|
|
21
30
|
};
|
|
22
31
|
/**
|
|
23
32
|
* I18nProvider - Shares the current language across the whole React tree.
|
|
@@ -27,8 +36,10 @@ export type I18nProviderProps = {
|
|
|
27
36
|
* `useState`/`useLocalStorage`, so no `window.location.reload()` is needed
|
|
28
37
|
* after `changeLanguage`.
|
|
29
38
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
39
|
+
* Language state is shared, and so are the app's resources when given through
|
|
40
|
+
* `resources`: the components then read their `material.*` words from them.
|
|
41
|
+
* Resource bundles otherwise stay static module imports inside each app, and
|
|
42
|
+
* are passed to `createTranslator` once.
|
|
32
43
|
*
|
|
33
44
|
* In a pure SPA (no `initialLanguage`), the initial language is read from
|
|
34
45
|
* `localStorage` lazily inside `useState`. In SSR, pass `initialLanguage`
|
|
@@ -42,7 +53,7 @@ export type I18nProviderProps = {
|
|
|
42
53
|
* </I18nProvider>
|
|
43
54
|
* ```
|
|
44
55
|
*/
|
|
45
|
-
export declare function I18nProvider({ children, defaultLanguage, storageKey, supportedLanguages, onLanguageChange, initialLanguage, }: I18nProviderProps): import("react").JSX.Element;
|
|
56
|
+
export declare function I18nProvider({ children, defaultLanguage, storageKey, supportedLanguages, onLanguageChange, initialLanguage, resources, }: I18nProviderProps): import("react").JSX.Element;
|
|
46
57
|
/**
|
|
47
58
|
* useI18nContext - Access the shared language state.
|
|
48
59
|
*
|
|
@@ -2141,6 +2141,9 @@ export declare const en: {
|
|
|
2141
2141
|
"bulk-action-name": string;
|
|
2142
2142
|
"bulk-max-notice": string;
|
|
2143
2143
|
"bulk-more": string;
|
|
2144
|
+
"bulk-bar": string;
|
|
2145
|
+
"bulk-selected": string;
|
|
2146
|
+
"bulk-cancel": string;
|
|
2144
2147
|
};
|
|
2145
2148
|
"list-empty": {
|
|
2146
2149
|
clear: string;
|
|
@@ -2130,7 +2130,10 @@ declare const _default: {
|
|
|
2130
2130
|
"bulk-action": "{label} ({count})",
|
|
2131
2131
|
"bulk-action-name": "{label} {count, plural, one {# row} other {# rows}}",
|
|
2132
2132
|
"bulk-max-notice": "Select {max, plural, one {# row} other {# rows}} or fewer to {label}",
|
|
2133
|
-
"bulk-more": "More"
|
|
2133
|
+
"bulk-more": "More",
|
|
2134
|
+
"bulk-bar": "Selected rows",
|
|
2135
|
+
"bulk-selected": "{count} selected",
|
|
2136
|
+
"bulk-cancel": "Cancel"
|
|
2134
2137
|
},
|
|
2135
2138
|
"list-empty": {
|
|
2136
2139
|
"clear": "Clear search and filters"
|
|
@@ -2141,6 +2141,9 @@ export declare const fr: {
|
|
|
2141
2141
|
"bulk-action-name": string;
|
|
2142
2142
|
"bulk-max-notice": string;
|
|
2143
2143
|
"bulk-more": string;
|
|
2144
|
+
"bulk-bar": string;
|
|
2145
|
+
"bulk-selected": string;
|
|
2146
|
+
"bulk-cancel": string;
|
|
2144
2147
|
};
|
|
2145
2148
|
"list-empty": {
|
|
2146
2149
|
clear: string;
|
|
@@ -2130,7 +2130,10 @@ declare const _default: {
|
|
|
2130
2130
|
"bulk-action": "{label} ({count})",
|
|
2131
2131
|
"bulk-action-name": "{label} : {count, plural, one {# ligne} other {# lignes}}",
|
|
2132
2132
|
"bulk-max-notice": "Sélectionnez {max, plural, one {# ligne} other {# lignes}} ou moins pour {label}",
|
|
2133
|
-
"bulk-more": "Plus"
|
|
2133
|
+
"bulk-more": "Plus",
|
|
2134
|
+
"bulk-bar": "Lignes sélectionnées",
|
|
2135
|
+
"bulk-selected": "{count, plural, one {# sélectionnée} other {# sélectionnées}}",
|
|
2136
|
+
"bulk-cancel": "Annuler"
|
|
2134
2137
|
},
|
|
2135
2138
|
"list-empty": {
|
|
2136
2139
|
"clear": "Effacer la recherche et les filtres"
|
|
@@ -2139,6 +2139,9 @@ export declare const resources: {
|
|
|
2139
2139
|
"bulk-action-name": string;
|
|
2140
2140
|
"bulk-max-notice": string;
|
|
2141
2141
|
"bulk-more": string;
|
|
2142
|
+
"bulk-bar": string;
|
|
2143
|
+
"bulk-selected": string;
|
|
2144
|
+
"bulk-cancel": string;
|
|
2142
2145
|
};
|
|
2143
2146
|
"list-empty": {
|
|
2144
2147
|
clear: string;
|
|
@@ -5040,6 +5043,9 @@ export declare const resources: {
|
|
|
5040
5043
|
"bulk-action-name": string;
|
|
5041
5044
|
"bulk-max-notice": string;
|
|
5042
5045
|
"bulk-more": string;
|
|
5046
|
+
"bulk-bar": string;
|
|
5047
|
+
"bulk-selected": string;
|
|
5048
|
+
"bulk-cancel": string;
|
|
5043
5049
|
};
|
|
5044
5050
|
"list-empty": {
|
|
5045
5051
|
clear: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ResourceBundle } from './merge-resources.js';
|
|
1
2
|
import { MaterialLocaleKey, TranslationContext } from './types.js';
|
|
2
3
|
/**
|
|
3
4
|
* Translates one of this package's own strings (`material.*`) for a language
|
|
@@ -10,6 +11,11 @@ import { MaterialLocaleKey, TranslationContext } from './types.js';
|
|
|
10
11
|
* have, or no language, gives `fallback`, formatted with that language's
|
|
11
12
|
* `Intl` rules.
|
|
12
13
|
*
|
|
14
|
+
* `resources` is the app's merged bundle. For each candidate language it is
|
|
15
|
+
* read first, then the base bundle, before the next candidate, so a bundle
|
|
16
|
+
* that was not merged with the base one keeps the built-in strings. Pass a
|
|
17
|
+
* stable object (module scope): the translator is cached per object.
|
|
18
|
+
*
|
|
13
19
|
* @example translateMaterial('fr', 'material.print.page-of', 'Page {page} of {pages}', { page: 2, pages: 5 }) // 'Page 2 sur 5'
|
|
14
20
|
*/
|
|
15
|
-
export declare function translateMaterial(language: string | null | undefined, key: MaterialLocaleKey, fallback: string, options?: TranslationContext): string;
|
|
21
|
+
export declare function translateMaterial(language: string | null | undefined, key: MaterialLocaleKey, fallback: string, options?: TranslationContext, resources?: ResourceBundle): string;
|