@ironsource/shared-ui 2.1.12-rc.49 → 2.1.12-rc.50
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/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8cc86a27_lang.css +1 -0
- package/components/dropdown/v4/ConditionalDropdown.vue.js +3 -3
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +99 -97
- package/index.js +1 -1
- package/package.json +1 -1
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_bdd6ee48_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.custom-list-area[data-v-8cc86a27]{color:var(--text-secondary);width:100%;text-align:center;box-sizing:border-box;padding:63px 10px}.inline-search[data-v-8cc86a27]{width:100%}.contain-accept[data-v-8cc86a27]{padding:6px 8px;margin-bottom:4px;cursor:pointer}.contain-accept[data-v-8cc86a27]:hover{background-color:var(--action-hover);border-radius:.5rem}.contain-accept--query[data-v-8cc86a27]{margin-left:4px;display:inline-flex;color:var(--primary-main)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ConditionalDropdown.vue2.js";
|
|
2
|
-
/* empty css */import
|
|
3
|
-
// import "../../../ConditionalDropdown.
|
|
4
|
-
const p = /* @__PURE__ */
|
|
2
|
+
/* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_8cc86a27_lang.css"; //*');
|
|
4
|
+
const p = /* @__PURE__ */ _(o, [["__scopeId", "data-v-8cc86a27"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import "../../../ConditionalDropdown.
|
|
1
|
+
import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_8cc86a27_lang.css"; import { defineComponent as H, computed as b, ref as r, watch as g, onMounted as J, resolveComponent as X, openBlock as B, createBlock as Y, unref as p, createSlots as Z, withCtx as f, createVNode as y, mergeProps as _, createElementVNode as ee, isRef as te, normalizeProps as F, guardReactiveProps as I, createElementBlock as le, createTextVNode as oe, toDisplayString as ne, createCommentVNode as ae, renderSlot as ie } from "vue";
|
|
2
2
|
import U from "./DropdownV4.vue.js";
|
|
3
3
|
import "./DefaultDropdownTrigger.vue.js";
|
|
4
4
|
import "./IconButtonDropdownTrigger.vue.js";
|
|
5
5
|
import ue from "./ChipDropdownTrigger.vue.js";
|
|
6
6
|
import "./AppDropdownTrigger.vue.js";
|
|
7
7
|
import "./ButtonDropdownTrigger.vue.js";
|
|
8
|
-
import
|
|
8
|
+
import se from "./ButtonFilterDropdownTrigger.vue.js";
|
|
9
9
|
import "./TreeDropdown.vue.js";
|
|
10
10
|
import "./OptionV4.vue.js";
|
|
11
11
|
import "./ConditionalDropdown.vue.js";
|
|
12
|
-
import
|
|
12
|
+
import re from "../../search/v4/SearchV4.vue.js";
|
|
13
13
|
import de from "../../typography/v4/Typography.vue.js";
|
|
14
14
|
import { useDebounceFn as ce } from "@vueuse/core";
|
|
15
15
|
const pe = { class: "conditional-container" }, ve = {
|
|
@@ -42,44 +42,44 @@ const pe = { class: "conditional-container" }, ve = {
|
|
|
42
42
|
triggerShownValuesCount: { default: 1 }
|
|
43
43
|
},
|
|
44
44
|
emits: ["update:selectedCondition", "update:appliedSelections", "clear", "closed"],
|
|
45
|
-
setup(
|
|
46
|
-
const e =
|
|
45
|
+
setup(a, { emit: h }) {
|
|
46
|
+
const e = a, S = b({
|
|
47
47
|
get: () => e.appliedSelections,
|
|
48
|
-
set: (
|
|
49
|
-
h("update:appliedSelections",
|
|
48
|
+
set: (t) => {
|
|
49
|
+
h("update:appliedSelections", t);
|
|
50
50
|
}
|
|
51
|
-
}), T =
|
|
51
|
+
}), T = r(
|
|
52
52
|
e.selectedCondition || e.conditionalOptions[0]
|
|
53
|
-
),
|
|
53
|
+
), i = b({
|
|
54
54
|
get: () => T.value || e.conditionalOptions[0],
|
|
55
|
-
set: (
|
|
56
|
-
T.value =
|
|
55
|
+
set: (t) => {
|
|
56
|
+
T.value = t;
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
g(
|
|
60
60
|
() => e.selectedCondition,
|
|
61
|
-
(
|
|
62
|
-
|
|
61
|
+
(t) => {
|
|
62
|
+
t && t.value !== i.value?.value && (i.value = t, k());
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
const A = () => {
|
|
66
|
-
const { appliedSelections:
|
|
67
|
-
return
|
|
68
|
-
}, D =
|
|
69
|
-
const
|
|
66
|
+
const { appliedSelections: t } = e;
|
|
67
|
+
return t ? Array.isArray(t) ? t : [t] : [];
|
|
68
|
+
}, D = r(null), v = r(!0), o = r([]), u = r(A()), N = r(!0), c = r(!1), w = r(!1), s = r(e.searchQuery), M = r(""), C = r(e.label), K = r([]), E = b(() => (!s.value || s.value?.length < e.minCharsToStart) && !o.value.length ? `Enter at least ${e.minCharsToStart} characters to begin` : "No results found"), Q = b(() => {
|
|
69
|
+
const t = v.value ? 4 : 4.5, l = o.value.length > 4 ? o.value.length : t;
|
|
70
70
|
if (e.groupedOptions) {
|
|
71
71
|
let d = 0;
|
|
72
|
-
return
|
|
72
|
+
return o.value.forEach((n) => {
|
|
73
73
|
n.options && (d = d + n.options.length);
|
|
74
|
-
}), d > 4 ? d :
|
|
74
|
+
}), d > 4 ? d : t;
|
|
75
75
|
}
|
|
76
|
-
return
|
|
77
|
-
}), V = (
|
|
78
|
-
if (e.infiniteLoading &&
|
|
76
|
+
return l > t ? l : t;
|
|
77
|
+
}), V = (t, l) => {
|
|
78
|
+
if (e.infiniteLoading && i.value.multi && Array.isArray(u.value) && u.value.length && t && l.length) {
|
|
79
79
|
const d = [], n = u.value.filter(
|
|
80
|
-
(m) => m[e.optionNameKey].includes(
|
|
80
|
+
(m) => m[e.optionNameKey].includes(t)
|
|
81
81
|
);
|
|
82
|
-
return
|
|
82
|
+
return l.forEach((m) => {
|
|
83
83
|
n.find(
|
|
84
84
|
(G) => G[e.comparingKey] === m[e.comparingKey]
|
|
85
85
|
) && d.push(m[e.comparingKey]);
|
|
@@ -88,114 +88,115 @@ const pe = { class: "conditional-container" }, ve = {
|
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
return [];
|
|
91
|
-
}, L = async (
|
|
91
|
+
}, L = async (t) => {
|
|
92
92
|
try {
|
|
93
93
|
c.value = !0;
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
const l = await e.fetchFnCallback(t), d = V(
|
|
95
|
+
t,
|
|
96
|
+
l
|
|
97
97
|
);
|
|
98
|
-
|
|
99
|
-
} catch (
|
|
100
|
-
c.value = !1, console.error("Error fetching data:",
|
|
98
|
+
o.value = [...d, ...l], c.value = !1;
|
|
99
|
+
} catch (l) {
|
|
100
|
+
c.value = !1, console.error("Error fetching data:", l);
|
|
101
101
|
}
|
|
102
102
|
}, $ = async () => {
|
|
103
103
|
if (e.infiniteLoading)
|
|
104
104
|
try {
|
|
105
105
|
w.value = !0;
|
|
106
|
-
const
|
|
107
|
-
w.value = !1, Array.isArray(
|
|
108
|
-
} catch (
|
|
109
|
-
w.value = !1, console.error("Error fetching data:",
|
|
106
|
+
const t = await e.loadMoreFn();
|
|
107
|
+
w.value = !1, Array.isArray(t) && (o.value = [...o.value, ...t]);
|
|
108
|
+
} catch (t) {
|
|
109
|
+
w.value = !1, console.error("Error fetching data:", t);
|
|
110
110
|
}
|
|
111
111
|
}, x = ce(
|
|
112
112
|
L,
|
|
113
113
|
e.fetchDataDebounceTime
|
|
114
|
-
), O = (
|
|
115
|
-
|
|
114
|
+
), O = (t) => {
|
|
115
|
+
t.length >= e.minCharsToStart ? (x(t), D.value?.scrollTo(0)) : e.infiniteLoading && i.value.multi ? o.value = K.value || [] : o.value = [];
|
|
116
116
|
}, R = () => {
|
|
117
|
-
|
|
118
|
-
[e.optionNameKey]:
|
|
117
|
+
s.value && o.value.length && !c.value && !i.value.multi ? o.value[0].conditionalOptions ? o.value[0] = {
|
|
118
|
+
[e.optionNameKey]: s.value,
|
|
119
119
|
conditionalOptions: !0,
|
|
120
|
-
conditionalName:
|
|
121
|
-
[e.comparingKey]:
|
|
122
|
-
} :
|
|
120
|
+
conditionalName: i.value.label,
|
|
121
|
+
[e.comparingKey]: s.value
|
|
122
|
+
} : o.value = [
|
|
123
123
|
{
|
|
124
|
-
[e.optionNameKey]:
|
|
124
|
+
[e.optionNameKey]: s.value,
|
|
125
125
|
conditionalOptions: !0,
|
|
126
|
-
conditionalName:
|
|
127
|
-
[e.comparingKey]:
|
|
126
|
+
conditionalName: i.value.label,
|
|
127
|
+
[e.comparingKey]: s.value
|
|
128
128
|
},
|
|
129
|
-
...
|
|
130
|
-
] :
|
|
129
|
+
...o.value
|
|
130
|
+
] : o.value.length && o.value[0].conditionalOptions && o.value.shift();
|
|
131
131
|
}, k = () => {
|
|
132
|
-
v.value && u.value.length === 0 ? C.value = e.label : C.value = `${e.label} ${
|
|
132
|
+
v.value && u.value.length === 0 ? C.value = e.label : C.value = `${e.label} ${i.value.label.toLowerCase()}`;
|
|
133
133
|
};
|
|
134
|
-
g(
|
|
135
|
-
O(
|
|
136
|
-
}), g([
|
|
134
|
+
g(s, () => {
|
|
135
|
+
O(s.value);
|
|
136
|
+
}), g([i, o], () => {
|
|
137
137
|
R();
|
|
138
138
|
}), g(
|
|
139
139
|
() => e.loadingOverride,
|
|
140
|
-
(
|
|
141
|
-
!
|
|
140
|
+
(t, l) => {
|
|
141
|
+
!t && l && !e.infiniteLoading && L(e.searchQuery);
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
144
|
const z = () => {
|
|
145
|
-
v.value && u.value.length === 0 ? (S.value = [],
|
|
145
|
+
v.value && u.value.length === 0 ? (S.value = [], i.value = null) : (M.value = s.value, S.value = v.value ? [...u.value] : { ...u.value }, N.value = v.value), h("update:selectedCondition", i.value), k();
|
|
146
146
|
};
|
|
147
|
-
g(
|
|
148
|
-
|
|
147
|
+
g(i, (t, l) => {
|
|
148
|
+
i.value.multi ? (c.value = !0, !l.multi && t.multi && (Array.isArray(e.appliedSelections) ? u.value = e.appliedSelections : u.value = [e.appliedSelections]), setTimeout(() => {
|
|
149
149
|
c.value = !1, v.value = !0;
|
|
150
|
-
}, 100)) : (!
|
|
151
|
-
!
|
|
150
|
+
}, 100)) : (!l.multi && !t.multi && (c.value = !0), setTimeout(() => {
|
|
151
|
+
!l.multi && !t.multi && (c.value = !1), v.value = !1;
|
|
152
152
|
}, 100));
|
|
153
153
|
}), g(S, () => {
|
|
154
154
|
u.value = A();
|
|
155
155
|
});
|
|
156
|
-
const P = (
|
|
157
|
-
K.value =
|
|
156
|
+
const P = (t) => {
|
|
157
|
+
K.value = t;
|
|
158
158
|
}, j = () => {
|
|
159
|
-
u.value = [], S.value = [],
|
|
160
|
-
}, W = (
|
|
161
|
-
|
|
159
|
+
u.value = [], S.value = [], i.value = null, h("update:selectedCondition", null), C.value = e.label, s.value = "", h("clear");
|
|
160
|
+
}, W = (t) => {
|
|
161
|
+
i.value === null && (i.value = e.conditionalOptions[0]), t && i.value.multi && e.infiniteLoading && u.value && (o.value = u.value, s.value && O(s.value));
|
|
162
162
|
};
|
|
163
163
|
J(() => {
|
|
164
|
-
(e.searchQuery || !e.infiniteLoading || e.minCharsToStart === 0) && O(e.searchQuery), e.appliedSelections && Array.isArray(e.appliedSelections) && (
|
|
164
|
+
(e.searchQuery || !e.infiniteLoading || e.minCharsToStart === 0) && O(e.searchQuery), e.appliedSelections && Array.isArray(e.appliedSelections) && (o.value = e.appliedSelections, u.value = e.appliedSelections, K.value = e.appliedSelections), k();
|
|
165
165
|
});
|
|
166
166
|
const q = () => {
|
|
167
167
|
h("closed");
|
|
168
168
|
};
|
|
169
|
-
return (
|
|
169
|
+
return (t, l) => {
|
|
170
170
|
const d = X("ButtonDropdownTrigger");
|
|
171
171
|
return B(), Y(p(U), {
|
|
172
172
|
ref_key: "dropdownRef",
|
|
173
173
|
ref: D,
|
|
174
174
|
selected: u.value,
|
|
175
|
-
"onUpdate:selected":
|
|
175
|
+
"onUpdate:selected": l[2] || (l[2] = (n) => u.value = n),
|
|
176
176
|
"predefined-trigger": "chip",
|
|
177
|
-
"display-value": (n) => n?.[
|
|
177
|
+
"display-value": (n) => n?.[a.optionNameKey],
|
|
178
178
|
multi: v.value,
|
|
179
|
-
options:
|
|
179
|
+
options: o.value,
|
|
180
180
|
placeholder: C.value,
|
|
181
181
|
"search-placeholder": "Search",
|
|
182
|
-
"option-name-key":
|
|
182
|
+
"option-name-key": a.optionNameKey,
|
|
183
183
|
"with-conditions": "",
|
|
184
184
|
"inline-search": "",
|
|
185
185
|
"custom-number-of-displayed-options": p(Q),
|
|
186
186
|
"options-list-width": "330px",
|
|
187
|
-
loading: c.value ||
|
|
187
|
+
loading: c.value || a.loadingOverride,
|
|
188
188
|
"load-more-loading": w.value,
|
|
189
|
-
"comparing-key":
|
|
190
|
-
"is-open":
|
|
191
|
-
"infinite-loading":
|
|
192
|
-
"show-select-all": !
|
|
193
|
-
"grouped-options":
|
|
194
|
-
"option-flag-key":
|
|
195
|
-
"option-image-key":
|
|
196
|
-
"option-icon-key":
|
|
197
|
-
"option-icon-type":
|
|
198
|
-
"trigger-shown-values-count":
|
|
189
|
+
"comparing-key": a.comparingKey,
|
|
190
|
+
"is-open": a.isOpen,
|
|
191
|
+
"infinite-loading": a.infiniteLoading,
|
|
192
|
+
"show-select-all": !a.infiniteLoading && !s.value,
|
|
193
|
+
"grouped-options": a.groupedOptions,
|
|
194
|
+
"option-flag-key": a.optionFlagKey,
|
|
195
|
+
"option-image-key": a.optionImageKey,
|
|
196
|
+
"option-icon-key": a.optionIconKey,
|
|
197
|
+
"option-icon-type": a.optionIconType,
|
|
198
|
+
"trigger-shown-values-count": a.triggerShownValuesCount,
|
|
199
|
+
"test-id": a.testId,
|
|
199
200
|
"onUpdate:isOpen": W,
|
|
200
201
|
onOnsearch: O,
|
|
201
202
|
onApply: z,
|
|
@@ -209,47 +210,48 @@ const pe = { class: "conditional-container" }, ve = {
|
|
|
209
210
|
"selected-option": p(S),
|
|
210
211
|
multi: N.value,
|
|
211
212
|
"cancel-all-selected-display": "",
|
|
212
|
-
"test-id":
|
|
213
|
+
"test-id": a.testId,
|
|
213
214
|
"display-value-in-quotes": !Array.isArray(u.value) && u.value.conditionalOptions,
|
|
214
|
-
"shown-values-count":
|
|
215
|
+
"shown-values-count": a.triggerShownValuesCount,
|
|
215
216
|
onClear: j
|
|
216
217
|
}), null, 16, ["label", "selected-option", "multi", "test-id", "display-value-in-quotes", "shown-values-count"])
|
|
217
218
|
]),
|
|
218
219
|
"dropdown-conditions": f(() => [
|
|
219
220
|
ee("div", pe, [
|
|
220
221
|
y(p(U), {
|
|
221
|
-
selected: p(
|
|
222
|
-
"onUpdate:selected":
|
|
223
|
-
options:
|
|
222
|
+
selected: p(i),
|
|
223
|
+
"onUpdate:selected": l[0] || (l[0] = (n) => te(i) ? i.value = n : null),
|
|
224
|
+
options: a.conditionalOptions,
|
|
224
225
|
"option-name-key": "label",
|
|
225
226
|
"display-value": (n) => n?.label,
|
|
226
227
|
container: ".conditional-container",
|
|
227
|
-
size: "small"
|
|
228
|
+
size: "small",
|
|
229
|
+
"test-id": `${a.testId}-conditions`
|
|
228
230
|
}, {
|
|
229
231
|
"dropdown-trigger": f(({ buttonTriggerProps: n }) => [
|
|
230
232
|
y(d, F(I(n)), null, 16),
|
|
231
|
-
y(p(
|
|
233
|
+
y(p(se), F(I(n)), null, 16)
|
|
232
234
|
]),
|
|
233
235
|
_: 1
|
|
234
|
-
}, 8, ["selected", "options", "display-value"])
|
|
236
|
+
}, 8, ["selected", "options", "display-value", "test-id"])
|
|
235
237
|
])
|
|
236
238
|
]),
|
|
237
239
|
"inline-search": f(() => [
|
|
238
|
-
y(p(
|
|
239
|
-
modelValue:
|
|
240
|
-
"onUpdate:modelValue":
|
|
240
|
+
y(p(re), {
|
|
241
|
+
modelValue: s.value,
|
|
242
|
+
"onUpdate:modelValue": l[1] || (l[1] = (n) => s.value = n),
|
|
241
243
|
class: "inline-search",
|
|
242
244
|
placeholder: "Search",
|
|
243
245
|
variant: "transparent",
|
|
244
246
|
size: "md",
|
|
245
|
-
"auto-focus":
|
|
247
|
+
"auto-focus": a.autoFocusSearch
|
|
246
248
|
}, null, 8, ["modelValue", "auto-focus"])
|
|
247
249
|
]),
|
|
248
250
|
"custom-list-area": f(() => [
|
|
249
|
-
!
|
|
251
|
+
!o.value.length && !c.value ? (B(), le("div", ve, [
|
|
250
252
|
y(de, { variant: "body1" }, {
|
|
251
253
|
default: f(() => [
|
|
252
|
-
|
|
254
|
+
oe(ne(p(E)), 1)
|
|
253
255
|
]),
|
|
254
256
|
_: 1
|
|
255
257
|
})
|
|
@@ -257,14 +259,14 @@ const pe = { class: "conditional-container" }, ve = {
|
|
|
257
259
|
]),
|
|
258
260
|
_: 2
|
|
259
261
|
}, [
|
|
260
|
-
|
|
262
|
+
t.$slots["option-end"] ? {
|
|
261
263
|
name: "option-end",
|
|
262
264
|
fn: f(({ option: n }) => [
|
|
263
|
-
ie(
|
|
265
|
+
ie(t.$slots, "option-end", { option: n }, void 0, !0)
|
|
264
266
|
]),
|
|
265
267
|
key: "0"
|
|
266
268
|
} : void 0
|
|
267
|
-
]), 1032, ["selected", "display-value", "multi", "options", "placeholder", "option-name-key", "custom-number-of-displayed-options", "loading", "load-more-loading", "comparing-key", "is-open", "infinite-loading", "show-select-all", "grouped-options", "option-flag-key", "option-image-key", "option-icon-key", "option-icon-type", "trigger-shown-values-count"]);
|
|
269
|
+
]), 1032, ["selected", "display-value", "multi", "options", "placeholder", "option-name-key", "custom-number-of-displayed-options", "loading", "load-more-loading", "comparing-key", "is-open", "infinite-loading", "show-select-all", "grouped-options", "option-flag-key", "option-image-key", "option-icon-key", "option-icon-type", "trigger-shown-values-count", "test-id"]);
|
|
268
270
|
};
|
|
269
271
|
}
|
|
270
272
|
});
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './AppIcon.vue_vue_type_style_index_0_scoped_56ba337c_lang.css';
|
|
2
2
|
import { AppTriggerTypes as eo } from "./components/appTrigger/index.js";
|
|
3
3
|
import { AutocompleteDropdownTypes as mo } from "./components/autocompleteDropdown/index.js";
|
|
4
4
|
import { MenuItemTypes as ao } from "./components/menuItem/index.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.custom-list-area[data-v-bdd6ee48]{color:var(--text-secondary);width:100%;text-align:center;box-sizing:border-box;padding:63px 10px}.inline-search[data-v-bdd6ee48]{width:100%}.contain-accept[data-v-bdd6ee48]{padding:6px 8px;margin-bottom:4px;cursor:pointer}.contain-accept[data-v-bdd6ee48]:hover{background-color:var(--action-hover);border-radius:.5rem}.contain-accept--query[data-v-bdd6ee48]{margin-left:4px;display:inline-flex;color:var(--primary-main)}
|