@cdek-it/widget 3.9.0 → 3.9.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/README.md +2 -3
- package/dist/cdek-widget.es.js +10 -3
- package/dist/cdek-widget.umd.js +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
[](https://www.jsdelivr.com/package/gh/cdek-it/widget)
|
|
5
5
|
[](https://github.com/cdek-it/widget/releases)
|
|
6
6
|
|
|
7
|
+
[Документация по виджету](https://github.com/cdek-it/widget/blob/main/docs/ru/INTRO.md)
|
|
7
8
|
|
|
8
|
-
[
|
|
9
|
-
|
|
10
|
-
[English version of documentation](docs/en/INTRO.md)
|
|
9
|
+
[English version of documentation](https://github.com/cdek-it/widget/blob/main/docs/en/INTRO.md)
|
package/dist/cdek-widget.es.js
CHANGED
|
@@ -18365,9 +18365,12 @@ class Widget {
|
|
|
18365
18365
|
coreStorage.togglePopup(Popup.INFO);
|
|
18366
18366
|
}
|
|
18367
18367
|
}).finally(coreStorage.unlockUi);
|
|
18368
|
-
const debouncedUpdate = debounce(async (input) => {
|
|
18368
|
+
const debouncedUpdate = debounce(async (input, forceUpdate = false) => {
|
|
18369
18369
|
try {
|
|
18370
|
-
|
|
18370
|
+
if (forceUpdate) {
|
|
18371
|
+
mapStorage.offices = [];
|
|
18372
|
+
mapStorage.offices = await this.cdekApi.getOffices();
|
|
18373
|
+
}
|
|
18371
18374
|
searchStorage.searchResults = (await this.yandexApi.geocodeString(input)).members;
|
|
18372
18375
|
searchStorage.loading = false;
|
|
18373
18376
|
} catch (e) {
|
|
@@ -18379,10 +18382,14 @@ class Widget {
|
|
|
18379
18382
|
if (mutation.storeId !== "search" || mutation.type !== "patch object") {
|
|
18380
18383
|
return;
|
|
18381
18384
|
}
|
|
18385
|
+
let forceUpdate = false;
|
|
18386
|
+
if (mutation.payload.hasOwnProperty("filters")) {
|
|
18387
|
+
forceUpdate = true;
|
|
18388
|
+
}
|
|
18382
18389
|
searchStorage.loading = true;
|
|
18383
18390
|
this.cdekApi.cancelOfficeRequest();
|
|
18384
18391
|
this.yandexApi.cancelGeocodeStringRequest();
|
|
18385
|
-
await debouncedUpdate(state.value);
|
|
18392
|
+
await debouncedUpdate(state.value, forceUpdate);
|
|
18386
18393
|
});
|
|
18387
18394
|
const debouncedSearch = debounce(async (coordinates) => {
|
|
18388
18395
|
try {
|