@bynder/compact-view 5.2.2 → 5.2.4
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/AccessToken2.js +1 -1
- package/ActiveFilters.js +49 -50
- package/AddMedia.js +19 -18
- package/Advanced.js +13 -13
- package/App.js +60 -59
- package/Arrow.js +1 -1
- package/AssetFilter.js +38 -38
- package/AssetItem.js +10 -17
- package/AssetList.js +5 -5
- package/AssetTypeItem.js +21 -21
- package/AssetsView.js +13 -13
- package/Axios2.js +82 -76
- package/AxiosError.js +36 -35
- package/ButtonAction.js +1 -1
- package/CanceledError.js +15 -8
- package/Card.js +1 -1
- package/Chip.js +1 -1
- package/CollectionCard.js +22 -22
- package/CollectionItem.js +9 -9
- package/CollectionList.js +5 -5
- package/CollectionView.js +11 -11
- package/ColorPicker.js +1 -1
- package/ColorPickerSolid.js +3 -3
- package/ColorPickerWithOpacity.js +3 -3
- package/Component.js +158 -0
- package/Component2.js +4 -0
- package/ConfigContext.js +7 -8
- package/Container.js +1 -1
- package/ContextAction.js +1 -1
- package/ControlGroup.js +6 -6
- package/Dat.js +33 -32
- package/DatDropdownItem.js +1 -1
- package/DesignSystemProvider.js +7 -7
- package/DirectionSelect.js +11 -10
- package/DomainInput.js +19 -11
- package/Draggable.js +337 -0
- package/Draggable2.js +4 -0
- package/DraggableCore.js +312 -0
- package/DraggableCore2.js +4 -0
- package/Dropdown.js +37 -37
- package/Dropdown2.js +1 -1
- package/DropdownListItem.js +1 -1
- package/FieldSelect.js +19 -17
- package/FileSelector.js +38 -37
- package/FontPicker.js +1 -1
- package/Form.js +1 -1
- package/Header.js +5 -4
- package/HttpStatusCode.js +7 -1
- package/InfiniteScroll.js +1 -1
- package/InlineBanner.js +1 -1
- package/Input.js +1 -1
- package/InterceptorManager.js +2 -1
- package/Item.js +8 -8
- package/Item4.js +2 -2
- package/LeftArrow.js +1 -1
- package/ListItem2.js +1 -1
- package/ModalBase.js +15 -15
- package/NoResults.js +1 -1
- package/Option_new.js +36 -29
- package/ReactPropTypesSecret.js +10 -0
- package/RightArrow.js +1 -1
- package/SearchInput.js +1 -1
- package/SearchInput2.js +1 -1
- package/SelectionFooter.js +41 -31
- package/Shield.js +2 -2
- package/Smartfilters_new.js +107 -98
- package/StatefulAssetList.js +50 -50
- package/StoreInitializer.js +32 -16
- package/SwitchNLS.js +1 -1
- package/TagItem.js +15 -15
- package/Tags.js +1 -1
- package/Toolbar.js +23 -20
- package/Tooltip2.js +1 -1
- package/ViewSwitch.js +17 -15
- package/_commonjsHelpers.js +28 -3
- package/adapters.js +54 -42
- package/api/filterAssets.d.ts +1 -1
- package/api/getAssets.d.ts +1 -1
- package/api/getFilters.d.ts +1 -1
- package/api/rest/index.d.ts +1 -1
- package/api/rest/types.d.ts +1 -1
- package/api2.js +1 -1
- package/asset.type.js +1 -1
- package/axios.js +1 -1
- package/bodyScrollLock.esm.js +68 -0
- package/buildURL.js +13 -15
- package/checkGlobals.js +1 -1
- package/cjs.js +7 -0
- package/cjs2.js +15 -0
- package/cjs3.js +4 -0
- package/clsx.m.js +6 -0
- package/clsx.m2.js +15 -0
- package/combineMetaproperties.js +3 -1
- package/composeSignals.js +1 -1
- package/cookieStore.js +1 -1
- package/cookies.js +13 -11
- package/currentScopes.js +1 -1
- package/data.js +1 -1
- package/devUtils.js +1 -1
- package/dispatchRequest.js +5 -5
- package/domFns.js +151 -0
- package/domFns2.js +4 -0
- package/factoryWithThrowingShims.js +52 -0
- package/fetch2.js +156 -128
- package/filter/AssetFilterContext.d.ts +3 -3
- package/getPrefix.js +35 -0
- package/getPrefix2.js +4 -0
- package/goober.modern.js +75 -0
- package/handlers.js +1 -1
- package/iconBase.js +56 -0
- package/iconContext.js +12 -0
- package/iconsManifest.js +222 -0
- package/index-esm.js +1 -4
- package/index.browser.js +1 -1
- package/index.m.js +9 -0
- package/index.m2.js +17 -0
- package/index10.js +1 -1
- package/index11.js +181 -15
- package/index112.js +1 -1
- package/index12.js +313 -36
- package/index13.js +5 -2430
- package/index14.js +3 -557
- package/index15.js +15 -55
- package/index16.js +3 -2
- package/index17.js +3 -87
- package/index18.js +36 -7
- package/index19.js +3 -60
- package/index20.js +2429 -12
- package/index21.js +557 -10
- package/index22.js +1 -1
- package/index23.js +119 -6
- package/index24.js +39 -7
- package/index25.js +2 -5
- package/index26.js +86 -9
- package/index27.js +55 -8
- package/index28.js +6 -636
- package/index29.js +8692 -74
- package/index3.js +1684 -5
- package/index30.js +2 -5
- package/index31.js +4 -20
- package/index310.js +2 -0
- package/index32.js +11 -2
- package/index33.js +5083 -4
- package/index34.js +2 -18
- package/index35.js +59 -5
- package/index36.js +2 -2
- package/index37.js +13 -11
- package/index38.js +46 -10
- package/index39.js +6 -12
- package/index4.js +5 -1684
- package/index40.js +8 -11
- package/index41.js +26 -18
- package/index42.js +2 -64
- package/index43.js +63 -5
- package/index44.js +9 -55
- package/index45.js +7 -67
- package/index46.js +8 -31
- package/index47.js +5 -11
- package/index48.js +10 -121
- package/index49.js +9 -86
- package/index5.js +215 -23
- package/index50.js +636 -7
- package/index51.js +74 -11
- package/index52.js +4 -13
- package/index53.js +19 -13
- package/index54.js +4 -6
- package/index55.js +18 -7
- package/index56.js +5 -14
- package/index57.js +10 -28
- package/index58.js +10 -15
- package/index59.js +15 -0
- package/index6.js +250 -299
- package/index60.js +13 -0
- package/index61.js +21 -0
- package/index62.js +8 -0
- package/index63.js +57 -0
- package/index64.js +4 -0
- package/index65.js +69 -0
- package/index66.js +33 -0
- package/index67.js +13 -0
- package/index68.js +123 -0
- package/index69.js +88 -0
- package/index7.js +25 -2
- package/index70.js +10 -0
- package/index71.js +13 -0
- package/index72.js +13 -225
- package/index73.js +16 -0
- package/index74.js +9 -0
- package/index75.js +228 -0
- package/index76.js +9 -0
- package/index77.js +17 -0
- package/index78.js +31 -0
- package/index79.js +18 -0
- package/index8.js +1537 -1536
- package/index9.js +1 -1
- package/isAbsoluteURL.js +1 -1
- package/isURLSameOrigin.js +1 -1
- package/localization.js +15 -15
- package/log.js +14 -0
- package/log2.js +4 -0
- package/matchRequestUrl.js +1 -1
- package/mergeConfig.js +37 -32
- package/notify.js +2 -2
- package/package.json +1 -1
- package/positionFns.js +101 -0
- package/positionFns2.js +4 -0
- package/react-laag.esm.js +957 -0
- package/react.js +8 -8
- package/react2.js +9 -9
- package/resolveConfig.js +23 -23
- package/select/add-media/AddMedia.d.ts +3 -1
- package/select/current-selection/SelectedItems.d.ts +1 -1
- package/shims.js +29 -0
- package/shims2.js +4 -0
- package/store/StoreInitializer.d.ts +5 -1
- package/store/useAssetFilterStore.d.ts +55 -0
- package/store/useSelectionStore.d.ts +47 -0
- package/styled-components.browser.esm.js +2 -2
- package/throttle.js +1 -1
- package/toURLEncodedForm.js +11 -10
- package/tokenExpirationHelper.js +1 -1
- package/transformData.js +1 -1
- package/transitional.js +4 -3
- package/useAssetFilterStore.js +152 -0
- package/useDatStore.js +1 -1
- package/useEffectEvent.js +7 -7
- package/useFonts.js +1 -1
- package/useOrderingStore.js +1 -1
- package/useRouterStore.js +1 -1
- package/useSearchStore.js +1 -1
- package/useSelectionStore.js +131 -0
- package/useSimilaritySearchStore.js +1 -1
- package/useTranslate.js +1 -1
- package/utils/combineMetaproperties.d.ts +2 -0
- package/utils6.js +160 -118
- package/xhr.js +47 -46
- package/AssetFilterContext.js +0 -161
- package/Middleware.js +0 -49
- package/SelectionContext.js +0 -143
- package/middleware2.js +0 -177
- package/select/SelectionContext.d.ts +0 -30
package/Option_new.js
CHANGED
|
@@ -1,48 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import s from "./styled-components.browser.esm.js";
|
|
3
|
-
import { TruncatedText as
|
|
4
|
-
import { token as
|
|
5
|
-
import { IconCheckCircle as
|
|
6
|
-
import { ListItem as
|
|
3
|
+
import { TruncatedText as l } from "./TruncatedText.js";
|
|
4
|
+
import { token as r } from "./token.js";
|
|
5
|
+
import { IconCheckCircle as n } from "./index3.js";
|
|
6
|
+
import { ListItem as h, StyledCheckboxWrapper as g, Content as k } from "./Checkbox.styles.js";
|
|
7
7
|
const w = ({
|
|
8
|
-
option:
|
|
9
|
-
onClick:
|
|
10
|
-
metapropertyName:
|
|
11
|
-
isSelected:
|
|
12
|
-
metapropertyMultifilter:
|
|
13
|
-
showCount:
|
|
14
|
-
count:
|
|
15
|
-
}) => /* @__PURE__ */
|
|
16
|
-
|
|
8
|
+
option: e,
|
|
9
|
+
onClick: p,
|
|
10
|
+
metapropertyName: c,
|
|
11
|
+
isSelected: o,
|
|
12
|
+
metapropertyMultifilter: d,
|
|
13
|
+
showCount: a = !0,
|
|
14
|
+
count: m
|
|
15
|
+
}) => /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(g, { $isChecked: o, children: /* @__PURE__ */ i(
|
|
16
|
+
k,
|
|
17
17
|
{
|
|
18
|
-
$isChecked:
|
|
18
|
+
$isChecked: o,
|
|
19
19
|
onClick: () => {
|
|
20
|
-
c
|
|
20
|
+
p(c, e, d);
|
|
21
21
|
},
|
|
22
22
|
"data-testid": "metaproperty-option",
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
/* @__PURE__ */ t(l, { children: e.label }),
|
|
25
|
+
o && !a ? /* @__PURE__ */ t(n, { "data-testid": "metaproperty-option-checkmark" }) : null,
|
|
26
|
+
a && /* @__PURE__ */ i(
|
|
27
|
+
f,
|
|
28
|
+
{
|
|
29
|
+
className: "fade-in-down",
|
|
30
|
+
"data-testid": "metaproperty-option-count",
|
|
31
|
+
children: [
|
|
32
|
+
o ? /* @__PURE__ */ t(n, { "data-testid": "metaproperty-option-checkmark" }) : null,
|
|
33
|
+
" ",
|
|
34
|
+
m
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
)
|
|
31
38
|
]
|
|
32
39
|
}
|
|
33
|
-
) }) }),
|
|
40
|
+
) }) }), f = s.span`
|
|
34
41
|
display: flex;
|
|
35
42
|
align-items: center;
|
|
36
|
-
padding: 0 ${
|
|
43
|
+
padding: 0 ${r.spacing3};
|
|
37
44
|
color: rgba(0, 34, 51, 0.8);
|
|
38
45
|
background-color: #f7f8f9;
|
|
39
46
|
border: 1px solid rgba(0, 34, 51, 0.1);
|
|
40
|
-
border-radius: ${
|
|
47
|
+
border-radius: ${r.spacing5};
|
|
41
48
|
|
|
42
49
|
svg {
|
|
43
|
-
max-width: ${
|
|
44
|
-
max-height: ${
|
|
45
|
-
margin-right: ${
|
|
50
|
+
max-width: ${r.spacing5};
|
|
51
|
+
max-height: ${r.spacing5};
|
|
52
|
+
margin-right: ${r.spacing2};
|
|
46
53
|
}
|
|
47
54
|
`;
|
|
48
55
|
export {
|
package/RightArrow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import o from "./styled-components.browser.esm.js";
|
|
3
|
-
import { IconArrowRight as r } from "./
|
|
3
|
+
import { IconArrowRight as r } from "./index3.js";
|
|
4
4
|
import { Button as a } from "./Button.js";
|
|
5
5
|
function d(i) {
|
|
6
6
|
return /* @__PURE__ */ t(f, { children: /* @__PURE__ */ t(
|
package/SearchInput.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as B, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as a, useEffect as p } from "react";
|
|
3
3
|
import g from "./styled-components.browser.esm.js";
|
|
4
4
|
import { useDebouncedCallback as m } from "./index.module2.js";
|
|
5
|
-
import { IconSearch as F, IconImage as H } from "./
|
|
5
|
+
import { IconSearch as F, IconImage as H } from "./index3.js";
|
|
6
6
|
import { Input as $ } from "./Input.js";
|
|
7
7
|
import { Spinner as j } from "./Spinner.js";
|
|
8
8
|
import { __ as f } from "./index2.js";
|
package/SearchInput2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as f, useEffect as p } from "react";
|
|
3
3
|
import t from "./styled-components.browser.esm.js";
|
|
4
|
-
import { IconSearch as h } from "./
|
|
4
|
+
import { IconSearch as h } from "./index3.js";
|
|
5
5
|
import { Input as l } from "./Input.js";
|
|
6
6
|
import { token as n } from "./token.js";
|
|
7
7
|
import { useDropdownContext as a } from "./context3.js";
|
package/SelectionFooter.js
CHANGED
|
@@ -1,64 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Button as
|
|
4
|
-
import { token as
|
|
5
|
-
import { IconSteps as
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import m from "./styled-components.browser.esm.js";
|
|
3
|
+
import { Button as a } from "./Button.js";
|
|
4
|
+
import { token as r } from "./token.js";
|
|
5
|
+
import { IconSteps as y } from "./index3.js";
|
|
6
6
|
import { Dropdown as v } from "./Dropdown.js";
|
|
7
7
|
import { __ as o } from "./index2.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
8
|
+
import { AddMedia as w } from "./AddMedia.js";
|
|
9
|
+
import { SelectedItems as C } from "./SelectedItems.js";
|
|
10
|
+
import { useConfig as A } from "./ConfigContext.js";
|
|
11
|
+
import { useRouterSelectors as I } from "./useRouterStore.js";
|
|
12
|
+
import { Tooltip as k } from "./Tooltip.js";
|
|
13
|
+
import { useSimilaritySearchStore as M } from "./useSimilaritySearchStore.js";
|
|
14
|
+
import { useSimilarityAssets as _ } from "./getSimilarityAssets.js";
|
|
15
|
+
import { useSelectionStore as $ } from "./useSelectionStore.js";
|
|
16
16
|
function L() {
|
|
17
|
-
const { selection: i, clear:
|
|
17
|
+
const { selection: i, clear: n, selectAll: p } = $(), { selectionMode: l, selectAllOption: u } = A(), f = I.use.page(), { setIsSelected: S, isEnabled: g } = M(), { search: h, resetData: x } = _(), s = i.length >= 1 ? i.filter(
|
|
18
18
|
(t) => t.type === "asset" && t.value.__typename === "Image"
|
|
19
|
-
).map((t) => t.value.databaseId ? t.value.databaseId : t.value.id) : [],
|
|
20
|
-
x(), S(!0), h(s),
|
|
19
|
+
).map((t) => t.value.databaseId ? t.value.databaseId : t.value.id) : [], b = () => {
|
|
20
|
+
x(), S(!0), h(s), n();
|
|
21
21
|
}, c = i.length;
|
|
22
|
-
return c === 0 ? null : /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
22
|
+
return c === 0 ? null : /* @__PURE__ */ d(j, { "data-testid": "selection-footer", children: [
|
|
23
|
+
/* @__PURE__ */ d(D, { children: [
|
|
24
24
|
/* @__PURE__ */ e(
|
|
25
25
|
v,
|
|
26
26
|
{
|
|
27
27
|
buttonKind: "secondary",
|
|
28
28
|
direction: "Up",
|
|
29
29
|
title: o("View {} selected").replace("{}", c.toString()),
|
|
30
|
-
|
|
30
|
+
"data-testid": "view-selected-dropdown",
|
|
31
|
+
children: () => /* @__PURE__ */ e(C, { selection: i })
|
|
31
32
|
}
|
|
32
33
|
),
|
|
33
|
-
l === "MultiSelect" &&
|
|
34
|
-
/* @__PURE__ */ e(
|
|
34
|
+
l === "MultiSelect" && u && f.page === "assets" && /* @__PURE__ */ e(a, { variant: "secondary", onClick: p, "data-testid": "select-all-button", children: o("Select all") }),
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
a,
|
|
37
|
+
{
|
|
38
|
+
variant: "clean",
|
|
39
|
+
onClick: n,
|
|
40
|
+
"data-testid": "clear-selection-button",
|
|
41
|
+
children: o("Clear selection")
|
|
42
|
+
}
|
|
43
|
+
)
|
|
35
44
|
] }),
|
|
36
|
-
l === "MultiSelect" &&
|
|
37
|
-
|
|
45
|
+
l === "MultiSelect" && g && s.length > 0 && /* @__PURE__ */ e(k, { text: o("Show similar"), margin: "right", marginAmount: "spacing3", children: /* @__PURE__ */ e(
|
|
46
|
+
a,
|
|
38
47
|
{
|
|
39
48
|
variant: "clean",
|
|
40
|
-
icon: /* @__PURE__ */ e(
|
|
49
|
+
icon: /* @__PURE__ */ e(y, {}),
|
|
41
50
|
"aria-label": o("Show similar"),
|
|
42
|
-
onClick:
|
|
51
|
+
onClick: b,
|
|
52
|
+
"data-testid": "show-similar-button"
|
|
43
53
|
}
|
|
44
54
|
) }),
|
|
45
|
-
/* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ e(w, { selection: i })
|
|
46
56
|
] });
|
|
47
57
|
}
|
|
48
|
-
const j =
|
|
58
|
+
const j = m.div`
|
|
49
59
|
display: flex;
|
|
50
60
|
flex-shrink: 0;
|
|
51
61
|
z-index: 10;
|
|
52
|
-
height: ${
|
|
53
|
-
padding: ${
|
|
62
|
+
height: ${r.layoutSpacing5};
|
|
63
|
+
padding: ${r.spacing6};
|
|
54
64
|
align-items: center;
|
|
55
65
|
box-shadow: 0 -1px 0 0 rgba(0, 34, 51, 0.1), 0 -1px 6px 0 rgba(0, 34, 51, 0.1);
|
|
56
66
|
animation: var(--fade-in-down);
|
|
57
|
-
`, D =
|
|
67
|
+
`, D = m.span`
|
|
58
68
|
display: flex;
|
|
59
69
|
flex-grow: 1;
|
|
60
70
|
align-items: center;
|
|
61
|
-
gap: ${
|
|
71
|
+
gap: ${r.spacing2};
|
|
62
72
|
`;
|
|
63
73
|
export {
|
|
64
74
|
L as SelectionFooter
|
package/Shield.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import e from "react";
|
|
3
3
|
import { Oops as o } from "./Oops.js";
|
|
4
|
-
class
|
|
4
|
+
class p extends e.Component {
|
|
5
5
|
constructor(r) {
|
|
6
6
|
super(r), this.state = { error: null };
|
|
7
7
|
}
|
|
@@ -20,5 +20,5 @@ class l extends e.Component {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
p as Shield
|
|
24
24
|
};
|
package/Smartfilters_new.js
CHANGED
|
@@ -1,48 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { Box as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { token as
|
|
8
|
-
import { IconArrowLeft as
|
|
9
|
-
import { useConfig as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { jsx as i, Fragment as J, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useRef as f, useEffect as K } from "react";
|
|
3
|
+
import g from "./styled-components.browser.esm.js";
|
|
4
|
+
import { Box as Q } from "./Box.js";
|
|
5
|
+
import { Button as Y } from "./Button.js";
|
|
6
|
+
import { Flex as Z } from "./Flex.js";
|
|
7
|
+
import { token as S } from "./token.js";
|
|
8
|
+
import { IconArrowLeft as tt, IconArrowRight as et } from "./index3.js";
|
|
9
|
+
import { useConfig as rt } from "./ConfigContext.js";
|
|
10
|
+
import { Dropdown as ot } from "./Dropdown.js";
|
|
11
|
+
import { Autocomplete as nt } from "./Autocomplete_new.js";
|
|
12
|
+
import { SmartFilterSelect as it } from "./SmartFilterSelect_new.js";
|
|
13
|
+
import { getAutocompleteOptions as st } from "./autocomplete.js";
|
|
14
|
+
import { useAuth as lt } from "./LoginContext.js";
|
|
15
|
+
import { debounceAsync as at } from "./asyncDebounce.js";
|
|
16
|
+
import { useAssetFilterStore as ct } from "./useAssetFilterStore.js";
|
|
17
|
+
const Lt = ({ filterData: l }) => {
|
|
18
|
+
const {
|
|
19
|
+
selectSmartfilterOption: y,
|
|
20
|
+
selectedSmartfilterOptions: a,
|
|
21
|
+
existingFilters: n,
|
|
22
|
+
isDropdownActive: D
|
|
23
|
+
} = ct(), X = lt(), { language: A } = rt(), I = pt(l, n), [P, M] = d({}), [R, O] = d(), [U, v] = d({}), [h, m] = d(0), [c, W] = d(0), [C, F] = d(!1), p = f(null), x = f(!1), u = f(null), b = f(null), w = f({});
|
|
24
|
+
K(() => {
|
|
25
|
+
p.current && W(p.current.scrollWidth - p.current.clientWidth), D || (M({}), O({}));
|
|
26
|
+
}, [l, p, D]);
|
|
27
|
+
const z = h === 0, E = c > 5 && h !== c;
|
|
28
|
+
function N() {
|
|
29
|
+
m((e) => {
|
|
25
30
|
const t = Math.max(e - 250, 0);
|
|
26
31
|
return t >= 100 ? t : 0;
|
|
27
32
|
});
|
|
28
33
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
34
|
+
function _() {
|
|
35
|
+
m((e) => {
|
|
31
36
|
const t = Math.min(e + 250, c);
|
|
32
37
|
return t <= c - 100 ? t : c;
|
|
33
38
|
});
|
|
34
39
|
}
|
|
35
|
-
const
|
|
40
|
+
const j = async (e, t, o) => {
|
|
36
41
|
let s;
|
|
37
|
-
|
|
42
|
+
v((r) => ({
|
|
38
43
|
...r,
|
|
39
44
|
[t]: !0
|
|
40
|
-
})), e.length >= 2 && (s = await
|
|
45
|
+
})), e.length >= 2 && (s = await st({
|
|
41
46
|
metapropertyId: t,
|
|
42
|
-
auth:
|
|
47
|
+
auth: X,
|
|
43
48
|
searchTerm: e,
|
|
44
49
|
page: o
|
|
45
|
-
})),
|
|
50
|
+
})), O((r) => ({
|
|
46
51
|
...r,
|
|
47
52
|
[t]: s ? {
|
|
48
53
|
...s,
|
|
@@ -51,20 +56,20 @@ const Ct = ({ filterData: l }) => {
|
|
|
51
56
|
...s.metapropertyOptions
|
|
52
57
|
] : s.metapropertyOptions
|
|
53
58
|
} : null
|
|
54
|
-
})),
|
|
59
|
+
})), v((r) => ({
|
|
55
60
|
...r,
|
|
56
61
|
[t]: !1
|
|
57
62
|
}));
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
63
|
+
}, B = (e) => (w.current[e] || (w.current[e] = at(j, 500)), w.current[e]), $ = (e, t, o) => {
|
|
64
|
+
y(e, t, o);
|
|
65
|
+
}, H = (e, t, o) => {
|
|
66
|
+
M((r) => ({
|
|
62
67
|
...r,
|
|
63
68
|
[e]: t
|
|
64
|
-
})),
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
},
|
|
69
|
+
})), B(e)(t, e, o);
|
|
70
|
+
}, V = (e) => {
|
|
71
|
+
u.current = e.clientX, x.current = !1, F(!0);
|
|
72
|
+
}, T = (e) => {
|
|
68
73
|
if (x.current) {
|
|
69
74
|
e.preventDefault();
|
|
70
75
|
const t = (o) => {
|
|
@@ -75,86 +80,86 @@ const Ct = ({ filterData: l }) => {
|
|
|
75
80
|
once: !0
|
|
76
81
|
});
|
|
77
82
|
}
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
if (!
|
|
81
|
-
e.preventDefault(),
|
|
82
|
-
const t = (e.clientX -
|
|
83
|
-
return t <= 16 ?
|
|
83
|
+
u.current = null, b.current = null, F(!1);
|
|
84
|
+
}, q = (e) => {
|
|
85
|
+
if (!C || !p.current || !u.current) return;
|
|
86
|
+
e.preventDefault(), b.current === null && (b.current = h), u.current && Math.abs(e.clientX - u.current) > 5 && (x.current = !0);
|
|
87
|
+
const t = (e.clientX - u.current) * -1 + b.current;
|
|
88
|
+
return t <= 16 ? m(0) : t + 16 < c ? m(t) : m(c);
|
|
84
89
|
};
|
|
85
|
-
return /* @__PURE__ */
|
|
90
|
+
return /* @__PURE__ */ i(J, { children: I.map((e) => {
|
|
86
91
|
const t = e.smartfilter, o = e.metapropertyFilters;
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
|
|
92
|
+
return /* @__PURE__ */ i(
|
|
93
|
+
ot,
|
|
89
94
|
{
|
|
90
|
-
title: t.labels[
|
|
91
|
-
alt: t.labels[
|
|
95
|
+
title: t.labels[A] || t.labels.en_US,
|
|
96
|
+
alt: t.labels[A] || t.labels.en_US,
|
|
92
97
|
isSmall: !0,
|
|
93
98
|
fadeIn: !0,
|
|
94
99
|
isMetapropertyDropdown: !0,
|
|
95
|
-
children: () => /* @__PURE__ */
|
|
96
|
-
|
|
100
|
+
children: () => /* @__PURE__ */ k(
|
|
101
|
+
ut,
|
|
97
102
|
{
|
|
98
|
-
ref:
|
|
99
|
-
onMouseDown:
|
|
100
|
-
onMouseUp:
|
|
101
|
-
onMouseMove:
|
|
103
|
+
ref: p,
|
|
104
|
+
onMouseDown: V,
|
|
105
|
+
onMouseUp: T,
|
|
106
|
+
onMouseMove: q,
|
|
102
107
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
108
|
+
/* @__PURE__ */ i(
|
|
109
|
+
dt,
|
|
105
110
|
{
|
|
106
|
-
$scroll:
|
|
111
|
+
$scroll: h,
|
|
107
112
|
"data-testid": "metaproperty-dropdown-content",
|
|
108
|
-
$isDragging:
|
|
113
|
+
$isDragging: C,
|
|
109
114
|
children: o.map((s) => {
|
|
110
115
|
const r = s.metaproperty;
|
|
111
|
-
if (!
|
|
116
|
+
if (!n?.[r.name] || r.type !== "autocomplete" && (r.type !== "smart-single" && r.type !== "select" || r.options.length === 0))
|
|
112
117
|
return null;
|
|
113
|
-
const
|
|
114
|
-
|
|
118
|
+
const G = r.type === "autocomplete" ? /* @__PURE__ */ i(
|
|
119
|
+
nt,
|
|
115
120
|
{
|
|
116
121
|
metaproperty: r,
|
|
117
|
-
value:
|
|
118
|
-
onChange:
|
|
119
|
-
onOptionSelect:
|
|
120
|
-
autocompleteOptions:
|
|
121
|
-
isLoading:
|
|
122
|
-
selectedOptions:
|
|
122
|
+
value: P[r.id] || "",
|
|
123
|
+
onChange: H,
|
|
124
|
+
onOptionSelect: $,
|
|
125
|
+
autocompleteOptions: R || {},
|
|
126
|
+
isLoading: U[r.id] || !1,
|
|
127
|
+
selectedOptions: a || {}
|
|
123
128
|
}
|
|
124
|
-
) : /* @__PURE__ */
|
|
125
|
-
|
|
129
|
+
) : /* @__PURE__ */ i(
|
|
130
|
+
it,
|
|
126
131
|
{
|
|
127
132
|
metaproperty: r,
|
|
128
133
|
smartfilterId: t.id,
|
|
129
|
-
onOptionSelect:
|
|
130
|
-
selectedOptions:
|
|
131
|
-
filteredMetaproperty:
|
|
134
|
+
onOptionSelect: $,
|
|
135
|
+
selectedOptions: a || {},
|
|
136
|
+
filteredMetaproperty: n?.[r.name],
|
|
132
137
|
metapropertyCursor: s.metadata.nextCursorMark
|
|
133
138
|
}
|
|
134
139
|
);
|
|
135
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ i(mt, { children: G }, r.id);
|
|
136
141
|
})
|
|
137
142
|
}
|
|
138
143
|
),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
144
|
+
/* @__PURE__ */ k(ft, { direction: "row", justifyContent: "flex-end", children: [
|
|
145
|
+
/* @__PURE__ */ i(
|
|
146
|
+
L,
|
|
142
147
|
{
|
|
143
148
|
title: "Previous",
|
|
144
|
-
icon: /* @__PURE__ */
|
|
145
|
-
onClick:
|
|
149
|
+
icon: /* @__PURE__ */ i(tt, {}),
|
|
150
|
+
onClick: N,
|
|
146
151
|
"data-testid": "left-arrow",
|
|
147
|
-
isDisabled:
|
|
152
|
+
isDisabled: z
|
|
148
153
|
}
|
|
149
154
|
),
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
|
|
155
|
+
/* @__PURE__ */ i(
|
|
156
|
+
L,
|
|
152
157
|
{
|
|
153
158
|
title: "Next",
|
|
154
|
-
icon: /* @__PURE__ */
|
|
155
|
-
onClick:
|
|
159
|
+
icon: /* @__PURE__ */ i(et, {}),
|
|
160
|
+
onClick: _,
|
|
156
161
|
"data-testid": "right-arrow",
|
|
157
|
-
isDisabled: !
|
|
162
|
+
isDisabled: !E
|
|
158
163
|
}
|
|
159
164
|
)
|
|
160
165
|
] })
|
|
@@ -166,34 +171,38 @@ const Ct = ({ filterData: l }) => {
|
|
|
166
171
|
);
|
|
167
172
|
}) });
|
|
168
173
|
};
|
|
169
|
-
function
|
|
170
|
-
return [...l.filters].
|
|
174
|
+
function pt(l, y) {
|
|
175
|
+
return [...l.filters].filter(
|
|
176
|
+
(a) => a.metapropertyFilters.some(
|
|
177
|
+
(n) => a.smartfilter.metaproperties.includes(n.metaproperty.id) && y?.[n.metaproperty.name] && (n.metaproperty.options.length > 0 || n.metaproperty.type === "autocomplete")
|
|
178
|
+
)
|
|
179
|
+
).sort((a, n) => a.smartfilter.zindex - n.smartfilter.zindex);
|
|
171
180
|
}
|
|
172
|
-
const
|
|
181
|
+
const ut = g.div`
|
|
173
182
|
display: flex;
|
|
174
183
|
flex-direction: column;
|
|
175
184
|
overflow: hidden;
|
|
176
|
-
`,
|
|
185
|
+
`, dt = g.div`
|
|
177
186
|
display: flex;
|
|
178
187
|
flex-direction: row;
|
|
179
188
|
transform: translateX(-${(l) => l.$scroll}px);
|
|
180
189
|
transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.15);
|
|
181
190
|
width: fit-content;
|
|
182
191
|
cursor: ${(l) => l.$isDragging ? "grabbing" : "default"};
|
|
183
|
-
`,
|
|
192
|
+
`, mt = g(Q)`
|
|
184
193
|
border-right: 1px solid rgba(3, 16, 38, 0.1);
|
|
185
194
|
max-width: 300px;
|
|
186
|
-
`,
|
|
187
|
-
padding: ${
|
|
195
|
+
`, ft = g(Z)`
|
|
196
|
+
padding: ${S.spacing3};
|
|
188
197
|
border-top: 1px solid rgba(3, 16, 38, 0.1);
|
|
189
|
-
gap: ${
|
|
190
|
-
`,
|
|
191
|
-
padding: ${
|
|
198
|
+
gap: ${S.spacing3};
|
|
199
|
+
`, L = g(Y)`
|
|
200
|
+
padding: ${S.spacing3};
|
|
192
201
|
border-radius: 6px;
|
|
193
202
|
border: 1px solid rgba(3, 16, 38, 0.1);
|
|
194
203
|
background: rgba(3, 16, 38, 0.03);
|
|
195
204
|
cursor: pointer;
|
|
196
205
|
`;
|
|
197
206
|
export {
|
|
198
|
-
|
|
207
|
+
Lt as Smartfilter
|
|
199
208
|
};
|