@depict-ai/ui 2.0.5 → 2.0.6
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 +131 -107
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +131 -107
- package/latest/index.cjs +117 -90
- package/latest/index.d.ts +1 -1
- package/latest/index.js +117 -90
- package/package.json +2 -2
- package/server/ES10/index.cjs +75 -66
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +75 -66
- package/server/latest/index.cjs +66 -54
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +66 -54
- package/locales/require.js +0 -1152
package/server/latest/index.cjs
CHANGED
|
@@ -61,7 +61,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
|
|
|
61
61
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
62
62
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
63
63
|
/*! Depict.ai search and product listing SDK */
|
|
64
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.
|
|
64
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.6";
|
|
65
65
|
|
|
66
66
|
/** @jsxImportSource solid-js */
|
|
67
67
|
|
|
@@ -1251,9 +1251,9 @@ function $c1dc1554c1b94233$export$430444115f70a734({
|
|
|
1251
1251
|
}
|
|
1252
1252
|
})));
|
|
1253
1253
|
}
|
|
1254
|
-
const $0b7222ba8a8bb72f$var$_tmpl$ = ["<div", ' class="
|
|
1254
|
+
const $0b7222ba8a8bb72f$var$_tmpl$ = ["<div", ' class="', '"><div class="input-group"><div class="field"><input', ' type="number"', '></div><div class="separator">-</div><div class="field"><input', ' type="number"', "></div></div><!--#-->", '<!--/--><div class="value-text"><span class="min"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", '<!--/--></span><span class="max"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></div></div>"],
|
|
1255
1255
|
$0b7222ba8a8bb72f$var$_tmpl$2 = ["<div", ' class="slider"><div class="progress" style="', '"></div></div>'],
|
|
1256
|
-
$0b7222ba8a8bb72f$var$_tmpl$3 = ["<div", ' class="range-group"><input type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1256
|
+
$0b7222ba8a8bb72f$var$_tmpl$3 = ["<div", ' class="range-group"><input', ' type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1257
1257
|
function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({
|
|
1258
1258
|
filter_: filter_,
|
|
1259
1259
|
selected_filters_: selected_filters_,
|
|
@@ -1326,11 +1326,13 @@ function $0b7222ba8a8bb72f$var$RangeSelector({
|
|
|
1326
1326
|
const [get_current_range] = current_range_;
|
|
1327
1327
|
const pre_price = $5vyXB$solidjs.createMemo(() => price_formatting_().pre_);
|
|
1328
1328
|
const post_price = $5vyXB$solidjs.createMemo(() => price_formatting_().post_);
|
|
1329
|
-
|
|
1329
|
+
const should_be_disabled_ = $5vyXB$solidjs.createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1330
|
+
return $5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `range ${min_() === max_() ? "disabled" : ""}`, $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape(get_current_range()[0], true), false), $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true) + $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape(get_current_range()[1], true), false), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent($0b7222ba8a8bb72f$var$ExponentialSlider, {
|
|
1330
1331
|
max_: max_,
|
|
1331
1332
|
min_: min_,
|
|
1332
1333
|
current_range_: current_range_,
|
|
1333
|
-
i18n_: i18n_
|
|
1334
|
+
i18n_: i18n_,
|
|
1335
|
+
should_be_disabled_: should_be_disabled_
|
|
1334
1336
|
})), $5vyXB$solidjsweb.escape(pre_price()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $d659702496cb72ea$export$a71e92cfbb498adc), {
|
|
1335
1337
|
get price_() {
|
|
1336
1338
|
return min_();
|
|
@@ -1351,13 +1353,13 @@ function $0b7222ba8a8bb72f$var$ExponentialSlider({
|
|
|
1351
1353
|
current_range_: current_range_,
|
|
1352
1354
|
min_: min_,
|
|
1353
1355
|
i18n_: i18n_,
|
|
1354
|
-
max_: max_
|
|
1356
|
+
max_: max_,
|
|
1357
|
+
should_be_disabled_: should_be_disabled_
|
|
1355
1358
|
}) {
|
|
1356
1359
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1357
1360
|
const transform_linear_to_nonlinear = ([smaller, larger]) => [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
1358
1361
|
const [read_current_range, write_current_range] = current_range_;
|
|
1359
|
-
const
|
|
1360
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
1362
|
+
const modified_range_accessor = $5vyXB$solidjs.createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
1361
1363
|
const modified_max = $5vyXB$solidjs.createMemo(() => Math.sqrt(max_()));
|
|
1362
1364
|
const modified_min = $5vyXB$solidjs.createMemo(() => Math.sqrt(min_()));
|
|
1363
1365
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -1365,23 +1367,28 @@ function $0b7222ba8a8bb72f$var$ExponentialSlider({
|
|
|
1365
1367
|
const changed = number_in_linear + how_many;
|
|
1366
1368
|
return Math.sqrt(changed);
|
|
1367
1369
|
};
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
const
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1370
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
1371
|
+
const modified_range_setter = new_range_or_function => {
|
|
1372
|
+
const old_range = $5vyXB$solidjs.untrack(modified_range_accessor);
|
|
1373
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
1374
|
+
const [smaller, larger] = new_range;
|
|
1375
|
+
const [old_smaller, old_larger] = old_range;
|
|
1376
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
1377
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
1378
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
1379
|
+
// If the new value gets identical rounding errors to the old value when being converted back, don't write it to the signal since it would cause an infinite loop
|
|
1380
|
+
return new_range;
|
|
1381
|
+
write_current_range(new_range_converted);
|
|
1382
|
+
return new_range;
|
|
1383
|
+
};
|
|
1379
1384
|
return $0b7222ba8a8bb72f$var$LinearSlider({
|
|
1380
|
-
current_range_:
|
|
1385
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
1386
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
1381
1387
|
min_: modified_min,
|
|
1382
1388
|
max_: modified_max,
|
|
1383
1389
|
offset_value_calculator_: offset_value_calculator_,
|
|
1384
|
-
i18n_: i18n_
|
|
1390
|
+
i18n_: i18n_,
|
|
1391
|
+
should_be_disabled_: should_be_disabled_
|
|
1385
1392
|
});
|
|
1386
1393
|
}
|
|
1387
1394
|
function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
@@ -1389,7 +1396,8 @@ function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
|
1389
1396
|
min_: min_,
|
|
1390
1397
|
current_range_: current_range_,
|
|
1391
1398
|
offset_value_calculator_: offset_value_calculator_,
|
|
1392
|
-
i18n_: i18n_
|
|
1399
|
+
i18n_: i18n_,
|
|
1400
|
+
should_be_disabled_: should_be_disabled_
|
|
1393
1401
|
}) {
|
|
1394
1402
|
let range_input_1;
|
|
1395
1403
|
let range_input_2;
|
|
@@ -1399,6 +1407,7 @@ function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
|
1399
1407
|
const min = min_();
|
|
1400
1408
|
const span = max_() - min;
|
|
1401
1409
|
const [start, end] = get_current_range();
|
|
1410
|
+
if (should_be_disabled_()) return `left:50%;right:50%`;
|
|
1402
1411
|
return `left:${(start - min) / span * 100}%;right:${100 - (end - min) / span * 100}%`;
|
|
1403
1412
|
});
|
|
1404
1413
|
const set_value = (el, index) => {
|
|
@@ -1412,13 +1421,13 @@ function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
|
1412
1421
|
el.value = get_current_range()[index];
|
|
1413
1422
|
});
|
|
1414
1423
|
};
|
|
1415
|
-
return [$5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrStyle(progress_styling())), $5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape($5vyXB$solidjs.createMemo(() => {
|
|
1424
|
+
return [$5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrStyle(progress_styling())), $5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape($5vyXB$solidjs.createMemo(() => {
|
|
1416
1425
|
min_();
|
|
1417
1426
|
max_();
|
|
1418
1427
|
return get_current_range()[0];
|
|
1419
1428
|
}, undefined, {
|
|
1420
1429
|
equals: false
|
|
1421
|
-
})(), true), false), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false))];
|
|
1430
|
+
})(), true), false), $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true) + $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false))];
|
|
1422
1431
|
}
|
|
1423
1432
|
function $0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_range_signal, index, target_el, get_offset_value = (value, how_many) => value + how_many) {
|
|
1424
1433
|
let value_as_number = +target_el.value;
|
|
@@ -1667,37 +1676,40 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1667
1676
|
return has_expandable();
|
|
1668
1677
|
},
|
|
1669
1678
|
get children() {
|
|
1670
|
-
return
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
+
return (() => {
|
|
1680
|
+
const is_open = $5vyXB$solidjs.createMemo(() => {
|
|
1681
|
+
const v = value();
|
|
1682
|
+
if (!v)
|
|
1683
|
+
// only to prevent cleanup errors
|
|
1684
|
+
return $5vyXB$solidjs.createSignal(false);
|
|
1685
|
+
const {
|
|
1686
|
+
is_expanded_: {
|
|
1687
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
1688
|
+
set_user_expanded_: set_user_expanded_
|
|
1679
1689
|
}
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1690
|
+
} = v;
|
|
1691
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
1692
|
+
});
|
|
1693
|
+
return $5vyXB$solidjsweb.createComponent((0, $a69e505a12a77874$export$6c6d7a51fa9aa15d), {
|
|
1694
|
+
get details_() {
|
|
1695
|
+
return $5vyXB$solidjsweb.ssr($3bdc00a1353c1150$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey());
|
|
1696
|
+
},
|
|
1697
|
+
get summary_() {
|
|
1698
|
+
return $5vyXB$solidjsweb.ssr($3bdc00a1353c1150$var$_tmpl$4, $5vyXB$solidjsweb.ssrHydrationKey(), `count ${value()?.count_ === 0 ? "count-0" : ""}`, $5vyXB$solidjsweb.escape(value()?.count_), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $7567511a7c3e4bd7$export$e5c2828934226505), {
|
|
1699
|
+
i18n_: i18n_,
|
|
1700
|
+
get expanded_() {
|
|
1701
|
+
return $5vyXB$solidjs.createMemo(() => value()?.is_expanded_?.ui_should_show_expanded_?.() ?? false);
|
|
1692
1702
|
}
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1703
|
+
})));
|
|
1704
|
+
},
|
|
1705
|
+
get is_open_() {
|
|
1706
|
+
return is_open();
|
|
1707
|
+
},
|
|
1708
|
+
get children() {
|
|
1709
|
+
return $3bdc00a1353c1150$var$render_stuff($5vyXB$solidjs.createMemo(() => value()?.children_ || {}), existing_filter, i18n_);
|
|
1710
|
+
}
|
|
1711
|
+
});
|
|
1712
|
+
})();
|
|
1701
1713
|
}
|
|
1702
1714
|
})));
|
|
1703
1715
|
})();
|
|
@@ -1760,7 +1772,7 @@ function $3bdc00a1353c1150$var$create_updating_signal({
|
|
|
1760
1772
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1761
1773
|
let updating_blocked = false;
|
|
1762
1774
|
const index_of_us_in_selected_filter = existing_filter_?.data?.findIndex?.(el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
1763
|
-
signal_.push(...$5vyXB$solidjs.createSignal(index_of_us_in_selected_filter >= 0
|
|
1775
|
+
signal_.push(...$5vyXB$solidjs.createSignal(index_of_us_in_selected_filter >= 0));
|
|
1764
1776
|
const [read_checked, write_checked] = signal_;
|
|
1765
1777
|
const child_objects = Object.values(self_.children_);
|
|
1766
1778
|
const get_child_object_values = child_objects.map(({
|
package/server/latest/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
|
|
|
7
7
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
8
8
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
|
-
export const version = "2.0.
|
|
10
|
+
export const version = "2.0.6";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|
package/server/latest/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, escape as
|
|
|
5
5
|
/*! Depict.ai search and product listing SDK */
|
|
6
6
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
7
7
|
register_es_version("ui", "latest");
|
|
8
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "2.0.
|
|
8
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "2.0.6";
|
|
9
9
|
|
|
10
10
|
/** @jsxImportSource solid-js */
|
|
11
11
|
|
|
@@ -1195,9 +1195,9 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({
|
|
|
1195
1195
|
}
|
|
1196
1196
|
})));
|
|
1197
1197
|
}
|
|
1198
|
-
const $a6b08770e164eced$var$_tmpl$ = ["<div", ' class="
|
|
1198
|
+
const $a6b08770e164eced$var$_tmpl$ = ["<div", ' class="', '"><div class="input-group"><div class="field"><input', ' type="number"', '></div><div class="separator">-</div><div class="field"><input', ' type="number"', "></div></div><!--#-->", '<!--/--><div class="value-text"><span class="min"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", '<!--/--></span><span class="max"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></div></div>"],
|
|
1199
1199
|
$a6b08770e164eced$var$_tmpl$2 = ["<div", ' class="slider"><div class="progress" style="', '"></div></div>'],
|
|
1200
|
-
$a6b08770e164eced$var$_tmpl$3 = ["<div", ' class="range-group"><input type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1200
|
+
$a6b08770e164eced$var$_tmpl$3 = ["<div", ' class="range-group"><input', ' type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1201
1201
|
function $a6b08770e164eced$export$e0d834a0ad870cda({
|
|
1202
1202
|
filter_: filter_,
|
|
1203
1203
|
selected_filters_: selected_filters_,
|
|
@@ -1270,11 +1270,13 @@ function $a6b08770e164eced$var$RangeSelector({
|
|
|
1270
1270
|
const [get_current_range] = current_range_;
|
|
1271
1271
|
const pre_price = $i7OB2$createMemo(() => price_formatting_().pre_);
|
|
1272
1272
|
const post_price = $i7OB2$createMemo(() => price_formatting_().post_);
|
|
1273
|
-
|
|
1273
|
+
const should_be_disabled_ = $i7OB2$createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1274
|
+
return $i7OB2$ssr($a6b08770e164eced$var$_tmpl$, $i7OB2$ssrHydrationKey(), `range ${min_() === max_() ? "disabled" : ""}`, $i7OB2$ssrAttribute("disabled", should_be_disabled_(), true), $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $i7OB2$ssrAttribute("min", $i7OB2$escape(min_(), true), false) + $i7OB2$ssrAttribute("max", $i7OB2$escape(max_(), true), false) + $i7OB2$ssrAttribute("value", $i7OB2$escape(get_current_range()[0], true), false), $i7OB2$ssrAttribute("disabled", should_be_disabled_(), true) + $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.range_filter_high_point_aria_label_(), true), false), $i7OB2$ssrAttribute("min", $i7OB2$escape(min_(), true), false) + $i7OB2$ssrAttribute("max", $i7OB2$escape(max_(), true), false) + $i7OB2$ssrAttribute("value", $i7OB2$escape(get_current_range()[1], true), false), $i7OB2$escape($i7OB2$createComponent($a6b08770e164eced$var$ExponentialSlider, {
|
|
1274
1275
|
max_: max_,
|
|
1275
1276
|
min_: min_,
|
|
1276
1277
|
current_range_: current_range_,
|
|
1277
|
-
i18n_: i18n_
|
|
1278
|
+
i18n_: i18n_,
|
|
1279
|
+
should_be_disabled_: should_be_disabled_
|
|
1278
1280
|
})), $i7OB2$escape(pre_price()), $i7OB2$escape($i7OB2$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
|
|
1279
1281
|
get price_() {
|
|
1280
1282
|
return min_();
|
|
@@ -1295,13 +1297,13 @@ function $a6b08770e164eced$var$ExponentialSlider({
|
|
|
1295
1297
|
current_range_: current_range_,
|
|
1296
1298
|
min_: min_,
|
|
1297
1299
|
i18n_: i18n_,
|
|
1298
|
-
max_: max_
|
|
1300
|
+
max_: max_,
|
|
1301
|
+
should_be_disabled_: should_be_disabled_
|
|
1299
1302
|
}) {
|
|
1300
1303
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1301
1304
|
const transform_linear_to_nonlinear = ([smaller, larger]) => [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
1302
1305
|
const [read_current_range, write_current_range] = current_range_;
|
|
1303
|
-
const
|
|
1304
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
1306
|
+
const modified_range_accessor = $i7OB2$createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
1305
1307
|
const modified_max = $i7OB2$createMemo(() => Math.sqrt(max_()));
|
|
1306
1308
|
const modified_min = $i7OB2$createMemo(() => Math.sqrt(min_()));
|
|
1307
1309
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -1309,23 +1311,28 @@ function $a6b08770e164eced$var$ExponentialSlider({
|
|
|
1309
1311
|
const changed = number_in_linear + how_many;
|
|
1310
1312
|
return Math.sqrt(changed);
|
|
1311
1313
|
};
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1314
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
1315
|
+
const modified_range_setter = new_range_or_function => {
|
|
1316
|
+
const old_range = $i7OB2$untrack(modified_range_accessor);
|
|
1317
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
1318
|
+
const [smaller, larger] = new_range;
|
|
1319
|
+
const [old_smaller, old_larger] = old_range;
|
|
1320
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
1321
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
1322
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
1323
|
+
// If the new value gets identical rounding errors to the old value when being converted back, don't write it to the signal since it would cause an infinite loop
|
|
1324
|
+
return new_range;
|
|
1325
|
+
write_current_range(new_range_converted);
|
|
1326
|
+
return new_range;
|
|
1327
|
+
};
|
|
1323
1328
|
return $a6b08770e164eced$var$LinearSlider({
|
|
1324
|
-
current_range_:
|
|
1329
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
1330
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
1325
1331
|
min_: modified_min,
|
|
1326
1332
|
max_: modified_max,
|
|
1327
1333
|
offset_value_calculator_: offset_value_calculator_,
|
|
1328
|
-
i18n_: i18n_
|
|
1334
|
+
i18n_: i18n_,
|
|
1335
|
+
should_be_disabled_: should_be_disabled_
|
|
1329
1336
|
});
|
|
1330
1337
|
}
|
|
1331
1338
|
function $a6b08770e164eced$var$LinearSlider({
|
|
@@ -1333,7 +1340,8 @@ function $a6b08770e164eced$var$LinearSlider({
|
|
|
1333
1340
|
min_: min_,
|
|
1334
1341
|
current_range_: current_range_,
|
|
1335
1342
|
offset_value_calculator_: offset_value_calculator_,
|
|
1336
|
-
i18n_: i18n_
|
|
1343
|
+
i18n_: i18n_,
|
|
1344
|
+
should_be_disabled_: should_be_disabled_
|
|
1337
1345
|
}) {
|
|
1338
1346
|
let range_input_1;
|
|
1339
1347
|
let range_input_2;
|
|
@@ -1343,6 +1351,7 @@ function $a6b08770e164eced$var$LinearSlider({
|
|
|
1343
1351
|
const min = min_();
|
|
1344
1352
|
const span = max_() - min;
|
|
1345
1353
|
const [start, end] = get_current_range();
|
|
1354
|
+
if (should_be_disabled_()) return `left:50%;right:50%`;
|
|
1346
1355
|
return `left:${(start - min) / span * 100}%;right:${100 - (end - min) / span * 100}%`;
|
|
1347
1356
|
});
|
|
1348
1357
|
const set_value = (el, index) => {
|
|
@@ -1356,13 +1365,13 @@ function $a6b08770e164eced$var$LinearSlider({
|
|
|
1356
1365
|
el.value = get_current_range()[index];
|
|
1357
1366
|
});
|
|
1358
1367
|
};
|
|
1359
|
-
return [$i7OB2$ssr($a6b08770e164eced$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$ssrStyle(progress_styling())), $i7OB2$ssr($a6b08770e164eced$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $i7OB2$ssrAttribute("min", $i7OB2$escape(min_(), true), false) + $i7OB2$ssrAttribute("max", $i7OB2$escape(max_(), true), false) + $i7OB2$ssrAttribute("value", $i7OB2$escape($i7OB2$createMemo(() => {
|
|
1368
|
+
return [$i7OB2$ssr($a6b08770e164eced$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$ssrStyle(progress_styling())), $i7OB2$ssr($a6b08770e164eced$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("disabled", should_be_disabled_(), true), $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $i7OB2$ssrAttribute("min", $i7OB2$escape(min_(), true), false) + $i7OB2$ssrAttribute("max", $i7OB2$escape(max_(), true), false) + $i7OB2$ssrAttribute("value", $i7OB2$escape($i7OB2$createMemo(() => {
|
|
1360
1369
|
min_();
|
|
1361
1370
|
max_();
|
|
1362
1371
|
return get_current_range()[0];
|
|
1363
1372
|
}, undefined, {
|
|
1364
1373
|
equals: false
|
|
1365
|
-
})(), true), false), $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.range_filter_high_point_aria_label_(), true), false), $i7OB2$ssrAttribute("min", $i7OB2$escape(min_(), true), false) + $i7OB2$ssrAttribute("max", $i7OB2$escape(max_(), true), false))];
|
|
1374
|
+
})(), true), false), $i7OB2$ssrAttribute("disabled", should_be_disabled_(), true) + $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.range_filter_high_point_aria_label_(), true), false), $i7OB2$ssrAttribute("min", $i7OB2$escape(min_(), true), false) + $i7OB2$ssrAttribute("max", $i7OB2$escape(max_(), true), false))];
|
|
1366
1375
|
}
|
|
1367
1376
|
function $a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_range_signal, index, target_el, get_offset_value = (value, how_many) => value + how_many) {
|
|
1368
1377
|
let value_as_number = +target_el.value;
|
|
@@ -1611,37 +1620,40 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1611
1620
|
return has_expandable();
|
|
1612
1621
|
},
|
|
1613
1622
|
get children() {
|
|
1614
|
-
return
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
+
return (() => {
|
|
1624
|
+
const is_open = $i7OB2$createMemo(() => {
|
|
1625
|
+
const v = value();
|
|
1626
|
+
if (!v)
|
|
1627
|
+
// only to prevent cleanup errors
|
|
1628
|
+
return $i7OB2$createSignal(false);
|
|
1629
|
+
const {
|
|
1630
|
+
is_expanded_: {
|
|
1631
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
1632
|
+
set_user_expanded_: set_user_expanded_
|
|
1623
1633
|
}
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1634
|
+
} = v;
|
|
1635
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
1636
|
+
});
|
|
1637
|
+
return $i7OB2$createComponent((0, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d), {
|
|
1638
|
+
get details_() {
|
|
1639
|
+
return $i7OB2$ssr($1c8cac76cb67e9af$var$_tmpl$3, $i7OB2$ssrHydrationKey());
|
|
1640
|
+
},
|
|
1641
|
+
get summary_() {
|
|
1642
|
+
return $i7OB2$ssr($1c8cac76cb67e9af$var$_tmpl$4, $i7OB2$ssrHydrationKey(), `count ${value()?.count_ === 0 ? "count-0" : ""}`, $i7OB2$escape(value()?.count_), $i7OB2$escape($i7OB2$createComponent((0, $0b6bc2f8309efa8a$export$e5c2828934226505), {
|
|
1643
|
+
i18n_: i18n_,
|
|
1644
|
+
get expanded_() {
|
|
1645
|
+
return $i7OB2$createMemo(() => value()?.is_expanded_?.ui_should_show_expanded_?.() ?? false);
|
|
1636
1646
|
}
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1647
|
+
})));
|
|
1648
|
+
},
|
|
1649
|
+
get is_open_() {
|
|
1650
|
+
return is_open();
|
|
1651
|
+
},
|
|
1652
|
+
get children() {
|
|
1653
|
+
return $1c8cac76cb67e9af$var$render_stuff($i7OB2$createMemo(() => value()?.children_ || {}), existing_filter, i18n_);
|
|
1654
|
+
}
|
|
1655
|
+
});
|
|
1656
|
+
})();
|
|
1645
1657
|
}
|
|
1646
1658
|
})));
|
|
1647
1659
|
})();
|
|
@@ -1704,7 +1716,7 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
|
|
|
1704
1716
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1705
1717
|
let updating_blocked = false;
|
|
1706
1718
|
const index_of_us_in_selected_filter = existing_filter_?.data?.findIndex?.(el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
1707
|
-
signal_.push(...$i7OB2$createSignal(index_of_us_in_selected_filter >= 0
|
|
1719
|
+
signal_.push(...$i7OB2$createSignal(index_of_us_in_selected_filter >= 0));
|
|
1708
1720
|
const [read_checked, write_checked] = signal_;
|
|
1709
1721
|
const child_objects = Object.values(self_.children_);
|
|
1710
1722
|
const get_child_object_values = child_objects.map(({
|