@depict-ai/ui 2.1.15 → 2.1.17
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 +96 -43
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +96 -43
- package/latest/index.cjs +75 -23
- package/latest/index.d.ts +1 -1
- package/latest/index.js +75 -23
- package/package.json +2 -2
- package/server/ES10/index.cjs +94 -41
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +94 -41
- package/server/latest/index.cjs +75 -23
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +75 -23
package/latest/index.cjs
CHANGED
|
@@ -70,7 +70,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
|
|
|
70
70
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
71
71
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
72
72
|
/*! Depict.ai search and product listing SDK */
|
|
73
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.1.
|
|
73
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.1.17";
|
|
74
74
|
const $1ab22f2cd39b3061$var$fallback_operator = "in";
|
|
75
75
|
const $1ab22f2cd39b3061$var$fallback_token = "";
|
|
76
76
|
const $1ab22f2cd39b3061$var$legacy_filter_prefix = "filter_";
|
|
@@ -2040,16 +2040,26 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({
|
|
|
2040
2040
|
return !!data?.some(item => $daa394359b026187$export$325f75597868c4f0(item) === value);
|
|
2041
2041
|
});
|
|
2042
2042
|
const value = $gVhhF$solidjs.createMemo(() => checkbox().value_);
|
|
2043
|
+
const is_count_zero = $gVhhF$solidjs.createMemo(() => checkbox().count_ === 0);
|
|
2044
|
+
const display_text = $gVhhF$solidjs.createMemo(() => checkbox().name_ || value());
|
|
2043
2045
|
return $gVhhF$solidjsweb.createComponent((0, $1c63082b2da848ad$export$48513f6b9f8ce62d), {
|
|
2044
2046
|
get value_() {
|
|
2045
2047
|
return value();
|
|
2046
2048
|
},
|
|
2047
2049
|
get label_() {
|
|
2048
|
-
return $gVhhF$solidjsweb.createComponent((0, $
|
|
2049
|
-
get
|
|
2050
|
-
return
|
|
2050
|
+
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
2051
|
+
get when() {
|
|
2052
|
+
return is_count_zero();
|
|
2053
|
+
},
|
|
2054
|
+
get fallback() {
|
|
2055
|
+
return $gVhhF$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
2056
|
+
whole_text_to_display_: display_text,
|
|
2057
|
+
searching_for_value_: () => filter_query_?.()
|
|
2058
|
+
});
|
|
2051
2059
|
},
|
|
2052
|
-
|
|
2060
|
+
get children() {
|
|
2061
|
+
return display_text();
|
|
2062
|
+
}
|
|
2053
2063
|
});
|
|
2054
2064
|
},
|
|
2055
2065
|
get count_() {
|
|
@@ -2196,9 +2206,19 @@ function $c1dc1554c1b94233$export$430444115f70a734({
|
|
|
2196
2206
|
}));
|
|
2197
2207
|
$gVhhF$solidjsweb.setAttribute(_el$4, "id", random_selector);
|
|
2198
2208
|
$gVhhF$solidjsweb.setAttribute(_el$4, "name", radio_name);
|
|
2199
|
-
$gVhhF$solidjsweb.insert(_el$3, $gVhhF$solidjsweb.createComponent((0, $
|
|
2200
|
-
|
|
2201
|
-
|
|
2209
|
+
$gVhhF$solidjsweb.insert(_el$3, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
2210
|
+
get when() {
|
|
2211
|
+
return count() !== 0;
|
|
2212
|
+
},
|
|
2213
|
+
get fallback() {
|
|
2214
|
+
return label();
|
|
2215
|
+
},
|
|
2216
|
+
get children() {
|
|
2217
|
+
return $gVhhF$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
2218
|
+
whole_text_to_display_: label,
|
|
2219
|
+
searching_for_value_: () => filter_query_?.()
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2202
2222
|
}), _el$7, _co$);
|
|
2203
2223
|
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
2204
2224
|
get when() {
|
|
@@ -3061,12 +3081,22 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_, filter
|
|
|
3061
3081
|
return value_as_string();
|
|
3062
3082
|
},
|
|
3063
3083
|
get label_() {
|
|
3064
|
-
return $gVhhF$solidjsweb.createComponent((0, $
|
|
3065
|
-
get
|
|
3066
|
-
return
|
|
3084
|
+
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
3085
|
+
get when() {
|
|
3086
|
+
return value()?.count_ === 0;
|
|
3087
|
+
},
|
|
3088
|
+
get fallback() {
|
|
3089
|
+
return $gVhhF$solidjsweb.createComponent((0, $f6efb1605fcb9f39$export$8e79c28529dbfa90), {
|
|
3090
|
+
get text_() {
|
|
3091
|
+
return label_text();
|
|
3092
|
+
},
|
|
3093
|
+
get to_highlight_() {
|
|
3094
|
+
return filter_query_?.();
|
|
3095
|
+
}
|
|
3096
|
+
});
|
|
3067
3097
|
},
|
|
3068
|
-
get
|
|
3069
|
-
return
|
|
3098
|
+
get children() {
|
|
3099
|
+
return label_text();
|
|
3070
3100
|
}
|
|
3071
3101
|
});
|
|
3072
3102
|
},
|
|
@@ -3399,6 +3429,7 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({
|
|
|
3399
3429
|
});
|
|
3400
3430
|
const MakeButton = attributes => {
|
|
3401
3431
|
const label = $gVhhF$solidjs.createMemo(() => value().name_ || value().value_ + "");
|
|
3432
|
+
const count_zero = $gVhhF$solidjs.createMemo(() => value().count_ === 0);
|
|
3402
3433
|
return (() => {
|
|
3403
3434
|
const _el$2 = $gVhhF$solidjsweb.getNextElement($0ef1681699140f1a$var$_tmpl$3),
|
|
3404
3435
|
_el$5 = _el$2.firstChild,
|
|
@@ -3407,7 +3438,7 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({
|
|
|
3407
3438
|
[_el$8, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$7.nextSibling);
|
|
3408
3439
|
$gVhhF$solidjsweb.spread(_el$2, $gVhhF$solidjsweb.mergeProps(attributes, {
|
|
3409
3440
|
get disabled() {
|
|
3410
|
-
return $gVhhF$solidjsweb.memo(() =>
|
|
3441
|
+
return $gVhhF$solidjsweb.memo(() => !!count_zero())() && !is_selected();
|
|
3411
3442
|
},
|
|
3412
3443
|
get classList() {
|
|
3413
3444
|
return {
|
|
@@ -3442,9 +3473,19 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({
|
|
|
3442
3473
|
});
|
|
3443
3474
|
}
|
|
3444
3475
|
}), false, true);
|
|
3445
|
-
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $
|
|
3446
|
-
|
|
3447
|
-
|
|
3476
|
+
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
3477
|
+
get when() {
|
|
3478
|
+
return count_zero();
|
|
3479
|
+
},
|
|
3480
|
+
get fallback() {
|
|
3481
|
+
return $gVhhF$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
3482
|
+
whole_text_to_display_: label,
|
|
3483
|
+
searching_for_value_: () => filter_query_?.()
|
|
3484
|
+
});
|
|
3485
|
+
},
|
|
3486
|
+
get children() {
|
|
3487
|
+
return label();
|
|
3488
|
+
}
|
|
3448
3489
|
}), _el$6, _co$);
|
|
3449
3490
|
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
3450
3491
|
get when() {
|
|
@@ -3585,18 +3626,29 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
3585
3626
|
});
|
|
3586
3627
|
const value = $gVhhF$solidjs.createMemo(() => checkbox().value_);
|
|
3587
3628
|
const label_text = $gVhhF$solidjs.createMemo(() => checkbox().name_ || value() + "");
|
|
3629
|
+
const count = $gVhhF$solidjs.createMemo(() => checkbox().count_);
|
|
3588
3630
|
const input_row = $gVhhF$solidjsweb.createComponent((0, $1c63082b2da848ad$export$48513f6b9f8ce62d), {
|
|
3589
3631
|
get value_() {
|
|
3590
3632
|
return value();
|
|
3591
3633
|
},
|
|
3592
3634
|
get label_() {
|
|
3593
|
-
return $gVhhF$solidjsweb.createComponent((0, $
|
|
3594
|
-
|
|
3595
|
-
|
|
3635
|
+
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
3636
|
+
get when() {
|
|
3637
|
+
return count() !== 0;
|
|
3638
|
+
},
|
|
3639
|
+
get fallback() {
|
|
3640
|
+
return label_text();
|
|
3641
|
+
},
|
|
3642
|
+
get children() {
|
|
3643
|
+
return $gVhhF$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
3644
|
+
whole_text_to_display_: label_text,
|
|
3645
|
+
searching_for_value_: () => filter_query_?.()
|
|
3646
|
+
});
|
|
3647
|
+
}
|
|
3596
3648
|
});
|
|
3597
3649
|
},
|
|
3598
3650
|
get count_() {
|
|
3599
|
-
return
|
|
3651
|
+
return count();
|
|
3600
3652
|
},
|
|
3601
3653
|
get checked_() {
|
|
3602
3654
|
return is_checked();
|
|
@@ -3907,7 +3959,7 @@ function $87d7574e1d89d69b$export$82eafebb825fc23f(props = {}) {
|
|
|
3907
3959
|
})();
|
|
3908
3960
|
}
|
|
3909
3961
|
const $47d8681015b71901$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=search-in-filters><input type=text class=query><!$><!/><button class=clear-filter-search>`);
|
|
3910
|
-
const $47d8681015b71901$var$min_items_to_enable_filter_searching =
|
|
3962
|
+
const $47d8681015b71901$var$min_items_to_enable_filter_searching = 15; // For checkbox color and checkbox grid we 2x this
|
|
3911
3963
|
function $47d8681015b71901$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_) {
|
|
3912
3964
|
const [filter_query_, set_filter_query_] = $gVhhF$solidjs.createSignal();
|
|
3913
3965
|
// Check if we have enough items to enable searching
|
|
@@ -3917,7 +3969,7 @@ function $47d8681015b71901$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_
|
|
|
3917
3969
|
const type = filter.meta?.type;
|
|
3918
3970
|
if (type === "range") continue;
|
|
3919
3971
|
const length = filter.meta.values.length;
|
|
3920
|
-
count += type === "checkbox-color" || type === "checkbox-grid" ? length /
|
|
3972
|
+
count += type === "checkbox-color" || type === "checkbox-grid" ? length / 2 : length; // For checkbox-color we have two columns, checkbox-grid three, so we can show search later
|
|
3921
3973
|
}
|
|
3922
3974
|
|
|
3923
3975
|
return count >= $47d8681015b71901$var$min_items_to_enable_filter_searching;
|
package/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 { ProductListingRequestV2 } from "@depict-ai/types/api/ProductListingRequestV2";
|
|
10
|
-
export const version = "2.1.
|
|
10
|
+
export const version = "2.1.17";
|
|
11
11
|
/**
|
|
12
12
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
13
13
|
*/
|
package/latest/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
|
|
|
6
6
|
/*! Depict.ai search and product listing SDK */
|
|
7
7
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
8
8
|
register_es_version("ui", "latest");
|
|
9
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "2.1.
|
|
9
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "2.1.17";
|
|
10
10
|
const $4147651646da990a$var$fallback_operator = "in";
|
|
11
11
|
const $4147651646da990a$var$fallback_token = "";
|
|
12
12
|
const $4147651646da990a$var$legacy_filter_prefix = "filter_";
|
|
@@ -1976,16 +1976,26 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
1976
1976
|
return !!data?.some(item => $91aa8ee9f431800d$export$325f75597868c4f0(item) === value);
|
|
1977
1977
|
});
|
|
1978
1978
|
const value = $9HbP8$createMemo(() => checkbox().value_);
|
|
1979
|
+
const is_count_zero = $9HbP8$createMemo(() => checkbox().count_ === 0);
|
|
1980
|
+
const display_text = $9HbP8$createMemo(() => checkbox().name_ || value());
|
|
1979
1981
|
return $9HbP8$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
|
|
1980
1982
|
get value_() {
|
|
1981
1983
|
return value();
|
|
1982
1984
|
},
|
|
1983
1985
|
get label_() {
|
|
1984
|
-
return $9HbP8$createComponent((0, $
|
|
1985
|
-
get
|
|
1986
|
-
return
|
|
1986
|
+
return $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
1987
|
+
get when() {
|
|
1988
|
+
return is_count_zero();
|
|
1989
|
+
},
|
|
1990
|
+
get fallback() {
|
|
1991
|
+
return $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
|
|
1992
|
+
whole_text_to_display_: display_text,
|
|
1993
|
+
searching_for_value_: () => filter_query_?.()
|
|
1994
|
+
});
|
|
1987
1995
|
},
|
|
1988
|
-
|
|
1996
|
+
get children() {
|
|
1997
|
+
return display_text();
|
|
1998
|
+
}
|
|
1989
1999
|
});
|
|
1990
2000
|
},
|
|
1991
2001
|
get count_() {
|
|
@@ -2132,9 +2142,19 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({
|
|
|
2132
2142
|
}));
|
|
2133
2143
|
$9HbP8$setAttribute(_el$4, "id", random_selector);
|
|
2134
2144
|
$9HbP8$setAttribute(_el$4, "name", radio_name);
|
|
2135
|
-
$9HbP8$insert(_el$3, $9HbP8$createComponent((0, $
|
|
2136
|
-
|
|
2137
|
-
|
|
2145
|
+
$9HbP8$insert(_el$3, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
2146
|
+
get when() {
|
|
2147
|
+
return count() !== 0;
|
|
2148
|
+
},
|
|
2149
|
+
get fallback() {
|
|
2150
|
+
return label();
|
|
2151
|
+
},
|
|
2152
|
+
get children() {
|
|
2153
|
+
return $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
|
|
2154
|
+
whole_text_to_display_: label,
|
|
2155
|
+
searching_for_value_: () => filter_query_?.()
|
|
2156
|
+
});
|
|
2157
|
+
}
|
|
2138
2158
|
}), _el$7, _co$);
|
|
2139
2159
|
$9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
2140
2160
|
get when() {
|
|
@@ -2997,12 +3017,22 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_, filter
|
|
|
2997
3017
|
return value_as_string();
|
|
2998
3018
|
},
|
|
2999
3019
|
get label_() {
|
|
3000
|
-
return $9HbP8$createComponent((0, $
|
|
3001
|
-
get
|
|
3002
|
-
return
|
|
3020
|
+
return $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3021
|
+
get when() {
|
|
3022
|
+
return value()?.count_ === 0;
|
|
3023
|
+
},
|
|
3024
|
+
get fallback() {
|
|
3025
|
+
return $9HbP8$createComponent((0, $3ec2b9489931358d$export$8e79c28529dbfa90), {
|
|
3026
|
+
get text_() {
|
|
3027
|
+
return label_text();
|
|
3028
|
+
},
|
|
3029
|
+
get to_highlight_() {
|
|
3030
|
+
return filter_query_?.();
|
|
3031
|
+
}
|
|
3032
|
+
});
|
|
3003
3033
|
},
|
|
3004
|
-
get
|
|
3005
|
-
return
|
|
3034
|
+
get children() {
|
|
3035
|
+
return label_text();
|
|
3006
3036
|
}
|
|
3007
3037
|
});
|
|
3008
3038
|
},
|
|
@@ -3335,6 +3365,7 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
|
|
|
3335
3365
|
});
|
|
3336
3366
|
const MakeButton = attributes => {
|
|
3337
3367
|
const label = $9HbP8$createMemo(() => value().name_ || value().value_ + "");
|
|
3368
|
+
const count_zero = $9HbP8$createMemo(() => value().count_ === 0);
|
|
3338
3369
|
return (() => {
|
|
3339
3370
|
const _el$2 = $9HbP8$getNextElement($93716a9ad0dea854$var$_tmpl$3),
|
|
3340
3371
|
_el$5 = _el$2.firstChild,
|
|
@@ -3343,7 +3374,7 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
|
|
|
3343
3374
|
[_el$8, _co$2] = $9HbP8$getNextMarker(_el$7.nextSibling);
|
|
3344
3375
|
$9HbP8$spread(_el$2, $9HbP8$mergeProps1(attributes, {
|
|
3345
3376
|
get disabled() {
|
|
3346
|
-
return $9HbP8$memo(() =>
|
|
3377
|
+
return $9HbP8$memo(() => !!count_zero())() && !is_selected();
|
|
3347
3378
|
},
|
|
3348
3379
|
get classList() {
|
|
3349
3380
|
return {
|
|
@@ -3378,9 +3409,19 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
|
|
|
3378
3409
|
});
|
|
3379
3410
|
}
|
|
3380
3411
|
}), false, true);
|
|
3381
|
-
$9HbP8$insert(_el$2, $9HbP8$createComponent((0, $
|
|
3382
|
-
|
|
3383
|
-
|
|
3412
|
+
$9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3413
|
+
get when() {
|
|
3414
|
+
return count_zero();
|
|
3415
|
+
},
|
|
3416
|
+
get fallback() {
|
|
3417
|
+
return $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
|
|
3418
|
+
whole_text_to_display_: label,
|
|
3419
|
+
searching_for_value_: () => filter_query_?.()
|
|
3420
|
+
});
|
|
3421
|
+
},
|
|
3422
|
+
get children() {
|
|
3423
|
+
return label();
|
|
3424
|
+
}
|
|
3384
3425
|
}), _el$6, _co$);
|
|
3385
3426
|
$9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3386
3427
|
get when() {
|
|
@@ -3521,18 +3562,29 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
3521
3562
|
});
|
|
3522
3563
|
const value = $9HbP8$createMemo(() => checkbox().value_);
|
|
3523
3564
|
const label_text = $9HbP8$createMemo(() => checkbox().name_ || value() + "");
|
|
3565
|
+
const count = $9HbP8$createMemo(() => checkbox().count_);
|
|
3524
3566
|
const input_row = $9HbP8$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
|
|
3525
3567
|
get value_() {
|
|
3526
3568
|
return value();
|
|
3527
3569
|
},
|
|
3528
3570
|
get label_() {
|
|
3529
|
-
return $9HbP8$createComponent((0, $
|
|
3530
|
-
|
|
3531
|
-
|
|
3571
|
+
return $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3572
|
+
get when() {
|
|
3573
|
+
return count() !== 0;
|
|
3574
|
+
},
|
|
3575
|
+
get fallback() {
|
|
3576
|
+
return label_text();
|
|
3577
|
+
},
|
|
3578
|
+
get children() {
|
|
3579
|
+
return $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
|
|
3580
|
+
whole_text_to_display_: label_text,
|
|
3581
|
+
searching_for_value_: () => filter_query_?.()
|
|
3582
|
+
});
|
|
3583
|
+
}
|
|
3532
3584
|
});
|
|
3533
3585
|
},
|
|
3534
3586
|
get count_() {
|
|
3535
|
-
return
|
|
3587
|
+
return count();
|
|
3536
3588
|
},
|
|
3537
3589
|
get checked_() {
|
|
3538
3590
|
return is_checked();
|
|
@@ -3843,7 +3895,7 @@ function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
|
|
|
3843
3895
|
})();
|
|
3844
3896
|
}
|
|
3845
3897
|
const $e01b34f289b61435$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=search-in-filters><input type=text class=query><!$><!/><button class=clear-filter-search>`);
|
|
3846
|
-
const $e01b34f289b61435$var$min_items_to_enable_filter_searching =
|
|
3898
|
+
const $e01b34f289b61435$var$min_items_to_enable_filter_searching = 15; // For checkbox color and checkbox grid we 2x this
|
|
3847
3899
|
function $e01b34f289b61435$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_) {
|
|
3848
3900
|
const [filter_query_, set_filter_query_] = $9HbP8$createSignal();
|
|
3849
3901
|
// Check if we have enough items to enable searching
|
|
@@ -3853,7 +3905,7 @@ function $e01b34f289b61435$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_
|
|
|
3853
3905
|
const type = filter.meta?.type;
|
|
3854
3906
|
if (type === "range") continue;
|
|
3855
3907
|
const length = filter.meta.values.length;
|
|
3856
|
-
count += type === "checkbox-color" || type === "checkbox-grid" ? length /
|
|
3908
|
+
count += type === "checkbox-color" || type === "checkbox-grid" ? length / 2 : length; // For checkbox-color we have two columns, checkbox-grid three, so we can show search later
|
|
3857
3909
|
}
|
|
3858
3910
|
|
|
3859
3911
|
return count >= $e01b34f289b61435$var$min_items_to_enable_filter_searching;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
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.12",
|
|
240
240
|
"@depict-ai/types": "^1.0.39",
|
|
241
241
|
"@depict-ai/utilishared": "^1.0.48",
|
|
242
242
|
"solid-js": "^1.8.1"
|
package/server/ES10/index.cjs
CHANGED
|
@@ -76,7 +76,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
76
76
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
77
77
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
78
78
|
/*! Depict.ai search and product listing SDK */
|
|
79
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.1.
|
|
79
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.1.17";
|
|
80
80
|
const $a68b73fd7ba0853f$var$fallback_operator = "in";
|
|
81
81
|
const $a68b73fd7ba0853f$var$fallback_token = "";
|
|
82
82
|
const $a68b73fd7ba0853f$var$legacy_filter_prefix = "filter_";
|
|
@@ -1695,16 +1695,26 @@ function $9b54b9c5381716eb$export$dd948f91abc3a1c4(_ref) {
|
|
|
1695
1695
|
return !!(data !== null && data !== void 0 && data.some(item => $e2d74bb03cc5252e$export$325f75597868c4f0(item) === value));
|
|
1696
1696
|
});
|
|
1697
1697
|
const value = $3hooq$solidjs.createMemo(() => checkbox().value_);
|
|
1698
|
+
const is_count_zero = $3hooq$solidjs.createMemo(() => checkbox().count_ === 0);
|
|
1699
|
+
const display_text = $3hooq$solidjs.createMemo(() => checkbox().name_ || value());
|
|
1698
1700
|
return $3hooq$solidjsweb.createComponent((0, $902a0ca2b52f3898$export$48513f6b9f8ce62d), {
|
|
1699
1701
|
get value_() {
|
|
1700
1702
|
return value();
|
|
1701
1703
|
},
|
|
1702
1704
|
get label_() {
|
|
1703
|
-
return $3hooq$solidjsweb.createComponent((0, $
|
|
1704
|
-
get
|
|
1705
|
-
return
|
|
1705
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1706
|
+
get when() {
|
|
1707
|
+
return is_count_zero();
|
|
1706
1708
|
},
|
|
1707
|
-
|
|
1709
|
+
get fallback() {
|
|
1710
|
+
return $3hooq$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
1711
|
+
whole_text_to_display_: display_text,
|
|
1712
|
+
searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
|
|
1713
|
+
});
|
|
1714
|
+
},
|
|
1715
|
+
get children() {
|
|
1716
|
+
return display_text();
|
|
1717
|
+
}
|
|
1708
1718
|
});
|
|
1709
1719
|
},
|
|
1710
1720
|
get count_() {
|
|
@@ -1809,9 +1819,19 @@ function $d9239dad9a9d899b$export$430444115f70a734(_ref) {
|
|
|
1809
1819
|
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
1810
1820
|
if ($e2d74bb03cc5252e$export$325f75597868c4f0(data) === $e2d74bb03cc5252e$export$325f75597868c4f0(v)) return true;
|
|
1811
1821
|
return Array.isArray(data) && data.every((item, index) => item === v[index]);
|
|
1812
|
-
})(), true), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $
|
|
1813
|
-
|
|
1814
|
-
|
|
1822
|
+
})(), true), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1823
|
+
get when() {
|
|
1824
|
+
return count() !== 0;
|
|
1825
|
+
},
|
|
1826
|
+
get fallback() {
|
|
1827
|
+
return label();
|
|
1828
|
+
},
|
|
1829
|
+
get children() {
|
|
1830
|
+
return $3hooq$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
1831
|
+
whole_text_to_display_: label,
|
|
1832
|
+
searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1815
1835
|
})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1816
1836
|
get when() {
|
|
1817
1837
|
return count() != undefined;
|
|
@@ -2504,43 +2524,54 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_, filter
|
|
|
2504
2524
|
return value_as_string();
|
|
2505
2525
|
},
|
|
2506
2526
|
get label_() {
|
|
2507
|
-
return $3hooq$solidjsweb.createComponent((0, $
|
|
2508
|
-
get
|
|
2509
|
-
|
|
2527
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
2528
|
+
get when() {
|
|
2529
|
+
var _value4;
|
|
2530
|
+
return ((_value4 = value()) === null || _value4 === void 0 ? void 0 : _value4.count_) === 0;
|
|
2531
|
+
},
|
|
2532
|
+
get fallback() {
|
|
2533
|
+
return $3hooq$solidjsweb.createComponent((0, $dc5db6bf7093867a$export$8e79c28529dbfa90), {
|
|
2534
|
+
get text_() {
|
|
2535
|
+
return label_text();
|
|
2536
|
+
},
|
|
2537
|
+
get to_highlight_() {
|
|
2538
|
+
return filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_();
|
|
2539
|
+
}
|
|
2540
|
+
});
|
|
2510
2541
|
},
|
|
2511
|
-
get
|
|
2512
|
-
return
|
|
2542
|
+
get children() {
|
|
2543
|
+
return label_text();
|
|
2513
2544
|
}
|
|
2514
2545
|
});
|
|
2515
2546
|
},
|
|
2516
2547
|
get count_() {
|
|
2517
|
-
var
|
|
2518
|
-
return has_expandable() ? undefined : (
|
|
2548
|
+
var _value5;
|
|
2549
|
+
return has_expandable() ? undefined : (_value5 = value()) === null || _value5 === void 0 ? void 0 : _value5.count_;
|
|
2519
2550
|
},
|
|
2520
2551
|
get is_count_zero_() {
|
|
2521
|
-
var
|
|
2522
|
-
return has_expandable() && ((
|
|
2552
|
+
var _value6;
|
|
2553
|
+
return has_expandable() && ((_value6 = value()) === null || _value6 === void 0 ? void 0 : _value6.count_) === 0;
|
|
2523
2554
|
},
|
|
2524
2555
|
get checked_() {
|
|
2525
|
-
var _value$is_checked_$,
|
|
2526
|
-
return (_value$is_checked_$ = (
|
|
2556
|
+
var _value$is_checked_$, _value7, _value7$is_checked_, _value7$is_checked_$;
|
|
2557
|
+
return (_value$is_checked_$ = (_value7 = value()) === null || _value7 === void 0 ? void 0 : (_value7$is_checked_ = _value7.is_checked_) === null || _value7$is_checked_ === void 0 ? void 0 : (_value7$is_checked_$ = _value7$is_checked_[0]) === null || _value7$is_checked_$ === void 0 ? void 0 : _value7$is_checked_$.call(_value7$is_checked_)) !== null && _value$is_checked_$ !== void 0 ? _value$is_checked_$ : false;
|
|
2527
2558
|
},
|
|
2528
2559
|
input_ref_: input => {
|
|
2529
2560
|
input.addEventListener("change", $3hooq$depictaiutilishared.catchify(() => $3hooq$solidjs.untrack(() => {
|
|
2530
|
-
var
|
|
2561
|
+
var _value9;
|
|
2531
2562
|
const {
|
|
2532
2563
|
checked: checked
|
|
2533
2564
|
} = input;
|
|
2534
2565
|
if (checked) {
|
|
2535
|
-
var
|
|
2536
|
-
(
|
|
2566
|
+
var _value8;
|
|
2567
|
+
(_value8 = value()) === null || _value8 === void 0 || _value8.is_expanded_.set_user_expanded_(true);
|
|
2537
2568
|
}
|
|
2538
|
-
(
|
|
2569
|
+
(_value9 = value()) === null || _value9 === void 0 || _value9.is_checked_[1](checked);
|
|
2539
2570
|
})));
|
|
2540
2571
|
const any_kids_checked = $3hooq$solidjs.createMemo(() => {
|
|
2541
|
-
var
|
|
2572
|
+
var _value10;
|
|
2542
2573
|
let are_checked = false;
|
|
2543
|
-
const to_check = Object.values(((
|
|
2574
|
+
const to_check = Object.values(((_value10 = value()) === null || _value10 === void 0 ? void 0 : _value10.children_) || {});
|
|
2544
2575
|
while (to_check.length) {
|
|
2545
2576
|
const kid_to_check = to_check.pop();
|
|
2546
2577
|
to_check.push(...Object.values(kid_to_check.children_));
|
|
@@ -2577,13 +2608,13 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_, filter
|
|
|
2577
2608
|
return $3hooq$solidjsweb.ssr($9c1d49181fb3002a$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey());
|
|
2578
2609
|
},
|
|
2579
2610
|
get summary_() {
|
|
2580
|
-
var
|
|
2581
|
-
return $3hooq$solidjsweb.ssr($9c1d49181fb3002a$var$_tmpl$4, $3hooq$solidjsweb.ssrHydrationKey(), "count ".concat(((
|
|
2611
|
+
var _value11, _value12;
|
|
2612
|
+
return $3hooq$solidjsweb.ssr($9c1d49181fb3002a$var$_tmpl$4, $3hooq$solidjsweb.ssrHydrationKey(), "count ".concat(((_value11 = value()) === null || _value11 === void 0 ? void 0 : _value11.count_) === 0 ? "count-0" : ""), $3hooq$solidjsweb.escape((_value12 = value()) === null || _value12 === void 0 ? void 0 : _value12.count_), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $ac040bdfeed58ee4$export$e5c2828934226505), {
|
|
2582
2613
|
i18n_: i18n_,
|
|
2583
2614
|
get expanded_() {
|
|
2584
2615
|
return $3hooq$solidjs.createMemo(() => {
|
|
2585
|
-
var _value$is_expanded_$u,
|
|
2586
|
-
return (_value$is_expanded_$u = (
|
|
2616
|
+
var _value$is_expanded_$u, _value13, _value13$is_expanded_, _value13$is_expanded_2;
|
|
2617
|
+
return (_value$is_expanded_$u = (_value13 = value()) === null || _value13 === void 0 ? void 0 : (_value13$is_expanded_ = _value13.is_expanded_) === null || _value13$is_expanded_ === void 0 ? void 0 : (_value13$is_expanded_2 = _value13$is_expanded_.ui_should_show_expanded_) === null || _value13$is_expanded_2 === void 0 ? void 0 : _value13$is_expanded_2.call(_value13$is_expanded_)) !== null && _value$is_expanded_$u !== void 0 ? _value$is_expanded_$u : false;
|
|
2587
2618
|
});
|
|
2588
2619
|
}
|
|
2589
2620
|
})));
|
|
@@ -2593,8 +2624,8 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_, filter
|
|
|
2593
2624
|
},
|
|
2594
2625
|
get children() {
|
|
2595
2626
|
return $9c1d49181fb3002a$var$render_stuff($3hooq$solidjs.createMemo(() => {
|
|
2596
|
-
var
|
|
2597
|
-
return ((
|
|
2627
|
+
var _value14;
|
|
2628
|
+
return ((_value14 = value()) === null || _value14 === void 0 ? void 0 : _value14.children_) || {};
|
|
2598
2629
|
}), existing_filter, i18n_, filter_query_);
|
|
2599
2630
|
}
|
|
2600
2631
|
});
|
|
@@ -2861,9 +2892,10 @@ const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
|
2861
2892
|
});
|
|
2862
2893
|
const MakeButton = attributes => {
|
|
2863
2894
|
const label = $3hooq$solidjs.createMemo(() => value().name_ || value().value_ + "");
|
|
2895
|
+
const count_zero = $3hooq$solidjs.createMemo(() => value().count_ === 0);
|
|
2864
2896
|
return $3hooq$solidjsweb.ssrElement("button", $3hooq$solidjsweb.mergeProps(attributes, {
|
|
2865
2897
|
get disabled() {
|
|
2866
|
-
return
|
|
2898
|
+
return count_zero() && !is_selected();
|
|
2867
2899
|
},
|
|
2868
2900
|
get classList() {
|
|
2869
2901
|
return {
|
|
@@ -2872,9 +2904,19 @@ const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
|
2872
2904
|
"major-minor-transition": true
|
|
2873
2905
|
};
|
|
2874
2906
|
}
|
|
2875
|
-
}), () => ["<!--$-->", $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $
|
|
2876
|
-
|
|
2877
|
-
|
|
2907
|
+
}), () => ["<!--$-->", $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
2908
|
+
get when() {
|
|
2909
|
+
return count_zero();
|
|
2910
|
+
},
|
|
2911
|
+
get fallback() {
|
|
2912
|
+
return $3hooq$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
2913
|
+
whole_text_to_display_: label,
|
|
2914
|
+
searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
|
|
2915
|
+
});
|
|
2916
|
+
},
|
|
2917
|
+
get children() {
|
|
2918
|
+
return label();
|
|
2919
|
+
}
|
|
2878
2920
|
})), "<!--/-->", "<!--$-->", $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
2879
2921
|
get when() {
|
|
2880
2922
|
return value().count_ != undefined;
|
|
@@ -3021,18 +3063,29 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
|
|
|
3021
3063
|
});
|
|
3022
3064
|
const value = $3hooq$solidjs.createMemo(() => checkbox().value_);
|
|
3023
3065
|
const label_text = $3hooq$solidjs.createMemo(() => checkbox().name_ || value() + "");
|
|
3066
|
+
const count = $3hooq$solidjs.createMemo(() => checkbox().count_);
|
|
3024
3067
|
const input_row = $3hooq$solidjsweb.createComponent((0, $902a0ca2b52f3898$export$48513f6b9f8ce62d), {
|
|
3025
3068
|
get value_() {
|
|
3026
3069
|
return value();
|
|
3027
3070
|
},
|
|
3028
3071
|
get label_() {
|
|
3029
|
-
return $3hooq$solidjsweb.createComponent((0, $
|
|
3030
|
-
|
|
3031
|
-
|
|
3072
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
3073
|
+
get when() {
|
|
3074
|
+
return count() !== 0;
|
|
3075
|
+
},
|
|
3076
|
+
get fallback() {
|
|
3077
|
+
return label_text();
|
|
3078
|
+
},
|
|
3079
|
+
get children() {
|
|
3080
|
+
return $3hooq$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
3081
|
+
whole_text_to_display_: label_text,
|
|
3082
|
+
searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
|
|
3083
|
+
});
|
|
3084
|
+
}
|
|
3032
3085
|
});
|
|
3033
3086
|
},
|
|
3034
3087
|
get count_() {
|
|
3035
|
-
return
|
|
3088
|
+
return count();
|
|
3036
3089
|
},
|
|
3037
3090
|
get checked_() {
|
|
3038
3091
|
return is_checked();
|
|
@@ -3299,7 +3352,7 @@ function $5b88b077e48a4451$export$82eafebb825fc23f() {
|
|
|
3299
3352
|
}, props), () => $3hooq$solidjsweb.ssr($5b88b077e48a4451$var$_tmpl$), true);
|
|
3300
3353
|
}
|
|
3301
3354
|
const $8e7ac26c00243687$var$_tmpl$ = ["<div", ' class="search-in-filters"><input type="text" class="query"', "><!--$-->", '<!--/--><button style="', '" class="clear-filter-search">', "</button></div>"];
|
|
3302
|
-
const $8e7ac26c00243687$var$min_items_to_enable_filter_searching =
|
|
3355
|
+
const $8e7ac26c00243687$var$min_items_to_enable_filter_searching = 15; // For checkbox color and checkbox grid we 2x this
|
|
3303
3356
|
function $8e7ac26c00243687$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_) {
|
|
3304
3357
|
const [filter_query_, set_filter_query_] = $3hooq$solidjs.createSignal();
|
|
3305
3358
|
// Check if we have enough items to enable searching
|
|
@@ -3310,7 +3363,7 @@ function $8e7ac26c00243687$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_
|
|
|
3310
3363
|
const type = (_filter$meta = filter.meta) === null || _filter$meta === void 0 ? void 0 : _filter$meta.type;
|
|
3311
3364
|
if (type === "range") continue;
|
|
3312
3365
|
const length = filter.meta.values.length;
|
|
3313
|
-
count += type === "checkbox-color" || type === "checkbox-grid" ? length /
|
|
3366
|
+
count += type === "checkbox-color" || type === "checkbox-grid" ? length / 2 : length; // For checkbox-color we have two columns, checkbox-grid three, so we can show search later
|
|
3314
3367
|
}
|
|
3315
3368
|
|
|
3316
3369
|
return count >= $8e7ac26c00243687$var$min_items_to_enable_filter_searching;
|