@algolia/autocomplete-js 1.13.0 → 1.14.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/esm/autocomplete.js
CHANGED
|
@@ -280,20 +280,18 @@ export function autocomplete(options) {
|
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
function setIsModalOpen(value) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
});
|
|
283
|
+
var prevValue = props.value.core.environment.document.body.contains(dom.value.detachedOverlay);
|
|
284
|
+
if (value === prevValue) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (value) {
|
|
288
|
+
props.value.core.environment.document.body.appendChild(dom.value.detachedOverlay);
|
|
289
|
+
props.value.core.environment.document.body.classList.add('aa-Detached');
|
|
290
|
+
dom.value.input.focus();
|
|
291
|
+
} else {
|
|
292
|
+
props.value.core.environment.document.body.removeChild(dom.value.detachedOverlay);
|
|
293
|
+
props.value.core.environment.document.body.classList.remove('aa-Detached');
|
|
294
|
+
}
|
|
297
295
|
}
|
|
298
296
|
process.env.NODE_ENV !== 'production' ? warn(instancesCount === 0, "Autocomplete doesn't support multiple instances running at the same time. Make sure to destroy the previous instance before creating a new one.\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-destroy") : void 0;
|
|
299
297
|
instancesCount++;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @algolia/autocomplete-js 1.
|
|
1
|
+
/*! @algolia/autocomplete-js 1.14.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -347,7 +347,7 @@
|
|
|
347
347
|
return undefined;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
var version = '1.
|
|
350
|
+
var version = '1.14.0';
|
|
351
351
|
|
|
352
352
|
var userAgents$1 = [{
|
|
353
353
|
segment: 'autocomplete-core',
|
|
@@ -878,6 +878,7 @@
|
|
|
878
878
|
function createAlgoliaInsightsPlugin(options) {
|
|
879
879
|
var _getOptions = getOptions(options),
|
|
880
880
|
providedInsightsClient = _getOptions.insightsClient,
|
|
881
|
+
insightsInitParams = _getOptions.insightsInitParams,
|
|
881
882
|
onItemsChange = _getOptions.onItemsChange,
|
|
882
883
|
onSelectEvent = _getOptions.onSelect,
|
|
883
884
|
onActiveEvent = _getOptions.onActive,
|
|
@@ -915,6 +916,11 @@
|
|
|
915
916
|
if (!insightsClient) {
|
|
916
917
|
return {};
|
|
917
918
|
}
|
|
919
|
+
if (insightsInitParams) {
|
|
920
|
+
insightsClient('init', _objectSpread$f({
|
|
921
|
+
partial: true
|
|
922
|
+
}, insightsInitParams));
|
|
923
|
+
}
|
|
918
924
|
var insights = createSearchInsightsApi(insightsClient);
|
|
919
925
|
var previousItems = createRef([]);
|
|
920
926
|
var debouncedOnStateChange = debounce(function (_ref3) {
|
|
@@ -5093,20 +5099,18 @@
|
|
|
5093
5099
|
});
|
|
5094
5100
|
}
|
|
5095
5101
|
function setIsModalOpen(value) {
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
}
|
|
5109
|
-
});
|
|
5102
|
+
var prevValue = props.value.core.environment.document.body.contains(dom.value.detachedOverlay);
|
|
5103
|
+
if (value === prevValue) {
|
|
5104
|
+
return;
|
|
5105
|
+
}
|
|
5106
|
+
if (value) {
|
|
5107
|
+
props.value.core.environment.document.body.appendChild(dom.value.detachedOverlay);
|
|
5108
|
+
props.value.core.environment.document.body.classList.add('aa-Detached');
|
|
5109
|
+
dom.value.input.focus();
|
|
5110
|
+
} else {
|
|
5111
|
+
props.value.core.environment.document.body.removeChild(dom.value.detachedOverlay);
|
|
5112
|
+
props.value.core.environment.document.body.classList.remove('aa-Detached');
|
|
5113
|
+
}
|
|
5110
5114
|
}
|
|
5111
5115
|
"development" !== 'production' ? warn(instancesCount === 0, "Autocomplete doesn't support multiple instances running at the same time. Make sure to destroy the previous instance before creating a new one.\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-destroy") : void 0;
|
|
5112
5116
|
instancesCount++;
|