@depict-ai/ui 2.0.4 → 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 +139 -109
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +139 -109
- package/latest/index.cjs +125 -92
- package/latest/index.d.ts +1 -1
- package/latest/index.js +125 -92
- package/package.json +2 -2
- package/server/ES10/index.cjs +82 -67
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +82 -67
- package/server/latest/index.cjs +73 -55
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +73 -55
package/latest/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, i
|
|
|
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
|
|
|
@@ -1684,6 +1684,9 @@ function $a6b08770e164eced$export$e0d834a0ad870cda({
|
|
|
1684
1684
|
selected_filters_: selected_filters_,
|
|
1685
1685
|
i18n_: i18n_
|
|
1686
1686
|
}) {
|
|
1687
|
+
// If you ever attempt to implement that one can drag one range "knob" over the other like on prisjakt, see https://gitlab.com/depict-ai/depict.ai/-/merge_requests/8458/diffs?commit_id=c52dbdd15ca073489bee138b15d27bb6bf2992df
|
|
1688
|
+
// The issue with it is that one wants to discard the changes to the lower value as soon as the lower value has become the upper value when dragging the initially lower knob over the initially upper knob
|
|
1689
|
+
// But we can't reliably know when we've started dragging/changing the value (or at least I gave up at that point for now)
|
|
1687
1690
|
const current_range = $9HbP8$createSignal($9HbP8$untrack(() => filter_().data));
|
|
1688
1691
|
const selected_filter = $9HbP8$createMemo(() => selected_filters_[0]().find(({
|
|
1689
1692
|
field: checking_field,
|
|
@@ -1748,6 +1751,7 @@ function $a6b08770e164eced$var$RangeSelector({
|
|
|
1748
1751
|
const [get_current_range] = current_range_;
|
|
1749
1752
|
const pre_price = $9HbP8$createMemo(() => price_formatting_().pre_);
|
|
1750
1753
|
const post_price = $9HbP8$createMemo(() => price_formatting_().post_);
|
|
1754
|
+
const should_be_disabled_ = $9HbP8$createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1751
1755
|
return (() => {
|
|
1752
1756
|
const _el$ = $9HbP8$getNextElement($a6b08770e164eced$var$_tmpl$),
|
|
1753
1757
|
_el$2 = _el$.firstChild,
|
|
@@ -1793,7 +1797,8 @@ function $a6b08770e164eced$var$RangeSelector({
|
|
|
1793
1797
|
max_: max_,
|
|
1794
1798
|
min_: min_,
|
|
1795
1799
|
current_range_: current_range_,
|
|
1796
|
-
i18n_: i18n_
|
|
1800
|
+
i18n_: i18n_,
|
|
1801
|
+
should_be_disabled_: should_be_disabled_
|
|
1797
1802
|
}), _el$24, _co$7);
|
|
1798
1803
|
$9HbP8$insert(_el$9, pre_price, _el$11, _co$);
|
|
1799
1804
|
$9HbP8$insert(_el$9, $9HbP8$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
|
|
@@ -1816,18 +1821,24 @@ function $a6b08770e164eced$var$RangeSelector({
|
|
|
1816
1821
|
}), _el$20, _co$5);
|
|
1817
1822
|
$9HbP8$insert(_el$16, post_price, _el$22, _co$6);
|
|
1818
1823
|
$9HbP8$effect(_p$ => {
|
|
1819
|
-
const _v$ =
|
|
1820
|
-
_v$2 =
|
|
1821
|
-
_v$3 =
|
|
1822
|
-
_v$4 =
|
|
1823
|
-
_v$5 =
|
|
1824
|
-
_v$6 =
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
_v$
|
|
1829
|
-
_v$
|
|
1830
|
-
_v$
|
|
1824
|
+
const _v$ = !!(min_() === max_()),
|
|
1825
|
+
_v$2 = should_be_disabled_(),
|
|
1826
|
+
_v$3 = i18n_.range_filter_low_point_aria_label_(),
|
|
1827
|
+
_v$4 = min_(),
|
|
1828
|
+
_v$5 = max_(),
|
|
1829
|
+
_v$6 = should_be_disabled_(),
|
|
1830
|
+
_v$7 = i18n_.range_filter_high_point_aria_label_(),
|
|
1831
|
+
_v$8 = min_(),
|
|
1832
|
+
_v$9 = max_();
|
|
1833
|
+
_v$ !== _p$._v$ && _el$.classList.toggle("disabled", _p$._v$ = _v$);
|
|
1834
|
+
_v$2 !== _p$._v$2 && (_el$4.disabled = _p$._v$2 = _v$2);
|
|
1835
|
+
_v$3 !== _p$._v$3 && $9HbP8$setAttribute(_el$4, "aria-label", _p$._v$3 = _v$3);
|
|
1836
|
+
_v$4 !== _p$._v$4 && $9HbP8$setAttribute(_el$4, "min", _p$._v$4 = _v$4);
|
|
1837
|
+
_v$5 !== _p$._v$5 && $9HbP8$setAttribute(_el$4, "max", _p$._v$5 = _v$5);
|
|
1838
|
+
_v$6 !== _p$._v$6 && (_el$7.disabled = _p$._v$6 = _v$6);
|
|
1839
|
+
_v$7 !== _p$._v$7 && $9HbP8$setAttribute(_el$7, "aria-label", _p$._v$7 = _v$7);
|
|
1840
|
+
_v$8 !== _p$._v$8 && $9HbP8$setAttribute(_el$7, "min", _p$._v$8 = _v$8);
|
|
1841
|
+
_v$9 !== _p$._v$9 && $9HbP8$setAttribute(_el$7, "max", _p$._v$9 = _v$9);
|
|
1831
1842
|
return _p$;
|
|
1832
1843
|
}, {
|
|
1833
1844
|
_v$: undefined,
|
|
@@ -1835,7 +1846,10 @@ function $a6b08770e164eced$var$RangeSelector({
|
|
|
1835
1846
|
_v$3: undefined,
|
|
1836
1847
|
_v$4: undefined,
|
|
1837
1848
|
_v$5: undefined,
|
|
1838
|
-
_v$6: undefined
|
|
1849
|
+
_v$6: undefined,
|
|
1850
|
+
_v$7: undefined,
|
|
1851
|
+
_v$8: undefined,
|
|
1852
|
+
_v$9: undefined
|
|
1839
1853
|
});
|
|
1840
1854
|
$9HbP8$effect(() => _el$4.value = get_current_range()[0]);
|
|
1841
1855
|
$9HbP8$effect(() => _el$7.value = get_current_range()[1]);
|
|
@@ -1847,13 +1861,13 @@ function $a6b08770e164eced$var$ExponentialSlider({
|
|
|
1847
1861
|
current_range_: current_range_,
|
|
1848
1862
|
min_: min_,
|
|
1849
1863
|
i18n_: i18n_,
|
|
1850
|
-
max_: max_
|
|
1864
|
+
max_: max_,
|
|
1865
|
+
should_be_disabled_: should_be_disabled_
|
|
1851
1866
|
}) {
|
|
1852
1867
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1853
1868
|
const transform_linear_to_nonlinear = ([smaller, larger]) => [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
1854
1869
|
const [read_current_range, write_current_range] = current_range_;
|
|
1855
|
-
const
|
|
1856
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
1870
|
+
const modified_range_accessor = $9HbP8$createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
1857
1871
|
const modified_max = $9HbP8$createMemo(() => Math.sqrt(max_()));
|
|
1858
1872
|
const modified_min = $9HbP8$createMemo(() => Math.sqrt(min_()));
|
|
1859
1873
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -1861,23 +1875,28 @@ function $a6b08770e164eced$var$ExponentialSlider({
|
|
|
1861
1875
|
const changed = number_in_linear + how_many;
|
|
1862
1876
|
return Math.sqrt(changed);
|
|
1863
1877
|
};
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
const
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1878
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
1879
|
+
const modified_range_setter = new_range_or_function => {
|
|
1880
|
+
const old_range = $9HbP8$untrack(modified_range_accessor);
|
|
1881
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
1882
|
+
const [smaller, larger] = new_range;
|
|
1883
|
+
const [old_smaller, old_larger] = old_range;
|
|
1884
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
1885
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
1886
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
1887
|
+
// 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
|
|
1888
|
+
return new_range;
|
|
1889
|
+
write_current_range(new_range_converted);
|
|
1890
|
+
return new_range;
|
|
1891
|
+
};
|
|
1875
1892
|
return $a6b08770e164eced$var$LinearSlider({
|
|
1876
|
-
current_range_:
|
|
1893
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
1894
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
1877
1895
|
min_: modified_min,
|
|
1878
1896
|
max_: modified_max,
|
|
1879
1897
|
offset_value_calculator_: offset_value_calculator_,
|
|
1880
|
-
i18n_: i18n_
|
|
1898
|
+
i18n_: i18n_,
|
|
1899
|
+
should_be_disabled_: should_be_disabled_
|
|
1881
1900
|
});
|
|
1882
1901
|
}
|
|
1883
1902
|
function $a6b08770e164eced$var$LinearSlider({
|
|
@@ -1885,14 +1904,19 @@ function $a6b08770e164eced$var$LinearSlider({
|
|
|
1885
1904
|
min_: min_,
|
|
1886
1905
|
current_range_: current_range_,
|
|
1887
1906
|
offset_value_calculator_: offset_value_calculator_,
|
|
1888
|
-
i18n_: i18n_
|
|
1907
|
+
i18n_: i18n_,
|
|
1908
|
+
should_be_disabled_: should_be_disabled_
|
|
1889
1909
|
}) {
|
|
1890
1910
|
let range_input_1;
|
|
1891
1911
|
let range_input_2;
|
|
1892
1912
|
let clickable_slider;
|
|
1893
1913
|
const [get_current_range, set_current_range] = current_range_;
|
|
1894
1914
|
const progress_styling = $9HbP8$createMemo(() => {
|
|
1895
|
-
|
|
1915
|
+
const min = min_();
|
|
1916
|
+
const span = max_() - min;
|
|
1917
|
+
const [start, end] = get_current_range();
|
|
1918
|
+
if (should_be_disabled_()) return `left:50%;right:50%`;
|
|
1919
|
+
return `left:${(start - min) / span * 100}%;right:${100 - (end - min) / span * 100}%`;
|
|
1896
1920
|
});
|
|
1897
1921
|
const set_value = (el, index) => {
|
|
1898
1922
|
// initially I set the value on the elements by just having value={get_current_range()[0]}
|
|
@@ -1915,7 +1939,7 @@ function $a6b08770e164eced$var$LinearSlider({
|
|
|
1915
1939
|
const click_from_left_in_slider = e.clientX - slider_beginning_left; // both of these value contain scroll position so this should work regardless of horisontal scroll if there is any
|
|
1916
1940
|
const place_of_click_in_percent = click_from_left_in_slider / slider_width * 100;
|
|
1917
1941
|
const one_percent_of_range = (max_() - min_()) / 100;
|
|
1918
|
-
const place_of_click =
|
|
1942
|
+
const place_of_click = min_() + one_percent_of_range * place_of_click_in_percent;
|
|
1919
1943
|
const [lower, upper] = get_current_range();
|
|
1920
1944
|
const distance_to_lower_point = Math.abs(place_of_click - lower);
|
|
1921
1945
|
const distance_to_upper_point = Math.abs(upper - place_of_click);
|
|
@@ -1941,26 +1965,32 @@ function $a6b08770e164eced$var$LinearSlider({
|
|
|
1941
1965
|
}, _el$29);
|
|
1942
1966
|
$9HbP8$addEventListener(_el$29, "input", $9HbP8$catchify(() => $a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_range_, 1, range_input_2, offset_value_calculator_)), true);
|
|
1943
1967
|
$9HbP8$effect(_p$ => {
|
|
1944
|
-
const _v$
|
|
1945
|
-
_v$
|
|
1946
|
-
_v$
|
|
1947
|
-
_v$
|
|
1948
|
-
_v$
|
|
1949
|
-
_v$
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
_v$
|
|
1953
|
-
_v$
|
|
1954
|
-
_v$
|
|
1955
|
-
_v$
|
|
1968
|
+
const _v$10 = should_be_disabled_(),
|
|
1969
|
+
_v$11 = i18n_.range_filter_low_point_aria_label_(),
|
|
1970
|
+
_v$12 = min_(),
|
|
1971
|
+
_v$13 = max_(),
|
|
1972
|
+
_v$14 = should_be_disabled_(),
|
|
1973
|
+
_v$15 = i18n_.range_filter_high_point_aria_label_(),
|
|
1974
|
+
_v$16 = min_(),
|
|
1975
|
+
_v$17 = max_();
|
|
1976
|
+
_v$10 !== _p$._v$10 && (_el$28.disabled = _p$._v$10 = _v$10);
|
|
1977
|
+
_v$11 !== _p$._v$11 && $9HbP8$setAttribute(_el$28, "aria-label", _p$._v$11 = _v$11);
|
|
1978
|
+
_v$12 !== _p$._v$12 && $9HbP8$setAttribute(_el$28, "min", _p$._v$12 = _v$12);
|
|
1979
|
+
_v$13 !== _p$._v$13 && $9HbP8$setAttribute(_el$28, "max", _p$._v$13 = _v$13);
|
|
1980
|
+
_v$14 !== _p$._v$14 && (_el$29.disabled = _p$._v$14 = _v$14);
|
|
1981
|
+
_v$15 !== _p$._v$15 && $9HbP8$setAttribute(_el$29, "aria-label", _p$._v$15 = _v$15);
|
|
1982
|
+
_v$16 !== _p$._v$16 && $9HbP8$setAttribute(_el$29, "min", _p$._v$16 = _v$16);
|
|
1983
|
+
_v$17 !== _p$._v$17 && $9HbP8$setAttribute(_el$29, "max", _p$._v$17 = _v$17);
|
|
1956
1984
|
return _p$;
|
|
1957
1985
|
}, {
|
|
1958
|
-
_v$7: undefined,
|
|
1959
|
-
_v$8: undefined,
|
|
1960
|
-
_v$9: undefined,
|
|
1961
1986
|
_v$10: undefined,
|
|
1962
1987
|
_v$11: undefined,
|
|
1963
|
-
_v$12: undefined
|
|
1988
|
+
_v$12: undefined,
|
|
1989
|
+
_v$13: undefined,
|
|
1990
|
+
_v$14: undefined,
|
|
1991
|
+
_v$15: undefined,
|
|
1992
|
+
_v$16: undefined,
|
|
1993
|
+
_v$17: undefined
|
|
1964
1994
|
});
|
|
1965
1995
|
$9HbP8$effect(() => _el$28.value = $9HbP8$createMemo(() => {
|
|
1966
1996
|
min_();
|
|
@@ -2250,47 +2280,50 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2250
2280
|
return has_expandable();
|
|
2251
2281
|
},
|
|
2252
2282
|
get children() {
|
|
2253
|
-
return
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
return
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
}
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2283
|
+
return (() => {
|
|
2284
|
+
const is_open = $9HbP8$createMemo(() => {
|
|
2285
|
+
const v = value();
|
|
2286
|
+
if (!v)
|
|
2287
|
+
// only to prevent cleanup errors
|
|
2288
|
+
return $9HbP8$createSignal(false);
|
|
2289
|
+
const {
|
|
2290
|
+
is_expanded_: {
|
|
2291
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
2292
|
+
set_user_expanded_: set_user_expanded_
|
|
2293
|
+
}
|
|
2294
|
+
} = v;
|
|
2295
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
2296
|
+
});
|
|
2297
|
+
return $9HbP8$createComponent((0, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d), {
|
|
2298
|
+
get details_() {
|
|
2299
|
+
return $9HbP8$getNextElement($1c8cac76cb67e9af$var$_tmpl$3);
|
|
2300
|
+
},
|
|
2301
|
+
get summary_() {
|
|
2302
|
+
return (() => {
|
|
2303
|
+
const _el$12 = $9HbP8$getNextElement($1c8cac76cb67e9af$var$_tmpl$4),
|
|
2304
|
+
_el$13 = _el$12.firstChild,
|
|
2305
|
+
_el$14 = _el$13.firstChild,
|
|
2306
|
+
_el$15 = _el$14.nextSibling,
|
|
2307
|
+
[_el$16, _co$5] = $9HbP8$getNextMarker(_el$15.nextSibling);
|
|
2308
|
+
$9HbP8$insert(_el$14, () => value()?.count_);
|
|
2309
|
+
$9HbP8$insert(_el$13, $9HbP8$createComponent((0, $0b6bc2f8309efa8a$export$e5c2828934226505), {
|
|
2310
|
+
i18n_: i18n_,
|
|
2311
|
+
get expanded_() {
|
|
2312
|
+
return $9HbP8$createMemo(() => value()?.is_expanded_?.ui_should_show_expanded_?.() ?? false);
|
|
2313
|
+
}
|
|
2314
|
+
}), _el$16, _co$5);
|
|
2315
|
+
$9HbP8$effect(() => _el$14.classList.toggle("count-0", !!(value()?.count_ === 0)));
|
|
2316
|
+
return _el$12;
|
|
2317
|
+
})();
|
|
2318
|
+
},
|
|
2319
|
+
get is_open_() {
|
|
2320
|
+
return is_open();
|
|
2321
|
+
},
|
|
2322
|
+
get children() {
|
|
2323
|
+
return $1c8cac76cb67e9af$var$render_stuff($9HbP8$createMemo(() => value()?.children_ || {}), existing_filter, i18n_);
|
|
2324
|
+
}
|
|
2325
|
+
});
|
|
2326
|
+
})();
|
|
2294
2327
|
}
|
|
2295
2328
|
}), _el$10, _co$4);
|
|
2296
2329
|
$9HbP8$effect(() => _el$6.classList.toggle("expandable", !!has_expandable()));
|
|
@@ -2356,7 +2389,7 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
|
|
|
2356
2389
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
2357
2390
|
let updating_blocked = false;
|
|
2358
2391
|
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));
|
|
2359
|
-
signal_.push(...$9HbP8$createSignal(index_of_us_in_selected_filter >= 0
|
|
2392
|
+
signal_.push(...$9HbP8$createSignal(index_of_us_in_selected_filter >= 0));
|
|
2360
2393
|
const [read_checked, write_checked] = signal_;
|
|
2361
2394
|
const child_objects = Object.values(self_.children_);
|
|
2362
2395
|
const get_child_object_values = child_objects.map(({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
237
237
|
"@babel/runtime": "latest",
|
|
238
238
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
239
|
-
"@depict-ai/plp-styling": "^1.2.
|
|
239
|
+
"@depict-ai/plp-styling": "^1.2.5",
|
|
240
240
|
"@depict-ai/types": "^1.0.39",
|
|
241
241
|
"@depict-ai/utilishared": "^1.0.42",
|
|
242
242
|
"solid-js": "^1.7.3"
|
package/server/ES10/index.cjs
CHANGED
|
@@ -67,7 +67,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
67
67
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
68
68
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
69
69
|
/*! Depict.ai search and product listing SDK */
|
|
70
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.
|
|
70
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.6";
|
|
71
71
|
|
|
72
72
|
/** @jsxImportSource solid-js */
|
|
73
73
|
|
|
@@ -1337,15 +1337,18 @@ function $d9239dad9a9d899b$export$430444115f70a734(_ref) {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
})));
|
|
1339
1339
|
}
|
|
1340
|
-
const $0257c760a99bfacb$var$_tmpl$ = ["<div", ' class="
|
|
1340
|
+
const $0257c760a99bfacb$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>"],
|
|
1341
1341
|
$0257c760a99bfacb$var$_tmpl$2 = ["<div", ' class="slider"><div class="progress" style="', '"></div></div>'],
|
|
1342
|
-
$0257c760a99bfacb$var$_tmpl$3 = ["<div", ' class="range-group"><input type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1342
|
+
$0257c760a99bfacb$var$_tmpl$3 = ["<div", ' class="range-group"><input', ' type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1343
1343
|
function $0257c760a99bfacb$export$e0d834a0ad870cda(_ref) {
|
|
1344
1344
|
let {
|
|
1345
1345
|
filter_: filter_,
|
|
1346
1346
|
selected_filters_: selected_filters_,
|
|
1347
1347
|
i18n_: i18n_
|
|
1348
1348
|
} = _ref;
|
|
1349
|
+
// If you ever attempt to implement that one can drag one range "knob" over the other like on prisjakt, see https://gitlab.com/depict-ai/depict.ai/-/merge_requests/8458/diffs?commit_id=c52dbdd15ca073489bee138b15d27bb6bf2992df
|
|
1350
|
+
// The issue with it is that one wants to discard the changes to the lower value as soon as the lower value has become the upper value when dragging the initially lower knob over the initially upper knob
|
|
1351
|
+
// But we can't reliably know when we've started dragging/changing the value (or at least I gave up at that point for now)
|
|
1349
1352
|
const current_range = $3hooq$solidjs.createSignal($3hooq$solidjs.untrack(() => filter_().data));
|
|
1350
1353
|
const selected_filter = $3hooq$solidjs.createMemo(() => selected_filters_[0]().find(_ref2 => {
|
|
1351
1354
|
let {
|
|
@@ -1415,11 +1418,13 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
1415
1418
|
const [get_current_range] = current_range_;
|
|
1416
1419
|
const pre_price = $3hooq$solidjs.createMemo(() => price_formatting_().pre_);
|
|
1417
1420
|
const post_price = $3hooq$solidjs.createMemo(() => price_formatting_().post_);
|
|
1418
|
-
|
|
1421
|
+
const should_be_disabled_ = $3hooq$solidjs.createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1422
|
+
return $3hooq$solidjsweb.ssr($0257c760a99bfacb$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "range ".concat(min_() === max_() ? "disabled" : ""), $3hooq$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true), $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $3hooq$solidjsweb.ssrAttribute("min", $3hooq$solidjsweb.escape(min_(), true), false) + $3hooq$solidjsweb.ssrAttribute("max", $3hooq$solidjsweb.escape(max_(), true), false) + $3hooq$solidjsweb.ssrAttribute("value", $3hooq$solidjsweb.escape(get_current_range()[0], true), false), $3hooq$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true) + $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $3hooq$solidjsweb.ssrAttribute("min", $3hooq$solidjsweb.escape(min_(), true), false) + $3hooq$solidjsweb.ssrAttribute("max", $3hooq$solidjsweb.escape(max_(), true), false) + $3hooq$solidjsweb.ssrAttribute("value", $3hooq$solidjsweb.escape(get_current_range()[1], true), false), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent($0257c760a99bfacb$var$ExponentialSlider, {
|
|
1419
1423
|
max_: max_,
|
|
1420
1424
|
min_: min_,
|
|
1421
1425
|
current_range_: current_range_,
|
|
1422
|
-
i18n_: i18n_
|
|
1426
|
+
i18n_: i18n_,
|
|
1427
|
+
should_be_disabled_: should_be_disabled_
|
|
1423
1428
|
})), $3hooq$solidjsweb.escape(pre_price()), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $f38f2e64ebe2da86$export$a71e92cfbb498adc), {
|
|
1424
1429
|
get price_() {
|
|
1425
1430
|
return min_();
|
|
@@ -1441,7 +1446,8 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref4) {
|
|
|
1441
1446
|
current_range_: current_range_,
|
|
1442
1447
|
min_: min_,
|
|
1443
1448
|
i18n_: i18n_,
|
|
1444
|
-
max_: max_
|
|
1449
|
+
max_: max_,
|
|
1450
|
+
should_be_disabled_: should_be_disabled_
|
|
1445
1451
|
} = _ref4;
|
|
1446
1452
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1447
1453
|
const transform_linear_to_nonlinear = _ref5 => {
|
|
@@ -1449,8 +1455,7 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref4) {
|
|
|
1449
1455
|
return [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
1450
1456
|
};
|
|
1451
1457
|
const [read_current_range, write_current_range] = current_range_;
|
|
1452
|
-
const
|
|
1453
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
1458
|
+
const modified_range_accessor = $3hooq$solidjs.createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
1454
1459
|
const modified_max = $3hooq$solidjs.createMemo(() => Math.sqrt(max_()));
|
|
1455
1460
|
const modified_min = $3hooq$solidjs.createMemo(() => Math.sqrt(min_()));
|
|
1456
1461
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -1458,42 +1463,49 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref4) {
|
|
|
1458
1463
|
const changed = number_in_linear + how_many;
|
|
1459
1464
|
return Math.sqrt(changed);
|
|
1460
1465
|
};
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
const
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
}
|
|
1466
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
1467
|
+
const modified_range_setter = new_range_or_function => {
|
|
1468
|
+
const old_range = $3hooq$solidjs.untrack(modified_range_accessor);
|
|
1469
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
1470
|
+
const [smaller, larger] = new_range;
|
|
1471
|
+
const [old_smaller, old_larger] = old_range;
|
|
1472
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
1473
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
1474
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
1475
|
+
// 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
|
|
1476
|
+
return new_range;
|
|
1477
|
+
write_current_range(new_range_converted);
|
|
1478
|
+
return new_range;
|
|
1479
|
+
};
|
|
1475
1480
|
return $0257c760a99bfacb$var$LinearSlider({
|
|
1476
|
-
current_range_:
|
|
1481
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
1482
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
1477
1483
|
min_: modified_min,
|
|
1478
1484
|
max_: modified_max,
|
|
1479
1485
|
offset_value_calculator_: offset_value_calculator_,
|
|
1480
|
-
i18n_: i18n_
|
|
1486
|
+
i18n_: i18n_,
|
|
1487
|
+
should_be_disabled_: should_be_disabled_
|
|
1481
1488
|
});
|
|
1482
1489
|
}
|
|
1483
|
-
function $0257c760a99bfacb$var$LinearSlider(
|
|
1490
|
+
function $0257c760a99bfacb$var$LinearSlider(_ref6) {
|
|
1484
1491
|
let {
|
|
1485
1492
|
max_: max_,
|
|
1486
1493
|
min_: min_,
|
|
1487
1494
|
current_range_: current_range_,
|
|
1488
1495
|
offset_value_calculator_: offset_value_calculator_,
|
|
1489
|
-
i18n_: i18n_
|
|
1490
|
-
|
|
1496
|
+
i18n_: i18n_,
|
|
1497
|
+
should_be_disabled_: should_be_disabled_
|
|
1498
|
+
} = _ref6;
|
|
1491
1499
|
let range_input_1;
|
|
1492
1500
|
let range_input_2;
|
|
1493
1501
|
let clickable_slider;
|
|
1494
1502
|
const [get_current_range, set_current_range] = current_range_;
|
|
1495
1503
|
const progress_styling = $3hooq$solidjs.createMemo(() => {
|
|
1496
|
-
|
|
1504
|
+
const min = min_();
|
|
1505
|
+
const span = max_() - min;
|
|
1506
|
+
const [start, end] = get_current_range();
|
|
1507
|
+
if (should_be_disabled_()) return "left:50%;right:50%";
|
|
1508
|
+
return "left:".concat((start - min) / span * 100, "%;right:").concat(100 - (end - min) / span * 100, "%");
|
|
1497
1509
|
});
|
|
1498
1510
|
const set_value = (el, index) => {
|
|
1499
1511
|
// initially I set the value on the elements by just having value={get_current_range()[0]}
|
|
@@ -1506,13 +1518,13 @@ function $0257c760a99bfacb$var$LinearSlider(_ref7) {
|
|
|
1506
1518
|
el.value = get_current_range()[index];
|
|
1507
1519
|
});
|
|
1508
1520
|
};
|
|
1509
|
-
return [$3hooq$solidjsweb.ssr($0257c760a99bfacb$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrStyle(progress_styling())), $3hooq$solidjsweb.ssr($0257c760a99bfacb$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $3hooq$solidjsweb.ssrAttribute("min", $3hooq$solidjsweb.escape(min_(), true), false) + $3hooq$solidjsweb.ssrAttribute("max", $3hooq$solidjsweb.escape(max_(), true), false) + $3hooq$solidjsweb.ssrAttribute("value", $3hooq$solidjsweb.escape($3hooq$solidjs.createMemo(() => {
|
|
1521
|
+
return [$3hooq$solidjsweb.ssr($0257c760a99bfacb$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrStyle(progress_styling())), $3hooq$solidjsweb.ssr($0257c760a99bfacb$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true), $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $3hooq$solidjsweb.ssrAttribute("min", $3hooq$solidjsweb.escape(min_(), true), false) + $3hooq$solidjsweb.ssrAttribute("max", $3hooq$solidjsweb.escape(max_(), true), false) + $3hooq$solidjsweb.ssrAttribute("value", $3hooq$solidjsweb.escape($3hooq$solidjs.createMemo(() => {
|
|
1510
1522
|
min_();
|
|
1511
1523
|
max_();
|
|
1512
1524
|
return get_current_range()[0];
|
|
1513
1525
|
}, undefined, {
|
|
1514
1526
|
equals: false
|
|
1515
|
-
})(), true), false), $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $3hooq$solidjsweb.ssrAttribute("min", $3hooq$solidjsweb.escape(min_(), true), false) + $3hooq$solidjsweb.ssrAttribute("max", $3hooq$solidjsweb.escape(max_(), true), false))];
|
|
1527
|
+
})(), true), false), $3hooq$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true) + $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $3hooq$solidjsweb.ssrAttribute("min", $3hooq$solidjsweb.escape(min_(), true), false) + $3hooq$solidjsweb.ssrAttribute("max", $3hooq$solidjsweb.escape(max_(), true), false))];
|
|
1516
1528
|
}
|
|
1517
1529
|
function $0257c760a99bfacb$var$set_range_with_sanitation(min_, max_, current_range_signal, index, target_el) {
|
|
1518
1530
|
let get_offset_value = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : (value, how_many) => value + how_many;
|
|
@@ -1781,44 +1793,47 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1781
1793
|
return has_expandable();
|
|
1782
1794
|
},
|
|
1783
1795
|
get children() {
|
|
1784
|
-
return
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
var _value$is_expanded_$u, _value12, _value12$is_expanded_, _value12$is_expanded_2;
|
|
1795
|
-
return (_value$is_expanded_$u = (_value12 = value()) === null || _value12 === void 0 ? void 0 : (_value12$is_expanded_ = _value12.is_expanded_) === null || _value12$is_expanded_ === void 0 ? void 0 : (_value12$is_expanded_2 = _value12$is_expanded_.ui_should_show_expanded_) === null || _value12$is_expanded_2 === void 0 ? void 0 : _value12$is_expanded_2.call(_value12$is_expanded_)) !== null && _value$is_expanded_$u !== void 0 ? _value$is_expanded_$u : false;
|
|
1796
|
-
});
|
|
1796
|
+
return (() => {
|
|
1797
|
+
const is_open = $3hooq$solidjs.createMemo(() => {
|
|
1798
|
+
const v = value();
|
|
1799
|
+
if (!v)
|
|
1800
|
+
// only to prevent cleanup errors
|
|
1801
|
+
return $3hooq$solidjs.createSignal(false);
|
|
1802
|
+
const {
|
|
1803
|
+
is_expanded_: {
|
|
1804
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
1805
|
+
set_user_expanded_: set_user_expanded_
|
|
1797
1806
|
}
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1807
|
+
} = v;
|
|
1808
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
1809
|
+
});
|
|
1810
|
+
return $3hooq$solidjsweb.createComponent((0, $4cfe8400ed3f92c4$export$6c6d7a51fa9aa15d), {
|
|
1811
|
+
get details_() {
|
|
1812
|
+
return $3hooq$solidjsweb.ssr($9c1d49181fb3002a$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey());
|
|
1813
|
+
},
|
|
1814
|
+
get summary_() {
|
|
1815
|
+
var _value10, _value11;
|
|
1816
|
+
return $3hooq$solidjsweb.ssr($9c1d49181fb3002a$var$_tmpl$4, $3hooq$solidjsweb.ssrHydrationKey(), "count ".concat(((_value10 = value()) === null || _value10 === void 0 ? void 0 : _value10.count_) === 0 ? "count-0" : ""), $3hooq$solidjsweb.escape((_value11 = value()) === null || _value11 === void 0 ? void 0 : _value11.count_), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $ac040bdfeed58ee4$export$e5c2828934226505), {
|
|
1817
|
+
i18n_: i18n_,
|
|
1818
|
+
get expanded_() {
|
|
1819
|
+
return $3hooq$solidjs.createMemo(() => {
|
|
1820
|
+
var _value$is_expanded_$u, _value12, _value12$is_expanded_, _value12$is_expanded_2;
|
|
1821
|
+
return (_value$is_expanded_$u = (_value12 = value()) === null || _value12 === void 0 ? void 0 : (_value12$is_expanded_ = _value12.is_expanded_) === null || _value12$is_expanded_ === void 0 ? void 0 : (_value12$is_expanded_2 = _value12$is_expanded_.ui_should_show_expanded_) === null || _value12$is_expanded_2 === void 0 ? void 0 : _value12$is_expanded_2.call(_value12$is_expanded_)) !== null && _value$is_expanded_$u !== void 0 ? _value$is_expanded_$u : false;
|
|
1822
|
+
});
|
|
1810
1823
|
}
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
var
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1824
|
+
})));
|
|
1825
|
+
},
|
|
1826
|
+
get is_open_() {
|
|
1827
|
+
return is_open();
|
|
1828
|
+
},
|
|
1829
|
+
get children() {
|
|
1830
|
+
return $9c1d49181fb3002a$var$render_stuff($3hooq$solidjs.createMemo(() => {
|
|
1831
|
+
var _value13;
|
|
1832
|
+
return ((_value13 = value()) === null || _value13 === void 0 ? void 0 : _value13.children_) || {};
|
|
1833
|
+
}), existing_filter, i18n_);
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
})();
|
|
1822
1837
|
}
|
|
1823
1838
|
})));
|
|
1824
1839
|
})();
|
|
@@ -1883,7 +1898,7 @@ function $9c1d49181fb3002a$var$create_updating_signal(_ref3) {
|
|
|
1883
1898
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1884
1899
|
let updating_blocked = false;
|
|
1885
1900
|
const index_of_us_in_selected_filter = existing_filter_ === null || existing_filter_ === void 0 ? void 0 : (_existing_filter_$dat = existing_filter_.data) === null || _existing_filter_$dat === void 0 ? void 0 : (_existing_filter_$dat2 = _existing_filter_$dat.findIndex) === null || _existing_filter_$dat2 === void 0 ? void 0 : _existing_filter_$dat2.call(_existing_filter_$dat, el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
1886
|
-
signal_.push(...$3hooq$solidjs.createSignal(index_of_us_in_selected_filter >= 0
|
|
1901
|
+
signal_.push(...$3hooq$solidjs.createSignal(index_of_us_in_selected_filter >= 0));
|
|
1887
1902
|
const [read_checked, write_checked] = signal_;
|
|
1888
1903
|
const child_objects = Object.values(self_.children_);
|
|
1889
1904
|
const get_child_object_values = child_objects.map(_ref4 => {
|
package/server/ES10/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
|
*/
|