@lumx/core 4.18.0-next.1 → 4.18.0-next.3
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.
|
@@ -23,12 +23,13 @@ export declare function setup({ components: { Combobox, IconButton, Button }, de
|
|
|
23
23
|
value: string;
|
|
24
24
|
};
|
|
25
25
|
decorators: ((story: any, context: any) => any)[];
|
|
26
|
-
render: ({ value, onChange, onSelect, }: {
|
|
26
|
+
render: ({ value, onChange, onSelect, selectionMode, }: {
|
|
27
27
|
value: string;
|
|
28
28
|
onChange: (v: string) => void;
|
|
29
29
|
onSelect?: (option: {
|
|
30
30
|
value: string;
|
|
31
31
|
}) => void;
|
|
32
|
+
selectionMode?: import("./types").ComboboxInputOptions["selectionMode"];
|
|
32
33
|
}) => import("react").JSX.Element;
|
|
33
34
|
};
|
|
34
35
|
ClickAwayClosesPopup: {
|
|
@@ -45,12 +46,13 @@ export declare function setup({ components: { Combobox, IconButton, Button }, de
|
|
|
45
46
|
value: string;
|
|
46
47
|
};
|
|
47
48
|
decorators: ((story: any, context: any) => any)[];
|
|
48
|
-
render: ({ value, onChange, onSelect, }: {
|
|
49
|
+
render: ({ value, onChange, onSelect, selectionMode, }: {
|
|
49
50
|
value: string;
|
|
50
51
|
onChange: (v: string) => void;
|
|
51
52
|
onSelect?: (option: {
|
|
52
53
|
value: string;
|
|
53
54
|
}) => void;
|
|
55
|
+
selectionMode?: import("./types").ComboboxInputOptions["selectionMode"];
|
|
54
56
|
}) => import("react").JSX.Element;
|
|
55
57
|
};
|
|
56
58
|
OptionMoreInfoKeyboardHighlight: {
|
|
@@ -175,12 +177,13 @@ export declare function setup({ components: { Combobox, IconButton, Button }, de
|
|
|
175
177
|
value: string;
|
|
176
178
|
};
|
|
177
179
|
decorators: ((story: any, context: any) => any)[];
|
|
178
|
-
render: ({ value, onChange, onSelect, }: {
|
|
180
|
+
render: ({ value, onChange, onSelect, selectionMode, }: {
|
|
179
181
|
value: string;
|
|
180
182
|
onChange: (v: string) => void;
|
|
181
183
|
onSelect?: (option: {
|
|
182
184
|
value: string;
|
|
183
185
|
}) => void;
|
|
186
|
+
selectionMode?: import("./types").ComboboxInputOptions["selectionMode"];
|
|
184
187
|
}) => import("react").JSX.Element;
|
|
185
188
|
};
|
|
186
189
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComboboxInputOptions } from './types';
|
|
1
2
|
/** Combobox compound component namespace type. */
|
|
2
3
|
export interface ComboboxNamespace {
|
|
3
4
|
Provider: any;
|
|
@@ -45,12 +46,13 @@ export declare function getActiveOption(): HTMLElement | null;
|
|
|
45
46
|
* Exported so TestStories.tsx can reuse the same templates for browser-only tests.
|
|
46
47
|
*/
|
|
47
48
|
export declare function createTemplates(Combobox: ComboboxNamespace, IconButton: any): {
|
|
48
|
-
inputTemplate: ({ value, onChange, onSelect, }: {
|
|
49
|
+
inputTemplate: ({ value, onChange, onSelect, selectionMode, }: {
|
|
49
50
|
value: string;
|
|
50
51
|
onChange: (v: string) => void;
|
|
51
52
|
onSelect?: (option: {
|
|
52
53
|
value: string;
|
|
53
54
|
}) => void;
|
|
55
|
+
selectionMode?: ComboboxInputOptions["selectionMode"];
|
|
54
56
|
}) => import("react").JSX.Element;
|
|
55
57
|
manualFilterTemplate: ({ value, onChange, onSelect, }: {
|
|
56
58
|
value: string;
|
|
@@ -6,6 +6,15 @@ export interface SetupComboboxInputOptions extends ComboboxCallbacks, ComboboxIn
|
|
|
6
6
|
* (Use this in framework wrappers that maintain controlled input state, like React)
|
|
7
7
|
*/
|
|
8
8
|
onInput?(value: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Called when the input value should change as a result of option selection,
|
|
11
|
+
* with `selectionMode` already applied.
|
|
12
|
+
*
|
|
13
|
+
* - `'fill'` (default): called with the selected option value.
|
|
14
|
+
* - `'clear'`: called with an empty string.
|
|
15
|
+
* - `'keep'`: NOT called (input value unchanged).
|
|
16
|
+
*/
|
|
17
|
+
onChange?(value: string): void;
|
|
9
18
|
}
|
|
10
19
|
/**
|
|
11
20
|
* Set up a combobox with an input trigger (autocomplete/filter pattern).
|
|
@@ -69,6 +69,19 @@ export interface ComboboxInputOptions {
|
|
|
69
69
|
* @default false (true when filter is 'off')
|
|
70
70
|
*/
|
|
71
71
|
openOnFocus?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Controls what happens to the input value when an option is selected.
|
|
74
|
+
*
|
|
75
|
+
* - `'fill'` (default) — The input is updated with the selected option value via `onChange`.
|
|
76
|
+
* - `'keep'` — The input value is left unchanged; `onChange` is not called.
|
|
77
|
+
* Useful when the component manages the displayed value independently (e.g. showing
|
|
78
|
+
* an option display name rather than the raw option ID). The filter still resets.
|
|
79
|
+
* - `'clear'` — The input is cleared (empty string) via `onChange` after selection.
|
|
80
|
+
* Useful for multi-select patterns where typing starts fresh after each pick.
|
|
81
|
+
*
|
|
82
|
+
* @default 'fill'
|
|
83
|
+
*/
|
|
84
|
+
selectionMode?: 'fill' | 'keep' | 'clear';
|
|
72
85
|
}
|
|
73
86
|
/** Handle returned by `setupCombobox`. Used by framework wrappers and mode controllers. */
|
|
74
87
|
export interface ComboboxHandle {
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@floating-ui/dom": "^1.7.5",
|
|
10
|
-
"@lumx/icons": "^4.18.0-next.
|
|
10
|
+
"@lumx/icons": "^4.18.0-next.3",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.18.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "4.18.0-next.
|
|
69
|
+
"version": "4.18.0-next.3",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
72
|
"@testing-library/dom": "^10.4.1",
|