@cratis/components 4.33.0 → 4.34.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/compat-manifest.json +11 -11
- package/dist/esm/Common/CratisComponentsProvider.d.ts +2 -0
- package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
- package/dist/esm/DataTables/TablePaginator.d.ts +2 -0
- package/dist/esm/DataTables/TablePaginator.d.ts.map +1 -1
- package/dist/esm/DataTables/TablePaginator.js.map +1 -1
- package/dist/esm/DataTables/TablePaginatorImplementation.d.ts.map +1 -1
- package/dist/esm/DataTables/TablePaginatorImplementation.js +1 -1
- package/dist/esm/DataTables/TablePaginatorImplementation.js.map +1 -1
- package/dist/esm/DataTables/paginatorRange.d.ts +3 -1
- package/dist/esm/DataTables/paginatorRange.d.ts.map +1 -1
- package/dist/esm/DataTables/paginatorRange.js +2 -2
- package/dist/esm/DataTables/paginatorRange.js.map +1 -1
- package/package.json +1 -1
package/compat-manifest.json
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
{
|
|
69
69
|
"name": "@cratis/components",
|
|
70
70
|
"role": "core",
|
|
71
|
-
"version": "4.
|
|
71
|
+
"version": "4.34.0",
|
|
72
72
|
"releaseMajorRange": ">=4 <5",
|
|
73
73
|
"independentRelease": false,
|
|
74
74
|
"private": false,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
{
|
|
93
93
|
"name": "@cratis/eslint-plugin-components",
|
|
94
94
|
"role": "eslint",
|
|
95
|
-
"version": "4.
|
|
95
|
+
"version": "4.34.0",
|
|
96
96
|
"releaseMajorRange": ">=4 <5",
|
|
97
97
|
"independentRelease": false,
|
|
98
98
|
"private": false,
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
{
|
|
106
106
|
"name": "@cratis/components.migrator",
|
|
107
107
|
"role": "migrator",
|
|
108
|
-
"version": "4.
|
|
108
|
+
"version": "4.34.0",
|
|
109
109
|
"releaseMajorRange": ">=4 <5",
|
|
110
110
|
"independentRelease": false,
|
|
111
111
|
"private": false,
|
|
@@ -116,13 +116,13 @@
|
|
|
116
116
|
{
|
|
117
117
|
"name": "@cratis/components.conformance",
|
|
118
118
|
"role": "conformance",
|
|
119
|
-
"version": "4.
|
|
119
|
+
"version": "4.34.0",
|
|
120
120
|
"releaseMajorRange": ">=4 <5",
|
|
121
121
|
"independentRelease": false,
|
|
122
122
|
"private": false,
|
|
123
123
|
"packageAccess": "public",
|
|
124
124
|
"peerDependencies": {
|
|
125
|
-
"@cratis/components": "4.
|
|
125
|
+
"@cratis/components": "4.34.0",
|
|
126
126
|
"react": "^19.0.0",
|
|
127
127
|
"react-dom": "^19.0.0"
|
|
128
128
|
},
|
|
@@ -132,13 +132,13 @@
|
|
|
132
132
|
{
|
|
133
133
|
"name": "@cratis/components.mui",
|
|
134
134
|
"role": "renderer-adapter",
|
|
135
|
-
"version": "4.
|
|
135
|
+
"version": "4.34.0",
|
|
136
136
|
"releaseMajorRange": ">=4 <5",
|
|
137
137
|
"independentRelease": false,
|
|
138
138
|
"private": false,
|
|
139
139
|
"packageAccess": "public",
|
|
140
140
|
"peerDependencies": {
|
|
141
|
-
"@cratis/components": "4.
|
|
141
|
+
"@cratis/components": "4.34.0",
|
|
142
142
|
"@emotion/react": ">=11.5 <12",
|
|
143
143
|
"@emotion/styled": ">=11.11 <12",
|
|
144
144
|
"@mui/material": ">=9 <10",
|
|
@@ -188,13 +188,13 @@
|
|
|
188
188
|
{
|
|
189
189
|
"name": "@cratis/components.primereact",
|
|
190
190
|
"role": "renderer-adapter",
|
|
191
|
-
"version": "4.
|
|
191
|
+
"version": "4.34.0",
|
|
192
192
|
"releaseMajorRange": ">=4 <5",
|
|
193
193
|
"independentRelease": false,
|
|
194
194
|
"private": false,
|
|
195
195
|
"packageAccess": "public",
|
|
196
196
|
"peerDependencies": {
|
|
197
|
-
"@cratis/components": "4.
|
|
197
|
+
"@cratis/components": "4.34.0",
|
|
198
198
|
"@primereact/core": ">=11 <12",
|
|
199
199
|
"@primereact/ui": ">=11 <12",
|
|
200
200
|
"@primeuix/themes": ">=3 <4",
|
|
@@ -256,13 +256,13 @@
|
|
|
256
256
|
{
|
|
257
257
|
"name": "@cratis/components.primereact10",
|
|
258
258
|
"role": "renderer-adapter",
|
|
259
|
-
"version": "4.
|
|
259
|
+
"version": "4.34.0",
|
|
260
260
|
"releaseMajorRange": ">=4 <5",
|
|
261
261
|
"independentRelease": false,
|
|
262
262
|
"private": false,
|
|
263
263
|
"packageAccess": "public",
|
|
264
264
|
"peerDependencies": {
|
|
265
|
-
"@cratis/components": "4.
|
|
265
|
+
"@cratis/components": "4.34.0",
|
|
266
266
|
"primereact": ">=10.9.9 <11",
|
|
267
267
|
"react": "^19.0.0",
|
|
268
268
|
"react-dom": "^19.0.0"
|
|
@@ -20,6 +20,8 @@ export interface CratisPaginatorMessages {
|
|
|
20
20
|
page?: (page: number) => string;
|
|
21
21
|
/** Accessible name for the numbered-page group. */
|
|
22
22
|
pages?: string;
|
|
23
|
+
/** Builds the visible range text from the one-based start, the clamped end and the total. Defaults to `start–end of total`. */
|
|
24
|
+
range?: (start: number, end: number, total: number) => string;
|
|
23
25
|
}
|
|
24
26
|
/** Localizable labels owned by the Cratis date picker composition. */
|
|
25
27
|
export interface CratisDatePickerMessages {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CratisComponentsProvider.d.ts","sourceRoot":"","sources":["../../../Common/CratisComponentsProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,6BAA0B,CAAC;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAgC,CAAC;AAM/E,OAAO,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,CAAC;IACpC,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,UAC7B,sBAAsB,GAAG,SAAS,KAC1C,sBAIF,CAAC;AAoEF,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,6GASlC,6BAA6B,gCAyB/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo, type ReactNode } from 'react';\nimport { I18nProvider } from 'react-aria-components/I18nProvider';\nimport { merge } from 'ts-deepmerge';\nimport { Toaster, type ToasterProps } from '../Notifications/Toaster';\nimport { unstable_RendererRoot } from '../renderer/RendererContext';\nimport type { CratisRendererSetup, unstable_UiLibrary } from '../renderer/manifest';\nimport type { CratisOverlayEnvironment } from '../renderer/overlayEnvironment';\nimport { CratisComponentsContext } from '../configuration/CratisComponentsContext';\nimport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\n\nconst RendererRoot = unstable_RendererRoot;\n\nexport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nexport { useCratisComponentsConfig } from '../configuration/CratisComponentsContext';\n\n/** Localizable labels owned by the Cratis paginator. */\nexport interface CratisPaginatorMessages {\n /** Pagination navigation-region name. */\n navigation?: string;\n /** First-page action label. */\n first?: string;\n /** Previous-page action label. */\n previous?: string;\n /** Next-page action label. */\n next?: string;\n /** Last-page action label. */\n last?: string;\n /** Builds a numbered page button's accessible name from its one-based page number. */\n page?: (page: number) => string;\n /** Accessible name for the numbered-page group. */\n pages?: string;\n}\n\n/** Localizable labels owned by the Cratis date picker composition. */\nexport interface CratisDatePickerMessages {\n /** Today action label. */\n today?: string;\n /** Clear action label. */\n clear?: string;\n /** Calendar-trigger label. */\n openCalendar?: string;\n /** Previous-month action label. */\n previousMonth?: string;\n /** Next-month action label. */\n nextMonth?: string;\n /**\n * Accessible name for the segmented date input when neither an explicit\n * `aria-label` nor a `placeholder` is supplied. Previously an orphaned\n * `'Date'` literal with no override path.\n */\n label?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Dropdown} composition. */\nexport interface CratisDropdownMessages {\n /** Accessible name for the options-popover trigger. */\n showOptions?: string;\n /** Accessible name for the clear-selection action. */\n clearSelection?: string;\n}\n\n/**\n * Localizable action and dismissal labels shared by every Cratis-owned dialog\n * surface — {@link Dialog}, {@link CommandDialog}, and {@link StepperCommandDialog}.\n */\nexport interface CratisDialogMessages {\n /** Primary confirmation label (the `Ok` action in `DialogButtons.Ok*`). */\n ok?: string;\n /** Cancellation label (the `Cancel` action, and the Stepper footer Cancel). */\n cancel?: string;\n /** Affirmative label (the `Yes` action in `DialogButtons.YesNo*`). */\n yes?: string;\n /** Negative label (the `No` action in `DialogButtons.YesNo*`). */\n no?: string;\n /** Accessible name for the header close (×) action. */\n close?: string;\n /**\n * Polite announcement made when a confirm is refused and the dialog stays open\n * (validation failure or business rule). Defaults to\n * 'The action was not completed. Review the dialog and try again.'\n */\n refused?: string;\n}\n\n/** Localizable navigation labels owned by {@link CommandStepper} / {@link StepperCommandDialog}. */\nexport interface CratisStepperMessages {\n /** Advance-to-next-step action label. */\n next?: string;\n /** Return-to-previous-step action label. */\n previous?: string;\n /** Final-step submit action label. */\n submit?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toaster}. */\nexport interface CratisNotificationsMessages {\n /** Accessible name for a toast's dismiss action. */\n dismiss?: string;\n /** Accessible name for the toast region landmark. */\n region?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link DataTableCore} composition. */\nexport interface CratisDataTableMessages {\n /** Accessible name for a single-selection row control. */\n selectRow?: string;\n /** Accessible name for the select-all control in a multiple-selection header. */\n selectAllRows?: string;\n /** Placeholder for the loaded-page search input. */\n search?: string;\n /** Accessible name for the loaded-page search input. */\n searchAriaLabel?: string;\n /** Message shown while loading an empty table. */\n loading?: string;\n /** Message shown when a query fails. */\n failed?: string;\n /** Message shown when a query denies access. */\n unauthorized?: string;\n /** Message shown when a search or filter leaves no rows on the loaded page. */\n filteredEmpty?: string;\n /** Message shown when a search or filter leaves no rows in server mode. */\n filteredEmptyServer?: string;\n}\n\n/** Localizable accessible names for the Cratis filter panel and its searches. */\nexport interface CratisFilterMessages {\n /** FilterPanel dialog name. Defaults to 'Filters'. */\n label?: string;\n /**\n * Search-input name for FilterPanel, its option groups, and standalone CheckboxListFilter.\n * Unset by default so an effective search placeholder retains precedence over 'Search'.\n * PivotViewer supplies group-specific names instead of using this shared name for its groups.\n */\n searchAriaLabel?: string;\n}\n\n/** Localizable labels owned by the Cratis column-filter popup. */\nexport interface CratisColumnFilterMessages {\n /** Builds the filter-trigger accessible name from the effective field. */\n filterTriggerAriaLabel?: (field: string) => string;\n /** Builds the value-control accessible name from the effective field. */\n valueAriaLabel?: (field: string) => string;\n /** Accessible name for the match-mode selector. */\n matchModeAriaLabel?: string;\n /** Localizes a match mode while retaining its default label as fallback input. */\n matchModeLabel?: (mode: string, defaultLabel: string) => string;\n /** Clear action label. */\n clear?: string;\n /** Apply action label. */\n apply?: string;\n /** Boolean true option label. */\n true?: string;\n /** Boolean false option label. */\n false?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toolbar} composition. */\nexport interface CratisToolbarMessages {\n /** Accessible toolbar name used when neither `aria-label` nor `aria-labelledby` is supplied. */\n label?: string;\n /** Accessible name of the close button in a drawer {@link ToolbarFolder}. Defaults to 'Close'. */\n closeDrawer?: string;\n}\n\n/** Components-owned message groups. */\nexport interface CratisComponentsMessages {\n /** Paginator labels. */\n paginator?: CratisPaginatorMessages;\n /** Date-picker labels. */\n datePicker?: CratisDatePickerMessages;\n /** Dropdown labels. */\n dropdown?: CratisDropdownMessages;\n /** Dialog action/dismissal labels shared by Dialog, CommandDialog, and StepperCommandDialog. */\n dialog?: CratisDialogMessages;\n /** Stepper navigation labels shared by CommandStepper and StepperCommandDialog. */\n stepper?: CratisStepperMessages;\n /** Toaster labels. */\n notifications?: CratisNotificationsMessages;\n /** DataTable search, selection, and query-state messages. */\n dataTable?: CratisDataTableMessages;\n /** FilterPanel dialog and search-input accessible names. */\n filter?: CratisFilterMessages;\n /** Column-filter popup labels and match-mode copy. */\n columnFilter?: CratisColumnFilterMessages;\n /** Toolbar accessible-name fallback. */\n toolbar?: CratisToolbarMessages;\n}\n\n/**\n * Components-owned icon vocabulary. Every name is a concept the library draws in more than one\n * place; registering one replaces that concept's built-in glyph everywhere it is drawn, without\n * touching the surrounding element, its part, or its accessible name.\n *\n * Resolution per site is `per-component prop → provider icon → built-in glyph`: a named prop such\n * as `Dialog`'s `closeIcon` means \"this one call site\" and keeps winning, while the provider\n * replaces the built-in default for the whole product. Registering nothing renders exactly what the\n * library renders today, because the built-in glyph stays at its call site and is never part of\n * {@link cratisDefaults}.\n *\n * A name registered as `null` draws no glyph while the button, its part, and its accessible name\n * remain — the same meaning `closeIcon={null}` already has.\n */\nexport interface CratisComponentsIcons {\n /** Dismissal mark. Drawn by `Dialog`'s header close, `Toaster`'s dismiss, `ChatSidebar`, the `Chat` panel, and the PivotViewer detail panel. Defaults to `×`. */\n close?: ReactNode;\n /** Remove-this-value mark. Drawn by `TagGroup`'s tag remove, `Chip`'s remove control, and `CommandForm`'s chips field. Defaults to `×`. */\n remove?: ReactNode;\n /** Expand/collapse chevron on a closed-by-default surface. Drawn by `Dropdown`'s trigger and `ComboBox`'s trigger. Defaults to `⌄` (`▾` in `ComboBox`). */\n expand?: ReactNode;\n /** Ascending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▲`. */\n sortAscending?: ReactNode;\n /** Descending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▼`. */\n sortDescending?: ReactNode;\n /** Step-backwards mark. Drawn by `TablePaginator`'s previous page and the date picker's previous month. Defaults to `‹`. */\n previous?: ReactNode;\n /** Step-forwards mark. Drawn by `TablePaginator`'s next page and the date picker's next month. Defaults to `›`. */\n next?: ReactNode;\n /** Clear-the-current-value mark. Drawn by `Dropdown`'s clear-selection action and the PivotViewer filter panel's clear action. Defaults to `×`. */\n clear?: ReactNode;\n}\n\ninterface LegacyLocaleMessages {\n today?: string;\n clear?: string;\n aria?: {\n navigation?: string;\n firstPageLabel?: string;\n prevPageLabel?: string;\n nextPageLabel?: string;\n lastPageLabel?: string;\n };\n [message: string]: unknown;\n}\n\n/** Renderer-independent application configuration for Components. */\nexport interface CratisComponentsConfig {\n /** BCP 47 locale used by React Aria for dates, numbers, and interaction announcements. */\n locale?: string;\n /** Cratis-owned labels not supplied by the platform's internationalization APIs. */\n messages?: CratisComponentsMessages;\n /** Cratis-owned icon vocabulary replacing the built-in glyphs the library draws. */\n icons?: CratisComponentsIcons;\n /**\n * @deprecated Use {@link messages}; React Aria supplies its own locale data.\n */\n locales?: Record<string, LegacyLocaleMessages>;\n}\n\n/** Props for the application-root Components provider. */\nexport interface CratisComponentsProviderProps {\n /** Locale and Components-owned messages. */\n value?: CratisComponentsConfig;\n /** Mounts the global toaster with defaults or explicit options. */\n toaster?: boolean | ToasterProps;\n /**\n * Selects one stable presentation library. The broader generic manifest and ordered,\n * last-wins composition form remain experimental.\n */\n library?: unstable_UiLibrary | readonly unstable_UiLibrary[];\n /** Experimental profile-promise behavior. Defaults to strict. */\n libraryMode?: 'strict' | 'degrade';\n /** Terminal slot fallback behavior. Defaults to the built-in Core implementation. */\n rendererFallback?: 'core' | 'throw';\n /** Host environment for overlay portal containers. */\n overlayEnvironment?: CratisOverlayEnvironment;\n /**\n * Non-secret renderer setup attestations. Values are booleans so credentials and license\n * tokens never cross the Components provider boundary.\n */\n rendererSetup?: CratisRendererSetup;\n /** Application content. */\n children: ReactNode;\n}\n\n/**\n * Deep-merges consumer configuration over {@link cratisDefaults}.\n *\n * `icons` merges by name only. An icon value is an opaque node — often a React element — so it is\n * carried over by identity instead of being deep-merged into, while a partial map still leaves every\n * unregistered name to its built-in glyph.\n */\nexport const mergeCratisComponentsConfig = (\n value: CratisComponentsConfig | undefined,\n): CratisComponentsConfig => {\n const { icons, ...rest } = value ?? {};\n const merged = merge(cratisDefaults, rest) as CratisComponentsConfig;\n return icons ? { ...merged, icons: { ...cratisDefaults.icons, ...icons } } : merged;\n};\n\nconst withLegacyLocaleMessages = (\n config: CratisComponentsConfig,\n explicitMessages: CratisComponentsMessages | undefined,\n): CratisComponentsConfig => {\n const legacy = config.locale ? config.locales?.[config.locale] : undefined;\n if (!legacy) return config;\n return {\n ...config,\n messages: {\n ...config.messages,\n paginator: {\n ...config.messages?.paginator,\n navigation:\n explicitMessages?.paginator?.navigation ??\n legacy.aria?.navigation ??\n config.messages?.paginator?.navigation,\n first:\n explicitMessages?.paginator?.first ??\n legacy.aria?.firstPageLabel ??\n config.messages?.paginator?.first,\n previous:\n explicitMessages?.paginator?.previous ??\n legacy.aria?.prevPageLabel ??\n config.messages?.paginator?.previous,\n next:\n explicitMessages?.paginator?.next ??\n legacy.aria?.nextPageLabel ??\n config.messages?.paginator?.next,\n last:\n explicitMessages?.paginator?.last ??\n legacy.aria?.lastPageLabel ??\n config.messages?.paginator?.last,\n },\n datePicker: {\n ...config.messages?.datePicker,\n today:\n explicitMessages?.datePicker?.today ??\n legacy.today ??\n config.messages?.datePicker?.today,\n clear:\n explicitMessages?.datePicker?.clear ??\n legacy.clear ??\n config.messages?.datePicker?.clear,\n openCalendar:\n explicitMessages?.datePicker?.openCalendar ??\n config.messages?.datePicker?.openCalendar,\n previousMonth:\n explicitMessages?.datePicker?.previousMonth ??\n config.messages?.datePicker?.previousMonth,\n nextMonth:\n explicitMessages?.datePicker?.nextMonth ??\n config.messages?.datePicker?.nextMonth,\n },\n },\n };\n};\n\nconst validLocale = (locale: string | undefined) => {\n if (!locale) return 'en-US';\n try {\n return new Intl.Locale(locale).toString();\n } catch {\n return 'en-US';\n }\n};\n\n/** Application root for locale, labels, and the optional app-wide toaster. */\nexport const CratisComponentsProvider = ({\n value,\n toaster,\n library,\n libraryMode,\n rendererFallback,\n overlayEnvironment,\n rendererSetup,\n children,\n}: CratisComponentsProviderProps) => {\n const resolved = useMemo(\n () =>\n withLegacyLocaleMessages(mergeCratisComponentsConfig(value), value?.messages),\n [value],\n );\n\n return (\n <RendererRoot\n library={library}\n libraryMode={libraryMode}\n rendererFallback={rendererFallback}\n overlayEnvironment={overlayEnvironment}\n rendererSetup={rendererSetup}\n >\n <CratisComponentsContext.Provider value={resolved}>\n <I18nProvider locale={validLocale(resolved.locale)}>\n {children}\n {toaster && (\n <Toaster {...(typeof toaster === 'object' ? toaster : {})} />\n )}\n </I18nProvider>\n </CratisComponentsContext.Provider>\n </RendererRoot>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAaA,MAAM,YAAY,GAAG,qBAAqB;AA+QnC,MAAM,2BAA2B,GAAG,CACvC,KAAyC,KACjB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,EAAE,IAAI,CAA2B;IACpE,OAAO,KAAK,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,MAAM;AACvF;AAEA,MAAM,wBAAwB,GAAG,CAC7B,MAA8B,EAC9B,gBAAsD,KAC9B;IACxB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS;AAC1E,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,MAAM;IAC1B,OAAO;AACH,QAAA,GAAG,MAAM;AACT,QAAA,QAAQ,EAA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CAAC,QAAQ,CAAC,MAAM,CAAC,EAAA,QAAA,EAAA,CAC7C,QAAQ,EACR,OAAO,KACJD,GAAA,CAAC,OAAO,QAAM,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC,GAAI,CAChE,CAAA,EAAA,CACU,EAAA,CACgB,EAAA,CACxB;AAEvB;;"}
|
|
1
|
+
{"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo, type ReactNode } from 'react';\nimport { I18nProvider } from 'react-aria-components/I18nProvider';\nimport { merge } from 'ts-deepmerge';\nimport { Toaster, type ToasterProps } from '../Notifications/Toaster';\nimport { unstable_RendererRoot } from '../renderer/RendererContext';\nimport type { CratisRendererSetup, unstable_UiLibrary } from '../renderer/manifest';\nimport type { CratisOverlayEnvironment } from '../renderer/overlayEnvironment';\nimport { CratisComponentsContext } from '../configuration/CratisComponentsContext';\nimport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\n\nconst RendererRoot = unstable_RendererRoot;\n\nexport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nexport { useCratisComponentsConfig } from '../configuration/CratisComponentsContext';\n\n/** Localizable labels owned by the Cratis paginator. */\nexport interface CratisPaginatorMessages {\n /** Pagination navigation-region name. */\n navigation?: string;\n /** First-page action label. */\n first?: string;\n /** Previous-page action label. */\n previous?: string;\n /** Next-page action label. */\n next?: string;\n /** Last-page action label. */\n last?: string;\n /** Builds a numbered page button's accessible name from its one-based page number. */\n page?: (page: number) => string;\n /** Accessible name for the numbered-page group. */\n pages?: string;\n /** Builds the visible range text from the one-based start, the clamped end and the total. Defaults to `start–end of total`. */\n range?: (start: number, end: number, total: number) => string;\n}\n\n/** Localizable labels owned by the Cratis date picker composition. */\nexport interface CratisDatePickerMessages {\n /** Today action label. */\n today?: string;\n /** Clear action label. */\n clear?: string;\n /** Calendar-trigger label. */\n openCalendar?: string;\n /** Previous-month action label. */\n previousMonth?: string;\n /** Next-month action label. */\n nextMonth?: string;\n /**\n * Accessible name for the segmented date input when neither an explicit\n * `aria-label` nor a `placeholder` is supplied. Previously an orphaned\n * `'Date'` literal with no override path.\n */\n label?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Dropdown} composition. */\nexport interface CratisDropdownMessages {\n /** Accessible name for the options-popover trigger. */\n showOptions?: string;\n /** Accessible name for the clear-selection action. */\n clearSelection?: string;\n}\n\n/**\n * Localizable action and dismissal labels shared by every Cratis-owned dialog\n * surface — {@link Dialog}, {@link CommandDialog}, and {@link StepperCommandDialog}.\n */\nexport interface CratisDialogMessages {\n /** Primary confirmation label (the `Ok` action in `DialogButtons.Ok*`). */\n ok?: string;\n /** Cancellation label (the `Cancel` action, and the Stepper footer Cancel). */\n cancel?: string;\n /** Affirmative label (the `Yes` action in `DialogButtons.YesNo*`). */\n yes?: string;\n /** Negative label (the `No` action in `DialogButtons.YesNo*`). */\n no?: string;\n /** Accessible name for the header close (×) action. */\n close?: string;\n /**\n * Polite announcement made when a confirm is refused and the dialog stays open\n * (validation failure or business rule). Defaults to\n * 'The action was not completed. Review the dialog and try again.'\n */\n refused?: string;\n}\n\n/** Localizable navigation labels owned by {@link CommandStepper} / {@link StepperCommandDialog}. */\nexport interface CratisStepperMessages {\n /** Advance-to-next-step action label. */\n next?: string;\n /** Return-to-previous-step action label. */\n previous?: string;\n /** Final-step submit action label. */\n submit?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toaster}. */\nexport interface CratisNotificationsMessages {\n /** Accessible name for a toast's dismiss action. */\n dismiss?: string;\n /** Accessible name for the toast region landmark. */\n region?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link DataTableCore} composition. */\nexport interface CratisDataTableMessages {\n /** Accessible name for a single-selection row control. */\n selectRow?: string;\n /** Accessible name for the select-all control in a multiple-selection header. */\n selectAllRows?: string;\n /** Placeholder for the loaded-page search input. */\n search?: string;\n /** Accessible name for the loaded-page search input. */\n searchAriaLabel?: string;\n /** Message shown while loading an empty table. */\n loading?: string;\n /** Message shown when a query fails. */\n failed?: string;\n /** Message shown when a query denies access. */\n unauthorized?: string;\n /** Message shown when a search or filter leaves no rows on the loaded page. */\n filteredEmpty?: string;\n /** Message shown when a search or filter leaves no rows in server mode. */\n filteredEmptyServer?: string;\n}\n\n/** Localizable accessible names for the Cratis filter panel and its searches. */\nexport interface CratisFilterMessages {\n /** FilterPanel dialog name. Defaults to 'Filters'. */\n label?: string;\n /**\n * Search-input name for FilterPanel, its option groups, and standalone CheckboxListFilter.\n * Unset by default so an effective search placeholder retains precedence over 'Search'.\n * PivotViewer supplies group-specific names instead of using this shared name for its groups.\n */\n searchAriaLabel?: string;\n}\n\n/** Localizable labels owned by the Cratis column-filter popup. */\nexport interface CratisColumnFilterMessages {\n /** Builds the filter-trigger accessible name from the effective field. */\n filterTriggerAriaLabel?: (field: string) => string;\n /** Builds the value-control accessible name from the effective field. */\n valueAriaLabel?: (field: string) => string;\n /** Accessible name for the match-mode selector. */\n matchModeAriaLabel?: string;\n /** Localizes a match mode while retaining its default label as fallback input. */\n matchModeLabel?: (mode: string, defaultLabel: string) => string;\n /** Clear action label. */\n clear?: string;\n /** Apply action label. */\n apply?: string;\n /** Boolean true option label. */\n true?: string;\n /** Boolean false option label. */\n false?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toolbar} composition. */\nexport interface CratisToolbarMessages {\n /** Accessible toolbar name used when neither `aria-label` nor `aria-labelledby` is supplied. */\n label?: string;\n /** Accessible name of the close button in a drawer {@link ToolbarFolder}. Defaults to 'Close'. */\n closeDrawer?: string;\n}\n\n/** Components-owned message groups. */\nexport interface CratisComponentsMessages {\n /** Paginator labels. */\n paginator?: CratisPaginatorMessages;\n /** Date-picker labels. */\n datePicker?: CratisDatePickerMessages;\n /** Dropdown labels. */\n dropdown?: CratisDropdownMessages;\n /** Dialog action/dismissal labels shared by Dialog, CommandDialog, and StepperCommandDialog. */\n dialog?: CratisDialogMessages;\n /** Stepper navigation labels shared by CommandStepper and StepperCommandDialog. */\n stepper?: CratisStepperMessages;\n /** Toaster labels. */\n notifications?: CratisNotificationsMessages;\n /** DataTable search, selection, and query-state messages. */\n dataTable?: CratisDataTableMessages;\n /** FilterPanel dialog and search-input accessible names. */\n filter?: CratisFilterMessages;\n /** Column-filter popup labels and match-mode copy. */\n columnFilter?: CratisColumnFilterMessages;\n /** Toolbar accessible-name fallback. */\n toolbar?: CratisToolbarMessages;\n}\n\n/**\n * Components-owned icon vocabulary. Every name is a concept the library draws in more than one\n * place; registering one replaces that concept's built-in glyph everywhere it is drawn, without\n * touching the surrounding element, its part, or its accessible name.\n *\n * Resolution per site is `per-component prop → provider icon → built-in glyph`: a named prop such\n * as `Dialog`'s `closeIcon` means \"this one call site\" and keeps winning, while the provider\n * replaces the built-in default for the whole product. Registering nothing renders exactly what the\n * library renders today, because the built-in glyph stays at its call site and is never part of\n * {@link cratisDefaults}.\n *\n * A name registered as `null` draws no glyph while the button, its part, and its accessible name\n * remain — the same meaning `closeIcon={null}` already has.\n */\nexport interface CratisComponentsIcons {\n /** Dismissal mark. Drawn by `Dialog`'s header close, `Toaster`'s dismiss, `ChatSidebar`, the `Chat` panel, and the PivotViewer detail panel. Defaults to `×`. */\n close?: ReactNode;\n /** Remove-this-value mark. Drawn by `TagGroup`'s tag remove, `Chip`'s remove control, and `CommandForm`'s chips field. Defaults to `×`. */\n remove?: ReactNode;\n /** Expand/collapse chevron on a closed-by-default surface. Drawn by `Dropdown`'s trigger and `ComboBox`'s trigger. Defaults to `⌄` (`▾` in `ComboBox`). */\n expand?: ReactNode;\n /** Ascending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▲`. */\n sortAscending?: ReactNode;\n /** Descending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▼`. */\n sortDescending?: ReactNode;\n /** Step-backwards mark. Drawn by `TablePaginator`'s previous page and the date picker's previous month. Defaults to `‹`. */\n previous?: ReactNode;\n /** Step-forwards mark. Drawn by `TablePaginator`'s next page and the date picker's next month. Defaults to `›`. */\n next?: ReactNode;\n /** Clear-the-current-value mark. Drawn by `Dropdown`'s clear-selection action and the PivotViewer filter panel's clear action. Defaults to `×`. */\n clear?: ReactNode;\n}\n\ninterface LegacyLocaleMessages {\n today?: string;\n clear?: string;\n aria?: {\n navigation?: string;\n firstPageLabel?: string;\n prevPageLabel?: string;\n nextPageLabel?: string;\n lastPageLabel?: string;\n };\n [message: string]: unknown;\n}\n\n/** Renderer-independent application configuration for Components. */\nexport interface CratisComponentsConfig {\n /** BCP 47 locale used by React Aria for dates, numbers, and interaction announcements. */\n locale?: string;\n /** Cratis-owned labels not supplied by the platform's internationalization APIs. */\n messages?: CratisComponentsMessages;\n /** Cratis-owned icon vocabulary replacing the built-in glyphs the library draws. */\n icons?: CratisComponentsIcons;\n /**\n * @deprecated Use {@link messages}; React Aria supplies its own locale data.\n */\n locales?: Record<string, LegacyLocaleMessages>;\n}\n\n/** Props for the application-root Components provider. */\nexport interface CratisComponentsProviderProps {\n /** Locale and Components-owned messages. */\n value?: CratisComponentsConfig;\n /** Mounts the global toaster with defaults or explicit options. */\n toaster?: boolean | ToasterProps;\n /**\n * Selects one stable presentation library. The broader generic manifest and ordered,\n * last-wins composition form remain experimental.\n */\n library?: unstable_UiLibrary | readonly unstable_UiLibrary[];\n /** Experimental profile-promise behavior. Defaults to strict. */\n libraryMode?: 'strict' | 'degrade';\n /** Terminal slot fallback behavior. Defaults to the built-in Core implementation. */\n rendererFallback?: 'core' | 'throw';\n /** Host environment for overlay portal containers. */\n overlayEnvironment?: CratisOverlayEnvironment;\n /**\n * Non-secret renderer setup attestations. Values are booleans so credentials and license\n * tokens never cross the Components provider boundary.\n */\n rendererSetup?: CratisRendererSetup;\n /** Application content. */\n children: ReactNode;\n}\n\n/**\n * Deep-merges consumer configuration over {@link cratisDefaults}.\n *\n * `icons` merges by name only. An icon value is an opaque node — often a React element — so it is\n * carried over by identity instead of being deep-merged into, while a partial map still leaves every\n * unregistered name to its built-in glyph.\n */\nexport const mergeCratisComponentsConfig = (\n value: CratisComponentsConfig | undefined,\n): CratisComponentsConfig => {\n const { icons, ...rest } = value ?? {};\n const merged = merge(cratisDefaults, rest) as CratisComponentsConfig;\n return icons ? { ...merged, icons: { ...cratisDefaults.icons, ...icons } } : merged;\n};\n\nconst withLegacyLocaleMessages = (\n config: CratisComponentsConfig,\n explicitMessages: CratisComponentsMessages | undefined,\n): CratisComponentsConfig => {\n const legacy = config.locale ? config.locales?.[config.locale] : undefined;\n if (!legacy) return config;\n return {\n ...config,\n messages: {\n ...config.messages,\n paginator: {\n ...config.messages?.paginator,\n navigation:\n explicitMessages?.paginator?.navigation ??\n legacy.aria?.navigation ??\n config.messages?.paginator?.navigation,\n first:\n explicitMessages?.paginator?.first ??\n legacy.aria?.firstPageLabel ??\n config.messages?.paginator?.first,\n previous:\n explicitMessages?.paginator?.previous ??\n legacy.aria?.prevPageLabel ??\n config.messages?.paginator?.previous,\n next:\n explicitMessages?.paginator?.next ??\n legacy.aria?.nextPageLabel ??\n config.messages?.paginator?.next,\n last:\n explicitMessages?.paginator?.last ??\n legacy.aria?.lastPageLabel ??\n config.messages?.paginator?.last,\n },\n datePicker: {\n ...config.messages?.datePicker,\n today:\n explicitMessages?.datePicker?.today ??\n legacy.today ??\n config.messages?.datePicker?.today,\n clear:\n explicitMessages?.datePicker?.clear ??\n legacy.clear ??\n config.messages?.datePicker?.clear,\n openCalendar:\n explicitMessages?.datePicker?.openCalendar ??\n config.messages?.datePicker?.openCalendar,\n previousMonth:\n explicitMessages?.datePicker?.previousMonth ??\n config.messages?.datePicker?.previousMonth,\n nextMonth:\n explicitMessages?.datePicker?.nextMonth ??\n config.messages?.datePicker?.nextMonth,\n },\n },\n };\n};\n\nconst validLocale = (locale: string | undefined) => {\n if (!locale) return 'en-US';\n try {\n return new Intl.Locale(locale).toString();\n } catch {\n return 'en-US';\n }\n};\n\n/** Application root for locale, labels, and the optional app-wide toaster. */\nexport const CratisComponentsProvider = ({\n value,\n toaster,\n library,\n libraryMode,\n rendererFallback,\n overlayEnvironment,\n rendererSetup,\n children,\n}: CratisComponentsProviderProps) => {\n const resolved = useMemo(\n () =>\n withLegacyLocaleMessages(mergeCratisComponentsConfig(value), value?.messages),\n [value],\n );\n\n return (\n <RendererRoot\n library={library}\n libraryMode={libraryMode}\n rendererFallback={rendererFallback}\n overlayEnvironment={overlayEnvironment}\n rendererSetup={rendererSetup}\n >\n <CratisComponentsContext.Provider value={resolved}>\n <I18nProvider locale={validLocale(resolved.locale)}>\n {children}\n {toaster && (\n <Toaster {...(typeof toaster === 'object' ? toaster : {})} />\n )}\n </I18nProvider>\n </CratisComponentsContext.Provider>\n </RendererRoot>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAaA,MAAM,YAAY,GAAG,qBAAqB;AAiRnC,MAAM,2BAA2B,GAAG,CACvC,KAAyC,KACjB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,EAAE,IAAI,CAA2B;IACpE,OAAO,KAAK,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,MAAM;AACvF;AAEA,MAAM,wBAAwB,GAAG,CAC7B,MAA8B,EAC9B,gBAAsD,KAC9B;IACxB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS;AAC1E,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,MAAM;IAC1B,OAAO;AACH,QAAA,GAAG,MAAM;AACT,QAAA,QAAQ,EAAE;YACN,GAAG,MAAM,CAAC,QAAQ;AAClB,YAAA,SAAS,EAAE;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QAAQ,EACR,OAAO,KACJD,GAAA,CAAC,OAAO,QAAM,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC,GAAI,CAChE,CAAA,EAAA,CACU,EAAA,CACgB,EAAA,CACxB;AAEvB;;"}
|
|
@@ -56,6 +56,8 @@ export interface TablePaginatorProps {
|
|
|
56
56
|
page?: (page: number) => string;
|
|
57
57
|
/** Accessible name for the numbered-page group. */
|
|
58
58
|
pages?: string;
|
|
59
|
+
/** Builds the visible range text from the one-based start, the clamped end and the total. Defaults to `start–end of total`. */
|
|
60
|
+
range?: (start: number, end: number, total: number) => string;
|
|
59
61
|
};
|
|
60
62
|
/** Extra class name for the paginator container. */
|
|
61
63
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePaginator.d.ts","sourceRoot":"","sources":["../../../DataTables/TablePaginator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAkB,CAAC;AAMpD,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IAChC,kCAAkC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACtC,gCAAgC;IAChC,KAAK,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IACxC,wCAAwC;IACxC,IAAI,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IACvC,qCAAqC;IACrC,KAAK,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACvC,wCAAwC;IACxC,IAAI,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;IAC/C,kDAAkD;IAClD,QAAQ,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAC3C,+BAA+B;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,kCAAkC;IAClC,QAA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AAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,iFAAiF;QACjF,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;QAChC,mDAAmD;QACnD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,+HAA+H;QAC/H,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;KACjE,CAAC;IACF,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,EAAE,CAAC,EAAE,mBAAmB,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAQD;;;GAGG;AACH,eAAO,MAAM,cAAc,UAAW,mBAAmB,+FAMxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePaginator.js","sources":["../../../DataTables/TablePaginator.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ButtonHTMLAttributes, HTMLAttributes } from 'react';\nimport type { ButtonParts } from '../Common/Button';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport { TablePaginatorImplementation } from './TablePaginatorImplementation';\n\n/** Stable Cratis-owned paginator parts. */\nexport interface TablePaginatorParts {\n /** Pagination navigation root. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Loaded item-range report. */\n range?: HTMLAttributes<HTMLSpanElement>;\n /** Current page / page-count report. */\n info?: HTMLAttributes<HTMLSpanElement>;\n /** Numbered-page group container. */\n pages?: HTMLAttributes<HTMLDivElement>;\n /** Each numbered-page native button. */\n page?: ButtonHTMLAttributes<HTMLButtonElement>;\n /** Non-interactive gap between numbered pages. */\n ellipsis?: HTMLAttributes<HTMLSpanElement>;\n /** First-page Button parts. */\n first?: ButtonParts;\n /** Previous-page Button parts. */\n previous?: ButtonParts;\n /** Next-page Button parts. */\n next?: ButtonParts;\n /** Last-page Button parts. */\n last?: ButtonParts;\n}\n\n/** Props for {@link TablePaginator}. */\nexport interface TablePaginatorProps {\n /** The current page, zero-based. */\n page: number;\n /** The total number of pages. */\n pageCount: number;\n /** Invoked with the requested zero-based page. */\n onPageChange: (page: number) => void;\n /** Total number of records across all pages — enables the \"X–Y of Z\" range report. */\n totalItems?: number;\n /** Rows per page — enables the \"X–Y of Z\" range report. */\n pageSize?: number;\n /**\n * Shows numbered page buttons instead of the page-count report. Defaults to false.\n * Pass true for one sibling and one boundary page, or customize the window sizes.\n */\n pageLinks?:\n | boolean\n | {\n /** Number of pages on each side of the current page. Defaults to 1. */\n siblings?: number;\n /** Number of pages at each end of the range. Defaults to 1. */\n boundaries?: number;\n };\n /** Accessible names for the paginator and its controls. Override any to localize. */\n ariaLabels?: {\n navigation?: string;\n first?: string;\n previous?: string;\n next?: string;\n last?: string;\n /** Builds a numbered button's accessible name from its one-based page number. */\n page?: (page: number) => string;\n /** Accessible name for the numbered-page group. */\n pages?: string;\n };\n /** Extra class name for the paginator container. */\n className?: string;\n /** Cratis-owned paginator part attributes. */\n pt?: TablePaginatorParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n}\n\nconst coreTablePaginatorDeclaration = Object.freeze({\n mode: 'atomic',\n fidelity: 'native',\n render: TablePaginatorImplementation,\n}) satisfies unstable_SlotDeclaration<'datatables.paginator'>;\n\n/**\n * A first/previous/next/last paginator with optional numbered page links. The Cratis data tables drive paging through Arc's\n * paging hook and receive requested zero-based pages through `onPageChange`.\n */\nexport const TablePaginator = (props: TablePaginatorProps) => {\n const declaration = unstable_useSlot(\n 'datatables.paginator',\n coreTablePaginatorDeclaration,\n );\n return renderSlot(declaration, props);\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"TablePaginator.js","sources":["../../../DataTables/TablePaginator.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ButtonHTMLAttributes, HTMLAttributes } from 'react';\nimport type { ButtonParts } from '../Common/Button';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport { TablePaginatorImplementation } from './TablePaginatorImplementation';\n\n/** Stable Cratis-owned paginator parts. */\nexport interface TablePaginatorParts {\n /** Pagination navigation root. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Loaded item-range report. */\n range?: HTMLAttributes<HTMLSpanElement>;\n /** Current page / page-count report. */\n info?: HTMLAttributes<HTMLSpanElement>;\n /** Numbered-page group container. */\n pages?: HTMLAttributes<HTMLDivElement>;\n /** Each numbered-page native button. */\n page?: ButtonHTMLAttributes<HTMLButtonElement>;\n /** Non-interactive gap between numbered pages. */\n ellipsis?: HTMLAttributes<HTMLSpanElement>;\n /** First-page Button parts. */\n first?: ButtonParts;\n /** Previous-page Button parts. */\n previous?: ButtonParts;\n /** Next-page Button parts. */\n next?: ButtonParts;\n /** Last-page Button parts. */\n last?: ButtonParts;\n}\n\n/** Props for {@link TablePaginator}. */\nexport interface TablePaginatorProps {\n /** The current page, zero-based. */\n page: number;\n /** The total number of pages. */\n pageCount: number;\n /** Invoked with the requested zero-based page. */\n onPageChange: (page: number) => void;\n /** Total number of records across all pages — enables the \"X–Y of Z\" range report. */\n totalItems?: number;\n /** Rows per page — enables the \"X–Y of Z\" range report. */\n pageSize?: number;\n /**\n * Shows numbered page buttons instead of the page-count report. Defaults to false.\n * Pass true for one sibling and one boundary page, or customize the window sizes.\n */\n pageLinks?:\n | boolean\n | {\n /** Number of pages on each side of the current page. Defaults to 1. */\n siblings?: number;\n /** Number of pages at each end of the range. Defaults to 1. */\n boundaries?: number;\n };\n /** Accessible names for the paginator and its controls. Override any to localize. */\n ariaLabels?: {\n navigation?: string;\n first?: string;\n previous?: string;\n next?: string;\n last?: string;\n /** Builds a numbered button's accessible name from its one-based page number. */\n page?: (page: number) => string;\n /** Accessible name for the numbered-page group. */\n pages?: string;\n /** Builds the visible range text from the one-based start, the clamped end and the total. Defaults to `start–end of total`. */\n range?: (start: number, end: number, total: number) => string;\n };\n /** Extra class name for the paginator container. */\n className?: string;\n /** Cratis-owned paginator part attributes. */\n pt?: TablePaginatorParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n}\n\nconst coreTablePaginatorDeclaration = Object.freeze({\n mode: 'atomic',\n fidelity: 'native',\n render: TablePaginatorImplementation,\n}) satisfies unstable_SlotDeclaration<'datatables.paginator'>;\n\n/**\n * A first/previous/next/last paginator with optional numbered page links. The Cratis data tables drive paging through Arc's\n * paging hook and receive requested zero-based pages through `onPageChange`.\n */\nexport const TablePaginator = (props: TablePaginatorProps) => {\n const declaration = unstable_useSlot(\n 'datatables.paginator',\n coreTablePaginatorDeclaration,\n );\n return renderSlot(declaration, props);\n};\n"],"names":[],"mappings":";;;;AAkFA,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;AAChD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,4BAA4B;AACvC,CAAA,CAA4D;AAMtD,MAAM,cAAc,GAAG,CAAC,KAA0B,KAAI;IACzD,MAAM,WAAW,GAAG,gBAAgB,CAChC,sBAAsB,EACtB,6BAA6B,CAChC;AACD,IAAA,OAAO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC;AACzC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePaginatorImplementation.d.ts","sourceRoot":"","sources":["../../../DataTables/TablePaginatorImplementation.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AAI5D;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,mGAUtC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"TablePaginatorImplementation.d.ts","sourceRoot":"","sources":["../../../DataTables/TablePaginatorImplementation.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AAI5D;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,mGAUtC,mBAAmB,gCA0GrB,CAAC"}
|
|
@@ -17,7 +17,7 @@ const TablePaginatorImplementation = ({ page, pageCount, onPageChange, totalItem
|
|
|
17
17
|
const icon = useCratisIcon();
|
|
18
18
|
const isFirst = page <= 0;
|
|
19
19
|
const isLast = page >= pageCount - 1;
|
|
20
|
-
const rangeReport = paginatorRange(page, pageSize, totalItems);
|
|
20
|
+
const rangeReport = paginatorRange(page, pageSize, totalItems, ariaLabels?.range ?? paginatorMessages?.range);
|
|
21
21
|
const labels = {
|
|
22
22
|
navigation: ariaLabels?.navigation ?? paginatorMessages?.navigation ?? 'Pagination',
|
|
23
23
|
first: ariaLabels?.first ?? paginatorMessages?.first ?? 'First page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePaginatorImplementation.js","sources":["../../../DataTables/TablePaginatorImplementation.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Button } from '../Common/Button';\nimport { useCratisComponentsConfig } from '../Common/CratisComponentsProvider';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\nimport type { TablePaginatorProps } from './TablePaginator';\nimport { paginatorRange } from './paginatorRange';\nimport { TablePaginatorPages } from './TablePaginatorPages';\n\n/**\n * A minimal first/previous/next/last paginator. The\n * Cratis data tables drive paging through Arc's paging hook rather than the\n * table's internal pagination — so this renders the page controls wired to a\n * simple `onPageChange(pageIndex)` callback.\n */\nexport const TablePaginatorImplementation = ({\n page,\n pageCount,\n onPageChange,\n totalItems,\n pageSize,\n pageLinks = false,\n ariaLabels,\n className,\n pt,\n}: TablePaginatorProps) => {\n const { messages } = useCratisComponentsConfig();\n const paginatorMessages = messages?.paginator;\n const icon = useCratisIcon();\n const isFirst = page <= 0;\n const isLast = page >= pageCount - 1;\n const rangeReport = paginatorRange(page
|
|
1
|
+
{"version":3,"file":"TablePaginatorImplementation.js","sources":["../../../DataTables/TablePaginatorImplementation.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Button } from '../Common/Button';\nimport { useCratisComponentsConfig } from '../Common/CratisComponentsProvider';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\nimport type { TablePaginatorProps } from './TablePaginator';\nimport { paginatorRange } from './paginatorRange';\nimport { TablePaginatorPages } from './TablePaginatorPages';\n\n/**\n * A minimal first/previous/next/last paginator. The\n * Cratis data tables drive paging through Arc's paging hook rather than the\n * table's internal pagination — so this renders the page controls wired to a\n * simple `onPageChange(pageIndex)` callback.\n */\nexport const TablePaginatorImplementation = ({\n page,\n pageCount,\n onPageChange,\n totalItems,\n pageSize,\n pageLinks = false,\n ariaLabels,\n className,\n pt,\n}: TablePaginatorProps) => {\n const { messages } = useCratisComponentsConfig();\n const paginatorMessages = messages?.paginator;\n const icon = useCratisIcon();\n const isFirst = page <= 0;\n const isLast = page >= pageCount - 1;\n const rangeReport = paginatorRange(\n page,\n pageSize,\n totalItems,\n ariaLabels?.range ?? paginatorMessages?.range,\n );\n const labels = {\n navigation:\n ariaLabels?.navigation ?? paginatorMessages?.navigation ?? 'Pagination',\n first: ariaLabels?.first ?? paginatorMessages?.first ?? 'First page',\n previous: ariaLabels?.previous ?? paginatorMessages?.previous ?? 'Previous page',\n next: ariaLabels?.next ?? paginatorMessages?.next ?? 'Next page',\n last: ariaLabels?.last ?? paginatorMessages?.last ?? 'Last page',\n page:\n ariaLabels?.page ??\n paginatorMessages?.page ??\n ((number: number) => `Page ${number}`),\n pages: ariaLabels?.pages ?? paginatorMessages?.pages ?? 'Pages',\n };\n\n return (\n <div\n {...pt?.root}\n role='navigation'\n aria-label={labels.navigation}\n data-cratis-part='root'\n className={['cratis-table-paginator', pt?.root?.className, className]\n .filter(Boolean)\n .join(' ')}\n >\n {rangeReport && (\n <span\n {...pt?.range}\n className={['cratis-table-paginator-range', pt?.range?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='range'\n >\n {rangeReport}\n </span>\n )}\n <Button\n variant='ghost'\n disabled={isFirst}\n onClick={() => onPageChange(0)}\n aria-label={labels.first}\n pt={pt?.first}\n >\n <span aria-hidden='true'>«</span>\n </Button>\n <Button\n variant='ghost'\n disabled={isFirst}\n onClick={() => onPageChange(page - 1)}\n aria-label={labels.previous}\n pt={pt?.previous}\n >\n <span aria-hidden='true'>{icon('previous', '‹')}</span>\n </Button>\n {pageLinks ? (\n <TablePaginatorPages\n page={page}\n pageCount={pageCount}\n pageLinks={pageLinks}\n onPageChange={onPageChange}\n pt={pt}\n pageLabel={labels.page}\n pagesLabel={labels.pages}\n />\n ) : (\n <span\n {...pt?.info}\n className={['cratis-table-paginator-info', pt?.info?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='info'\n >\n {page + 1} / {Math.max(pageCount, 1)}\n </span>\n )}\n <Button\n variant='ghost'\n disabled={isLast}\n onClick={() => onPageChange(page + 1)}\n aria-label={labels.next}\n pt={pt?.next}\n >\n <span aria-hidden='true'>{icon('next', '›')}</span>\n </Button>\n <Button\n variant='ghost'\n disabled={isLast}\n onClick={() => onPageChange(pageCount - 1)}\n aria-label={labels.last}\n pt={pt?.last}\n >\n <span aria-hidden='true'>»</span>\n </Button>\n </div>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;AAgBO,MAAM,4BAA4B,GAAG,CAAC,EACzC,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,GAAG,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|
|
9
|
+
* @param format - Optional message builder receiving the one-based start, the
|
|
10
|
+
* clamped end and the total. Defaults to the English `start–end of total`.
|
|
9
11
|
*/
|
|
10
|
-
export declare function paginatorRange(page: number, pageSize: number | undefined, totalItems: number | undefined): string | undefined;
|
|
12
|
+
export declare function paginatorRange(page: number, pageSize: number | undefined, totalItems: number | undefined, format?: (start: number, end: number, total: number) => string): string | undefined;
|
|
11
13
|
//# sourceMappingURL=paginatorRange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginatorRange.d.ts","sourceRoot":"","sources":["../../../DataTables/paginatorRange.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"paginatorRange.d.ts","sourceRoot":"","sources":["../../../DataTables/paginatorRange.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,MAAM,GAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAA6D,GACrH,MAAM,GAAG,SAAS,CAKpB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function paginatorRange(page, pageSize, totalItems) {
|
|
1
|
+
function paginatorRange(page, pageSize, totalItems, format = (start, end, total) => `${start}–${end} of ${total}`) {
|
|
2
2
|
if (totalItems === undefined || pageSize === undefined || totalItems <= 0)
|
|
3
3
|
return undefined;
|
|
4
4
|
const start = page * pageSize + 1;
|
|
5
5
|
const end = Math.min((page + 1) * pageSize, totalItems);
|
|
6
|
-
return
|
|
6
|
+
return format(start, end, totalItems);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { paginatorRange };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginatorRange.js","sources":["../../../DataTables/paginatorRange.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Formats the \"X–Y of Z\" range report for a zero-based page, or `undefined`\n * when the totals are unknown or there are no records. The end is clamped to\n * the total so the last (partial) page reports correctly.\n *\n * @param page - Zero-based current page.\n * @param pageSize - Rows per page.\n * @param totalItems - Total records across all pages.\n */\nexport function paginatorRange(page: number
|
|
1
|
+
{"version":3,"file":"paginatorRange.js","sources":["../../../DataTables/paginatorRange.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Formats the \"X–Y of Z\" range report for a zero-based page, or `undefined`\n * when the totals are unknown or there are no records. The end is clamped to\n * the total so the last (partial) page reports correctly.\n *\n * @param page - Zero-based current page.\n * @param pageSize - Rows per page.\n * @param totalItems - Total records across all pages.\n * @param format - Optional message builder receiving the one-based start, the\n * clamped end and the total. Defaults to the English `start–end of total`.\n */\nexport function paginatorRange(\n page: number,\n pageSize: number | undefined,\n totalItems: number | undefined,\n format: (start: number, end: number, total: number) => string = (start, end, total) => `${start}–${end} of ${total}`,\n): string | undefined {\n if (totalItems === undefined || pageSize === undefined || totalItems <= 0) return undefined;\n const start = page * pageSize + 1;\n const end = Math.min((page + 1) * pageSize, totalItems);\n return format(start, end, totalItems);\n}\n"],"names":[],"mappings":"AAcM,SAAU,cAAc,CAC1B,IAAY,EACZ,QAA4B,EAC5B,UAA8B,EAC9B,MAAA,GAAgE,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,KAAK,CAAA,EAAG,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,IAAA,EAAO,KAAK,CAAA,CAAE,EAAA;IAEpH,IAAI,UAAU,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,IAAI,UAAU,IAAI,CAAC;AAAE,QAAA,OAAO,SAAS;AAC3F,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,QAAQ,GAAG,CAAC;AACjC,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,QAAQ,EAAE,UAAU,CAAC;IACvD,OAAO,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC;AACzC;;"}
|
package/package.json
CHANGED