vviinn-widgets 2.180.0 → 2.180.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/dist/cjs/{index-C9e2G0zC.js → index-BFM8FXu_.js} +1 -1
- package/dist/cjs/{package-BQ80cVyc.js → package-oO--ZhE-.js} +1 -1
- package/dist/cjs/{search.store-CuafCQTE.js → search.store-C6iFzVC6.js} +1 -6
- package/dist/cjs/{triggerFilter-DAtDEe_t.js → triggerFilter-B1jIVczU.js} +38 -1
- package/dist/cjs/vviinn-camera_10.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-carousel_9.cjs.entry.js +15 -7
- package/dist/cjs/vviinn-detected-object_6.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-selected-filters.cjs.entry.js +26 -7
- package/dist/cjs/vviinn-text-search.cjs.entry.js +1 -1
- package/dist/collection/components/vviinn-filters/helpers/getIntervalLabel.js +2 -1
- package/dist/collection/components/vviinn-filters/helpers/subFilterSelection.js +21 -0
- package/dist/collection/components/vviinn-filters/helpers/triggerFilter.js +14 -0
- package/dist/collection/components/vviinn-filters/vviinn-selected-filters.js +25 -6
- package/dist/collection/components/vviinn-range-filter/vviinn-range-filter.css +0 -1
- package/dist/collection/components/vviinn-range-filter/vviinn-range-filter.js +10 -2
- package/dist/collection/store/search.store.js +1 -6
- package/dist/esm/{index-DaAFwTVd.js → index-CcBKWb29.js} +1 -1
- package/dist/esm/{package-DoCrkhsM.js → package-CSctix6j.js} +1 -1
- package/dist/esm/{search.store-CdDgllEd.js → search.store-DuGAVKtX.js} +1 -6
- package/dist/esm/{triggerFilter-qSVykzV9.js → triggerFilter-CfqsUfAn.js} +38 -2
- package/dist/esm/vviinn-camera_10.entry.js +3 -3
- package/dist/esm/vviinn-carousel_9.entry.js +15 -7
- package/dist/esm/vviinn-detected-object_6.entry.js +2 -2
- package/dist/esm/vviinn-selected-filters.entry.js +26 -7
- package/dist/esm/vviinn-text-search.entry.js +1 -1
- package/dist/types/components/vviinn-filters/helpers/subFilterSelection.d.ts +2 -1
- package/dist/types/components/vviinn-filters/helpers/triggerFilter.d.ts +8 -0
- package/dist/types/components/vviinn-range-filter/vviinn-range-filter.d.ts +1 -0
- package/dist/vviinn-widgets/p-0afb9042.entry.js +1 -0
- package/{www/build/p-a4604d1f.entry.js → dist/vviinn-widgets/p-2d7e7e40.entry.js} +1 -1
- package/dist/vviinn-widgets/p-90aa0b72.entry.js +1 -0
- package/dist/vviinn-widgets/p-BiQFiZBS.js +1 -0
- package/dist/vviinn-widgets/{p-DehFpKKv.js → p-BrdY1TFD.js} +1 -1
- package/dist/vviinn-widgets/{p-DoCrkhsM.js → p-CSctix6j.js} +1 -1
- package/dist/vviinn-widgets/{p-0uvMf__4.js → p-CnAj1JHu.js} +1 -1
- package/dist/vviinn-widgets/{p-aecf5ef8.entry.js → p-a342e51e.entry.js} +2 -2
- package/dist/vviinn-widgets/{p-1882d11c.entry.js → p-fed6b735.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-0afb9042.entry.js +1 -0
- package/{dist/vviinn-widgets/p-a4604d1f.entry.js → www/build/p-2d7e7e40.entry.js} +1 -1
- package/www/build/{p-e7bfe40b.js → p-39966f1a.js} +1 -1
- package/www/build/p-90aa0b72.entry.js +1 -0
- package/www/build/p-BiQFiZBS.js +1 -0
- package/www/build/{p-DehFpKKv.js → p-BrdY1TFD.js} +1 -1
- package/www/build/{p-DoCrkhsM.js → p-CSctix6j.js} +1 -1
- package/www/build/{p-0uvMf__4.js → p-CnAj1JHu.js} +1 -1
- package/www/build/{p-aecf5ef8.entry.js → p-a342e51e.entry.js} +2 -2
- package/www/build/{p-1882d11c.entry.js → p-fed6b735.entry.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/vviinn-widgets/p-1716f021.entry.js +0 -1
- package/dist/vviinn-widgets/p-3fa50987.entry.js +0 -1
- package/dist/vviinn-widgets/p-BakNKFp9.js +0 -1
- package/www/build/p-1716f021.entry.js +0 -1
- package/www/build/p-3fa50987.entry.js +0 -1
- package/www/build/p-BakNKFp9.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var search_store = require('./search.store-
|
|
4
|
+
var search_store = require('./search.store-C6iFzVC6.js');
|
|
5
5
|
|
|
6
6
|
const PlusIcon = () => (index.h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
|
|
7
7
|
index.h("path", { d: "M14.6667 17.3333H8.00001C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H14.6667V8.00001C14.6667 7.62223 14.7944 7.30556 15.05 7.05001C15.3056 6.79445 15.6222 6.66667 16 6.66667C16.3778 6.66667 16.6944 6.79445 16.95 7.05001C17.2056 7.30556 17.3333 7.62223 17.3333 8.00001V14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H17.3333V24C17.3333 24.3778 17.2056 24.6944 16.95 24.95C16.6944 25.2056 16.3778 25.3333 16 25.3333C15.6222 25.3333 15.3056 25.2056 15.05 24.95C14.7944 24.6944 14.6667 24.3778 14.6667 24V17.3333Z", fill: "currentColor" })));
|
|
@@ -17325,12 +17325,7 @@ const makeVisualSearchRequest = async (store, searchId) => {
|
|
|
17325
17325
|
};
|
|
17326
17326
|
}
|
|
17327
17327
|
else {
|
|
17328
|
-
searchRectangle =
|
|
17329
|
-
width: 1,
|
|
17330
|
-
height: 1,
|
|
17331
|
-
left: 0,
|
|
17332
|
-
top: 0,
|
|
17333
|
-
};
|
|
17328
|
+
searchRectangle = null;
|
|
17334
17329
|
fetchDetectedObjects = true;
|
|
17335
17330
|
}
|
|
17336
17331
|
const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ requestId: searchId !== null && searchId !== void 0 ? searchId : state.visualSearchId }, addIfNotEmpty("campaign", state.campaignIdVisualSearch || state.campaignId)), addIfNotEmpty("dynamicFilters", state.requestFilters)), { query: Object.assign({}, addIfDefined("searchArea", searchRectangle)) }), addNestedIfNotEmpty("staticFilters", Object.assign({}, addIfNotEmpty("excluded", state.excluded)))), { objectDetection: {
|
|
@@ -54,7 +54,8 @@ const getIntervalLabel = (intervalFilter, fullInterval, currencySign) => {
|
|
|
54
54
|
return `${start} ${currencySign} – ${end} ${currencySign}`;
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
|
|
57
|
+
const rangeValue = `${start} – ${end}`;
|
|
58
|
+
return isPrice ? rangeValue : `${intervalFilter.label}: ${rangeValue}`;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
else {
|
|
@@ -90,11 +91,32 @@ const RenderFilterButton = ({ handleSubFilterSelection, value, label, active, se
|
|
|
90
91
|
isRemovable && index.h(FilterIconClose, null))));
|
|
91
92
|
};
|
|
92
93
|
|
|
94
|
+
const isFullRangeInterval = (selectedFilter, interval) => {
|
|
95
|
+
if (selectedFilter.type !== "interval")
|
|
96
|
+
return false;
|
|
97
|
+
const intervalFilter = selectedFilter;
|
|
98
|
+
const fullRange = intervalFilter.full;
|
|
99
|
+
return interval.start === fullRange.start && interval.end === fullRange.end;
|
|
100
|
+
};
|
|
93
101
|
const subFilterSelection = (filters, selectedFilter, filterValue) => {
|
|
94
102
|
var _a, _b, _c;
|
|
95
103
|
const selectedColumn = selectedFilter.column;
|
|
96
104
|
const value = (_b = (_a = filterValue.interval) !== null && _a !== void 0 ? _a : filterValue.value) !== null && _b !== void 0 ? _b : filterValue;
|
|
97
105
|
const index = filters.findIndex(({ column }) => column === selectedColumn);
|
|
106
|
+
if (selectedFilter.type === "interval" && filterValue.interval) {
|
|
107
|
+
const interval = filterValue.interval;
|
|
108
|
+
if (isFullRangeInterval(selectedFilter, interval)) {
|
|
109
|
+
if (index > -1) {
|
|
110
|
+
filters = [
|
|
111
|
+
...filters.filter((filter) => filter.column !== selectedColumn),
|
|
112
|
+
];
|
|
113
|
+
return { filters, action: "deselect" };
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
return { filters: [...filters], action: "deselect" };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
98
120
|
const valueIndex = (_c = filters[index]) === null || _c === void 0 ? void 0 : _c.values.findIndex((val) => val === value);
|
|
99
121
|
const action = valueIndex == -1 || index == -1 ? "select" : "deselect";
|
|
100
122
|
const pushObject = index === -1 || (selectedFilter === null || selectedFilter === void 0 ? void 0 : selectedFilter.type) === "interval"
|
|
@@ -149,6 +171,20 @@ const triggerResetFilters = ({ vviinnFilterTriggered, vviinnFiltersChanged, el,
|
|
|
149
171
|
isTriggeredByVpsWidget,
|
|
150
172
|
});
|
|
151
173
|
};
|
|
174
|
+
const triggerRemoveIntervalFilter = ({ column, requestFilters, el, isTriggeredByVpsWidget, vviinnFilterTriggered, vviinnFiltersChanged, }) => {
|
|
175
|
+
const updatedFilters = requestFilters.filter((filter) => filter.column !== column);
|
|
176
|
+
vviinnFilterTriggered.emit({
|
|
177
|
+
kind: column,
|
|
178
|
+
action: "deselect",
|
|
179
|
+
isTriggeredByVpsWidget,
|
|
180
|
+
});
|
|
181
|
+
vviinnFiltersChanged.emit({
|
|
182
|
+
filters: updatedFilters,
|
|
183
|
+
el,
|
|
184
|
+
isTriggeredByVpsWidget,
|
|
185
|
+
});
|
|
186
|
+
return updatedFilters;
|
|
187
|
+
};
|
|
152
188
|
|
|
153
189
|
exports.FilterIconClose = FilterIconClose;
|
|
154
190
|
exports.RenderFilterButton = RenderFilterButton;
|
|
@@ -158,4 +194,5 @@ exports.getRemoveFilterAriaLabel = getRemoveFilterAriaLabel;
|
|
|
158
194
|
exports.isPriceFilter = isPriceFilter;
|
|
159
195
|
exports.isSubFilterActive = isSubFilterActive;
|
|
160
196
|
exports.triggerFilter = triggerFilter;
|
|
197
|
+
exports.triggerRemoveIntervalFilter = triggerRemoveIntervalFilter;
|
|
161
198
|
exports.triggerResetFilters = triggerResetFilters;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var search_store = require('./search.store-
|
|
4
|
+
var search_store = require('./search.store-C6iFzVC6.js');
|
|
5
5
|
var customizedSlots = require('./customized-slots-7egKJD19.js');
|
|
6
|
-
var index$2 = require('./index-
|
|
6
|
+
var index$2 = require('./index-BFM8FXu_.js');
|
|
7
7
|
var index$1 = require('./index-C3G9W48a.js');
|
|
8
8
|
var i18next = require('./i18next-DkN_8H9H.js');
|
|
9
9
|
var store = require('./store-CrCuJC55.js');
|
|
10
10
|
var Rectangle = require('./Rectangle-Dki6rXFf.js');
|
|
11
11
|
var index$3 = require('./index-CtHOBs61.js');
|
|
12
|
-
var _package = require('./package-
|
|
12
|
+
var _package = require('./package-oO--ZhE-.js');
|
|
13
13
|
var resources = require('./resources-DWfxrCA4.js');
|
|
14
14
|
var index$4 = require('./index-Dob37WH6.js');
|
|
15
15
|
var constants = require('./constants-D9v4GJNd.js');
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var search_store = require('./search.store-
|
|
4
|
+
var search_store = require('./search.store-C6iFzVC6.js');
|
|
5
5
|
var i18next = require('./i18next-DkN_8H9H.js');
|
|
6
|
-
var _package = require('./package-
|
|
7
|
-
var index$1 = require('./index-
|
|
6
|
+
var _package = require('./package-oO--ZhE-.js');
|
|
7
|
+
var index$1 = require('./index-BFM8FXu_.js');
|
|
8
8
|
var constants = require('./constants-D9v4GJNd.js');
|
|
9
9
|
var customizedSlots = require('./customized-slots-7egKJD19.js');
|
|
10
10
|
var index$2 = require('./index-Dob37WH6.js');
|
|
11
|
-
var triggerFilter = require('./triggerFilter-
|
|
11
|
+
var triggerFilter = require('./triggerFilter-B1jIVczU.js');
|
|
12
12
|
var resources = require('./resources-DWfxrCA4.js');
|
|
13
13
|
var Rectangle = require('./Rectangle-Dki6rXFf.js');
|
|
14
14
|
var store = require('./store-CrCuJC55.js');
|
|
@@ -1566,7 +1566,7 @@ const VviinnProductCard = class {
|
|
|
1566
1566
|
};
|
|
1567
1567
|
VviinnProductCard.style = vviinnProductCardCss;
|
|
1568
1568
|
|
|
1569
|
-
const vviinnRangeFilterCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{display:block;margin-top:var(--spacing-300);font-family:var(--font-family, var(--font-family-base));--thumb-size:32px}.histogram{height:64px;display:flex;align-items:flex-end;gap:2px;padding:0 12px}.histogram-bar{background:var(--surface-inverse-bg-color, #262626);
|
|
1569
|
+
const vviinnRangeFilterCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{display:block;margin-top:var(--spacing-300);font-family:var(--font-family, var(--font-family-base));--thumb-size:32px}.histogram{height:64px;display:flex;align-items:flex-end;gap:2px;padding:0 12px}.histogram-bar{background:var(--surface-inverse-bg-color, #262626);border-radius:2px 2px 0px 0px}.histogram-bar.histogram-bar-inactive{background:var(--surface-bg-color-disabled)}.range_container{display:flex;flex-direction:column;width:100%;margin-top:-2px;transform:translateX(-2px)}.range_container .sliders_control{position:relative;min-height:25px}.range_container .form_control{position:relative;display:flex;justify-content:space-between;font-size:24px;color:#635a5a}.range_container input[type=\"range\"]{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:1px;width:100%;position:absolute;background:var(--color-border-02);pointer-events:none}.range_container input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none;pointer-events:all;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--color-bg-base);box-shadow:unset;border-radius:50%;border:1px solid var(--color-border-03);cursor:pointer}.range_container input[type=\"range\"]::-moz-range-thumb{-webkit-appearance:none;pointer-events:all;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--color-bg-base);box-shadow:unset;border-radius:50%;border:1px solid var(--color-border-02);cursor:pointer}.range_container input[type=\"range\"]::-webkit-slider-thumb:hover{background:#f7f7f7}.range_container #fromSlider{z-index:1;background:transparent}.label-wrapper{display:flex;justify-content:space-between;margin-top:6px}.label-wrapper .label{display:flex;padding:var(--spacing-25) var(--spacing-100);justify-content:center;align-items:center;border-radius:var(--border-radius-100);background:var(--chip-bg-color-primary);color:var(--color-text-inverse);text-align:center;font-size:var(--font-size-label);font-style:normal;font-weight:var(--font-weight-500);line-height:var(--line-height-label);letter-spacing:var(--letter-spacing-label);gap:3px}";
|
|
1570
1570
|
|
|
1571
1571
|
const MIN_BAR_HEIGHT = 3;
|
|
1572
1572
|
const MIN_SLIDER_MARGIN_PERCENT = 0.03; // 3% of total range
|
|
@@ -1642,17 +1642,25 @@ const VviinnPriceRange = class {
|
|
|
1642
1642
|
const { start, end } = item.value.interval;
|
|
1643
1643
|
return !(end < this.fromValue || start > this.toValue);
|
|
1644
1644
|
}
|
|
1645
|
+
calculateBarWidth(item) {
|
|
1646
|
+
const { start, end } = item.value.interval;
|
|
1647
|
+
const intervalWidth = end - start;
|
|
1648
|
+
const totalRange = this.maxValue - this.minValue;
|
|
1649
|
+
return (intervalWidth / totalRange) * 100;
|
|
1650
|
+
}
|
|
1645
1651
|
render() {
|
|
1646
|
-
return (index.h(index.Host, { key: '
|
|
1652
|
+
return (index.h(index.Host, { key: 'e70dfd11bca2bb3753ef3c88b6460bfcca41be4d', exportparts: index$2.priceRangeParts }, index.h("div", { key: '2ab02721ba227a68abb959efa7e55ae384f1569c', class: "histogram", part: "histogram" }, this.histogram.map((item) => {
|
|
1647
1653
|
const barHeight = this.calculateBarHeight(item.value.frequency);
|
|
1648
1654
|
const heightInPercent = barHeight && barHeight < MIN_BAR_HEIGHT
|
|
1649
1655
|
? MIN_BAR_HEIGHT
|
|
1650
1656
|
: barHeight;
|
|
1657
|
+
const widthInPercent = this.calculateBarWidth(item);
|
|
1651
1658
|
const isActive = this.isBarActive(item);
|
|
1652
1659
|
return (index.h("div", { class: `histogram-bar ${!isActive ? "histogram-bar-inactive" : ""}`, style: {
|
|
1653
1660
|
height: `${heightInPercent}%`,
|
|
1661
|
+
width: `${widthInPercent}%`,
|
|
1654
1662
|
}, part: "histogram-bar" }));
|
|
1655
|
-
})), index.h("div", { key: '
|
|
1663
|
+
})), index.h("div", { key: '6e69e71e834cf6ef138083ced092ef325dfef8bf', class: "range_container", part: "histogram-range-container" }, index.h("div", { key: 'dac685637deefecdc5945264c96706f02df00d54', class: "sliders_control", part: "histogram-sliders-control" }, index.h("input", { key: 'f2ff48176dfb5c19d97003df7977159416248429', ref: (el) => (this.fromSlider = el), id: "fromSlider", type: "range", min: this.minValue, max: this.maxValue, step: 1, value: this.fromValue, onInput: this.controlFromSlider, onChange: this.sendBackValue, part: "histogram-from-slider", "aria-label": i18next.instance.t("a11y.priceRangeMin") }), index.h("input", { key: 'aa0f62603010f52e1fa15bc2c7daa496dfa66674', ref: (el) => (this.toSlider = el), id: "toSlider", type: "range", min: this.minValue, max: this.maxValue, step: 1, value: this.toValue, onInput: this.controlToSlider, onChange: this.sendBackValue, part: "histogram-to-slider", "aria-label": i18next.instance.t("a11y.priceRangeMax") }))), index.h("div", { key: '177c4acac84be0073e7581dfe1c8c1aa55b6d146', class: "label-wrapper", part: "histogram-label-wrapper" }, index.h("div", { key: '3c88d659d7c57255c2af48cbc0cf44b5b76e4cde', class: "label", part: "histogram-label" }, this.fromValue, this.showCurrency && (index.h("span", { key: '39400393cc5505ba13f7c0f1c015e22f5b37b269', class: "histogram-currency" }, store.globalState.currencySign))), index.h("div", { key: 'c2c4966b6df6a516e9318ca3fd4bdbd468a9a3a2', class: "label", part: "histogram-label" }, this.toValue, this.showCurrency && (index.h("span", { key: 'e331a3033c6d74952edf106f614f7a9679d421df', class: "histogram-currency" }, store.globalState.currencySign))))));
|
|
1656
1664
|
}
|
|
1657
1665
|
get el() { return index.getElement(this); }
|
|
1658
1666
|
static get watchers() { return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var search_store = require('./search.store-
|
|
4
|
+
var search_store = require('./search.store-C6iFzVC6.js');
|
|
5
5
|
var i18next = require('./i18next-DkN_8H9H.js');
|
|
6
6
|
var Rectangle = require('./Rectangle-Dki6rXFf.js');
|
|
7
7
|
var customizedSlots = require('./customized-slots-7egKJD19.js');
|
|
8
|
-
var _package = require('./package-
|
|
8
|
+
var _package = require('./package-oO--ZhE-.js');
|
|
9
9
|
var index$1 = require('./index-Dob37WH6.js');
|
|
10
10
|
var constants = require('./constants-D9v4GJNd.js');
|
|
11
11
|
var index$2 = require('./index-CtHOBs61.js');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var triggerFilter = require('./triggerFilter-
|
|
5
|
-
var search_store = require('./search.store-
|
|
4
|
+
var triggerFilter = require('./triggerFilter-B1jIVczU.js');
|
|
5
|
+
var search_store = require('./search.store-C6iFzVC6.js');
|
|
6
6
|
var store = require('./store-CrCuJC55.js');
|
|
7
7
|
var i18next = require('./i18next-DkN_8H9H.js');
|
|
8
8
|
var resources = require('./resources-DWfxrCA4.js');
|
|
@@ -96,6 +96,10 @@ const VviinnSelectedFilters = class {
|
|
|
96
96
|
if (intervalLabel) {
|
|
97
97
|
this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [detail.filter.column]: intervalLabel });
|
|
98
98
|
}
|
|
99
|
+
else {
|
|
100
|
+
const _b = this.intervalCustomFilters, _c = detail.filter.column, remaining = __rest(_b, [typeof _c === "symbol" ? _c : _c + ""]);
|
|
101
|
+
this.intervalCustomFilters = remaining;
|
|
102
|
+
}
|
|
99
103
|
}
|
|
100
104
|
};
|
|
101
105
|
this.handleImageUploadStarted = ({ detail }) => {
|
|
@@ -114,6 +118,13 @@ const VviinnSelectedFilters = class {
|
|
|
114
118
|
this.skipStateChanges(isTriggeredByVpsWidget))
|
|
115
119
|
return;
|
|
116
120
|
this.requestFilters = filters;
|
|
121
|
+
const activeIntervalColumns = new Set(filters
|
|
122
|
+
.filter((f) => f.values && f.values.length > 0)
|
|
123
|
+
.map((f) => f.column));
|
|
124
|
+
const updatedIntervalFilters = Object.fromEntries(Object.entries(this.intervalCustomFilters).filter(([column]) => activeIntervalColumns.has(column)));
|
|
125
|
+
if (Object.keys(updatedIntervalFilters).length !==
|
|
126
|
+
Object.keys(this.intervalCustomFilters).length)
|
|
127
|
+
this.intervalCustomFilters = updatedIntervalFilters;
|
|
117
128
|
};
|
|
118
129
|
this.handleSelectedFiltersReset = ({ detail }) => {
|
|
119
130
|
if (this.skipStateChanges(detail.isTriggeredByVpsWidget))
|
|
@@ -136,8 +147,14 @@ const VviinnSelectedFilters = class {
|
|
|
136
147
|
this.handleIntervalButtonClick = (column) => {
|
|
137
148
|
const _a = this.intervalCustomFilters, _b = column, remaining = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
138
149
|
this.intervalCustomFilters = remaining;
|
|
139
|
-
|
|
140
|
-
|
|
150
|
+
this.requestFilters = triggerFilter.triggerRemoveIntervalFilter({
|
|
151
|
+
column,
|
|
152
|
+
requestFilters: this.requestFilters,
|
|
153
|
+
el: this.el,
|
|
154
|
+
isTriggeredByVpsWidget: this.showInWidget,
|
|
155
|
+
vviinnFilterTriggered: this.vviinnFilterTriggered,
|
|
156
|
+
vviinnFiltersChanged: this.vviinnFiltersChanged,
|
|
157
|
+
});
|
|
141
158
|
};
|
|
142
159
|
this.handleCropButtonClick = () => {
|
|
143
160
|
this.vviinnResetCropArea.emit({
|
|
@@ -208,9 +225,9 @@ const VviinnSelectedFilters = class {
|
|
|
208
225
|
}
|
|
209
226
|
render() {
|
|
210
227
|
var _a, _b;
|
|
211
|
-
return (index.h(index.Host, { key: '
|
|
228
|
+
return (index.h(index.Host, { key: 'a80383c627e3804b3c48fa252d9078f962d0fafd', class: {
|
|
212
229
|
"show-in-widget": this.showInWidget,
|
|
213
|
-
} }, index.h("div", { key: '
|
|
230
|
+
} }, index.h("div", { key: '3fd50f4c8ca3c0e69a1723a737e0e98d40aec288', ref: (el) => (this.filterAnnouncementRef = el), "aria-live": "polite", class: "sr-only" }), index.h("section", { key: 'ddecdaa3f4f601badb613bf567106fac8e00172a', "aria-label": i18next.instance.t("a11y.selectedFilters") }, index.h("ul", { key: '9466dcd95bf97430cfb3513ee27fec53784f729f', class: "selected-filters-wrapper", part: "selected-filters-list" }, RenderCustomButton({
|
|
214
231
|
label: this.textSearchCustomFilter,
|
|
215
232
|
buttonType: "text",
|
|
216
233
|
hidden: !((_a = this.textSearchCustomFilter) === null || _a === void 0 ? void 0 : _a.length),
|
|
@@ -227,7 +244,9 @@ const VviinnSelectedFilters = class {
|
|
|
227
244
|
imageSrc: this.state.croppedImageUrl,
|
|
228
245
|
onClick: this.handleCropButtonClick,
|
|
229
246
|
hidden: !this.state.searchArea,
|
|
230
|
-
}), Object.entries(this.intervalCustomFilters)
|
|
247
|
+
}), Object.entries(this.intervalCustomFilters)
|
|
248
|
+
.filter(([, label]) => label && label.trim().length > 0)
|
|
249
|
+
.map(([column, label]) => (index.h("div", { key: column }, RenderCustomButton({
|
|
231
250
|
label,
|
|
232
251
|
buttonType: "range",
|
|
233
252
|
onClick: () => this.handleIntervalButtonClick(column),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var search_store = require('./search.store-
|
|
4
|
+
var search_store = require('./search.store-C6iFzVC6.js');
|
|
5
5
|
var customizedSlots = require('./customized-slots-7egKJD19.js');
|
|
6
6
|
var i18next = require('./i18next-DkN_8H9H.js');
|
|
7
7
|
var resources = require('./resources-DWfxrCA4.js');
|
|
@@ -10,7 +10,8 @@ export const getIntervalLabel = (intervalFilter, fullInterval, currencySign) =>
|
|
|
10
10
|
return `${start} ${currencySign} – ${end} ${currencySign}`;
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
|
|
13
|
+
const rangeValue = `${start} – ${end}`;
|
|
14
|
+
return isPrice ? rangeValue : `${intervalFilter.label}: ${rangeValue}`;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
+
const isFullRangeInterval = (selectedFilter, interval) => {
|
|
2
|
+
if (selectedFilter.type !== "interval")
|
|
3
|
+
return false;
|
|
4
|
+
const intervalFilter = selectedFilter;
|
|
5
|
+
const fullRange = intervalFilter.full;
|
|
6
|
+
return interval.start === fullRange.start && interval.end === fullRange.end;
|
|
7
|
+
};
|
|
1
8
|
export const subFilterSelection = (filters, selectedFilter, filterValue) => {
|
|
2
9
|
var _a, _b, _c;
|
|
3
10
|
const selectedColumn = selectedFilter.column;
|
|
4
11
|
const value = (_b = (_a = filterValue.interval) !== null && _a !== void 0 ? _a : filterValue.value) !== null && _b !== void 0 ? _b : filterValue;
|
|
5
12
|
const index = filters.findIndex(({ column }) => column === selectedColumn);
|
|
13
|
+
if (selectedFilter.type === "interval" && filterValue.interval) {
|
|
14
|
+
const interval = filterValue.interval;
|
|
15
|
+
if (isFullRangeInterval(selectedFilter, interval)) {
|
|
16
|
+
if (index > -1) {
|
|
17
|
+
filters = [
|
|
18
|
+
...filters.filter((filter) => filter.column !== selectedColumn),
|
|
19
|
+
];
|
|
20
|
+
return { filters, action: "deselect" };
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return { filters: [...filters], action: "deselect" };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
6
27
|
const valueIndex = (_c = filters[index]) === null || _c === void 0 ? void 0 : _c.values.findIndex((val) => val === value);
|
|
7
28
|
const action = valueIndex == -1 || index == -1 ? "select" : "deselect";
|
|
8
29
|
const pushObject = index === -1 || (selectedFilter === null || selectedFilter === void 0 ? void 0 : selectedFilter.type) === "interval"
|
|
@@ -27,3 +27,17 @@ export const triggerResetFilters = ({ vviinnFilterTriggered, vviinnFiltersChange
|
|
|
27
27
|
isTriggeredByVpsWidget,
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
+
export const triggerRemoveIntervalFilter = ({ column, requestFilters, el, isTriggeredByVpsWidget, vviinnFilterTriggered, vviinnFiltersChanged, }) => {
|
|
31
|
+
const updatedFilters = requestFilters.filter((filter) => filter.column !== column);
|
|
32
|
+
vviinnFilterTriggered.emit({
|
|
33
|
+
kind: column,
|
|
34
|
+
action: "deselect",
|
|
35
|
+
isTriggeredByVpsWidget,
|
|
36
|
+
});
|
|
37
|
+
vviinnFiltersChanged.emit({
|
|
38
|
+
filters: updatedFilters,
|
|
39
|
+
el,
|
|
40
|
+
isTriggeredByVpsWidget,
|
|
41
|
+
});
|
|
42
|
+
return updatedFilters;
|
|
43
|
+
};
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
import { Host, h, } from "@stencil/core";
|
|
14
14
|
import { getIntervalLabel, isSubFilterActive, RenderCustomButton, RenderFilterButton, } from "./helpers";
|
|
15
|
-
import { triggerFilter } from "./helpers/triggerFilter";
|
|
15
|
+
import { triggerFilter, triggerRemoveIntervalFilter, } from "./helpers/triggerFilter";
|
|
16
16
|
import { useSearchStore } from "../../store/search.store";
|
|
17
17
|
import { globalState } from "../../store/store";
|
|
18
18
|
import i18next from "i18next";
|
|
@@ -72,6 +72,10 @@ export class VviinnSelectedFilters {
|
|
|
72
72
|
if (intervalLabel) {
|
|
73
73
|
this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [detail.filter.column]: intervalLabel });
|
|
74
74
|
}
|
|
75
|
+
else {
|
|
76
|
+
const _b = this.intervalCustomFilters, _c = detail.filter.column, removed = _b[_c], remaining = __rest(_b, [typeof _c === "symbol" ? _c : _c + ""]);
|
|
77
|
+
this.intervalCustomFilters = remaining;
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
80
|
};
|
|
77
81
|
this.handleImageUploadStarted = ({ detail }) => {
|
|
@@ -90,6 +94,13 @@ export class VviinnSelectedFilters {
|
|
|
90
94
|
this.skipStateChanges(isTriggeredByVpsWidget))
|
|
91
95
|
return;
|
|
92
96
|
this.requestFilters = filters;
|
|
97
|
+
const activeIntervalColumns = new Set(filters
|
|
98
|
+
.filter((f) => f.values && f.values.length > 0)
|
|
99
|
+
.map((f) => f.column));
|
|
100
|
+
const updatedIntervalFilters = Object.fromEntries(Object.entries(this.intervalCustomFilters).filter(([column]) => activeIntervalColumns.has(column)));
|
|
101
|
+
if (Object.keys(updatedIntervalFilters).length !==
|
|
102
|
+
Object.keys(this.intervalCustomFilters).length)
|
|
103
|
+
this.intervalCustomFilters = updatedIntervalFilters;
|
|
93
104
|
};
|
|
94
105
|
this.handleSelectedFiltersReset = ({ detail }) => {
|
|
95
106
|
if (this.skipStateChanges(detail.isTriggeredByVpsWidget))
|
|
@@ -112,8 +123,14 @@ export class VviinnSelectedFilters {
|
|
|
112
123
|
this.handleIntervalButtonClick = (column) => {
|
|
113
124
|
const _a = this.intervalCustomFilters, _b = column, removed = _a[_b], remaining = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
114
125
|
this.intervalCustomFilters = remaining;
|
|
115
|
-
|
|
116
|
-
|
|
126
|
+
this.requestFilters = triggerRemoveIntervalFilter({
|
|
127
|
+
column,
|
|
128
|
+
requestFilters: this.requestFilters,
|
|
129
|
+
el: this.el,
|
|
130
|
+
isTriggeredByVpsWidget: this.showInWidget,
|
|
131
|
+
vviinnFilterTriggered: this.vviinnFilterTriggered,
|
|
132
|
+
vviinnFiltersChanged: this.vviinnFiltersChanged,
|
|
133
|
+
});
|
|
117
134
|
};
|
|
118
135
|
this.handleCropButtonClick = () => {
|
|
119
136
|
this.vviinnResetCropArea.emit({
|
|
@@ -184,9 +201,9 @@ export class VviinnSelectedFilters {
|
|
|
184
201
|
}
|
|
185
202
|
render() {
|
|
186
203
|
var _a, _b;
|
|
187
|
-
return (h(Host, { key: '
|
|
204
|
+
return (h(Host, { key: 'a80383c627e3804b3c48fa252d9078f962d0fafd', class: {
|
|
188
205
|
"show-in-widget": this.showInWidget,
|
|
189
|
-
} }, h("div", { key: '
|
|
206
|
+
} }, h("div", { key: '3fd50f4c8ca3c0e69a1723a737e0e98d40aec288', ref: (el) => (this.filterAnnouncementRef = el), "aria-live": "polite", class: "sr-only" }), h("section", { key: 'ddecdaa3f4f601badb613bf567106fac8e00172a', "aria-label": i18next.t("a11y.selectedFilters") }, h("ul", { key: '9466dcd95bf97430cfb3513ee27fec53784f729f', class: "selected-filters-wrapper", part: "selected-filters-list" }, RenderCustomButton({
|
|
190
207
|
label: this.textSearchCustomFilter,
|
|
191
208
|
buttonType: "text",
|
|
192
209
|
hidden: !((_a = this.textSearchCustomFilter) === null || _a === void 0 ? void 0 : _a.length),
|
|
@@ -203,7 +220,9 @@ export class VviinnSelectedFilters {
|
|
|
203
220
|
imageSrc: this.state.croppedImageUrl,
|
|
204
221
|
onClick: this.handleCropButtonClick,
|
|
205
222
|
hidden: !this.state.searchArea,
|
|
206
|
-
}), Object.entries(this.intervalCustomFilters)
|
|
223
|
+
}), Object.entries(this.intervalCustomFilters)
|
|
224
|
+
.filter(([, label]) => label && label.trim().length > 0)
|
|
225
|
+
.map(([column, label]) => (h("div", { key: column }, RenderCustomButton({
|
|
207
226
|
label,
|
|
208
227
|
buttonType: "range",
|
|
209
228
|
onClick: () => this.handleIntervalButtonClick(column),
|
|
@@ -85,17 +85,25 @@ export class VviinnPriceRange {
|
|
|
85
85
|
const { start, end } = item.value.interval;
|
|
86
86
|
return !(end < this.fromValue || start > this.toValue);
|
|
87
87
|
}
|
|
88
|
+
calculateBarWidth(item) {
|
|
89
|
+
const { start, end } = item.value.interval;
|
|
90
|
+
const intervalWidth = end - start;
|
|
91
|
+
const totalRange = this.maxValue - this.minValue;
|
|
92
|
+
return (intervalWidth / totalRange) * 100;
|
|
93
|
+
}
|
|
88
94
|
render() {
|
|
89
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: 'e70dfd11bca2bb3753ef3c88b6460bfcca41be4d', exportparts: priceRangeParts }, h("div", { key: '2ab02721ba227a68abb959efa7e55ae384f1569c', class: "histogram", part: "histogram" }, this.histogram.map((item) => {
|
|
90
96
|
const barHeight = this.calculateBarHeight(item.value.frequency);
|
|
91
97
|
const heightInPercent = barHeight && barHeight < MIN_BAR_HEIGHT
|
|
92
98
|
? MIN_BAR_HEIGHT
|
|
93
99
|
: barHeight;
|
|
100
|
+
const widthInPercent = this.calculateBarWidth(item);
|
|
94
101
|
const isActive = this.isBarActive(item);
|
|
95
102
|
return (h("div", { class: `histogram-bar ${!isActive ? "histogram-bar-inactive" : ""}`, style: {
|
|
96
103
|
height: `${heightInPercent}%`,
|
|
104
|
+
width: `${widthInPercent}%`,
|
|
97
105
|
}, part: "histogram-bar" }));
|
|
98
|
-
})), h("div", { key: '
|
|
106
|
+
})), h("div", { key: '6e69e71e834cf6ef138083ced092ef325dfef8bf', class: "range_container", part: "histogram-range-container" }, h("div", { key: 'dac685637deefecdc5945264c96706f02df00d54', class: "sliders_control", part: "histogram-sliders-control" }, h("input", { key: 'f2ff48176dfb5c19d97003df7977159416248429', ref: (el) => (this.fromSlider = el), id: "fromSlider", type: "range", min: this.minValue, max: this.maxValue, step: 1, value: this.fromValue, onInput: this.controlFromSlider, onChange: this.sendBackValue, part: "histogram-from-slider", "aria-label": i18next.t("a11y.priceRangeMin") }), h("input", { key: 'aa0f62603010f52e1fa15bc2c7daa496dfa66674', ref: (el) => (this.toSlider = el), id: "toSlider", type: "range", min: this.minValue, max: this.maxValue, step: 1, value: this.toValue, onInput: this.controlToSlider, onChange: this.sendBackValue, part: "histogram-to-slider", "aria-label": i18next.t("a11y.priceRangeMax") }))), h("div", { key: '177c4acac84be0073e7581dfe1c8c1aa55b6d146', class: "label-wrapper", part: "histogram-label-wrapper" }, h("div", { key: '3c88d659d7c57255c2af48cbc0cf44b5b76e4cde', class: "label", part: "histogram-label" }, this.fromValue, this.showCurrency && (h("span", { key: '39400393cc5505ba13f7c0f1c015e22f5b37b269', class: "histogram-currency" }, globalState.currencySign))), h("div", { key: 'c2c4966b6df6a516e9318ca3fd4bdbd468a9a3a2', class: "label", part: "histogram-label" }, this.toValue, this.showCurrency && (h("span", { key: 'e331a3033c6d74952edf106f614f7a9679d421df', class: "histogram-currency" }, globalState.currencySign))))));
|
|
99
107
|
}
|
|
100
108
|
static get is() { return "vviinn-range-filter"; }
|
|
101
109
|
static get encapsulation() { return "shadow"; }
|
|
@@ -145,12 +145,7 @@ export const makeVisualSearchRequest = async (store, searchId) => {
|
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
else {
|
|
148
|
-
searchRectangle =
|
|
149
|
-
width: 1,
|
|
150
|
-
height: 1,
|
|
151
|
-
left: 0,
|
|
152
|
-
top: 0,
|
|
153
|
-
};
|
|
148
|
+
searchRectangle = null;
|
|
154
149
|
fetchDetectedObjects = true;
|
|
155
150
|
}
|
|
156
151
|
const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ requestId: searchId !== null && searchId !== void 0 ? searchId : state.visualSearchId }, addIfNotEmpty("campaign", state.campaignIdVisualSearch || state.campaignId)), addIfNotEmpty("dynamicFilters", state.requestFilters)), { query: Object.assign({}, addIfDefined("searchArea", searchRectangle)) }), addNestedIfNotEmpty("staticFilters", Object.assign({}, addIfNotEmpty("excluded", state.excluded)))), { objectDetection: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from './index-C5qrIvmr.js';
|
|
2
|
-
import { a as addIfNotEmpty, p as parseStringToExcluded } from './search.store-
|
|
2
|
+
import { a as addIfNotEmpty, p as parseStringToExcluded } from './search.store-DuGAVKtX.js';
|
|
3
3
|
|
|
4
4
|
const PlusIcon = () => (h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
|
|
5
5
|
h("path", { d: "M14.6667 17.3333H8.00001C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H14.6667V8.00001C14.6667 7.62223 14.7944 7.30556 15.05 7.05001C15.3056 6.79445 15.6222 6.66667 16 6.66667C16.3778 6.66667 16.6944 6.79445 16.95 7.05001C17.2056 7.30556 17.3333 7.62223 17.3333 8.00001V14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H17.3333V24C17.3333 24.3778 17.2056 24.6944 16.95 24.95C16.6944 25.2056 16.3778 25.3333 16 25.3333C15.6222 25.3333 15.3056 25.2056 15.05 24.95C14.7944 24.6944 14.6667 24.3778 14.6667 24V17.3333Z", fill: "currentColor" })));
|
|
@@ -17323,12 +17323,7 @@ const makeVisualSearchRequest = async (store, searchId) => {
|
|
|
17323
17323
|
};
|
|
17324
17324
|
}
|
|
17325
17325
|
else {
|
|
17326
|
-
searchRectangle =
|
|
17327
|
-
width: 1,
|
|
17328
|
-
height: 1,
|
|
17329
|
-
left: 0,
|
|
17330
|
-
top: 0,
|
|
17331
|
-
};
|
|
17326
|
+
searchRectangle = null;
|
|
17332
17327
|
fetchDetectedObjects = true;
|
|
17333
17328
|
}
|
|
17334
17329
|
const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ requestId: searchId !== null && searchId !== void 0 ? searchId : state.visualSearchId }, addIfNotEmpty("campaign", state.campaignIdVisualSearch || state.campaignId)), addIfNotEmpty("dynamicFilters", state.requestFilters)), { query: Object.assign({}, addIfDefined("searchArea", searchRectangle)) }), addNestedIfNotEmpty("staticFilters", Object.assign({}, addIfNotEmpty("excluded", state.excluded)))), { objectDetection: {
|
|
@@ -52,7 +52,8 @@ const getIntervalLabel = (intervalFilter, fullInterval, currencySign) => {
|
|
|
52
52
|
return `${start} ${currencySign} – ${end} ${currencySign}`;
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
|
-
|
|
55
|
+
const rangeValue = `${start} – ${end}`;
|
|
56
|
+
return isPrice ? rangeValue : `${intervalFilter.label}: ${rangeValue}`;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
@@ -88,11 +89,32 @@ const RenderFilterButton = ({ handleSubFilterSelection, value, label, active, se
|
|
|
88
89
|
isRemovable && h(FilterIconClose, null))));
|
|
89
90
|
};
|
|
90
91
|
|
|
92
|
+
const isFullRangeInterval = (selectedFilter, interval) => {
|
|
93
|
+
if (selectedFilter.type !== "interval")
|
|
94
|
+
return false;
|
|
95
|
+
const intervalFilter = selectedFilter;
|
|
96
|
+
const fullRange = intervalFilter.full;
|
|
97
|
+
return interval.start === fullRange.start && interval.end === fullRange.end;
|
|
98
|
+
};
|
|
91
99
|
const subFilterSelection = (filters, selectedFilter, filterValue) => {
|
|
92
100
|
var _a, _b, _c;
|
|
93
101
|
const selectedColumn = selectedFilter.column;
|
|
94
102
|
const value = (_b = (_a = filterValue.interval) !== null && _a !== void 0 ? _a : filterValue.value) !== null && _b !== void 0 ? _b : filterValue;
|
|
95
103
|
const index = filters.findIndex(({ column }) => column === selectedColumn);
|
|
104
|
+
if (selectedFilter.type === "interval" && filterValue.interval) {
|
|
105
|
+
const interval = filterValue.interval;
|
|
106
|
+
if (isFullRangeInterval(selectedFilter, interval)) {
|
|
107
|
+
if (index > -1) {
|
|
108
|
+
filters = [
|
|
109
|
+
...filters.filter((filter) => filter.column !== selectedColumn),
|
|
110
|
+
];
|
|
111
|
+
return { filters, action: "deselect" };
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return { filters: [...filters], action: "deselect" };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
96
118
|
const valueIndex = (_c = filters[index]) === null || _c === void 0 ? void 0 : _c.values.findIndex((val) => val === value);
|
|
97
119
|
const action = valueIndex == -1 || index == -1 ? "select" : "deselect";
|
|
98
120
|
const pushObject = index === -1 || (selectedFilter === null || selectedFilter === void 0 ? void 0 : selectedFilter.type) === "interval"
|
|
@@ -147,5 +169,19 @@ const triggerResetFilters = ({ vviinnFilterTriggered, vviinnFiltersChanged, el,
|
|
|
147
169
|
isTriggeredByVpsWidget,
|
|
148
170
|
});
|
|
149
171
|
};
|
|
172
|
+
const triggerRemoveIntervalFilter = ({ column, requestFilters, el, isTriggeredByVpsWidget, vviinnFilterTriggered, vviinnFiltersChanged, }) => {
|
|
173
|
+
const updatedFilters = requestFilters.filter((filter) => filter.column !== column);
|
|
174
|
+
vviinnFilterTriggered.emit({
|
|
175
|
+
kind: column,
|
|
176
|
+
action: "deselect",
|
|
177
|
+
isTriggeredByVpsWidget,
|
|
178
|
+
});
|
|
179
|
+
vviinnFiltersChanged.emit({
|
|
180
|
+
filters: updatedFilters,
|
|
181
|
+
el,
|
|
182
|
+
isTriggeredByVpsWidget,
|
|
183
|
+
});
|
|
184
|
+
return updatedFilters;
|
|
185
|
+
};
|
|
150
186
|
|
|
151
|
-
export { FilterIconClose as F, RenderFilterButton as R, getIntervalLabel as a,
|
|
187
|
+
export { FilterIconClose as F, RenderFilterButton as R, getIntervalLabel as a, triggerRemoveIntervalFilter as b, announceToScreenReader as c, triggerResetFilters as d, isPriceFilter as e, getRemoveFilterAriaLabel as g, isSubFilterActive as i, triggerFilter as t };
|