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