@depict-ai/ui 4.10.13 → 4.10.14
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/ES10/index.cjs +137 -40
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +137 -40
- package/latest/index.cjs +134 -40
- package/latest/index.d.ts +1 -1
- package/latest/index.js +134 -40
- package/package.json +4 -4
- package/server/ES10/index.cjs +76 -21
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +76 -21
- package/server/latest/index.cjs +76 -21
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +76 -21
package/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.14";
|
|
14
14
|
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
15
15
|
const signal = $8tj43$createSignal(false);
|
|
16
16
|
$8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
|
|
@@ -2720,14 +2720,42 @@ var $3e850b2f2cca761f$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<button type=bu
|
|
|
2720
2720
|
function $3e850b2f2cca761f$export$ca21a16d65b3dd8(_ref) {
|
|
2721
2721
|
let {
|
|
2722
2722
|
show_extras_: [get_show_extras, set_show_extras],
|
|
2723
|
-
i18n_: i18n_
|
|
2723
|
+
i18n_: i18n_,
|
|
2724
|
+
expanding_container_element_: expanding_container_element_
|
|
2724
2725
|
} = _ref;
|
|
2726
|
+
let button;
|
|
2725
2727
|
return (() => {
|
|
2726
2728
|
var _el$ = $8tj43$getNextElement($3e850b2f2cca761f$var$_tmpl$),
|
|
2727
2729
|
_el$3 = _el$.firstChild,
|
|
2728
2730
|
[_el$4, _co$] = $8tj43$getNextMarker(_el$3.nextSibling),
|
|
2729
2731
|
_el$2 = _el$4.nextSibling;
|
|
2730
|
-
$8tj43$addEventListener(_el$, "click", $8tj43$catchify1(
|
|
2732
|
+
$8tj43$addEventListener(_el$, "click", $8tj43$catchify1(event => {
|
|
2733
|
+
const container = expanding_container_element_;
|
|
2734
|
+
const will_expand = !get_show_extras();
|
|
2735
|
+
// A click from Enter/Space on the button reports `detail === 0`; a real pointer click reports >= 1.
|
|
2736
|
+
// Only hijack focus for keyboard activation - mouse users can see the revealed options and don't need it
|
|
2737
|
+
// (and would otherwise get the viewport scrolled and an unexpected focus ring).
|
|
2738
|
+
const keyboard_activated = event.detail === 0;
|
|
2739
|
+
const had_focus_inside = !!container && container.contains(document.activeElement);
|
|
2740
|
+
set_show_extras(will_expand);
|
|
2741
|
+
if (will_expand) {
|
|
2742
|
+
if (!keyboard_activated) return;
|
|
2743
|
+
// The container's `expand()` (run from the consumer's effect after this handler) clears `inert`/`visibility`;
|
|
2744
|
+
// focus the first revealed option on the next frame so Tab continues through the newly shown options.
|
|
2745
|
+
// `preventScroll` so moving focus never yanks the viewport down to the first checkbox.
|
|
2746
|
+
requestAnimationFrame($8tj43$catchify1(() => {
|
|
2747
|
+
var _container$querySelec;
|
|
2748
|
+
return container === null || container === void 0 ? void 0 : (_container$querySelec = container.querySelector("input:not(:disabled)")) === null || _container$querySelec === void 0 ? void 0 : _container$querySelec.focus({
|
|
2749
|
+
preventScroll: true
|
|
2750
|
+
});
|
|
2751
|
+
}));
|
|
2752
|
+
} else if (had_focus_inside)
|
|
2753
|
+
// Keep focus on the toggle when collapsing, otherwise making the container `inert` dumps focus to <body>
|
|
2754
|
+
// (Safari doesn't focus buttons on mouse click, so focus can still be inside the container here).
|
|
2755
|
+
button.focus();
|
|
2756
|
+
}), true);
|
|
2757
|
+
var _ref$ = button;
|
|
2758
|
+
typeof _ref$ === "function" ? $8tj43$use(_ref$, _el$) : button = _el$;
|
|
2731
2759
|
$8tj43$insert(_el$, $8tj43$createComponent((0, $ff3225aef892a467$export$f21ab0717a89c77f), {}), _el$4, _co$);
|
|
2732
2760
|
$8tj43$insert(_el$2, (() => {
|
|
2733
2761
|
var _c$ = $8tj43$memo(() => !!get_show_extras());
|
|
@@ -2926,7 +2954,8 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
|
|
|
2926
2954
|
$8tj43$createRenderEffect(() => {
|
|
2927
2955
|
set_view_more_button_below_group_(togglable_rest() ? $8tj43$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
|
|
2928
2956
|
show_extras_: show_extras_signal,
|
|
2929
|
-
i18n_: i18n_
|
|
2957
|
+
i18n_: i18n_,
|
|
2958
|
+
expanding_container_element_: expanding_container_els
|
|
2930
2959
|
}) : []);
|
|
2931
2960
|
});
|
|
2932
2961
|
$8tj43$onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -3903,7 +3932,8 @@ function $0ae614c5c7babb43$export$a32086fa6616eafd(_ref) {
|
|
|
3903
3932
|
$8tj43$createRenderEffect(() => {
|
|
3904
3933
|
set_view_more_button_below_group(some_top_level_are_hidden() ? $8tj43$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
|
|
3905
3934
|
show_extras_: show_extras,
|
|
3906
|
-
i18n_: i18n_
|
|
3935
|
+
i18n_: i18n_,
|
|
3936
|
+
expanding_container_element_: expanding_container_els
|
|
3907
3937
|
}) : []);
|
|
3908
3938
|
});
|
|
3909
3939
|
$8tj43$onCleanup(() => set_view_more_button_below_group());
|
|
@@ -4710,7 +4740,8 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
4710
4740
|
$8tj43$createRenderEffect(() => {
|
|
4711
4741
|
set_view_more_button_below_group_(togglable_rest() ? $8tj43$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
|
|
4712
4742
|
show_extras_: show_extras_signal,
|
|
4713
|
-
i18n_: i18n_
|
|
4743
|
+
i18n_: i18n_,
|
|
4744
|
+
expanding_container_element_: expanding_container_els
|
|
4714
4745
|
}) : []);
|
|
4715
4746
|
});
|
|
4716
4747
|
$8tj43$onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -6201,8 +6232,8 @@ var $bce10e104a1dd893$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<svg xmlns=http
|
|
|
6201
6232
|
function $bce10e104a1dd893$export$cb808a3c41736d8e() {
|
|
6202
6233
|
return $8tj43$getNextElement($bce10e104a1dd893$var$_tmpl$);
|
|
6203
6234
|
}
|
|
6204
|
-
var $7396052a1484264f$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<
|
|
6205
|
-
$7396052a1484264f$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<
|
|
6235
|
+
var $7396052a1484264f$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<section class=filters tabindex=-1><div class=body>`),
|
|
6236
|
+
$7396052a1484264f$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<section class=sorting tabindex=-1><div class=body>`),
|
|
6206
6237
|
$7396052a1484264f$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=sort-and-filter-buttons><div class=outer><div class=inner><!$><!/><!$><!/><!$><!/>`),
|
|
6207
6238
|
$7396052a1484264f$var$_tmpl$4 = /*#__PURE__*/$8tj43$template(`<span class=num-filters>`),
|
|
6208
6239
|
$7396052a1484264f$var$_tmpl$5 = /*#__PURE__*/$8tj43$template(`<div class=open-filters-button-container><!$><!/><button type=button><!$><!/><span>`),
|
|
@@ -6279,6 +6310,27 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6279
6310
|
available_sortings_: available_sortings_,
|
|
6280
6311
|
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6281
6312
|
};
|
|
6313
|
+
// Keyboard accessibility for the desktop panels (rendered after the product grid in the DOM): when the user
|
|
6314
|
+
// opens a panel we move focus into it, and restore focus to the toggle button on close. Intent is tracked with
|
|
6315
|
+
// a plain flag set in the buttons' click handlers - `filters_open`/`sorting_open` also change programmatically
|
|
6316
|
+
// (undo toast, history-state restore, SDK consumers), and those must not steal focus.
|
|
6317
|
+
let user_opened_panel = false;
|
|
6318
|
+
let filter_toggle_button;
|
|
6319
|
+
let sort_toggle_button;
|
|
6320
|
+
let current_panel;
|
|
6321
|
+
let current_panel_toggle_button;
|
|
6322
|
+
const focus_panel_when_in_dom = panel => $8tj43$catchify1(async () => {
|
|
6323
|
+
// Bounded wait: if the panel never lands in the DOM (e.g. it's superseded by a rapid re-render before
|
|
6324
|
+
// insertion), the timeout lets this promise resolve instead of keeping `panel` - and the observer
|
|
6325
|
+
// listener it registers - referenced forever.
|
|
6326
|
+
await (0, $8tj43$observer).wait_for_element(panel, 4000);
|
|
6327
|
+
if (panel.isConnected) panel.focus();
|
|
6328
|
+
})();
|
|
6329
|
+
const register_desktop_panel = (el, toggle_button, should_focus) => {
|
|
6330
|
+
current_panel = el;
|
|
6331
|
+
current_panel_toggle_button = toggle_button;
|
|
6332
|
+
if (should_focus) focus_panel_when_in_dom(el);
|
|
6333
|
+
};
|
|
6282
6334
|
const make_open_filters_button = function () {
|
|
6283
6335
|
let adhere_to_width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6284
6336
|
let is_tabbable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -6289,7 +6341,9 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6289
6341
|
search_sorting_open_: search_sorting_open_,
|
|
6290
6342
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
6291
6343
|
filter_button_width_: adhere_to_width ? filter_button_width_ : undefined,
|
|
6292
|
-
hide_button_: hide_filters
|
|
6344
|
+
hide_button_: hide_filters,
|
|
6345
|
+
on_user_open_: () => user_opened_panel = true,
|
|
6346
|
+
button_ref_: is_tabbable ? el => filter_toggle_button = el : undefined
|
|
6293
6347
|
});
|
|
6294
6348
|
};
|
|
6295
6349
|
const make_open_sorting_button = function () {
|
|
@@ -6303,7 +6357,9 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6303
6357
|
search_sorting_open_: search_sorting_open_,
|
|
6304
6358
|
available_sortings_: available_sortings_,
|
|
6305
6359
|
sort_button_width_: adhere_to_width ? sort_button_width_ : undefined,
|
|
6306
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6360
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
6361
|
+
on_user_open_: () => user_opened_panel = true,
|
|
6362
|
+
button_ref_: is_tabbable ? el => sort_toggle_button = el : undefined
|
|
6307
6363
|
});
|
|
6308
6364
|
};
|
|
6309
6365
|
let open_modal_;
|
|
@@ -6323,10 +6379,47 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6323
6379
|
grid_is_in_original_state = true;
|
|
6324
6380
|
}
|
|
6325
6381
|
});
|
|
6382
|
+
// Restore focus to the relevant toggle button when a desktop panel is torn down while focus is still inside it.
|
|
6383
|
+
const restore_focus_to_toggle_on_close = () => {
|
|
6384
|
+
const button_to_restore = current_panel_toggle_button;
|
|
6385
|
+
const focus_was_in_panel = !!current_panel && current_panel.contains(document.activeElement);
|
|
6386
|
+
current_panel = undefined;
|
|
6387
|
+
current_panel_toggle_button = undefined;
|
|
6388
|
+
if (focus_was_in_panel) button_to_restore === null || button_to_restore === void 0 || button_to_restore.focus();
|
|
6389
|
+
};
|
|
6390
|
+
// `<section>` + `aria-label` so the panel announces itself ("Filters"/"Sort") when we move focus to it; the bare
|
|
6391
|
+
// tabindex=-1 container would otherwise give screen readers nothing to read on focus. A semantic <section> avoids
|
|
6392
|
+
// an ARIA role and the UA styling pitfalls of <fieldset>; the existing CSS targets the `.filters`/`.sorting` class.
|
|
6393
|
+
const FiltersPanel = should_focus => $8tj43$createComponent((0, $8tj43$Show), {
|
|
6394
|
+
get when() {
|
|
6395
|
+
return !hide_filters();
|
|
6396
|
+
},
|
|
6397
|
+
get children() {
|
|
6398
|
+
var _el$ = $8tj43$getNextElement($7396052a1484264f$var$_tmpl$),
|
|
6399
|
+
_el$2 = _el$.firstChild;
|
|
6400
|
+
$8tj43$use(el => register_desktop_panel(el, filter_toggle_button, should_focus), _el$);
|
|
6401
|
+
$8tj43$insert(_el$2, $8tj43$createComponent((0, $f6b0500577e1b210$export$3f1a388cc0d8fed7), filter_options));
|
|
6402
|
+
$8tj43$effect(() => $8tj43$setAttribute(_el$, "aria-label", i18n_.filters_()));
|
|
6403
|
+
return _el$;
|
|
6404
|
+
}
|
|
6405
|
+
});
|
|
6406
|
+
const SortingPanel = should_focus => (() => {
|
|
6407
|
+
var _el$3 = $8tj43$getNextElement($7396052a1484264f$var$_tmpl$2),
|
|
6408
|
+
_el$4 = _el$3.firstChild;
|
|
6409
|
+
$8tj43$use(el => register_desktop_panel(el, sort_toggle_button, should_focus), _el$3);
|
|
6410
|
+
$8tj43$insert(_el$4, $8tj43$createComponent((0, $cfdbd124dd09d713$export$1f1775a58da589b5), sorting_options));
|
|
6411
|
+
$8tj43$effect(() => $8tj43$setAttribute(_el$3, "aria-label", i18n_.sorting_text_()));
|
|
6412
|
+
return _el$3;
|
|
6413
|
+
})();
|
|
6326
6414
|
$8tj43$createEffect(() => {
|
|
6415
|
+
// Consume the user-intent flag once per run, in every branch, so a stale flag can't leak into a later
|
|
6416
|
+
// resize-triggered re-render and steal focus.
|
|
6417
|
+
const should_focus_panel = user_opened_panel;
|
|
6418
|
+
user_opened_panel = false;
|
|
6327
6419
|
if (!filters_open() && !sorting_open()) {
|
|
6328
6420
|
var _close_modal_;
|
|
6329
6421
|
(_close_modal_ = close_modal_) === null || _close_modal_ === void 0 || _close_modal_();
|
|
6422
|
+
restore_focus_to_toggle_on_close();
|
|
6330
6423
|
set_extra_els_in_results_container_("");
|
|
6331
6424
|
} else if (isSmall()()) {
|
|
6332
6425
|
var _open_modal_;
|
|
@@ -6336,27 +6429,15 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6336
6429
|
set_sorting_open(false);
|
|
6337
6430
|
return;
|
|
6338
6431
|
}
|
|
6432
|
+
// The modal manages its own focus; just drop the desktop panel reference.
|
|
6433
|
+
current_panel = undefined;
|
|
6434
|
+
current_panel_toggle_button = undefined;
|
|
6339
6435
|
(_open_modal_ = open_modal_) === null || _open_modal_ === void 0 || _open_modal_();
|
|
6340
6436
|
set_extra_els_in_results_container_("");
|
|
6341
6437
|
} else {
|
|
6342
6438
|
var _close_modal_2;
|
|
6343
6439
|
(_close_modal_2 = close_modal_) === null || _close_modal_2 === void 0 || _close_modal_2();
|
|
6344
|
-
if (filters_open()) set_extra_els_in_results_container_(() =>
|
|
6345
|
-
get when() {
|
|
6346
|
-
return !hide_filters();
|
|
6347
|
-
},
|
|
6348
|
-
get children() {
|
|
6349
|
-
var _el$ = $8tj43$getNextElement($7396052a1484264f$var$_tmpl$),
|
|
6350
|
-
_el$2 = _el$.firstChild;
|
|
6351
|
-
$8tj43$insert(_el$2, $8tj43$createComponent((0, $f6b0500577e1b210$export$3f1a388cc0d8fed7), filter_options));
|
|
6352
|
-
return _el$;
|
|
6353
|
-
}
|
|
6354
|
-
}));else set_extra_els_in_results_container_((() => {
|
|
6355
|
-
var _el$3 = $8tj43$getNextElement($7396052a1484264f$var$_tmpl$2),
|
|
6356
|
-
_el$4 = _el$3.firstChild;
|
|
6357
|
-
$8tj43$insert(_el$4, $8tj43$createComponent((0, $cfdbd124dd09d713$export$1f1775a58da589b5), sorting_options));
|
|
6358
|
-
return _el$3;
|
|
6359
|
-
})());
|
|
6440
|
+
if (filters_open()) set_extra_els_in_results_container_(() => FiltersPanel(should_focus_panel));else set_extra_els_in_results_container_(SortingPanel(should_focus_panel));
|
|
6360
6441
|
}
|
|
6361
6442
|
});
|
|
6362
6443
|
$8tj43$catchify1(async () => {
|
|
@@ -6421,7 +6502,9 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref3) {
|
|
|
6421
6502
|
filter_button_width_: filter_button_width_,
|
|
6422
6503
|
tabindex_: tabindex_,
|
|
6423
6504
|
number_of_rendered_selected_filters_items_: [num_selected_filters],
|
|
6424
|
-
hide_button_: hide_button_
|
|
6505
|
+
hide_button_: hide_button_,
|
|
6506
|
+
on_user_open_: on_user_open_,
|
|
6507
|
+
button_ref_: button_ref_
|
|
6425
6508
|
} = _ref3;
|
|
6426
6509
|
const filters_closed = $8tj43$createMemo(() => !search_filters_open_[0]());
|
|
6427
6510
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
@@ -6449,9 +6532,12 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref3) {
|
|
|
6449
6532
|
search_filters_open_[1](false);
|
|
6450
6533
|
return;
|
|
6451
6534
|
}
|
|
6535
|
+
on_user_open_ === null || on_user_open_ === void 0 || on_user_open_();
|
|
6452
6536
|
search_filters_open_[1](true);
|
|
6453
6537
|
search_sorting_open_[1](false);
|
|
6454
6538
|
})), true);
|
|
6539
|
+
var _ref$2 = button_ref_;
|
|
6540
|
+
typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$16) : button_ref_ = _el$16;
|
|
6455
6541
|
$8tj43$setAttribute(_el$16, "tabindex", tabindex_);
|
|
6456
6542
|
$8tj43$className(_el$16, "filter toggle-button major-minor-transition" + ((0, $8tj43$isServer) ? " minor" : ""));
|
|
6457
6543
|
$8tj43$insert(_el$16, $8tj43$createComponent((0, $8tj43$Show), {
|
|
@@ -6473,21 +6559,24 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref3) {
|
|
|
6473
6559
|
_v$2 = !filters_closed(),
|
|
6474
6560
|
_v$3 = !!filters_closed(),
|
|
6475
6561
|
_v$4 = (filters_closed() ? i18n_.open_filters_ : i18n_.close_filters_)(),
|
|
6476
|
-
_v$5 =
|
|
6562
|
+
_v$5 = !filters_closed(),
|
|
6563
|
+
_v$6 = filter_button_width_ !== null && filter_button_width_ !== void 0 && filter_button_width_() ? {
|
|
6477
6564
|
width: filter_button_width_() + "px"
|
|
6478
6565
|
} : {};
|
|
6479
6566
|
_p$.e = $8tj43$style(_el$14, _v$, _p$.e);
|
|
6480
6567
|
_v$2 !== _p$.t && _el$16.classList.toggle("major", _p$.t = _v$2);
|
|
6481
6568
|
_v$3 !== _p$.a && _el$16.classList.toggle("minor", _p$.a = _v$3);
|
|
6482
6569
|
_v$4 !== _p$.o && $8tj43$setAttribute(_el$16, "aria-label", _p$.o = _v$4);
|
|
6483
|
-
_p$.i
|
|
6570
|
+
_v$5 !== _p$.i && $8tj43$setAttribute(_el$16, "aria-expanded", _p$.i = _v$5);
|
|
6571
|
+
_p$.n = $8tj43$style(_el$16, _v$6, _p$.n);
|
|
6484
6572
|
return _p$;
|
|
6485
6573
|
}, {
|
|
6486
6574
|
e: undefined,
|
|
6487
6575
|
t: undefined,
|
|
6488
6576
|
a: undefined,
|
|
6489
6577
|
o: undefined,
|
|
6490
|
-
i: undefined
|
|
6578
|
+
i: undefined,
|
|
6579
|
+
n: undefined
|
|
6491
6580
|
});
|
|
6492
6581
|
$8tj43$runHydrationEvents();
|
|
6493
6582
|
return _el$14;
|
|
@@ -6502,7 +6591,9 @@ function $7396052a1484264f$var$OpenSortingButton(_ref4) {
|
|
|
6502
6591
|
search_sorting_open_: search_sorting_open_,
|
|
6503
6592
|
sort_button_width_: sort_button_width_,
|
|
6504
6593
|
tabindex_: tabindex_,
|
|
6505
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6594
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
6595
|
+
on_user_open_: on_user_open_,
|
|
6596
|
+
button_ref_: button_ref_
|
|
6506
6597
|
} = _ref4;
|
|
6507
6598
|
const sorting_closed = $8tj43$createMemo(() => !search_sorting_open_[0]());
|
|
6508
6599
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
@@ -6516,9 +6607,12 @@ function $7396052a1484264f$var$OpenSortingButton(_ref4) {
|
|
|
6516
6607
|
search_sorting_open_[1](false);
|
|
6517
6608
|
return;
|
|
6518
6609
|
}
|
|
6610
|
+
on_user_open_ === null || on_user_open_ === void 0 || on_user_open_();
|
|
6519
6611
|
search_filters_open_[1](false);
|
|
6520
6612
|
search_sorting_open_[1](true);
|
|
6521
6613
|
})), true);
|
|
6614
|
+
var _ref$3 = button_ref_;
|
|
6615
|
+
typeof _ref$3 === "function" ? $8tj43$use(_ref$3, _el$22) : button_ref_ = _el$22;
|
|
6522
6616
|
$8tj43$setAttribute(_el$22, "tabindex", tabindex_);
|
|
6523
6617
|
$8tj43$insert(_el$23, (() => {
|
|
6524
6618
|
var _c$ = $8tj43$memo(() => !!sorting_closed());
|
|
@@ -6547,22 +6641,25 @@ function $7396052a1484264f$var$OpenSortingButton(_ref4) {
|
|
|
6547
6641
|
}
|
|
6548
6642
|
}), _el$25, _co$6);
|
|
6549
6643
|
$8tj43$effect(_p$ => {
|
|
6550
|
-
var _v$
|
|
6551
|
-
_v$
|
|
6552
|
-
_v$
|
|
6553
|
-
_v$
|
|
6644
|
+
var _v$7 = !sorting_closed(),
|
|
6645
|
+
_v$8 = !!sorting_closed(),
|
|
6646
|
+
_v$9 = (sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(),
|
|
6647
|
+
_v$10 = !sorting_closed(),
|
|
6648
|
+
_v$11 = sort_button_width_ !== null && sort_button_width_ !== void 0 && sort_button_width_() ? {
|
|
6554
6649
|
width: sort_button_width_() + "px"
|
|
6555
6650
|
} : {};
|
|
6556
|
-
_v$
|
|
6557
|
-
_v$
|
|
6558
|
-
_v$
|
|
6559
|
-
_p$.o
|
|
6651
|
+
_v$7 !== _p$.e && _el$22.classList.toggle("major", _p$.e = _v$7);
|
|
6652
|
+
_v$8 !== _p$.t && _el$22.classList.toggle("minor", _p$.t = _v$8);
|
|
6653
|
+
_v$9 !== _p$.a && $8tj43$setAttribute(_el$22, "aria-label", _p$.a = _v$9);
|
|
6654
|
+
_v$10 !== _p$.o && $8tj43$setAttribute(_el$22, "aria-expanded", _p$.o = _v$10);
|
|
6655
|
+
_p$.i = $8tj43$style(_el$22, _v$11, _p$.i);
|
|
6560
6656
|
return _p$;
|
|
6561
6657
|
}, {
|
|
6562
6658
|
e: undefined,
|
|
6563
6659
|
t: undefined,
|
|
6564
6660
|
a: undefined,
|
|
6565
|
-
o: undefined
|
|
6661
|
+
o: undefined,
|
|
6662
|
+
i: undefined
|
|
6566
6663
|
});
|
|
6567
6664
|
$8tj43$runHydrationEvents();
|
|
6568
6665
|
return _el$22;
|
package/latest/index.cjs
CHANGED
|
@@ -109,7 +109,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
109
109
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
110
110
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
111
111
|
/*! Depict.ai search and product listing SDK */
|
|
112
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.
|
|
112
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.14";
|
|
113
113
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
114
114
|
const signal = $gVhhF$solidjs.createSignal(false);
|
|
115
115
|
$gVhhF$solidjs.onCleanup($gVhhF$depictaiutilishared.javascript_media_query(media_query, ({
|
|
@@ -2701,14 +2701,39 @@ function $cc43b6428000c4bf$export$f21ab0717a89c77f(props) {
|
|
|
2701
2701
|
var $0fe1e7efdf4200d6$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<button type=button class=expand-filter><!$><!/><span>`);
|
|
2702
2702
|
function $0fe1e7efdf4200d6$export$ca21a16d65b3dd8({
|
|
2703
2703
|
show_extras_: [get_show_extras, set_show_extras],
|
|
2704
|
-
i18n_: i18n_
|
|
2704
|
+
i18n_: i18n_,
|
|
2705
|
+
expanding_container_element_: expanding_container_element_
|
|
2705
2706
|
}) {
|
|
2707
|
+
let button;
|
|
2706
2708
|
return (() => {
|
|
2707
2709
|
var _el$ = $gVhhF$solidjsweb.getNextElement($0fe1e7efdf4200d6$var$_tmpl$),
|
|
2708
2710
|
_el$3 = _el$.firstChild,
|
|
2709
2711
|
[_el$4, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$3.nextSibling),
|
|
2710
2712
|
_el$2 = _el$4.nextSibling;
|
|
2711
|
-
$gVhhF$solidjsweb.addEventListener(_el$, "click", $gVhhF$depictaiutilishared.catchify(
|
|
2713
|
+
$gVhhF$solidjsweb.addEventListener(_el$, "click", $gVhhF$depictaiutilishared.catchify(event => {
|
|
2714
|
+
const container = expanding_container_element_;
|
|
2715
|
+
const will_expand = !get_show_extras();
|
|
2716
|
+
// A click from Enter/Space on the button reports `detail === 0`; a real pointer click reports >= 1.
|
|
2717
|
+
// Only hijack focus for keyboard activation - mouse users can see the revealed options and don't need it
|
|
2718
|
+
// (and would otherwise get the viewport scrolled and an unexpected focus ring).
|
|
2719
|
+
const keyboard_activated = event.detail === 0;
|
|
2720
|
+
const had_focus_inside = !!container && container.contains(document.activeElement);
|
|
2721
|
+
set_show_extras(will_expand);
|
|
2722
|
+
if (will_expand) {
|
|
2723
|
+
if (!keyboard_activated) return;
|
|
2724
|
+
// The container's `expand()` (run from the consumer's effect after this handler) clears `inert`/`visibility`;
|
|
2725
|
+
// focus the first revealed option on the next frame so Tab continues through the newly shown options.
|
|
2726
|
+
// `preventScroll` so moving focus never yanks the viewport down to the first checkbox.
|
|
2727
|
+
requestAnimationFrame($gVhhF$depictaiutilishared.catchify(() => container?.querySelector("input:not(:disabled)")?.focus({
|
|
2728
|
+
preventScroll: true
|
|
2729
|
+
})));
|
|
2730
|
+
} else if (had_focus_inside)
|
|
2731
|
+
// Keep focus on the toggle when collapsing, otherwise making the container `inert` dumps focus to <body>
|
|
2732
|
+
// (Safari doesn't focus buttons on mouse click, so focus can still be inside the container here).
|
|
2733
|
+
button.focus();
|
|
2734
|
+
}), true);
|
|
2735
|
+
var _ref$ = button;
|
|
2736
|
+
typeof _ref$ === "function" ? $gVhhF$solidjsweb.use(_ref$, _el$) : button = _el$;
|
|
2712
2737
|
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $cc43b6428000c4bf$export$f21ab0717a89c77f), {}), _el$4, _co$);
|
|
2713
2738
|
$gVhhF$solidjsweb.insert(_el$2, (() => {
|
|
2714
2739
|
var _c$ = $gVhhF$solidjsweb.memo(() => !!get_show_extras());
|
|
@@ -2898,7 +2923,8 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({
|
|
|
2898
2923
|
$gVhhF$solidjs.createRenderEffect(() => {
|
|
2899
2924
|
set_view_more_button_below_group_(togglable_rest() ? $gVhhF$solidjsweb.createComponent((0, $0fe1e7efdf4200d6$export$ca21a16d65b3dd8), {
|
|
2900
2925
|
show_extras_: show_extras_signal,
|
|
2901
|
-
i18n_: i18n_
|
|
2926
|
+
i18n_: i18n_,
|
|
2927
|
+
expanding_container_element_: expanding_container_els
|
|
2902
2928
|
}) : []);
|
|
2903
2929
|
});
|
|
2904
2930
|
$gVhhF$solidjs.onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -3827,7 +3853,8 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({
|
|
|
3827
3853
|
$gVhhF$solidjs.createRenderEffect(() => {
|
|
3828
3854
|
set_view_more_button_below_group(some_top_level_are_hidden() ? $gVhhF$solidjsweb.createComponent((0, $0fe1e7efdf4200d6$export$ca21a16d65b3dd8), {
|
|
3829
3855
|
show_extras_: show_extras,
|
|
3830
|
-
i18n_: i18n_
|
|
3856
|
+
i18n_: i18n_,
|
|
3857
|
+
expanding_container_element_: expanding_container_els
|
|
3831
3858
|
}) : []);
|
|
3832
3859
|
});
|
|
3833
3860
|
$gVhhF$solidjs.onCleanup(() => set_view_more_button_below_group());
|
|
@@ -4568,7 +4595,8 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
4568
4595
|
$gVhhF$solidjs.createRenderEffect(() => {
|
|
4569
4596
|
set_view_more_button_below_group_(togglable_rest() ? $gVhhF$solidjsweb.createComponent((0, $0fe1e7efdf4200d6$export$ca21a16d65b3dd8), {
|
|
4570
4597
|
show_extras_: show_extras_signal,
|
|
4571
|
-
i18n_: i18n_
|
|
4598
|
+
i18n_: i18n_,
|
|
4599
|
+
expanding_container_element_: expanding_container_els
|
|
4572
4600
|
}) : []);
|
|
4573
4601
|
});
|
|
4574
4602
|
$gVhhF$solidjs.onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -5961,8 +5989,8 @@ var $f49857214f7675b1$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<svg
|
|
|
5961
5989
|
function $f49857214f7675b1$export$cb808a3c41736d8e() {
|
|
5962
5990
|
return $gVhhF$solidjsweb.getNextElement($f49857214f7675b1$var$_tmpl$);
|
|
5963
5991
|
}
|
|
5964
|
-
var $f8f64d05c525825b$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<
|
|
5965
|
-
$f8f64d05c525825b$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<
|
|
5992
|
+
var $f8f64d05c525825b$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<section class=filters tabindex=-1><div class=body>`),
|
|
5993
|
+
$f8f64d05c525825b$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<section class=sorting tabindex=-1><div class=body>`),
|
|
5966
5994
|
$f8f64d05c525825b$var$_tmpl$3 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=sort-and-filter-buttons><div class=outer><div class=inner><!$><!/><!$><!/><!$><!/>`),
|
|
5967
5995
|
$f8f64d05c525825b$var$_tmpl$4 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<span class=num-filters>`),
|
|
5968
5996
|
$f8f64d05c525825b$var$_tmpl$5 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=open-filters-button-container><!$><!/><button type=button><!$><!/><span>`),
|
|
@@ -6031,6 +6059,27 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
6031
6059
|
available_sortings_: available_sortings_,
|
|
6032
6060
|
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6033
6061
|
};
|
|
6062
|
+
// Keyboard accessibility for the desktop panels (rendered after the product grid in the DOM): when the user
|
|
6063
|
+
// opens a panel we move focus into it, and restore focus to the toggle button on close. Intent is tracked with
|
|
6064
|
+
// a plain flag set in the buttons' click handlers - `filters_open`/`sorting_open` also change programmatically
|
|
6065
|
+
// (undo toast, history-state restore, SDK consumers), and those must not steal focus.
|
|
6066
|
+
let user_opened_panel = false;
|
|
6067
|
+
let filter_toggle_button;
|
|
6068
|
+
let sort_toggle_button;
|
|
6069
|
+
let current_panel;
|
|
6070
|
+
let current_panel_toggle_button;
|
|
6071
|
+
const focus_panel_when_in_dom = panel => $gVhhF$depictaiutilishared.catchify(async () => {
|
|
6072
|
+
// Bounded wait: if the panel never lands in the DOM (e.g. it's superseded by a rapid re-render before
|
|
6073
|
+
// insertion), the timeout lets this promise resolve instead of keeping `panel` - and the observer
|
|
6074
|
+
// listener it registers - referenced forever.
|
|
6075
|
+
await (0, $gVhhF$depictaiutilishared.observer).wait_for_element(panel, 4000);
|
|
6076
|
+
if (panel.isConnected) panel.focus();
|
|
6077
|
+
})();
|
|
6078
|
+
const register_desktop_panel = (el, toggle_button, should_focus) => {
|
|
6079
|
+
current_panel = el;
|
|
6080
|
+
current_panel_toggle_button = toggle_button;
|
|
6081
|
+
if (should_focus) focus_panel_when_in_dom(el);
|
|
6082
|
+
};
|
|
6034
6083
|
const make_open_filters_button = (adhere_to_width = false, is_tabbable = false) => $gVhhF$solidjsweb.createComponent($f8f64d05c525825b$var$OpenFiltersButton, {
|
|
6035
6084
|
tabindex_: is_tabbable ? 0 : -1,
|
|
6036
6085
|
i18n_: i18n_,
|
|
@@ -6038,7 +6087,9 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
6038
6087
|
search_sorting_open_: search_sorting_open_,
|
|
6039
6088
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
6040
6089
|
filter_button_width_: adhere_to_width ? filter_button_width_ : undefined,
|
|
6041
|
-
hide_button_: hide_filters
|
|
6090
|
+
hide_button_: hide_filters,
|
|
6091
|
+
on_user_open_: () => user_opened_panel = true,
|
|
6092
|
+
button_ref_: is_tabbable ? el => filter_toggle_button = el : undefined
|
|
6042
6093
|
});
|
|
6043
6094
|
const make_open_sorting_button = (adhere_to_width = false, is_tabbable = false) => $gVhhF$solidjsweb.createComponent($f8f64d05c525825b$var$OpenSortingButton, {
|
|
6044
6095
|
tabindex_: is_tabbable ? 0 : -1,
|
|
@@ -6048,7 +6099,9 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
6048
6099
|
search_sorting_open_: search_sorting_open_,
|
|
6049
6100
|
available_sortings_: available_sortings_,
|
|
6050
6101
|
sort_button_width_: adhere_to_width ? sort_button_width_ : undefined,
|
|
6051
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6102
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
6103
|
+
on_user_open_: () => user_opened_panel = true,
|
|
6104
|
+
button_ref_: is_tabbable ? el => sort_toggle_button = el : undefined
|
|
6052
6105
|
});
|
|
6053
6106
|
let open_modal_;
|
|
6054
6107
|
let close_modal_;
|
|
@@ -6067,9 +6120,46 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
6067
6120
|
grid_is_in_original_state = true;
|
|
6068
6121
|
}
|
|
6069
6122
|
});
|
|
6123
|
+
// Restore focus to the relevant toggle button when a desktop panel is torn down while focus is still inside it.
|
|
6124
|
+
const restore_focus_to_toggle_on_close = () => {
|
|
6125
|
+
const button_to_restore = current_panel_toggle_button;
|
|
6126
|
+
const focus_was_in_panel = !!current_panel && current_panel.contains(document.activeElement);
|
|
6127
|
+
current_panel = undefined;
|
|
6128
|
+
current_panel_toggle_button = undefined;
|
|
6129
|
+
if (focus_was_in_panel) button_to_restore?.focus();
|
|
6130
|
+
};
|
|
6131
|
+
// `<section>` + `aria-label` so the panel announces itself ("Filters"/"Sort") when we move focus to it; the bare
|
|
6132
|
+
// tabindex=-1 container would otherwise give screen readers nothing to read on focus. A semantic <section> avoids
|
|
6133
|
+
// an ARIA role and the UA styling pitfalls of <fieldset>; the existing CSS targets the `.filters`/`.sorting` class.
|
|
6134
|
+
const FiltersPanel = should_focus => $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
6135
|
+
get when() {
|
|
6136
|
+
return !hide_filters();
|
|
6137
|
+
},
|
|
6138
|
+
get children() {
|
|
6139
|
+
var _el$ = $gVhhF$solidjsweb.getNextElement($f8f64d05c525825b$var$_tmpl$),
|
|
6140
|
+
_el$2 = _el$.firstChild;
|
|
6141
|
+
$gVhhF$solidjsweb.use(el => register_desktop_panel(el, filter_toggle_button, should_focus), _el$);
|
|
6142
|
+
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $aff9a96d30ed3563$export$3f1a388cc0d8fed7), filter_options));
|
|
6143
|
+
$gVhhF$solidjsweb.effect(() => $gVhhF$solidjsweb.setAttribute(_el$, "aria-label", i18n_.filters_()));
|
|
6144
|
+
return _el$;
|
|
6145
|
+
}
|
|
6146
|
+
});
|
|
6147
|
+
const SortingPanel = should_focus => (() => {
|
|
6148
|
+
var _el$3 = $gVhhF$solidjsweb.getNextElement($f8f64d05c525825b$var$_tmpl$2),
|
|
6149
|
+
_el$4 = _el$3.firstChild;
|
|
6150
|
+
$gVhhF$solidjsweb.use(el => register_desktop_panel(el, sort_toggle_button, should_focus), _el$3);
|
|
6151
|
+
$gVhhF$solidjsweb.insert(_el$4, $gVhhF$solidjsweb.createComponent((0, $be89be42ce9ea60f$export$1f1775a58da589b5), sorting_options));
|
|
6152
|
+
$gVhhF$solidjsweb.effect(() => $gVhhF$solidjsweb.setAttribute(_el$3, "aria-label", i18n_.sorting_text_()));
|
|
6153
|
+
return _el$3;
|
|
6154
|
+
})();
|
|
6070
6155
|
$gVhhF$solidjs.createEffect(() => {
|
|
6156
|
+
// Consume the user-intent flag once per run, in every branch, so a stale flag can't leak into a later
|
|
6157
|
+
// resize-triggered re-render and steal focus.
|
|
6158
|
+
const should_focus_panel = user_opened_panel;
|
|
6159
|
+
user_opened_panel = false;
|
|
6071
6160
|
if (!filters_open() && !sorting_open()) {
|
|
6072
6161
|
close_modal_?.();
|
|
6162
|
+
restore_focus_to_toggle_on_close();
|
|
6073
6163
|
set_extra_els_in_results_container_("");
|
|
6074
6164
|
} else if (isSmall()()) {
|
|
6075
6165
|
if ($gVhhF$solidjs.untrack(() => input_modal_open_?.())) {
|
|
@@ -6078,26 +6168,14 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
6078
6168
|
set_sorting_open(false);
|
|
6079
6169
|
return;
|
|
6080
6170
|
}
|
|
6171
|
+
// The modal manages its own focus; just drop the desktop panel reference.
|
|
6172
|
+
current_panel = undefined;
|
|
6173
|
+
current_panel_toggle_button = undefined;
|
|
6081
6174
|
open_modal_?.();
|
|
6082
6175
|
set_extra_els_in_results_container_("");
|
|
6083
6176
|
} else {
|
|
6084
6177
|
close_modal_?.();
|
|
6085
|
-
if (filters_open()) set_extra_els_in_results_container_(() =>
|
|
6086
|
-
get when() {
|
|
6087
|
-
return !hide_filters();
|
|
6088
|
-
},
|
|
6089
|
-
get children() {
|
|
6090
|
-
var _el$ = $gVhhF$solidjsweb.getNextElement($f8f64d05c525825b$var$_tmpl$),
|
|
6091
|
-
_el$2 = _el$.firstChild;
|
|
6092
|
-
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $aff9a96d30ed3563$export$3f1a388cc0d8fed7), filter_options));
|
|
6093
|
-
return _el$;
|
|
6094
|
-
}
|
|
6095
|
-
}));else set_extra_els_in_results_container_((() => {
|
|
6096
|
-
var _el$3 = $gVhhF$solidjsweb.getNextElement($f8f64d05c525825b$var$_tmpl$2),
|
|
6097
|
-
_el$4 = _el$3.firstChild;
|
|
6098
|
-
$gVhhF$solidjsweb.insert(_el$4, $gVhhF$solidjsweb.createComponent((0, $be89be42ce9ea60f$export$1f1775a58da589b5), sorting_options));
|
|
6099
|
-
return _el$3;
|
|
6100
|
-
})());
|
|
6178
|
+
if (filters_open()) set_extra_els_in_results_container_(() => FiltersPanel(should_focus_panel));else set_extra_els_in_results_container_(SortingPanel(should_focus_panel));
|
|
6101
6179
|
}
|
|
6102
6180
|
});
|
|
6103
6181
|
$gVhhF$depictaiutilishared.catchify(async () => {
|
|
@@ -6161,7 +6239,9 @@ function $f8f64d05c525825b$var$OpenFiltersButton({
|
|
|
6161
6239
|
filter_button_width_: filter_button_width_,
|
|
6162
6240
|
tabindex_: tabindex_,
|
|
6163
6241
|
number_of_rendered_selected_filters_items_: [num_selected_filters],
|
|
6164
|
-
hide_button_: hide_button_
|
|
6242
|
+
hide_button_: hide_button_,
|
|
6243
|
+
on_user_open_: on_user_open_,
|
|
6244
|
+
button_ref_: button_ref_
|
|
6165
6245
|
}) {
|
|
6166
6246
|
const filters_closed = $gVhhF$solidjs.createMemo(() => !search_filters_open_[0]());
|
|
6167
6247
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
@@ -6189,9 +6269,12 @@ function $f8f64d05c525825b$var$OpenFiltersButton({
|
|
|
6189
6269
|
search_filters_open_[1](false);
|
|
6190
6270
|
return;
|
|
6191
6271
|
}
|
|
6272
|
+
on_user_open_?.();
|
|
6192
6273
|
search_filters_open_[1](true);
|
|
6193
6274
|
search_sorting_open_[1](false);
|
|
6194
6275
|
})), true);
|
|
6276
|
+
var _ref$2 = button_ref_;
|
|
6277
|
+
typeof _ref$2 === "function" ? $gVhhF$solidjsweb.use(_ref$2, _el$16) : button_ref_ = _el$16;
|
|
6195
6278
|
$gVhhF$solidjsweb.setAttribute(_el$16, "tabindex", tabindex_);
|
|
6196
6279
|
$gVhhF$solidjsweb.className(_el$16, "filter toggle-button major-minor-transition" + ((0, $gVhhF$solidjsweb.isServer) ? " minor" : ""));
|
|
6197
6280
|
$gVhhF$solidjsweb.insert(_el$16, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
@@ -6213,21 +6296,24 @@ function $f8f64d05c525825b$var$OpenFiltersButton({
|
|
|
6213
6296
|
_v$2 = !filters_closed(),
|
|
6214
6297
|
_v$3 = !!filters_closed(),
|
|
6215
6298
|
_v$4 = (filters_closed() ? i18n_.open_filters_ : i18n_.close_filters_)(),
|
|
6216
|
-
_v$5 =
|
|
6299
|
+
_v$5 = !filters_closed(),
|
|
6300
|
+
_v$6 = filter_button_width_?.() ? {
|
|
6217
6301
|
width: filter_button_width_() + "px"
|
|
6218
6302
|
} : {};
|
|
6219
6303
|
_p$.e = $gVhhF$solidjsweb.style(_el$14, _v$, _p$.e);
|
|
6220
6304
|
_v$2 !== _p$.t && _el$16.classList.toggle("major", _p$.t = _v$2);
|
|
6221
6305
|
_v$3 !== _p$.a && _el$16.classList.toggle("minor", _p$.a = _v$3);
|
|
6222
6306
|
_v$4 !== _p$.o && $gVhhF$solidjsweb.setAttribute(_el$16, "aria-label", _p$.o = _v$4);
|
|
6223
|
-
_p$.i
|
|
6307
|
+
_v$5 !== _p$.i && $gVhhF$solidjsweb.setAttribute(_el$16, "aria-expanded", _p$.i = _v$5);
|
|
6308
|
+
_p$.n = $gVhhF$solidjsweb.style(_el$16, _v$6, _p$.n);
|
|
6224
6309
|
return _p$;
|
|
6225
6310
|
}, {
|
|
6226
6311
|
e: undefined,
|
|
6227
6312
|
t: undefined,
|
|
6228
6313
|
a: undefined,
|
|
6229
6314
|
o: undefined,
|
|
6230
|
-
i: undefined
|
|
6315
|
+
i: undefined,
|
|
6316
|
+
n: undefined
|
|
6231
6317
|
});
|
|
6232
6318
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
6233
6319
|
return _el$14;
|
|
@@ -6241,7 +6327,9 @@ function $f8f64d05c525825b$var$OpenSortingButton({
|
|
|
6241
6327
|
search_sorting_open_: search_sorting_open_,
|
|
6242
6328
|
sort_button_width_: sort_button_width_,
|
|
6243
6329
|
tabindex_: tabindex_,
|
|
6244
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6330
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
6331
|
+
on_user_open_: on_user_open_,
|
|
6332
|
+
button_ref_: button_ref_
|
|
6245
6333
|
}) {
|
|
6246
6334
|
const sorting_closed = $gVhhF$solidjs.createMemo(() => !search_sorting_open_[0]());
|
|
6247
6335
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
@@ -6255,9 +6343,12 @@ function $f8f64d05c525825b$var$OpenSortingButton({
|
|
|
6255
6343
|
search_sorting_open_[1](false);
|
|
6256
6344
|
return;
|
|
6257
6345
|
}
|
|
6346
|
+
on_user_open_?.();
|
|
6258
6347
|
search_filters_open_[1](false);
|
|
6259
6348
|
search_sorting_open_[1](true);
|
|
6260
6349
|
})), true);
|
|
6350
|
+
var _ref$3 = button_ref_;
|
|
6351
|
+
typeof _ref$3 === "function" ? $gVhhF$solidjsweb.use(_ref$3, _el$22) : button_ref_ = _el$22;
|
|
6261
6352
|
$gVhhF$solidjsweb.setAttribute(_el$22, "tabindex", tabindex_);
|
|
6262
6353
|
$gVhhF$solidjsweb.insert(_el$23, (() => {
|
|
6263
6354
|
var _c$ = $gVhhF$solidjsweb.memo(() => !!sorting_closed());
|
|
@@ -6279,22 +6370,25 @@ function $f8f64d05c525825b$var$OpenSortingButton({
|
|
|
6279
6370
|
}
|
|
6280
6371
|
}), _el$25, _co$6);
|
|
6281
6372
|
$gVhhF$solidjsweb.effect(_p$ => {
|
|
6282
|
-
var _v$
|
|
6283
|
-
_v$
|
|
6284
|
-
_v$
|
|
6285
|
-
_v$
|
|
6373
|
+
var _v$7 = !sorting_closed(),
|
|
6374
|
+
_v$8 = !!sorting_closed(),
|
|
6375
|
+
_v$9 = (sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(),
|
|
6376
|
+
_v$10 = !sorting_closed(),
|
|
6377
|
+
_v$11 = sort_button_width_?.() ? {
|
|
6286
6378
|
width: sort_button_width_() + "px"
|
|
6287
6379
|
} : {};
|
|
6288
|
-
_v$
|
|
6289
|
-
_v$
|
|
6290
|
-
_v$
|
|
6291
|
-
_p$.o
|
|
6380
|
+
_v$7 !== _p$.e && _el$22.classList.toggle("major", _p$.e = _v$7);
|
|
6381
|
+
_v$8 !== _p$.t && _el$22.classList.toggle("minor", _p$.t = _v$8);
|
|
6382
|
+
_v$9 !== _p$.a && $gVhhF$solidjsweb.setAttribute(_el$22, "aria-label", _p$.a = _v$9);
|
|
6383
|
+
_v$10 !== _p$.o && $gVhhF$solidjsweb.setAttribute(_el$22, "aria-expanded", _p$.o = _v$10);
|
|
6384
|
+
_p$.i = $gVhhF$solidjsweb.style(_el$22, _v$11, _p$.i);
|
|
6292
6385
|
return _p$;
|
|
6293
6386
|
}, {
|
|
6294
6387
|
e: undefined,
|
|
6295
6388
|
t: undefined,
|
|
6296
6389
|
a: undefined,
|
|
6297
|
-
o: undefined
|
|
6390
|
+
o: undefined,
|
|
6391
|
+
i: undefined
|
|
6298
6392
|
});
|
|
6299
6393
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
6300
6394
|
return _el$22;
|