@cratis/components 4.38.1 → 4.39.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/Chat/ChatSidebar.d.ts.map +1 -1
- package/dist/esm/Chat/ChatSidebar.js +2 -2
- package/dist/esm/Chat/ChatSidebar.js.map +1 -1
- package/dist/esm/CommandDialog/CommandDialog.d.ts +1 -1
- package/dist/esm/CommandDialog/CommandDialog.d.ts.map +1 -1
- package/dist/esm/CommandDialog/CommandDialog.js +5 -2
- package/dist/esm/CommandDialog/CommandDialog.js.map +1 -1
- package/dist/esm/CommandDialog/CommandStepperContent.js +1 -1
- package/dist/esm/CommandDialog/CommandStepperContent.js.map +1 -1
- package/dist/esm/CommandDialog/StepperCommandDialog.d.ts +7 -0
- package/dist/esm/CommandDialog/StepperCommandDialog.d.ts.map +1 -1
- package/dist/esm/CommandDialog/StepperCommandDialog.js +4 -4
- package/dist/esm/CommandDialog/StepperCommandDialog.js.map +1 -1
- package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/CheckboxField.js +1 -1
- package/dist/esm/CommandForm/fields/CheckboxField.js.map +1 -1
- package/dist/esm/CommandForm/fields/ChipsField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/ChipsField.js +1 -1
- package/dist/esm/CommandForm/fields/ChipsField.js.map +1 -1
- package/dist/esm/CommandForm/fields/ColorPickerField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/ColorPickerField.js +1 -1
- package/dist/esm/CommandForm/fields/ColorPickerField.js.map +1 -1
- package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/NumberField.js +1 -1
- package/dist/esm/CommandForm/fields/NumberField.js.map +1 -1
- package/dist/esm/CommandForm/fields/PasswordField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/PasswordField.js +1 -1
- package/dist/esm/CommandForm/fields/PasswordField.js.map +1 -1
- package/dist/esm/CommandForm/fields/RadioButtonField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/RadioButtonField.js +1 -1
- package/dist/esm/CommandForm/fields/RadioButtonField.js.map +1 -1
- package/dist/esm/CommandForm/fields/RadioGroupField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/RadioGroupField.js +1 -1
- package/dist/esm/CommandForm/fields/RadioGroupField.js.map +1 -1
- package/dist/esm/CommandForm/fields/RatingField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/RatingField.js +1 -1
- package/dist/esm/CommandForm/fields/RatingField.js.map +1 -1
- package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/SliderField.js +1 -1
- package/dist/esm/CommandForm/fields/SliderField.js.map +1 -1
- package/dist/esm/CommandForm/fields/ToggleSwitchField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/ToggleSwitchField.js +1 -1
- package/dist/esm/CommandForm/fields/ToggleSwitchField.js.map +1 -1
- package/dist/esm/Common/ActionMenubar.d.ts.map +1 -1
- package/dist/esm/Common/ActionMenubar.js +1 -1
- package/dist/esm/Common/ActionMenubar.js.map +1 -1
- package/dist/esm/Common/Breadcrumbs.d.ts.map +1 -1
- package/dist/esm/Common/Breadcrumbs.js +1 -1
- package/dist/esm/Common/Breadcrumbs.js.map +1 -1
- package/dist/esm/Common/Button.d.ts.map +1 -1
- package/dist/esm/Common/Button.js +4 -1
- package/dist/esm/Common/Button.js.map +1 -1
- package/dist/esm/Common/CheckboxImplementation.d.ts.map +1 -1
- package/dist/esm/Common/CheckboxImplementation.js +1 -1
- package/dist/esm/Common/CheckboxImplementation.js.map +1 -1
- package/dist/esm/Common/ComboBox.js +1 -1
- package/dist/esm/Common/ComboBox.js.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.d.ts +14 -1
- package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.js +6 -2
- package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
- package/dist/esm/Common/DatePickerInputImplementation.d.ts.map +1 -1
- package/dist/esm/Common/DatePickerInputImplementation.js +1 -1
- package/dist/esm/Common/DatePickerInputImplementation.js.map +1 -1
- package/dist/esm/Common/FormElement.js +1 -1
- package/dist/esm/Common/FormElement.js.map +1 -1
- package/dist/esm/Common/IconButton.d.ts.map +1 -1
- package/dist/esm/Common/IconButton.js +4 -1
- package/dist/esm/Common/IconButton.js.map +1 -1
- package/dist/esm/Common/NumberInput.d.ts.map +1 -1
- package/dist/esm/Common/NumberInput.js +1 -1
- package/dist/esm/Common/NumberInput.js.map +1 -1
- package/dist/esm/Common/Page.d.ts +1 -1
- package/dist/esm/Common/Page.d.ts.map +1 -1
- package/dist/esm/Common/Page.js +11 -2
- package/dist/esm/Common/Page.js.map +1 -1
- package/dist/esm/Common/RadioImplementation.d.ts.map +1 -1
- package/dist/esm/Common/RadioImplementation.js +1 -1
- package/dist/esm/Common/RadioImplementation.js.map +1 -1
- package/dist/esm/Common/SurfaceImplementation.d.ts.map +1 -1
- package/dist/esm/Common/SurfaceImplementation.js +1 -1
- package/dist/esm/Common/SurfaceImplementation.js.map +1 -1
- package/dist/esm/Common/SwitchImplementation.d.ts.map +1 -1
- package/dist/esm/Common/SwitchImplementation.js +1 -1
- package/dist/esm/Common/SwitchImplementation.js.map +1 -1
- package/dist/esm/Common/Tabs.d.ts.map +1 -1
- package/dist/esm/Common/Tabs.js +1 -1
- package/dist/esm/Common/Tabs.js.map +1 -1
- package/dist/esm/Common/TagGroup.d.ts.map +1 -1
- package/dist/esm/Common/TagGroup.js +1 -1
- package/dist/esm/Common/TagGroup.js.map +1 -1
- package/dist/esm/Common/TextArea.d.ts.map +1 -1
- package/dist/esm/Common/TextArea.js +4 -1
- package/dist/esm/Common/TextArea.js.map +1 -1
- package/dist/esm/Common/TextInput.d.ts.map +1 -1
- package/dist/esm/Common/TextInput.js +4 -1
- package/dist/esm/Common/TextInput.js.map +1 -1
- package/dist/esm/Common/ToggleGroup.d.ts.map +1 -1
- package/dist/esm/Common/ToggleGroup.js +1 -1
- package/dist/esm/Common/ToggleGroup.js.map +1 -1
- package/dist/esm/Common/buttonDescriptor.d.ts +7 -0
- package/dist/esm/Common/buttonDescriptor.d.ts.map +1 -0
- package/dist/esm/Common/buttonDescriptor.js +28 -0
- package/dist/esm/Common/buttonDescriptor.js.map +1 -0
- package/dist/esm/Common/textFieldDescriptors.d.ts +7 -0
- package/dist/esm/Common/textFieldDescriptors.d.ts.map +1 -0
- package/dist/esm/Common/textFieldDescriptors.js +25 -0
- package/dist/esm/Common/textFieldDescriptors.js.map +1 -0
- package/dist/esm/ComponentPicker/ComponentHighlight.d.ts +14 -0
- package/dist/esm/ComponentPicker/ComponentHighlight.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/ComponentHighlight.js +12 -0
- package/dist/esm/ComponentPicker/ComponentHighlight.js.map +1 -0
- package/dist/esm/ComponentPicker/ComponentPicker.d.ts +24 -0
- package/dist/esm/ComponentPicker/ComponentPicker.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/ComponentPicker.js +116 -0
- package/dist/esm/ComponentPicker/ComponentPicker.js.map +1 -0
- package/dist/esm/ComponentPicker/ComponentResolver.d.ts +6 -0
- package/dist/esm/ComponentPicker/ComponentResolver.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/ComponentResolver.js +4 -0
- package/dist/esm/ComponentPicker/ComponentResolver.js.map +1 -0
- package/dist/esm/ComponentPicker/HighlightFrame.d.ts +14 -0
- package/dist/esm/ComponentPicker/HighlightFrame.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/HighlightFrame.js +70 -0
- package/dist/esm/ComponentPicker/HighlightFrame.js.map +1 -0
- package/dist/esm/ComponentPicker/PickedAncestor.d.ts +10 -0
- package/dist/esm/ComponentPicker/PickedAncestor.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/PickedAncestor.js +4 -0
- package/dist/esm/ComponentPicker/PickedAncestor.js.map +1 -0
- package/dist/esm/ComponentPicker/PickedComponent.d.ts +23 -0
- package/dist/esm/ComponentPicker/PickedComponent.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/PickedComponent.js +4 -0
- package/dist/esm/ComponentPicker/PickedComponent.js.map +1 -0
- package/dist/esm/ComponentPicker/PickedPresentationProperty.d.ts +22 -0
- package/dist/esm/ComponentPicker/PickedPresentationProperty.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/PickedPresentationProperty.js +4 -0
- package/dist/esm/ComponentPicker/PickedPresentationProperty.js.map +1 -0
- package/dist/esm/ComponentPicker/PickedRect.d.ts +20 -0
- package/dist/esm/ComponentPicker/PickedRect.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/PickedRect.js +4 -0
- package/dist/esm/ComponentPicker/PickedRect.js.map +1 -0
- package/dist/esm/ComponentPicker/PresentationPropertyEditor.d.ts +25 -0
- package/dist/esm/ComponentPicker/PresentationPropertyEditor.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/PresentationPropertyEditor.js +51 -0
- package/dist/esm/ComponentPicker/PresentationPropertyEditor.js.map +1 -0
- package/dist/esm/ComponentPicker/componentElements.d.ts +14 -0
- package/dist/esm/ComponentPicker/componentElements.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/componentElements.js +18 -0
- package/dist/esm/ComponentPicker/componentElements.js.map +1 -0
- package/dist/esm/ComponentPicker/describeComponentElement.d.ts +11 -0
- package/dist/esm/ComponentPicker/describeComponentElement.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/describeComponentElement.js +63 -0
- package/dist/esm/ComponentPicker/describeComponentElement.js.map +1 -0
- package/dist/esm/ComponentPicker/index.d.ts +24 -0
- package/dist/esm/ComponentPicker/index.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/index.js +12 -0
- package/dist/esm/ComponentPicker/index.js.map +1 -0
- package/dist/esm/ComponentPicker/pickerStacking.d.ts +3 -0
- package/dist/esm/ComponentPicker/pickerStacking.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/pickerStacking.js +10 -0
- package/dist/esm/ComponentPicker/pickerStacking.js.map +1 -0
- package/dist/esm/ComponentPicker/proposedChanges.d.ts +11 -0
- package/dist/esm/ComponentPicker/proposedChanges.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/proposedChanges.js +6 -0
- package/dist/esm/ComponentPicker/proposedChanges.js.map +1 -0
- package/dist/esm/ComponentPicker/useComponentPicker.d.ts +30 -0
- package/dist/esm/ComponentPicker/useComponentPicker.d.ts.map +1 -0
- package/dist/esm/ComponentPicker/useComponentPicker.js +31 -0
- package/dist/esm/ComponentPicker/useComponentPicker.js.map +1 -0
- package/dist/esm/ConfigurationEditor/OrderedItemEditor.d.ts.map +1 -1
- package/dist/esm/ConfigurationEditor/OrderedItemEditor.js +1 -1
- package/dist/esm/ConfigurationEditor/OrderedItemEditor.js.map +1 -1
- package/dist/esm/ConfigurationEditor/PropertyControls.d.ts.map +1 -1
- package/dist/esm/ConfigurationEditor/PropertyControls.js +1 -1
- package/dist/esm/ConfigurationEditor/PropertyControls.js.map +1 -1
- package/dist/esm/DataPage/DataPage.js +1 -1
- package/dist/esm/DataPage/DataPage.js.map +1 -1
- package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableCore.js +1 -1
- package/dist/esm/DataTables/DataTableCore.js.map +1 -1
- package/dist/esm/DataTables/DataTableHeaderCell.d.ts +2 -2
- package/dist/esm/DataTables/DataTableHeaderCell.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableHeaderCell.js +7 -2
- package/dist/esm/DataTables/DataTableHeaderCell.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/columnDescriptor.d.ts +4 -0
- package/dist/esm/DataTables/columnDescriptor.d.ts.map +1 -0
- package/dist/esm/DataTables/columnDescriptor.js +10 -0
- package/dist/esm/DataTables/columnDescriptor.js.map +1 -0
- package/dist/esm/Dialogs/Dialog.d.ts +18 -0
- package/dist/esm/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/esm/Dialogs/Dialog.js.map +1 -1
- package/dist/esm/Dialogs/DialogGlobalHeaderActions.d.ts +8 -0
- package/dist/esm/Dialogs/DialogGlobalHeaderActions.d.ts.map +1 -0
- package/dist/esm/Dialogs/DialogGlobalHeaderActions.js +6 -0
- package/dist/esm/Dialogs/DialogGlobalHeaderActions.js.map +1 -0
- package/dist/esm/Dialogs/DialogImplementation.d.ts +1 -1
- package/dist/esm/Dialogs/DialogImplementation.d.ts.map +1 -1
- package/dist/esm/Dialogs/DialogImplementation.js +22 -6
- package/dist/esm/Dialogs/DialogImplementation.js.map +1 -1
- package/dist/esm/Dialogs/dialogDescriptor.d.ts +4 -0
- package/dist/esm/Dialogs/dialogDescriptor.d.ts.map +1 -0
- package/dist/esm/Dialogs/dialogDescriptor.js +12 -0
- package/dist/esm/Dialogs/dialogDescriptor.js.map +1 -0
- package/dist/esm/Dialogs/index.d.ts +3 -0
- package/dist/esm/Dialogs/index.d.ts.map +1 -1
- package/dist/esm/Display/Avatar.d.ts.map +1 -1
- package/dist/esm/Display/Avatar.js +1 -1
- package/dist/esm/Display/Avatar.js.map +1 -1
- package/dist/esm/Display/Badge.d.ts.map +1 -1
- package/dist/esm/Display/Badge.js +1 -1
- package/dist/esm/Display/Badge.js.map +1 -1
- package/dist/esm/Display/Chip.d.ts.map +1 -1
- package/dist/esm/Display/Chip.js +1 -1
- package/dist/esm/Display/Chip.js.map +1 -1
- package/dist/esm/Display/Message.d.ts.map +1 -1
- package/dist/esm/Display/Message.js +1 -1
- package/dist/esm/Display/Message.js.map +1 -1
- package/dist/esm/Display/ProgressBarImplementation.d.ts.map +1 -1
- package/dist/esm/Display/ProgressBarImplementation.js +1 -1
- package/dist/esm/Display/ProgressBarImplementation.js.map +1 -1
- package/dist/esm/Display/ProgressSpinner.d.ts.map +1 -1
- package/dist/esm/Display/ProgressSpinner.js +1 -1
- package/dist/esm/Display/ProgressSpinner.js.map +1 -1
- package/dist/esm/Display/Skeleton.d.ts.map +1 -1
- package/dist/esm/Display/Skeleton.js +1 -1
- package/dist/esm/Display/Skeleton.js.map +1 -1
- package/dist/esm/Display/Tag.d.ts.map +1 -1
- package/dist/esm/Display/Tag.js +1 -1
- package/dist/esm/Display/Tag.js.map +1 -1
- package/dist/esm/Dropdown/DropdownImplementation.js +4 -4
- package/dist/esm/Dropdown/DropdownImplementation.js.map +1 -1
- package/dist/esm/IconPicker/IconPicker.d.ts.map +1 -1
- package/dist/esm/IconPicker/IconPicker.js +1 -1
- package/dist/esm/IconPicker/IconPicker.js.map +1 -1
- package/dist/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/esm/MarkdownEditor/MarkdownEditor.js +1 -1
- package/dist/esm/MarkdownEditor/MarkdownEditor.js.map +1 -1
- package/dist/esm/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/esm/Toolbar/Toolbar.js +1 -1
- package/dist/esm/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/configuration/DialogHeaderActionsRenderer.d.ts +8 -0
- package/dist/esm/configuration/DialogHeaderActionsRenderer.d.ts.map +1 -0
- package/dist/esm/configuration/DialogHeaderActionsRenderer.js +4 -0
- package/dist/esm/configuration/DialogHeaderActionsRenderer.js.map +1 -0
- package/dist/esm/configuration/DialogHeaderContext.d.ts +13 -0
- package/dist/esm/configuration/DialogHeaderContext.d.ts.map +1 -0
- package/dist/esm/configuration/DialogHeaderContext.js +4 -0
- package/dist/esm/configuration/DialogHeaderContext.js.map +1 -0
- package/dist/esm/configuration/DialogSliceLocation.d.ts +13 -0
- package/dist/esm/configuration/DialogSliceLocation.d.ts.map +1 -0
- package/dist/esm/configuration/DialogSliceLocation.js +4 -0
- package/dist/esm/configuration/DialogSliceLocation.js.map +1 -0
- package/dist/esm/configuration/identity/ComponentDescriptor.d.ts +12 -0
- package/dist/esm/configuration/identity/ComponentDescriptor.d.ts.map +1 -0
- package/dist/esm/configuration/identity/ComponentDescriptor.js +4 -0
- package/dist/esm/configuration/identity/ComponentDescriptor.js.map +1 -0
- package/dist/esm/configuration/identity/ComponentMarkerAttributes.d.ts +10 -0
- package/dist/esm/configuration/identity/ComponentMarkerAttributes.d.ts.map +1 -0
- package/dist/esm/configuration/identity/ComponentMarkerAttributes.js +4 -0
- package/dist/esm/configuration/identity/ComponentMarkerAttributes.js.map +1 -0
- package/dist/esm/configuration/identity/PresentationChange.d.ts +11 -0
- package/dist/esm/configuration/identity/PresentationChange.d.ts.map +1 -0
- package/dist/esm/configuration/identity/PresentationChange.js +4 -0
- package/dist/esm/configuration/identity/PresentationChange.js.map +1 -0
- package/dist/esm/configuration/identity/PresentationPropertyDescriptor.d.ts +22 -0
- package/dist/esm/configuration/identity/PresentationPropertyDescriptor.d.ts.map +1 -0
- package/dist/esm/configuration/identity/PresentationPropertyDescriptor.js +4 -0
- package/dist/esm/configuration/identity/PresentationPropertyDescriptor.js.map +1 -0
- package/dist/esm/configuration/identity/PresentationPropertyType.d.ts +3 -0
- package/dist/esm/configuration/identity/PresentationPropertyType.d.ts.map +1 -0
- package/dist/esm/configuration/identity/PresentationPropertyType.js +4 -0
- package/dist/esm/configuration/identity/PresentationPropertyType.js.map +1 -0
- package/dist/esm/configuration/identity/PresentationPropertyValue.d.ts +3 -0
- package/dist/esm/configuration/identity/PresentationPropertyValue.d.ts.map +1 -0
- package/dist/esm/configuration/identity/PresentationPropertyValue.js +4 -0
- package/dist/esm/configuration/identity/PresentationPropertyValue.js.map +1 -0
- package/dist/esm/configuration/identity/RegisteredComponent.d.ts +9 -0
- package/dist/esm/configuration/identity/RegisteredComponent.d.ts.map +1 -0
- package/dist/esm/configuration/identity/RegisteredComponent.js +4 -0
- package/dist/esm/configuration/identity/RegisteredComponent.js.map +1 -0
- package/dist/esm/configuration/identity/componentIdentityAttributes.d.ts +7 -0
- package/dist/esm/configuration/identity/componentIdentityAttributes.d.ts.map +1 -0
- package/dist/esm/configuration/identity/componentIdentityAttributes.js +6 -0
- package/dist/esm/configuration/identity/componentIdentityAttributes.js.map +1 -0
- package/dist/esm/configuration/identity/componentInstances.d.ts +30 -0
- package/dist/esm/configuration/identity/componentInstances.d.ts.map +1 -0
- package/dist/esm/configuration/identity/componentInstances.js +61 -0
- package/dist/esm/configuration/identity/componentInstances.js.map +1 -0
- package/dist/esm/configuration/identity/componentMarker.d.ts +9 -0
- package/dist/esm/configuration/identity/componentMarker.d.ts.map +1 -0
- package/dist/esm/configuration/identity/componentMarker.js +7 -0
- package/dist/esm/configuration/identity/componentMarker.js.map +1 -0
- package/dist/esm/configuration/identity/describeComponent.d.ts +11 -0
- package/dist/esm/configuration/identity/describeComponent.d.ts.map +1 -0
- package/dist/esm/configuration/identity/describeComponent.js +4 -0
- package/dist/esm/configuration/identity/describeComponent.js.map +1 -0
- package/dist/esm/configuration/identity/useComponentPresentation.d.ts +15 -0
- package/dist/esm/configuration/identity/useComponentPresentation.d.ts.map +1 -0
- package/dist/esm/configuration/identity/useComponentPresentation.js +18 -0
- package/dist/esm/configuration/identity/useComponentPresentation.js.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/renderer/dialogStack.d.ts +2 -0
- package/dist/esm/renderer/dialogStack.d.ts.map +1 -1
- package/dist/esm/renderer/dialogStack.js +2 -1
- package/dist/esm/renderer/dialogStack.js.map +1 -1
- package/dist/esm/types/parts.d.ts +25 -2
- package/dist/esm/types/parts.d.ts.map +1 -1
- package/dist/esm/types/parts.js +25 -2
- package/dist/esm/types/parts.js.map +1 -1
- package/package.json +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableCore.js","sources":["../../../DataTables/DataTableCore.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 React, { useId, useMemo, type CSSProperties, type ReactNode } from 'react';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\nimport type { ColumnProps } from './Column';\nimport { classNames } from '../ClassNames/classNames';\nimport type { DataTableFilterMeta } from './DataTableFilterMeta';\nimport { DataTableHeaderCell } from './DataTableHeaderCell';\nimport type { DataTableParts } from './DataTableParts';\nimport type { DataTableRowClickEvent } from './DataTableRowClickEvent';\nimport { DataTableBody } from './DataTableBody';\nimport { DataTableRow } from './DataTableRow';\nimport { DataTableSearch } from './DataTableSearch';\nimport { DataTableRowProcessing } from './DataTableRowProcessing';\nimport type { DataTableSelectionChangeEvent } from './DataTableSelectionChangeEvent';\nimport type { DataTableSort } from './DataTableSort';\nimport { DataTableStatus } from './DataTableStatus';\nimport { isFilterEntryActive } from './matchesFilterEntry';\nimport { processRows } from './processRows';\nimport { useDataTableMessages } from './useDataTableMessages';\nimport { useDataTableState } from './useDataTableState';\nimport { useRowSelection } from './useRowSelection';\n\nexport type { DataTableParts } from './DataTableParts';\nexport type { DataTableRowClickEvent } from './DataTableRowClickEvent';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nconst useColumns = (children: React.ReactNode): React.ReactElement<ColumnProps<any>>[] =>\n useMemo(\n () =>\n React.Children.toArray(children).filter(\n React.isValidElement,\n ) as React.ReactElement<ColumnProps<any>>[],\n [children],\n );\n\n/** Props for the semantic loaded-page DataTable renderer. */\nexport interface DataTableCoreProps<TData extends object> {\n /** Loaded page rows. */\n data: TData[];\n /** Declarative {@link Column} markers. */\n children?: ReactNode;\n /** Row property used as stable identity. Required to preserve selection across refreshed row objects. */\n dataKey?: string;\n /** Content shown when the loaded page has no matching rows. */\n emptyMessage: ReactNode;\n /**\n * Content shown instead of {@link emptyMessage} when a search or column filter is active and no\n * rows are shown. Defaults to a localizable message that names the loaded page, or a neutral\n * one when the server applies the search.\n */\n filteredEmptyMessage?: ReactNode;\n /** Table display state. Defaults to ready. */\n status?: DataTableStatus;\n /** Message shown while loading without rows. */\n loadingMessage?: ReactNode;\n /** Message shown for a failed query. */\n failureMessage?: ReactNode;\n /** Message shown for an unauthorized query. */\n unauthorizedMessage?: ReactNode;\n /**\n * Enables row selection. `'single'` selects one row at a time through row activation;\n * `'multiple'` adds per-row checkboxes and a select-all header checkbox, and reports through\n * {@link onSelectedItemsChange} rather than {@link onSelectionChange}.\n */\n selectionMode?: 'single' | 'multiple';\n /** Accessible name for row selection controls. Falls back to the provider's `dataTable.selectRow` message, then `'Select row'`. */\n selectionAriaLabel?: string;\n /** Accessible name for the select-all control. Falls back to the provider's `dataTable.selectAllRows` message, then `'Select all rows'`. */\n selectAllAriaLabel?: string;\n /** Controlled selected row. Applies to `selectionMode='single'`. */\n selection?: TData | null;\n /** Invoked when the single-row selection changes. */\n onSelectionChange?: (event: DataTableSelectionChangeEvent<TData>) => void;\n /** Controlled selected rows. Applies to `selectionMode='multiple'`. */\n selectedItems?: TData[];\n /** Invoked with the full set of selected rows when a multiple selection changes. */\n onSelectedItemsChange?: (items: TData[]) => void;\n /** Invoked when a row is clicked or keyboard activated. */\n onRowClick?: (event: DataTableRowClickEvent<TData>) => void;\n /** Builds an extra class name for one row. */\n rowClassName?: (rowData: TData) => string;\n /** Row fields searched on the loaded page. */\n globalFilterFields?: string[];\n /** Placeholder for the loaded-page search input. Falls back to the provider's `dataTable.search` message, then `'Search…'`. */\n globalSearchPlaceholder?: string;\n /** Accessible name for the loaded-page search input. Falls back to the provider's `dataTable.searchAriaLabel` message, then `'Search table'`. */\n globalSearchAriaLabel?: string;\n /** Initial per-field filter constraints. */\n defaultFilters?: DataTableFilterMeta;\n /** Controlled per-field filter constraints. Leave undefined to let the table keep its own. */\n filters?: DataTableFilterMeta;\n /** Invoked when applied field filters change. */\n onFilter?: (filters: DataTableFilterMeta) => void;\n /** Controlled search text. Leave undefined to let the table keep its own. */\n globalFilter?: string;\n /** Invoked when the search text changes. */\n onGlobalFilterChange?: (globalFilter: string) => void;\n /** Controlled sort; null means not sorted. Leave undefined to let the table keep its own. */\n sort?: DataTableSort | null;\n /** Invoked when a sortable column header changes the sort. */\n onSortChange?: (sort: DataTableSort | null) => void;\n /**\n * Whether the table filters and sorts the rows it is given (default:\n * {@link DataTableRowProcessing.Loaded}). Use {@link DataTableRowProcessing.None} when the\n * source already applied the controlled filter and sort state.\n */\n rowProcessing?: DataTableRowProcessing;\n /** Enables the bounded scroll container. */\n scrollable?: boolean;\n /** Scroll-container maximum height. */\n scrollHeight?: string;\n /** Extra class name for the table composition. */\n className?: string;\n /** Inline style for the table composition. */\n style?: CSSProperties;\n /** Cratis-owned per-part attributes. */\n pt?: DataTableParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n}\n\n/** A semantic, renderer-independent data table over one already-loaded page. */\nexport const DataTableCore = <TData extends object>({\n data,\n children,\n dataKey,\n emptyMessage,\n filteredEmptyMessage,\n status = DataTableStatus.Ready,\n loadingMessage,\n failureMessage,\n unauthorizedMessage,\n selectionMode,\n selectionAriaLabel,\n selectAllAriaLabel,\n selection,\n onSelectionChange,\n selectedItems,\n onSelectedItemsChange,\n onRowClick,\n rowClassName,\n globalFilterFields,\n globalSearchPlaceholder,\n globalSearchAriaLabel,\n defaultFilters,\n filters: filtersProp,\n onFilter,\n globalFilter: globalFilterProp,\n onGlobalFilterChange,\n sort: sortProp,\n onSortChange,\n rowProcessing = DataTableRowProcessing.Loaded,\n scrollable,\n scrollHeight,\n className,\n style,\n pt,\n}: DataTableCoreProps<TData>) => {\n const messages = useDataTableMessages({\n selectionAriaLabel,\n selectAllAriaLabel,\n globalSearchPlaceholder,\n globalSearchAriaLabel,\n loadingMessage,\n failureMessage,\n unauthorizedMessage,\n filteredEmptyMessage,\n }, rowProcessing === DataTableRowProcessing.None);\n const {\n resolvedSelectionAriaLabel,\n resolvedSelectAllAriaLabel,\n resolvedGlobalSearchPlaceholder,\n resolvedGlobalSearchAriaLabel,\n } = messages;\n const isBusy = status === DataTableStatus.Loading && data.length > 0;\n const icon = useCratisIcon();\n const sortAscendingIcon = icon('sortAscending', '▲');\n const sortDescendingIcon = icon('sortDescending', '▼');\n const columns = useColumns(children);\n const selectionGroupName = useId();\n const { filters, updateFilter, globalFilter, setGlobalFilter, sort, setSort } =\n useDataTableState({\n defaultFilters,\n filters: filtersProp,\n onFilter,\n globalFilter: globalFilterProp,\n onGlobalFilterChange,\n sort: sortProp,\n onSortChange,\n });\n\n const isServerMode = rowProcessing === DataTableRowProcessing.None;\n const isFiltered =\n (globalFilter.trim() !== '' && !!globalFilterFields?.length) ||\n Object.values(filters).some(isFilterEntryActive);\n const filteredRows = useMemo(\n () =>\n processRows(data, {\n filters,\n globalFilter,\n globalFilterFields,\n sort,\n rowProcessing,\n }),\n [data, filters, globalFilter, globalFilterFields, sort, rowProcessing],\n );\n const {\n dataKeyIdentity,\n isSelectedRow,\n isRowSelected,\n toggleRowSelection,\n allFilteredRowsSelected,\n selectAllRef,\n toggleSelectAll,\n } = useRowSelection({\n data,\n visibleRows: filteredRows.map(({ row }) => row),\n dataKey,\n selection,\n selectedItems,\n onSelectedItemsChange,\n });\n const isInteractive =\n Boolean(onRowClick) || selectionMode === 'single' || selectionMode === 'multiple';\n\n const activateRow = (\n row: TData,\n index: number,\n originalEvent: React.SyntheticEvent,\n ) => {\n onRowClick?.({ data: row, index });\n if (selectionMode === 'single') {\n onSelectionChange?.({ value: row, originalEvent });\n }\n if (selectionMode === 'multiple') {\n toggleRowSelection(row);\n }\n };\n\n return (\n <div\n {...pt?.root}\n className={classNames(\n 'cratis-datatable',\n scrollable ? 'cratis-datatable--scrollable' : undefined,\n pt?.root?.className,\n className,\n )}\n style={{ ...pt?.root?.style, ...style }}\n data-cratis-part='root'\n data-busy={isBusy || undefined}\n >\n {!!globalFilterFields?.length && (\n <DataTableSearch\n parts={pt}\n value={globalFilter}\n placeholder={resolvedGlobalSearchPlaceholder}\n ariaLabel={resolvedGlobalSearchAriaLabel}\n onChange={setGlobalFilter}\n />\n )}\n <div\n {...pt?.tableContainer}\n className={classNames(\n 'cratis-datatable__container',\n pt?.tableContainer?.className,\n )}\n style={{\n ...pt?.tableContainer?.style,\n ...(scrollable\n ? { maxHeight: scrollHeight ?? '100%', overflow: 'auto' }\n : {}),\n }}\n data-cratis-part='table-container'\n >\n <table\n {...pt?.table}\n className={classNames(\n 'cratis-datatable__table',\n pt?.table?.className,\n )}\n data-cratis-part='table'\n aria-busy={isBusy || undefined}\n >\n <thead\n {...pt?.head}\n className={classNames(\n 'cratis-datatable__head',\n pt?.head?.className,\n )}\n data-cratis-part='head'\n >\n <tr\n {...pt?.headerRow}\n className={classNames(\n 'cratis-datatable__header-row',\n pt?.headerRow?.className,\n )}\n data-cratis-part='header-row'\n >\n {columns.map((column, index) => (\n <DataTableHeaderCell\n key={index}\n column={column}\n parts={pt}\n sort={sort}\n onSort={setSort}\n filters={filters}\n updateFilter={updateFilter}\n resolvedSelectionAriaLabel={\n resolvedSelectionAriaLabel\n }\n resolvedSelectAllAriaLabel={\n resolvedSelectAllAriaLabel\n }\n allFilteredRowsSelected={allFilteredRowsSelected}\n selectAllRef={selectAllRef}\n toggleSelectAll={toggleSelectAll}\n sortAscendingIcon={sortAscendingIcon}\n sortDescendingIcon={sortDescendingIcon}\n />\n ))}\n </tr>\n </thead>\n <DataTableBody\n status={status}\n hasLoadedRows={data.length > 0}\n rowCount={filteredRows.length}\n columnCount={columns.length}\n parts={pt}\n messages={messages}\n emptyMessage={emptyMessage}\n isFiltered={isFiltered && (isServerMode || data.length > 0)}\n renderRows={() =>\n filteredRows.map(({ row, loadedIndex }) => {\n const identity = dataKey\n ? dataKeyIdentity(row)\n : 'loaded-row';\n const isSelected =\n selectionMode === 'single' &&\n isSelectedRow(row, loadedIndex);\n return (\n <DataTableRow<TData>\n key={`${identity}::${loadedIndex}`}\n row={row}\n columns={columns}\n parts={pt}\n selectionMode={selectionMode}\n isSelected={isSelected}\n isInteractive={isInteractive}\n isRowSelected={isRowSelected(row)}\n rowClassName={rowClassName}\n resolvedSelectionAriaLabel={\n resolvedSelectionAriaLabel\n }\n selectionGroupName={selectionGroupName}\n onActivate={(event) =>\n activateRow(row, loadedIndex, event)\n }\n onToggleSelection={() => toggleRowSelection(row)}\n />\n );\n })\n }\n />\n </table>\n </div>\n </div>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;AA6BA,MAAM,UAAU,GAAG,CAAC,QAAyB,KACzC,OAAO,CACH,MACI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACnC,KAAK,CAAC,cAAc,CACmB,EAC/C,CAAC,QAAQ,CAAC,CACb;AA+FE,MAAM,aAAa,GAAG,CAAuB,EAChD,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,MAAM,GAAG,eAAe,CAAC,KAAK,EAC9B,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,OAAO,EAAE,WAAW,EACpB,QAAQ,EACR,YAAY,EAAE,gBAAgB,EAC9B,oBAAoB,EACpB,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,aAAa,GAAG,sBAAsB,CAAC,MAAM,EAC7C,UAAU,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,EAAE,GACsB,KAAI;IAC5B,MAAM,QAAQ,GAAG,oBAAoB,CAAC;QAClC,kBAAkB;QAClB,kBAAkB;QAClB,uBAAuB;QACvB,qBAAqB;QACrB,cAAc;QACd,cAAc;QACd,mBAAmB;QACnB,oBAAoB;AACvB,KAAA,EAAE,aAAa,KAAK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GAAG,CAAC,EAAA,EAhB3C,GAAG,QAAQ,CAAA,EAAA,EAAK,WAAW,CAAA,CAAE,CAiBpC;AAEV,4BAAA,CAAC,CAAC,EAAA,CAER,CAAA,EAAA,CACE,EAAA,CACN,CAAA,EAAA,CACJ;AAEd;;"}
|
|
1
|
+
{"version":3,"file":"DataTableCore.js","sources":["../../../DataTables/DataTableCore.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 React, { useId, useMemo, type CSSProperties, type ReactNode } from 'react';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\nimport type { ColumnProps } from './Column';\nimport { classNames } from '../ClassNames/classNames';\nimport type { DataTableFilterMeta } from './DataTableFilterMeta';\nimport { DataTableHeaderCell } from './DataTableHeaderCell';\nimport type { DataTableParts } from './DataTableParts';\nimport type { DataTableRowClickEvent } from './DataTableRowClickEvent';\nimport { DataTableBody } from './DataTableBody';\nimport { DataTableRow } from './DataTableRow';\nimport { DataTableSearch } from './DataTableSearch';\nimport { DataTableRowProcessing } from './DataTableRowProcessing';\nimport type { DataTableSelectionChangeEvent } from './DataTableSelectionChangeEvent';\nimport type { DataTableSort } from './DataTableSort';\nimport { DataTableStatus } from './DataTableStatus';\nimport { isFilterEntryActive } from './matchesFilterEntry';\nimport { processRows } from './processRows';\nimport { useDataTableMessages } from './useDataTableMessages';\nimport { useDataTableState } from './useDataTableState';\nimport { useRowSelection } from './useRowSelection';\n\nexport type { DataTableParts } from './DataTableParts';\nexport type { DataTableRowClickEvent } from './DataTableRowClickEvent';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nconst useColumns = (children: React.ReactNode): React.ReactElement<ColumnProps<any>>[] =>\n useMemo(\n () =>\n React.Children.toArray(children).filter(\n React.isValidElement,\n ) as React.ReactElement<ColumnProps<any>>[],\n [children],\n );\n\n/** Props for the semantic loaded-page DataTable renderer. */\nexport interface DataTableCoreProps<TData extends object> {\n /** Loaded page rows. */\n data: TData[];\n /** Declarative {@link Column} markers. */\n children?: ReactNode;\n /** Row property used as stable identity. Required to preserve selection across refreshed row objects. */\n dataKey?: string;\n /** Content shown when the loaded page has no matching rows. */\n emptyMessage: ReactNode;\n /**\n * Content shown instead of {@link emptyMessage} when a search or column filter is active and no\n * rows are shown. Defaults to a localizable message that names the loaded page, or a neutral\n * one when the server applies the search.\n */\n filteredEmptyMessage?: ReactNode;\n /** Table display state. Defaults to ready. */\n status?: DataTableStatus;\n /** Message shown while loading without rows. */\n loadingMessage?: ReactNode;\n /** Message shown for a failed query. */\n failureMessage?: ReactNode;\n /** Message shown for an unauthorized query. */\n unauthorizedMessage?: ReactNode;\n /**\n * Enables row selection. `'single'` selects one row at a time through row activation;\n * `'multiple'` adds per-row checkboxes and a select-all header checkbox, and reports through\n * {@link onSelectedItemsChange} rather than {@link onSelectionChange}.\n */\n selectionMode?: 'single' | 'multiple';\n /** Accessible name for row selection controls. Falls back to the provider's `dataTable.selectRow` message, then `'Select row'`. */\n selectionAriaLabel?: string;\n /** Accessible name for the select-all control. Falls back to the provider's `dataTable.selectAllRows` message, then `'Select all rows'`. */\n selectAllAriaLabel?: string;\n /** Controlled selected row. Applies to `selectionMode='single'`. */\n selection?: TData | null;\n /** Invoked when the single-row selection changes. */\n onSelectionChange?: (event: DataTableSelectionChangeEvent<TData>) => void;\n /** Controlled selected rows. Applies to `selectionMode='multiple'`. */\n selectedItems?: TData[];\n /** Invoked with the full set of selected rows when a multiple selection changes. */\n onSelectedItemsChange?: (items: TData[]) => void;\n /** Invoked when a row is clicked or keyboard activated. */\n onRowClick?: (event: DataTableRowClickEvent<TData>) => void;\n /** Builds an extra class name for one row. */\n rowClassName?: (rowData: TData) => string;\n /** Row fields searched on the loaded page. */\n globalFilterFields?: string[];\n /** Placeholder for the loaded-page search input. Falls back to the provider's `dataTable.search` message, then `'Search…'`. */\n globalSearchPlaceholder?: string;\n /** Accessible name for the loaded-page search input. Falls back to the provider's `dataTable.searchAriaLabel` message, then `'Search table'`. */\n globalSearchAriaLabel?: string;\n /** Initial per-field filter constraints. */\n defaultFilters?: DataTableFilterMeta;\n /** Controlled per-field filter constraints. Leave undefined to let the table keep its own. */\n filters?: DataTableFilterMeta;\n /** Invoked when applied field filters change. */\n onFilter?: (filters: DataTableFilterMeta) => void;\n /** Controlled search text. Leave undefined to let the table keep its own. */\n globalFilter?: string;\n /** Invoked when the search text changes. */\n onGlobalFilterChange?: (globalFilter: string) => void;\n /** Controlled sort; null means not sorted. Leave undefined to let the table keep its own. */\n sort?: DataTableSort | null;\n /** Invoked when a sortable column header changes the sort. */\n onSortChange?: (sort: DataTableSort | null) => void;\n /**\n * Whether the table filters and sorts the rows it is given (default:\n * {@link DataTableRowProcessing.Loaded}). Use {@link DataTableRowProcessing.None} when the\n * source already applied the controlled filter and sort state.\n */\n rowProcessing?: DataTableRowProcessing;\n /** Enables the bounded scroll container. */\n scrollable?: boolean;\n /** Scroll-container maximum height. */\n scrollHeight?: string;\n /** Extra class name for the table composition. */\n className?: string;\n /** Inline style for the table composition. */\n style?: CSSProperties;\n /** Cratis-owned per-part attributes. */\n pt?: DataTableParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n}\n\n/** A semantic, renderer-independent data table over one already-loaded page. */\nexport const DataTableCore = <TData extends object>({\n data,\n children,\n dataKey,\n emptyMessage,\n filteredEmptyMessage,\n status = DataTableStatus.Ready,\n loadingMessage,\n failureMessage,\n unauthorizedMessage,\n selectionMode,\n selectionAriaLabel,\n selectAllAriaLabel,\n selection,\n onSelectionChange,\n selectedItems,\n onSelectedItemsChange,\n onRowClick,\n rowClassName,\n globalFilterFields,\n globalSearchPlaceholder,\n globalSearchAriaLabel,\n defaultFilters,\n filters: filtersProp,\n onFilter,\n globalFilter: globalFilterProp,\n onGlobalFilterChange,\n sort: sortProp,\n onSortChange,\n rowProcessing = DataTableRowProcessing.Loaded,\n scrollable,\n scrollHeight,\n className,\n style,\n pt,\n}: DataTableCoreProps<TData>) => {\n const messages = useDataTableMessages({\n selectionAriaLabel,\n selectAllAriaLabel,\n globalSearchPlaceholder,\n globalSearchAriaLabel,\n loadingMessage,\n failureMessage,\n unauthorizedMessage,\n filteredEmptyMessage,\n }, rowProcessing === DataTableRowProcessing.None);\n const {\n resolvedSelectionAriaLabel,\n resolvedSelectAllAriaLabel,\n resolvedGlobalSearchPlaceholder,\n resolvedGlobalSearchAriaLabel,\n } = messages;\n const isBusy = status === DataTableStatus.Loading && data.length > 0;\n const icon = useCratisIcon();\n const sortAscendingIcon = icon('sortAscending', '▲');\n const sortDescendingIcon = icon('sortDescending', '▼');\n const columns = useColumns(children);\n const selectionGroupName = useId();\n const { filters, updateFilter, globalFilter, setGlobalFilter, sort, setSort } =\n useDataTableState({\n defaultFilters,\n filters: filtersProp,\n onFilter,\n globalFilter: globalFilterProp,\n onGlobalFilterChange,\n sort: sortProp,\n onSortChange,\n });\n\n const isServerMode = rowProcessing === DataTableRowProcessing.None;\n const isFiltered =\n (globalFilter.trim() !== '' && !!globalFilterFields?.length) ||\n Object.values(filters).some(isFilterEntryActive);\n const filteredRows = useMemo(\n () =>\n processRows(data, {\n filters,\n globalFilter,\n globalFilterFields,\n sort,\n rowProcessing,\n }),\n [data, filters, globalFilter, globalFilterFields, sort, rowProcessing],\n );\n const {\n dataKeyIdentity,\n isSelectedRow,\n isRowSelected,\n toggleRowSelection,\n allFilteredRowsSelected,\n selectAllRef,\n toggleSelectAll,\n } = useRowSelection({\n data,\n visibleRows: filteredRows.map(({ row }) => row),\n dataKey,\n selection,\n selectedItems,\n onSelectedItemsChange,\n });\n const isInteractive =\n Boolean(onRowClick) || selectionMode === 'single' || selectionMode === 'multiple';\n\n const activateRow = (\n row: TData,\n index: number,\n originalEvent: React.SyntheticEvent,\n ) => {\n onRowClick?.({ data: row, index });\n if (selectionMode === 'single') {\n onSelectionChange?.({ value: row, originalEvent });\n }\n if (selectionMode === 'multiple') {\n toggleRowSelection(row);\n }\n };\n\n return (\n <div\n {...pt?.root}\n className={classNames(\n 'cratis-datatable',\n scrollable ? 'cratis-datatable--scrollable' : undefined,\n pt?.root?.className,\n className,\n )}\n style={{ ...pt?.root?.style, ...style }}\n data-cratis-part='root'\n data-cratis-component='DataTableCore'\n data-busy={isBusy || undefined}\n >\n {!!globalFilterFields?.length && (\n <DataTableSearch\n parts={pt}\n value={globalFilter}\n placeholder={resolvedGlobalSearchPlaceholder}\n ariaLabel={resolvedGlobalSearchAriaLabel}\n onChange={setGlobalFilter}\n />\n )}\n <div\n {...pt?.tableContainer}\n className={classNames(\n 'cratis-datatable__container',\n pt?.tableContainer?.className,\n )}\n style={{\n ...pt?.tableContainer?.style,\n ...(scrollable\n ? { maxHeight: scrollHeight ?? '100%', overflow: 'auto' }\n : {}),\n }}\n data-cratis-part='table-container'\n >\n <table\n {...pt?.table}\n className={classNames(\n 'cratis-datatable__table',\n pt?.table?.className,\n )}\n data-cratis-part='table'\n aria-busy={isBusy || undefined}\n >\n <thead\n {...pt?.head}\n className={classNames(\n 'cratis-datatable__head',\n pt?.head?.className,\n )}\n data-cratis-part='head'\n >\n <tr\n {...pt?.headerRow}\n className={classNames(\n 'cratis-datatable__header-row',\n pt?.headerRow?.className,\n )}\n data-cratis-part='header-row'\n >\n {columns.map((column, index) => (\n <DataTableHeaderCell\n key={index}\n column={column}\n parts={pt}\n sort={sort}\n onSort={setSort}\n filters={filters}\n updateFilter={updateFilter}\n resolvedSelectionAriaLabel={\n resolvedSelectionAriaLabel\n }\n resolvedSelectAllAriaLabel={\n resolvedSelectAllAriaLabel\n }\n allFilteredRowsSelected={allFilteredRowsSelected}\n selectAllRef={selectAllRef}\n toggleSelectAll={toggleSelectAll}\n sortAscendingIcon={sortAscendingIcon}\n sortDescendingIcon={sortDescendingIcon}\n />\n ))}\n </tr>\n </thead>\n <DataTableBody\n status={status}\n hasLoadedRows={data.length > 0}\n rowCount={filteredRows.length}\n columnCount={columns.length}\n parts={pt}\n messages={messages}\n emptyMessage={emptyMessage}\n isFiltered={isFiltered && (isServerMode || data.length > 0)}\n renderRows={() =>\n filteredRows.map(({ row, loadedIndex }) => {\n const identity = dataKey\n ? dataKeyIdentity(row)\n : 'loaded-row';\n const isSelected =\n selectionMode === 'single' &&\n isSelectedRow(row, loadedIndex);\n return (\n <DataTableRow<TData>\n key={`${identity}::${loadedIndex}`}\n row={row}\n columns={columns}\n parts={pt}\n selectionMode={selectionMode}\n isSelected={isSelected}\n isInteractive={isInteractive}\n isRowSelected={isRowSelected(row)}\n rowClassName={rowClassName}\n resolvedSelectionAriaLabel={\n resolvedSelectionAriaLabel\n }\n selectionGroupName={selectionGroupName}\n onActivate={(event) =>\n activateRow(row, loadedIndex, event)\n }\n onToggleSelection={() => toggleRowSelection(row)}\n />\n );\n })\n }\n />\n </table>\n </div>\n </div>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;AA6BA,MAAM,UAAU,GAAG,CAAC,QAAyB,KACzC,OAAO,CACH,MACI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACnC,KAAK,CAAC,cAAc,CACmB,EAC/C,CAAC,QAAQ,CAAC,CACb;AA+FE,MAAM,aAAa,GAAG,CAAuB,EAChD,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,MAAM,GAAG,eAAe,CAAC,KAAK,EAC9B,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,OAAO,EAAE,WAAW,EACpB,QAAQ,EACR,YAAY,EAAE,gBAAgB,EAC9B,oBAAoB,EACp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K,EAAE,EAAE,EACT,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,CAAC,GAAG,CAAC,EACjC,YAAY,EAAE,YAAY,EAC1B,0BAA0B,EACtB,0BAA0B,EAE9B,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,EAAE,CAAC,KAAK,KACd,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,CAAC,EAExC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC,GAAG,CAAC,EAAA,EAhB3C,GAAG,QAAQ,CAAA,EAAA,EAAK,WAAW,CAAA,CAAE,CAiBpC;AAEV,4BAAA,CAAC,CAAC,EAAA,CAER,CAAA,EAAA,CACE,EAAA,CACN,CAAA,EAAA,CACJ;AAEd;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactElement, type ReactNode, type RefObject } from 'react';
|
|
2
2
|
import type { ColumnProps } from './Column.js';
|
|
3
3
|
import type { DataTableFilterConstraint, DataTableFilterMeta } from './DataTableFilterMeta.js';
|
|
4
4
|
import type { DataTableParts } from './DataTableParts.js';
|
|
@@ -21,5 +21,5 @@ export interface DataTableHeaderCellProps {
|
|
|
21
21
|
sortDescendingIcon: ReactNode;
|
|
22
22
|
}
|
|
23
23
|
/** One column header: its label, sort control, filter menu, and select-all or selection label. */
|
|
24
|
-
export declare const DataTableHeaderCell: ({ column, parts: pt, sort, onSort, filters, updateFilter, resolvedSelectionAriaLabel, resolvedSelectAllAriaLabel, allFilteredRowsSelected, selectAllRef, toggleSelectAll, sortAscendingIcon, sortDescendingIcon, }: DataTableHeaderCellProps) => import("react").JSX.Element;
|
|
24
|
+
export declare const DataTableHeaderCell: ({ column: declaredColumn, parts: pt, sort, onSort, filters, updateFilter, resolvedSelectionAriaLabel, resolvedSelectAllAriaLabel, allFilteredRowsSelected, selectAllRef, toggleSelectAll, sortAscendingIcon, sortDescendingIcon, }: DataTableHeaderCellProps) => import("react").JSX.Element;
|
|
25
25
|
//# sourceMappingURL=DataTableHeaderCell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableHeaderCell.d.ts","sourceRoot":"","sources":["../../../DataTables/DataTableHeaderCell.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"DataTableHeaderCell.d.ts","sourceRoot":"","sources":["../../../DataTables/DataTableHeaderCell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAG5C,OAAO,KAAK,EACR,yBAAyB,EACzB,mBAAmB,EACtB,MAAM,0BAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAiB,CAAC;AAMrD,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,mCAAmC;IACnC,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,YAAY,EAAE,CACV,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,yBAAyB,GAAG,SAAS,KAChD,IAAI,CAAC;IACV,0BAA0B,EAAE,MAAM,CAAC;IACnC,0BAA0B,EAAE,MAAM,CAAC;IACnC,uBAAuB,EAAE,OAAO,CAAC;IACjC,YAAY,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACjD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,iBAAiB,EAAE,SAAS,CAAC;IAC7B,kBAAkB,EAAE,SAAS,CAAC;CACjC;AAED,kGAAkG;AAClG,eAAO,MAAM,mBAAmB,uOAc7B,wBAAwB,gCAoG1B,CAAC"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { cloneElement } from 'react';
|
|
3
|
+
import { useComponentPresentation } from '../configuration/identity/useComponentPresentation.js';
|
|
4
|
+
import { columnDescriptor } from './columnDescriptor.js';
|
|
2
5
|
import { ColumnFilterMenu } from './ColumnFilterMenu.js';
|
|
3
6
|
import { classNames } from '../ClassNames/classNames.js';
|
|
4
7
|
import { DataTableSortDirection } from './DataTableSortDirection.js';
|
|
5
8
|
import { firstConstraint } from './matchesFilterEntry.js';
|
|
6
9
|
|
|
7
|
-
const DataTableHeaderCell = ({ column, parts: pt, sort, onSort, filters, updateFilter, resolvedSelectionAriaLabel, resolvedSelectAllAriaLabel, allFilteredRowsSelected, selectAllRef, toggleSelectAll, sortAscendingIcon, sortDescendingIcon, }) => {
|
|
10
|
+
const DataTableHeaderCell = ({ column: declaredColumn, parts: pt, sort, onSort, filters, updateFilter, resolvedSelectionAriaLabel, resolvedSelectAllAriaLabel, allFilteredRowsSelected, selectAllRef, toggleSelectAll, sortAscendingIcon, sortDescendingIcon, }) => {
|
|
11
|
+
const [columnProps, marker] = useComponentPresentation(columnDescriptor, declaredColumn.props, declaredColumn.props.field);
|
|
12
|
+
const column = columnProps === declaredColumn.props ? declaredColumn : cloneElement(declaredColumn, columnProps);
|
|
8
13
|
const field = column.props.filterField ?? column.props.field;
|
|
9
14
|
const ariaSort = sort && sort.field === column.props.field ? sort.direction : undefined;
|
|
10
15
|
return (jsx("th", { ...pt?.headerCell, scope: 'col', "aria-label": column.props.selectionMode ? resolvedSelectionAriaLabel : undefined, "aria-sort": ariaSort, style: {
|
|
11
16
|
...pt?.headerCell?.style,
|
|
12
17
|
...column.props.style,
|
|
13
18
|
...column.props.headerStyle,
|
|
14
|
-
}, className: classNames('cratis-datatable__header-cell', pt?.headerCell?.className, column.props.headerClassName), "data-cratis-part": 'header-cell', "data-selected": Boolean(ariaSort) || undefined, children: jsxs("div", { className: 'cratis-datatable-header-cell', "data-cratis-part": 'header-content', "data-selected": Boolean(ariaSort) || undefined, children: [column.props.selectionMode === 'multiple' ? (jsx("input", { type: 'checkbox', "aria-label": resolvedSelectAllAriaLabel, "data-cratis-part": 'select-all', checked: allFilteredRowsSelected, ref: selectAllRef, onChange: toggleSelectAll })) : (column.props.selectionMode && (jsx("span", { className: 'cratis-datatable__sr-only', children: resolvedSelectionAriaLabel }))), column.props.sortable && column.props.field ? (jsxs("button", { type: 'button', className: 'cratis-datatable__sort', "data-cratis-part": 'sort', "data-pressed": Boolean(ariaSort) || undefined, onClick: () => onSort({
|
|
19
|
+
}, className: classNames('cratis-datatable__header-cell', pt?.headerCell?.className, column.props.headerClassName), "data-cratis-part": 'header-cell', ...marker, "data-selected": Boolean(ariaSort) || undefined, children: jsxs("div", { className: 'cratis-datatable-header-cell', "data-cratis-part": 'header-content', "data-selected": Boolean(ariaSort) || undefined, children: [column.props.selectionMode === 'multiple' ? (jsx("input", { type: 'checkbox', "aria-label": resolvedSelectAllAriaLabel, "data-cratis-part": 'select-all', checked: allFilteredRowsSelected, ref: selectAllRef, onChange: toggleSelectAll })) : (column.props.selectionMode && (jsx("span", { className: 'cratis-datatable__sr-only', children: resolvedSelectionAriaLabel }))), column.props.sortable && column.props.field ? (jsxs("button", { type: 'button', className: 'cratis-datatable__sort', "data-cratis-part": 'sort', "data-pressed": Boolean(ariaSort) || undefined, onClick: () => onSort({
|
|
15
20
|
field: column.props.field,
|
|
16
21
|
direction: sort?.field === column.props.field &&
|
|
17
22
|
sort?.direction === DataTableSortDirection.Ascending
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableHeaderCell.js","sources":["../../../DataTables/DataTableHeaderCell.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
|
|
1
|
+
{"version":3,"file":"DataTableHeaderCell.js","sources":["../../../DataTables/DataTableHeaderCell.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 { cloneElement, type ReactElement, type ReactNode, type RefObject } from 'react';\nimport { useComponentPresentation } from '../configuration/identity/useComponentPresentation';\nimport { columnDescriptor } from './columnDescriptor';\nimport type { ColumnProps } from './Column';\nimport { ColumnFilterMenu } from './ColumnFilterMenu';\nimport { classNames } from '../ClassNames/classNames';\nimport type {\n DataTableFilterConstraint,\n DataTableFilterMeta,\n} from './DataTableFilterMeta';\nimport type { DataTableParts } from './DataTableParts';\nimport type { DataTableSort } from './DataTableSort';\nimport { DataTableSortDirection } from './DataTableSortDirection';\nimport { firstConstraint } from './matchesFilterEntry';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/** Props for {@link DataTableHeaderCell}. */\nexport interface DataTableHeaderCellProps {\n column: ReactElement<ColumnProps<any>>;\n /** The table's part attributes. */\n parts?: DataTableParts;\n sort: DataTableSort | null;\n onSort: (sort: DataTableSort) => void;\n filters: DataTableFilterMeta;\n updateFilter: (\n field: string,\n constraint: DataTableFilterConstraint | undefined,\n ) => void;\n resolvedSelectionAriaLabel: string;\n resolvedSelectAllAriaLabel: string;\n allFilteredRowsSelected: boolean;\n selectAllRef: RefObject<HTMLInputElement | null>;\n toggleSelectAll: () => void;\n sortAscendingIcon: ReactNode;\n sortDescendingIcon: ReactNode;\n}\n\n/** One column header: its label, sort control, filter menu, and select-all or selection label. */\nexport const DataTableHeaderCell = ({\n column: declaredColumn,\n parts: pt,\n sort,\n onSort,\n filters,\n updateFilter,\n resolvedSelectionAriaLabel,\n resolvedSelectAllAriaLabel,\n allFilteredRowsSelected,\n selectAllRef,\n toggleSelectAll,\n sortAscendingIcon,\n sortDescendingIcon,\n}: DataTableHeaderCellProps) => {\n const [columnProps, marker] = useComponentPresentation(\n columnDescriptor,\n declaredColumn.props,\n declaredColumn.props.field,\n );\n const column = columnProps === declaredColumn.props ? declaredColumn : cloneElement(declaredColumn, columnProps);\n const field = column.props.filterField ?? column.props.field;\n const ariaSort =\n sort && sort.field === column.props.field ? sort.direction : undefined;\n return (\n <th\n {...pt?.headerCell}\n scope='col'\n aria-label={\n column.props.selectionMode ? resolvedSelectionAriaLabel : undefined\n }\n aria-sort={ariaSort}\n style={{\n ...pt?.headerCell?.style,\n ...column.props.style,\n ...column.props.headerStyle,\n }}\n className={classNames(\n 'cratis-datatable__header-cell',\n pt?.headerCell?.className,\n column.props.headerClassName,\n )}\n data-cratis-part='header-cell'\n {...marker}\n data-selected={Boolean(ariaSort) || undefined}\n >\n <div\n className='cratis-datatable-header-cell'\n data-cratis-part='header-content'\n data-selected={Boolean(ariaSort) || undefined}\n >\n {column.props.selectionMode === 'multiple' ? (\n <input\n type='checkbox'\n aria-label={resolvedSelectAllAriaLabel}\n data-cratis-part='select-all'\n checked={allFilteredRowsSelected}\n ref={selectAllRef}\n onChange={toggleSelectAll}\n />\n ) : (\n column.props.selectionMode && (\n <span className='cratis-datatable__sr-only'>\n {resolvedSelectionAriaLabel}\n </span>\n )\n )}\n {column.props.sortable && column.props.field ? (\n <button\n type='button'\n className='cratis-datatable__sort'\n data-cratis-part='sort'\n data-pressed={Boolean(ariaSort) || undefined}\n onClick={() =>\n onSort({\n field: column.props.field as string,\n direction:\n sort?.field === column.props.field &&\n sort?.direction === DataTableSortDirection.Ascending\n ? DataTableSortDirection.Descending\n : DataTableSortDirection.Ascending,\n })\n }\n >\n <span>{column.props.header}</span>\n {ariaSort && (\n <span aria-hidden='true'>\n {ariaSort === 'ascending'\n ? sortAscendingIcon\n : sortDescendingIcon}\n </span>\n )}\n </button>\n ) : (\n column.props.header\n )}\n {column.props.filter && field && (\n <ColumnFilterMenu\n field={field}\n dataType={column.props.dataType}\n placeholder={column.props.filterPlaceholder}\n showMatchModes={column.props.showFilterMatchModes}\n filterElement={column.props.filterElement}\n filterOptions={column.props.filterOptions}\n labels={column.props.filterLabels}\n pt={column.props.filterPt}\n constraint={firstConstraint(filters[field])}\n onApply={(constraint) => updateFilter(field, constraint)}\n onClear={() => updateFilter(field, undefined)}\n />\n )}\n </div>\n </th>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;AA0CO,MAAM,mBAAmB,GAAG,CAAC,EAChC,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,EAAE,EACT,IAAI,EACJ,MAAM,EACN,OAAO,EACP,YAAY,EACZ,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACK,KAAI;IAC3B,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,wBAAwB,CAClD,gBAAgB,EAChB,cAAc,CAAC,KAAK,EACpB,cAAc,CAAC,KAAK,CAAC,KAAK,CAC7B;IACD,MAAM,MAAM,GAAG,WAAW,KAAK,cAAc,CAAC,KAAK,GAAG,cAAc,GAAG,YAAY,CAAC,cAAc,EAAE,WAAW,CAAC;AAChH,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK;IAC5D,MAAM,QAAQ,GACV,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,SAAS;IAC1E,QACIA,GAAA,CAAA,IAAA,EAAA,EAAA,GACQ,EAAE,EAAE,UAAU,EAClB,KAAK,EAAC,KAAK,EAAA,YAAA,EAEP,MAAM,CAAC,KAAK,CAAC,aAAa,GAAG,0BAA0B,GAAG,SAAS,EAAA,WAAA,EAE5D,QAAQ,EACnB,KAAK,EAAE;AACH,YAAA,GAAG,EAAE,EAAE,UA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ources":["../../../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,gCA2GrB,CAAC"}
|
|
@@ -30,7 +30,7 @@ const TablePaginatorImplementation = ({ page, pageCount, onPageChange, totalItem
|
|
|
30
30
|
((number) => `Page ${number}`),
|
|
31
31
|
pages: ariaLabels?.pages ?? paginatorMessages?.pages ?? 'Pages',
|
|
32
32
|
};
|
|
33
|
-
return (jsxs("div", { ...pt?.root, role: 'navigation', "aria-label": labels.navigation, "data-cratis-part": 'root', className: ['cratis-table-paginator', pt?.root?.className, className]
|
|
33
|
+
return (jsxs("div", { ...pt?.root, role: 'navigation', "aria-label": labels.navigation, "data-cratis-part": 'root', "data-cratis-component": 'TablePaginator', className: ['cratis-table-paginator', pt?.root?.className, className]
|
|
34
34
|
.filter(Boolean)
|
|
35
35
|
.join(' '), children: [rangeReport && (jsx("span", { ...pt?.range, className: ['cratis-table-paginator-range', pt?.range?.className]
|
|
36
36
|
.filter(Boolean)
|
|
@@ -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(\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,KAAK,EACjB,UAAU,EACV,SAAS,EACT,EAAE,GACgB,KAAI;AACtB,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,yBAAyB,EAAE;AAChD,IAAA,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS;AAC7C,IAAA,MAAM,IAAI,GAAG,aAAa,EAAE;AAC5B,IAAA,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC;AACzB,IAAA,MAAM,MAAM,GAAG,IAAI,IAAI,SAAS,GAAG,CAAC;AACpC,IAAA,MAAM,WAAW,GAAG,cAAc,CAC9B,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,UAAU,EAAE,KAAK,IAAI,iBAAiB,EAAE,KAAK,CAChD;AACD,IAAA,MAAM,MAAM,GAAG;QACX,UAAU,EACN,UAAU,EAAE,UAAU,IAAI,iBAAiB,EAAE,UAAU,IAAI,YAAY;QAC3E,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,iBAAiB,EAAE,KAAK,IAAI,YAAY;QACpE,QAAQ,EAAE,UAAU,EAAE,QAAQ,IAAI,iBAAiB,EAAE,QAAQ,IAAI,eAAe;QAChF,IAAI,EAAE,UAAU,EAAE,IAAI,IAAI,iBAAiB,EAAE,IAAI,IAAI,WAAW;QAChE,IAAI,EAAE,UAAU,EAAE,IAAI,IAAI,iBAAiB,EAAE,IAAI,IAAI,WAAW;QAChE,IAAI,EACA,UAAU,EAAE,IAAI;AAChB,YAAA,iBAAiB,EAAE,IAAI;aACtB,CAAC,MAAc,KAAK,CAAA,KAAA,EAAQ,MAAM,EAAE,CAAC;QAC1C,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,iBAAiB,EAAE,KAAK,IAAI,OAAO;KAClE;AAED,IAAA,QACIA,IAAA,CAAA,KAAA,EAAA,EAAA,GACQ,EAAE,EAAE,IAAI,EACZ,IAAI,EAAC,YAAY,EAAA,YAAA,EACL,MAAM,CAAC,UAAU,EAAA,kBAAA,EACZ,MAAM,
|
|
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 data-cratis-component='TablePaginator'\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,KAAK,EACjB,UAAU,EACV,SAAS,EACT,EAAE,GACgB,KAAI;AACtB,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,yBAAyB,EAAE;AAChD,IAAA,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS;AAC7C,IAAA,MAAM,IAAI,GAAG,aAAa,EAAE;AAC5B,IAAA,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC;AACzB,IAAA,MAAM,MAAM,GAAG,IAAI,IAAI,SAAS,GAAG,CAAC;AACpC,IAAA,MAAM,WAAW,GAAG,cAAc,CAC9B,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,UAAU,EAAE,KAAK,IAAI,iBAAiB,EAAE,KAAK,CAChD;AACD,IAAA,MAAM,MAAM,GAAG;QACX,UAAU,EACN,UAAU,EAAE,UAAU,IAAI,iBAAiB,EAAE,UAAU,IAAI,YAAY;QAC3E,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,iBAAiB,EAAE,KAAK,IAAI,YAAY;QACpE,QAAQ,EAAE,UAAU,EAAE,QAAQ,IAAI,iBAAiB,EAAE,QAAQ,IAAI,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AAkB,MAAM,EAAA,QAAA,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAA,CAAQ,EAAA,CAC9C,EACTA,GAAA,CAAC,MAAM,EAAA,EACH,OAAO,EAAC,OAAO,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC,EAAA,YAAA,EAC9B,MAAM,CAAC,IAAI,EACvB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAA,QAAA,EAEZA,GAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,EAAA,QAAA,EAAA,QAAA,EAAA,CAAS,EAAA,CAC5B,CAAA,EAAA,CACP;AAEd;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ColumnProps } from './Column.js';
|
|
2
|
+
/** Presentation props of a data table {@link Column}, identified on its header cell as `DataTableColumn`. */
|
|
3
|
+
export declare const columnDescriptor: import("../ComponentPicker/index.js").ComponentDescriptor<ColumnProps<unknown>>;
|
|
4
|
+
//# sourceMappingURL=columnDescriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnDescriptor.d.ts","sourceRoot":"","sources":["../../../DataTables/columnDescriptor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAE5C,6GAA6G;AAC7G,eAAO,MAAM,gBAAgB,iFAI3B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describeComponent } from '../configuration/identity/describeComponent.js';
|
|
2
|
+
|
|
3
|
+
const columnDescriptor = describeComponent('DataTableColumn', [
|
|
4
|
+
{ name: 'header', label: 'Header', type: 'string', description: 'The text at the top of the column.' },
|
|
5
|
+
{ name: 'sortable', label: 'Sortable', type: 'boolean', defaultValue: false },
|
|
6
|
+
{ name: 'filter', label: 'Filterable', type: 'boolean', defaultValue: false },
|
|
7
|
+
]);
|
|
8
|
+
|
|
9
|
+
export { columnDescriptor };
|
|
10
|
+
//# sourceMappingURL=columnDescriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnDescriptor.js","sources":["../../../DataTables/columnDescriptor.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\nimport { describeComponent } from '../configuration/identity/describeComponent';\nimport type { ColumnProps } from './Column';\n\n/** Presentation props of a data table {@link Column}, identified on its header cell as `DataTableColumn`. */\nexport const columnDescriptor = describeComponent<ColumnProps>('DataTableColumn', [\n { name: 'header', label: 'Header', type: 'string', description: 'The text at the top of the column.' },\n { name: 'sortable', label: 'Sortable', type: 'boolean', defaultValue: false },\n { name: 'filter', label: 'Filterable', type: 'boolean', defaultValue: false },\n]);\n"],"names":[],"mappings":";;AAOO,MAAM,gBAAgB,GAAG,iBAAiB,CAAc,iBAAiB,EAAE;AAC9E,IAAA,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;AACtG,IAAA,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AAC7E,IAAA,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AAChF,CAAA;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DialogResult, DialogButtons } from '@cratis/arc.react/dialogs';
|
|
2
2
|
import type { ButtonHTMLAttributes, CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import type { DialogSliceLocation } from '../configuration/DialogSliceLocation.js';
|
|
3
4
|
import type { DialogInitialFocus } from './DialogInitialFocus.js';
|
|
4
5
|
/** Callback handling a typed dialog result; return `false` to keep the dialog open. */
|
|
5
6
|
export type CloseDialog = (result: DialogResult) => boolean | void | Promise<boolean> | Promise<void>;
|
|
@@ -30,6 +31,8 @@ export interface DialogParts {
|
|
|
30
31
|
title?: DialogPartAttributes<HTMLHeadingElement>;
|
|
31
32
|
/** Secondary line under the heading, rendered only when `subtitle` is set. */
|
|
32
33
|
subtitle?: DialogPartAttributes<HTMLParagraphElement>;
|
|
34
|
+
/** Region before the close button holding per-dialog and app-wide header actions. */
|
|
35
|
+
headerActions?: DialogPartAttributes<HTMLDivElement>;
|
|
33
36
|
/** Header close button. */
|
|
34
37
|
close?: DialogButtonAttributes;
|
|
35
38
|
/** Dialog content region. */
|
|
@@ -56,6 +59,21 @@ export interface DialogProps {
|
|
|
56
59
|
* are identical across placements.
|
|
57
60
|
*/
|
|
58
61
|
placement?: DialogPlacement;
|
|
62
|
+
/**
|
|
63
|
+
* Actions rendered in the header before the close button, in a `header-actions` part. Use it
|
|
64
|
+
* for a help, feedback or copy-link action that belongs to this dialog. Rendered next to the
|
|
65
|
+
* app-wide actions registered on `CratisComponentsProvider`.
|
|
66
|
+
*/
|
|
67
|
+
headerActions?: ReactNode;
|
|
68
|
+
/** Suppresses the app-wide header actions registered on `CratisComponentsProvider` for this dialog. */
|
|
69
|
+
hideGlobalHeaderActions?: boolean;
|
|
70
|
+
/** Where this dialog's opener sits in the application. Passed to app-wide header actions as `sliceLocation`. */
|
|
71
|
+
sliceLocation?: DialogSliceLocation;
|
|
72
|
+
/**
|
|
73
|
+
* Set by `CommandDialog` and `StepperCommandDialog` so app-wide header actions can tell a command
|
|
74
|
+
* dialog from a plain one. Defaults to `false`.
|
|
75
|
+
*/
|
|
76
|
+
isCommandDialog?: boolean;
|
|
59
77
|
/**
|
|
60
78
|
* Glyph for the header close button. Names this one dialog and wins over the provider's
|
|
61
79
|
* `icons.close`; defaults to a multiplication sign when neither is set.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","s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
-
{"version":3,"file":"Dialog.js","sources":["../../../Dialogs/Dialog.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 { DialogResult, DialogButtons } from '@cratis/arc.react/dialogs';\nimport type {\n ButtonHTMLAttributes,\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n} from 'react';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport type { DialogInitialFocus } from './DialogInitialFocus';\nimport { DialogImplementation } from './DialogImplementation';\n\n/** Callback handling a typed dialog result; return `false` to keep the dialog open. */\nexport type CloseDialog = (\n result: DialogResult,\n) => boolean | void | Promise<boolean> | Promise<void>;\n\n/** Confirmation callback; return `true` to permit host closure. */\nexport type ConfirmCallback = () => boolean | void | Promise<boolean> | Promise<void>;\n/** Cancellation callback; return `true` to permit host closure. */\nexport type CancelCallback = () => boolean | void | Promise<boolean> | Promise<void>;\n\ntype DialogPartAttributes<TElement> = HTMLAttributes<TElement> & {\n [attribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\ntype DialogButtonAttributes = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'value'\n>;\n\n/**\n * Where a {@link Dialog} sits in the viewport. `center` is the classic modal; `start` and `end`\n * make it a full-height side sheet against the inline-start or inline-end edge.\n */\nexport type DialogPlacement = 'center' | 'start' | 'end';\n\n/** Stable Cratis-owned parts for styling a {@link Dialog}. */\nexport interface DialogParts {\n /** Viewport backdrop and dismissal surface. */\n backdrop?: DialogPartAttributes<HTMLDivElement>;\n /** Viewport positioning wrapper. */\n positioner?: DialogPartAttributes<HTMLDivElement>;\n /** Modal root. */\n root?: DialogPartAttributes<HTMLDivElement>;\n /** Header containing title and optional close action. */\n header?: DialogPartAttributes<HTMLElement>;\n /** Dialog heading. */\n title?: DialogPartAttributes<HTMLHeadingElement>;\n /** Secondary line under the heading, rendered only when `subtitle` is set. */\n subtitle?: DialogPartAttributes<HTMLParagraphElement>;\n /** Header close button. */\n close?: DialogButtonAttributes;\n /** Dialog content region. */\n content?: DialogPartAttributes<HTMLDivElement>;\n /** Footer action region. */\n footer?: DialogPartAttributes<HTMLElement>;\n /** Primary confirmation button. */\n confirm?: DialogButtonAttributes;\n /** Secondary dismissal button(s). */\n cancel?: DialogButtonAttributes;\n}\n\n/** Props for {@link Dialog}. */\nexport interface DialogProps {\n /** Dialog heading. */\n title: string;\n /**\n * Secondary line under the heading — a reference, a status, a short summary. Announced as the\n * dialog's description.\n */\n subtitle?: ReactNode;\n /**\n * Viewport placement. `center` (default) is a modal; `start` and `end` render a full-height\n * side sheet against that inline edge, sliding in from it. Dismissal, focus and busy behavior\n * are identical across placements.\n */\n placement?: DialogPlacement;\n /**\n * Glyph for the header close button. Names this one dialog and wins over the provider's\n * `icons.close`; defaults to a multiplication sign when neither is set.\n */\n closeIcon?: ReactNode;\n /** Controlled open state. Defaults to `true`. */\n visible?: boolean;\n /** Combined result callback used when a dedicated confirm/cancel callback is absent. */\n onClose?: CloseDialog;\n /** Invoked by primary confirmation actions. */\n onConfirm?: ConfirmCallback;\n /** Invoked by cancellation actions. */\n onCancel?: CancelCallback;\n /** Predefined Arc buttons, custom footer content, or `null` for no footer. */\n buttons?: DialogButtons | ReactNode;\n /** Initial focus target. Defaults to the confirmation action. */\n initialFocus?: DialogInitialFocus;\n /** Dialog body content. */\n children: ReactNode;\n /** CSS width. Defaults to `450px`. */\n width?: string;\n /** Modal-root inline style. */\n style?: CSSProperties;\n /** Content-region inline style. */\n contentStyle?: CSSProperties;\n /**\n * @deprecated The Cratis dialog is viewport-bounded rather than resizable. Remove this prop.\n */\n resizable?: boolean;\n /** Whether the primary action is enabled. Defaults to `true`. */\n isValid?: boolean;\n /** Disables every action and dismissal path while work is in flight. */\n isBusy?: boolean;\n /** Label for the Ok action. Falls back to the provider's `dialog.ok` message, then `'Ok'`. */\n okLabel?: string;\n /** Label for the Cancel action. Falls back to the provider's `dialog.cancel` message, then `'Cancel'`. */\n cancelLabel?: string;\n /** Label for the Yes action. Falls back to the provider's `dialog.yes` message, then `'Yes'`. */\n yesLabel?: string;\n /** Label for the No action. Falls back to the provider's `dialog.no` message, then `'No'`. */\n noLabel?: string;\n /** Accessible label for the header close button. Falls back to the provider's `dialog.close` message, then `'Close'`. */\n closeAriaLabel?: string;\n /**\n * Combined default for header, Escape, and backdrop dismissal. Defaults to true\n * for predefined buttons and false for custom/no footer. Independent props override it.\n */\n dismissable?: boolean;\n /** Whether outside clicks dismiss the dialog. Falls back to `dismissable`; blocked while busy. */\n dismissOnOutsideClick?: boolean;\n /** Whether Escape dismisses the dialog. Falls back to `dismissable`; blocked while busy. */\n closeOnEscape?: boolean;\n /** Whether to show the header close button. Falls back to `dismissable`; disabled while busy. */\n showCloseButton?: boolean;\n /** Extra class name for the modal root. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: DialogParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n}\n\nconst coreDialogDeclaration = Object.freeze({\n mode: 'atomic',\n fidelity: 'native',\n render: DialogImplementation,\n}) satisfies unstable_SlotDeclaration<'dialogs.dialog'>;\n\n/**\n * A modal dialog with Arc host integration, typed footer actions, busy/validity\n * state, controlled dismissal, and stable Cratis-owned styling parts.\n */\nexport const Dialog = (props: DialogProps) => {\n const declaration = unstable_useSlot('dialogs.dialog', coreDialogDeclaration);\n return renderSlot(declaration, props);\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../Dialogs/Dialog.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 { DialogResult, DialogButtons } from '@cratis/arc.react/dialogs';\nimport type {\n ButtonHTMLAttributes,\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n} from 'react';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport type { DialogSliceLocation } from '../configuration/DialogSliceLocation';\nimport type { DialogInitialFocus } from './DialogInitialFocus';\nimport { DialogImplementation } from './DialogImplementation';\n\n/** Callback handling a typed dialog result; return `false` to keep the dialog open. */\nexport type CloseDialog = (\n result: DialogResult,\n) => boolean | void | Promise<boolean> | Promise<void>;\n\n/** Confirmation callback; return `true` to permit host closure. */\nexport type ConfirmCallback = () => boolean | void | Promise<boolean> | Promise<void>;\n/** Cancellation callback; return `true` to permit host closure. */\nexport type CancelCallback = () => boolean | void | Promise<boolean> | Promise<void>;\n\ntype DialogPartAttributes<TElement> = HTMLAttributes<TElement> & {\n [attribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\ntype DialogButtonAttributes = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'value'\n>;\n\n/**\n * Where a {@link Dialog} sits in the viewport. `center` is the classic modal; `start` and `end`\n * make it a full-height side sheet against the inline-start or inline-end edge.\n */\nexport type DialogPlacement = 'center' | 'start' | 'end';\n\n/** Stable Cratis-owned parts for styling a {@link Dialog}. */\nexport interface DialogParts {\n /** Viewport backdrop and dismissal surface. */\n backdrop?: DialogPartAttributes<HTMLDivElement>;\n /** Viewport positioning wrapper. */\n positioner?: DialogPartAttributes<HTMLDivElement>;\n /** Modal root. */\n root?: DialogPartAttributes<HTMLDivElement>;\n /** Header containing title and optional close action. */\n header?: DialogPartAttributes<HTMLElement>;\n /** Dialog heading. */\n title?: DialogPartAttributes<HTMLHeadingElement>;\n /** Secondary line under the heading, rendered only when `subtitle` is set. */\n subtitle?: DialogPartAttributes<HTMLParagraphElement>;\n /** Region before the close button holding per-dialog and app-wide header actions. */\n headerActions?: DialogPartAttributes<HTMLDivElement>;\n /** Header close button. */\n close?: DialogButtonAttributes;\n /** Dialog content region. */\n content?: DialogPartAttributes<HTMLDivElement>;\n /** Footer action region. */\n footer?: DialogPartAttributes<HTMLElement>;\n /** Primary confirmation button. */\n confirm?: DialogButtonAttributes;\n /** Secondary dismissal button(s). */\n cancel?: DialogButtonAttributes;\n}\n\n/** Props for {@link Dialog}. */\nexport interface DialogProps {\n /** Dialog heading. */\n title: string;\n /**\n * Secondary line under the heading — a reference, a status, a short summary. Announced as the\n * dialog's description.\n */\n subtitle?: ReactNode;\n /**\n * Viewport placement. `center` (default) is a modal; `start` and `end` render a full-height\n * side sheet against that inline edge, sliding in from it. Dismissal, focus and busy behavior\n * are identical across placements.\n */\n placement?: DialogPlacement;\n /**\n * Actions rendered in the header before the close button, in a `header-actions` part. Use it\n * for a help, feedback or copy-link action that belongs to this dialog. Rendered next to the\n * app-wide actions registered on `CratisComponentsProvider`.\n */\n headerActions?: ReactNode;\n /** Suppresses the app-wide header actions registered on `CratisComponentsProvider` for this dialog. */\n hideGlobalHeaderActions?: boolean;\n /** Where this dialog's opener sits in the application. Passed to app-wide header actions as `sliceLocation`. */\n sliceLocation?: DialogSliceLocation;\n /**\n * Set by `CommandDialog` and `StepperCommandDialog` so app-wide header actions can tell a command\n * dialog from a plain one. Defaults to `false`.\n */\n isCommandDialog?: boolean;\n /**\n * Glyph for the header close button. Names this one dialog and wins over the provider's\n * `icons.close`; defaults to a multiplication sign when neither is set.\n */\n closeIcon?: ReactNode;\n /** Controlled open state. Defaults to `true`. */\n visible?: boolean;\n /** Combined result callback used when a dedicated confirm/cancel callback is absent. */\n onClose?: CloseDialog;\n /** Invoked by primary confirmation actions. */\n onConfirm?: ConfirmCallback;\n /** Invoked by cancellation actions. */\n onCancel?: CancelCallback;\n /** Predefined Arc buttons, custom footer content, or `null` for no footer. */\n buttons?: DialogButtons | ReactNode;\n /** Initial focus target. Defaults to the confirmation action. */\n initialFocus?: DialogInitialFocus;\n /** Dialog body content. */\n children: ReactNode;\n /** CSS width. Defaults to `450px`. */\n width?: string;\n /** Modal-root inline style. */\n style?: CSSProperties;\n /** Content-region inline style. */\n contentStyle?: CSSProperties;\n /**\n * @deprecated The Cratis dialog is viewport-bounded rather than resizable. Remove this prop.\n */\n resizable?: boolean;\n /** Whether the primary action is enabled. Defaults to `true`. */\n isValid?: boolean;\n /** Disables every action and dismissal path while work is in flight. */\n isBusy?: boolean;\n /** Label for the Ok action. Falls back to the provider's `dialog.ok` message, then `'Ok'`. */\n okLabel?: string;\n /** Label for the Cancel action. Falls back to the provider's `dialog.cancel` message, then `'Cancel'`. */\n cancelLabel?: string;\n /** Label for the Yes action. Falls back to the provider's `dialog.yes` message, then `'Yes'`. */\n yesLabel?: string;\n /** Label for the No action. Falls back to the provider's `dialog.no` message, then `'No'`. */\n noLabel?: string;\n /** Accessible label for the header close button. Falls back to the provider's `dialog.close` message, then `'Close'`. */\n closeAriaLabel?: string;\n /**\n * Combined default for header, Escape, and backdrop dismissal. Defaults to true\n * for predefined buttons and false for custom/no footer. Independent props override it.\n */\n dismissable?: boolean;\n /** Whether outside clicks dismiss the dialog. Falls back to `dismissable`; blocked while busy. */\n dismissOnOutsideClick?: boolean;\n /** Whether Escape dismisses the dialog. Falls back to `dismissable`; blocked while busy. */\n closeOnEscape?: boolean;\n /** Whether to show the header close button. Falls back to `dismissable`; disabled while busy. */\n showCloseButton?: boolean;\n /** Extra class name for the modal root. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: DialogParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n}\n\nconst coreDialogDeclaration = Object.freeze({\n mode: 'atomic',\n fidelity: 'native',\n render: DialogImplementation,\n}) satisfies unstable_SlotDeclaration<'dialogs.dialog'>;\n\n/**\n * A modal dialog with Arc host integration, typed footer actions, busy/validity\n * state, controlled dismissal, and stable Cratis-owned styling parts.\n */\nexport const Dialog = (props: DialogProps) => {\n const declaration = unstable_useSlot('dialogs.dialog', coreDialogDeclaration);\n return renderSlot(declaration, props);\n};\n"],"names":[],"mappings":";;;;AAwKA,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;AACxC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,oBAAoB;AAC/B,CAAA,CAAsD;AAMhD,MAAM,MAAM,GAAG,CAAC,KAAkB,KAAI;IACzC,MAAM,WAAW,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AAC7E,IAAA,OAAO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC;AACzC;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DialogHeaderActionsRenderer } from '../configuration/DialogHeaderActionsRenderer.js';
|
|
2
|
+
import type { DialogHeaderContext } from '../configuration/DialogHeaderContext.js';
|
|
3
|
+
/** Mounts the app-wide renderer as a component so the actions it returns can use hooks. */
|
|
4
|
+
export declare const DialogGlobalHeaderActions: ({ render, context, }: {
|
|
5
|
+
render: DialogHeaderActionsRenderer;
|
|
6
|
+
context: DialogHeaderContext;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DialogGlobalHeaderActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogGlobalHeaderActions.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogGlobalHeaderActions.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iDAA8C,CAAC;AAChG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAsC,CAAC;AAEhF,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,yBAGnC;IACC,MAAM,EAAE,2BAA2B,CAAC;IACpC,OAAO,EAAE,mBAAmB,CAAC;CAChC,gCAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogGlobalHeaderActions.js","sources":["../../../Dialogs/DialogGlobalHeaderActions.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 { DialogHeaderActionsRenderer } from '../configuration/DialogHeaderActionsRenderer';\nimport type { DialogHeaderContext } from '../configuration/DialogHeaderContext';\n\n/** Mounts the app-wide renderer as a component so the actions it returns can use hooks. */\nexport const DialogGlobalHeaderActions = ({\n render,\n context,\n}: {\n render: DialogHeaderActionsRenderer;\n context: DialogHeaderContext;\n}) => <>{render(context)}</>;\n"],"names":["_jsx","_Fragment"],"mappings":";;AAOO,MAAM,yBAAyB,GAAG,CAAC,EACtC,MAAM,EACN,OAAO,GAIV,KAAKA,GAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAG,MAAM,CAAC,OAAO,CAAC;;"}
|
|
@@ -4,5 +4,5 @@ import type { DialogProps } from './Dialog.js';
|
|
|
4
4
|
* A modal dialog with Arc host integration, typed footer actions, busy/validity
|
|
5
5
|
* state, controlled dismissal, and stable Cratis-owned styling parts.
|
|
6
6
|
*/
|
|
7
|
-
export declare const DialogImplementation: (
|
|
7
|
+
export declare const DialogImplementation: (incomingProps: DialogProps) => React.JSX.Element | null;
|
|
8
8
|
//# sourceMappingURL=DialogImplementation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogImplementation.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogImplementation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"DialogImplementation.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogImplementation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAiD5C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kBAAmB,WAAW,6BAghB9D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { DialogButtons, useDialogContext, DialogResult } from '@cratis/arc.react/dialogs';
|
|
3
3
|
import { Dialog, Heading } from 'react-aria-components/Dialog';
|
|
4
4
|
import { ModalOverlay, Modal } from 'react-aria-components/Modal';
|
|
5
5
|
import { UNSAFE_PortalProvider } from 'react-aria';
|
|
@@ -17,6 +17,9 @@ import '../Notifications/toast.js';
|
|
|
17
17
|
import { classNames } from '../ClassNames/classNames.js';
|
|
18
18
|
import { openDialogTier, closeDialogTier, DIALOG_ZINDEX_TOKEN, dialogZIndexForTier } from '../renderer/dialogStack.js';
|
|
19
19
|
import { DialogStackContext } from '../renderer/DialogStackContext.js';
|
|
20
|
+
import { DialogGlobalHeaderActions } from './DialogGlobalHeaderActions.js';
|
|
21
|
+
import { useComponentPresentation } from '../configuration/identity/useComponentPresentation.js';
|
|
22
|
+
import { dialogDescriptor } from './dialogDescriptor.js';
|
|
20
23
|
|
|
21
24
|
const visuallyHidden = {
|
|
22
25
|
position: 'absolute',
|
|
@@ -29,11 +32,23 @@ const visuallyHidden = {
|
|
|
29
32
|
whiteSpace: 'nowrap',
|
|
30
33
|
border: 0,
|
|
31
34
|
};
|
|
35
|
+
const headerActionsStyle = (hasCloseButton) => ({
|
|
36
|
+
display: 'inline-flex',
|
|
37
|
+
gridColumn: 2,
|
|
38
|
+
gridRow: 1,
|
|
39
|
+
justifySelf: 'end',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
gap: '0.25rem',
|
|
42
|
+
marginInlineEnd: hasCloseButton ? '2.25rem' : undefined,
|
|
43
|
+
});
|
|
32
44
|
const subscribeToBrowserEnvironment = () => () => undefined;
|
|
33
45
|
const useIsBrowser = () => useSyncExternalStore(subscribeToBrowserEnvironment, () => true, () => false);
|
|
34
|
-
const DialogImplementation = (
|
|
46
|
+
const DialogImplementation = (incomingProps) => {
|
|
47
|
+
const [props, marker] = useComponentPresentation(dialogDescriptor, incomingProps);
|
|
48
|
+
const { title, subtitle, placement = 'center', closeIcon, headerActions, hideGlobalHeaderActions = false, sliceLocation, isCommandDialog = false, visible = true, onClose, onConfirm, onCancel, buttons = DialogButtons.OkCancel, initialFocus = DialogInitialFocus.Confirm, children, width = '450px', style, contentStyle, isValid, isBusy = false, okLabel, cancelLabel, yesLabel, noLabel, closeAriaLabel, dismissable, dismissOnOutsideClick, closeOnEscape, showCloseButton, className, pt, } = props;
|
|
35
49
|
const overlayEnvironment = unstable_useOverlayEnvironment();
|
|
36
|
-
const { messages } = useCratisComponentsConfig();
|
|
50
|
+
const { messages, dialogHeaderActions } = useCratisComponentsConfig();
|
|
51
|
+
const dialogId = useId();
|
|
37
52
|
const dialogMessages = messages?.dialog;
|
|
38
53
|
const resolvedOkLabel = okLabel ?? dialogMessages?.ok ?? 'Ok';
|
|
39
54
|
const resolvedCancelLabel = cancelLabel ?? dialogMessages?.cancel ?? 'Cancel';
|
|
@@ -52,6 +67,7 @@ const DialogImplementation = ({ title, subtitle, placement = 'center', closeIcon
|
|
|
52
67
|
catch {
|
|
53
68
|
contextCloseDialog = undefined;
|
|
54
69
|
}
|
|
70
|
+
const hasHeaderActions = headerActions != null || (dialogHeaderActions !== undefined && !hideGlobalHeaderActions);
|
|
55
71
|
const isBrowser = useIsBrowser();
|
|
56
72
|
const subtitleId = useId();
|
|
57
73
|
const hasSubtitle = subtitle !== undefined && subtitle !== null && subtitle !== false;
|
|
@@ -178,7 +194,7 @@ const DialogImplementation = ({ title, subtitle, placement = 'center', closeIcon
|
|
|
178
194
|
return null;
|
|
179
195
|
}
|
|
180
196
|
};
|
|
181
|
-
const dialogDocument = (jsx(DialogStackContext.Provider, { value: resolvedZIndex ?? DIALOG_ZINDEX_TOKEN, children: jsx(Dialog, { className: 'cratis-dialog__document', "aria-describedby": hasSubtitle ? subtitleId : undefined, children: jsxs(Fragment, { children: [jsxs("header", { ...pt?.header, className: classNames('cratis-dialog__header', pt?.header?.className), style: pt?.header?.style, "data-cratis-part": 'header', children: [jsx(Heading, { ...pt?.title, slot: 'title', tabIndex: focusesTitle ? -1 : undefined, ref: titleRef, className: classNames('cratis-dialog__title', pt?.title?.className), style: pt?.title?.style, "data-cratis-part": 'title', children: title }), hasSubtitle && (jsx("p", { ...pt?.subtitle, id: subtitleId, className: classNames('cratis-dialog__subtitle', pt?.subtitle?.className), style: pt?.subtitle?.style, "data-cratis-part": 'subtitle', children: subtitle })), showsCloseButton && (jsx("button", { ...pt?.close, type: 'button', disabled: isBusy, className: classNames('cratis-dialog__close', pt?.close?.className), "data-cratis-part": 'close', "data-disabled": isBusy || undefined, "data-busy": isBusy || undefined, "aria-label": resolvedCloseAriaLabel, onClick: () => void handleClose(DialogResult.Cancelled), children: jsx("span", { "aria-hidden": 'true', children: resolvedCloseIcon }) }))] }), jsx("div", { ...pt?.content, className: classNames('cratis-dialog__content', pt?.content?.className), style: { ...pt?.content?.style, ...contentStyle }, "data-cratis-part": 'content', "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("fieldset", { className: 'cratis-dialog__busy-scope', "data-cratis-part": 'busy-scope', "data-busy": isBusy || undefined, disabled: isBusy, inert: isBusy, "aria-busy": isBusy || undefined, children: children }) }), buttons !== null && (jsx("footer", { ...pt?.footer, className: classNames('cratis-dialog__footer', pt?.footer?.className), style: pt?.footer?.style, "data-cratis-part": 'footer', children: jsx("fieldset", { className: 'cratis-dialog__busy-scope cratis-dialog__busy-scope--footer', "data-cratis-part": 'busy-scope', "data-busy": isBusy || undefined, disabled: isFooterScopeBusy, inert: isFooterScopeBusy, "aria-busy": isBusy || undefined, children: predefinedFooter() }) })), jsx("div", { className: 'cratis-dialog__live-region', style: visuallyHidden, role: 'status', "aria-live": 'polite', "aria-atomic": 'true', children: announcement && jsx("span", { children: announcement.text }, announcement.key) })] }) }) }));
|
|
197
|
+
const dialogDocument = (jsx(DialogStackContext.Provider, { value: resolvedZIndex ?? DIALOG_ZINDEX_TOKEN, children: jsx(Dialog, { className: 'cratis-dialog__document', "aria-describedby": hasSubtitle ? subtitleId : undefined, children: jsxs(Fragment, { children: [jsxs("header", { ...pt?.header, className: classNames('cratis-dialog__header', pt?.header?.className), style: pt?.header?.style, "data-cratis-part": 'header', children: [jsx(Heading, { ...pt?.title, slot: 'title', tabIndex: focusesTitle ? -1 : undefined, ref: titleRef, className: classNames('cratis-dialog__title', pt?.title?.className), style: pt?.title?.style, "data-cratis-part": 'title', children: title }), hasSubtitle && (jsx("p", { ...pt?.subtitle, id: subtitleId, className: classNames('cratis-dialog__subtitle', pt?.subtitle?.className), style: pt?.subtitle?.style, "data-cratis-part": 'subtitle', children: subtitle })), hasHeaderActions && (jsxs("div", { ...pt?.headerActions, className: classNames('cratis-dialog__header-actions', pt?.headerActions?.className), style: { ...headerActionsStyle(showsCloseButton), ...pt?.headerActions?.style }, "data-cratis-part": 'header-actions', children: [headerActions, dialogHeaderActions && !hideGlobalHeaderActions && (jsx(DialogGlobalHeaderActions, { render: dialogHeaderActions, context: { dialogId, title, isCommandDialog, sliceLocation } }))] })), showsCloseButton && (jsx("button", { ...pt?.close, type: 'button', disabled: isBusy, className: classNames('cratis-dialog__close', pt?.close?.className), style: hasHeaderActions ? { justifySelf: 'end', ...pt?.close?.style } : pt?.close?.style, "data-cratis-part": 'close', "data-disabled": isBusy || undefined, "data-busy": isBusy || undefined, "aria-label": resolvedCloseAriaLabel, onClick: () => void handleClose(DialogResult.Cancelled), children: jsx("span", { "aria-hidden": 'true', children: resolvedCloseIcon }) }))] }), jsx("div", { ...pt?.content, className: classNames('cratis-dialog__content', pt?.content?.className), style: { ...pt?.content?.style, ...contentStyle }, "data-cratis-part": 'content', "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("fieldset", { className: 'cratis-dialog__busy-scope', "data-cratis-part": 'busy-scope', "data-busy": isBusy || undefined, disabled: isBusy, inert: isBusy, "aria-busy": isBusy || undefined, children: children }) }), buttons !== null && (jsx("footer", { ...pt?.footer, className: classNames('cratis-dialog__footer', pt?.footer?.className), style: pt?.footer?.style, "data-cratis-part": 'footer', children: jsx("fieldset", { className: 'cratis-dialog__busy-scope cratis-dialog__busy-scope--footer', "data-cratis-part": 'busy-scope', "data-busy": isBusy || undefined, disabled: isFooterScopeBusy, inert: isFooterScopeBusy, "aria-busy": isBusy || undefined, children: predefinedFooter() }) })), jsx("div", { className: 'cratis-dialog__live-region', style: visuallyHidden, role: 'status', "aria-live": 'polite', "aria-atomic": 'true', children: announcement && jsx("span", { children: announcement.text }, announcement.key) })] }) }) }));
|
|
182
198
|
const dialogStyle = { width, ...pt?.root?.style, ...style };
|
|
183
199
|
if (!isBrowser) {
|
|
184
200
|
if (!visible)
|
|
@@ -186,7 +202,7 @@ const DialogImplementation = ({ title, subtitle, placement = 'center', closeIcon
|
|
|
186
202
|
return (jsx("div", { ...pt?.backdrop, className: classNames('cratis-dialog__backdrop', pt?.backdrop?.className), style: {
|
|
187
203
|
zIndex: resolvedZIndex ?? DIALOG_ZINDEX_TOKEN,
|
|
188
204
|
...pt?.backdrop?.style,
|
|
189
|
-
}, "data-cratis-part": 'backdrop', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("div", { ...pt?.positioner, className: classNames('cratis-dialog__positioner', pt?.positioner?.className), style: pt?.positioner?.style, "data-cratis-part": 'positioner', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("section", { ...pt?.root, className: classNames('cratis-dialog', pt?.root?.className, className), style: dialogStyle, "data-cratis-part": 'root', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: dialogDocument }) }) }));
|
|
205
|
+
}, "data-cratis-part": 'backdrop', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("div", { ...pt?.positioner, className: classNames('cratis-dialog__positioner', pt?.positioner?.className), style: pt?.positioner?.style, "data-cratis-part": 'positioner', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("section", { ...pt?.root, className: classNames('cratis-dialog', pt?.root?.className, className), style: dialogStyle, "data-cratis-part": 'root', ...marker, "data-cratis-dialog-id": dialogId, "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: dialogDocument }) }) }));
|
|
190
206
|
}
|
|
191
207
|
return (jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsx(ModalOverlay, { ...pt?.backdrop, isOpen: visible, onOpenChange: (open) => {
|
|
192
208
|
if (!open && !isBusy)
|
|
@@ -194,7 +210,7 @@ const DialogImplementation = ({ title, subtitle, placement = 'center', closeIcon
|
|
|
194
210
|
}, isDismissable: allowsOutsideDismissal, isKeyboardDismissDisabled: !allowsEscapeDismissal, className: classNames('cratis-dialog__backdrop', pt?.backdrop?.className), style: {
|
|
195
211
|
zIndex: resolvedZIndex ?? DIALOG_ZINDEX_TOKEN,
|
|
196
212
|
...pt?.backdrop?.style,
|
|
197
|
-
}, "data-cratis-part": 'backdrop', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("div", { ...pt?.positioner, className: classNames('cratis-dialog__positioner', pt?.positioner?.className), style: pt?.positioner?.style, "data-cratis-part": 'positioner', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx(Modal, { ...pt?.root, className: classNames('cratis-dialog', pt?.root?.className, className), style: dialogStyle, "data-cratis-part": 'root', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: dialogDocument }) }) }) }));
|
|
213
|
+
}, "data-cratis-part": 'backdrop', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx("div", { ...pt?.positioner, className: classNames('cratis-dialog__positioner', pt?.positioner?.className), style: pt?.positioner?.style, "data-cratis-part": 'positioner', "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: jsx(Modal, { ...pt?.root, className: classNames('cratis-dialog', pt?.root?.className, className), style: dialogStyle, "data-cratis-part": 'root', ...marker, "data-cratis-dialog-id": dialogId, "data-placement": placement, "data-open": visible || undefined, "data-busy": isBusy || undefined, children: dialogDocument }) }) }) }));
|
|
198
214
|
};
|
|
199
215
|
|
|
200
216
|
export { DialogImplementation };
|