@depict-ai/ui 4.10.13 → 4.10.15
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 +167 -42
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +167 -42
- package/latest/index.cjs +163 -42
- package/latest/index.d.ts +1 -1
- package/latest/index.js +163 -42
- package/package.json +4 -4
- package/server/ES10/index.cjs +95 -21
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +95 -21
- package/server/latest/index.cjs +94 -21
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +94 -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.15";
|
|
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 => {
|
|
@@ -2716,18 +2716,53 @@ function $ff3225aef892a467$export$f21ab0717a89c77f(props) {
|
|
|
2716
2716
|
return _el$;
|
|
2717
2717
|
})();
|
|
2718
2718
|
}
|
|
2719
|
+
|
|
2720
|
+
/**
|
|
2721
|
+
* Whether a click came from the keyboard (Enter/Space) rather than a pointer. Browsers report `detail === 0` for
|
|
2722
|
+
* keyboard-activated clicks and `>= 1` for real pointer clicks, so we use it to only move focus on keyboard opens.
|
|
2723
|
+
*/
|
|
2724
|
+
function $5cfec0b5cd753ec8$export$c5c485c196a19ec1(event) {
|
|
2725
|
+
return event.detail === 0;
|
|
2726
|
+
}
|
|
2719
2727
|
var $3e850b2f2cca761f$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<button type=button class=expand-filter><!$><!/><span>`);
|
|
2720
2728
|
function $3e850b2f2cca761f$export$ca21a16d65b3dd8(_ref) {
|
|
2721
2729
|
let {
|
|
2722
2730
|
show_extras_: [get_show_extras, set_show_extras],
|
|
2723
|
-
i18n_: i18n_
|
|
2731
|
+
i18n_: i18n_,
|
|
2732
|
+
expanding_container_element_: expanding_container_element_
|
|
2724
2733
|
} = _ref;
|
|
2734
|
+
let button;
|
|
2725
2735
|
return (() => {
|
|
2726
2736
|
var _el$ = $8tj43$getNextElement($3e850b2f2cca761f$var$_tmpl$),
|
|
2727
2737
|
_el$3 = _el$.firstChild,
|
|
2728
2738
|
[_el$4, _co$] = $8tj43$getNextMarker(_el$3.nextSibling),
|
|
2729
2739
|
_el$2 = _el$4.nextSibling;
|
|
2730
|
-
$8tj43$addEventListener(_el$, "click", $8tj43$catchify1(
|
|
2740
|
+
$8tj43$addEventListener(_el$, "click", $8tj43$catchify1(event => {
|
|
2741
|
+
const container = expanding_container_element_;
|
|
2742
|
+
const will_expand = !get_show_extras();
|
|
2743
|
+
// Only move focus for keyboard activation; mouse users see the revealed options and don't need a focus jump.
|
|
2744
|
+
const keyboard_activated = $5cfec0b5cd753ec8$export$c5c485c196a19ec1(event);
|
|
2745
|
+
const had_focus_inside = !!container && container.contains(document.activeElement);
|
|
2746
|
+
set_show_extras(will_expand);
|
|
2747
|
+
if (will_expand) {
|
|
2748
|
+
if (!keyboard_activated) return;
|
|
2749
|
+
// `expand()` (consumer's effect, runs after this) clears `inert`/`visibility`; focus the first revealed
|
|
2750
|
+
// option next frame so Tab continues through them. `preventScroll` so it doesn't yank the viewport down.
|
|
2751
|
+
requestAnimationFrame($8tj43$catchify1(() => {
|
|
2752
|
+
var _container$querySelec;
|
|
2753
|
+
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({
|
|
2754
|
+
preventScroll: true
|
|
2755
|
+
});
|
|
2756
|
+
}));
|
|
2757
|
+
} else if (had_focus_inside)
|
|
2758
|
+
// Keep focus on the toggle when collapsing, otherwise making the container `inert` dumps focus to <body>
|
|
2759
|
+
// (Safari doesn't focus buttons on mouse click, so focus can still be inside the container here).
|
|
2760
|
+
button.focus({
|
|
2761
|
+
preventScroll: true
|
|
2762
|
+
});
|
|
2763
|
+
}), true);
|
|
2764
|
+
var _ref$ = button;
|
|
2765
|
+
typeof _ref$ === "function" ? $8tj43$use(_ref$, _el$) : button = _el$;
|
|
2731
2766
|
$8tj43$insert(_el$, $8tj43$createComponent((0, $ff3225aef892a467$export$f21ab0717a89c77f), {}), _el$4, _co$);
|
|
2732
2767
|
$8tj43$insert(_el$2, (() => {
|
|
2733
2768
|
var _c$ = $8tj43$memo(() => !!get_show_extras());
|
|
@@ -2926,7 +2961,8 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
|
|
|
2926
2961
|
$8tj43$createRenderEffect(() => {
|
|
2927
2962
|
set_view_more_button_below_group_(togglable_rest() ? $8tj43$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
|
|
2928
2963
|
show_extras_: show_extras_signal,
|
|
2929
|
-
i18n_: i18n_
|
|
2964
|
+
i18n_: i18n_,
|
|
2965
|
+
expanding_container_element_: expanding_container_els
|
|
2930
2966
|
}) : []);
|
|
2931
2967
|
});
|
|
2932
2968
|
$8tj43$onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -3903,7 +3939,8 @@ function $0ae614c5c7babb43$export$a32086fa6616eafd(_ref) {
|
|
|
3903
3939
|
$8tj43$createRenderEffect(() => {
|
|
3904
3940
|
set_view_more_button_below_group(some_top_level_are_hidden() ? $8tj43$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
|
|
3905
3941
|
show_extras_: show_extras,
|
|
3906
|
-
i18n_: i18n_
|
|
3942
|
+
i18n_: i18n_,
|
|
3943
|
+
expanding_container_element_: expanding_container_els
|
|
3907
3944
|
}) : []);
|
|
3908
3945
|
});
|
|
3909
3946
|
$8tj43$onCleanup(() => set_view_more_button_below_group());
|
|
@@ -4710,7 +4747,8 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
4710
4747
|
$8tj43$createRenderEffect(() => {
|
|
4711
4748
|
set_view_more_button_below_group_(togglable_rest() ? $8tj43$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
|
|
4712
4749
|
show_extras_: show_extras_signal,
|
|
4713
|
-
i18n_: i18n_
|
|
4750
|
+
i18n_: i18n_,
|
|
4751
|
+
expanding_container_element_: expanding_container_els
|
|
4714
4752
|
}) : []);
|
|
4715
4753
|
});
|
|
4716
4754
|
$8tj43$onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -6201,8 +6239,8 @@ var $bce10e104a1dd893$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<svg xmlns=http
|
|
|
6201
6239
|
function $bce10e104a1dd893$export$cb808a3c41736d8e() {
|
|
6202
6240
|
return $8tj43$getNextElement($bce10e104a1dd893$var$_tmpl$);
|
|
6203
6241
|
}
|
|
6204
|
-
var $7396052a1484264f$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<
|
|
6205
|
-
$7396052a1484264f$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<
|
|
6242
|
+
var $7396052a1484264f$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<section class=filters tabindex=-1><div class=body>`),
|
|
6243
|
+
$7396052a1484264f$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<section class=sorting tabindex=-1><div class=body>`),
|
|
6206
6244
|
$7396052a1484264f$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=sort-and-filter-buttons><div class=outer><div class=inner><!$><!/><!$><!/><!$><!/>`),
|
|
6207
6245
|
$7396052a1484264f$var$_tmpl$4 = /*#__PURE__*/$8tj43$template(`<span class=num-filters>`),
|
|
6208
6246
|
$7396052a1484264f$var$_tmpl$5 = /*#__PURE__*/$8tj43$template(`<div class=open-filters-button-container><!$><!/><button type=button><!$><!/><span>`),
|
|
@@ -6279,6 +6317,40 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6279
6317
|
available_sortings_: available_sortings_,
|
|
6280
6318
|
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6281
6319
|
};
|
|
6320
|
+
// Keyboard a11y for desktop panels (DOM order: after the grid). Keyboard opens move focus into the panel and
|
|
6321
|
+
// restore it to the toggle on close; mouse opens skip the focus move (already visible, and it'd jump the viewport).
|
|
6322
|
+
// `user_opened_panel` is set only on keyboard activation - `filters_open`/`sorting_open` also change
|
|
6323
|
+
// programmatically (undo toast, history restore, SDK consumers), which must not steal focus.
|
|
6324
|
+
let user_opened_panel = false;
|
|
6325
|
+
let filter_toggle_button;
|
|
6326
|
+
let sort_toggle_button;
|
|
6327
|
+
let current_panel;
|
|
6328
|
+
let current_panel_toggle_button;
|
|
6329
|
+
const focus_panel_when_in_dom = panel => $8tj43$catchify1(async () => {
|
|
6330
|
+
// Bounded wait: if the panel never lands in the DOM (e.g. it's superseded by a rapid re-render before
|
|
6331
|
+
// insertion), the timeout lets this promise resolve instead of keeping `panel` - and the observer
|
|
6332
|
+
// listener it registers - referenced forever.
|
|
6333
|
+
await (0, $8tj43$observer).wait_for_element(panel, 4000);
|
|
6334
|
+
if (panel.isConnected) {
|
|
6335
|
+
var _panel$querySelector;
|
|
6336
|
+
// Focus the first interactive control (often a group's <summary>), not the <section>: the section has no
|
|
6337
|
+
// visible focus ring and is flex-stretched to full grid height (scrolling it mis-aligns). The first
|
|
6338
|
+
// control keeps focus visible and lets Tab walk through the panel. `summary` is focusable but not matched
|
|
6339
|
+
// by the input/button/etc. selectors, so it must be listed explicitly.
|
|
6340
|
+
const focus_target = (_panel$querySelector = panel.querySelector("summary, input:not([type='hidden']):not(:disabled), button:not(:disabled), a[href], select:not(:disabled), [tabindex]:not([tabindex='-1'])")) !== null && _panel$querySelector !== void 0 ? _panel$querySelector : panel;
|
|
6341
|
+
focus_target.focus({
|
|
6342
|
+
preventScroll: true
|
|
6343
|
+
});
|
|
6344
|
+
focus_target.scrollIntoView({
|
|
6345
|
+
block: "nearest"
|
|
6346
|
+
});
|
|
6347
|
+
}
|
|
6348
|
+
})();
|
|
6349
|
+
const register_desktop_panel = (el, toggle_button, should_focus) => {
|
|
6350
|
+
current_panel = el;
|
|
6351
|
+
current_panel_toggle_button = toggle_button;
|
|
6352
|
+
if (should_focus) focus_panel_when_in_dom(el);
|
|
6353
|
+
};
|
|
6282
6354
|
const make_open_filters_button = function () {
|
|
6283
6355
|
let adhere_to_width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6284
6356
|
let is_tabbable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -6289,7 +6361,11 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6289
6361
|
search_sorting_open_: search_sorting_open_,
|
|
6290
6362
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
6291
6363
|
filter_button_width_: adhere_to_width ? filter_button_width_ : undefined,
|
|
6292
|
-
hide_button_: hide_filters
|
|
6364
|
+
hide_button_: hide_filters,
|
|
6365
|
+
on_user_open_: keyboard_activated => {
|
|
6366
|
+
if (keyboard_activated) user_opened_panel = true;
|
|
6367
|
+
},
|
|
6368
|
+
button_ref_: is_tabbable ? el => filter_toggle_button = el : undefined
|
|
6293
6369
|
});
|
|
6294
6370
|
};
|
|
6295
6371
|
const make_open_sorting_button = function () {
|
|
@@ -6303,7 +6379,11 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6303
6379
|
search_sorting_open_: search_sorting_open_,
|
|
6304
6380
|
available_sortings_: available_sortings_,
|
|
6305
6381
|
sort_button_width_: adhere_to_width ? sort_button_width_ : undefined,
|
|
6306
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6382
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
6383
|
+
on_user_open_: keyboard_activated => {
|
|
6384
|
+
if (keyboard_activated) user_opened_panel = true;
|
|
6385
|
+
},
|
|
6386
|
+
button_ref_: is_tabbable ? el => sort_toggle_button = el : undefined
|
|
6307
6387
|
});
|
|
6308
6388
|
};
|
|
6309
6389
|
let open_modal_;
|
|
@@ -6323,10 +6403,49 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6323
6403
|
grid_is_in_original_state = true;
|
|
6324
6404
|
}
|
|
6325
6405
|
});
|
|
6406
|
+
// Restore focus to the relevant toggle button when a desktop panel is torn down while focus is still inside it.
|
|
6407
|
+
const restore_focus_to_toggle_on_close = () => {
|
|
6408
|
+
const button_to_restore = current_panel_toggle_button;
|
|
6409
|
+
const focus_was_in_panel = !!current_panel && current_panel.contains(document.activeElement);
|
|
6410
|
+
current_panel = undefined;
|
|
6411
|
+
current_panel_toggle_button = undefined;
|
|
6412
|
+
if (focus_was_in_panel && button_to_restore) button_to_restore.focus({
|
|
6413
|
+
preventScroll: true
|
|
6414
|
+
});
|
|
6415
|
+
};
|
|
6416
|
+
// `<section>` + `aria-label` so the panel announces itself ("Filters"/"Sort") when we move focus to it; the bare
|
|
6417
|
+
// tabindex=-1 container would otherwise give screen readers nothing to read on focus. A semantic <section> avoids
|
|
6418
|
+
// an ARIA role and the UA styling pitfalls of <fieldset>; the existing CSS targets the `.filters`/`.sorting` class.
|
|
6419
|
+
const FiltersPanel = should_focus => $8tj43$createComponent((0, $8tj43$Show), {
|
|
6420
|
+
get when() {
|
|
6421
|
+
return !hide_filters();
|
|
6422
|
+
},
|
|
6423
|
+
get children() {
|
|
6424
|
+
var _el$ = $8tj43$getNextElement($7396052a1484264f$var$_tmpl$),
|
|
6425
|
+
_el$2 = _el$.firstChild;
|
|
6426
|
+
$8tj43$use(el => register_desktop_panel(el, filter_toggle_button, should_focus), _el$);
|
|
6427
|
+
$8tj43$insert(_el$2, $8tj43$createComponent((0, $f6b0500577e1b210$export$3f1a388cc0d8fed7), filter_options));
|
|
6428
|
+
$8tj43$effect(() => $8tj43$setAttribute(_el$, "aria-label", i18n_.filters_()));
|
|
6429
|
+
return _el$;
|
|
6430
|
+
}
|
|
6431
|
+
});
|
|
6432
|
+
const SortingPanel = should_focus => (() => {
|
|
6433
|
+
var _el$3 = $8tj43$getNextElement($7396052a1484264f$var$_tmpl$2),
|
|
6434
|
+
_el$4 = _el$3.firstChild;
|
|
6435
|
+
$8tj43$use(el => register_desktop_panel(el, sort_toggle_button, should_focus), _el$3);
|
|
6436
|
+
$8tj43$insert(_el$4, $8tj43$createComponent((0, $cfdbd124dd09d713$export$1f1775a58da589b5), sorting_options));
|
|
6437
|
+
$8tj43$effect(() => $8tj43$setAttribute(_el$3, "aria-label", i18n_.sorting_text_()));
|
|
6438
|
+
return _el$3;
|
|
6439
|
+
})();
|
|
6326
6440
|
$8tj43$createEffect(() => {
|
|
6441
|
+
// Consume the user-intent flag once per run, in every branch, so a stale flag can't leak into a later
|
|
6442
|
+
// resize-triggered re-render and steal focus.
|
|
6443
|
+
const should_focus_panel = user_opened_panel;
|
|
6444
|
+
user_opened_panel = false;
|
|
6327
6445
|
if (!filters_open() && !sorting_open()) {
|
|
6328
6446
|
var _close_modal_;
|
|
6329
6447
|
(_close_modal_ = close_modal_) === null || _close_modal_ === void 0 || _close_modal_();
|
|
6448
|
+
restore_focus_to_toggle_on_close();
|
|
6330
6449
|
set_extra_els_in_results_container_("");
|
|
6331
6450
|
} else if (isSmall()()) {
|
|
6332
6451
|
var _open_modal_;
|
|
@@ -6336,27 +6455,15 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6336
6455
|
set_sorting_open(false);
|
|
6337
6456
|
return;
|
|
6338
6457
|
}
|
|
6458
|
+
// The modal manages its own focus; just drop the desktop panel reference.
|
|
6459
|
+
current_panel = undefined;
|
|
6460
|
+
current_panel_toggle_button = undefined;
|
|
6339
6461
|
(_open_modal_ = open_modal_) === null || _open_modal_ === void 0 || _open_modal_();
|
|
6340
6462
|
set_extra_els_in_results_container_("");
|
|
6341
6463
|
} else {
|
|
6342
6464
|
var _close_modal_2;
|
|
6343
6465
|
(_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
|
-
})());
|
|
6466
|
+
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
6467
|
}
|
|
6361
6468
|
});
|
|
6362
6469
|
$8tj43$catchify1(async () => {
|
|
@@ -6421,7 +6528,9 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref3) {
|
|
|
6421
6528
|
filter_button_width_: filter_button_width_,
|
|
6422
6529
|
tabindex_: tabindex_,
|
|
6423
6530
|
number_of_rendered_selected_filters_items_: [num_selected_filters],
|
|
6424
|
-
hide_button_: hide_button_
|
|
6531
|
+
hide_button_: hide_button_,
|
|
6532
|
+
on_user_open_: on_user_open_,
|
|
6533
|
+
button_ref_: button_ref_
|
|
6425
6534
|
} = _ref3;
|
|
6426
6535
|
const filters_closed = $8tj43$createMemo(() => !search_filters_open_[0]());
|
|
6427
6536
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
@@ -6444,14 +6553,18 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref3) {
|
|
|
6444
6553
|
return _el$15;
|
|
6445
6554
|
}
|
|
6446
6555
|
}), _el$21, _co$5);
|
|
6447
|
-
$8tj43$addEventListener(_el$16, "click", $8tj43$catchify1(
|
|
6556
|
+
$8tj43$addEventListener(_el$16, "click", $8tj43$catchify1(event => $8tj43$batch(() => {
|
|
6448
6557
|
if (search_filters_open_[0]()) {
|
|
6449
6558
|
search_filters_open_[1](false);
|
|
6450
6559
|
return;
|
|
6451
6560
|
}
|
|
6561
|
+
// Only keyboard opens move focus into the panel; mouse opens leave the viewport put.
|
|
6562
|
+
on_user_open_ === null || on_user_open_ === void 0 || on_user_open_($5cfec0b5cd753ec8$export$c5c485c196a19ec1(event));
|
|
6452
6563
|
search_filters_open_[1](true);
|
|
6453
6564
|
search_sorting_open_[1](false);
|
|
6454
6565
|
})), true);
|
|
6566
|
+
var _ref$2 = button_ref_;
|
|
6567
|
+
typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$16) : button_ref_ = _el$16;
|
|
6455
6568
|
$8tj43$setAttribute(_el$16, "tabindex", tabindex_);
|
|
6456
6569
|
$8tj43$className(_el$16, "filter toggle-button major-minor-transition" + ((0, $8tj43$isServer) ? " minor" : ""));
|
|
6457
6570
|
$8tj43$insert(_el$16, $8tj43$createComponent((0, $8tj43$Show), {
|
|
@@ -6473,21 +6586,24 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref3) {
|
|
|
6473
6586
|
_v$2 = !filters_closed(),
|
|
6474
6587
|
_v$3 = !!filters_closed(),
|
|
6475
6588
|
_v$4 = (filters_closed() ? i18n_.open_filters_ : i18n_.close_filters_)(),
|
|
6476
|
-
_v$5 =
|
|
6589
|
+
_v$5 = !filters_closed(),
|
|
6590
|
+
_v$6 = filter_button_width_ !== null && filter_button_width_ !== void 0 && filter_button_width_() ? {
|
|
6477
6591
|
width: filter_button_width_() + "px"
|
|
6478
6592
|
} : {};
|
|
6479
6593
|
_p$.e = $8tj43$style(_el$14, _v$, _p$.e);
|
|
6480
6594
|
_v$2 !== _p$.t && _el$16.classList.toggle("major", _p$.t = _v$2);
|
|
6481
6595
|
_v$3 !== _p$.a && _el$16.classList.toggle("minor", _p$.a = _v$3);
|
|
6482
6596
|
_v$4 !== _p$.o && $8tj43$setAttribute(_el$16, "aria-label", _p$.o = _v$4);
|
|
6483
|
-
_p$.i
|
|
6597
|
+
_v$5 !== _p$.i && $8tj43$setAttribute(_el$16, "aria-expanded", _p$.i = _v$5);
|
|
6598
|
+
_p$.n = $8tj43$style(_el$16, _v$6, _p$.n);
|
|
6484
6599
|
return _p$;
|
|
6485
6600
|
}, {
|
|
6486
6601
|
e: undefined,
|
|
6487
6602
|
t: undefined,
|
|
6488
6603
|
a: undefined,
|
|
6489
6604
|
o: undefined,
|
|
6490
|
-
i: undefined
|
|
6605
|
+
i: undefined,
|
|
6606
|
+
n: undefined
|
|
6491
6607
|
});
|
|
6492
6608
|
$8tj43$runHydrationEvents();
|
|
6493
6609
|
return _el$14;
|
|
@@ -6502,7 +6618,9 @@ function $7396052a1484264f$var$OpenSortingButton(_ref4) {
|
|
|
6502
6618
|
search_sorting_open_: search_sorting_open_,
|
|
6503
6619
|
sort_button_width_: sort_button_width_,
|
|
6504
6620
|
tabindex_: tabindex_,
|
|
6505
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
6621
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
6622
|
+
on_user_open_: on_user_open_,
|
|
6623
|
+
button_ref_: button_ref_
|
|
6506
6624
|
} = _ref4;
|
|
6507
6625
|
const sorting_closed = $8tj43$createMemo(() => !search_sorting_open_[0]());
|
|
6508
6626
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
@@ -6511,14 +6629,18 @@ function $7396052a1484264f$var$OpenSortingButton(_ref4) {
|
|
|
6511
6629
|
_el$23 = _el$22.firstChild,
|
|
6512
6630
|
_el$24 = _el$23.nextSibling,
|
|
6513
6631
|
[_el$25, _co$6] = $8tj43$getNextMarker(_el$24.nextSibling);
|
|
6514
|
-
$8tj43$addEventListener(_el$22, "click", $8tj43$catchify1(
|
|
6632
|
+
$8tj43$addEventListener(_el$22, "click", $8tj43$catchify1(event => $8tj43$batch(() => {
|
|
6515
6633
|
if (search_sorting_open_[0]()) {
|
|
6516
6634
|
search_sorting_open_[1](false);
|
|
6517
6635
|
return;
|
|
6518
6636
|
}
|
|
6637
|
+
// Only keyboard opens move focus into the panel; mouse opens leave the viewport put.
|
|
6638
|
+
on_user_open_ === null || on_user_open_ === void 0 || on_user_open_($5cfec0b5cd753ec8$export$c5c485c196a19ec1(event));
|
|
6519
6639
|
search_filters_open_[1](false);
|
|
6520
6640
|
search_sorting_open_[1](true);
|
|
6521
6641
|
})), true);
|
|
6642
|
+
var _ref$3 = button_ref_;
|
|
6643
|
+
typeof _ref$3 === "function" ? $8tj43$use(_ref$3, _el$22) : button_ref_ = _el$22;
|
|
6522
6644
|
$8tj43$setAttribute(_el$22, "tabindex", tabindex_);
|
|
6523
6645
|
$8tj43$insert(_el$23, (() => {
|
|
6524
6646
|
var _c$ = $8tj43$memo(() => !!sorting_closed());
|
|
@@ -6547,22 +6669,25 @@ function $7396052a1484264f$var$OpenSortingButton(_ref4) {
|
|
|
6547
6669
|
}
|
|
6548
6670
|
}), _el$25, _co$6);
|
|
6549
6671
|
$8tj43$effect(_p$ => {
|
|
6550
|
-
var _v$
|
|
6551
|
-
_v$
|
|
6552
|
-
_v$
|
|
6553
|
-
_v$
|
|
6672
|
+
var _v$7 = !sorting_closed(),
|
|
6673
|
+
_v$8 = !!sorting_closed(),
|
|
6674
|
+
_v$9 = (sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(),
|
|
6675
|
+
_v$10 = !sorting_closed(),
|
|
6676
|
+
_v$11 = sort_button_width_ !== null && sort_button_width_ !== void 0 && sort_button_width_() ? {
|
|
6554
6677
|
width: sort_button_width_() + "px"
|
|
6555
6678
|
} : {};
|
|
6556
|
-
_v$
|
|
6557
|
-
_v$
|
|
6558
|
-
_v$
|
|
6559
|
-
_p$.o
|
|
6679
|
+
_v$7 !== _p$.e && _el$22.classList.toggle("major", _p$.e = _v$7);
|
|
6680
|
+
_v$8 !== _p$.t && _el$22.classList.toggle("minor", _p$.t = _v$8);
|
|
6681
|
+
_v$9 !== _p$.a && $8tj43$setAttribute(_el$22, "aria-label", _p$.a = _v$9);
|
|
6682
|
+
_v$10 !== _p$.o && $8tj43$setAttribute(_el$22, "aria-expanded", _p$.o = _v$10);
|
|
6683
|
+
_p$.i = $8tj43$style(_el$22, _v$11, _p$.i);
|
|
6560
6684
|
return _p$;
|
|
6561
6685
|
}, {
|
|
6562
6686
|
e: undefined,
|
|
6563
6687
|
t: undefined,
|
|
6564
6688
|
a: undefined,
|
|
6565
|
-
o: undefined
|
|
6689
|
+
o: undefined,
|
|
6690
|
+
i: undefined
|
|
6566
6691
|
});
|
|
6567
6692
|
$8tj43$runHydrationEvents();
|
|
6568
6693
|
return _el$22;
|