@neo4j-ndl/react 4.18.13 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/LICENSES.txt +54 -0
- package/lib/NOTICE.txt +8 -0
- package/lib/cjs/_common/use-semi-controlled-state.js +6 -1
- package/lib/cjs/_common/use-semi-controlled-state.js.map +1 -1
- package/lib/cjs/combobox/Combobox.js +1031 -0
- package/lib/cjs/combobox/Combobox.js.map +1 -0
- package/lib/cjs/combobox/combobox-types.js +23 -0
- package/lib/cjs/combobox/combobox-types.js.map +1 -0
- package/lib/cjs/combobox/combobox-utils.js +129 -0
- package/lib/cjs/combobox/combobox-utils.js.map +1 -0
- package/lib/cjs/combobox/index.js +26 -0
- package/lib/cjs/combobox/index.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-action-on-select.story.js +82 -0
- package/lib/cjs/combobox/stories/combobox-action-on-select.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-actions.story.js +78 -0
- package/lib/cjs/combobox/stories/combobox-actions.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-async.story.js +75 -0
- package/lib/cjs/combobox/stories/combobox-async.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-clean.story.js +38 -0
- package/lib/cjs/combobox/stories/combobox-clean.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-creatable.story.js +41 -0
- package/lib/cjs/combobox/stories/combobox-creatable.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-custom-multi.story.js +45 -0
- package/lib/cjs/combobox/stories/combobox-custom-multi.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-custom-single.story.js +44 -0
- package/lib/cjs/combobox/stories/combobox-custom-single.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js +60 -0
- package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-default.story.js +42 -0
- package/lib/cjs/combobox/stories/combobox-default.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-descriptions.story.js +45 -0
- package/lib/cjs/combobox/stories/combobox-descriptions.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-disabled.story.js +34 -0
- package/lib/cjs/combobox/stories/combobox-disabled.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-fluid.story.js +34 -0
- package/lib/cjs/combobox/stories/combobox-fluid.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-groups.story.js +49 -0
- package/lib/cjs/combobox/stories/combobox-groups.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-hidden-label.story.js +33 -0
- package/lib/cjs/combobox/stories/combobox-hidden-label.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-icons.story.js +46 -0
- package/lib/cjs/combobox/stories/combobox-icons.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-in-dialog.story.js +40 -0
- package/lib/cjs/combobox/stories/combobox-in-dialog.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js +40 -0
- package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-in-popover.story.js +36 -0
- package/lib/cjs/combobox/stories/combobox-in-popover.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-large-data-set.story.js +36 -0
- package/lib/cjs/combobox/stories/combobox-large-data-set.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-max-rows.story.js +42 -0
- package/lib/cjs/combobox/stories/combobox-max-rows.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-multi.story.js +45 -0
- package/lib/cjs/combobox/stories/combobox-multi.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-native-form.story.js +49 -0
- package/lib/cjs/combobox/stories/combobox-native-form.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-select-only.story.js +38 -0
- package/lib/cjs/combobox/stories/combobox-select-only.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-sizes.story.js +33 -0
- package/lib/cjs/combobox/stories/combobox-sizes.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js +42 -0
- package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
- package/lib/cjs/combobox/stories/combobox-validation.story.js +33 -0
- package/lib/cjs/combobox/stories/combobox-validation.story.js.map +1 -0
- package/lib/cjs/combobox/stories/index.js +133 -0
- package/lib/cjs/combobox/stories/index.js.map +1 -0
- package/lib/cjs/combobox/use-combobox-multi-value-overflow.js +173 -0
- package/lib/cjs/combobox/use-combobox-multi-value-overflow.js.map +1 -0
- package/lib/cjs/combobox/use-combobox-popover.js +80 -0
- package/lib/cjs/combobox/use-combobox-popover.js.map +1 -0
- package/lib/cjs/date-picker/DatePicker.js.map +1 -1
- package/lib/cjs/dismissible-tag/DismissibleTag.js +1 -1
- package/lib/cjs/dismissible-tag/DismissibleTag.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/select/Select.js +3 -0
- package/lib/cjs/select/Select.js.map +1 -1
- package/lib/cjs/text-area/TextArea.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/esm/_common/use-semi-controlled-state.js +6 -1
- package/lib/esm/_common/use-semi-controlled-state.js.map +1 -1
- package/lib/esm/combobox/Combobox.js +1024 -0
- package/lib/esm/combobox/Combobox.js.map +1 -0
- package/lib/esm/combobox/combobox-types.js +22 -0
- package/lib/esm/combobox/combobox-types.js.map +1 -0
- package/lib/esm/combobox/combobox-utils.js +112 -0
- package/lib/esm/combobox/combobox-utils.js.map +1 -0
- package/lib/esm/combobox/index.js +22 -0
- package/lib/esm/combobox/index.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-action-on-select.story.js +80 -0
- package/lib/esm/combobox/stories/combobox-action-on-select.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-actions.story.js +76 -0
- package/lib/esm/combobox/stories/combobox-actions.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-async.story.js +73 -0
- package/lib/esm/combobox/stories/combobox-async.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-clean.story.js +36 -0
- package/lib/esm/combobox/stories/combobox-clean.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-creatable.story.js +39 -0
- package/lib/esm/combobox/stories/combobox-creatable.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-custom-multi.story.js +43 -0
- package/lib/esm/combobox/stories/combobox-custom-multi.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-custom-single.story.js +42 -0
- package/lib/esm/combobox/stories/combobox-custom-single.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-custom-trigger.story.js +58 -0
- package/lib/esm/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-default.story.js +40 -0
- package/lib/esm/combobox/stories/combobox-default.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-descriptions.story.js +43 -0
- package/lib/esm/combobox/stories/combobox-descriptions.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-disabled.story.js +32 -0
- package/lib/esm/combobox/stories/combobox-disabled.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-fluid.story.js +32 -0
- package/lib/esm/combobox/stories/combobox-fluid.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-groups.story.js +47 -0
- package/lib/esm/combobox/stories/combobox-groups.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-hidden-label.story.js +31 -0
- package/lib/esm/combobox/stories/combobox-hidden-label.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-icons.story.js +44 -0
- package/lib/esm/combobox/stories/combobox-icons.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-in-dialog.story.js +38 -0
- package/lib/esm/combobox/stories/combobox-in-dialog.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js +38 -0
- package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-in-popover.story.js +34 -0
- package/lib/esm/combobox/stories/combobox-in-popover.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-large-data-set.story.js +34 -0
- package/lib/esm/combobox/stories/combobox-large-data-set.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-max-rows.story.js +40 -0
- package/lib/esm/combobox/stories/combobox-max-rows.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-multi.story.js +43 -0
- package/lib/esm/combobox/stories/combobox-multi.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-native-form.story.js +47 -0
- package/lib/esm/combobox/stories/combobox-native-form.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-select-only.story.js +36 -0
- package/lib/esm/combobox/stories/combobox-select-only.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-sizes.story.js +31 -0
- package/lib/esm/combobox/stories/combobox-sizes.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js +40 -0
- package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
- package/lib/esm/combobox/stories/combobox-validation.story.js +31 -0
- package/lib/esm/combobox/stories/combobox-validation.story.js.map +1 -0
- package/lib/esm/combobox/stories/index.js +100 -0
- package/lib/esm/combobox/stories/index.js.map +1 -0
- package/lib/esm/combobox/use-combobox-multi-value-overflow.js +166 -0
- package/lib/esm/combobox/use-combobox-multi-value-overflow.js.map +1 -0
- package/lib/esm/combobox/use-combobox-popover.js +77 -0
- package/lib/esm/combobox/use-combobox-popover.js.map +1 -0
- package/lib/esm/date-picker/DatePicker.js.map +1 -1
- package/lib/esm/dismissible-tag/DismissibleTag.js +1 -1
- package/lib/esm/dismissible-tag/DismissibleTag.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/select/Select.js +3 -0
- package/lib/esm/select/Select.js.map +1 -1
- package/lib/esm/text-area/TextArea.js.map +1 -1
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/types/_common/use-semi-controlled-state.d.ts +5 -1
- package/lib/types/_common/use-semi-controlled-state.d.ts.map +1 -1
- package/lib/types/combobox/Combobox.d.ts +24 -0
- package/lib/types/combobox/Combobox.d.ts.map +1 -0
- package/lib/types/combobox/combobox-types.d.ts +419 -0
- package/lib/types/combobox/combobox-types.d.ts.map +1 -0
- package/lib/types/combobox/combobox-utils.d.ts +81 -0
- package/lib/types/combobox/combobox-utils.d.ts.map +1 -0
- package/lib/types/combobox/index.d.ts +23 -0
- package/lib/types/combobox/index.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-actions.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-actions.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-async.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-async.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-clean.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-clean.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-creatable.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-creatable.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-custom-single.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-custom-single.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-default.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-default.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-descriptions.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-descriptions.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-disabled.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-disabled.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-fluid.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-fluid.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-groups.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-groups.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-icons.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-icons.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-in-popover.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-in-popover.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-max-rows.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-max-rows.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-multi.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-multi.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-native-form.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-native-form.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-select-only.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-select-only.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-sizes.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-sizes.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/combobox-validation.story.d.ts +24 -0
- package/lib/types/combobox/stories/combobox-validation.story.d.ts.map +1 -0
- package/lib/types/combobox/stories/index.d.ts +73 -0
- package/lib/types/combobox/stories/index.d.ts.map +1 -0
- package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts +76 -0
- package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts.map +1 -0
- package/lib/types/combobox/use-combobox-popover.d.ts +66 -0
- package/lib/types/combobox/use-combobox-popover.d.ts.map +1 -0
- package/lib/types/date-picker/DatePicker.d.ts.map +1 -1
- package/lib/types/dismissible-tag/DismissibleTag.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/select/Select.d.ts +3 -0
- package/lib/types/select/Select.d.ts.map +1 -1
- package/lib/types/text-input/TextInput.d.ts.map +1 -1
- package/package.json +10 -4
- package/skills/ndl-react/SKILL.md +20 -0
- package/skills/ndl-react/components/combobox.md +1487 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
type ComboboxOption = {
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
/** If the option is disabled */
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
/** A visual element to display before the label. Incompatible with multi select. */
|
|
27
|
+
leadingVisual?: React.ReactNode;
|
|
28
|
+
/** A description to display below the label. */
|
|
29
|
+
description?: string;
|
|
30
|
+
};
|
|
31
|
+
type ComboboxOptionGroup<TOption extends ComboboxOption = ComboboxOption> = {
|
|
32
|
+
label: string;
|
|
33
|
+
options: TOption[];
|
|
34
|
+
};
|
|
35
|
+
type ComboboxFilterOption<TOption extends ComboboxOption = ComboboxOption> = ((option: TOption, searchValue: string) => boolean) | false;
|
|
36
|
+
type ComboboxSize = 'small' | 'medium' | 'large';
|
|
37
|
+
/**
|
|
38
|
+
* A row at the end of the panel that acts instead of selecting.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Deliberately not a `ComboboxOption`, since an action never becomes part of
|
|
42
|
+
* the value. Use it for something that leads out of the selection, such as a
|
|
43
|
+
* link into a create flow.
|
|
44
|
+
*/
|
|
45
|
+
type ComboboxAction = {
|
|
46
|
+
/** Text of the row. */
|
|
47
|
+
label: string;
|
|
48
|
+
/**
|
|
49
|
+
* Called when the row is activated, with the current search value so the
|
|
50
|
+
* action can carry the query with it. The selection is left untouched.
|
|
51
|
+
*/
|
|
52
|
+
onSelect: (context: {
|
|
53
|
+
searchValue: string;
|
|
54
|
+
}) => void;
|
|
55
|
+
/** A description to display below the label. */
|
|
56
|
+
description?: string;
|
|
57
|
+
/** A visual element to display before the label. */
|
|
58
|
+
leadingVisual?: React.ReactNode;
|
|
59
|
+
/** If the action is disabled. */
|
|
60
|
+
isDisabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether a divider is rendered above the action, separating it from the
|
|
63
|
+
* action before it. Ignored on the first action, which already sits below
|
|
64
|
+
* the divider that separates actions from options.
|
|
65
|
+
*/
|
|
66
|
+
hasDivider?: boolean;
|
|
67
|
+
};
|
|
68
|
+
type ComboboxBaseProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
69
|
+
/** Accessible label for the combobox. Rendered above the control. */
|
|
70
|
+
label: string;
|
|
71
|
+
/**
|
|
72
|
+
* Name used to submit the selected option value through a native form.
|
|
73
|
+
* Above 300 options, only the selection is mirrored to the form, so browser
|
|
74
|
+
* autofill no longer offers the option list.
|
|
75
|
+
*/
|
|
76
|
+
name?: string;
|
|
77
|
+
/** Id of the form the combobox belongs to when it is outside that form. */
|
|
78
|
+
formId?: string;
|
|
79
|
+
/** Hint for browser autofill on the native form control. */
|
|
80
|
+
autoComplete?: string;
|
|
81
|
+
/** Ref to the focusable combobox trigger. */
|
|
82
|
+
triggerRef?: React.Ref<HTMLElement>;
|
|
83
|
+
/** Whether the label is clipped out of the layout, leaving it to screen readers only. */
|
|
84
|
+
hasVisuallyHiddenLabel?: boolean;
|
|
85
|
+
/** Assistive text below the control. Replaced by `errorText` while there is an error. */
|
|
86
|
+
helpText?: React.ReactNode;
|
|
87
|
+
/** Error message below the control. Puts the control in its error state. */
|
|
88
|
+
errorText?: React.ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* Whether a selection is required. Sets `aria-required` and, when `name` is
|
|
91
|
+
* provided, enables native form validation.
|
|
92
|
+
*/
|
|
93
|
+
isRequired?: boolean;
|
|
94
|
+
/** Whether Required or Optional is shown at the end of the label row. */
|
|
95
|
+
hasRequiredIndicator?: boolean;
|
|
96
|
+
/** The options to display in the combobox. Either an array of options or an array of option groups. */
|
|
97
|
+
options: TOption[] | ComboboxOptionGroup<TOption>[];
|
|
98
|
+
/**
|
|
99
|
+
* Whether a search input is rendered inside the panel. On by default; turn
|
|
100
|
+
* it off for a short list (roughly 10 options or fewer) where filtering
|
|
101
|
+
* adds nothing.
|
|
102
|
+
*/
|
|
103
|
+
isSearchable?: boolean;
|
|
104
|
+
/** The search value in controlled mode. */
|
|
105
|
+
searchValue?: string;
|
|
106
|
+
/** The initial search value in uncontrolled mode. */
|
|
107
|
+
defaultSearchValue?: string;
|
|
108
|
+
/** Called when the search value changes. */
|
|
109
|
+
onSearchChange?: (searchValue: string) => void;
|
|
110
|
+
/**
|
|
111
|
+
* How options are matched against the search value. Defaults to a
|
|
112
|
+
* case-insensitive match on the option label. Pass `false` to skip internal
|
|
113
|
+
* filtering when the options are already filtered, such as when searching
|
|
114
|
+
* server side.
|
|
115
|
+
*/
|
|
116
|
+
filterOption?: ComboboxFilterOption<TOption>;
|
|
117
|
+
/** Placeholder for the search input, which also names it. */
|
|
118
|
+
searchPlaceholder?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Whether the panel is waiting for options. Replaces the empty message while
|
|
121
|
+
* there are no options.
|
|
122
|
+
*/
|
|
123
|
+
isLoading?: boolean;
|
|
124
|
+
/** Text of the loading status. Defaults to `Loading...`. */
|
|
125
|
+
loadingMessage?: React.ReactNode;
|
|
126
|
+
/**
|
|
127
|
+
* Whether the search value can be turned into a new option, shown as an extra
|
|
128
|
+
* row at the end of the list. Requires `isSearchable`.
|
|
129
|
+
*/
|
|
130
|
+
isCreatable?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Called after a created option has been selected, so it can be persisted
|
|
133
|
+
* into `options`. Created options are not added to `options` by the combobox.
|
|
134
|
+
*/
|
|
135
|
+
onCreateOption?: (option: TOption) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Builds the option to create from the search value. Defaults to using the
|
|
138
|
+
* search value as both label and value, which is only enough when the options
|
|
139
|
+
* carry no fields of their own beyond `ComboboxOption`.
|
|
140
|
+
*/
|
|
141
|
+
createOption?: (searchValue: string) => TOption;
|
|
142
|
+
/** Text of the create row. Defaults to `Create "<search value>"`. */
|
|
143
|
+
formatCreateLabel?: (searchValue: string) => React.ReactNode;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the search value can become a new option. Defaults to requiring a
|
|
146
|
+
* non-blank value that does not exactly match an existing option or a
|
|
147
|
+
* currently selected one.
|
|
148
|
+
*/
|
|
149
|
+
isValidNewOption?: (searchValue: string, options: TOption[]) => boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Rows that act instead of selecting, pinned below the scrolling options
|
|
152
|
+
* after a divider so they stay visible however long the list is. They are
|
|
153
|
+
* always shown, never filtered by the search value, and never part of the
|
|
154
|
+
* selection.
|
|
155
|
+
*/
|
|
156
|
+
actions?: ComboboxAction[];
|
|
157
|
+
/** Whether the panel is controlled open. */
|
|
158
|
+
isOpen?: boolean;
|
|
159
|
+
/** Called when the panel opens or closes. */
|
|
160
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
161
|
+
/** Whether a button for clearing the selection is rendered in the trigger. */
|
|
162
|
+
isClearable?: boolean;
|
|
163
|
+
/** Text shown in the trigger while nothing is selected. */
|
|
164
|
+
placeholder?: string;
|
|
165
|
+
/** Whether the combobox is disabled. */
|
|
166
|
+
isDisabled?: boolean;
|
|
167
|
+
/** Size of the combobox control. */
|
|
168
|
+
size?: ComboboxSize;
|
|
169
|
+
/** Whether the combobox fills the available width. */
|
|
170
|
+
isFluid?: boolean;
|
|
171
|
+
/** Whether the control hugs its content without a background or resting outline. */
|
|
172
|
+
isClean?: boolean;
|
|
173
|
+
/** Whether the panel is wrapped in a floating portal. Defaults to true outside a dialog. */
|
|
174
|
+
isPortaled?: boolean;
|
|
175
|
+
/** Portal target element. Defaults to `document.body`. */
|
|
176
|
+
portalTarget?: HTMLElement | null;
|
|
177
|
+
/** Positioning strategy used by Floating UI. */
|
|
178
|
+
floatingStrategy?: 'absolute' | 'fixed';
|
|
179
|
+
/**
|
|
180
|
+
* Replaces the built-in trigger. Spread `triggerProps` onto the focusable
|
|
181
|
+
* element that should open the panel; the panel is anchored to it. The root
|
|
182
|
+
* element then lays out as `display: contents`, so the trigger is placed by
|
|
183
|
+
* whatever contains the combobox, and `isFluid`, `isClean`, `size`,
|
|
184
|
+
* `className` and `style` no longer shape it.
|
|
185
|
+
*/
|
|
186
|
+
renderTrigger?: (triggerProps: ComboboxTriggerProps, state: ComboboxTriggerState<TOption>) => React.ReactNode;
|
|
187
|
+
/**
|
|
188
|
+
* Replaces how selected values and option labels are presented, keeping the
|
|
189
|
+
* behavior and the ARIA of the combobox.
|
|
190
|
+
*/
|
|
191
|
+
components?: ComboboxComponents<TOption>;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Presentation overrides for the parts of the combobox that show an option.
|
|
195
|
+
*
|
|
196
|
+
* @remarks
|
|
197
|
+
* Each override is handed the option itself, so widening the option type is
|
|
198
|
+
* what gives them typed access to fields of your own, such as a color. Only
|
|
199
|
+
* presentation is replaced; selection, filtering, keyboard interaction and the
|
|
200
|
+
* ARIA of the surrounding elements stay with the combobox. Use `renderTrigger`
|
|
201
|
+
* instead to replace the control as a whole.
|
|
202
|
+
*/
|
|
203
|
+
type ComboboxComponents<TOption extends ComboboxOption = ComboboxOption> = {
|
|
204
|
+
/** Replaces the tag rendered per selected option in multi select. */
|
|
205
|
+
MultiValue?: React.ComponentType<ComboboxMultiValueProps<TOption>>;
|
|
206
|
+
/** Replaces the value shown in the trigger in single select. Must be non-interactive. */
|
|
207
|
+
SingleValue?: React.ComponentType<ComboboxSingleValueProps<TOption>>;
|
|
208
|
+
/** Replaces the label of an option. The selection and description chrome stays. */
|
|
209
|
+
OptionLabel?: React.ComponentType<ComboboxOptionLabelProps<TOption>>;
|
|
210
|
+
};
|
|
211
|
+
/** Props of a `MultiValue` override, rendered once per selected option. */
|
|
212
|
+
type ComboboxMultiValueProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
213
|
+
option: TOption;
|
|
214
|
+
/** Position of the option in the selection. */
|
|
215
|
+
index: number;
|
|
216
|
+
isDisabled: boolean;
|
|
217
|
+
size: ComboboxSize;
|
|
218
|
+
/**
|
|
219
|
+
* Deselects this option. Nothing calls it unless the override renders an
|
|
220
|
+
* affordance for it, which also makes focus after the removal its own
|
|
221
|
+
* responsibility.
|
|
222
|
+
*/
|
|
223
|
+
remove: () => void;
|
|
224
|
+
};
|
|
225
|
+
/** Props of a `SingleValue` override, rendered inside the trigger. */
|
|
226
|
+
type ComboboxSingleValueProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
227
|
+
option: TOption;
|
|
228
|
+
isDisabled: boolean;
|
|
229
|
+
size: ComboboxSize;
|
|
230
|
+
};
|
|
231
|
+
/** Props of an `OptionLabel` override, rendered inside each option. */
|
|
232
|
+
type ComboboxOptionLabelProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
233
|
+
option: TOption;
|
|
234
|
+
isSelected: boolean;
|
|
235
|
+
isDisabled: boolean;
|
|
236
|
+
/** Whether the option currently holds virtual focus. */
|
|
237
|
+
isFocused: boolean;
|
|
238
|
+
isMulti: boolean;
|
|
239
|
+
size: ComboboxSize;
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* Props that must be spread onto a custom trigger element. Includes the
|
|
243
|
+
* Floating UI reference props, so the element it lands on becomes the anchor
|
|
244
|
+
* the panel is positioned against.
|
|
245
|
+
*/
|
|
246
|
+
type ComboboxTriggerProps = React.HTMLAttributes<HTMLElement> & {
|
|
247
|
+
ref: React.Ref<HTMLElement>;
|
|
248
|
+
role: 'combobox';
|
|
249
|
+
'aria-haspopup': 'dialog' | 'listbox';
|
|
250
|
+
'aria-expanded': boolean;
|
|
251
|
+
'aria-disabled': boolean | undefined;
|
|
252
|
+
'aria-invalid': boolean | undefined;
|
|
253
|
+
'aria-required': boolean | undefined;
|
|
254
|
+
'aria-controls': string | undefined;
|
|
255
|
+
'aria-activedescendant': string | undefined;
|
|
256
|
+
'aria-describedby': string | undefined;
|
|
257
|
+
'aria-label'?: string;
|
|
258
|
+
'aria-labelledby'?: string;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* The label, help text, and error text of the combobox, for rendering them from
|
|
262
|
+
* a custom trigger.
|
|
263
|
+
*
|
|
264
|
+
* @remarks
|
|
265
|
+
* A custom trigger is named through `aria-label` and carries the
|
|
266
|
+
* `aria-describedby` of whichever message is currently shown, so it has to
|
|
267
|
+
* render that message with the id it is handed here.
|
|
268
|
+
*/
|
|
269
|
+
type ComboboxFieldState = {
|
|
270
|
+
label: string;
|
|
271
|
+
hasVisuallyHiddenLabel: boolean;
|
|
272
|
+
helpText?: React.ReactNode;
|
|
273
|
+
errorText?: React.ReactNode;
|
|
274
|
+
hasError: boolean;
|
|
275
|
+
isRequired: boolean;
|
|
276
|
+
hasRequiredIndicator: boolean;
|
|
277
|
+
/** Id the trigger's `aria-labelledby` points at when the label is rendered. */
|
|
278
|
+
labelId: string;
|
|
279
|
+
/** Id of the trigger, so a rendered `<label>` can point at it with `htmlFor`. */
|
|
280
|
+
triggerId: string;
|
|
281
|
+
/** Ids the trigger's `aria-describedby` points at. Only one is used at a time. */
|
|
282
|
+
helpTextId: string;
|
|
283
|
+
errorTextId: string;
|
|
284
|
+
};
|
|
285
|
+
/** Current combobox state, for rendering a custom trigger. */
|
|
286
|
+
type ComboboxTriggerState<TOption extends ComboboxOption = ComboboxOption> = {
|
|
287
|
+
isOpen: boolean;
|
|
288
|
+
isMulti: boolean;
|
|
289
|
+
isDisabled: boolean;
|
|
290
|
+
/** The selected options, as a list in both single and multi select. */
|
|
291
|
+
selectedOptions: TOption[];
|
|
292
|
+
/** Clears the whole selection. */
|
|
293
|
+
clear: () => void;
|
|
294
|
+
/** Deselects a single option. */
|
|
295
|
+
remove: (option: TOption) => void;
|
|
296
|
+
/** The label and messages of the combobox, so a custom trigger can present them. */
|
|
297
|
+
field: ComboboxFieldState;
|
|
298
|
+
};
|
|
299
|
+
type ComboboxSingleProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
300
|
+
/** The selected option in controlled mode. */
|
|
301
|
+
value?: TOption | null;
|
|
302
|
+
/** The initially selected option in uncontrolled mode. */
|
|
303
|
+
defaultValue?: TOption | null;
|
|
304
|
+
/** Called when the selected option changes. `null` when the selection is cleared. */
|
|
305
|
+
onChange?: (value: TOption | null) => void;
|
|
306
|
+
/** Whether multiple options can be selected. */
|
|
307
|
+
isMulti?: false;
|
|
308
|
+
maxRows?: never;
|
|
309
|
+
};
|
|
310
|
+
type ComboboxMultiProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
311
|
+
/** The selected options in controlled mode. */
|
|
312
|
+
value?: TOption[];
|
|
313
|
+
/** The initially selected options in uncontrolled mode. */
|
|
314
|
+
defaultValue?: TOption[];
|
|
315
|
+
/** Called when the selected options change. */
|
|
316
|
+
onChange?: (value: TOption[]) => void;
|
|
317
|
+
/** Whether multiple options can be selected. */
|
|
318
|
+
isMulti: true;
|
|
319
|
+
/**
|
|
320
|
+
* Maximum number of rows the selected tags may wrap into, a single row by
|
|
321
|
+
* default. Tags that do not fit are collapsed into a read-only counter tag,
|
|
322
|
+
* such as `+4`, at the end of the last row. Pass `null` to let the control
|
|
323
|
+
* grow with the selection.
|
|
324
|
+
*/
|
|
325
|
+
maxRows?: number | null;
|
|
326
|
+
};
|
|
327
|
+
type ComboboxProps<TOption extends ComboboxOption = ComboboxOption> = ComboboxBaseProps<TOption> & (ComboboxSingleProps<TOption> | ComboboxMultiProps<TOption>);
|
|
328
|
+
type ComboboxPanelProps = {
|
|
329
|
+
children?: React.ReactNode;
|
|
330
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
331
|
+
id?: string;
|
|
332
|
+
className?: string;
|
|
333
|
+
style?: React.CSSProperties;
|
|
334
|
+
/**
|
|
335
|
+
* Set when the panel is a dialog popup, which is the case while the search
|
|
336
|
+
* input inside it holds DOM focus.
|
|
337
|
+
*/
|
|
338
|
+
ariaLabel?: string;
|
|
339
|
+
isDialog?: boolean;
|
|
340
|
+
} & Record<string, unknown>;
|
|
341
|
+
type ComboboxControlProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
342
|
+
triggerProps: ComboboxTriggerProps;
|
|
343
|
+
state: ComboboxTriggerState<TOption>;
|
|
344
|
+
field: ComboboxFieldState;
|
|
345
|
+
placeholder: string;
|
|
346
|
+
isClearable: boolean;
|
|
347
|
+
isClean: boolean;
|
|
348
|
+
size: ComboboxSize;
|
|
349
|
+
/** Maximum number of rows the selected tags may wrap into in multi select. `null` is unlimited. */
|
|
350
|
+
maxRows?: number | null;
|
|
351
|
+
components: ComboboxComponents<TOption>;
|
|
352
|
+
/** Floating UI reference props, so clicking anywhere in the control opens the panel. */
|
|
353
|
+
referenceProps: React.HTMLAttributes<HTMLDivElement>;
|
|
354
|
+
referenceRef: React.Ref<HTMLDivElement>;
|
|
355
|
+
};
|
|
356
|
+
type ComboboxEmptyStateProps = {
|
|
357
|
+
children?: React.ReactNode;
|
|
358
|
+
};
|
|
359
|
+
type ComboboxInputProps = {
|
|
360
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
361
|
+
ariaLabel: string;
|
|
362
|
+
value: string;
|
|
363
|
+
onValueChange: (searchValue: string) => void;
|
|
364
|
+
placeholder?: string;
|
|
365
|
+
/** Id of the listbox the input controls, when the listbox is rendered. */
|
|
366
|
+
listboxId?: string;
|
|
367
|
+
/** Id of the virtually focused option, when one is active. */
|
|
368
|
+
activeOptionId?: string;
|
|
369
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
370
|
+
};
|
|
371
|
+
type ComboboxListBoxProps = {
|
|
372
|
+
ariaLabel: string;
|
|
373
|
+
children?: React.ReactNode;
|
|
374
|
+
isMulti?: boolean;
|
|
375
|
+
id?: string;
|
|
376
|
+
/** Ids of the pinned action rows the listbox owns without containing. */
|
|
377
|
+
ownsIds?: string;
|
|
378
|
+
};
|
|
379
|
+
type ComboboxGroupProps = {
|
|
380
|
+
children?: React.ReactNode;
|
|
381
|
+
label: string;
|
|
382
|
+
};
|
|
383
|
+
type ComboboxOptionProps = {
|
|
384
|
+
children?: React.ReactNode;
|
|
385
|
+
/** Left out on rows that cannot be selected, which drops `aria-selected`. */
|
|
386
|
+
isSelected?: boolean;
|
|
387
|
+
isDisabled?: boolean;
|
|
388
|
+
isFocused?: boolean;
|
|
389
|
+
/** Whether the option is the row that creates a new option from the search value. */
|
|
390
|
+
isCreate?: boolean;
|
|
391
|
+
/** Whether the option is an action row, which acts instead of selecting. */
|
|
392
|
+
isAction?: boolean;
|
|
393
|
+
id?: string;
|
|
394
|
+
onClick?: () => void;
|
|
395
|
+
/** Called when the pointer moves over the option, so hover can drive virtual focus. */
|
|
396
|
+
onHover?: () => void;
|
|
397
|
+
/**
|
|
398
|
+
* One-based position in the full list. Only set while the listbox is
|
|
399
|
+
* virtualized, where the DOM no longer holds every option.
|
|
400
|
+
*/
|
|
401
|
+
posInSet?: number;
|
|
402
|
+
/** Total options in the full list. Only set while the listbox is virtualized. */
|
|
403
|
+
setSize?: number;
|
|
404
|
+
};
|
|
405
|
+
type ComboboxOptionContentProps = {
|
|
406
|
+
label: string;
|
|
407
|
+
/**
|
|
408
|
+
* Replaces the label text. Rendered in place of the label typography rather
|
|
409
|
+
* than inside it, so it can be any element rather than inline text.
|
|
410
|
+
*/
|
|
411
|
+
customLabel?: React.ReactNode;
|
|
412
|
+
description?: string;
|
|
413
|
+
leadingVisual?: React.ReactNode;
|
|
414
|
+
isDisabled?: boolean;
|
|
415
|
+
isSelected?: boolean;
|
|
416
|
+
isMulti?: boolean;
|
|
417
|
+
};
|
|
418
|
+
export type { ComboboxProps, ComboboxAction, ComboboxComponents, ComboboxControlProps, ComboboxFieldState, ComboboxMultiValueProps, ComboboxOptionLabelProps, ComboboxSingleValueProps, ComboboxTriggerProps, ComboboxTriggerState, ComboboxPanelProps, ComboboxEmptyStateProps, ComboboxFilterOption, ComboboxInputProps, ComboboxListBoxProps, ComboboxGroupProps, ComboboxOptionProps, ComboboxOptionContentProps, ComboboxOption, ComboboxOptionGroup, ComboboxSize, };
|
|
419
|
+
//# sourceMappingURL=combobox-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-types.d.ts","sourceRoot":"","sources":["../../../src/combobox/combobox-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oFAAoF;IACpF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,mBAAmB,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,IAAI;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,KAAK,oBAAoB,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,IACrE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,GACnD,KAAK,CAAC;AAEV,KAAK,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjD;;;;;;;GAOG;AACH,KAAK,cAAc,GAAG;IACpB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrD,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,iBAAiB,CAA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AW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,YAAY,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,YAAY,GACb,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import { type ComboboxAction, type ComboboxFilterOption, type ComboboxOption, type ComboboxOptionGroup } from './combobox-types';
|
|
22
|
+
type ComboboxOptions<TOption extends ComboboxOption> = TOption[] | ComboboxOptionGroup<TOption>[];
|
|
23
|
+
declare const isOptionGroup: <TOption extends ComboboxOption>(item: TOption | ComboboxOptionGroup<TOption>) => item is ComboboxOptionGroup<TOption>;
|
|
24
|
+
/**
|
|
25
|
+
* Filters options against the search value, keeping the grouped or flat shape
|
|
26
|
+
* of the input. Groups that end up without matches are dropped.
|
|
27
|
+
*/
|
|
28
|
+
declare const filterComboboxOptions: <TOption extends ComboboxOption>(options: ComboboxOptions<TOption>, searchValue: string, filterOption?: ComboboxFilterOption<TOption>) => ComboboxOptions<TOption>;
|
|
29
|
+
/** Flattens grouped options into the visual order used for option ids. */
|
|
30
|
+
declare const flattenComboboxOptions: <TOption extends ComboboxOption>(options: (TOption | ComboboxOptionGroup<TOption>)[]) => TOption[];
|
|
31
|
+
declare const CREATE_MARKER: unique symbol;
|
|
32
|
+
type ComboboxCreateOption<TOption extends ComboboxOption> = TOption & {
|
|
33
|
+
readonly [CREATE_MARKER]: true;
|
|
34
|
+
};
|
|
35
|
+
declare const isCreateOption: <TOption extends ComboboxOption>(option: TOption) => option is ComboboxCreateOption<TOption>;
|
|
36
|
+
/** Tags an option as the create row, so activating it creates instead of selects. */
|
|
37
|
+
declare const asCreateOption: <TOption extends ComboboxOption>(option: TOption) => ComboboxCreateOption<TOption>;
|
|
38
|
+
/**
|
|
39
|
+
* The default way to build the option to create. It can only fill in the fields
|
|
40
|
+
* of `ComboboxOption`, so an option type with more required fields of its own
|
|
41
|
+
* has to supply `createOption`.
|
|
42
|
+
*/
|
|
43
|
+
declare const buildCreateOption: <TOption extends ComboboxOption>(searchValue: string) => TOption;
|
|
44
|
+
declare const formatCreateOptionLabel: (searchValue: string) => string;
|
|
45
|
+
declare const ACTION_MARKER: unique symbol;
|
|
46
|
+
type ComboboxActionRow = ComboboxOption & {
|
|
47
|
+
readonly [ACTION_MARKER]: ComboboxAction;
|
|
48
|
+
};
|
|
49
|
+
/** A row of the rendered list, which is either an option or an action. */
|
|
50
|
+
type ComboboxRow<TOption extends ComboboxOption> = TOption | ComboboxActionRow;
|
|
51
|
+
declare const isActionRow: <TOption extends ComboboxOption>(row: ComboboxRow<TOption>) => row is ComboboxActionRow;
|
|
52
|
+
/**
|
|
53
|
+
* Wraps an action as a list row. The position in `actions` gives the row a
|
|
54
|
+
* stable value, which keeps the active row from being reset every render.
|
|
55
|
+
*/
|
|
56
|
+
declare const asActionRow: (action: ComboboxAction, index: number) => ComboboxActionRow;
|
|
57
|
+
declare const getAction: (row: ComboboxActionRow) => ComboboxAction;
|
|
58
|
+
/**
|
|
59
|
+
* A created option is never added to `options`, so the current selection is
|
|
60
|
+
* checked too. Without that, retyping a created value would offer to create it
|
|
61
|
+
* again and toggle the existing selection back off in multi select.
|
|
62
|
+
*/
|
|
63
|
+
declare const isValidNewComboboxOption: (searchValue: string, options: ComboboxOption[]) => boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Disabled options are deliberately included in keyboard navigation, following
|
|
66
|
+
* the APG guidance on the focusability of disabled controls: skipping them
|
|
67
|
+
* would make them undiscoverable to screen reader users. Activation is what
|
|
68
|
+
* ignores them instead.
|
|
69
|
+
*/
|
|
70
|
+
declare const getFirstOptionIndex: (options: ComboboxOption[]) => -1 | 0;
|
|
71
|
+
declare const getLastOptionIndex: (options: ComboboxOption[]) => number;
|
|
72
|
+
/**
|
|
73
|
+
* Steps one option in the given direction, clamping at the ends of the list
|
|
74
|
+
* as the combobox pattern permits.
|
|
75
|
+
*/
|
|
76
|
+
declare const getNextOptionIndex: (options: ComboboxOption[], fromIndex: number, direction: 1 | -1) => number;
|
|
77
|
+
type ComboboxValue<TOption extends ComboboxOption> = TOption | TOption[] | null;
|
|
78
|
+
declare const getInitialValue: <TOption extends ComboboxOption>(value: ComboboxValue<TOption> | undefined, defaultValue: ComboboxValue<TOption> | undefined, isMulti: boolean) => ComboboxValue<TOption>;
|
|
79
|
+
export { asActionRow, asCreateOption, buildCreateOption, filterComboboxOptions, flattenComboboxOptions, formatCreateOptionLabel, getAction, getFirstOptionIndex, getLastOptionIndex, getNextOptionIndex, isActionRow, isCreateOption, isOptionGroup, isValidNewComboboxOption, getInitialValue, };
|
|
80
|
+
export type { ComboboxActionRow, ComboboxRow, ComboboxValue };
|
|
81
|
+
//# sourceMappingURL=combobox-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-utils.d.ts","sourceRoot":"","sources":["../../../src/combobox/combobox-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,KAAK,eAAe,CAAC,OAAO,SAAS,cAAc,IAC/C,OAAO,EAAE,GACT,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;AAEnC,QAAA,MAAM,aAAa,GAAI,OAAO,SAAS,cAAc,EACnD,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,KAC3C,IAAI,IAAI,mBAAmB,CAAC,OAAO,CAAsB,CAAC;AAK7D;;;GAGG;AACH,QAAA,MAAM,qBAAqB,GAAI,OAAO,SAAS,cAAc,EAC3D,SAAS,eAAe,CAAC,OAAO,CAAC,EACjC,aAAa,MAAM,EACnB,eAAe,oBAAoB,CAAC,OAAO,CAAC,KAC3C,eAAe,CAAC,OAAO,CAmBzB,CAAC;AAEF,0EAA0E;AAC1E,QAAA,MAAM,sBAAsB,GAAI,OAAO,SAAS,cAAc,EAC5D,SAAS,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,EAAE,KAClD,OAAO,EAC8D,CAAC;AAIzE,QAAA,MAAM,aAAa,eAAoC,CAAC;AAExD,KAAK,oBAAoB,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,GAAG;IACpE,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC;CAChC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MAAM,EACjB,WAAW,CAAC,GAAG,CAAC,CAAC,WACkD,CAAC;AAEtE,KAAK,aAAa,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;AAEhF,QAAA,MAAM,eAAe,GAAI,OAAO,SAAS,cAAc,EACrD,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,EACzC,cAAc,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,EAChD,SAAS,OAAO,KACf,aAAa,CAAC,OAAO,CAcvB,CAAC;AAEF,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,eAAe,GAChB,CAAC;AACF,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export { Combobox } from './Combobox';
|
|
22
|
+
export type { ComboboxAction, ComboboxComponents, ComboboxMultiValueProps, ComboboxOption, ComboboxOptionGroup, ComboboxOptionLabelProps, ComboboxSingleValueProps, ComboboxSize, ComboboxTriggerProps, ComboboxTriggerState, } from './combobox-types';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/combobox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
24
|
+
//# sourceMappingURL=combobox-action-on-select.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-action-on-select.story.d.ts","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-action-on-select.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAwBjD,QAAA,MAAM,SAAS,+CAkDd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
24
|
+
//# sourceMappingURL=combobox-actions.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-actions.story.d.ts","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-actions.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAiCjD,QAAA,MAAM,SAAS,+CAiCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
24
|
+
//# sourceMappingURL=combobox-async.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-async.story.d.ts","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-async.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAiBjD,QAAA,MAAM,SAAS,+CA+Dd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|