@ironsource/shared-ui 2.1.11-test.99 → 2.1.12-rc.0
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/Chart.vue_vue_type_style_index_0_scoped_026d82c5_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +1 -0
- package/ChartLoader.vue_vue_type_style_index_0_scoped_ffa4cc66_lang.css +1 -0
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8e026669_lang.css +1 -0
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +1 -0
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_73bf9b5b_lang.css +1 -0
- package/EditableV4.vue_vue_type_style_index_0_scoped_1bbe222a_lang.css +1 -0
- package/IconFlag.vue_vue_type_style_index_0_scoped_6526c390_lang.css +1 -0
- package/OptionV4.vue_vue_type_style_index_0_scoped_1e8837dc_lang.css +1 -0
- package/SnackbarV4.vue_vue_type_style_index_0_scoped_1b650c39_lang.css +1 -0
- package/SortableItem.vue_vue_type_style_index_0_scoped_48542664_lang.css +1 -0
- package/SortableList.vue_vue_type_style_index_0_scoped_8f267f88_lang.css +1 -0
- package/TextField.vue_vue_type_style_index_0_scoped_fce3948c_lang.css +1 -0
- package/TooltipV4.vue_vue_type_style_index_0_scoped_66eab856_lang.css +1 -0
- package/TooltipV4.vue_vue_type_style_index_1_lang.css +1 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +1 -0
- package/Typography.vue_vue_type_style_index_0_scoped_07b259bf_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +5 -0
- package/components/chart/Chart.vue.js +3 -3
- package/components/chart/Chart.vue2.js +116 -108
- package/components/chart/ChartLegend.vue.js +3 -3
- package/components/chart/ChartLegend.vue2.js +64 -54
- package/components/chart/ChartLoader.vue.js +5 -23
- package/components/chart/ChartLoader.vue2.js +15 -0
- package/components/chart/index.d.ts +20 -1
- package/components/chart/mockData.d.ts +8 -0
- package/components/dateRange/v4/DateRangeV4.vue.js +3 -3
- package/components/dateRange/v4/DateRangeV4.vue2.js +86 -81
- package/components/dropdown/common/Dropdown.common.js +65 -65
- package/components/dropdown/v4/ConditionalDropdown.vue.d.ts +5 -3
- package/components/dropdown/v4/ConditionalDropdown.vue.js +3 -3
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +106 -100
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +45 -46
- package/components/dropdown/v4/OptionV4.vue.js +3 -3
- package/components/dropdown/v4/OptionV4.vue2.js +97 -98
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +86 -86
- package/components/dropdown/v4/index.d.ts +5 -3
- package/components/icon/v4/IconFlag.vue.js +3 -3
- package/components/icon/v4/IconFlag.vue2.js +1 -1
- package/components/input/v4/TextField.vue.js +3 -3
- package/components/input/v4/TextField.vue2.js +184 -164
- package/components/snackbar/v4/SnackbarV4.vue.js +3 -3
- package/components/snackbar/v4/SnackbarV4.vue2.js +1 -1
- package/components/sortableList/SortableItem.vue.d.ts +5 -0
- package/components/sortableList/SortableItem.vue.js +3 -3
- package/components/sortableList/SortableItem.vue2.js +76 -61
- package/components/sortableList/SortableList.vue.d.ts +16 -0
- package/components/sortableList/SortableList.vue.js +3 -3
- package/components/sortableList/SortableList.vue2.js +100 -87
- package/components/sortableList/index.d.ts +59 -1
- package/components/table/v4/DataGrid.vue.d.ts +1 -1
- package/components/table/v4/MultipleDataGrid.vue.d.ts +1 -1
- package/components/table/v4/index.d.ts +40 -40
- package/components/table-cells/common/Editable.common.js +8 -7
- package/components/table-cells/common/EditableContext.d.ts +1 -0
- package/components/table-cells/v4/EditableV4.vue.d.ts +5 -0
- package/components/table-cells/v4/EditableV4.vue.js +3 -3
- package/components/table-cells/v4/EditableV4.vue2.js +11 -10
- package/components/table-cells/v4/index.d.ts +20 -1
- package/components/tooltip/v4/TooltipV4.vue.js +3 -3
- package/components/tooltip/v4/TooltipV4.vue2.js +1 -1
- package/components/typography/v4/Typography.vue.js +3 -3
- package/components/typography/v4/Typography.vue2.js +1 -1
- package/index.d.ts +248 -90
- package/index.js +1 -1
- package/mocks/apps.d.ts +1 -0
- package/mocks/randomValue.d.ts +1 -0
- package/package.json +3 -3
- package/testids/index.d.ts +1 -0
- package/testids/index.js +13 -13
- package/Chart.vue_vue_type_style_index_0_scoped_04b9d6b3_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_a1c626cd_lang.css +0 -1
- package/ChartLoader.vue_vue_type_style_index_0_scoped_142c444a_lang.css +0 -1
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_b2684c5f_lang.css +0 -1
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_309e5351_lang.css +0 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_9fa84b26_lang.css +0 -1
- package/EditableV4.vue_vue_type_style_index_0_scoped_e0c047b4_lang.css +0 -1
- package/IconFlag.vue_vue_type_style_index_0_scoped_7b09cc85_lang.css +0 -1
- package/OptionV4.vue_vue_type_style_index_0_scoped_2c2947b3_lang.css +0 -1
- package/SnackbarV4.vue_vue_type_style_index_0_scoped_89fe8aa1_lang.css +0 -1
- package/SortableItem.vue_vue_type_style_index_0_scoped_7cb676f1_lang.css +0 -1
- package/SortableList.vue_vue_type_style_index_0_scoped_156c01ca_lang.css +0 -1
- package/TextField.vue_vue_type_style_index_0_scoped_2e327aa1_lang.css +0 -1
- package/TooltipV4.vue_vue_type_style_index_0_scoped_82b46d6d_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_bdfb0aef_lang.css +0 -1
- package/Typography.vue_vue_type_style_index_0_scoped_a14013a5_lang.css +0 -1
- package/consts/configs.js +0 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "../../SortableItem.
|
|
2
|
-
import
|
|
1
|
+
import "../../SortableItem.vue_vue_type_style_index_0_scoped_48542664_lang.css"; import { defineComponent as P, useCssVars as E, useSlots as $, computed as C, watch as I, ref as R, openBlock as l, createElementBlock as n, normalizeClass as f, unref as t, withModifiers as u, createElementVNode as c, createVNode as h, createBlock as a, withCtx as b, createTextVNode as S, toDisplayString as V, createCommentVNode as d, renderSlot as D, mergeProps as F, normalizeProps as j, Fragment as q, renderList as A } from "vue";
|
|
2
|
+
import L from "../typography/v4/Typography.vue.js";
|
|
3
3
|
import m from "../icon/v4/IconV4.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useVirtualList as
|
|
7
|
-
import { matchString as
|
|
8
|
-
import { useHoverEffect as
|
|
9
|
-
const
|
|
4
|
+
import w from "../icon/v4/IconFlag.vue.js";
|
|
5
|
+
import G from "./SortableItemLabel.vue.js";
|
|
6
|
+
import { useVirtualList as J } from "@vueuse/core";
|
|
7
|
+
import { matchString as K } from "../../utils/search.js";
|
|
8
|
+
import { useHoverEffect as U } from "./composables/useHoverEffect.js";
|
|
9
|
+
const W = { class: "draggable-handle" }, X = { class: "item__prefix" }, Y = ["onClick"], Z = { class: "item__text" }, _ = ["onClick"], ce = /* @__PURE__ */ P({
|
|
10
10
|
__name: "SortableItem",
|
|
11
11
|
props: {
|
|
12
12
|
item: null,
|
|
@@ -15,127 +15,142 @@ const U = { class: "draggable-handle" }, W = { class: "item__prefix" }, X = ["on
|
|
|
15
15
|
isSelected: { type: Boolean, default: !1 },
|
|
16
16
|
selectedChildId: { default: null },
|
|
17
17
|
searchQuery: { default: null },
|
|
18
|
+
childListMaxHeight: { default: "530px" },
|
|
18
19
|
searchHandler: { type: Function, default: null },
|
|
19
20
|
displayValue: null
|
|
20
21
|
},
|
|
21
22
|
emits: ["toggle", "select", "selectChild"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
setup(e, { emit: y }) {
|
|
24
|
+
const s = e;
|
|
25
|
+
E((r) => ({
|
|
26
|
+
"480cd4cc": e.childListMaxHeight
|
|
27
|
+
}));
|
|
28
|
+
const H = $(), M = () => {
|
|
29
|
+
y("toggle", !s.isOpen);
|
|
30
|
+
}, g = C(() => (s.item.children || []).filter(
|
|
31
|
+
(o) => s.searchHandler ? s.searchHandler(o, s.searchQuery) : K(o.displayText, s.searchQuery)
|
|
32
|
+
)), k = C(() => g.value.length > 0), z = (r) => r.id === s.selectedChildId, {
|
|
33
|
+
list: Q,
|
|
34
|
+
containerProps: B,
|
|
35
|
+
wrapperProps: T,
|
|
31
36
|
scrollTo: N
|
|
32
|
-
} =
|
|
37
|
+
} = J(g, {
|
|
33
38
|
itemHeight: 34
|
|
34
39
|
});
|
|
35
|
-
|
|
36
|
-
() =>
|
|
40
|
+
I(
|
|
41
|
+
() => s.searchQuery,
|
|
37
42
|
() => N(0)
|
|
38
43
|
);
|
|
39
|
-
const p =
|
|
44
|
+
const p = R(null), { handleMouseout: v, handleMouseover: x } = U(
|
|
40
45
|
p,
|
|
41
46
|
"sortable-item--hovered"
|
|
42
47
|
);
|
|
43
|
-
return (
|
|
48
|
+
return (r, o) => (l(), n("div", {
|
|
44
49
|
ref_key: "itemRef",
|
|
45
50
|
ref: p,
|
|
46
|
-
class: f(["sortable-item", { "sortable-item--selected":
|
|
51
|
+
class: f(["sortable-item", { "sortable-item--selected": e.isSelected }]),
|
|
47
52
|
onMouseover: o[1] || (o[1] = //@ts-ignore
|
|
48
|
-
(...
|
|
53
|
+
(...i) => t(x) && t(x)(...i)),
|
|
49
54
|
onMouseout: o[2] || (o[2] = //@ts-ignore
|
|
50
|
-
(...
|
|
51
|
-
onClick: o[3] || (o[3] = u((
|
|
55
|
+
(...i) => t(v) && t(v)(...i)),
|
|
56
|
+
onClick: o[3] || (o[3] = u((i) => y("select"), ["stop"]))
|
|
52
57
|
}, [
|
|
53
|
-
|
|
54
|
-
class: f(["item", {
|
|
58
|
+
c("div", {
|
|
59
|
+
class: f(["item", {
|
|
60
|
+
"drag-allowed": !e.item.isLocked && !e.searchQuery,
|
|
61
|
+
"item--selected": e.isSelected && !e.selectedChildId
|
|
62
|
+
}])
|
|
55
63
|
}, [
|
|
56
|
-
|
|
57
|
-
h(
|
|
64
|
+
c("div", W, [
|
|
65
|
+
h(t(m), {
|
|
58
66
|
name: "dots-six-vertical",
|
|
59
|
-
|
|
67
|
+
size: "20px",
|
|
60
68
|
type: "bold"
|
|
61
69
|
})
|
|
62
70
|
]),
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
c("div", X, [
|
|
72
|
+
e.item.isLocked ? (l(), a(t(m), {
|
|
65
73
|
key: 1,
|
|
66
74
|
class: "locked-icon",
|
|
67
75
|
name: "lock",
|
|
68
|
-
|
|
69
|
-
})) : (l(),
|
|
76
|
+
size: "16px"
|
|
77
|
+
})) : (l(), a(t(L), {
|
|
70
78
|
key: 0,
|
|
71
79
|
class: "order-num",
|
|
72
80
|
variant: "subtitle2"
|
|
73
81
|
}, {
|
|
74
82
|
default: b(() => [
|
|
75
|
-
S(
|
|
83
|
+
S(V(e.index + 1) + ". ", 1)
|
|
76
84
|
]),
|
|
77
85
|
_: 1
|
|
78
86
|
}))
|
|
79
87
|
]),
|
|
80
|
-
|
|
88
|
+
t(k) && !e.searchQuery ? (l(), n("div", {
|
|
81
89
|
key: 0,
|
|
82
90
|
class: "expand-icon",
|
|
83
|
-
onClick: u(
|
|
91
|
+
onClick: u(M, ["stop"])
|
|
84
92
|
}, [
|
|
85
|
-
|
|
93
|
+
e.isOpen ? (l(), a(t(m), {
|
|
86
94
|
key: 0,
|
|
87
95
|
name: "caret-down",
|
|
88
96
|
size: "16px"
|
|
89
|
-
})) : (l(),
|
|
97
|
+
})) : (l(), a(t(m), {
|
|
90
98
|
key: 1,
|
|
91
99
|
name: "caret-right",
|
|
92
100
|
size: "16px"
|
|
93
101
|
}))
|
|
94
|
-
], 8,
|
|
95
|
-
|
|
96
|
-
|
|
102
|
+
], 8, Y)) : d("", !0),
|
|
103
|
+
c("div", Z, [
|
|
104
|
+
e.item.countryFlag ? (l(), a(t(w), {
|
|
97
105
|
key: 0,
|
|
98
106
|
class: "country-flag",
|
|
99
|
-
"country-code":
|
|
107
|
+
"country-code": e.item.countryFlag
|
|
100
108
|
}, null, 8, ["country-code"])) : d("", !0),
|
|
101
|
-
h(
|
|
102
|
-
"display-value":
|
|
103
|
-
item:
|
|
109
|
+
h(G, {
|
|
110
|
+
"display-value": e.displayValue,
|
|
111
|
+
item: e.item
|
|
104
112
|
}, null, 8, ["display-value", "item"])
|
|
105
113
|
]),
|
|
106
|
-
|
|
114
|
+
t(H).menu ? (l(), n("div", {
|
|
107
115
|
key: 1,
|
|
108
116
|
class: "item__menu",
|
|
109
117
|
onClick: o[0] || (o[0] = u(() => {
|
|
110
118
|
}, ["stop"]))
|
|
111
119
|
}, [
|
|
112
|
-
|
|
120
|
+
D(r.$slots, "menu", {}, void 0, !0)
|
|
113
121
|
])) : d("", !0)
|
|
114
122
|
], 2),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(l(!0),
|
|
123
|
+
c("div", F(t(B), { class: "child-list" }), [
|
|
124
|
+
t(k) && e.isOpen ? (l(), n("ul", j(F({ key: 0 }, t(T))), [
|
|
125
|
+
(l(!0), n(q, null, A(t(Q), ({ data: i, index: O }) => (l(), n("li", {
|
|
118
126
|
key: O,
|
|
119
|
-
class: f({ selected:
|
|
120
|
-
onClick: u((
|
|
127
|
+
class: f({ selected: z(i) }),
|
|
128
|
+
onClick: u((ee) => y("selectChild", i), ["stop"])
|
|
121
129
|
}, [
|
|
122
|
-
|
|
130
|
+
i.countryFlag ? (l(), a(t(w), {
|
|
123
131
|
key: 0,
|
|
124
132
|
class: "country-flag",
|
|
125
|
-
"country-code":
|
|
133
|
+
"country-code": i.countryFlag
|
|
126
134
|
}, null, 8, ["country-code"])) : d("", !0),
|
|
127
|
-
h(
|
|
135
|
+
h(t(L), {
|
|
136
|
+
class: "country-title",
|
|
137
|
+
variant: "body2",
|
|
138
|
+
"tooltip-placement": "top",
|
|
139
|
+
"tooltip-text": e.displayValue(i),
|
|
140
|
+
"is-truncated": "",
|
|
141
|
+
"with-tooltip": ""
|
|
142
|
+
}, {
|
|
128
143
|
default: b(() => [
|
|
129
|
-
S(
|
|
144
|
+
S(V(e.displayValue(i)), 1)
|
|
130
145
|
]),
|
|
131
146
|
_: 2
|
|
132
|
-
},
|
|
133
|
-
], 10,
|
|
147
|
+
}, 1032, ["tooltip-text"])
|
|
148
|
+
], 10, _))), 128))
|
|
134
149
|
], 16)) : d("", !0)
|
|
135
150
|
], 16)
|
|
136
151
|
], 34));
|
|
137
152
|
}
|
|
138
153
|
});
|
|
139
154
|
export {
|
|
140
|
-
|
|
155
|
+
ce as default
|
|
141
156
|
};
|
|
@@ -12,6 +12,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
12
12
|
isLoading?: boolean;
|
|
13
13
|
loadingRowCount?: number;
|
|
14
14
|
emptyStateTitle?: string;
|
|
15
|
+
childListMaxHeight?: string;
|
|
16
|
+
isSticky?: boolean;
|
|
17
|
+
zIndexBase?: number;
|
|
15
18
|
testId?: string;
|
|
16
19
|
}>, {
|
|
17
20
|
items: () => any[];
|
|
@@ -26,6 +29,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
26
29
|
isLoading: boolean;
|
|
27
30
|
loadingRowCount: number;
|
|
28
31
|
emptyStateTitle: string;
|
|
32
|
+
childListMaxHeight: string;
|
|
33
|
+
isSticky: boolean;
|
|
34
|
+
zIndexBase: number;
|
|
29
35
|
testId: string;
|
|
30
36
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
37
|
sortableItemDragged: (event: {
|
|
@@ -51,6 +57,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
51
57
|
isLoading?: boolean;
|
|
52
58
|
loadingRowCount?: number;
|
|
53
59
|
emptyStateTitle?: string;
|
|
60
|
+
childListMaxHeight?: string;
|
|
61
|
+
isSticky?: boolean;
|
|
62
|
+
zIndexBase?: number;
|
|
54
63
|
testId?: string;
|
|
55
64
|
}>, {
|
|
56
65
|
items: () => any[];
|
|
@@ -65,6 +74,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
65
74
|
isLoading: boolean;
|
|
66
75
|
loadingRowCount: number;
|
|
67
76
|
emptyStateTitle: string;
|
|
77
|
+
childListMaxHeight: string;
|
|
78
|
+
isSticky: boolean;
|
|
79
|
+
zIndexBase: number;
|
|
68
80
|
testId: string;
|
|
69
81
|
}>>> & {
|
|
70
82
|
onClearSearch?: () => any;
|
|
@@ -85,13 +97,17 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
85
97
|
searchPlaceholder: string;
|
|
86
98
|
items: SortableListItem[];
|
|
87
99
|
selectedChildId: string | number;
|
|
100
|
+
childListMaxHeight: string;
|
|
88
101
|
searchHandler: (item: SortableListItem, searchQuery: string) => boolean;
|
|
89
102
|
openId: string | number;
|
|
90
103
|
selectedId: string | number;
|
|
91
104
|
showSearch: boolean;
|
|
92
105
|
loadingRowCount: number;
|
|
93
106
|
emptyStateTitle: string;
|
|
107
|
+
isSticky: boolean;
|
|
108
|
+
zIndexBase: number;
|
|
94
109
|
}>, {
|
|
110
|
+
header?(_: {}): any;
|
|
95
111
|
menu?(_: {
|
|
96
112
|
item: SortableListItem;
|
|
97
113
|
}): any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SortableList.vue2.js";
|
|
2
2
|
/* empty css */import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../SortableList.
|
|
4
|
-
const
|
|
3
|
+
// import "../../SortableList.vue_vue_type_style_index_0_scoped_8f267f88_lang.css"; //*');
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8f267f88"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import "../../SortableList.
|
|
2
|
-
import { VueDraggable as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useVModel as
|
|
8
|
-
import { matchString as
|
|
9
|
-
import { useTestIdAttrs as
|
|
10
|
-
import { SortableListTestIdModifiers as
|
|
1
|
+
import "../../SortableList.vue_vue_type_style_index_0_scoped_8f267f88_lang.css"; import { defineComponent as P, useCssVars as z, useSlots as G, computed as S, ref as U, openBlock as s, createElementBlock as r, mergeProps as V, unref as l, normalizeClass as K, renderSlot as g, createCommentVNode as h, createBlock as p, isRef as A, withCtx as I, Fragment as x, renderList as B, createSlots as E, createElementVNode as Q, createVNode as H, createTextVNode as j, toDisplayString as J } from "vue";
|
|
2
|
+
import { VueDraggable as W } from "vue-draggable-plus";
|
|
3
|
+
import N from "./SortableItem.vue.js";
|
|
4
|
+
import X from "../search/v4/SearchV4.vue.js";
|
|
5
|
+
import Y from "../typography/v4/Typography.vue.js";
|
|
6
|
+
import Z from "../skeleton/v4/SkeletonV4.vue.js";
|
|
7
|
+
import { useVModel as _ } from "@vueuse/core";
|
|
8
|
+
import { matchString as q } from "../../utils/search.js";
|
|
9
|
+
import { useTestIdAttrs as ee } from "../../utils/testIds.js";
|
|
10
|
+
import { SortableListTestIdModifiers as v } from "../../testids/index.js";
|
|
11
11
|
import { DRAG_CURSOR_CSS_CLASS as O } from "./consts.js";
|
|
12
|
-
const
|
|
12
|
+
const te = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "sortable-list-container"
|
|
15
|
-
},
|
|
15
|
+
}, le = { class: "loader-bars" }, de = {
|
|
16
16
|
key: 3,
|
|
17
17
|
class: "empty-state-title"
|
|
18
|
-
},
|
|
18
|
+
}, ye = /* @__PURE__ */ P({
|
|
19
19
|
__name: "SortableList",
|
|
20
20
|
props: {
|
|
21
21
|
items: { default: () => [] },
|
|
@@ -30,137 +30,150 @@ const _ = {
|
|
|
30
30
|
isLoading: { type: Boolean, default: !1 },
|
|
31
31
|
loadingRowCount: { default: 3 },
|
|
32
32
|
emptyStateTitle: { default: "No results" },
|
|
33
|
+
childListMaxHeight: { default: "530px" },
|
|
34
|
+
isSticky: { type: Boolean, default: !0 },
|
|
35
|
+
zIndexBase: { default: 100 },
|
|
33
36
|
testId: { default: "" }
|
|
34
37
|
},
|
|
35
38
|
emits: ["sortableItemDragged", "update:items", "update:openId", "update:selectedId", "update:selectedChildId", "update:search", "clearSearch"],
|
|
36
|
-
setup(d, { emit:
|
|
37
|
-
const
|
|
39
|
+
setup(d, { emit: n }) {
|
|
40
|
+
const i = d;
|
|
41
|
+
z((t) => ({
|
|
42
|
+
"2b5787e0": d.zIndexBase
|
|
43
|
+
}));
|
|
44
|
+
const y = G(), u = _(i, "search", n), k = S(() => !!u.value?.trim()), C = S(() => k.value ? i.items.filter((t) => {
|
|
38
45
|
const a = t.children || [], e = u.value;
|
|
39
|
-
return
|
|
40
|
-
a.some((
|
|
41
|
-
}) :
|
|
46
|
+
return i.searchHandler ? i.searchHandler(t, e) : q(t.displayText, e) || // match parent item
|
|
47
|
+
a.some((o) => q(o.displayText, e));
|
|
48
|
+
}) : i.items), f = S({
|
|
42
49
|
get() {
|
|
43
50
|
return C.value.filter((t) => !t.isLocked);
|
|
44
51
|
},
|
|
45
52
|
set(t) {
|
|
46
|
-
|
|
53
|
+
n("update:items", [...t, ...L.value]);
|
|
47
54
|
}
|
|
48
|
-
}),
|
|
55
|
+
}), L = S(
|
|
49
56
|
() => C.value.filter((t) => t.isLocked)
|
|
50
|
-
), b =
|
|
57
|
+
), b = U(!1), F = (t) => {
|
|
51
58
|
b.value = !0, setTimeout(() => t.target.classList.add(O), 50);
|
|
52
|
-
},
|
|
53
|
-
const { target: a, item: e, newIndex:
|
|
59
|
+
}, M = (t) => {
|
|
60
|
+
const { target: a, item: e, newIndex: o } = t;
|
|
54
61
|
b.value = !1, a.classList.remove(O);
|
|
55
62
|
const c = e.attributes["data-id"]?.value;
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
a ?
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
return (t, a) => (s(),
|
|
65
|
-
d.showSearch ? (s(),
|
|
63
|
+
n("sortableItemDragged", { id: c, newIndex: o });
|
|
64
|
+
}, D = (t) => (k.value || t.id === i.openId) && !b.value, R = (t, a) => {
|
|
65
|
+
a ? n("update:openId", t.id) : n("update:openId", null);
|
|
66
|
+
}, m = (t) => t.id === i.selectedId, $ = (t) => {
|
|
67
|
+
n("update:selectedId", t.id), n("update:selectedChildId", null);
|
|
68
|
+
}, w = (t, a) => {
|
|
69
|
+
n("update:selectedChildId", t.id), n("update:selectedId", a.id), n("update:openId", a.id);
|
|
70
|
+
}, T = ee(i.testId, v);
|
|
71
|
+
return (t, a) => (s(), r("div", V({ class: "sortable-list-and-header-container" }, l(T)[l(v).CONTAINER]), [
|
|
72
|
+
l(y).header || d.showSearch ? (s(), r("div", {
|
|
66
73
|
key: 0,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
class: K(["header-container", { sticky: d.isSticky }])
|
|
75
|
+
}, [
|
|
76
|
+
l(y).header ? g(t.$slots, "header", { key: 0 }, void 0, !0) : h("", !0),
|
|
77
|
+
d.showSearch ? (s(), p(l(X), {
|
|
78
|
+
key: 1,
|
|
79
|
+
modelValue: l(u),
|
|
80
|
+
"onUpdate:modelValue": a[0] || (a[0] = (e) => A(u) ? u.value = e : null),
|
|
81
|
+
placeholder: d.searchPlaceholder,
|
|
82
|
+
"test-id": d.testId,
|
|
83
|
+
onOnClear: a[1] || (a[1] = (e) => n("clearSearch"))
|
|
84
|
+
}, null, 8, ["modelValue", "placeholder", "test-id"])) : h("", !0)
|
|
85
|
+
], 2)) : h("", !0),
|
|
86
|
+
d.isLoading ? g(t.$slots, "loader", { key: 2 }, () => [
|
|
87
|
+
Q("div", le, [
|
|
88
|
+
(s(!0), r(x, null, B(d.loadingRowCount, (e) => (s(), r("div", { key: e }, [
|
|
89
|
+
H(l(Z), {
|
|
78
90
|
round: "",
|
|
79
91
|
class: "loader-bar"
|
|
80
92
|
})
|
|
81
93
|
]))), 128))
|
|
82
94
|
])
|
|
83
|
-
], !0) : (s(),
|
|
84
|
-
l(
|
|
95
|
+
], !0) : (s(), r("div", te, [
|
|
96
|
+
l(f).length ? (s(), p(l(W), V({
|
|
85
97
|
key: 0,
|
|
86
|
-
modelValue: l(
|
|
87
|
-
"onUpdate:modelValue": a[2] || (a[2] = (e) =>
|
|
98
|
+
modelValue: l(f),
|
|
99
|
+
"onUpdate:modelValue": a[2] || (a[2] = (e) => A(f) ? f.value = e : null),
|
|
88
100
|
class: "sortable-list",
|
|
89
101
|
filter: ".expand-icon",
|
|
90
102
|
animation: 150,
|
|
91
103
|
handle: ".draggable-handle",
|
|
92
|
-
disabled: l(
|
|
93
|
-
}, l(
|
|
104
|
+
disabled: l(k)
|
|
105
|
+
}, l(T)[l(v).DRAGGABLE_LIST], {
|
|
94
106
|
onStart: F,
|
|
95
|
-
onEnd:
|
|
107
|
+
onEnd: M
|
|
96
108
|
}), {
|
|
97
|
-
default:
|
|
98
|
-
(s(!0),
|
|
109
|
+
default: I(() => [
|
|
110
|
+
(s(!0), r(x, null, B(l(f), (e, o) => (s(), p(N, {
|
|
99
111
|
key: e.id,
|
|
100
112
|
"data-id": e.id,
|
|
101
113
|
item: e,
|
|
102
|
-
index:
|
|
103
|
-
"is-open":
|
|
104
|
-
"is-selected":
|
|
105
|
-
"selected-child-id":
|
|
114
|
+
index: o,
|
|
115
|
+
"is-open": D(e),
|
|
116
|
+
"is-selected": m(e),
|
|
117
|
+
"selected-child-id": m(e) ? d.selectedChildId : null,
|
|
106
118
|
"display-value": d.displayValue,
|
|
107
119
|
"search-query": l(u),
|
|
108
120
|
"search-handler": d.searchHandler,
|
|
109
|
-
onToggle: (c) =>
|
|
110
|
-
onSelect: (c) =>
|
|
111
|
-
onSelectChild: (c) =>
|
|
112
|
-
},
|
|
113
|
-
l(
|
|
121
|
+
onToggle: (c) => R(e, c),
|
|
122
|
+
onSelect: (c) => $(e),
|
|
123
|
+
onSelectChild: (c) => w(c, e)
|
|
124
|
+
}, E({ _: 2 }, [
|
|
125
|
+
l(y).menu ? {
|
|
114
126
|
name: "menu",
|
|
115
|
-
fn:
|
|
116
|
-
|
|
127
|
+
fn: I(() => [
|
|
128
|
+
g(t.$slots, "menu", { item: e }, void 0, !0)
|
|
117
129
|
]),
|
|
118
130
|
key: "0"
|
|
119
131
|
} : void 0
|
|
120
132
|
]), 1032, ["data-id", "item", "index", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "search-handler", "onToggle", "onSelect", "onSelectChild"]))), 128))
|
|
121
133
|
]),
|
|
122
134
|
_: 3
|
|
123
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
124
|
-
l(
|
|
135
|
+
}, 16, ["modelValue", "disabled"])) : h("", !0),
|
|
136
|
+
l(L).length ? (s(), r("div", V({
|
|
125
137
|
key: 1,
|
|
126
138
|
class: "locked-list"
|
|
127
|
-
}, l(
|
|
128
|
-
(s(!0),
|
|
139
|
+
}, l(T)[l(v).LOCKED_LIST]), [
|
|
140
|
+
(s(!0), r(x, null, B(l(L), (e) => (s(), p(N, {
|
|
129
141
|
key: e.id,
|
|
130
142
|
item: e,
|
|
131
|
-
"is-open":
|
|
132
|
-
"is-selected":
|
|
133
|
-
"selected-child-id":
|
|
143
|
+
"is-open": D(e),
|
|
144
|
+
"is-selected": m(e),
|
|
145
|
+
"selected-child-id": m(e) ? d.selectedChildId : null,
|
|
134
146
|
"display-value": d.displayValue,
|
|
135
147
|
"search-query": l(u),
|
|
136
148
|
"on-search": d.searchHandler,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
149
|
+
"child-list-max-height": d.childListMaxHeight,
|
|
150
|
+
onToggle: (o) => R(e, o),
|
|
151
|
+
onSelect: (o) => $(e),
|
|
152
|
+
onSelectChild: (o) => w(o, e)
|
|
153
|
+
}, E({ _: 2 }, [
|
|
154
|
+
l(y).menu ? {
|
|
142
155
|
name: "menu",
|
|
143
|
-
fn:
|
|
144
|
-
|
|
156
|
+
fn: I(() => [
|
|
157
|
+
g(t.$slots, "menu", { item: e }, void 0, !0)
|
|
145
158
|
]),
|
|
146
159
|
key: "0"
|
|
147
160
|
} : void 0
|
|
148
|
-
]), 1032, ["item", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "on-search", "onToggle", "onSelect", "onSelectChild"]))), 128))
|
|
149
|
-
], 16)) :
|
|
161
|
+
]), 1032, ["item", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "on-search", "child-list-max-height", "onToggle", "onSelect", "onSelectChild"]))), 128))
|
|
162
|
+
], 16)) : h("", !0)
|
|
150
163
|
])),
|
|
151
|
-
!l(C).length && !d.isLoading ? (s(),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
default:
|
|
155
|
-
|
|
164
|
+
!l(C).length && !d.isLoading ? (s(), r("div", de, [
|
|
165
|
+
g(t.$slots, "empty-state", {}, () => [
|
|
166
|
+
H(l(Y), { variant: "body2" }, {
|
|
167
|
+
default: I(() => [
|
|
168
|
+
j(J(d.emptyStateTitle), 1)
|
|
156
169
|
]),
|
|
157
170
|
_: 1
|
|
158
171
|
})
|
|
159
172
|
], !0)
|
|
160
|
-
])) :
|
|
173
|
+
])) : h("", !0)
|
|
161
174
|
], 16));
|
|
162
175
|
}
|
|
163
176
|
});
|
|
164
177
|
export {
|
|
165
|
-
|
|
178
|
+
ye as default
|
|
166
179
|
};
|