@cratis/components 4.42.0 → 4.42.1
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 +2 -2
- package/dist/esm/Chat/ChatSidebar.d.ts.map +1 -1
- package/dist/esm/Chat/ChatSidebar.js +21 -101
- package/dist/esm/Chat/ChatSidebar.js.map +1 -1
- package/dist/esm/Chat/ChatSidebarContent.d.ts +25 -0
- package/dist/esm/Chat/ChatSidebarContent.d.ts.map +1 -0
- package/dist/esm/Chat/ChatSidebarContent.js +12 -0
- package/dist/esm/Chat/ChatSidebarContent.js.map +1 -0
- package/dist/esm/Chat/ChatSidebarHeader.d.ts +16 -0
- package/dist/esm/Chat/ChatSidebarHeader.d.ts.map +1 -0
- package/dist/esm/Chat/ChatSidebarHeader.js +26 -0
- package/dist/esm/Chat/ChatSidebarHeader.js.map +1 -0
- package/dist/esm/Chat/ChatSidebarShells.d.ts +31 -0
- package/dist/esm/Chat/ChatSidebarShells.d.ts.map +1 -0
- package/dist/esm/Chat/ChatSidebarShells.js +43 -0
- package/dist/esm/Chat/ChatSidebarShells.js.map +1 -0
- package/dist/esm/Chat/useNonModalPhase.d.ts +16 -0
- package/dist/esm/Chat/useNonModalPhase.d.ts.map +1 -0
- package/dist/esm/Chat/useNonModalPhase.js +38 -0
- package/dist/esm/Chat/useNonModalPhase.js.map +1 -0
- package/dist/esm/Chat/useTopicSelection.d.ts +31 -0
- package/dist/esm/Chat/useTopicSelection.d.ts.map +1 -0
- package/dist/esm/Chat/useTopicSelection.js +45 -0
- package/dist/esm/Chat/useTopicSelection.js.map +1 -0
- package/dist/esm/DataTables/ColumnFilterActions.d.ts +11 -0
- package/dist/esm/DataTables/ColumnFilterActions.d.ts.map +1 -0
- package/dist/esm/DataTables/ColumnFilterActions.js +8 -0
- package/dist/esm/DataTables/ColumnFilterActions.js.map +1 -0
- package/dist/esm/DataTables/ColumnFilterMenu.d.ts +1 -1
- package/dist/esm/DataTables/ColumnFilterMenu.d.ts.map +1 -1
- package/dist/esm/DataTables/ColumnFilterMenu.js +16 -148
- package/dist/esm/DataTables/ColumnFilterMenu.js.map +1 -1
- package/dist/esm/DataTables/ColumnFilterTrigger.d.ts +12 -0
- package/dist/esm/DataTables/ColumnFilterTrigger.d.ts.map +1 -0
- package/dist/esm/DataTables/ColumnFilterTrigger.js +9 -0
- package/dist/esm/DataTables/ColumnFilterTrigger.js.map +1 -0
- package/dist/esm/DataTables/ColumnFilterValueInput.d.ts +24 -0
- package/dist/esm/DataTables/ColumnFilterValueInput.d.ts.map +1 -0
- package/dist/esm/DataTables/ColumnFilterValueInput.js +39 -0
- package/dist/esm/DataTables/ColumnFilterValueInput.js.map +1 -0
- package/dist/esm/DataTables/columnFilterMatchModes.d.ts +10 -0
- package/dist/esm/DataTables/columnFilterMatchModes.d.ts.map +1 -0
- package/dist/esm/DataTables/columnFilterMatchModes.js +52 -0
- package/dist/esm/DataTables/columnFilterMatchModes.js.map +1 -0
- package/dist/esm/DataTables/resolveColumnFilterLabels.d.ts +4 -0
- package/dist/esm/DataTables/resolveColumnFilterLabels.d.ts.map +1 -0
- package/dist/esm/DataTables/resolveColumnFilterLabels.js +20 -0
- package/dist/esm/DataTables/resolveColumnFilterLabels.js.map +1 -0
- package/dist/esm/DataTables/useColumnFilterDraft.d.ts +13 -0
- package/dist/esm/DataTables/useColumnFilterDraft.d.ts.map +1 -0
- package/dist/esm/DataTables/useColumnFilterDraft.js +24 -0
- package/dist/esm/DataTables/useColumnFilterDraft.js.map +1 -0
- package/dist/esm/DataTables/useRestoreFocusOnClose.d.ts +7 -0
- package/dist/esm/DataTables/useRestoreFocusOnClose.d.ts.map +1 -0
- package/dist/esm/DataTables/useRestoreFocusOnClose.js +30 -0
- package/dist/esm/DataTables/useRestoreFocusOnClose.js.map +1 -0
- package/dist/esm/Dialogs/DialogDocument.d.ts +22 -0
- package/dist/esm/Dialogs/DialogDocument.d.ts.map +1 -0
- package/dist/esm/Dialogs/DialogDocument.js +24 -0
- package/dist/esm/Dialogs/DialogDocument.js.map +1 -0
- package/dist/esm/Dialogs/DialogFooter.d.ts +24 -0
- package/dist/esm/Dialogs/DialogFooter.d.ts.map +1 -0
- package/dist/esm/Dialogs/DialogFooter.js +65 -0
- package/dist/esm/Dialogs/DialogFooter.js.map +1 -0
- package/dist/esm/Dialogs/DialogHeader.d.ts +31 -0
- package/dist/esm/Dialogs/DialogHeader.d.ts.map +1 -0
- package/dist/esm/Dialogs/DialogHeader.js +28 -0
- package/dist/esm/Dialogs/DialogHeader.js.map +1 -0
- package/dist/esm/Dialogs/DialogImplementation.d.ts +1 -2
- package/dist/esm/Dialogs/DialogImplementation.d.ts.map +1 -1
- package/dist/esm/Dialogs/DialogImplementation.js +88 -189
- package/dist/esm/Dialogs/DialogImplementation.js.map +1 -1
- package/dist/esm/Dialogs/DialogShells.d.ts +29 -0
- package/dist/esm/Dialogs/DialogShells.d.ts.map +1 -0
- package/dist/esm/Dialogs/DialogShells.js +36 -0
- package/dist/esm/Dialogs/DialogShells.js.map +1 -0
- package/dist/esm/Dialogs/dialogPartAttributes.d.ts +19 -0
- package/dist/esm/Dialogs/dialogPartAttributes.d.ts.map +1 -0
- package/dist/esm/Dialogs/dialogPartAttributes.js +10 -0
- package/dist/esm/Dialogs/dialogPartAttributes.js.map +1 -0
- package/dist/esm/Dialogs/resolveDialogLabels.d.ts +29 -0
- package/dist/esm/Dialogs/resolveDialogLabels.d.ts.map +1 -0
- package/dist/esm/Dialogs/resolveDialogLabels.js +11 -0
- package/dist/esm/Dialogs/resolveDialogLabels.js.map +1 -0
- package/dist/esm/Dialogs/useDialogClose.d.ts +13 -0
- package/dist/esm/Dialogs/useDialogClose.d.ts.map +1 -0
- package/dist/esm/Dialogs/useDialogClose.js +32 -0
- package/dist/esm/Dialogs/useDialogClose.js.map +1 -0
- package/dist/esm/Dialogs/useDialogFocus.d.ts +26 -0
- package/dist/esm/Dialogs/useDialogFocus.d.ts.map +1 -0
- package/dist/esm/Dialogs/useDialogFocus.js +56 -0
- package/dist/esm/Dialogs/useDialogFocus.js.map +1 -0
- package/dist/esm/Dialogs/useDialogZIndex.d.ts +9 -0
- package/dist/esm/Dialogs/useDialogZIndex.d.ts.map +1 -0
- package/dist/esm/Dialogs/useDialogZIndex.js +19 -0
- package/dist/esm/Dialogs/useDialogZIndex.js.map +1 -0
- package/dist/esm/SchemaEditor/ReadOnlyTypeCell.d.ts +6 -0
- package/dist/esm/SchemaEditor/ReadOnlyTypeCell.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/ReadOnlyTypeCell.js +19 -0
- package/dist/esm/SchemaEditor/ReadOnlyTypeCell.js.map +1 -0
- package/dist/esm/SchemaEditor/SchemaEditor.d.ts.map +1 -1
- package/dist/esm/SchemaEditor/SchemaEditor.js +44 -514
- package/dist/esm/SchemaEditor/SchemaEditor.js.map +1 -1
- package/dist/esm/SchemaEditor/SchemaEditorNavigation.d.ts +13 -0
- package/dist/esm/SchemaEditor/SchemaEditorNavigation.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/SchemaEditorNavigation.js +36 -0
- package/dist/esm/SchemaEditor/SchemaEditorNavigation.js.map +1 -0
- package/dist/esm/SchemaEditor/SchemaEditorTable.d.ts +34 -0
- package/dist/esm/SchemaEditor/SchemaEditorTable.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/SchemaEditorTable.js +54 -0
- package/dist/esm/SchemaEditor/SchemaEditorTable.js.map +1 -0
- package/dist/esm/SchemaEditor/TypeCell.d.ts.map +1 -1
- package/dist/esm/SchemaEditor/TypeCell.js +14 -80
- package/dist/esm/SchemaEditor/TypeCell.js.map +1 -1
- package/dist/esm/SchemaEditor/TypeCellActions.d.ts +13 -0
- package/dist/esm/SchemaEditor/TypeCellActions.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/TypeCellActions.js +19 -0
- package/dist/esm/SchemaEditor/TypeCellActions.js.map +1 -0
- package/dist/esm/SchemaEditor/resolveTypeChange.d.ts +12 -0
- package/dist/esm/SchemaEditor/resolveTypeChange.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/resolveTypeChange.js +19 -0
- package/dist/esm/SchemaEditor/resolveTypeChange.js.map +1 -0
- package/dist/esm/SchemaEditor/schemaDocument.d.ts +20 -0
- package/dist/esm/SchemaEditor/schemaDocument.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/schemaDocument.js +70 -0
- package/dist/esm/SchemaEditor/schemaDocument.js.map +1 -0
- package/dist/esm/SchemaEditor/schemaEditorMenu.d.ts +30 -0
- package/dist/esm/SchemaEditor/schemaEditorMenu.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/schemaEditorMenu.js +51 -0
- package/dist/esm/SchemaEditor/schemaEditorMenu.js.map +1 -0
- package/dist/esm/SchemaEditor/schemaPropertyEdits.d.ts +33 -0
- package/dist/esm/SchemaEditor/schemaPropertyEdits.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/schemaPropertyEdits.js +134 -0
- package/dist/esm/SchemaEditor/schemaPropertyEdits.js.map +1 -0
- package/dist/esm/SchemaEditor/typeOptions.d.ts +11 -0
- package/dist/esm/SchemaEditor/typeOptions.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/typeOptions.js +20 -0
- package/dist/esm/SchemaEditor/typeOptions.js.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaDocument.d.ts +26 -0
- package/dist/esm/SchemaEditor/useSchemaDocument.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaDocument.js +65 -0
- package/dist/esm/SchemaEditor/useSchemaDocument.js.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaEdits.d.ts +29 -0
- package/dist/esm/SchemaEditor/useSchemaEdits.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaEdits.js +50 -0
- package/dist/esm/SchemaEditor/useSchemaEdits.js.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaNavigation.d.ts +15 -0
- package/dist/esm/SchemaEditor/useSchemaNavigation.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaNavigation.js +24 -0
- package/dist/esm/SchemaEditor/useSchemaNavigation.js.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaRows.d.ts +17 -0
- package/dist/esm/SchemaEditor/useSchemaRows.d.ts.map +1 -0
- package/dist/esm/SchemaEditor/useSchemaRows.js +49 -0
- package/dist/esm/SchemaEditor/useSchemaRows.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { DatePickerInput } from '../Common/DatePickerInput.js';
|
|
3
|
+
import { Dropdown } from '../Dropdown/Dropdown.js';
|
|
4
|
+
import { classNames } from '../ClassNames/classNames.js';
|
|
5
|
+
|
|
6
|
+
const NumericInput = ({ field, placeholder, draftValue, setDraftValue, labels, pt }) => (jsx("input", { ...pt?.input, type: 'number', "aria-label": labels.valueAriaLabel(field), value: typeof draftValue === 'number' ? draftValue : '', placeholder: placeholder, className: classNames('cratis-filter-menu__input', pt?.input?.className), onChange: (event) => setDraftValue(event.target.value === '' ? null : event.target.valueAsNumber) }));
|
|
7
|
+
const DateInput = ({ field, draftValue, setDraftValue, labels, pt }) => (jsx(DatePickerInput, { value: draftValue instanceof Date ? draftValue : null, onChange: (value) => setDraftValue(value), showIcon: true, "aria-label": labels.valueAriaLabel(field), className: pt?.input?.className, style: pt?.input?.style }));
|
|
8
|
+
const BooleanInput = ({ field, placeholder, draftValue, setDraftValue, labels, pt }) => (jsx(Dropdown, { value: draftValue, options: [
|
|
9
|
+
{ label: labels.true, value: true },
|
|
10
|
+
{ label: labels.false, value: false },
|
|
11
|
+
], placeholder: placeholder, showClear: true, onChange: (value) => setDraftValue(value), "aria-label": labels.valueAriaLabel(field), className: pt?.input?.className, style: pt?.input?.style }));
|
|
12
|
+
const TextInput = ({ field, placeholder, draftValue, setDraftValue, labels, pt }) => (jsx("input", { ...pt?.input, value: typeof draftValue === 'string' ? draftValue : '', "aria-label": labels.valueAriaLabel(field), placeholder: placeholder, className: classNames('cratis-filter-menu__input', pt?.input?.className), onChange: (event) => setDraftValue(event.target.value) }));
|
|
13
|
+
const builtInInputs = {
|
|
14
|
+
numeric: NumericInput,
|
|
15
|
+
date: DateInput,
|
|
16
|
+
boolean: BooleanInput,
|
|
17
|
+
text: TextInput,
|
|
18
|
+
};
|
|
19
|
+
const ColumnFilterValueInput = (props) => {
|
|
20
|
+
const { field, dataType, placeholder, filterOptions, filterElement, draftValue, draftMode, setDraftValue, setDraftMode, apply, clear, labels, pt } = props;
|
|
21
|
+
if (filterOptions) {
|
|
22
|
+
return (jsx(Dropdown, { value: draftValue, options: filterOptions, optionLabel: 'label', optionValue: 'value', placeholder: placeholder, showClear: true, onChange: (value) => setDraftValue(() => value), "aria-label": labels.valueAriaLabel(field), className: pt?.input?.className, style: pt?.input?.style }));
|
|
23
|
+
}
|
|
24
|
+
if (filterElement) {
|
|
25
|
+
return filterElement({
|
|
26
|
+
field,
|
|
27
|
+
value: draftValue,
|
|
28
|
+
matchMode: draftMode,
|
|
29
|
+
onChange: (value) => setDraftValue(() => value),
|
|
30
|
+
onMatchModeChange: (matchMode) => setDraftMode(matchMode),
|
|
31
|
+
onApply: apply,
|
|
32
|
+
onClear: clear,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return (builtInInputs[dataType] ?? TextInput)({ field, placeholder, draftValue, setDraftValue, labels, pt });
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { ColumnFilterValueInput };
|
|
39
|
+
//# sourceMappingURL=ColumnFilterValueInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnFilterValueInput.js","sources":["../../../DataTables/ColumnFilterValueInput.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 { SyntheticEvent } from 'react';\nimport { DatePickerInput } from '../Common/DatePickerInput';\nimport { Dropdown } from '../Dropdown/Dropdown';\nimport { classNames } from '../ClassNames/classNames';\nimport type { DataTableFilterMatchMode as FilterMatchMode } from './DataTableFilterMeta';\nimport type {\n ColumnFilterDataType,\n ColumnFilterElement,\n ColumnFilterMenuLabels,\n ColumnFilterMenuParts,\n ColumnFilterOption,\n} from './ColumnFilterMenu';\n\nexport interface ColumnFilterValueInputProps {\n field: string;\n dataType: ColumnFilterDataType;\n placeholder?: string;\n filterOptions?: ColumnFilterOption[];\n filterElement?: ColumnFilterElement;\n draftValue: unknown;\n draftMode: FilterMatchMode;\n setDraftValue: (update: unknown) => void;\n setDraftMode: (mode: FilterMatchMode) => void;\n apply: (event?: SyntheticEvent) => void;\n clear: (event?: SyntheticEvent) => void;\n labels: ColumnFilterMenuLabels;\n pt?: ColumnFilterMenuParts;\n}\n\ntype BuiltInInputProps = Pick<\n ColumnFilterValueInputProps,\n 'field' | 'placeholder' | 'draftValue' | 'setDraftValue' | 'labels' | 'pt'\n>;\n\nconst NumericInput = ({ field, placeholder, draftValue, setDraftValue, labels, pt }: BuiltInInputProps) => (\n <input\n {...pt?.input}\n type='number'\n aria-label={labels.valueAriaLabel(field)}\n value={typeof draftValue === 'number' ? draftValue : ''}\n placeholder={placeholder}\n className={classNames('cratis-filter-menu__input', pt?.input?.className)}\n onChange={(event) =>\n setDraftValue(event.target.value === '' ? null : event.target.valueAsNumber)\n }\n />\n);\n\nconst DateInput = ({ field, draftValue, setDraftValue, labels, pt }: BuiltInInputProps) => (\n <DatePickerInput\n value={draftValue instanceof Date ? draftValue : null}\n onChange={(value) => setDraftValue(value)}\n showIcon\n aria-label={labels.valueAriaLabel(field)}\n className={pt?.input?.className}\n style={pt?.input?.style}\n />\n);\n\nconst BooleanInput = ({ field, placeholder, draftValue, setDraftValue, labels, pt }: BuiltInInputProps) => (\n <Dropdown\n value={draftValue}\n options={[\n { label: labels.true, value: true },\n { label: labels.false, value: false },\n ]}\n placeholder={placeholder}\n showClear\n onChange={(value) => setDraftValue(value)}\n aria-label={labels.valueAriaLabel(field)}\n className={pt?.input?.className}\n style={pt?.input?.style}\n />\n);\n\nconst TextInput = ({ field, placeholder, draftValue, setDraftValue, labels, pt }: BuiltInInputProps) => (\n <input\n {...pt?.input}\n value={typeof draftValue === 'string' ? draftValue : ''}\n aria-label={labels.valueAriaLabel(field)}\n placeholder={placeholder}\n className={classNames('cratis-filter-menu__input', pt?.input?.className)}\n onChange={(event) => setDraftValue(event.target.value)}\n />\n);\n\nconst builtInInputs: Record<ColumnFilterDataType, (props: BuiltInInputProps) => React.JSX.Element> = {\n numeric: NumericInput,\n date: DateInput,\n boolean: BooleanInput,\n text: TextInput,\n};\n\n/**\n * Renders the value editor of a column filter. The built-in editors are called as functions, not\n * mounted as components, so switching data type keeps the same element type at the same position.\n */\nexport const ColumnFilterValueInput = (props: ColumnFilterValueInputProps) => {\n const { field, dataType, placeholder, filterOptions, filterElement, draftValue, draftMode, setDraftValue, setDraftMode, apply, clear, labels, pt } = props;\n if (filterOptions) {\n return (\n <Dropdown\n value={draftValue}\n options={filterOptions}\n optionLabel='label'\n optionValue='value'\n placeholder={placeholder}\n showClear\n onChange={(value) => setDraftValue(() => value)}\n aria-label={labels.valueAriaLabel(field)}\n className={pt?.input?.className}\n style={pt?.input?.style}\n />\n );\n }\n if (filterElement) {\n return filterElement({\n field,\n value: draftValue,\n matchMode: draftMode,\n onChange: (value) => setDraftValue(() => value),\n onMatchModeChange: (matchMode) => setDraftMode(matchMode),\n onApply: apply,\n onClear: clear,\n });\n }\n return (builtInInputs[dataType] ?? TextInput)({ field, placeholder, draftValue, setDraftValue, labels, pt });\n};\n"],"names":["_jsx"],"mappings":";;;;;AAqCA,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAqB,MAClGA,GAAA,CAAA,OAAA,EAAA,EAAA,GACQ,EAAE,EAAE,KAAK,EACb,IAAI,EA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AW,EAAC,OAAO,EACnB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAA,IAAA,EACT,QAAQ,EAAE,CAAC,KAAK,KAAK,aAAa,CAAC,MAAM,KAAK,CAAC,EAAA,YAAA,EACnC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EACxC,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAC/B,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAA,CACzB;IAEV;IACA,IAAI,aAAa,EAAE;AACf,QAAA,OAAO,aAAa,CAAC;YACjB,KAAK;AACL,YAAA,KAAK,EAAE,UAAU;AACjB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,QAAQ,EAAE,CAAC,KAAK,KAAK,aAAa,CAAC,MAAM,KAAK,CAAC;YAC/C,iBAAiB,EAAE,CAAC,SAAS,KAAK,YAAY,CAAC,SAAS,CAAC;AACzD,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,OAAO,EAAE,KAAK;AACjB,SAAA,CAAC;IACN;IACA,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,SAAS,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAChH;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DataTableFilterMatchMode as FilterMatchMode } from './DataTableFilterMeta.js';
|
|
2
|
+
import type { ColumnFilterDataType, ColumnFilterMenuLabels } from './ColumnFilterMenu.js';
|
|
3
|
+
export interface MatchModeOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: FilterMatchMode;
|
|
6
|
+
}
|
|
7
|
+
export declare const defaultModeFor: (dataType: ColumnFilterDataType) => FilterMatchMode;
|
|
8
|
+
/** The localized match modes on offer, with the current draft mode appended when it is not one of them. */
|
|
9
|
+
export declare const buildModeOptions: (dataType: ColumnFilterDataType, hasKnownValues: boolean, draftMode: FilterMatchMode, matchModeLabel: ColumnFilterMenuLabels['matchModeLabel']) => MatchModeOption[];
|
|
10
|
+
//# sourceMappingURL=columnFilterMatchModes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnFilterMatchModes.d.ts","sourceRoot":"","sources":["../../../DataTables/columnFilterMatchModes.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,wBAAwB,IAAI,eAAe,EACnD,MAAM,0BAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,uBAAoB,CAAC;AAEvF,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,CAAC;CAC1B;AA6CD,eAAO,MAAM,cAAc,aAAc,oBAAoB,KAAG,eACO,CAAC;AAKxE,2GAA2G;AAC3G,eAAO,MAAM,gBAAgB,aACf,oBAAoB,kBACd,OAAO,aACZ,eAAe,kBACV,sBAAsB,CAAC,gBAAgB,CAAC,KACzD,eAAe,EAQjB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DataTableFilterMatchMode } from './DataTableFilterMeta.js';
|
|
2
|
+
|
|
3
|
+
const modeOptions = (pairs) => pairs.map(([label, value]) => ({ label, value }));
|
|
4
|
+
const valueMatchModeOptions = modeOptions([
|
|
5
|
+
['Equals', DataTableFilterMatchMode.Equals],
|
|
6
|
+
['Not equals', DataTableFilterMatchMode.NotEquals],
|
|
7
|
+
]);
|
|
8
|
+
const matchModesByDataType = {
|
|
9
|
+
numeric: modeOptions([
|
|
10
|
+
['Equals', DataTableFilterMatchMode.Equals],
|
|
11
|
+
['Not equals', DataTableFilterMatchMode.NotEquals],
|
|
12
|
+
['Less than', DataTableFilterMatchMode.LessThan],
|
|
13
|
+
['Less than or equal', DataTableFilterMatchMode.LessThanOrEqual],
|
|
14
|
+
['Greater than', DataTableFilterMatchMode.GreaterThan],
|
|
15
|
+
['Greater than or equal', DataTableFilterMatchMode.GreaterThanOrEqual],
|
|
16
|
+
]),
|
|
17
|
+
date: modeOptions([
|
|
18
|
+
['Date is', DataTableFilterMatchMode.DateIs],
|
|
19
|
+
['Date is not', DataTableFilterMatchMode.DateIsNot],
|
|
20
|
+
['Before', DataTableFilterMatchMode.DateBefore],
|
|
21
|
+
['After', DataTableFilterMatchMode.DateAfter],
|
|
22
|
+
]),
|
|
23
|
+
boolean: modeOptions([['Equals', DataTableFilterMatchMode.Equals]]),
|
|
24
|
+
text: modeOptions([
|
|
25
|
+
['Contains', DataTableFilterMatchMode.Contains],
|
|
26
|
+
['Starts with', DataTableFilterMatchMode.StartsWith],
|
|
27
|
+
['Ends with', DataTableFilterMatchMode.EndsWith],
|
|
28
|
+
['Equals', DataTableFilterMatchMode.Equals],
|
|
29
|
+
['Not contains', DataTableFilterMatchMode.NotContains],
|
|
30
|
+
['Not equals', DataTableFilterMatchMode.NotEquals],
|
|
31
|
+
]),
|
|
32
|
+
};
|
|
33
|
+
const defaultModesByDataType = {
|
|
34
|
+
text: DataTableFilterMatchMode.Contains,
|
|
35
|
+
date: DataTableFilterMatchMode.DateIs,
|
|
36
|
+
numeric: DataTableFilterMatchMode.Equals,
|
|
37
|
+
boolean: DataTableFilterMatchMode.Equals,
|
|
38
|
+
};
|
|
39
|
+
const defaultModeFor = (dataType) => defaultModesByDataType[dataType] ?? DataTableFilterMatchMode.Equals;
|
|
40
|
+
const offeredModes = (dataType, hasKnownValues) => hasKnownValues ? valueMatchModeOptions : (matchModesByDataType[dataType] ?? matchModesByDataType.text);
|
|
41
|
+
const buildModeOptions = (dataType, hasKnownValues, draftMode, matchModeLabel) => {
|
|
42
|
+
const options = offeredModes(dataType, hasKnownValues).map(option => ({
|
|
43
|
+
...option,
|
|
44
|
+
label: matchModeLabel(option.value, option.label),
|
|
45
|
+
}));
|
|
46
|
+
return options.some(option => option.value === draftMode)
|
|
47
|
+
? options
|
|
48
|
+
: [...options, { label: matchModeLabel(draftMode, String(draftMode)), value: draftMode }];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { buildModeOptions, defaultModeFor };
|
|
52
|
+
//# sourceMappingURL=columnFilterMatchModes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnFilterMatchModes.js","sources":["../../../DataTables/columnFilterMatchModes.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 {\n DataTableFilterMatchMode,\n type DataTableFilterMatchMode as FilterMatchMode,\n} from './DataTableFilterMeta';\nimport type { ColumnFilterDataType, ColumnFilterMenuLabels } from './ColumnFilterMenu';\n\nexport interface MatchModeOption {\n label: string;\n value: FilterMatchMode;\n}\n\nconst modeOptions = (pairs: [string, FilterMatchMode][]): MatchModeOption[] =>\n pairs.map(([label, value]) => ({ label, value }));\n\n// A column that filters over a known set of values has only two questions worth asking of it - is it\n// this one, or is it not - so the free-text and numeric comparisons are not offered for it.\nconst valueMatchModeOptions: MatchModeOption[] = modeOptions([\n ['Equals', DataTableFilterMatchMode.Equals],\n ['Not equals', DataTableFilterMatchMode.NotEquals],\n]);\n\nconst matchModesByDataType: Record<ColumnFilterDataType, MatchModeOption[]> = {\n numeric: modeOptions([\n ['Equals', DataTableFilterMatchMode.Equals],\n ['Not equals', DataTableFilterMatchMode.NotEquals],\n ['Less than', DataTableFilterMatchMode.LessThan],\n ['Less than or equal', DataTableFilterMatchMode.LessThanOrEqual],\n ['Greater than', DataTableFilterMatchMode.GreaterThan],\n ['Greater than or equal', DataTableFilterMatchMode.GreaterThanOrEqual],\n ]),\n date: modeOptions([\n ['Date is', DataTableFilterMatchMode.DateIs],\n ['Date is not', DataTableFilterMatchMode.DateIsNot],\n ['Before', DataTableFilterMatchMode.DateBefore],\n ['After', DataTableFilterMatchMode.DateAfter],\n ]),\n boolean: modeOptions([['Equals', DataTableFilterMatchMode.Equals]]),\n text: modeOptions([\n ['Contains', DataTableFilterMatchMode.Contains],\n ['Starts with', DataTableFilterMatchMode.StartsWith],\n ['Ends with', DataTableFilterMatchMode.EndsWith],\n ['Equals', DataTableFilterMatchMode.Equals],\n ['Not contains', DataTableFilterMatchMode.NotContains],\n ['Not equals', DataTableFilterMatchMode.NotEquals],\n ]),\n};\n\nconst defaultModesByDataType: Record<ColumnFilterDataType, FilterMatchMode> = {\n text: DataTableFilterMatchMode.Contains,\n date: DataTableFilterMatchMode.DateIs,\n numeric: DataTableFilterMatchMode.Equals,\n boolean: DataTableFilterMatchMode.Equals,\n};\n\nexport const defaultModeFor = (dataType: ColumnFilterDataType): FilterMatchMode =>\n defaultModesByDataType[dataType] ?? DataTableFilterMatchMode.Equals;\n\nconst offeredModes = (dataType: ColumnFilterDataType, hasKnownValues: boolean): MatchModeOption[] =>\n hasKnownValues ? valueMatchModeOptions : (matchModesByDataType[dataType] ?? matchModesByDataType.text);\n\n/** The localized match modes on offer, with the current draft mode appended when it is not one of them. */\nexport const buildModeOptions = (\n dataType: ColumnFilterDataType,\n hasKnownValues: boolean,\n draftMode: FilterMatchMode,\n matchModeLabel: ColumnFilterMenuLabels['matchModeLabel'],\n): MatchModeOption[] => {\n const options = offeredModes(dataType, hasKnownValues).map(option => ({\n ...option,\n label: matchModeLabel(option.value, option.label),\n }));\n return options.some(option => option.value === draftMode)\n ? options\n : [...options, { label: matchModeLabel(draftMode, String(draftMode)), value: draftMode }];\n};\n"],"names":[],"mappings":";;AAcA,MAAM,WAAW,GAAG,CAAC,KAAkC,KACnD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAIrD,MAAM,qBAAqB,GAAsB,WAAW,CAAC;AACzD,IAAA,CAAC,QAAQ,EAAE,wBAAwB,CAAC,MAAM,CAAC;AAC3C,IAAA,CAAC,YAAY,EAAE,wBAAwB,CAAC,SAAS,CAAC;AACrD,CAAA,CAAC;AAEF,M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,QAAQ;IACvC,IAAI,EAAE,wBAAwB,CAAC,MAAM;IACrC,OAAO,EAAE,wBAAwB,CAAC,MAAM;IACxC,OAAO,EAAE,wBAAwB,CAAC,MAAM;CAC3C;AAEM,MAAM,cAAc,GAAG,CAAC,QAA8B,KACzD,sBAAsB,CAAC,QAAQ,CAAC,IAAI,wBAAwB,CAAC;AAEjE,MAAM,YAAY,GAAG,CAAC,QAA8B,EAAE,cAAuB,KACzE,cAAc,GAAG,qBAAqB,IAAI,oBAAoB,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC;AAGnG,MAAM,gBAAgB,GAAG,CAC5B,QAA8B,EAC9B,cAAuB,EACvB,SAA0B,EAC1B,cAAwD,KACrC;AACnB,IAAA,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK;AAClE,QAAA,GAAG,MAAM;QACT,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;AACpD,KAAA,CAAC,CAAC;AACH,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;AACpD,UAAE;UACA,CAAC,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AACjG;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ColumnFilterMenuLabels } from './ColumnFilterMenu.js';
|
|
2
|
+
/** Each label comes from the explicit labels, else the provider messages, else the defaults. */
|
|
3
|
+
export declare const resolveColumnFilterLabels: (labels: Partial<ColumnFilterMenuLabels> | undefined, providerMessages: Partial<ColumnFilterMenuLabels> | undefined, defaults: ColumnFilterMenuLabels) => ColumnFilterMenuLabels;
|
|
4
|
+
//# sourceMappingURL=resolveColumnFilterLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveColumnFilterLabels.d.ts","sourceRoot":"","sources":["../../../DataTables/resolveColumnFilterLabels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAoB,CAAC;AAajE,gGAAgG;AAChG,eAAO,MAAM,yBAAyB,WAC1B,OAAO,CAAC,sBAAsB,CAAC,GAAG,SAAS,oBACjC,OAAO,CAAC,sBAAsB,CAAC,GAAG,SAAS,YACnD,sBAAsB,KACjC,sBAMF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const labelKeys = [
|
|
2
|
+
'filterTriggerAriaLabel',
|
|
3
|
+
'valueAriaLabel',
|
|
4
|
+
'matchModeAriaLabel',
|
|
5
|
+
'matchModeLabel',
|
|
6
|
+
'clear',
|
|
7
|
+
'apply',
|
|
8
|
+
'true',
|
|
9
|
+
'false',
|
|
10
|
+
];
|
|
11
|
+
const resolveColumnFilterLabels = (labels, providerMessages, defaults) => {
|
|
12
|
+
const resolved = {};
|
|
13
|
+
for (const key of labelKeys) {
|
|
14
|
+
resolved[key] = labels?.[key] ?? providerMessages?.[key] ?? defaults[key];
|
|
15
|
+
}
|
|
16
|
+
return resolved;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { resolveColumnFilterLabels };
|
|
20
|
+
//# sourceMappingURL=resolveColumnFilterLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveColumnFilterLabels.js","sources":["../../../DataTables/resolveColumnFilterLabels.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 type { ColumnFilterMenuLabels } from './ColumnFilterMenu';\n\nconst labelKeys: (keyof ColumnFilterMenuLabels)[] = [\n 'filterTriggerAriaLabel',\n 'valueAriaLabel',\n 'matchModeAriaLabel',\n 'matchModeLabel',\n 'clear',\n 'apply',\n 'true',\n 'false',\n];\n\n/** Each label comes from the explicit labels, else the provider messages, else the defaults. */\nexport const resolveColumnFilterLabels = (\n labels: Partial<ColumnFilterMenuLabels> | undefined,\n providerMessages: Partial<ColumnFilterMenuLabels> | undefined,\n defaults: ColumnFilterMenuLabels,\n): ColumnFilterMenuLabels => {\n const resolved: Record<string, unknown> = {};\n for (const key of labelKeys) {\n resolved[key] = labels?.[key] ?? providerMessages?.[key] ?? defaults[key];\n }\n return resolved as unknown as ColumnFilterMenuLabels;\n};\n"],"names":[],"mappings":"AAKA,MAAM,SAAS,GAAqC;IAChD,wBAAwB;IACxB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,OAAO;IACP,OAAO;IACP,MAAM;IACN,OAAO;CACV;AAGM,MAAM,yBAAyB,GAAG,CACrC,MAAmD,EACnD,gBAA6D,EAC7D,QAAgC,KACR;IACxB,MAAM,QAAQ,GAA4B,EAAE;AAC5C,IAAA,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE;QACzB,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,IAAI,gBAAgB,GAAG,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;IAC7E;AACA,IAAA,OAAO,QAA6C;AACxD;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SyntheticEvent } from 'react';
|
|
2
|
+
import type { ColumnFilterDataType } from './ColumnFilterMenu.js';
|
|
3
|
+
import type { DataTableFilterConstraint, DataTableFilterMatchMode as FilterMatchMode } from './DataTableFilterMeta.js';
|
|
4
|
+
/** Holds the draft value and match mode of a column filter and the apply/clear actions over it. */
|
|
5
|
+
export declare const useColumnFilterDraft: (dataType: ColumnFilterDataType, constraint: DataTableFilterConstraint | undefined, onApply: (constraint: DataTableFilterConstraint) => void, onClear: () => void) => {
|
|
6
|
+
draftValue: unknown;
|
|
7
|
+
draftMode: FilterMatchMode;
|
|
8
|
+
setDraftValue: import("react").Dispatch<unknown>;
|
|
9
|
+
setDraftMode: import("react").Dispatch<import("react").SetStateAction<FilterMatchMode>>;
|
|
10
|
+
apply: (event?: SyntheticEvent) => void;
|
|
11
|
+
clear: (event?: SyntheticEvent) => void;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useColumnFilterDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnFilterDraft.d.ts","sourceRoot":"","sources":["../../../DataTables/useColumnFilterDraft.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAoB,CAAC;AAE/D,OAAO,KAAK,EACR,yBAAyB,EACzB,wBAAwB,IAAI,eAAe,EAC9C,MAAM,0BAAuB,CAAC;AAE/B,mGAAmG;AACnG,eAAO,MAAM,oBAAoB,aACnB,oBAAoB,cAClB,yBAAyB,GAAG,SAAS,WACxC,CAAC,UAAU,EAAE,yBAAyB,KAAK,IAAI,WAC/C,MAAM,IAAI;;;;;oBAiBI,cAAc;oBALd,cAAc;CAWxC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { defaultModeFor } from './columnFilterMatchModes.js';
|
|
3
|
+
|
|
4
|
+
const useColumnFilterDraft = (dataType, constraint, onApply, onClear) => {
|
|
5
|
+
const [draftValue, setDraftValue] = useState(constraint?.value ?? null);
|
|
6
|
+
const [draftMode, setDraftMode] = useState(constraint?.matchMode ?? defaultModeFor(dataType));
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setDraftValue(constraint?.value ?? null);
|
|
9
|
+
setDraftMode(constraint?.matchMode ?? defaultModeFor(dataType));
|
|
10
|
+
}, [constraint, dataType]);
|
|
11
|
+
const clear = (event) => {
|
|
12
|
+
setDraftValue(null);
|
|
13
|
+
onClear();
|
|
14
|
+
event?.preventDefault();
|
|
15
|
+
};
|
|
16
|
+
const apply = (event) => {
|
|
17
|
+
onApply({ value: draftValue, matchMode: draftMode });
|
|
18
|
+
event?.preventDefault();
|
|
19
|
+
};
|
|
20
|
+
return { draftValue, draftMode, setDraftValue, setDraftMode, apply, clear };
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { useColumnFilterDraft };
|
|
24
|
+
//# sourceMappingURL=useColumnFilterDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnFilterDraft.js","sources":["../../../DataTables/useColumnFilterDraft.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 { useEffect, useState, type SyntheticEvent } from 'react';\nimport type { ColumnFilterDataType } from './ColumnFilterMenu';\nimport { defaultModeFor } from './columnFilterMatchModes';\nimport type {\n DataTableFilterConstraint,\n DataTableFilterMatchMode as FilterMatchMode,\n} from './DataTableFilterMeta';\n\n/** Holds the draft value and match mode of a column filter and the apply/clear actions over it. */\nexport const useColumnFilterDraft = (\n dataType: ColumnFilterDataType,\n constraint: DataTableFilterConstraint | undefined,\n onApply: (constraint: DataTableFilterConstraint) => void,\n onClear: () => void,\n) => {\n const [draftValue, setDraftValue] = useState<unknown>(constraint?.value ?? null);\n const [draftMode, setDraftMode] = useState<FilterMatchMode>(\n constraint?.matchMode ?? defaultModeFor(dataType),\n );\n\n useEffect(() => {\n setDraftValue(constraint?.value ?? null);\n setDraftMode(constraint?.matchMode ?? defaultModeFor(dataType));\n }, [constraint, dataType]);\n\n const clear = (event?: SyntheticEvent) => {\n setDraftValue(null);\n onClear();\n event?.preventDefault();\n };\n const apply = (event?: SyntheticEvent) => {\n onApply({ value: draftValue, matchMode: draftMode });\n event?.preventDefault();\n };\n\n return { draftValue, draftMode, setDraftValue, setDraftMode, apply, clear };\n};\n"],"names":[],"mappings":";;;AAYO,MAAM,oBAAoB,GAAG,CAChC,QAA8B,EAC9B,UAAiD,EACjD,OAAwD,EACxD,OAAmB,KACnB;AACA,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAU,UAAU,EAAE,KAAK,IAAI,IAAI,CAAC;AAChF,IAAA,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CACtC,UAAU,EAAE,SAAS,IAAI,cAAc,CAAC,QAAQ,CAAC,CACpD;IAED,SAAS,CAAC,MAAK;AACX,QAAA,aAAa,CAAC,UAAU,EAAE,KAAK,IAAI,IAAI,CAAC;QACxC,YAAY,CAAC,UAAU,EAAE,SAAS,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC;AACnE,IAAA,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAE1B,IAAA,MAAM,KAAK,GAAG,CAAC,KAAsB,KAAI;QACrC,aAAa,CAAC,IAAI,CAAC;AACnB,QAAA,OAAO,EAAE;QACT,KAAK,EAAE,cAAc,EAAE;AAC3B,IAAA,CAAC;AACD,IAAA,MAAM,KAAK,GAAG,CAAC,KAAsB,KAAI;QACrC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;QACpD,KAAK,EAAE,cAAc,EAAE;AAC3B,IAAA,CAAC;AAED,IAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE;AAC/E;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Restores focus to the trigger when the popover closes, but only when the close actually dropped focus.
|
|
4
|
+
* Returns the ref callback that captures the popover element.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useRestoreFocusOnClose: (isOpen: boolean, triggerRef: RefObject<HTMLElement | null>) => (element: HTMLElement | null) => void;
|
|
7
|
+
//# sourceMappingURL=useRestoreFocusOnClose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRestoreFocusOnClose.d.ts","sourceRoot":"","sources":["../../../DataTables/useRestoreFocusOnClose.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAavE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,WAAY,OAAO,cAAc,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,eAKhD,WAAW,GAAG,IAAI,SA2BlE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const focusWasDropped = (trigger, popover) => {
|
|
4
|
+
const ownerDocument = trigger.ownerDocument;
|
|
5
|
+
const focusedElement = ownerDocument.activeElement;
|
|
6
|
+
return (!focusedElement ||
|
|
7
|
+
focusedElement === ownerDocument.body ||
|
|
8
|
+
!focusedElement.isConnected ||
|
|
9
|
+
popover?.contains(focusedElement) === true);
|
|
10
|
+
};
|
|
11
|
+
const useRestoreFocusOnClose = (isOpen, triggerRef) => {
|
|
12
|
+
const popoverRef = useRef(null);
|
|
13
|
+
const capturePopover = useCallback((element) => {
|
|
14
|
+
if (element)
|
|
15
|
+
popoverRef.current = element;
|
|
16
|
+
}, []);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!isOpen)
|
|
19
|
+
return;
|
|
20
|
+
return () => {
|
|
21
|
+
const trigger = triggerRef.current;
|
|
22
|
+
if (trigger && focusWasDropped(trigger, popoverRef.current))
|
|
23
|
+
trigger.focus();
|
|
24
|
+
};
|
|
25
|
+
}, [isOpen, triggerRef]);
|
|
26
|
+
return capturePopover;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { useRestoreFocusOnClose };
|
|
30
|
+
//# sourceMappingURL=useRestoreFocusOnClose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRestoreFocusOnClose.js","sources":["../../../DataTables/useRestoreFocusOnClose.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 { useCallback, useEffect, useRef, type RefObject } from 'react';\n\nconst focusWasDropped = (trigger: HTMLElement, popover: HTMLElement | null): boolean => {\n const ownerDocument = trigger.ownerDocument;\n const focusedElement = ownerDocument.activeElement;\n return (\n !focusedElement ||\n focusedElement === ownerDocument.body ||\n !focusedElement.isConnected ||\n popover?.contains(focusedElement) === true\n );\n};\n\n/**\n * Restores focus to the trigger when the popover closes, but only when the close actually dropped focus.\n * Returns the ref callback that captures the popover element.\n */\nexport const useRestoreFocusOnClose = (isOpen: boolean, triggerRef: RefObject<HTMLElement | null>) => {\n const popoverRef = useRef<HTMLElement | null>(null);\n // Sticky on purpose: React detaches the popover's ref during the same commit that closes the\n // menu, before the effect cleanup below runs, so the last element we saw is the only handle we\n // still have on the popover that is going away.\n const capturePopover = useCallback((element: HTMLElement | null) => {\n if (element) popoverRef.current = element;\n }, []);\n\n // React Aria's FocusScope already draws that distinction - at teardown it asks whether the\n // active element is still inside the dying scope or has already fallen to `document.body`, and\n // it leaves focus alone otherwise. Its weakness is only the timing: it defers the real restore\n // to a `requestAnimationFrame` that re-tests `activeElement === body`, which lands a frame after\n // focus has visibly left the trigger's neighborhood and silently does nothing if anything else\n // claims focus first. We keep its question and drop its delay: the same predicate is evaluated\n // synchronously in this cleanup, so the restore happens in the commit that closed the menu.\n //\n // \"Dropped\" has to be read at the moment this cleanup runs, while the popover is still exiting.\n // Focus is typically still on the popover's own content (its value input), which is about to be\n // removed - that is a drop in progress, not a destination. So a drop is: nothing focused, the\n // body, a node already detached from the document, or anything inside this menu's own popover.\n // Focus anywhere else is somewhere the user deliberately went, such as another column's filter\n // trigger, and must be left alone.\n useEffect(() => {\n if (!isOpen) return;\n return () => {\n const trigger = triggerRef.current;\n if (trigger && focusWasDropped(trigger, popoverRef.current)) trigger.focus();\n };\n }, [isOpen, triggerRef]);\n\n return capturePopover;\n};\n"],"names":[],"mappings":";;AAKA,MAAM,eAAe,GAAG,CAAC,OAAoB,EAAE,OAA2B,KAAa;AACnF,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa;AAC3C,IAAA,MAAM,cAAc,GAAG,aAAa,CAAC,aAAa;IAClD,QACI,CAAC,cAAc;QACf,cAAc,KAAK,aAAa,CAAC,IAAI;QACrC,CAAC,cAAc,CAAC,WAAW;QAC3B,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,IAAI;AAElD,CAAC;MAMY,sBAAsB,GAAG,CAAC,MAAe,EAAE,UAAyC,KAAI;AACjG,IAAA,MAAM,UAAU,GAAG,MAAM,CAAqB,IAAI,CAAC;AAInD,IAAA,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,OAA2B,KAAI;AAC/D,QAAA,IAAI,OAAO;AAAE,YAAA,UAAU,CAAC,OAAO,GAAG,OAAO;IAC7C,CAAC,EAAE,EAAE,CAAC;IAgBN,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,CAAC,MAAM;YAAE;AACb,QAAA,OAAO,MAAK;AACR,YAAA,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO;YAClC,IAAI,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;gBAAE,OAAO,CAAC,KAAK,EAAE;AAChF,QAAA,CAAC;AACL,IAAA,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAExB,IAAA,OAAO,cAAc;AACzB;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type DialogFooterProps } from './DialogFooter.js';
|
|
3
|
+
import { type DialogHeaderProps } from './DialogHeader.js';
|
|
4
|
+
interface Announcement {
|
|
5
|
+
key: number;
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
/** Props of the dialog document. */
|
|
9
|
+
export interface DialogDocumentProps {
|
|
10
|
+
header: DialogHeaderProps;
|
|
11
|
+
/** The footer, or null when the dialog has no footer. */
|
|
12
|
+
footer: DialogFooterProps | null;
|
|
13
|
+
stackZIndex: string;
|
|
14
|
+
visible: boolean;
|
|
15
|
+
contentStyle: React.CSSProperties | undefined;
|
|
16
|
+
announcement: Announcement | null;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** The accessible dialog document: header, content, footer and the status live region. */
|
|
20
|
+
export declare const DialogDocument: ({ header, footer, stackZIndex, visible, contentStyle, announcement, children, }: DialogDocumentProps) => React.JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=DialogDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogDocument.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogDocument.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AACtE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AAgBtE,UAAU,YAAY;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB;AA4CD,oCAAoC;AACpC,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,yDAAyD;IACzD,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IAC9C,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,0FAA0F;AAC1F,eAAO,MAAM,cAAc,oFAQxB,mBAAmB,sBAgBrB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { Dialog } from 'react-aria-components/Dialog';
|
|
3
|
+
import { classNames } from '../ClassNames/classNames.js';
|
|
4
|
+
import { DialogStackContext } from '../renderer/DialogStackContext.js';
|
|
5
|
+
import { DialogFooter } from './DialogFooter.js';
|
|
6
|
+
import { DialogHeader } from './DialogHeader.js';
|
|
7
|
+
|
|
8
|
+
const visuallyHidden = {
|
|
9
|
+
position: 'absolute',
|
|
10
|
+
width: 1,
|
|
11
|
+
height: 1,
|
|
12
|
+
margin: -1,
|
|
13
|
+
padding: 0,
|
|
14
|
+
overflow: 'hidden',
|
|
15
|
+
clipPath: 'inset(50%)',
|
|
16
|
+
whiteSpace: 'nowrap',
|
|
17
|
+
border: 0,
|
|
18
|
+
};
|
|
19
|
+
const DialogContent = ({ visible, isBusy, contentStyle, pt, children }) => (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 }) }));
|
|
20
|
+
const LiveRegion = ({ announcement }) => (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) }));
|
|
21
|
+
const DialogDocument = ({ header, footer, stackZIndex, visible, contentStyle, announcement, children, }) => (jsx(DialogStackContext.Provider, { value: stackZIndex, children: jsx(Dialog, { className: 'cratis-dialog__document', "aria-describedby": header.hasSubtitle ? header.subtitleId : undefined, children: jsxs(Fragment, { children: [jsx(DialogHeader, { ...header }), jsx(DialogContent, { visible: visible, isBusy: header.isBusy, contentStyle: contentStyle, pt: header.pt, children: children }), footer && jsx(DialogFooter, { ...footer }), jsx(LiveRegion, { announcement: announcement })] }) }) }));
|
|
22
|
+
|
|
23
|
+
export { DialogDocument };
|
|
24
|
+
//# sourceMappingURL=DialogDocument.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogDocument.js","sources":["../../../Dialogs/DialogDocument.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 { Dialog as AriaDialog } from 'react-aria-components/Dialog';\nimport type React from 'react';\nimport { classNames } from '../ClassNames/classNames';\nimport { DialogStackContext } from '../renderer/DialogStackContext';\nimport { DialogFooter, type DialogFooterProps } from './DialogFooter';\nimport { DialogHeader, type DialogHeaderProps } from './DialogHeader';\nimport type { DialogParts } from './Dialog';\n\n// Inline rather than in Dialog.css: the packed aggregate stylesheet has a reviewed size budget.\nconst visuallyHidden: React.CSSProperties = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n padding: 0,\n overflow: 'hidden',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n border: 0,\n};\n\ninterface Announcement {\n key: number;\n text: string;\n}\n\ninterface DialogContentProps {\n visible: boolean;\n isBusy: boolean;\n contentStyle: React.CSSProperties | undefined;\n pt: DialogParts | undefined;\n children: React.ReactNode;\n}\n\nconst DialogContent = ({ visible, isBusy, contentStyle, pt, children }: DialogContentProps) => (\n <div\n {...pt?.content}\n className={classNames('cratis-dialog__content', pt?.content?.className)}\n style={{ ...pt?.content?.style, ...contentStyle }}\n data-cratis-part='content'\n data-open={visible || undefined}\n data-busy={isBusy || undefined}\n >\n <fieldset\n className='cratis-dialog__busy-scope'\n data-cratis-part='busy-scope'\n data-busy={isBusy || undefined}\n disabled={isBusy}\n inert={isBusy}\n aria-busy={isBusy || undefined}\n >\n {children}\n </fieldset>\n </div>\n);\n\nconst LiveRegion = ({ announcement }: { announcement: Announcement | null }) => (\n <div\n className='cratis-dialog__live-region'\n style={visuallyHidden}\n role='status'\n aria-live='polite'\n aria-atomic='true'\n >\n {announcement && <span key={announcement.key}>{announcement.text}</span>}\n </div>\n);\n\n/** Props of the dialog document. */\nexport interface DialogDocumentProps {\n header: DialogHeaderProps;\n /** The footer, or null when the dialog has no footer. */\n footer: DialogFooterProps | null;\n stackZIndex: string;\n visible: boolean;\n contentStyle: React.CSSProperties | undefined;\n announcement: Announcement | null;\n children: React.ReactNode;\n}\n\n/** The accessible dialog document: header, content, footer and the status live region. */\nexport const DialogDocument = ({\n header,\n footer,\n stackZIndex,\n visible,\n contentStyle,\n announcement,\n children,\n}: DialogDocumentProps) => (\n <DialogStackContext.Provider value={stackZIndex}>\n <AriaDialog\n className='cratis-dialog__document'\n aria-describedby={header.hasSubtitle ? header.subtitleId : undefined}\n >\n <>\n <DialogHeader {...header} />\n <DialogContent visible={visible} isBusy={header.isBusy} contentStyle={contentStyle} pt={header.pt}>\n {children}\n </DialogContent>\n {footer && <DialogFooter {...footer} />}\n <LiveRegion announcement={announcement} />\n </>\n </AriaDialog>\n </DialogStackContext.Provider>\n);\n"],"names":["_jsx","AriaDialog","_jsxs","_Fragment"],"mappings":";;;;;;;AAYA,MAAM,cAAc,GAAwB;AACxC,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,EAAE;AACV,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,QAAQ,EAAE,YAAY;AACtB,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,MAAM,EAAE,CAAC;CACZ;AAeD,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAsB,MACtFA,GAAA,CAAA,KAAA,EAAA,EAAA,GACQ,EAAE,EAAE,OAAO,EACf,SAAS,EAAE,UAAU,CAAC,wBAAwB,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,EACv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AC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAA,QAAA,EAC5F,QAAQ,EAAA,CACG,EACf,MAAM,IAAIA,GAAA,CAAC,YAAY,EAAA,EAAA,GAAK,MAAM,EAAA,CAAI,EACvCA,GAAA,CAAC,UAAU,EAAA,EAAC,YAAY,EAAE,YAAY,GAAI,CAAA,EAAA,CAC3C,EAAA,CACM,EAAA,CACa;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DialogResult } from '@cratis/arc.react/dialogs';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { DialogParts, DialogProps } from './Dialog.js';
|
|
4
|
+
import type { DialogLabels } from './resolveDialogLabels.js';
|
|
5
|
+
interface FocusFlags {
|
|
6
|
+
confirm: boolean;
|
|
7
|
+
dismissing: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Props of the dialog footer. */
|
|
10
|
+
export interface DialogFooterProps {
|
|
11
|
+
buttons: NonNullable<DialogProps['buttons']>;
|
|
12
|
+
labels: DialogLabels;
|
|
13
|
+
focus: FocusFlags;
|
|
14
|
+
isBusy: boolean;
|
|
15
|
+
isValid: boolean;
|
|
16
|
+
pt: DialogParts | undefined;
|
|
17
|
+
confirmRef: React.RefObject<HTMLButtonElement | null>;
|
|
18
|
+
cancelRef: React.RefObject<HTMLButtonElement | null>;
|
|
19
|
+
onResult: (result: DialogResult) => void;
|
|
20
|
+
}
|
|
21
|
+
/** The dialog footer holding either the predefined buttons or a custom footer. */
|
|
22
|
+
export declare const DialogFooter: (props: DialogFooterProps) => React.JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=DialogFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogFooter.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogFooter.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAiB,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAAuB,CAAC;AAS1D,UAAU,UAAU;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACvB;AA8GD,kCAAkC;AAClC,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,EAAE,WAAW,GAAG,SAAS,CAAC;IAC5B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACtD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACrD,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CAC5C;AA4BD,kFAAkF;AAClF,eAAO,MAAM,YAAY,UAAW,iBAAiB,sBAyBpD,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { DialogButtons, DialogResult } from '@cratis/arc.react/dialogs';
|
|
3
|
+
import { classNames } from '../ClassNames/classNames.js';
|
|
4
|
+
|
|
5
|
+
const footerButtonsFor = (buttons, labels, focus) => {
|
|
6
|
+
const primary = (result, label) => ({ result, label, primary: true, focused: focus.confirm });
|
|
7
|
+
const secondary = (result, label, focused = focus.dismissing) => ({
|
|
8
|
+
result,
|
|
9
|
+
label,
|
|
10
|
+
primary: false,
|
|
11
|
+
focused,
|
|
12
|
+
});
|
|
13
|
+
switch (buttons) {
|
|
14
|
+
case DialogButtons.Ok:
|
|
15
|
+
return [primary(DialogResult.Ok, labels.ok)];
|
|
16
|
+
case DialogButtons.OkCancel:
|
|
17
|
+
return [primary(DialogResult.Ok, labels.ok), secondary(DialogResult.Cancelled, labels.cancel)];
|
|
18
|
+
case DialogButtons.YesNo:
|
|
19
|
+
return [primary(DialogResult.Yes, labels.yes), secondary(DialogResult.No, labels.no)];
|
|
20
|
+
case DialogButtons.YesNoCancel:
|
|
21
|
+
return [
|
|
22
|
+
primary(DialogResult.Yes, labels.yes),
|
|
23
|
+
secondary(DialogResult.No, labels.no, false),
|
|
24
|
+
secondary(DialogResult.Cancelled, labels.cancel),
|
|
25
|
+
];
|
|
26
|
+
default:
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const isActivationKey = (key) => key === 'Enter' || key === ' ';
|
|
31
|
+
const suppressRepeatedActivation = (event) => {
|
|
32
|
+
if (event.repeat && isActivationKey(event.key))
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
};
|
|
35
|
+
const buttonAttributes = (kind, part) => ({
|
|
36
|
+
...part,
|
|
37
|
+
type: 'button',
|
|
38
|
+
className: classNames('cratis-dialog__button', `cratis-dialog__button--${kind}`, part?.className),
|
|
39
|
+
});
|
|
40
|
+
const primaryAria = (isBusy) => ({
|
|
41
|
+
'aria-disabled': isBusy || undefined,
|
|
42
|
+
'aria-busy': isBusy || undefined,
|
|
43
|
+
});
|
|
44
|
+
const activate = (isBusy, onResult, result) => () => {
|
|
45
|
+
if (!isBusy)
|
|
46
|
+
onResult(result);
|
|
47
|
+
};
|
|
48
|
+
const PrimaryButton = ({ button, isBusy, isValid, pt, confirmRef, onResult }) => {
|
|
49
|
+
const isDisabled = !isValid || isBusy;
|
|
50
|
+
return (jsxs("button", { ...buttonAttributes('primary', pt?.confirm), ...primaryAria(isBusy), "data-cratis-part": 'confirm', "data-disabled": isDisabled || undefined, "data-busy": isBusy || undefined, ref: confirmRef, onClick: activate(isBusy, onResult, button.result), onKeyDown: suppressRepeatedActivation, disabled: !isValid, autoFocus: button.focused, children: [isBusy && jsx("span", { className: 'cratis-dialog__spinner', "aria-hidden": 'true' }), jsx("span", { children: button.label })] }));
|
|
51
|
+
};
|
|
52
|
+
const SecondaryButton = ({ button, isBusy, pt, cancelRef, onResult }) => (jsx("button", { ...buttonAttributes('secondary', pt?.cancel), "data-cratis-part": 'cancel', "data-disabled": isBusy || undefined, "data-busy": isBusy || undefined, ref: button.focused ? cancelRef : undefined, onClick: activate(isBusy, onResult, button.result), disabled: isBusy, autoFocus: button.focused, children: jsx("span", { children: button.label }) }));
|
|
53
|
+
const FooterButtons = ({ buttons, labels, focus, isBusy, isValid, pt, confirmRef, cancelRef, onResult }) => {
|
|
54
|
+
if (typeof buttons !== 'number')
|
|
55
|
+
return buttons;
|
|
56
|
+
return footerButtonsFor(buttons, labels, focus).map((button) => button.primary ? (jsx(PrimaryButton, { button: button, isBusy: isBusy, isValid: isValid, pt: pt, confirmRef: confirmRef, onResult: onResult }, `${button.result}-${button.label}`)) : (jsx(SecondaryButton, { button: button, isBusy: isBusy, pt: pt, cancelRef: cancelRef, onResult: onResult }, `${button.result}-${button.label}`)));
|
|
57
|
+
};
|
|
58
|
+
const DialogFooter = (props) => {
|
|
59
|
+
const { buttons, isBusy, pt } = props;
|
|
60
|
+
const isFooterScopeBusy = isBusy && typeof buttons !== 'number';
|
|
61
|
+
return (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: jsx(FooterButtons, { ...props }) }) }));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { DialogFooter };
|
|
65
|
+
//# sourceMappingURL=DialogFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogFooter.js","sources":["../../../Dialogs/DialogFooter.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 { DialogResult, DialogButtons } from '@cratis/arc.react/dialogs';\nimport type React from 'react';\nimport { classNames } from '../ClassNames/classNames';\nimport type { DialogParts, DialogProps } from './Dialog';\nimport type { DialogLabels } from './resolveDialogLabels';\n\ninterface FooterButton {\n result: DialogResult;\n label: string;\n primary: boolean;\n focused: boolean;\n}\n\ninterface FocusFlags {\n confirm: boolean;\n dismissing: boolean;\n}\n\n/**\n * Describes the predefined footer buttons of a button set.\n * @param buttons The dialog's predefined button set.\n * @param labels The resolved labels.\n * @param focus Which button kind receives the initial focus.\n * @returns The buttons in display order; empty for an unknown set.\n */\nconst footerButtonsFor = (buttons: DialogButtons, labels: DialogLabels, focus: FocusFlags): FooterButton[] => {\n const primary = (result: DialogResult, label: string): FooterButton => ({ result, label, primary: true, focused: focus.confirm });\n const secondary = (result: DialogResult, label: string, focused = focus.dismissing): FooterButton => ({\n result,\n label,\n primary: false,\n focused,\n });\n\n switch (buttons) {\n case DialogButtons.Ok:\n return [primary(DialogResult.Ok, labels.ok)];\n case DialogButtons.OkCancel:\n return [primary(DialogResult.Ok, labels.ok), secondary(DialogResult.Cancelled, labels.cancel)];\n case DialogButtons.YesNo:\n return [primary(DialogResult.Yes, labels.yes), secondary(DialogResult.No, labels.no)];\n case DialogButtons.YesNoCancel:\n return [\n primary(DialogResult.Yes, labels.yes),\n secondary(DialogResult.No, labels.no, false),\n secondary(DialogResult.Cancelled, labels.cancel),\n ];\n default:\n return [];\n }\n};\n\ninterface ButtonProps {\n button: FooterButton;\n isBusy: boolean;\n pt: DialogParts | undefined;\n onResult: (result: DialogResult) => void;\n}\n\ninterface PrimaryButtonProps extends ButtonProps {\n isValid: boolean;\n confirmRef: React.RefObject<HTMLButtonElement | null>;\n}\n\ninterface SecondaryButtonProps extends ButtonProps {\n cancelRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nconst isActivationKey = (key: string) => key === 'Enter' || key === ' ';\n\n// A held key must not re-submit when focus returns after a refusal.\nconst suppressRepeatedActivation = (event: React.KeyboardEvent) => {\n if (event.repeat && isActivationKey(event.key)) event.preventDefault();\n};\n\nconst buttonAttributes = (kind: 'primary' | 'secondary', part: DialogParts['confirm']) => ({\n ...part,\n type: 'button' as const,\n className: classNames('cratis-dialog__button', `cratis-dialog__button--${kind}`, part?.className),\n});\n\nconst primaryAria = (isBusy: boolean) => ({\n 'aria-disabled': isBusy || undefined,\n 'aria-busy': isBusy || undefined,\n});\n\nconst activate = (isBusy: boolean, onResult: (result: DialogResult) => void, result: DialogResult) => () => {\n if (!isBusy) onResult(result);\n};\n\nconst PrimaryButton = ({ button, isBusy, isValid, pt, confirmRef, onResult }: PrimaryButtonProps) => {\n const isDisabled = !isValid || isBusy;\n return (\n <button\n {...buttonAttributes('primary', pt?.confirm)}\n {...primaryAria(isBusy)}\n data-cratis-part='confirm'\n data-disabled={isDisabled || undefined}\n data-busy={isBusy || undefined}\n ref={confirmRef}\n onClick={activate(isBusy, onResult, button.result)}\n onKeyDown={suppressRepeatedActivation}\n disabled={!isValid}\n autoFocus={button.focused}\n >\n {isBusy && <span className='cratis-dialog__spinner' aria-hidden='true' />}\n <span>{button.label}</span>\n </button>\n );\n};\n\nconst SecondaryButton = ({ button, isBusy, pt, cancelRef, onResult }: SecondaryButtonProps) => (\n <button\n {...buttonAttributes('secondary', pt?.cancel)}\n data-cratis-part='cancel'\n data-disabled={isBusy || undefined}\n data-busy={isBusy || undefined}\n ref={button.focused ? cancelRef : undefined}\n onClick={activate(isBusy, onResult, button.result)}\n disabled={isBusy}\n autoFocus={button.focused}\n >\n <span>{button.label}</span>\n </button>\n);\n\n/** Props of the dialog footer. */\nexport interface DialogFooterProps {\n buttons: NonNullable<DialogProps['buttons']>;\n labels: DialogLabels;\n focus: FocusFlags;\n isBusy: boolean;\n isValid: boolean;\n pt: DialogParts | undefined;\n confirmRef: React.RefObject<HTMLButtonElement | null>;\n cancelRef: React.RefObject<HTMLButtonElement | null>;\n onResult: (result: DialogResult) => void;\n}\n\nconst FooterButtons = ({ buttons, labels, focus, isBusy, isValid, pt, confirmRef, cancelRef, onResult }: DialogFooterProps) => {\n if (typeof buttons !== 'number') return buttons;\n return footerButtonsFor(buttons, labels, focus).map((button) =>\n button.primary ? (\n <PrimaryButton\n key={`${button.result}-${button.label}`}\n button={button}\n isBusy={isBusy}\n isValid={isValid}\n pt={pt}\n confirmRef={confirmRef}\n onResult={onResult}\n />\n ) : (\n <SecondaryButton\n key={`${button.result}-${button.label}`}\n button={button}\n isBusy={isBusy}\n pt={pt}\n cancelRef={cancelRef}\n onResult={onResult}\n />\n ),\n );\n};\n\n/** The dialog footer holding either the predefined buttons or a custom footer. */\nexport const DialogFooter = (props: DialogFooterProps) => {\n const { buttons, isBusy, pt } = props;\n // The predefined footer keeps the confirm button focusable while busy, so only a custom\n // footer needs the whole scope disabled; predefined secondary buttons disable themselves.\n const isFooterScopeBusy = isBusy && typeof buttons !== 'number';\n\n return (\n <footer\n {...pt?.footer}\n className={classNames('cratis-dialog__footer', pt?.footer?.className)}\n style={pt?.footer?.style}\n data-cratis-part='footer'\n >\n <fieldset\n className='cratis-dialog__busy-scope cratis-dialog__busy-scope--footer'\n data-cratis-part='busy-scope'\n data-busy={isBusy || undefined}\n disabled={isFooterScopeBusy}\n inert={isFooterScopeBusy}\n aria-busy={isBusy || undefined}\n >\n <FooterButtons {...props} />\n </fieldset>\n </footer>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AA4BA,MAAM,gBAAgB,GAAG,CAAC,OAAsB,EAAE,MAAoB,EAAE,KAAiB,KAAoB;IACzG,MAAM,OAAO,GAAG,CAAC,MAAoB,EAAE,KAAa,MAAoB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO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AAQ,EAAA,EANb,GAAG,MAAM,CAAC,MAAM,CAAA,CAAA,EAAI,MAAM,CAAC,KAAK,CAAA,CAAE,CAOzC,KAEFA,GAAA,CAAC,eAAe,EAAA,EAEZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAAA,EALb,CAAA,EAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,CAAA,CAAE,CAMzC,CACL,CACJ;AACL,CAAC;AAGM,MAAM,YAAY,GAAG,CAAC,KAAwB,KAAI;IACrD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK;IAGrC,MAAM,iBAAiB,GAAG,MAAM,IAAI,OAAO,OAAO,KAAK,QAAQ;AAE/D,IAAA,QACIA,GAAA,CAAA,QAAA,EAAA,EAAA,GACQ,EAAE,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EACrE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAA,kBAAA,EACP,QAAQ,EAAA,QAAA,EAEzBA,GAAA,CAAA,UAAA,EAAA,EACI,SAAS,EAAC,6DAA6D,EAAA,kBAAA,EACtD,YAAY,EAAA,WAAA,EAClB,MAAM,IAAI,SAAS,EAC9B,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,iBAAiB,EAAA,WAAA,EACb,MAAM,IAAI,SAAS,EAAA,QAAA,EAE9BA,GAAA,CAAC,aAAa,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CACrB,EAAA,CACN;AAEjB;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { DialogHeaderActionsRenderer } from '../configuration/DialogHeaderActionsRenderer.js';
|
|
3
|
+
import type { DialogParts, DialogProps } from './Dialog.js';
|
|
4
|
+
interface HeaderActionsProps {
|
|
5
|
+
dialogId: string;
|
|
6
|
+
title: DialogProps['title'];
|
|
7
|
+
headerActions: DialogProps['headerActions'];
|
|
8
|
+
globalHeaderActions: DialogHeaderActionsRenderer | undefined;
|
|
9
|
+
hideGlobalHeaderActions: boolean;
|
|
10
|
+
isCommandDialog: boolean;
|
|
11
|
+
sliceLocation: DialogProps['sliceLocation'];
|
|
12
|
+
showsCloseButton: boolean;
|
|
13
|
+
pt: DialogParts | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** Props of the dialog header. */
|
|
16
|
+
export interface DialogHeaderProps extends HeaderActionsProps {
|
|
17
|
+
subtitle: DialogProps['subtitle'];
|
|
18
|
+
subtitleId: string;
|
|
19
|
+
hasSubtitle: boolean;
|
|
20
|
+
hasHeaderActions: boolean;
|
|
21
|
+
focusesTitle: boolean;
|
|
22
|
+
titleRef: React.Ref<HTMLHeadingElement>;
|
|
23
|
+
isBusy: boolean;
|
|
24
|
+
closeAriaLabel: string;
|
|
25
|
+
closeIcon: React.ReactNode;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
}
|
|
28
|
+
/** The dialog header: title, subtitle, header actions and the close button. */
|
|
29
|
+
export declare const DialogHeader: (props: DialogHeaderProps) => React.JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=DialogHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogHeader.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iDAA8C,CAAC;AAEhG,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAgBzD,UAAU,kBAAkB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC5C,mBAAmB,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAC7D,uBAAuB,EAAE,OAAO,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,EAAE,EAAE,WAAW,GAAG,SAAS,CAAC;CAC/B;AAyFD,kCAAkC;AAClC,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IACzD,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,+EAA+E;AAC/E,eAAO,MAAM,YAAY,UAAW,iBAAiB,sBAwBpD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Heading } from 'react-aria-components/Dialog';
|
|
3
|
+
import { dialogPartAttributes } from './dialogPartAttributes.js';
|
|
4
|
+
import { DialogGlobalHeaderActions } from './DialogGlobalHeaderActions.js';
|
|
5
|
+
|
|
6
|
+
const headerActionsStyle = (hasCloseButton, style) => ({
|
|
7
|
+
display: 'inline-flex',
|
|
8
|
+
gridColumn: 2,
|
|
9
|
+
gridRow: 1,
|
|
10
|
+
justifySelf: 'end',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
gap: '0.25rem',
|
|
13
|
+
marginInlineEnd: hasCloseButton ? '2.25rem' : undefined,
|
|
14
|
+
...style,
|
|
15
|
+
});
|
|
16
|
+
const HeaderActions = ({ dialogId, title, headerActions, globalHeaderActions, hideGlobalHeaderActions, isCommandDialog, sliceLocation, showsCloseButton, pt, }) => (jsxs("div", { ...dialogPartAttributes(pt?.headerActions, 'cratis-dialog__header-actions', headerActionsStyle(showsCloseButton, pt?.headerActions?.style)), "data-cratis-part": 'header-actions', children: [headerActions, globalHeaderActions && !hideGlobalHeaderActions && (jsx(DialogGlobalHeaderActions, { render: globalHeaderActions, context: { dialogId, title, isCommandDialog, sliceLocation } }))] }));
|
|
17
|
+
const closeButtonStyle = (hasHeaderActions, style) => hasHeaderActions ? { justifySelf: 'end', ...style } : style;
|
|
18
|
+
const CloseButton = ({ isBusy, hasHeaderActions, ariaLabel, icon, pt, onClose }) => (jsx("button", { type: 'button', ...dialogPartAttributes(pt?.close, 'cratis-dialog__close', closeButtonStyle(hasHeaderActions, pt?.close?.style)), disabled: isBusy, "data-cratis-part": 'close', "data-disabled": isBusy || undefined, "data-busy": isBusy || undefined, "aria-label": ariaLabel, onClick: onClose, children: jsx("span", { "aria-hidden": 'true', children: icon }) }));
|
|
19
|
+
const Title = ({ title, focusesTitle, titleRef, pt }) => (jsx(Heading, { ...dialogPartAttributes(pt?.title, 'cratis-dialog__title'), slot: 'title', tabIndex: focusesTitle ? -1 : undefined, ref: titleRef, "data-cratis-part": 'title', children: title }));
|
|
20
|
+
const Subtitle = ({ subtitle, subtitleId, pt }) => (jsx("p", { ...dialogPartAttributes(pt?.subtitle, 'cratis-dialog__subtitle'), id: subtitleId, "data-cratis-part": 'subtitle', children: subtitle }));
|
|
21
|
+
const DialogHeader = (props) => {
|
|
22
|
+
const { pt, title, subtitle, subtitleId, hasSubtitle, hasHeaderActions, focusesTitle, titleRef } = props;
|
|
23
|
+
const { showsCloseButton, isBusy, closeAriaLabel, closeIcon, onClose } = props;
|
|
24
|
+
return (jsxs("header", { ...dialogPartAttributes(pt?.header, 'cratis-dialog__header'), "data-cratis-part": 'header', children: [jsx(Title, { title: title, focusesTitle: focusesTitle, titleRef: titleRef, pt: pt }), hasSubtitle && jsx(Subtitle, { subtitle: subtitle, subtitleId: subtitleId, pt: pt }), hasHeaderActions && jsx(HeaderActions, { ...props }), showsCloseButton && (jsx(CloseButton, { isBusy: isBusy, hasHeaderActions: hasHeaderActions, ariaLabel: closeAriaLabel, icon: closeIcon, pt: pt, onClose: onClose }))] }));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { DialogHeader };
|
|
28
|
+
//# sourceMappingURL=DialogHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogHeader.js","sources":["../../../Dialogs/DialogHeader.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 { Heading } from 'react-aria-components/Dialog';\nimport type React from 'react';\nimport { dialogPartAttributes } from './dialogPartAttributes';\nimport type { DialogHeaderActionsRenderer } from '../configuration/DialogHeaderActionsRenderer';\nimport { DialogGlobalHeaderActions } from './DialogGlobalHeaderActions';\nimport type { DialogParts, DialogProps } from './Dialog';\n\n// Header actions sit in the close button's grid column, to its left. Inline rather than in Dialog.css:\n// the packed aggregate stylesheet has a reviewed size budget.\nconst headerActionsStyle = (hasCloseButton: boolean, style: React.CSSProperties | undefined): React.CSSProperties => ({\n display: 'inline-flex',\n gridColumn: 2,\n gridRow: 1,\n justifySelf: 'end',\n alignItems: 'center',\n gap: '0.25rem',\n marginInlineEnd: hasCloseButton ? '2.25rem' : undefined,\n ...style,\n});\n\n\ninterface HeaderActionsProps {\n dialogId: string;\n title: DialogProps['title'];\n headerActions: DialogProps['headerActions'];\n globalHeaderActions: DialogHeaderActionsRenderer | undefined;\n hideGlobalHeaderActions: boolean;\n isCommandDialog: boolean;\n sliceLocation: DialogProps['sliceLocation'];\n showsCloseButton: boolean;\n pt: DialogParts | undefined;\n}\n\nconst HeaderActions = ({\n dialogId,\n title,\n headerActions,\n globalHeaderActions,\n hideGlobalHeaderActions,\n isCommandDialog,\n sliceLocation,\n showsCloseButton,\n pt,\n}: HeaderActionsProps) => (\n <div\n {...dialogPartAttributes(pt?.headerActions, 'cratis-dialog__header-actions', headerActionsStyle(showsCloseButton, pt?.headerActions?.style))}\n data-cratis-part='header-actions'\n >\n {headerActions}\n {globalHeaderActions && !hideGlobalHeaderActions && (\n <DialogGlobalHeaderActions\n render={globalHeaderActions}\n context={{ dialogId, title, isCommandDialog, sliceLocation }}\n />\n )}\n </div>\n);\n\nconst closeButtonStyle = (hasHeaderActions: boolean, style: React.CSSProperties | undefined) =>\n hasHeaderActions ? { justifySelf: 'end' as const, ...style } : style;\n\ninterface CloseButtonProps {\n isBusy: boolean;\n hasHeaderActions: boolean;\n ariaLabel: string;\n icon: React.ReactNode;\n pt: DialogParts | undefined;\n onClose: () => void;\n}\n\nconst CloseButton = ({ isBusy, hasHeaderActions, ariaLabel, icon, pt, onClose }: CloseButtonProps) => (\n <button\n type='button'\n {...dialogPartAttributes(pt?.close, 'cratis-dialog__close', closeButtonStyle(hasHeaderActions, pt?.close?.style))}\n disabled={isBusy}\n data-cratis-part='close'\n data-disabled={isBusy || undefined}\n data-busy={isBusy || undefined}\n aria-label={ariaLabel}\n onClick={onClose}\n >\n <span aria-hidden='true'>{icon}</span>\n </button>\n);\n\ninterface TitleProps {\n title: DialogProps['title'];\n focusesTitle: boolean;\n titleRef: React.Ref<HTMLHeadingElement>;\n pt: DialogParts | undefined;\n}\n\nconst Title = ({ title, focusesTitle, titleRef, pt }: TitleProps) => (\n <Heading\n {...dialogPartAttributes(pt?.title, 'cratis-dialog__title')}\n slot='title'\n tabIndex={focusesTitle ? -1 : undefined}\n ref={titleRef}\n data-cratis-part='title'\n >\n {title}\n </Heading>\n);\n\ninterface SubtitleProps {\n subtitle: DialogProps['subtitle'];\n subtitleId: string;\n pt: DialogParts | undefined;\n}\n\nconst Subtitle = ({ subtitle, subtitleId, pt }: SubtitleProps) => (\n <p\n {...dialogPartAttributes(pt?.subtitle, 'cratis-dialog__subtitle')}\n id={subtitleId}\n data-cratis-part='subtitle'\n >\n {subtitle}\n </p>\n);\n\n/** Props of the dialog header. */\nexport interface DialogHeaderProps extends HeaderActionsProps {\n subtitle: DialogProps['subtitle'];\n subtitleId: string;\n hasSubtitle: boolean;\n hasHeaderActions: boolean;\n focusesTitle: boolean;\n titleRef: React.Ref<HTMLHeadingElement>;\n isBusy: boolean;\n closeAriaLabel: string;\n closeIcon: React.ReactNode;\n onClose: () => void;\n}\n\n/** The dialog header: title, subtitle, header actions and the close button. */\nexport const DialogHeader = (props: DialogHeaderProps) => {\n const { pt, title, subtitle, subtitleId, hasSubtitle, hasHeaderActions, focusesTitle, titleRef } = props;\n const { showsCloseButton, isBusy, closeAriaLabel, closeIcon, onClose } = props;\n\n return (\n <header\n {...dialogPartAttributes(pt?.header, 'cratis-dialog__header')}\n data-cratis-part='header'\n >\n <Title title={title} focusesTitle={focusesTitle} titleRef={titleRef} pt={pt} />\n {hasSubtitle && <Subtitle subtitle={subtitle} subtitleId={subtitleId} pt={pt} />}\n {hasHeaderActions && <HeaderActions {...props} />}\n {showsCloseButton && (\n <CloseButton\n isBusy={isBusy}\n hasHeaderActions={hasHeaderActions}\n ariaLabel={closeAriaLabel}\n icon={closeIcon}\n pt={pt}\n onClose={onClose}\n />\n )}\n </header>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;AAYA,MAAM,kBAAkB,GAAG,CAAC,cAAuB,EAAE,KAAsC,MAA2B;AAClH,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,GAAG,EAAE,SAAS;IACd,eAAe,EAAE,cAAc,GAAG,SAAS,GAAG,SAAS;AACvD,IAAA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C,QAAQ,IAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,GAAI,EAC/E,gBAAgB,IAAIA,GAAA,CAAC,aAAa,OAAK,KAAK,EAAA,CAAI,EAChD,gBAAgB,KACbA,GAAA,CAAC,WAAW,IACR,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,SAAS,EACf,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,GAClB,CACL,CAAA,EAAA,CACI;AAEjB;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import type { DialogProps } from './Dialog.js';
|
|
3
2
|
/**
|
|
4
3
|
* A modal dialog with Arc host integration, typed footer actions, busy/validity
|
|
5
4
|
* state, controlled dismissal, and stable Cratis-owned styling parts.
|
|
6
5
|
*/
|
|
7
|
-
export declare const DialogImplementation: (incomingProps: DialogProps) =>
|
|
6
|
+
export declare const DialogImplementation: (incomingProps: DialogProps) => import("react").JSX.Element;
|
|
8
7
|
//# sourceMappingURL=DialogImplementation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogImplementation.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogImplementation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"DialogImplementation.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogImplementation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAuC5C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kBAAmB,WAAW,gCA0H9D,CAAC"}
|