@cratis/components 4.40.0 → 4.40.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 +13 -13
- package/dist/esm/Common/DatePickerButtonBar.d.ts +15 -0
- package/dist/esm/Common/DatePickerButtonBar.d.ts.map +1 -0
- package/dist/esm/Common/DatePickerButtonBar.js +17 -0
- package/dist/esm/Common/DatePickerButtonBar.js.map +1 -0
- package/dist/esm/Common/DatePickerCalendar.d.ts +8 -0
- package/dist/esm/Common/DatePickerCalendar.d.ts.map +1 -0
- package/dist/esm/Common/DatePickerCalendar.js +29 -0
- package/dist/esm/Common/DatePickerCalendar.js.map +1 -0
- package/dist/esm/Common/DatePickerDateInput.d.ts +14 -0
- package/dist/esm/Common/DatePickerDateInput.d.ts.map +1 -0
- package/dist/esm/Common/DatePickerDateInput.js +9 -0
- package/dist/esm/Common/DatePickerDateInput.js.map +1 -0
- package/dist/esm/Common/DatePickerGroup.d.ts +21 -0
- package/dist/esm/Common/DatePickerGroup.d.ts.map +1 -0
- package/dist/esm/Common/DatePickerGroup.js +10 -0
- package/dist/esm/Common/DatePickerGroup.js.map +1 -0
- package/dist/esm/Common/DatePickerInputImplementation.d.ts +1 -1
- package/dist/esm/Common/DatePickerInputImplementation.d.ts.map +1 -1
- package/dist/esm/Common/DatePickerInputImplementation.js +35 -91
- package/dist/esm/Common/DatePickerInputImplementation.js.map +1 -1
- package/dist/esm/Common/DatePickerPopover.d.ts +12 -0
- package/dist/esm/Common/DatePickerPopover.d.ts.map +1 -0
- package/dist/esm/Common/DatePickerPopover.js +11 -0
- package/dist/esm/Common/DatePickerPopover.js.map +1 -0
- package/dist/esm/Common/datePickerStateAttributes.d.ts +38 -0
- package/dist/esm/Common/datePickerStateAttributes.d.ts.map +1 -0
- package/dist/esm/Common/datePickerStateAttributes.js +26 -0
- package/dist/esm/Common/datePickerStateAttributes.js.map +1 -0
- package/dist/esm/Common/datePickerValues.d.ts +11 -0
- package/dist/esm/Common/datePickerValues.d.ts.map +1 -0
- package/dist/esm/Common/datePickerValues.js +23 -0
- package/dist/esm/Common/datePickerValues.js.map +1 -0
- package/dist/esm/Common/toolbarFocusQueries.d.ts +13 -0
- package/dist/esm/Common/toolbarFocusQueries.d.ts.map +1 -0
- package/dist/esm/Common/toolbarFocusQueries.js +46 -0
- package/dist/esm/Common/toolbarFocusQueries.js.map +1 -0
- package/dist/esm/Common/toolbarNavigationCandidates.d.ts +7 -0
- package/dist/esm/Common/toolbarNavigationCandidates.d.ts.map +1 -0
- package/dist/esm/Common/toolbarNavigationCandidates.js +44 -0
- package/dist/esm/Common/toolbarNavigationCandidates.js.map +1 -0
- package/dist/esm/Common/toolbarTabStop.d.ts +28 -0
- package/dist/esm/Common/toolbarTabStop.d.ts.map +1 -0
- package/dist/esm/Common/toolbarTabStop.js +94 -0
- package/dist/esm/Common/toolbarTabStop.js.map +1 -0
- package/dist/esm/Common/useDatePickerState.d.ts +591 -0
- package/dist/esm/Common/useDatePickerState.d.ts.map +1 -0
- package/dist/esm/Common/useDatePickerState.js +78 -0
- package/dist/esm/Common/useDatePickerState.js.map +1 -0
- package/dist/esm/Common/useMicrotaskScheduler.d.ts +3 -0
- package/dist/esm/Common/useMicrotaskScheduler.d.ts.map +1 -0
- package/dist/esm/Common/useMicrotaskScheduler.js +17 -0
- package/dist/esm/Common/useMicrotaskScheduler.js.map +1 -0
- package/dist/esm/Common/useToolbarKeyboardNavigation.d.ts +1 -2
- package/dist/esm/Common/useToolbarKeyboardNavigation.d.ts.map +1 -1
- package/dist/esm/Common/useToolbarKeyboardNavigation.js +12 -211
- package/dist/esm/Common/useToolbarKeyboardNavigation.js.map +1 -1
- package/dist/esm/Common/useToolbarTabStop.d.ts +9 -0
- package/dist/esm/Common/useToolbarTabStop.d.ts.map +1 -0
- package/dist/esm/Common/useToolbarTabStop.js +81 -0
- package/dist/esm/Common/useToolbarTabStop.js.map +1 -0
- package/dist/esm/Dropdown/ComboBoxCommitBridge.d.ts +13 -0
- package/dist/esm/Dropdown/ComboBoxCommitBridge.d.ts.map +1 -0
- package/dist/esm/Dropdown/ComboBoxCommitBridge.js +16 -0
- package/dist/esm/Dropdown/ComboBoxCommitBridge.js.map +1 -0
- package/dist/esm/Dropdown/DropdownBranchProps.d.ts +10 -0
- package/dist/esm/Dropdown/DropdownBranchProps.d.ts.map +1 -0
- package/dist/esm/Dropdown/DropdownBranchProps.js +4 -0
- package/dist/esm/Dropdown/DropdownBranchProps.js.map +1 -0
- package/dist/esm/Dropdown/DropdownImplementation.d.ts +1 -2
- package/dist/esm/Dropdown/DropdownImplementation.d.ts.map +1 -1
- package/dist/esm/Dropdown/DropdownImplementation.js +16 -192
- package/dist/esm/Dropdown/DropdownImplementation.js.map +1 -1
- package/dist/esm/Dropdown/DropdownOptionLists.d.ts +15 -0
- package/dist/esm/Dropdown/DropdownOptionLists.d.ts.map +1 -0
- package/dist/esm/Dropdown/DropdownOptionLists.js +12 -0
- package/dist/esm/Dropdown/DropdownOptionLists.js.map +1 -0
- package/dist/esm/Dropdown/DropdownParts.d.ts +46 -0
- package/dist/esm/Dropdown/DropdownParts.d.ts.map +1 -0
- package/dist/esm/Dropdown/DropdownParts.js +14 -0
- package/dist/esm/Dropdown/DropdownParts.js.map +1 -0
- package/dist/esm/Dropdown/FilterDropdown.d.ts +7 -0
- package/dist/esm/Dropdown/FilterDropdown.d.ts.map +1 -0
- package/dist/esm/Dropdown/FilterDropdown.js +31 -0
- package/dist/esm/Dropdown/FilterDropdown.js.map +1 -0
- package/dist/esm/Dropdown/MultipleSelectDropdown.d.ts +4 -0
- package/dist/esm/Dropdown/MultipleSelectDropdown.d.ts.map +1 -0
- package/dist/esm/Dropdown/MultipleSelectDropdown.js +23 -0
- package/dist/esm/Dropdown/MultipleSelectDropdown.js.map +1 -0
- package/dist/esm/Dropdown/SingleSelectDropdown.d.ts +4 -0
- package/dist/esm/Dropdown/SingleSelectDropdown.d.ts.map +1 -0
- package/dist/esm/Dropdown/SingleSelectDropdown.js +16 -0
- package/dist/esm/Dropdown/SingleSelectDropdown.js.map +1 -0
- package/dist/esm/Dropdown/SingleSelectTrigger.d.ts +4 -0
- package/dist/esm/Dropdown/SingleSelectTrigger.d.ts.map +1 -0
- package/dist/esm/Dropdown/SingleSelectTrigger.js +16 -0
- package/dist/esm/Dropdown/SingleSelectTrigger.js.map +1 -0
- package/dist/esm/Dropdown/dropdownAttributes.d.ts +867 -0
- package/dist/esm/Dropdown/dropdownAttributes.d.ts.map +1 -0
- package/dist/esm/Dropdown/dropdownAttributes.js +9 -0
- package/dist/esm/Dropdown/dropdownAttributes.js.map +1 -0
- package/dist/esm/Dropdown/renderTriggerWithOpenState.d.ts +4 -0
- package/dist/esm/Dropdown/renderTriggerWithOpenState.d.ts.map +1 -0
- package/dist/esm/Dropdown/renderTriggerWithOpenState.js +8 -0
- package/dist/esm/Dropdown/renderTriggerWithOpenState.js.map +1 -0
- package/dist/esm/Dropdown/resolveOptions.d.ts +12 -0
- package/dist/esm/Dropdown/resolveOptions.d.ts.map +1 -0
- package/dist/esm/Dropdown/resolveOptions.js +36 -0
- package/dist/esm/Dropdown/resolveOptions.js.map +1 -0
- package/dist/esm/Dropdown/useDropdownHandlers.d.ts +12 -0
- package/dist/esm/Dropdown/useDropdownHandlers.d.ts.map +1 -0
- package/dist/esm/Dropdown/useDropdownHandlers.js +50 -0
- package/dist/esm/Dropdown/useDropdownHandlers.js.map +1 -0
- package/dist/esm/Dropdown/useDropdownState.d.ts +28 -0
- package/dist/esm/Dropdown/useDropdownState.d.ts.map +1 -0
- package/dist/esm/Dropdown/useDropdownState.js +91 -0
- package/dist/esm/Dropdown/useDropdownState.js.map +1 -0
- package/package.json +6 -4
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
2
1
|
import type { DropdownProps } from './Dropdown.js';
|
|
3
|
-
export declare function DropdownImplementation<T = unknown>(
|
|
2
|
+
export declare function DropdownImplementation<T = unknown>(props: DropdownProps<T>): import("react").JSX.Element;
|
|
4
3
|
export declare namespace DropdownImplementation {
|
|
5
4
|
var displayName: string;
|
|
6
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownImplementation.d.ts","sourceRoot":"","sources":["../../../Dropdown/DropdownImplementation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"DropdownImplementation.d.ts","sourceRoot":"","sources":["../../../Dropdown/DropdownImplementation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAY,CAAC;+CAcT,CAAC,GAAG,OAAO,EAAG,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC"}
|
|
@@ -1,198 +1,22 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useState, useRef, useCallback, useContext, useEffect } from 'react';
|
|
3
|
-
import { Select, Button as Button$1, SelectValue, Popover as Popover$1, ListBox as ListBox$1, ListBoxItem as ListBoxItem$1 } from 'react-aria-components/Select';
|
|
4
|
-
import { ComboBox, ComboBoxValue, Input, Button, Popover, ListBox, ListBoxItem, ComboBoxStateContext } from 'react-aria-components/ComboBox';
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
2
|
import { UNSAFE_PortalProvider } from 'react-aria';
|
|
6
|
-
import {
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import { useCratisComponentsConfig } from '../configuration/CratisComponentsContext.js';
|
|
12
|
-
import { useCratisIcon } from '../configuration/useCratisIcon.js';
|
|
13
|
-
import '../Notifications/toast.js';
|
|
14
|
-
import { classNames } from '../ClassNames/classNames.js';
|
|
15
|
-
import { zIndexAboveDialog, OVERLAY_OFFSET } from '../renderer/dialogStack.js';
|
|
16
|
-
import { useNearestDialogZIndex } from '../renderer/DialogStackContext.js';
|
|
17
|
-
import { useExternalLabel } from './useExternalLabel.js';
|
|
18
|
-
import { asReactAriaButtonProps, asReactAriaListBoxItemProps, asReactAriaListBoxProps } from '../Common/reactAriaProps.js';
|
|
3
|
+
import { FilterDropdown } from './FilterDropdown.js';
|
|
4
|
+
import { MultipleSelectDropdown } from './MultipleSelectDropdown.js';
|
|
5
|
+
import { SingleSelectDropdown } from './SingleSelectDropdown.js';
|
|
6
|
+
import { useDropdownHandlers } from './useDropdownHandlers.js';
|
|
7
|
+
import { useDropdownState } from './useDropdownState.js';
|
|
19
8
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
: undefined;
|
|
9
|
+
const chooseBranch = (props, branch) => {
|
|
10
|
+
if (props.filter)
|
|
11
|
+
return jsx(FilterDropdown, { ...branch });
|
|
12
|
+
return props.multiple ? jsx(MultipleSelectDropdown, { ...branch }) : jsx(SingleSelectDropdown, { ...branch });
|
|
25
13
|
};
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
if (!field || option === null || typeof option !== 'object')
|
|
33
|
-
return optionValue(option);
|
|
34
|
-
return field in option
|
|
35
|
-
? optionValue(option[field])
|
|
36
|
-
: optionValue(option);
|
|
37
|
-
};
|
|
38
|
-
const resolveOptions = (options, optionLabel, optionValue) => (options ?? []).map((option, index) => {
|
|
39
|
-
const value = readField(option, optionValue);
|
|
40
|
-
const labelValue = readField(option, optionLabel);
|
|
41
|
-
const keyValue = value ?? index;
|
|
42
|
-
const disabled = option !== null && typeof option === 'object' && 'disabled' in option
|
|
43
|
-
? Boolean(option.disabled)
|
|
44
|
-
: false;
|
|
45
|
-
return {
|
|
46
|
-
key: `${typeof keyValue}:${String(keyValue)}:${index}`,
|
|
47
|
-
label: String(labelValue ?? value ?? ''),
|
|
48
|
-
value,
|
|
49
|
-
disabled,
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
const ComboBoxCommitBridge = ({ handle, }) => {
|
|
53
|
-
const state = useContext(ComboBoxStateContext);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
handle.current = state;
|
|
56
|
-
return () => {
|
|
57
|
-
handle.current = null;
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
return null;
|
|
61
|
-
};
|
|
62
|
-
const renderTriggerWithOpenState = (props) => (jsx("button", { ...props, "data-open": props['aria-expanded'] === true || props['aria-expanded'] === 'true'
|
|
63
|
-
? true
|
|
64
|
-
: undefined }));
|
|
65
|
-
const DropdownImplementation = ({ value, options, optionLabel = conventionalField(options, 'label'), optionValue = conventionalField(options, 'value'), placeholder, filter, filterPlaceholder, multiple, showClear, invalid, disabled, className, style, id, inputId, panelClassName, name, tabIndex, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, ariaLabel: ariaLabelAlias, ariaLabelledBy, ariaDescribedBy, ariaInvalid, onChange, onBlur, pt, }) => {
|
|
66
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
67
|
-
const comboBox = useRef(null);
|
|
68
|
-
const { ref: attachExternalLabel, labelledBy: externalLabelledBy } = useExternalLabel();
|
|
69
|
-
const overlayEnvironment = unstable_useOverlayEnvironment();
|
|
70
|
-
const nearestDialogZIndex = useNearestDialogZIndex();
|
|
71
|
-
const resolvedPopoverZIndex = nearestDialogZIndex === null
|
|
72
|
-
? 'var(--cratis-z-index-overlay)'
|
|
73
|
-
: zIndexAboveDialog(nearestDialogZIndex, OVERLAY_OFFSET);
|
|
74
|
-
const { messages } = useCratisComponentsConfig();
|
|
75
|
-
const dropdownMessages = messages?.dropdown;
|
|
76
|
-
const showOptionsLabel = pt?.trigger?.['aria-label'] ??
|
|
77
|
-
pt?.select?.['aria-label'] ??
|
|
78
|
-
dropdownMessages?.showOptions ??
|
|
79
|
-
'Show options';
|
|
80
|
-
const clearSelectionLabel = pt?.clear?.['aria-label'] ??
|
|
81
|
-
dropdownMessages?.clearSelection ??
|
|
82
|
-
'Clear selection';
|
|
83
|
-
const icon = useCratisIcon();
|
|
84
|
-
const expandIcon = icon('expand', '⌄');
|
|
85
|
-
const clearIcon = icon('clear', '×');
|
|
86
|
-
const resolvedOptions = resolveOptions(options, optionLabel, optionValue);
|
|
87
|
-
const [committed, setCommitted] = useState(null);
|
|
88
|
-
const remembered = committed !== null && Object.is(committed.observedValue, value)
|
|
89
|
-
? committed
|
|
90
|
-
: null;
|
|
91
|
-
const remember = (key) => setCommitted({ key, observedValue: value });
|
|
92
|
-
const selectedOption = resolvedOptions.find((option) => Object.is(option.value, value)) ??
|
|
93
|
-
(remembered?.key == null
|
|
94
|
-
? undefined
|
|
95
|
-
: resolvedOptions.find((option) => option.key === remembered.key));
|
|
96
|
-
const selectedKey = selectedOption?.key ?? null;
|
|
97
|
-
const controlPart = filter ? pt?.filter : multiple ? pt?.multiple : pt?.trigger;
|
|
98
|
-
const effectiveAriaLabel = ariaLabel ??
|
|
99
|
-
ariaLabelAlias ??
|
|
100
|
-
pt?.input?.['aria-label'] ??
|
|
101
|
-
pt?.select?.['aria-label'] ??
|
|
102
|
-
controlPart?.['aria-label'];
|
|
103
|
-
const effectiveAriaLabelledby = ariaLabelledby ??
|
|
104
|
-
ariaLabelledBy ??
|
|
105
|
-
pt?.input?.['aria-labelledby'] ??
|
|
106
|
-
pt?.select?.['aria-labelledby'] ??
|
|
107
|
-
controlPart?.['aria-labelledby'] ??
|
|
108
|
-
(effectiveAriaLabel ? undefined : externalLabelledBy);
|
|
109
|
-
const effectiveAriaDescribedby = ariaDescribedby ??
|
|
110
|
-
ariaDescribedBy ??
|
|
111
|
-
pt?.input?.['aria-describedby'] ??
|
|
112
|
-
pt?.select?.['aria-describedby'];
|
|
113
|
-
const inputAriaInvalid = pt?.input?.['aria-invalid'] ?? pt?.select?.['aria-invalid'];
|
|
114
|
-
const effectiveInvalid = invalid ??
|
|
115
|
-
ariaInvalid ??
|
|
116
|
-
(inputAriaInvalid === true ||
|
|
117
|
-
inputAriaInvalid === 'true' ||
|
|
118
|
-
inputAriaInvalid === 'grammar' ||
|
|
119
|
-
inputAriaInvalid === 'spelling');
|
|
120
|
-
const rootClassName = classNames('cratis-dropdown', pt?.root?.className, pt?.select?.className, className);
|
|
121
|
-
const triggerId = id ?? inputId ?? pt?.trigger?.id ?? pt?.input?.id ?? pt?.select?.id;
|
|
122
|
-
const selectOption = (key) => {
|
|
123
|
-
const option = resolvedOptions.find((candidate) => candidate.key === String(key));
|
|
124
|
-
remember(option?.key ?? null);
|
|
125
|
-
onChange?.((option?.value ?? null), { source: 'user' });
|
|
126
|
-
comboBox.current?.close();
|
|
127
|
-
};
|
|
128
|
-
const clearSelection = (event) => {
|
|
129
|
-
remember(null);
|
|
130
|
-
onChange?.(null, { source: 'user', nativeEvent: event.nativeEvent });
|
|
131
|
-
};
|
|
132
|
-
const selectOptions = (keys) => {
|
|
133
|
-
const selectedKeys = new Set(keys.map(String));
|
|
134
|
-
const values = resolvedOptions
|
|
135
|
-
.filter((option) => selectedKeys.has(option.key))
|
|
136
|
-
.map((option) => option.value);
|
|
137
|
-
onChange?.(values, { source: 'user' });
|
|
138
|
-
};
|
|
139
|
-
const applyTriggerState = useCallback((element) => {
|
|
140
|
-
attachExternalLabel(element);
|
|
141
|
-
if (!element)
|
|
142
|
-
return;
|
|
143
|
-
if (effectiveAriaLabelledby) {
|
|
144
|
-
const references = [
|
|
145
|
-
...effectiveAriaLabelledby.split(/\s+/u),
|
|
146
|
-
...(element.getAttribute('aria-labelledby') ?? '').split(/\s+/u),
|
|
147
|
-
].filter(Boolean);
|
|
148
|
-
element.setAttribute('aria-labelledby', [...new Set(references)].join(' '));
|
|
149
|
-
}
|
|
150
|
-
if (effectiveInvalid)
|
|
151
|
-
element.setAttribute('aria-invalid', 'true');
|
|
152
|
-
else
|
|
153
|
-
element.removeAttribute('aria-invalid');
|
|
154
|
-
if (tabIndex !== undefined)
|
|
155
|
-
element.tabIndex = tabIndex;
|
|
156
|
-
}, [effectiveAriaLabelledby, effectiveInvalid, attachExternalLabel, tabIndex]);
|
|
157
|
-
if (multiple) {
|
|
158
|
-
const selectedValues = Array.isArray(value) ? value : [];
|
|
159
|
-
const selectedKeys = resolvedOptions
|
|
160
|
-
.filter((option) => selectedValues.some((selected) => Object.is(selected, option.value)))
|
|
161
|
-
.map((option) => option.key);
|
|
162
|
-
if (filter) {
|
|
163
|
-
return (jsx("span", { ...pt?.root, className: rootClassName, "data-cratis-part": 'root', "data-cratis-component": 'Dropdown', "data-invalid": effectiveInvalid || undefined, "data-disabled": disabled || undefined, "data-open": isOpen || undefined, "data-selected": selectedKeys.length > 0 || undefined, style: { ...pt?.root?.style, ...pt?.select?.style, ...style }, onBlur: onBlur, children: jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsxs(ComboBox, { selectionMode: 'multiple', onOpenChange: setIsOpen, value: selectedKeys, onChange: selectOptions, isDisabled: disabled, isInvalid: effectiveInvalid, name: name, "aria-label": effectiveAriaLabel, "aria-labelledby": effectiveAriaLabelledby, "aria-describedby": effectiveAriaDescribedby, allowsEmptyCollection: true, className: 'cratis-dropdown__combobox', children: [jsx(ComboBoxValue, { ...pt?.value, placeholder: placeholder, className: classNames('cratis-dropdown__value', pt?.value?.className), "data-cratis-part": 'value', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-open": isOpen || undefined, "data-selected": selectedKeys.length > 0 || undefined }), jsx(Input, { ...pt?.filter, ref: attachExternalLabel, id: triggerId, placeholder: filterPlaceholder ?? placeholder, tabIndex: tabIndex, "aria-invalid": effectiveInvalid || undefined, className: classNames('cratis-dropdown__filter', pt?.input?.className, pt?.filter?.className), style: { ...pt?.input?.style, ...pt?.filter?.style }, "data-cratis-part": 'filter', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-open": isOpen || undefined }), jsx(Button, { ...asReactAriaButtonProps(pt?.trigger), className: classNames('cratis-dropdown__indicator', pt?.trigger?.className), "data-cratis-part": 'trigger', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-selected": selectedKeys.length > 0 || undefined, render: renderTriggerWithOpenState, "aria-label": showOptionsLabel, children: jsx("span", { "aria-hidden": 'true', children: expandIcon }) }), showClear && selectedKeys.length > 0 && (jsx("button", { ...pt?.clear, type: 'button', disabled: disabled, className: classNames('cratis-dropdown__clear', pt?.clear?.className), "data-cratis-part": 'clear', "data-disabled": disabled || undefined, "aria-label": clearSelectionLabel, onClick: (event) => onChange?.([], {
|
|
164
|
-
source: 'user',
|
|
165
|
-
nativeEvent: event.nativeEvent,
|
|
166
|
-
}), children: jsx("span", { "aria-hidden": 'true', children: clearIcon }) })), jsx(Popover, { ...pt?.popover, className: classNames('cratis-dropdown__popover', pt?.popover?.className, panelClassName), style: {
|
|
167
|
-
zIndex: resolvedPopoverZIndex,
|
|
168
|
-
...pt?.popover?.style,
|
|
169
|
-
}, "data-cratis-part": 'popover', "data-open": true, children: jsx(ListBox, { ...asReactAriaListBoxProps(pt?.listbox), items: resolvedOptions, className: classNames('cratis-dropdown__listbox', pt?.listbox?.className), "data-cratis-part": 'listbox', "data-open": true, children: (option) => (jsx(ListBoxItem, { ...asReactAriaListBoxItemProps(pt?.option), id: option.key, textValue: option.label, isDisabled: option.disabled, className: classNames('cratis-dropdown__option', pt?.option?.className), "data-cratis-part": 'option', "data-disabled": option.disabled || undefined, "data-selected": selectedKeys.includes(option.key) ||
|
|
170
|
-
undefined, children: option.label })) }) })] }) }) }));
|
|
171
|
-
}
|
|
172
|
-
return (jsxs("span", { ...pt?.root, className: rootClassName, "data-cratis-part": 'root', "data-cratis-component": 'Dropdown', "data-invalid": effectiveInvalid || undefined, "data-disabled": disabled || undefined, "data-selected": selectedKeys.length > 0 || undefined, style: { ...pt?.root?.style, ...pt?.select?.style, ...style }, onBlur: onBlur, children: [jsx("select", { ...pt?.multiple, ref: attachExternalLabel, id: triggerId ?? pt?.multiple?.id, name: name, multiple: true, disabled: disabled, value: selectedKeys, tabIndex: tabIndex, "aria-label": effectiveAriaLabel, "aria-labelledby": effectiveAriaLabelledby, "aria-describedby": effectiveAriaDescribedby, "aria-invalid": effectiveInvalid || undefined, className: classNames('cratis-dropdown__multiple', pt?.input?.className, pt?.multiple?.className), "data-cratis-part": 'multiple', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-selected": selectedKeys.length > 0 || undefined, onChange: (event) => {
|
|
173
|
-
const keys = Array.from(event.currentTarget.selectedOptions, (option) => option.value);
|
|
174
|
-
const values = resolvedOptions
|
|
175
|
-
.filter((option) => keys.includes(option.key))
|
|
176
|
-
.map((option) => option.value);
|
|
177
|
-
onChange?.(values, {
|
|
178
|
-
source: 'user',
|
|
179
|
-
nativeEvent: event.nativeEvent,
|
|
180
|
-
});
|
|
181
|
-
}, children: resolvedOptions.map((option) => (jsx("option", { value: option.key, disabled: option.disabled, "data-disabled": option.disabled || undefined, "data-selected": selectedKeys.includes(option.key) || undefined, children: option.label }, option.key))) }), showClear && selectedKeys.length > 0 && (jsx("button", { ...pt?.clear, type: 'button', disabled: disabled, className: classNames('cratis-dropdown__clear', pt?.clear?.className), "data-cratis-part": 'clear', "data-disabled": disabled || undefined, "aria-label": clearSelectionLabel, onClick: (event) => onChange?.([], {
|
|
182
|
-
source: 'user',
|
|
183
|
-
nativeEvent: event.nativeEvent,
|
|
184
|
-
}), children: jsx("span", { "aria-hidden": 'true', children: clearIcon }) }))] }));
|
|
185
|
-
}
|
|
186
|
-
if (filter) {
|
|
187
|
-
return (jsx("span", { ...pt?.root, className: rootClassName, "data-cratis-part": 'root', "data-cratis-component": 'Dropdown', "data-invalid": effectiveInvalid || undefined, "data-disabled": disabled || undefined, "data-open": isOpen || undefined, "data-selected": selectedKey !== null || undefined, style: { ...pt?.root?.style, ...pt?.select?.style, ...style }, onBlur: onBlur, children: jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsxs(ComboBox, { onOpenChange: setIsOpen, value: selectedKey, onChange: selectOption, isDisabled: disabled, isInvalid: effectiveInvalid, name: name, "aria-label": effectiveAriaLabel, "aria-labelledby": effectiveAriaLabelledby, "aria-describedby": effectiveAriaDescribedby, allowsEmptyCollection: true, className: 'cratis-dropdown__combobox', children: [jsx(ComboBoxCommitBridge, { handle: comboBox }), jsx(Input, { ...pt?.filter, ref: attachExternalLabel, id: triggerId, placeholder: filterPlaceholder ?? placeholder, tabIndex: tabIndex, "aria-invalid": effectiveInvalid || undefined, className: classNames('cratis-dropdown__filter', pt?.input?.className, pt?.filter?.className), style: { ...pt?.input?.style, ...pt?.filter?.style }, "data-cratis-part": 'filter', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-open": isOpen || undefined }), jsx(Button, { ...asReactAriaButtonProps(pt?.trigger), className: classNames('cratis-dropdown__indicator', pt?.trigger?.className), "data-cratis-part": 'trigger', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-selected": selectedKey !== null || undefined, render: renderTriggerWithOpenState, "aria-label": showOptionsLabel, children: jsx("span", { "aria-hidden": 'true', children: expandIcon }) }), showClear && selectedKey !== null && (jsx("button", { ...pt?.clear, type: 'button', disabled: disabled, className: classNames('cratis-dropdown__clear', pt?.clear?.className), "data-cratis-part": 'clear', "data-disabled": disabled || undefined, "aria-label": clearSelectionLabel, onClick: clearSelection, children: jsx("span", { "aria-hidden": 'true', children: clearIcon }) })), jsx(Popover, { ...pt?.popover, className: classNames('cratis-dropdown__popover', pt?.popover?.className, panelClassName), style: {
|
|
188
|
-
zIndex: resolvedPopoverZIndex,
|
|
189
|
-
...pt?.popover?.style,
|
|
190
|
-
}, "data-cratis-part": 'popover', "data-open": true, children: jsx(ListBox, { ...asReactAriaListBoxProps(pt?.listbox), items: resolvedOptions, className: classNames('cratis-dropdown__listbox', pt?.listbox?.className), "data-cratis-part": 'listbox', "data-open": true, children: (option) => (jsx(ListBoxItem, { ...asReactAriaListBoxItemProps(pt?.option), id: option.key, textValue: option.label, isDisabled: option.disabled, className: classNames('cratis-dropdown__option', pt?.option?.className), "data-cratis-part": 'option', "data-disabled": option.disabled || undefined, "data-selected": option.key === selectedKey || undefined, children: option.label })) }) })] }) }) }));
|
|
191
|
-
}
|
|
192
|
-
return (jsx("span", { ...pt?.root, className: rootClassName, "data-cratis-part": 'root', "data-cratis-component": 'Dropdown', "data-invalid": effectiveInvalid || undefined, "data-disabled": disabled || undefined, "data-open": isOpen || undefined, "data-selected": selectedKey !== null || undefined, style: { ...pt?.root?.style, ...pt?.select?.style, ...style }, onBlur: onBlur, children: jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsxs(Select, { onOpenChange: setIsOpen, value: selectedKey, onChange: selectOption, isDisabled: disabled, isInvalid: effectiveInvalid, name: name, "aria-label": effectiveAriaLabel, "aria-labelledby": effectiveAriaLabelledby, "aria-describedby": effectiveAriaDescribedby, className: 'cratis-dropdown__select', children: [jsxs(Button$1, { ...asReactAriaButtonProps(pt?.trigger), ref: applyTriggerState, id: triggerId, excludeFromTabOrder: tabIndex === -1, "aria-invalid": effectiveInvalid || undefined, className: classNames('cratis-dropdown__trigger', pt?.input?.className, pt?.trigger?.className), style: { ...pt?.input?.style, ...pt?.trigger?.style }, "data-cratis-part": 'trigger', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-selected": selectedKey !== null || undefined, render: renderTriggerWithOpenState, children: [jsx(SelectValue, { ...pt?.value, className: classNames('cratis-dropdown__value', pt?.value?.className), "data-cratis-part": 'value', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-open": isOpen || undefined, "data-selected": selectedKey !== null || undefined, children: selectedOption?.label ?? placeholder }), jsx("span", { ...pt?.indicator, className: classNames('cratis-dropdown__indicator', pt?.indicator?.className), "data-cratis-part": 'indicator', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-open": isOpen || undefined, "aria-hidden": 'true', children: expandIcon })] }), showClear && selectedKey !== null && (jsx("button", { ...pt?.clear, type: 'button', disabled: disabled, className: classNames('cratis-dropdown__clear', pt?.clear?.className), "data-cratis-part": 'clear', "data-disabled": disabled || undefined, "aria-label": clearSelectionLabel, onClick: clearSelection, children: jsx("span", { "aria-hidden": 'true', children: clearIcon }) })), jsx(Popover$1, { ...pt?.popover, className: classNames('cratis-dropdown__popover', pt?.popover?.className, panelClassName), style: {
|
|
193
|
-
zIndex: resolvedPopoverZIndex,
|
|
194
|
-
...pt?.popover?.style,
|
|
195
|
-
}, "data-cratis-part": 'popover', "data-open": true, children: jsx(ListBox$1, { ...asReactAriaListBoxProps(pt?.listbox), items: resolvedOptions, className: classNames('cratis-dropdown__listbox', pt?.listbox?.className), "data-cratis-part": 'listbox', "data-open": true, children: (option) => (jsx(ListBoxItem$1, { ...asReactAriaListBoxItemProps(pt?.option), id: option.key, textValue: option.label, isDisabled: option.disabled, className: classNames('cratis-dropdown__option', pt?.option?.className), "data-cratis-part": 'option', "data-disabled": option.disabled || undefined, "data-selected": option.key === selectedKey || undefined, children: option.label })) }) })] }) }) }));
|
|
14
|
+
const DropdownImplementation = (props) => {
|
|
15
|
+
const state = useDropdownState(props);
|
|
16
|
+
const handlers = useDropdownHandlers(props, state);
|
|
17
|
+
const { overlayEnvironment } = state;
|
|
18
|
+
const branch = { props, state, handlers };
|
|
19
|
+
return (jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: chooseBranch(props, branch) }));
|
|
196
20
|
};
|
|
197
21
|
DropdownImplementation.displayName = 'DropdownImplementation';
|
|
198
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownImplementation.js","sources":["../../../Dropdown/DropdownImplementation.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 { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport type { JSX, Key, MouseEvent, RefObject } from 'react';\nimport {\n Button as AriaButton,\n ListBox,\n ListBoxItem,\n Popover,\n Select as AriaSelect,\n SelectValue,\n} from 'react-aria-components/Select';\nimport {\n Button as ComboBoxButton,\n ComboBox,\n ComboBoxStateContext,\n ComboBoxValue,\n Input,\n ListBox as ComboBoxListBox,\n ListBoxItem as ComboBoxListBoxItem,\n Popover as ComboBoxPopover,\n} from 'react-aria-components/ComboBox';\nimport { UNSAFE_PortalProvider } from 'react-aria';\nimport { unstable_useOverlayEnvironment } from '../renderer/RendererContext';\nimport { useCratisComponentsConfig } from '../Common/CratisComponentsProvider';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\nimport { OVERLAY_OFFSET, zIndexAboveDialog } from '../renderer/dialogStack';\nimport { useNearestDialogZIndex } from '../renderer/DialogStackContext';\nimport type { DropdownProps } from './Dropdown';\nimport { useExternalLabel } from './useExternalLabel';\nimport {\n asReactAriaButtonProps,\n asReactAriaListBoxItemProps,\n asReactAriaListBoxProps,\n} from '../Common/reactAriaProps';\nimport { classNames } from '../ClassNames/classNames';\n\ntype DropdownOptionValue =\n string | number | boolean | bigint | symbol | object | null | undefined;\n\ninterface ResolvedOption {\n key: string;\n label: string;\n value: unknown;\n disabled: boolean;\n}\n\nconst conventionalField = (\n options: unknown[] | undefined,\n field: 'label' | 'value',\n): string | undefined => {\n const first = options?.[0];\n return first !== null && typeof first === 'object' && field in first\n ? field\n : undefined;\n};\n\nconst optionValue = (value: unknown): DropdownOptionValue => {\n if (typeof value === 'function') return String(value);\n return value as DropdownOptionValue;\n};\n\nconst readField = (option: unknown, field: string | undefined): DropdownOptionValue => {\n if (!field || option === null || typeof option !== 'object')\n return optionValue(option);\n return field in option\n ? optionValue((option as Record<string, unknown>)[field])\n : optionValue(option);\n};\n\nconst resolveOptions = (\n options: unknown[] | undefined,\n optionLabel: string | undefined,\n optionValue: string | undefined,\n): ResolvedOption[] =>\n (options ?? []).map((option, index) => {\n const value = readField(option, optionValue);\n const labelValue = readField(option, optionLabel);\n const keyValue = value ?? index;\n const disabled =\n option !== null && typeof option === 'object' && 'disabled' in option\n ? Boolean((option as { disabled?: unknown }).disabled)\n : false;\n\n return {\n key: `${typeof keyValue}:${String(keyValue)}:${index}`,\n label: String(labelValue ?? value ?? ''),\n value,\n disabled,\n };\n });\n\n/** The part of the ComboBox lifecycle a commit has to reach, from outside the ComboBox subtree. */\ninterface CommittableComboBox {\n close: () => void;\n}\n\n/**\n * Publishes the ComboBox state to the commit handler, which is declared outside the ComboBox and so\n * cannot read the context itself. Renders nothing.\n */\nconst ComboBoxCommitBridge = ({\n handle,\n}: {\n handle: RefObject<CommittableComboBox | null>;\n}) => {\n const state = useContext(ComboBoxStateContext);\n useEffect(() => {\n handle.current = state;\n return () => {\n handle.current = null;\n };\n });\n return null;\n};\n\nconst renderTriggerWithOpenState = (props: JSX.IntrinsicElements['button']) => (\n <button\n {...props}\n data-open={\n props['aria-expanded'] === true || props['aria-expanded'] === 'true'\n ? true\n : undefined\n }\n />\n);\n\n/** A renderer-independent single or multiple select with stable Cratis parts. */\nexport const DropdownImplementation = <T = unknown,>({\n value,\n options,\n optionLabel = conventionalField(options, 'label'),\n optionValue = conventionalField(options, 'value'),\n placeholder,\n filter,\n filterPlaceholder,\n multiple,\n showClear,\n invalid,\n disabled,\n className,\n style,\n id,\n inputId,\n panelClassName,\n name,\n tabIndex,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n ariaLabel: ariaLabelAlias,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaInvalid,\n onChange,\n onBlur,\n pt,\n}: DropdownProps<T>) => {\n const [isOpen, setIsOpen] = useState(false);\n const comboBox = useRef<CommittableComboBox | null>(null);\n const { ref: attachExternalLabel, labelledBy: externalLabelledBy } = useExternalLabel();\n const overlayEnvironment = unstable_useOverlayEnvironment();\n const nearestDialogZIndex = useNearestDialogZIndex();\n const resolvedPopoverZIndex =\n nearestDialogZIndex === null\n ? 'var(--cratis-z-index-overlay)'\n : zIndexAboveDialog(nearestDialogZIndex, OVERLAY_OFFSET);\n const { messages } = useCratisComponentsConfig();\n const dropdownMessages = messages?.dropdown;\n const showOptionsLabel =\n pt?.trigger?.['aria-label'] ??\n pt?.select?.['aria-label'] ??\n dropdownMessages?.showOptions ??\n 'Show options';\n const clearSelectionLabel =\n pt?.clear?.['aria-label'] ??\n dropdownMessages?.clearSelection ??\n 'Clear selection';\n const icon = useCratisIcon();\n const expandIcon = icon('expand', '⌄');\n const clearIcon = icon('clear', '×');\n const resolvedOptions = resolveOptions(options, optionLabel, optionValue);\n // React Aria decides that a selection happened - and only then closes the overlay and syncs the\n // filter text - by watching the key handed to it change. Deriving that key from `value` alone\n // means a consumer that does not feed the emitted value straight back gets a committed selection\n // the Dropdown never acts on: the popup stays open over an unchanged filter. Remembering what the\n // user just committed keeps the commit whole on its own, while an incoming `value` still wins and\n // still drops the memory the moment the consumer answers.\n const [committed, setCommitted] = useState<{\n key: string | null;\n observedValue: unknown;\n } | null>(null);\n const remembered =\n committed !== null && Object.is(committed.observedValue, value)\n ? committed\n : null;\n const remember = (key: string | null) => setCommitted({ key, observedValue: value });\n const selectedOption =\n resolvedOptions.find((option) => Object.is(option.value, value)) ??\n (remembered?.key == null\n ? undefined\n : resolvedOptions.find((option) => option.key === remembered.key));\n const selectedKey = selectedOption?.key ?? null;\n const controlPart = filter ? pt?.filter : multiple ? pt?.multiple : pt?.trigger;\n const effectiveAriaLabel =\n ariaLabel ??\n ariaLabelAlias ??\n pt?.input?.['aria-label'] ??\n pt?.select?.['aria-label'] ??\n controlPart?.['aria-label'];\n const effectiveAriaLabelledby =\n ariaLabelledby ??\n ariaLabelledBy ??\n pt?.input?.['aria-labelledby'] ??\n pt?.select?.['aria-labelledby'] ??\n controlPart?.['aria-labelledby'] ??\n (effectiveAriaLabel ? undefined : externalLabelledBy);\n const effectiveAriaDescribedby =\n ariaDescribedby ??\n ariaDescribedBy ??\n pt?.input?.['aria-describedby'] ??\n pt?.select?.['aria-describedby'];\n const inputAriaInvalid = pt?.input?.['aria-invalid'] ?? pt?.select?.['aria-invalid'];\n const effectiveInvalid =\n invalid ??\n ariaInvalid ??\n (inputAriaInvalid === true ||\n inputAriaInvalid === 'true' ||\n inputAriaInvalid === 'grammar' ||\n inputAriaInvalid === 'spelling');\n const rootClassName = classNames(\n 'cratis-dropdown',\n pt?.root?.className,\n pt?.select?.className,\n className,\n );\n const triggerId = id ?? inputId ?? pt?.trigger?.id ?? pt?.input?.id ?? pt?.select?.id;\n\n const selectOption = (key: Key | null) => {\n const option = resolvedOptions.find((candidate) => candidate.key === String(key));\n remember(option?.key ?? null);\n onChange?.((option?.value ?? null) as T, { source: 'user' });\n // React Aria hands the closing of a filtered overlay to whoever owns the value, and stands\n // down when that value does not come back as one of the options. Nothing about a committed\n // option is the consumer's to close, so close it here and let the filter text follow the\n // selection the Dropdown ends up showing.\n comboBox.current?.close();\n };\n const clearSelection = (event: MouseEvent<HTMLButtonElement>) => {\n remember(null);\n onChange?.(null as T, { source: 'user', nativeEvent: event.nativeEvent });\n };\n const selectOptions = (keys: readonly Key[]) => {\n const selectedKeys = new Set(keys.map(String));\n const values = resolvedOptions\n .filter((option) => selectedKeys.has(option.key))\n .map((option) => option.value);\n onChange?.(values as T, { source: 'user' });\n };\n // React Aria's Select trigger context does not forward aria-invalid from its Button child.\n // Keep the Cratis validation contract on the actual focusable control after context props merge.\n const applyTriggerState = useCallback((element: HTMLButtonElement | null) => {\n attachExternalLabel(element);\n if (!element) return;\n // React Aria puts the selected value first. Keep the field label first while\n // preserving the selected-value reference and all other context-generated ids.\n if (effectiveAriaLabelledby) {\n const references = [\n ...effectiveAriaLabelledby.split(/\\s+/u),\n ...(element.getAttribute('aria-labelledby') ?? '').split(/\\s+/u),\n ].filter(Boolean);\n element.setAttribute('aria-labelledby', [...new Set(references)].join(' '));\n }\n if (effectiveInvalid) element.setAttribute('aria-invalid', 'true');\n else element.removeAttribute('aria-invalid');\n if (tabIndex !== undefined) element.tabIndex = tabIndex;\n }, [effectiveAriaLabelledby, effectiveInvalid, attachExternalLabel, tabIndex]);\n\n if (multiple) {\n const selectedValues = Array.isArray(value) ? value : [];\n const selectedKeys = resolvedOptions\n .filter((option) =>\n selectedValues.some((selected) => Object.is(selected, option.value)),\n )\n .map((option) => option.key);\n\n if (filter) {\n return (\n <span\n {...pt?.root}\n className={rootClassName}\n data-cratis-part='root'\n data-cratis-component='Dropdown'\n data-invalid={effectiveInvalid || undefined}\n data-disabled={disabled || undefined}\n data-open={isOpen || undefined}\n data-selected={selectedKeys.length > 0 || undefined}\n style={{ ...pt?.root?.style, ...pt?.select?.style, ...style }}\n onBlur={onBlur}\n >\n <UNSAFE_PortalProvider getContainer={overlayEnvironment.getContainer}>\n <ComboBox\n selectionMode='multiple'\n onOpenChange={setIsOpen}\n value={selectedKeys}\n onChange={selectOptions}\n isDisabled={disabled}\n isInvalid={effectiveInvalid}\n name={name}\n aria-label={effectiveAriaLabel}\n aria-labelledby={effectiveAriaLabelledby}\n aria-describedby={effectiveAriaDescribedby}\n allowsEmptyCollection\n className='cratis-dropdown__combobox'\n >\n <ComboBoxValue\n {...pt?.value}\n placeholder={placeholder}\n className={classNames(\n 'cratis-dropdown__value',\n pt?.value?.className,\n )}\n data-cratis-part='value'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-open={isOpen || undefined}\n data-selected={selectedKeys.length > 0 || undefined}\n />\n <Input\n {...pt?.filter}\n ref={attachExternalLabel}\n id={triggerId}\n placeholder={filterPlaceholder ?? placeholder}\n tabIndex={tabIndex}\n aria-invalid={effectiveInvalid || undefined}\n className={classNames(\n 'cratis-dropdown__filter',\n pt?.input?.className,\n pt?.filter?.className,\n )}\n style={{ ...pt?.input?.style, ...pt?.filter?.style }}\n data-cratis-part='filter'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-open={isOpen || undefined}\n />\n <ComboBoxButton\n {...asReactAriaButtonProps(pt?.trigger)}\n className={classNames(\n 'cratis-dropdown__indicator',\n pt?.trigger?.className,\n )}\n data-cratis-part='trigger'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-selected={selectedKeys.length > 0 || undefined}\n render={renderTriggerWithOpenState}\n aria-label={showOptionsLabel}\n >\n <span aria-hidden='true'>{expandIcon}</span>\n </ComboBoxButton>\n {showClear && selectedKeys.length > 0 && (\n <button\n {...pt?.clear}\n type='button'\n disabled={disabled}\n className={classNames(\n 'cratis-dropdown__clear',\n pt?.clear?.className,\n )}\n data-cratis-part='clear'\n data-disabled={disabled || undefined}\n aria-label={clearSelectionLabel}\n onClick={(event) =>\n onChange?.([] as T, {\n source: 'user',\n nativeEvent: event.nativeEvent,\n })\n }\n >\n <span aria-hidden='true'>{clearIcon}</span>\n </button>\n )}\n <ComboBoxPopover\n {...pt?.popover}\n className={classNames(\n 'cratis-dropdown__popover',\n pt?.popover?.className,\n panelClassName,\n )}\n style={{\n zIndex: resolvedPopoverZIndex,\n ...pt?.popover?.style,\n }}\n data-cratis-part='popover'\n data-open\n >\n <ComboBoxListBox\n {...asReactAriaListBoxProps<ResolvedOption>(\n pt?.listbox,\n )}\n items={resolvedOptions}\n className={classNames(\n 'cratis-dropdown__listbox',\n pt?.listbox?.className,\n )}\n data-cratis-part='listbox'\n data-open\n >\n {(option) => (\n <ComboBoxListBoxItem\n {...asReactAriaListBoxItemProps<ResolvedOption>(\n pt?.option,\n )}\n id={option.key}\n textValue={option.label}\n isDisabled={option.disabled}\n className={classNames(\n 'cratis-dropdown__option',\n pt?.option?.className,\n )}\n data-cratis-part='option'\n data-disabled={option.disabled || undefined}\n data-selected={\n selectedKeys.includes(option.key) ||\n undefined\n }\n >\n {option.label}\n </ComboBoxListBoxItem>\n )}\n </ComboBoxListBox>\n </ComboBoxPopover>\n </ComboBox>\n </UNSAFE_PortalProvider>\n </span>\n );\n }\n\n return (\n <span\n {...pt?.root}\n className={rootClassName}\n data-cratis-part='root'\n data-cratis-component='Dropdown'\n data-invalid={effectiveInvalid || undefined}\n data-disabled={disabled || undefined}\n data-selected={selectedKeys.length > 0 || undefined}\n style={{ ...pt?.root?.style, ...pt?.select?.style, ...style }}\n onBlur={onBlur}\n >\n <select\n {...pt?.multiple}\n ref={attachExternalLabel}\n id={triggerId ?? pt?.multiple?.id}\n name={name}\n multiple\n disabled={disabled}\n value={selectedKeys}\n tabIndex={tabIndex}\n aria-label={effectiveAriaLabel}\n aria-labelledby={effectiveAriaLabelledby}\n aria-describedby={effectiveAriaDescribedby}\n aria-invalid={effectiveInvalid || undefined}\n className={classNames(\n 'cratis-dropdown__multiple',\n pt?.input?.className,\n pt?.multiple?.className,\n )}\n data-cratis-part='multiple'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-selected={selectedKeys.length > 0 || undefined}\n onChange={(event) => {\n const keys = Array.from(\n event.currentTarget.selectedOptions,\n (option) => option.value,\n );\n const values = resolvedOptions\n .filter((option) => keys.includes(option.key))\n .map((option) => option.value);\n onChange?.(values as T, {\n source: 'user',\n nativeEvent: event.nativeEvent,\n });\n }}\n >\n {resolvedOptions.map((option) => (\n <option\n key={option.key}\n value={option.key}\n disabled={option.disabled}\n data-disabled={option.disabled || undefined}\n data-selected={selectedKeys.includes(option.key) || undefined}\n >\n {option.label}\n </option>\n ))}\n </select>\n {showClear && selectedKeys.length > 0 && (\n <button\n {...pt?.clear}\n type='button'\n disabled={disabled}\n className={classNames(\n 'cratis-dropdown__clear',\n pt?.clear?.className,\n )}\n data-cratis-part='clear'\n data-disabled={disabled || undefined}\n aria-label={clearSelectionLabel}\n onClick={(event) =>\n onChange?.([] as T, {\n source: 'user',\n nativeEvent: event.nativeEvent,\n })\n }\n >\n <span aria-hidden='true'>{clearIcon}</span>\n </button>\n )}\n </span>\n );\n }\n\n if (filter) {\n return (\n <span\n {...pt?.root}\n className={rootClassName}\n data-cratis-part='root'\n data-cratis-component='Dropdown'\n data-invalid={effectiveInvalid || undefined}\n data-disabled={disabled || undefined}\n data-open={isOpen || undefined}\n data-selected={selectedKey !== null || undefined}\n style={{ ...pt?.root?.style, ...pt?.select?.style, ...style }}\n onBlur={onBlur}\n >\n <UNSAFE_PortalProvider getContainer={overlayEnvironment.getContainer}>\n <ComboBox\n onOpenChange={setIsOpen}\n value={selectedKey}\n onChange={selectOption}\n isDisabled={disabled}\n isInvalid={effectiveInvalid}\n name={name}\n aria-label={effectiveAriaLabel}\n aria-labelledby={effectiveAriaLabelledby}\n aria-describedby={effectiveAriaDescribedby}\n allowsEmptyCollection\n className='cratis-dropdown__combobox'\n >\n <ComboBoxCommitBridge handle={comboBox} />\n <Input\n {...pt?.filter}\n ref={attachExternalLabel}\n id={triggerId}\n placeholder={filterPlaceholder ?? placeholder}\n tabIndex={tabIndex}\n aria-invalid={effectiveInvalid || undefined}\n className={classNames(\n 'cratis-dropdown__filter',\n pt?.input?.className,\n pt?.filter?.className,\n )}\n style={{ ...pt?.input?.style, ...pt?.filter?.style }}\n data-cratis-part='filter'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-open={isOpen || undefined}\n />\n <ComboBoxButton\n {...asReactAriaButtonProps(pt?.trigger)}\n className={classNames(\n 'cratis-dropdown__indicator',\n pt?.trigger?.className,\n )}\n data-cratis-part='trigger'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-selected={selectedKey !== null || undefined}\n render={renderTriggerWithOpenState}\n aria-label={showOptionsLabel}\n >\n <span aria-hidden='true'>{expandIcon}</span>\n </ComboBoxButton>\n {showClear && selectedKey !== null && (\n <button\n {...pt?.clear}\n type='button'\n disabled={disabled}\n className={classNames(\n 'cratis-dropdown__clear',\n pt?.clear?.className,\n )}\n data-cratis-part='clear'\n data-disabled={disabled || undefined}\n aria-label={clearSelectionLabel}\n onClick={clearSelection}\n >\n <span aria-hidden='true'>{clearIcon}</span>\n </button>\n )}\n <ComboBoxPopover\n {...pt?.popover}\n className={classNames(\n 'cratis-dropdown__popover',\n pt?.popover?.className,\n panelClassName,\n )}\n style={{\n zIndex: resolvedPopoverZIndex,\n ...pt?.popover?.style,\n }}\n data-cratis-part='popover'\n data-open\n >\n <ComboBoxListBox\n {...asReactAriaListBoxProps<ResolvedOption>(pt?.listbox)}\n items={resolvedOptions}\n className={classNames(\n 'cratis-dropdown__listbox',\n pt?.listbox?.className,\n )}\n data-cratis-part='listbox'\n data-open\n >\n {(option) => (\n <ComboBoxListBoxItem\n {...asReactAriaListBoxItemProps<ResolvedOption>(\n pt?.option,\n )}\n id={option.key}\n textValue={option.label}\n isDisabled={option.disabled}\n className={classNames(\n 'cratis-dropdown__option',\n pt?.option?.className,\n )}\n data-cratis-part='option'\n data-disabled={option.disabled || undefined}\n data-selected={\n option.key === selectedKey || undefined\n }\n >\n {option.label}\n </ComboBoxListBoxItem>\n )}\n </ComboBoxListBox>\n </ComboBoxPopover>\n </ComboBox>\n </UNSAFE_PortalProvider>\n </span>\n );\n }\n\n return (\n <span\n {...pt?.root}\n className={rootClassName}\n data-cratis-part='root'\n data-cratis-component='Dropdown'\n data-invalid={effectiveInvalid || undefined}\n data-disabled={disabled || undefined}\n data-open={isOpen || undefined}\n data-selected={selectedKey !== null || undefined}\n style={{ ...pt?.root?.style, ...pt?.select?.style, ...style }}\n onBlur={onBlur}\n >\n <UNSAFE_PortalProvider getContainer={overlayEnvironment.getContainer}>\n <AriaSelect\n onOpenChange={setIsOpen}\n value={selectedKey}\n onChange={selectOption}\n isDisabled={disabled}\n isInvalid={effectiveInvalid}\n name={name}\n aria-label={effectiveAriaLabel}\n aria-labelledby={effectiveAriaLabelledby}\n aria-describedby={effectiveAriaDescribedby}\n className='cratis-dropdown__select'\n >\n <AriaButton\n {...asReactAriaButtonProps(pt?.trigger)}\n ref={applyTriggerState}\n id={triggerId}\n excludeFromTabOrder={tabIndex === -1}\n aria-invalid={effectiveInvalid || undefined}\n className={classNames(\n 'cratis-dropdown__trigger',\n pt?.input?.className,\n pt?.trigger?.className,\n )}\n style={{ ...pt?.input?.style, ...pt?.trigger?.style }}\n data-cratis-part='trigger'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-selected={selectedKey !== null || undefined}\n render={renderTriggerWithOpenState}\n >\n <SelectValue\n {...pt?.value}\n className={classNames(\n 'cratis-dropdown__value',\n pt?.value?.className,\n )}\n data-cratis-part='value'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-open={isOpen || undefined}\n data-selected={selectedKey !== null || undefined}\n >\n {selectedOption?.label ?? placeholder}\n </SelectValue>\n <span\n {...pt?.indicator}\n className={classNames(\n 'cratis-dropdown__indicator',\n pt?.indicator?.className,\n )}\n data-cratis-part='indicator'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-open={isOpen || undefined}\n aria-hidden='true'\n >\n {expandIcon}\n </span>\n </AriaButton>\n {showClear && selectedKey !== null && (\n <button\n {...pt?.clear}\n type='button'\n disabled={disabled}\n className={classNames(\n 'cratis-dropdown__clear',\n pt?.clear?.className,\n )}\n data-cratis-part='clear'\n data-disabled={disabled || undefined}\n aria-label={clearSelectionLabel}\n onClick={clearSelection}\n >\n <span aria-hidden='true'>{clearIcon}</span>\n </button>\n )}\n <Popover\n {...pt?.popover}\n className={classNames(\n 'cratis-dropdown__popover',\n pt?.popover?.className,\n panelClassName,\n )}\n style={{\n zIndex: resolvedPopoverZIndex,\n ...pt?.popover?.style,\n }}\n data-cratis-part='popover'\n data-open\n >\n <ListBox\n {...asReactAriaListBoxProps<ResolvedOption>(pt?.listbox)}\n items={resolvedOptions}\n className={classNames(\n 'cratis-dropdown__listbox',\n pt?.listbox?.className,\n )}\n data-cratis-part='listbox'\n data-open\n >\n {(option) => (\n <ListBoxItem\n {...asReactAriaListBoxItemProps<ResolvedOption>(\n pt?.option,\n )}\n id={option.key}\n textValue={option.label}\n isDisabled={option.disabled}\n className={classNames(\n 'cratis-dropdown__option',\n pt?.option?.className,\n )}\n data-cratis-part='option'\n data-disabled={option.disabled || undefined}\n data-selected={\n option.key === selectedKey || undefined\n }\n >\n {option.label}\n </ListBoxItem>\n )}\n </ListBox>\n </Popover>\n </AriaSelect>\n </UNSAFE_PortalProvider>\n </span>\n );\n};\n\nDropdownImplementation.displayName = 'DropdownImplementation';\n"],"names":["_jsx","_jsxs","ComboBoxButton","ComboBoxPopover","ComboBoxListBox","ComboBoxListBoxItem","AriaSelect","AriaButton","Popover","ListBox","ListBoxItem"],"mappings":";;;;;;;;;;;;;;;;;;;AAgDA,MAAM,iBAAiB,GAAG,CACtB,OAA8B,EAC9B,KAAwB,KACJ;AACpB,IAAA,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC;IAC1B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI;AAC3D,UAAE;UACA,SAAS;AACnB,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,KAAc,KAAyB;IACxD,IAAI,OAAO,KAAK,KAAK,UAAU;AAAE,QAAA,OAAO,MAAM,CAAC,KAAK,CAAC;AACrD,IAAA,OAAO,KAA4B;AACvC,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,MAAe,EAAE,KAAyB,KAAyB;IAClF,IAAI,CAAC,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;AACvD,QAAA,OAAO,WAAW,CAAC,MAAM,CAAC;IAC9B,OAAO,KAAK,IAAI;AACZ,UAAE,WAAW,CAAE,MAAkC,CAAC,KAAK,CAAC;AACxD,UAAE,WAAW,CAAC,MAAM,CAAC;AAC7B,CAAC;AAED,MAAM,cAAc,GAAG,CACnB,OAA8B,EAC9B,WAA+B,EAC/B,WAA+B,KAE/B,CAAC,OAAO,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;IAClC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC5C,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;AACjD,IAAA,MAAM,QAAQ,GAAG,KAAK,IAAI,KAAK;AAC/B,IAAA,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B,EAAE,EAAE,MAAM,EAAE,SAAS,CACxB,EAAA,kBAAA,EACgB,QAAQ,mBACV,MAAM,CAAC,QAAQ,IAAI,SAAS,EAAA,eAAA,EAEvC,MAAM,CAAC,GAAG,KAAK,WAAW,IAAI,SAAS,YAG1C,MAAM,CAAC,KAAK,EAAA,CACH,CACjB,EAAA,CACK,GACJ,CAAA,EAAA,CACD,EAAA,CACO,EAAA,CACrB;AAEf;AAEA,sBAAsB,CAAC,WAAW,GAAG,wBAAwB;;"}
|
|
1
|
+
{"version":3,"file":"DropdownImplementation.js","sources":["../../../Dropdown/DropdownImplementation.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 { UNSAFE_PortalProvider } from 'react-aria';\nimport type { DropdownProps } from './Dropdown';\nimport type { DropdownBranchProps } from './DropdownBranchProps';\nimport { FilterDropdown } from './FilterDropdown';\nimport { MultipleSelectDropdown } from './MultipleSelectDropdown';\nimport { SingleSelectDropdown } from './SingleSelectDropdown';\nimport { useDropdownHandlers } from './useDropdownHandlers';\nimport { useDropdownState } from './useDropdownState';\n\nconst chooseBranch = <T,>(props: DropdownProps<T>, branch: DropdownBranchProps<T>) => {\n if (props.filter) return <FilterDropdown {...branch} />;\n return props.multiple ? <MultipleSelectDropdown {...branch} /> : <SingleSelectDropdown {...branch} />;\n};\n\n/** A renderer-independent single or multiple select with stable Cratis parts. */\nexport const DropdownImplementation = <T = unknown,>(props: DropdownProps<T>) => {\n const state = useDropdownState(props);\n const handlers = useDropdownHandlers(props, state);\n const { overlayEnvironment } = state;\n const branch = { props, state, handlers };\n\n return (\n <UNSAFE_PortalProvider getContainer={overlayEnvironment.getContainer}>\n {chooseBranch(props, branch)}\n </UNSAFE_PortalProvider>\n );\n};\n\nDropdownImplementation.displayName = 'DropdownImplementation';\n"],"names":["_jsx"],"mappings":";;;;;;;;AAYA,MAAM,YAAY,GAAG,CAAK,KAAuB,EAAE,MAA8B,KAAI;IACjF,IAAI,KAAK,CAAC,MAAM;AAAE,QAAA,OAAOA,GAAA,CAAC,cAAc,EAAA,EAAA,GAAK,MAAM,GAAI;AACvD,IAAA,OAAO,KAAK,CAAC,QAAQ,GAAGA,IAAC,sBAAsB,EAAA,EAAA,GAAK,MAAM,EAAA,CAAI,GAAGA,GAAA,CAAC,oBAAoB,EAAA,EAAA,GAAK,MAAM,GAAI;AACzG,CAAC;AAGM,MAAM,sBAAsB,GAAG,CAAe,KAAuB,KAAI;AAC5E,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC;IACrC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC;AAClD,IAAA,MAAM,EAAE,kBAAkB,EAAE,GAAG,KAAK;IACpC,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE;AAEzC,IAAA,QACIA,GAAA,CAAC,qBAAqB,IAAC,YAAY,EAAE,kBAAkB,CAAC,YAAY,EAAA,QAAA,EAC/D,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,EAAA,CACR;AAEhC;AAEA,sBAAsB,CAAC,WAAW,GAAG,wBAAwB;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type DropdownParts } from './dropdownAttributes.js';
|
|
2
|
+
import type { ResolvedOption } from './resolveOptions.js';
|
|
3
|
+
interface OptionListProps {
|
|
4
|
+
pt: DropdownParts;
|
|
5
|
+
panelClassName: string | undefined;
|
|
6
|
+
zIndex: string;
|
|
7
|
+
options: ResolvedOption[];
|
|
8
|
+
isSelected: (key: string) => boolean;
|
|
9
|
+
}
|
|
10
|
+
/** The ComboBox popover with its listbox. */
|
|
11
|
+
export declare const ComboBoxOptionList: ({ pt, panelClassName, zIndex, options, isSelected }: OptionListProps) => import("react").JSX.Element;
|
|
12
|
+
/** The Select popover with its listbox. */
|
|
13
|
+
export declare const SelectOptionList: ({ pt, panelClassName, zIndex, options, isSelected }: OptionListProps) => import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=DropdownOptionLists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownOptionLists.d.ts","sourceRoot":"","sources":["../../../Dropdown/DropdownOptionLists.tsx"],"names":[],"mappings":"AAeA,OAAO,EAGH,KAAK,aAAa,EACrB,MAAM,yBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAEvD,UAAU,eAAe;IACrB,EAAE,EAAE,aAAa,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC;AAKD,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB,wDAAyD,eAAe,gCA+BtG,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,wDAAyD,eAAe,gCA+BpG,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Popover, ListBox, ListBoxItem } from 'react-aria-components/ComboBox';
|
|
3
|
+
import { Popover as Popover$1, ListBox as ListBox$1, ListBoxItem as ListBoxItem$1 } from 'react-aria-components/Select';
|
|
4
|
+
import { asReactAriaListBoxItemProps, asReactAriaListBoxProps } from '../Common/reactAriaProps.js';
|
|
5
|
+
import { classNames } from '../ClassNames/classNames.js';
|
|
6
|
+
import { popoverStyle, popoverClassName } from './dropdownAttributes.js';
|
|
7
|
+
|
|
8
|
+
const ComboBoxOptionList = ({ pt, panelClassName, zIndex, options, isSelected }) => (jsx(Popover, { ...pt?.popover, className: popoverClassName(pt, panelClassName), style: popoverStyle(pt, zIndex), "data-cratis-part": 'popover', "data-open": true, children: jsx(ListBox, { ...asReactAriaListBoxProps(pt?.listbox), items: options, className: classNames('cratis-dropdown__listbox', pt?.listbox?.className), "data-cratis-part": 'listbox', "data-open": true, children: (option) => (jsx(ListBoxItem, { ...asReactAriaListBoxItemProps(pt?.option), id: option.key, textValue: option.label, isDisabled: option.disabled, className: classNames('cratis-dropdown__option', pt?.option?.className), "data-cratis-part": 'option', "data-disabled": option.disabled || undefined, "data-selected": isSelected(option.key) || undefined, children: option.label })) }) }));
|
|
9
|
+
const SelectOptionList = ({ pt, panelClassName, zIndex, options, isSelected }) => (jsx(Popover$1, { ...pt?.popover, className: popoverClassName(pt, panelClassName), style: popoverStyle(pt, zIndex), "data-cratis-part": 'popover', "data-open": true, children: jsx(ListBox$1, { ...asReactAriaListBoxProps(pt?.listbox), items: options, className: classNames('cratis-dropdown__listbox', pt?.listbox?.className), "data-cratis-part": 'listbox', "data-open": true, children: (option) => (jsx(ListBoxItem$1, { ...asReactAriaListBoxItemProps(pt?.option), id: option.key, textValue: option.label, isDisabled: option.disabled, className: classNames('cratis-dropdown__option', pt?.option?.className), "data-cratis-part": 'option', "data-disabled": option.disabled || undefined, "data-selected": isSelected(option.key) || undefined, children: option.label })) }) }));
|
|
10
|
+
|
|
11
|
+
export { ComboBoxOptionList, SelectOptionList };
|
|
12
|
+
//# sourceMappingURL=DropdownOptionLists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownOptionLists.js","sources":["../../../Dropdown/DropdownOptionLists.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 {\n ListBox as ComboBoxListBox,\n ListBoxItem as ComboBoxListBoxItem,\n Popover as ComboBoxPopover,\n} from 'react-aria-components/ComboBox';\nimport {\n ListBox,\n ListBoxItem,\n Popover,\n} from 'react-aria-components/Select';\nimport { asReactAriaListBoxItemProps, asReactAriaListBoxProps } from '../Common/reactAriaProps';\nimport { classNames } from '../ClassNames/classNames';\nimport {\n popoverClassName,\n popoverStyle,\n type DropdownParts,\n} from './dropdownAttributes';\nimport type { ResolvedOption } from './resolveOptions';\n\ninterface OptionListProps {\n pt: DropdownParts;\n panelClassName: string | undefined;\n zIndex: string;\n options: ResolvedOption[];\n isSelected: (key: string) => boolean;\n}\n\n// The ComboBox and Select families come from different React Aria contexts and are not interchangeable,\n// so each keeps its own thin component over the shared attribute helpers.\n\n/** The ComboBox popover with its listbox. */\nexport const ComboBoxOptionList = ({ pt, panelClassName, zIndex, options, isSelected }: OptionListProps) => (\n <ComboBoxPopover\n {...pt?.popover}\n className={popoverClassName(pt, panelClassName)}\n style={popoverStyle(pt, zIndex)}\n data-cratis-part='popover'\n data-open\n >\n <ComboBoxListBox\n {...asReactAriaListBoxProps<ResolvedOption>(pt?.listbox)}\n items={options}\n className={classNames('cratis-dropdown__listbox', pt?.listbox?.className)}\n data-cratis-part='listbox'\n data-open\n >\n {(option) => (\n <ComboBoxListBoxItem\n {...asReactAriaListBoxItemProps<ResolvedOption>(pt?.option)}\n id={option.key}\n textValue={option.label}\n isDisabled={option.disabled}\n className={classNames('cratis-dropdown__option', pt?.option?.className)}\n data-cratis-part='option'\n data-disabled={option.disabled || undefined}\n data-selected={isSelected(option.key) || undefined}\n >\n {option.label}\n </ComboBoxListBoxItem>\n )}\n </ComboBoxListBox>\n </ComboBoxPopover>\n);\n\n/** The Select popover with its listbox. */\nexport const SelectOptionList = ({ pt, panelClassName, zIndex, options, isSelected }: OptionListProps) => (\n <Popover\n {...pt?.popover}\n className={popoverClassName(pt, panelClassName)}\n style={popoverStyle(pt, zIndex)}\n data-cratis-part='popover'\n data-open\n >\n <ListBox\n {...asReactAriaListBoxProps<ResolvedOption>(pt?.listbox)}\n items={options}\n className={classNames('cratis-dropdown__listbox', pt?.listbox?.className)}\n data-cratis-part='listbox'\n data-open\n >\n {(option) => (\n <ListBoxItem\n {...asReactAriaListBoxItemProps<ResolvedOption>(pt?.option)}\n id={option.key}\n textValue={option.label}\n isDisabled={option.disabled}\n className={classNames('cratis-dropdown__option', pt?.option?.className)}\n data-cratis-part='option'\n data-disabled={option.disabled || undefined}\n data-selected={isSelected(option.key) || undefined}\n >\n {option.label}\n </ListBoxItem>\n )}\n </ListBox>\n </Popover>\n);\n"],"names":["_jsx","ComboBoxPopover","ComboBoxListBox","ComboBoxListBoxItem","Popover","ListBox","ListBoxItem"],"mappings":";;;;;;;AAkCO,MAAM,kBAAkB,GAAG,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAmB,MACnGA,GAAA,CAACC,OAAe,EAAA,EAAA,GACR,EAAE,EAAE,OAAO,EACf,SAAS,EAAE,gBAAgB,CAAC,EAAE,EAAE,cAAc,CAAC,EAC/C,KAAK,EAAE,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,EAAA,kBAAA,EACd,SAAS,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAG1BD,IAACE,OAAe,EAAA,EAAA,GACR,uBAAuB,CAAiB,EAAE,EAAE,OAAO,CAAC,EACxD,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,EAAA,kBAAA,EACxD,SAAS,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAGzB,CAAC,MAAM,MACJF,GAAA,CAACG,WAAmB,EAAA,EAAA,GACZ,2BAA2B,CAAiB,EAAE,EAAE,MAAM,CAAC,EAC3D,EAAE,EAAE,MAAM,CAAC,GAAG,EACd,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,UAAU,EAAE,MAAM,CAAC,QAAQ,EAC3B,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAA,kBAAA,EACtD,QAAQ,EAAA,eAAA,EACV,MAAM,CAAC,QAAQ,IAAI,SAAS,EAAA,eAAA,EAC5B,UAAU,CAAC,MAAM,CAAC,GAAG,C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Handler, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { DropdownProps } from './Dropdown.js';
|
|
3
|
+
import { type DropdownParts } from './dropdownAttributes.js';
|
|
4
|
+
interface DropdownRootProps {
|
|
5
|
+
pt: DropdownParts;
|
|
6
|
+
className: string;
|
|
7
|
+
style: DropdownProps['style'];
|
|
8
|
+
onBlur: DropdownProps['onBlur'];
|
|
9
|
+
invalid: boolean;
|
|
10
|
+
disabled: boolean | undefined;
|
|
11
|
+
open: boolean;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** The root element every dropdown variant renders; the parts differ only in what they hold. */
|
|
16
|
+
export declare const DropdownRoot: ({ pt, className, style, onBlur, invalid, disabled, open, selected, children }: DropdownRootProps) => import("react").JSX.Element;
|
|
17
|
+
interface DropdownClearButtonProps {
|
|
18
|
+
pt: DropdownParts;
|
|
19
|
+
disabled: boolean | undefined;
|
|
20
|
+
label: string;
|
|
21
|
+
icon: ReactNode;
|
|
22
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
23
|
+
}
|
|
24
|
+
export declare const DropdownClearButton: ({ pt, disabled, label, icon, onClick }: DropdownClearButtonProps) => import("react").JSX.Element;
|
|
25
|
+
interface DropdownFilterInputProps {
|
|
26
|
+
pt: DropdownParts;
|
|
27
|
+
inputRef: Ref<HTMLInputElement>;
|
|
28
|
+
id: string | undefined;
|
|
29
|
+
placeholder: string | undefined;
|
|
30
|
+
tabIndex: number | undefined;
|
|
31
|
+
invalid: boolean;
|
|
32
|
+
disabled: boolean | undefined;
|
|
33
|
+
open: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare const DropdownFilterInput: ({ pt, inputRef, id, placeholder, tabIndex, invalid, disabled, open }: DropdownFilterInputProps) => import("react").JSX.Element;
|
|
36
|
+
interface DropdownComboBoxTriggerProps {
|
|
37
|
+
pt: DropdownParts;
|
|
38
|
+
disabled: boolean | undefined;
|
|
39
|
+
invalid: boolean;
|
|
40
|
+
selected: boolean;
|
|
41
|
+
label: string;
|
|
42
|
+
icon: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export declare const DropdownComboBoxTrigger: ({ pt, disabled, invalid, selected, label, icon }: DropdownComboBoxTriggerProps) => import("react").JSX.Element;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=DropdownParts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownParts.d.ts","sourceRoot":"","sources":["../../../Dropdown/DropdownParts.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAY,CAAC;AAChD,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,yBAAsB,CAAC;AAGhE,UAAU,iBAAiB;IACvB,EAAE,EAAE,aAAa,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,gGAAgG;AAChG,eAAO,MAAM,YAAY,kFAAmF,iBAAiB,gCAe5H,CAAC;AAEF,UAAU,wBAAwB;IAC9B,EAAE,EAAE,aAAa,CAAC;IAClB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,mBAAmB,2CAA4C,wBAAwB,gCAanG,CAAC;AAEF,UAAU,wBAAwB;IAC9B,EAAE,EAAE,aAAa,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAChC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,yEAA0E,wBAAwB,gCAejI,CAAC;AAEF,UAAU,4BAA4B;IAClC,EAAE,EAAE,aAAa,CAAC;IAClB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,uBAAuB,qDAAsD,4BAA4B,gCAarH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Input, Button } from 'react-aria-components/ComboBox';
|
|
3
|
+
import { classNames } from '../ClassNames/classNames.js';
|
|
4
|
+
import { asReactAriaButtonProps } from '../Common/reactAriaProps.js';
|
|
5
|
+
import { flag } from './dropdownAttributes.js';
|
|
6
|
+
import { renderTriggerWithOpenState } from './renderTriggerWithOpenState.js';
|
|
7
|
+
|
|
8
|
+
const DropdownRoot = ({ pt, className, style, onBlur, invalid, disabled, open, selected, children }) => (jsx("span", { ...pt?.root, className: className, "data-cratis-part": 'root', "data-cratis-component": 'Dropdown', "data-invalid": invalid || undefined, "data-disabled": disabled || undefined, "data-open": open || undefined, "data-selected": selected || undefined, style: { ...pt?.root?.style, ...pt?.select?.style, ...style }, onBlur: onBlur, children: children }));
|
|
9
|
+
const DropdownClearButton = ({ pt, disabled, label, icon, onClick }) => (jsx("button", { ...pt?.clear, type: 'button', disabled: disabled, className: classNames('cratis-dropdown__clear', pt?.clear?.className), "data-cratis-part": 'clear', "data-disabled": disabled || undefined, "aria-label": label, onClick: onClick, children: jsx("span", { "aria-hidden": 'true', children: icon }) }));
|
|
10
|
+
const DropdownFilterInput = ({ pt, inputRef, id, placeholder, tabIndex, invalid, disabled, open }) => (jsx(Input, { ...pt?.filter, ref: inputRef, id: id, placeholder: placeholder, tabIndex: tabIndex, "aria-invalid": flag(invalid), className: classNames('cratis-dropdown__filter', pt?.input?.className, pt?.filter?.className), style: { ...pt?.input?.style, ...pt?.filter?.style }, "data-cratis-part": 'filter', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-open": open || undefined }));
|
|
11
|
+
const DropdownComboBoxTrigger = ({ pt, disabled, invalid, selected, label, icon }) => (jsx(Button, { ...asReactAriaButtonProps(pt?.trigger), className: classNames('cratis-dropdown__indicator', pt?.trigger?.className), "data-cratis-part": 'trigger', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-selected": selected || undefined, render: renderTriggerWithOpenState, "aria-label": label, children: jsx("span", { "aria-hidden": 'true', children: icon }) }));
|
|
12
|
+
|
|
13
|
+
export { DropdownClearButton, DropdownComboBoxTrigger, DropdownFilterInput, DropdownRoot };
|
|
14
|
+
//# sourceMappingURL=DropdownParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownParts.js","sources":["../../../Dropdown/DropdownParts.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 { MouseEventHandler, ReactNode, Ref } from 'react';\nimport { Button as ComboBoxButton, Input } from 'react-aria-components/ComboBox';\nimport { classNames } from '../ClassNames/classNames';\nimport { asReactAriaButtonProps } from '../Common/reactAriaProps';\nimport type { DropdownProps } from './Dropdown';\nimport { flag, type DropdownParts } from './dropdownAttributes';\nimport { renderTriggerWithOpenState } from './renderTriggerWithOpenState';\n\ninterface DropdownRootProps {\n pt: DropdownParts;\n className: string;\n style: DropdownProps['style'];\n onBlur: DropdownProps['onBlur'];\n invalid: boolean;\n disabled: boolean | undefined;\n open: boolean;\n selected: boolean;\n children: ReactNode;\n}\n\n/** The root element every dropdown variant renders; the parts differ only in what they hold. */\nexport const DropdownRoot = ({ pt, className, style, onBlur, invalid, disabled, open, selected, children }: DropdownRootProps) => (\n <span\n {...pt?.root}\n className={className}\n data-cratis-part='root'\n data-cratis-component='Dropdown'\n data-invalid={invalid || undefined}\n data-disabled={disabled || undefined}\n data-open={open || undefined}\n data-selected={selected || undefined}\n style={{ ...pt?.root?.style, ...pt?.select?.style, ...style }}\n onBlur={onBlur}\n >\n {children}\n </span>\n);\n\ninterface DropdownClearButtonProps {\n pt: DropdownParts;\n disabled: boolean | undefined;\n label: string;\n icon: ReactNode;\n onClick: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const DropdownClearButton = ({ pt, disabled, label, icon, onClick }: DropdownClearButtonProps) => (\n <button\n {...pt?.clear}\n type='button'\n disabled={disabled}\n className={classNames('cratis-dropdown__clear', pt?.clear?.className)}\n data-cratis-part='clear'\n data-disabled={disabled || undefined}\n aria-label={label}\n onClick={onClick}\n >\n <span aria-hidden='true'>{icon}</span>\n </button>\n);\n\ninterface DropdownFilterInputProps {\n pt: DropdownParts;\n inputRef: Ref<HTMLInputElement>;\n id: string | undefined;\n placeholder: string | undefined;\n tabIndex: number | undefined;\n invalid: boolean;\n disabled: boolean | undefined;\n open: boolean;\n}\n\nexport const DropdownFilterInput = ({ pt, inputRef, id, placeholder, tabIndex, invalid, disabled, open }: DropdownFilterInputProps) => (\n <Input\n {...pt?.filter}\n ref={inputRef}\n id={id}\n placeholder={placeholder}\n tabIndex={tabIndex}\n aria-invalid={flag(invalid)}\n className={classNames('cratis-dropdown__filter', pt?.input?.className, pt?.filter?.className)}\n style={{ ...pt?.input?.style, ...pt?.filter?.style }}\n data-cratis-part='filter'\n data-disabled={disabled || undefined}\n data-invalid={invalid || undefined}\n data-open={open || undefined}\n />\n);\n\ninterface DropdownComboBoxTriggerProps {\n pt: DropdownParts;\n disabled: boolean | undefined;\n invalid: boolean;\n selected: boolean;\n label: string;\n icon: ReactNode;\n}\n\nexport const DropdownComboBoxTrigger = ({ pt, disabled, invalid, selected, label, icon }: DropdownComboBoxTriggerProps) => (\n <ComboBoxButton\n {...asReactAriaButtonProps(pt?.trigger)}\n className={classNames('cratis-dropdown__indicator', pt?.trigger?.className)}\n data-cratis-part='trigger'\n data-disabled={disabled || undefined}\n data-invalid={invalid || undefined}\n data-selected={selected || undefined}\n render={renderTriggerWithOpenState}\n aria-label={label}\n >\n <span aria-hidden='true'>{icon}</span>\n </ComboBoxButton>\n);\n"],"names":["_jsx","ComboBoxButton"],"mappings":";;;;;;;AAwBO,MAAM,YAAY,GAAG,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAqB,MACzHA,iBACQ,EAAE,EAAE,IAAI,EACZ,SAAS,EAAE,SAAS,sBACH,MAAM,EAAA,uBAAA,EACD,UAAU,EAAA,cAAA,EAClB,OAAO,IAAI,SAAS,mBACnB,QAAQ,IAAI,SAAS,EAAA,WAAA,EACzB,IAAI,IAAI,SAAS,EAAA,eAAA,EACb,QAAQ,IAAI,SAAS,EACpC,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAC7D,MAAM,EAAE,MAAM,YAEb,QAAQ,EAAA,CACN;AAWJ,MAAM,mBAAmB,GAAG,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAA4B,MAChGA,GAAA,CAAA,QAAA,EAAA,EAAA,GACQ,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AAA,GACP,sBAAsB,CAAC,EAAE,EAAE,OAAO,CAAC,EACvC,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,EAAA,kBAAA,EAC1D,SAAS,EAAA,eAAA,EACX,QAAQ,IAAI,SAAS,EAAA,cAAA,EACtB,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,QAAQ,IAAI,SAAS,EACpC,MAAM,EAAE,0BAA0B,EAAA,YAAA,EACtB,KAAK,EAAA,QAAA,EAEjBD,GAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,EAAA,QAAA,EAAE,IAAI,EAAA,CAAQ,EAAA,CACzB;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DropdownBranchProps } from './DropdownBranchProps.js';
|
|
2
|
+
/**
|
|
3
|
+
* The filterable dropdown, single or multiple: a React Aria ComboBox. One component serves both
|
|
4
|
+
* selection modes so switching `multiple` keeps the ComboBox and the filter input mounted.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FilterDropdown: <T>({ props, state, handlers }: DropdownBranchProps<T>) => import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=FilterDropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDropdown.d.ts","sourceRoot":"","sources":["../../../Dropdown/FilterDropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAAuB,CAAC;AAUjE;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,8BAA+B,mBAAmB,CAAC,CAAC,CAAC,gCA4FpF,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ComboBoxValue, ComboBox } from 'react-aria-components/ComboBox';
|
|
3
|
+
import { classNames } from '../ClassNames/classNames.js';
|
|
4
|
+
import { ComboBoxCommitBridge } from './ComboBoxCommitBridge.js';
|
|
5
|
+
import { ComboBoxOptionList } from './DropdownOptionLists.js';
|
|
6
|
+
import { DropdownFilterInput, DropdownComboBoxTrigger, DropdownClearButton, DropdownRoot } from './DropdownParts.js';
|
|
7
|
+
import { selectedKeysOf } from './resolveOptions.js';
|
|
8
|
+
|
|
9
|
+
const FilterDropdown = ({ props, state, handlers }) => {
|
|
10
|
+
const { pt, value, multiple, placeholder, filterPlaceholder, disabled, name, tabIndex, showClear, style, onBlur, panelClassName } = props;
|
|
11
|
+
const { selectedKey, isOpen, effectiveInvalid } = state;
|
|
12
|
+
const selectedKeys = multiple ? selectedKeysOf(value, state.resolvedOptions) : [];
|
|
13
|
+
const selected = multiple ? selectedKeys.length > 0 : selectedKey !== null;
|
|
14
|
+
const isSelected = (key) => (multiple ? selectedKeys.includes(key) : key === selectedKey);
|
|
15
|
+
const common = {
|
|
16
|
+
onOpenChange: state.setIsOpen,
|
|
17
|
+
isDisabled: disabled,
|
|
18
|
+
isInvalid: effectiveInvalid,
|
|
19
|
+
name,
|
|
20
|
+
'aria-label': state.effectiveAriaLabel,
|
|
21
|
+
'aria-labelledby': state.effectiveAriaLabelledby,
|
|
22
|
+
'aria-describedby': state.effectiveAriaDescribedby,
|
|
23
|
+
allowsEmptyCollection: true,
|
|
24
|
+
className: 'cratis-dropdown__combobox',
|
|
25
|
+
};
|
|
26
|
+
const body = (jsxs(Fragment, { children: [multiple ? (jsx(ComboBoxValue, { ...pt?.value, placeholder: placeholder, className: classNames('cratis-dropdown__value', pt?.value?.className), "data-cratis-part": 'value', "data-disabled": disabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-open": isOpen || undefined, "data-selected": selected || undefined })) : (jsx(ComboBoxCommitBridge, { handle: state.comboBox })), jsx(DropdownFilterInput, { pt: pt, inputRef: state.attachExternalLabel, id: state.triggerId, placeholder: filterPlaceholder ?? placeholder, tabIndex: tabIndex, invalid: effectiveInvalid, disabled: disabled, open: isOpen }), jsx(DropdownComboBoxTrigger, { pt: pt, disabled: disabled, invalid: effectiveInvalid, selected: selected, label: state.showOptionsLabel, icon: state.expandIcon }), showClear && selected && (jsx(DropdownClearButton, { pt: pt, disabled: disabled, label: state.clearSelectionLabel, icon: state.clearIcon, onClick: multiple ? handlers.clearSelections : handlers.clearSelection })), jsx(ComboBoxOptionList, { pt: pt, panelClassName: panelClassName, zIndex: state.resolvedPopoverZIndex, options: state.resolvedOptions, isSelected: isSelected })] }));
|
|
27
|
+
return (jsx(DropdownRoot, { pt: pt, className: state.rootClassName, style: style, onBlur: onBlur, invalid: effectiveInvalid, disabled: disabled, open: isOpen, selected: selected, children: multiple ? (jsx(ComboBox, { ...common, selectionMode: 'multiple', value: selectedKeys, onChange: handlers.selectOptions, children: body })) : (jsx(ComboBox, { ...common, value: selectedKey, onChange: handlers.selectOption, children: body })) }));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { FilterDropdown };
|
|
31
|
+
//# sourceMappingURL=FilterDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDropdown.js","sources":["../../../Dropdown/FilterDropdown.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 { ComboBox, ComboBoxValue } from 'react-aria-components/ComboBox';\nimport { classNames } from '../ClassNames/classNames';\nimport { ComboBoxCommitBridge } from './ComboBoxCommitBridge';\nimport type { DropdownBranchProps } from './DropdownBranchProps';\nimport { ComboBoxOptionList } from './DropdownOptionLists';\nimport {\n DropdownClearButton,\n DropdownComboBoxTrigger,\n DropdownFilterInput,\n DropdownRoot,\n} from './DropdownParts';\nimport { selectedKeysOf } from './resolveOptions';\n\n/**\n * The filterable dropdown, single or multiple: a React Aria ComboBox. One component serves both\n * selection modes so switching `multiple` keeps the ComboBox and the filter input mounted.\n */\nexport const FilterDropdown = <T,>({ props, state, handlers }: DropdownBranchProps<T>) => {\n const { pt, value, multiple, placeholder, filterPlaceholder, disabled, name, tabIndex, showClear, style, onBlur, panelClassName } = props;\n const { selectedKey, isOpen, effectiveInvalid } = state;\n const selectedKeys = multiple ? selectedKeysOf(value, state.resolvedOptions) : [];\n const selected = multiple ? selectedKeys.length > 0 : selectedKey !== null;\n const isSelected = (key: string) => (multiple ? selectedKeys.includes(key) : key === selectedKey);\n const common = {\n onOpenChange: state.setIsOpen,\n isDisabled: disabled,\n isInvalid: effectiveInvalid,\n name,\n 'aria-label': state.effectiveAriaLabel,\n 'aria-labelledby': state.effectiveAriaLabelledby,\n 'aria-describedby': state.effectiveAriaDescribedby,\n allowsEmptyCollection: true,\n className: 'cratis-dropdown__combobox',\n };\n const body = (\n <>\n {multiple ? (\n <ComboBoxValue\n {...pt?.value}\n placeholder={placeholder}\n className={classNames('cratis-dropdown__value', pt?.value?.className)}\n data-cratis-part='value'\n data-disabled={disabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-open={isOpen || undefined}\n data-selected={selected || undefined}\n />\n ) : (\n <ComboBoxCommitBridge handle={state.comboBox} />\n )}\n <DropdownFilterInput\n pt={pt}\n inputRef={state.attachExternalLabel}\n id={state.triggerId}\n placeholder={filterPlaceholder ?? placeholder}\n tabIndex={tabIndex}\n invalid={effectiveInvalid}\n disabled={disabled}\n open={isOpen}\n />\n <DropdownComboBoxTrigger\n pt={pt}\n disabled={disabled}\n invalid={effectiveInvalid}\n selected={selected}\n label={state.showOptionsLabel}\n icon={state.expandIcon}\n />\n {showClear && selected && (\n <DropdownClearButton\n pt={pt}\n disabled={disabled}\n label={state.clearSelectionLabel}\n icon={state.clearIcon}\n onClick={multiple ? handlers.clearSelections : handlers.clearSelection}\n />\n )}\n <ComboBoxOptionList\n pt={pt}\n panelClassName={panelClassName}\n zIndex={state.resolvedPopoverZIndex}\n options={state.resolvedOptions}\n isSelected={isSelected}\n />\n </>\n );\n\n return (\n <DropdownRoot\n pt={pt}\n className={state.rootClassName}\n style={style}\n onBlur={onBlur}\n invalid={effectiveInvalid}\n disabled={disabled}\n open={isOpen}\n selected={selected}\n >\n {multiple ? (\n <ComboBox {...common} selectionMode='multiple' value={selectedKeys} onChange={handlers.selectOptions}>\n {body}\n </ComboBox>\n ) : (\n <ComboBox {...common} value={selectedKey} onChange={handlers.selectOption}>\n {body}\n </ComboBox>\n )}\n </DropdownRoot>\n );\n};\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;AAoBO,MAAM,cAAc,GAAG,CAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAA0B,KAAI;IACrF,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK;IACzI,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK;AACvD,IAAA,MAAM,YAAY,GAAG,QAAQ,GAAG,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;AACjF,IAAA,MAAM,QAAQ,GAAG,QAAQ,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,WAAW,KAAK,IAAI;IAC1E,MAAM,UAAU,GAAG,CAAC,GAAW,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,WAAW,CAAC;AACjG,IAAA,MAAM,MAAM,GAAG;QACX,YAAY,EAAE,KAAK,CAAC,SAAS;AAC7B,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,SAAS,EAAE,gBAAgB;QAC3B,IAAI;QACJ,YAAY,EAAE,KAAK,CAAC,kBAAkB;QACtC,iBAAiB,EAAE,KAAK,CAAC,uBAAuB;QAChD,kBAAkB,EAAE,KAAK,CAAC,wBAAwB;AAClD,QAAA,qBAAqB,EAAE,IAAI;AAC3B,QAAA,S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