@ironsource/shared-ui 2.1.12-rc.5 → 2.1.12-rc.6
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_8d5521da_lang.css +1 -0
- package/components/dropdown/v4/ConditionalDropdown.vue.js +4 -4
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +64 -64
- package/package.json +1 -1
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_96c7507e_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.custom-list-area[data-v-8d5521da]{color:var(--text-secondary);width:100%;text-align:center;box-sizing:border-box;padding:63px 10px}.inline-search[data-v-8d5521da]{width:100%}.contain-accept[data-v-8d5521da]{padding:6px 8px;margin-bottom:4px;cursor:pointer}.contain-accept[data-v-8d5521da]:hover{background-color:var(--action-hover);border-radius:.5rem}.contain-accept--query[data-v-8d5521da]{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
|
|
2
|
+
/* empty css */import d from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_8d5521da_lang.css"; //*');
|
|
4
|
+
const p = /* @__PURE__ */ d(o, [["__scopeId", "data-v-8d5521da"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../../ConditionalDropdown.
|
|
1
|
+
import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_8d5521da_lang.css"; import { defineComponent as W, computed as O, ref as s, watch as K, onMounted as q, openBlock as D, createBlock as G, unref as c, withCtx as f, createVNode as g, mergeProps as H, createElementVNode as J, isRef as X, normalizeProps as Y, guardReactiveProps as Z, createElementBlock as _, createTextVNode as ee, toDisplayString as le, createCommentVNode as oe } from "vue";
|
|
2
2
|
import F from "./DropdownV4.vue.js";
|
|
3
3
|
import "./DefaultDropdownTrigger.vue.js";
|
|
4
4
|
import "./IconButtonDropdownTrigger.vue.js";
|
|
@@ -15,7 +15,7 @@ import { useDebounceFn as ue } from "@vueuse/core";
|
|
|
15
15
|
const re = { class: "conditional-container" }, se = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "custom-list-area"
|
|
18
|
-
},
|
|
18
|
+
}, Te = /* @__PURE__ */ W({
|
|
19
19
|
__name: "ConditionalDropdown",
|
|
20
20
|
props: {
|
|
21
21
|
selectedCondition: null,
|
|
@@ -55,114 +55,114 @@ const re = { class: "conditional-container" }, se = {
|
|
|
55
55
|
}), L = () => {
|
|
56
56
|
const { appliedSelections: l } = e;
|
|
57
57
|
return l ? Array.isArray(l) ? l : [l] : [];
|
|
58
|
-
},
|
|
59
|
-
const l = p.value ? 4 : 4.5,
|
|
58
|
+
}, T = s(null), p = s(!0), t = s([]), n = s(L()), A = s(!0), d = s(!1), C = s(!1), u = s(e.searchQuery), B = s(""), m = s(e.label), k = s([]), U = O(() => (!u.value || u.value?.length < e.minCharsToStart) && !t.value.length ? `Enter at least ${e.minCharsToStart} characters to begin` : "No results found"), I = O(() => {
|
|
59
|
+
const l = p.value ? 4 : 4.5, o = t.value.length > 4 ? t.value.length : l;
|
|
60
60
|
if (e.groupedOptions) {
|
|
61
|
-
let
|
|
62
|
-
return
|
|
63
|
-
y.options && (
|
|
64
|
-
}),
|
|
61
|
+
let a = 0;
|
|
62
|
+
return t.value.forEach((y) => {
|
|
63
|
+
y.options && (a = a + y.options.length);
|
|
64
|
+
}), a > 4 ? a : l;
|
|
65
65
|
}
|
|
66
|
-
return
|
|
67
|
-
}), M = (l,
|
|
68
|
-
if (e.infiniteLoading && i.value.multi && Array.isArray(n.value) && n.value.length && l &&
|
|
69
|
-
const
|
|
66
|
+
return o > l ? o : l;
|
|
67
|
+
}), M = (l, o) => {
|
|
68
|
+
if (e.infiniteLoading && i.value.multi && Array.isArray(n.value) && n.value.length && l && o.length) {
|
|
69
|
+
const a = [], y = n.value.filter(
|
|
70
70
|
(v) => v[e.optionNameKey].includes(l)
|
|
71
71
|
);
|
|
72
|
-
return
|
|
72
|
+
return o.forEach((v) => {
|
|
73
73
|
y.find(
|
|
74
74
|
(j) => j[e.comparingKey] === v[e.comparingKey]
|
|
75
|
-
) &&
|
|
75
|
+
) && a.push(v[e.comparingKey]);
|
|
76
76
|
}), y.filter(
|
|
77
|
-
(v) => !
|
|
77
|
+
(v) => !a.includes(v[e.comparingKey])
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
return [];
|
|
81
|
-
},
|
|
81
|
+
}, w = async (l) => {
|
|
82
82
|
try {
|
|
83
83
|
d.value = !0;
|
|
84
|
-
const
|
|
84
|
+
const o = await e.fetchFnCallback(l), a = M(
|
|
85
85
|
l,
|
|
86
|
-
|
|
86
|
+
o
|
|
87
87
|
);
|
|
88
|
-
|
|
89
|
-
} catch (
|
|
90
|
-
d.value = !1, console.error("Error fetching data:",
|
|
88
|
+
t.value = [...a, ...o], d.value = !1;
|
|
89
|
+
} catch (o) {
|
|
90
|
+
d.value = !1, console.error("Error fetching data:", o);
|
|
91
91
|
}
|
|
92
92
|
}, E = async () => {
|
|
93
93
|
if (e.infiniteLoading)
|
|
94
94
|
try {
|
|
95
95
|
C.value = !0;
|
|
96
96
|
const l = await e.loadMoreFn();
|
|
97
|
-
C.value = !1, Array.isArray(l) && (
|
|
97
|
+
C.value = !1, Array.isArray(l) && (t.value = [...t.value, ...l]);
|
|
98
98
|
} catch (l) {
|
|
99
99
|
C.value = !1, console.error("Error fetching data:", l);
|
|
100
100
|
}
|
|
101
|
-
},
|
|
102
|
-
|
|
101
|
+
}, x = ue(
|
|
102
|
+
w,
|
|
103
103
|
e.fetchDataDebounceTime
|
|
104
104
|
), b = (l) => {
|
|
105
|
-
l.length >= e.minCharsToStart ? (
|
|
106
|
-
},
|
|
107
|
-
u.value &&
|
|
105
|
+
l.length >= e.minCharsToStart ? (x(l), T.value?.scrollTo(0)) : e.infiniteLoading && i.value.multi ? t.value = k.value || [] : t.value = [];
|
|
106
|
+
}, P = () => {
|
|
107
|
+
u.value && t.value.length && !d.value && !i.value.multi ? t.value[0].conditionalOptions ? t.value[0] = {
|
|
108
108
|
[e.optionNameKey]: u.value,
|
|
109
109
|
conditionalOptions: !0,
|
|
110
110
|
conditionalName: i.value.label,
|
|
111
111
|
[e.comparingKey]: u.value
|
|
112
|
-
} :
|
|
112
|
+
} : t.value = [
|
|
113
113
|
{
|
|
114
114
|
[e.optionNameKey]: u.value,
|
|
115
115
|
conditionalOptions: !0,
|
|
116
116
|
conditionalName: i.value.label,
|
|
117
117
|
[e.comparingKey]: u.value
|
|
118
118
|
},
|
|
119
|
-
...
|
|
120
|
-
] :
|
|
119
|
+
...t.value
|
|
120
|
+
] : t.value.length && t.value[0].conditionalOptions && t.value.shift();
|
|
121
121
|
}, N = () => {
|
|
122
122
|
p.value && n.value.length === 0 ? m.value = e.label : m.value = `${e.label} ${i.value.label.toLowerCase()}`;
|
|
123
123
|
};
|
|
124
124
|
K(u, () => {
|
|
125
125
|
b(u.value);
|
|
126
|
-
}), K([i,
|
|
127
|
-
|
|
126
|
+
}), K([i, t], () => {
|
|
127
|
+
P();
|
|
128
128
|
}), K(
|
|
129
129
|
() => e.loadingOverride,
|
|
130
|
-
(l,
|
|
131
|
-
!l &&
|
|
130
|
+
(l, o) => {
|
|
131
|
+
!l && o && !e.infiniteLoading && w(e.searchQuery);
|
|
132
132
|
}
|
|
133
133
|
);
|
|
134
|
-
const
|
|
135
|
-
p.value && n.value.length === 0 ? (i.value = null, S.value = [], i.value = null) : (B.value = u.value, S.value = p.value ? [...n.value] : { ...n.value },
|
|
134
|
+
const Q = () => {
|
|
135
|
+
p.value && n.value.length === 0 ? (i.value = null, S.value = [], i.value = null) : (B.value = u.value, S.value = p.value ? [...n.value] : { ...n.value }, A.value = p.value), N();
|
|
136
136
|
};
|
|
137
|
-
K(i, (l,
|
|
138
|
-
i.value.multi ? (d.value = !0, !
|
|
137
|
+
K(i, (l, o) => {
|
|
138
|
+
i.value.multi ? (d.value = !0, !o.multi && l.multi && (Array.isArray(e.appliedSelections) ? n.value = e.appliedSelections : n.value = [e.appliedSelections]), setTimeout(() => {
|
|
139
139
|
d.value = !1, p.value = !0;
|
|
140
|
-
}, 100)) : (d.value = !0, setTimeout(() => {
|
|
141
|
-
d.value = !1, p.value = !1;
|
|
140
|
+
}, 100)) : (!o.multi && !l.multi && (d.value = !0), setTimeout(() => {
|
|
141
|
+
!o.multi && !l.multi && (d.value = !1), p.value = !1;
|
|
142
142
|
}, 100));
|
|
143
143
|
});
|
|
144
|
-
const
|
|
144
|
+
const R = (l) => {
|
|
145
145
|
k.value = l;
|
|
146
|
-
},
|
|
146
|
+
}, z = () => {
|
|
147
147
|
n.value = [], S.value = [], i.value = null, m.value = e.label, u.value = "", h("clear");
|
|
148
|
-
},
|
|
149
|
-
l && i.value.multi && e.infiniteLoading && n.value && (
|
|
148
|
+
}, V = (l) => {
|
|
149
|
+
l && i.value.multi && e.infiniteLoading && n.value && (t.value = n.value, u.value && b(u.value));
|
|
150
150
|
};
|
|
151
151
|
q(() => {
|
|
152
|
-
(e.searchQuery || !e.infiniteLoading || e.minCharsToStart === 0) && b(e.searchQuery), e.appliedSelections && Array.isArray(e.appliedSelections) && (
|
|
152
|
+
(e.searchQuery || !e.infiniteLoading || e.minCharsToStart === 0) && b(e.searchQuery), e.appliedSelections && Array.isArray(e.appliedSelections) && (t.value = e.appliedSelections, n.value = e.appliedSelections, k.value = e.appliedSelections), N();
|
|
153
153
|
});
|
|
154
154
|
const $ = () => {
|
|
155
155
|
h("closed");
|
|
156
156
|
};
|
|
157
|
-
return (l,
|
|
157
|
+
return (l, o) => (D(), G(c(F), {
|
|
158
158
|
ref_key: "dropdownRef",
|
|
159
|
-
ref:
|
|
159
|
+
ref: T,
|
|
160
160
|
selected: n.value,
|
|
161
|
-
"onUpdate:selected":
|
|
161
|
+
"onUpdate:selected": o[2] || (o[2] = (a) => n.value = a),
|
|
162
162
|
"predefined-trigger": "chip",
|
|
163
|
-
"display-value": (
|
|
163
|
+
"display-value": (a) => a?.[r.optionNameKey],
|
|
164
164
|
multi: p.value,
|
|
165
|
-
options:
|
|
165
|
+
options: t.value,
|
|
166
166
|
placeholder: m.value,
|
|
167
167
|
"search-placeholder": "Search",
|
|
168
168
|
"option-name-key": r.optionNameKey,
|
|
@@ -181,36 +181,36 @@ const re = { class: "conditional-container" }, se = {
|
|
|
181
181
|
"option-image-key": r.optionImageKey,
|
|
182
182
|
"option-icon-key": r.optionIconKey,
|
|
183
183
|
"option-icon-type": r.optionIconType,
|
|
184
|
-
"onUpdate:isOpen":
|
|
184
|
+
"onUpdate:isOpen": V,
|
|
185
185
|
onOnsearch: b,
|
|
186
|
-
onApply:
|
|
186
|
+
onApply: Q,
|
|
187
187
|
onLoadMore: E,
|
|
188
|
-
onUnsavedSelectionUpdate:
|
|
188
|
+
onUnsavedSelectionUpdate: R,
|
|
189
189
|
onClosed: $
|
|
190
190
|
}, {
|
|
191
|
-
"dropdown-trigger": f(({ defaultTriggerProps:
|
|
192
|
-
g(c(ae), H(
|
|
191
|
+
"dropdown-trigger": f(({ defaultTriggerProps: a }) => [
|
|
192
|
+
g(c(ae), H(a, {
|
|
193
193
|
label: m.value,
|
|
194
194
|
"selected-option": c(S),
|
|
195
|
-
multi:
|
|
195
|
+
multi: A.value,
|
|
196
196
|
"cancel-all-selected-display": "",
|
|
197
197
|
"display-value-in-quotes": !Array.isArray(n.value) && n.value.conditionalOptions,
|
|
198
|
-
onClear:
|
|
198
|
+
onClear: z
|
|
199
199
|
}), null, 16, ["label", "selected-option", "multi", "display-value-in-quotes"])
|
|
200
200
|
]),
|
|
201
201
|
"dropdown-conditions": f(() => [
|
|
202
202
|
J("div", re, [
|
|
203
203
|
g(c(F), {
|
|
204
204
|
selected: c(i),
|
|
205
|
-
"onUpdate:selected":
|
|
205
|
+
"onUpdate:selected": o[0] || (o[0] = (a) => X(i) ? i.value = a : null),
|
|
206
206
|
options: r.conditionalOptions,
|
|
207
207
|
"option-name-key": "label",
|
|
208
|
-
"display-value": (
|
|
208
|
+
"display-value": (a) => a?.label,
|
|
209
209
|
container: ".conditional-container",
|
|
210
210
|
size: "small"
|
|
211
211
|
}, {
|
|
212
|
-
"dropdown-trigger": f(({ buttonTriggerProps:
|
|
213
|
-
g(c(te), Y(Z(
|
|
212
|
+
"dropdown-trigger": f(({ buttonTriggerProps: a }) => [
|
|
213
|
+
g(c(te), Y(Z(a)), null, 16)
|
|
214
214
|
]),
|
|
215
215
|
_: 1
|
|
216
216
|
}, 8, ["selected", "options", "display-value"])
|
|
@@ -219,7 +219,7 @@ const re = { class: "conditional-container" }, se = {
|
|
|
219
219
|
"inline-search": f(() => [
|
|
220
220
|
g(c(ne), {
|
|
221
221
|
modelValue: u.value,
|
|
222
|
-
"onUpdate:modelValue":
|
|
222
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => u.value = a),
|
|
223
223
|
class: "inline-search",
|
|
224
224
|
placeholder: "Search",
|
|
225
225
|
variant: "transparent",
|
|
@@ -228,7 +228,7 @@ const re = { class: "conditional-container" }, se = {
|
|
|
228
228
|
}, null, 8, ["modelValue", "auto-focus"])
|
|
229
229
|
]),
|
|
230
230
|
"custom-list-area": f(() => [
|
|
231
|
-
!
|
|
231
|
+
!t.value.length && !d.value ? (D(), _("div", se, [
|
|
232
232
|
g(ie, { variant: "body1" }, {
|
|
233
233
|
default: f(() => [
|
|
234
234
|
ee(le(c(U)), 1)
|
|
@@ -242,5 +242,5 @@ const re = { class: "conditional-container" }, se = {
|
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
export {
|
|
245
|
-
|
|
245
|
+
Te as default
|
|
246
246
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.custom-list-area[data-v-96c7507e]{color:var(--text-secondary);width:100%;text-align:center;box-sizing:border-box;padding:20px 43px}.inline-search[data-v-96c7507e]{width:100%}.contain-accept[data-v-96c7507e]{padding:6px 8px;margin-bottom:4px;cursor:pointer}.contain-accept[data-v-96c7507e]:hover{background-color:var(--action-hover);border-radius:.5rem}.contain-accept--query[data-v-96c7507e]{margin-left:4px;display:inline-flex;color:var(--primary-main)}
|