@constructor-io/constructorio-ui-autocomplete 1.17.0 → 1.18.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/dist/constructorio-ui-autocomplete-bundled.js +9 -9
- package/lib/cjs/hooks/useCioAutocomplete.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/hooks/useCioAutocomplete.js +2 -2
- package/lib/mjs/version.js +1 -1
- package/lib/types/types.d.ts +1 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -21,8 +21,8 @@ exports.defaultSections = [
|
|
|
21
21
|
},
|
|
22
22
|
];
|
|
23
23
|
const useCioAutocomplete = (options) => {
|
|
24
|
-
const { onSubmit, onChange, openOnFocus, apiKey, cioJsClient, cioJsClientOptions, placeholder = 'What can we help you find today?', sections = exports.defaultSections, zeroStateSections, autocompleteClassName = 'cio-autocomplete', advancedParameters, } = options;
|
|
25
|
-
const [query, setQuery] = (0, react_1.useState)('');
|
|
24
|
+
const { onSubmit, onChange, openOnFocus, apiKey, cioJsClient, cioJsClientOptions, placeholder = 'What can we help you find today?', sections = exports.defaultSections, zeroStateSections, autocompleteClassName = 'cio-autocomplete', advancedParameters, defaultInput, } = options;
|
|
25
|
+
const [query, setQuery] = (0, react_1.useState)(defaultInput || '');
|
|
26
26
|
const previousQuery = (0, usePrevious_1.default)(query);
|
|
27
27
|
const cioClient = (0, useCioClient_1.default)({ apiKey, cioJsClient, cioJsClientOptions });
|
|
28
28
|
// Get autocomplete sections (autocomplete + recommendations + custom)
|
package/lib/cjs/version.js
CHANGED
|
@@ -17,8 +17,8 @@ export const defaultSections = [
|
|
|
17
17
|
},
|
|
18
18
|
];
|
|
19
19
|
const useCioAutocomplete = (options) => {
|
|
20
|
-
const { onSubmit, onChange, openOnFocus, apiKey, cioJsClient, cioJsClientOptions, placeholder = 'What can we help you find today?', sections = defaultSections, zeroStateSections, autocompleteClassName = 'cio-autocomplete', advancedParameters, } = options;
|
|
21
|
-
const [query, setQuery] = useState('');
|
|
20
|
+
const { onSubmit, onChange, openOnFocus, apiKey, cioJsClient, cioJsClientOptions, placeholder = 'What can we help you find today?', sections = defaultSections, zeroStateSections, autocompleteClassName = 'cio-autocomplete', advancedParameters, defaultInput, } = options;
|
|
21
|
+
const [query, setQuery] = useState(defaultInput || '');
|
|
22
22
|
const previousQuery = usePrevious(query);
|
|
23
23
|
const cioClient = useCioClient({ apiKey, cioJsClient, cioJsClientOptions });
|
|
24
24
|
// Get autocomplete sections (autocomplete + recommendations + custom)
|
package/lib/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.
|
|
1
|
+
export default '1.18.0';
|
package/lib/types/types.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export type CioAutocompleteProps = CioClientConfig & {
|
|
|
28
28
|
zeroStateSections?: UserDefinedSection[];
|
|
29
29
|
autocompleteClassName?: string;
|
|
30
30
|
advancedParameters?: AdvancedParameters;
|
|
31
|
+
defaultInput?: string;
|
|
31
32
|
};
|
|
32
33
|
export type AutocompleteSubmitEvent = {
|
|
33
34
|
item: Item;
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.
|
|
1
|
+
declare const _default: "1.18.0";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED