@ironsource/shared-ui 2.1.11-test.99 → 2.1.11
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/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/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/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,7 +1,7 @@
|
|
|
1
|
-
import "../../../DateRangeV4.
|
|
2
|
-
import
|
|
3
|
-
import { typeToName as
|
|
4
|
-
import
|
|
1
|
+
import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css"; import { defineComponent as J, watch as Q, openBlock as n, createElementBlock as s, unref as e, normalizeClass as r, createElementVNode as d, renderSlot as x, createVNode as i, withDirectives as v, Fragment as k, renderList as C, withCtx as l, createTextVNode as m, toDisplayString as g, createCommentVNode as E, vShow as $, normalizeStyle as X, setBlockTracking as R } from "vue";
|
|
2
|
+
import Z from "./CalendarMonthV4.vue.js";
|
|
3
|
+
import { typeToName as _, messagePerType as ee } from "../common/consts.common.js";
|
|
4
|
+
import A from "../../button/v4/ButtonV4.vue.js";
|
|
5
5
|
import "../../button/v4/IconButtonV4.vue.js";
|
|
6
6
|
import "../../button/v4/ButtonGroup.vue.js";
|
|
7
7
|
import "../../button/v4/ToggleButtonGroupAB.vue.js";
|
|
@@ -11,17 +11,17 @@ import "../../dropdown/v4/IconButtonDropdownTrigger.vue.js";
|
|
|
11
11
|
import "../../dropdown/v4/ChipDropdownTrigger.vue.js";
|
|
12
12
|
import "../../dropdown/v4/AppDropdownTrigger.vue.js";
|
|
13
13
|
import "../../dropdown/v4/ButtonDropdownTrigger.vue.js";
|
|
14
|
-
import
|
|
14
|
+
import te from "../../dropdown/v4/ButtonFilterDropdownTrigger.vue.js";
|
|
15
15
|
import "../../dropdown/v4/TreeDropdown.vue.js";
|
|
16
16
|
import "../../dropdown/v4/OptionV4.vue.js";
|
|
17
17
|
import "../../dropdown/v4/ConditionalDropdown.vue.js";
|
|
18
|
-
import { DateRangeTestIdModifiers as o, DatePickerTestIdModifiers as
|
|
19
|
-
import { dateRangeCommon as
|
|
18
|
+
import { DateRangeTestIdModifiers as o, DatePickerTestIdModifiers as ae } from "../../../testids/index.js";
|
|
19
|
+
import { dateRangeCommon as de } from "../common/DateRange.common.js";
|
|
20
20
|
import p from "../../typography/v4/Typography.vue.js";
|
|
21
|
-
const
|
|
21
|
+
const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid"], oe = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "type-picker"
|
|
24
|
-
},
|
|
24
|
+
}, le = ["onClick"], re = ["data-testid"], ce = ["id"], ue = ["id"], me = ["onClick"], pe = { class: "dropdown-rightTriangle" }, ye = ["data-testid"], ge = { class: "date-picker-calendar left-box" }, fe = { class: "buttons-cover" }, he = { class: "range" }, ve = { class: "text-container" }, Ve = /* @__PURE__ */ J({
|
|
25
25
|
__name: "DateRangeV4",
|
|
26
26
|
props: {
|
|
27
27
|
range: null,
|
|
@@ -48,86 +48,91 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
48
48
|
"opened",
|
|
49
49
|
"dismissed"
|
|
50
50
|
],
|
|
51
|
-
setup(t, { emit:
|
|
52
|
-
const
|
|
53
|
-
datePicker:
|
|
54
|
-
datePickerId:
|
|
55
|
-
getMaxAllowedDate:
|
|
56
|
-
selectedPreset:
|
|
57
|
-
displayError:
|
|
51
|
+
setup(t, { emit: B }) {
|
|
52
|
+
const I = t, {
|
|
53
|
+
datePicker: M,
|
|
54
|
+
datePickerId: S,
|
|
55
|
+
getMaxAllowedDate: q,
|
|
56
|
+
selectedPreset: w,
|
|
57
|
+
displayError: O,
|
|
58
58
|
rangeType: f,
|
|
59
|
-
selectedRange:
|
|
60
|
-
placement:
|
|
61
|
-
currentDate:
|
|
62
|
-
error:
|
|
63
|
-
presets:
|
|
59
|
+
selectedRange: L,
|
|
60
|
+
placement: V,
|
|
61
|
+
currentDate: T,
|
|
62
|
+
error: z,
|
|
63
|
+
presets: U,
|
|
64
64
|
isOpen: h,
|
|
65
|
-
popup:
|
|
65
|
+
popup: F,
|
|
66
66
|
currentMonths: y,
|
|
67
|
-
displayedMonthsKeys:
|
|
68
|
-
changeType:
|
|
67
|
+
displayedMonthsKeys: b,
|
|
68
|
+
changeType: P,
|
|
69
69
|
presetChanged: G,
|
|
70
70
|
apply: K,
|
|
71
71
|
getNavigation: W,
|
|
72
72
|
navigationCallback: Y,
|
|
73
73
|
selectionChanged: j,
|
|
74
|
-
toggle:
|
|
74
|
+
toggle: D,
|
|
75
75
|
isCompact: H
|
|
76
|
-
} =
|
|
77
|
-
return (
|
|
78
|
-
|
|
76
|
+
} = de(I, B);
|
|
77
|
+
return Q(
|
|
78
|
+
() => I.datePresetList,
|
|
79
|
+
() => {
|
|
80
|
+
P("date", !1);
|
|
81
|
+
}
|
|
82
|
+
), (N, c) => (n(), s("div", {
|
|
83
|
+
id: e(S),
|
|
79
84
|
ref_key: "datePicker",
|
|
80
|
-
ref:
|
|
85
|
+
ref: M,
|
|
81
86
|
class: r(["relative-wrap", { "date-range-disabled": t.disabled }]),
|
|
82
87
|
"data-testid": `${t.testId}-${e(o).WRAPPER}`
|
|
83
88
|
}, [
|
|
84
89
|
d("div", {
|
|
85
90
|
class: "date-range-field",
|
|
86
91
|
"data-testid": `${t.testId}-${e(o).TRIGGER}`,
|
|
87
|
-
onClick:
|
|
92
|
+
onClick: c[0] || (c[0] = (a) => e(D)())
|
|
88
93
|
}, [
|
|
89
|
-
N
|
|
90
|
-
currentDate: e(
|
|
94
|
+
x(N.$slots, "field", {
|
|
95
|
+
currentDate: e(T),
|
|
91
96
|
isOpen: e(h)
|
|
92
97
|
}, () => [
|
|
93
|
-
|
|
94
|
-
label: e(
|
|
98
|
+
i(e(te), {
|
|
99
|
+
label: e(T),
|
|
95
100
|
"start-icon-name": "calendar-blank",
|
|
96
101
|
variant: "outlined",
|
|
97
|
-
"test-id": `${t.testId}-${e(
|
|
102
|
+
"test-id": `${t.testId}-${e(ae).INPUT}`,
|
|
98
103
|
open: e(h)
|
|
99
104
|
}, null, 8, ["label", "test-id", "open"])
|
|
100
105
|
], !0)
|
|
101
|
-
], 8,
|
|
106
|
+
], 8, se),
|
|
102
107
|
v(d("div", {
|
|
103
108
|
id: "datepickerPopup" + t.uniqueId,
|
|
104
109
|
ref_key: "popup",
|
|
105
|
-
ref:
|
|
110
|
+
ref: F,
|
|
106
111
|
class: r(["pop-up", [
|
|
107
|
-
e(
|
|
112
|
+
e(V),
|
|
108
113
|
t.openOnTop ? "open-on-top" : "",
|
|
109
114
|
t.showPresets ? "" : "hide-presets"
|
|
110
115
|
]]),
|
|
111
116
|
"data-testid": `${t.testId}-${e(o).CONTAINER}`
|
|
112
117
|
}, [
|
|
113
|
-
t.types.length > 1 ? (n(),
|
|
114
|
-
(n(!0),
|
|
118
|
+
t.types.length > 1 ? (n(), s("div", oe, [
|
|
119
|
+
(n(!0), s(k, null, C(t.types, (a) => (n(), s("span", {
|
|
115
120
|
key: a,
|
|
116
121
|
class: r(["range-type", { "selected-range-type": e(f) === a }]),
|
|
117
|
-
onClick: (
|
|
122
|
+
onClick: (u) => e(P)(a, !0)
|
|
118
123
|
}, [
|
|
119
|
-
|
|
124
|
+
i(e(p), { variant: "h1" }, {
|
|
120
125
|
default: l(() => [
|
|
121
|
-
m(g(e(
|
|
126
|
+
m(g(e(_)[a]), 1)
|
|
122
127
|
]),
|
|
123
128
|
_: 2
|
|
124
129
|
}, 1024)
|
|
125
|
-
], 10,
|
|
126
|
-
])) :
|
|
130
|
+
], 10, le))), 128))
|
|
131
|
+
])) : E("", !0),
|
|
127
132
|
d("div", {
|
|
128
133
|
class: r(["flex", { "pop-up-content": t.types.length > 1 }])
|
|
129
134
|
}, [
|
|
130
|
-
t.showPresets ? (n(),
|
|
135
|
+
t.showPresets ? (n(), s("div", {
|
|
131
136
|
key: 0,
|
|
132
137
|
class: "date-picker-menu",
|
|
133
138
|
"data-testid": `${t.testId}-${e(o).MENU}`
|
|
@@ -139,17 +144,17 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
139
144
|
d("ul", {
|
|
140
145
|
id: "customDropDownList" + t.uniqueId
|
|
141
146
|
}, [
|
|
142
|
-
(n(!0),
|
|
147
|
+
(n(!0), s(k, null, C(e(U), (a) => (n(), s("li", {
|
|
143
148
|
key: a.id,
|
|
144
149
|
class: r({
|
|
145
|
-
"selected-preset-container": e(
|
|
150
|
+
"selected-preset-container": e(w) === a.id
|
|
146
151
|
})
|
|
147
152
|
}, [
|
|
148
153
|
d("div", {
|
|
149
|
-
class: r([{ "selected-preset": e(
|
|
150
|
-
onClick: (
|
|
154
|
+
class: r([{ "selected-preset": e(w) === a.id }, "preset-element"]),
|
|
155
|
+
onClick: (u) => e(G)(a)
|
|
151
156
|
}, [
|
|
152
|
-
|
|
157
|
+
i(e(p), {
|
|
153
158
|
variant: "body2",
|
|
154
159
|
"data-testid": `${t.testId}-${e(o).MENU}-${a.id}`
|
|
155
160
|
}, {
|
|
@@ -158,60 +163,60 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
158
163
|
]),
|
|
159
164
|
_: 2
|
|
160
165
|
}, 1032, ["data-testid"])
|
|
161
|
-
], 10,
|
|
162
|
-
v(d("div",
|
|
166
|
+
], 10, me),
|
|
167
|
+
v(d("div", pe, null, 512), [
|
|
163
168
|
[$, a.id === "custom"]
|
|
164
169
|
])
|
|
165
170
|
], 2))), 128))
|
|
166
171
|
], 8, ue)
|
|
167
|
-
], 8,
|
|
172
|
+
], 8, ce),
|
|
168
173
|
d("div", {
|
|
169
174
|
class: "type-message",
|
|
170
175
|
"data-testid": `${t.testId}-${e(o).MESSAGE}`
|
|
171
|
-
}, g(e(
|
|
172
|
-
], 8,
|
|
176
|
+
}, g(e(ee)[e(f)]), 9, ye)
|
|
177
|
+
], 8, re)) : E("", !0),
|
|
173
178
|
d("div", {
|
|
174
179
|
class: "calendar-wrap",
|
|
175
|
-
style:
|
|
180
|
+
style: X({ height: e(H) ? "336px" : "372px" })
|
|
176
181
|
}, [
|
|
177
|
-
d("div",
|
|
178
|
-
(n(!0),
|
|
179
|
-
|
|
182
|
+
d("div", ge, [
|
|
183
|
+
(n(!0), s(k, null, C(e(b), (a, u) => (n(), s("div", { key: a }, [
|
|
184
|
+
i(Z, {
|
|
180
185
|
id: t.uniqueId,
|
|
181
186
|
navigation: e(W)(
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
u === 0,
|
|
188
|
+
u === e(b).length - 1
|
|
184
189
|
),
|
|
185
190
|
year: e(y)[a].parsedMonth.year,
|
|
186
191
|
days: e(y)[a].parsedMonth.days,
|
|
187
192
|
weeks: e(y)[a].parsedMonth.weeks,
|
|
188
193
|
month: e(y)[a].parsedMonth.month,
|
|
189
|
-
range: e(
|
|
194
|
+
range: e(L),
|
|
190
195
|
type: e(f),
|
|
191
196
|
"allowed-days": t.allowedDays,
|
|
192
|
-
"max-allowed-date": e(
|
|
193
|
-
"test-id": `${t.testId}-${
|
|
197
|
+
"max-allowed-date": e(q),
|
|
198
|
+
"test-id": `${t.testId}-${u}`,
|
|
194
199
|
onSelectionChanged: e(j),
|
|
195
200
|
onNavigation: e(Y)
|
|
196
201
|
}, null, 8, ["id", "navigation", "year", "days", "weeks", "month", "range", "type", "allowed-days", "max-allowed-date", "test-id", "onSelectionChanged", "onNavigation"])
|
|
197
202
|
]))), 128)),
|
|
198
|
-
d("div",
|
|
199
|
-
d("div", fe, [
|
|
200
|
-
N(D.$slots, "footer", {}, void 0, !0)
|
|
201
|
-
]),
|
|
203
|
+
d("div", fe, [
|
|
202
204
|
d("div", he, [
|
|
203
|
-
|
|
205
|
+
x(N.$slots, "footer", {}, void 0, !0)
|
|
206
|
+
]),
|
|
207
|
+
d("div", ve, [
|
|
208
|
+
i(e(p), { variant: "body2" }, {
|
|
204
209
|
default: l(() => [
|
|
205
210
|
m("All dates are in UTC")
|
|
206
211
|
]),
|
|
207
212
|
_: 1
|
|
208
213
|
})
|
|
209
214
|
]),
|
|
210
|
-
v(d("div", { class: "error" }, g(e(
|
|
211
|
-
[$, e(
|
|
215
|
+
v(d("div", { class: "error" }, g(e(z)), 513), [
|
|
216
|
+
[$, e(O)]
|
|
212
217
|
]),
|
|
213
|
-
|
|
214
|
-
|
|
218
|
+
c[1] || (R(-1), c[1] = d("div", { class: "buttons" }, [
|
|
219
|
+
i(e(A), {
|
|
215
220
|
id: "button-ok" + t.uniqueId,
|
|
216
221
|
size: "small",
|
|
217
222
|
class: "button",
|
|
@@ -220,7 +225,7 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
220
225
|
onClick: (a) => e(K)()
|
|
221
226
|
}, {
|
|
222
227
|
default: l(() => [
|
|
223
|
-
|
|
228
|
+
i(e(p), { variant: "button" }, {
|
|
224
229
|
default: l(() => [
|
|
225
230
|
m("Apply")
|
|
226
231
|
]),
|
|
@@ -229,7 +234,7 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
229
234
|
]),
|
|
230
235
|
_: 1
|
|
231
236
|
}, 8, ["id", "data-testid", "onClick"]),
|
|
232
|
-
|
|
237
|
+
i(e(A), {
|
|
233
238
|
id: "button-cancel" + t.uniqueId,
|
|
234
239
|
size: "small",
|
|
235
240
|
theme: "third",
|
|
@@ -237,10 +242,10 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
237
242
|
variant: "outlined",
|
|
238
243
|
class: "button",
|
|
239
244
|
"data-testid": `${t.testId}-${e(o).ACTION_CANCEL}`,
|
|
240
|
-
onClick: (a) => e(
|
|
245
|
+
onClick: (a) => e(D)()
|
|
241
246
|
}, {
|
|
242
247
|
default: l(() => [
|
|
243
|
-
|
|
248
|
+
i(e(p), { variant: "button" }, {
|
|
244
249
|
default: l(() => [
|
|
245
250
|
m(" Cancel ")
|
|
246
251
|
]),
|
|
@@ -249,7 +254,7 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
249
254
|
]),
|
|
250
255
|
_: 1
|
|
251
256
|
}, 8, ["id", "data-testid", "onClick"])
|
|
252
|
-
]),
|
|
257
|
+
]), R(1), c[1])
|
|
253
258
|
])
|
|
254
259
|
])
|
|
255
260
|
], 4)
|
|
@@ -257,9 +262,9 @@ const de = ["id", "data-testid"], ne = ["data-testid"], ie = ["id", "data-testid
|
|
|
257
262
|
], 10, ie), [
|
|
258
263
|
[$, e(h)]
|
|
259
264
|
])
|
|
260
|
-
], 10,
|
|
265
|
+
], 10, ne));
|
|
261
266
|
}
|
|
262
267
|
});
|
|
263
268
|
export {
|
|
264
|
-
|
|
269
|
+
Ve as default
|
|
265
270
|
};
|
|
@@ -3,29 +3,29 @@ import { inject as Ve, ref as r, computed as c, watch as b, useSlots as ke, toRa
|
|
|
3
3
|
import { isObjectInArray as ae } from "../../../utils/array.js";
|
|
4
4
|
import { objectsEqual as Ue } from "../../../utils/object.js";
|
|
5
5
|
import { useClamp as Be, useVirtualList as He, onClickOutside as ne, useInfiniteScroll as qe } from "@vueuse/core";
|
|
6
|
-
import { Mode as T, Type as
|
|
6
|
+
import { Mode as T, Type as U, DropdownContext as Xe } from "./DropdownContext.js";
|
|
7
7
|
import { pxToRem as $e } from "../../../utils/style.js";
|
|
8
8
|
import { useEditableContext as je } from "../../table-cells/common/EditableContext.js";
|
|
9
9
|
import { useGroupedOptions as ze } from "./useGroupedOptions.js";
|
|
10
10
|
const tl = (l, v, g) => {
|
|
11
|
-
const
|
|
12
|
-
sortOutGroups:
|
|
11
|
+
const B = Ve("isTreeDropdown", !1), {
|
|
12
|
+
sortOutGroups: H,
|
|
13
13
|
flattenAndMarkGroupOptions: ue,
|
|
14
|
-
isGroup:
|
|
14
|
+
isGroup: q,
|
|
15
15
|
selectAllWithGroups: ie,
|
|
16
16
|
isIndeterminateGrouped: re,
|
|
17
|
-
allSelectedGrouped:
|
|
17
|
+
allSelectedGrouped: X,
|
|
18
18
|
areAllPreviousSelected: oe
|
|
19
19
|
} = ze(l), ce = (e, t) => l.multi && Array.isArray(e) ? l.comparingKey ? e?.findIndex(
|
|
20
20
|
(i) => i[l.comparingKey] === t[l.comparingKey]
|
|
21
21
|
) > -1 : ae(e, t) : l.comparingKey ? e?.[l.comparingKey] === t[l.comparingKey] : e === t;
|
|
22
|
-
let
|
|
22
|
+
let $;
|
|
23
23
|
((e) => {
|
|
24
24
|
e[e.None = 0] = "None", e[e.Next = 1] = "Next", e[e.Previous = -1] = "Previous", e[e.NextPage = 10] = "NextPage", e[e.PrevPage = -10] = "PrevPage";
|
|
25
|
-
})(
|
|
25
|
+
})($ || ($ = {}));
|
|
26
26
|
const a = r(
|
|
27
27
|
l.selected
|
|
28
|
-
), R = je(),
|
|
28
|
+
), R = je(), u = c({
|
|
29
29
|
get() {
|
|
30
30
|
return R?.value?.value ?? a.value;
|
|
31
31
|
},
|
|
@@ -39,7 +39,7 @@ const tl = (l, v, g) => {
|
|
|
39
39
|
a.value = l.selected, d.value = l.selected;
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
|
-
const se = ke(), w = r(null), m = r(null),
|
|
42
|
+
const se = ke(), w = r(null), m = r(null), j = r(null), E = r(null), z = r(null), I = r(null), de = r(), W = r(null), J = r(null), Q = r(null), ve = 8, fe = c(() => I.value ? I.value.getBoundingClientRect().height + ve + l.distance : 0), D = r(!1), y = r([]), x = r(-1), h = r(""), d = r(l.selected || []), Y = () => I.value?.focus(), [O, ge, ye] = _e({
|
|
43
43
|
disabled: l.disabled,
|
|
44
44
|
initialValue: l.defaultOpen
|
|
45
45
|
});
|
|
@@ -49,7 +49,7 @@ const tl = (l, v, g) => {
|
|
|
49
49
|
e !== void 0 && ye(e);
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
const
|
|
52
|
+
const Z = (e) => {
|
|
53
53
|
he.value = ge(e);
|
|
54
54
|
}, he = c({
|
|
55
55
|
get() {
|
|
@@ -58,19 +58,19 @@ const tl = (l, v, g) => {
|
|
|
58
58
|
set(e) {
|
|
59
59
|
v("update:isOpen", e);
|
|
60
60
|
}
|
|
61
|
-
}), Oe = c(() => o.value.length - 1), f = Be(0, 0, Oe),
|
|
61
|
+
}), Oe = c(() => o.value.length - 1), f = Be(0, 0, Oe), F = c(() => u.value ? l.displayValue(u.value) : ""), Se = (e) => {
|
|
62
62
|
if (!e.value.length && !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix)
|
|
63
63
|
return l.placeholder;
|
|
64
64
|
const t = !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix ? `${e.value.length} selected` : `${l.multiOptionsPlaceholderPrefix ?? ""}${e.value.length ?? "0"}${l.multiOptionsPlaceholderSuffix ?? ""}`;
|
|
65
65
|
return e.value.length == 1 && l.displayValue ? l.displayValue(e.value[0]) : t;
|
|
66
66
|
}, me = c(() => {
|
|
67
67
|
if (!l.multi)
|
|
68
|
-
return
|
|
68
|
+
return u.value ? l.displayValue(u.value) : l.placeholder;
|
|
69
69
|
if (Array.isArray(a.value))
|
|
70
70
|
return Se(a);
|
|
71
71
|
}), M = c(() => {
|
|
72
72
|
if (Array.isArray(a.value))
|
|
73
|
-
return l.groupedOptions ?
|
|
73
|
+
return l.groupedOptions ? X(o, a) : a.value.length === o.value.length;
|
|
74
74
|
}), Ae = c(() => !l.multi || !Array.isArray(a.value) ? !1 : l.groupedOptions ? re(
|
|
75
75
|
o,
|
|
76
76
|
a
|
|
@@ -87,35 +87,35 @@ const tl = (l, v, g) => {
|
|
|
87
87
|
notSelected: []
|
|
88
88
|
};
|
|
89
89
|
P(N).value.forEach((i) => {
|
|
90
|
-
const
|
|
91
|
-
(
|
|
90
|
+
const n = (l.comparingKey ? d.value.findIndex(
|
|
91
|
+
(L) => L[l.comparingKey] === i[l.comparingKey]
|
|
92
92
|
) > -1 : d.value.includes(i)) ? "selected" : "notSelected";
|
|
93
|
-
e[
|
|
93
|
+
e[n].push(i);
|
|
94
94
|
});
|
|
95
|
-
const t = l.groupedOptions ?
|
|
95
|
+
const t = l.groupedOptions ? H(e.notSelected) : e.notSelected;
|
|
96
96
|
return [].concat(e.selected, t);
|
|
97
97
|
}), o = c(() => {
|
|
98
|
-
const e = Array.isArray(d.value) && l.multi && g.VERSION === 4 && !
|
|
98
|
+
const e = Array.isArray(d.value) && l.multi && g.VERSION === 4 && !B ? be.value : N.value;
|
|
99
99
|
if (l.onSearch) {
|
|
100
|
-
const t = e.filter((i) => l.groupedOptions &&
|
|
101
|
-
return l.groupedOptions ?
|
|
100
|
+
const t = e.filter((i) => l.groupedOptions && q(i) ? i : l.onSearch(i, h.value));
|
|
101
|
+
return l.groupedOptions ? H(t) : t;
|
|
102
102
|
} else
|
|
103
103
|
return e;
|
|
104
|
-
}), Pe = c(() => y.value[0]?.hasSubtitle),
|
|
104
|
+
}), Pe = c(() => y.value[0]?.hasSubtitle), p = c(() => s.mode === T.Multi), ee = c(
|
|
105
105
|
() => Pe.value ? g.MULTILINE_LIST_HEIGHT : g.LIST_HEIGHT
|
|
106
106
|
), {
|
|
107
|
-
list:
|
|
108
|
-
containerProps:
|
|
107
|
+
list: V,
|
|
108
|
+
containerProps: k,
|
|
109
109
|
wrapperProps: Te,
|
|
110
110
|
scrollTo: C
|
|
111
111
|
} = He(o, {
|
|
112
|
-
itemHeight:
|
|
112
|
+
itemHeight: ee.value,
|
|
113
113
|
overscan: l.disableVirtualScroll ? 1 / 0 : 2
|
|
114
114
|
});
|
|
115
115
|
b(
|
|
116
116
|
() => l.isOpen,
|
|
117
117
|
(e) => {
|
|
118
|
-
|
|
118
|
+
Z(e);
|
|
119
119
|
}
|
|
120
120
|
), b([x], async () => {
|
|
121
121
|
await K();
|
|
@@ -132,16 +132,16 @@ const tl = (l, v, g) => {
|
|
|
132
132
|
v("onsearch", h.value), C(0);
|
|
133
133
|
});
|
|
134
134
|
const A = (e, t = !1) => {
|
|
135
|
-
l.disabled || (
|
|
135
|
+
l.disabled || (Z(e), K(() => {
|
|
136
136
|
O.value && v("opened"), O.value || v("closed"), w.value && t && w.value.focus();
|
|
137
137
|
}));
|
|
138
138
|
};
|
|
139
139
|
b(O, (e) => {
|
|
140
140
|
if (e) {
|
|
141
|
-
h.value = "",
|
|
141
|
+
h.value = "", p.value && Array.isArray(u.value) && (d.value = P(u.value).slice());
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
Y();
|
|
145
145
|
});
|
|
146
146
|
const we = () => {
|
|
147
147
|
if (M.value) {
|
|
@@ -161,17 +161,17 @@ const tl = (l, v, g) => {
|
|
|
161
161
|
v("selectAll");
|
|
162
162
|
}
|
|
163
163
|
}, Ie = () => {
|
|
164
|
-
we(), g.VERSION !== 4 && (
|
|
164
|
+
we(), g.VERSION !== 4 && (u.value = a.value);
|
|
165
165
|
}, xe = (e = !0) => {
|
|
166
|
-
a.value = [], e && (
|
|
167
|
-
},
|
|
166
|
+
a.value = [], e && (u.value = [], d.value = []), v("clear");
|
|
167
|
+
}, G = (e, t) => {
|
|
168
168
|
if (e = P(e), g.VERSION === 4 ? e[l.disabledOptionKey] : y.value[t]?.disabled)
|
|
169
169
|
return;
|
|
170
170
|
if (x.value = t, !l.multi) {
|
|
171
171
|
l.keepOpen || A(!1), s.goToOption(
|
|
172
172
|
0
|
|
173
173
|
/* None */
|
|
174
|
-
),
|
|
174
|
+
), u.value = e, _(""), Y(), s.type === U.Search && m.value && (m.value.value = l.displayValue(e)), le();
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
if (!Array.isArray(a.value))
|
|
@@ -179,9 +179,9 @@ const tl = (l, v, g) => {
|
|
|
179
179
|
m.value?.focus();
|
|
180
180
|
const S = P(a.value);
|
|
181
181
|
if (ae(S, e) || l.comparingKey && S.findIndex(
|
|
182
|
-
(
|
|
182
|
+
(n) => n[l.comparingKey] === e[l.comparingKey]
|
|
183
183
|
) > -1) {
|
|
184
|
-
a.value = S.filter((
|
|
184
|
+
a.value = S.filter((n) => l.comparingKey ? n[l.comparingKey] !== e[l.comparingKey] : !Ue(n, e));
|
|
185
185
|
return;
|
|
186
186
|
} else {
|
|
187
187
|
a.value = [...S, e];
|
|
@@ -190,24 +190,24 @@ const tl = (l, v, g) => {
|
|
|
190
190
|
}, De = (e) => y.value[e]?.disabled, s = {
|
|
191
191
|
activeIndex: f,
|
|
192
192
|
options: y,
|
|
193
|
-
selectedOption:
|
|
194
|
-
labelRef:
|
|
193
|
+
selectedOption: u,
|
|
194
|
+
labelRef: z,
|
|
195
195
|
activeOption: E,
|
|
196
196
|
listRef: w,
|
|
197
197
|
clearable: l.clearable,
|
|
198
|
-
type: se.input ?
|
|
198
|
+
type: se.input ? U.Search : U.Dropdown,
|
|
199
199
|
mode: l.multi ? T.Multi : T.Single,
|
|
200
200
|
query: h,
|
|
201
|
-
selectedValue:
|
|
201
|
+
selectedValue: F,
|
|
202
202
|
toggle: A,
|
|
203
203
|
disabled: l.disabled,
|
|
204
204
|
open: O,
|
|
205
205
|
mandatory: l.mandatory,
|
|
206
206
|
size: l.size,
|
|
207
207
|
placeholder: l.placeholder,
|
|
208
|
-
select:
|
|
208
|
+
select: G,
|
|
209
209
|
clearSelection: () => {
|
|
210
|
-
_(""),
|
|
210
|
+
_(""), u.value = s.mode === T.Single ? null : [], d.value = s.mode === T.Single ? null : [], m.value && (m.value.value = "");
|
|
211
211
|
},
|
|
212
212
|
search: _,
|
|
213
213
|
goToOption: async (e) => {
|
|
@@ -215,7 +215,7 @@ const tl = (l, v, g) => {
|
|
|
215
215
|
return;
|
|
216
216
|
let t = f.value + e;
|
|
217
217
|
const i = y.value.filter(
|
|
218
|
-
(
|
|
218
|
+
(n) => n.disabled
|
|
219
219
|
).length, S = o.value.length - i;
|
|
220
220
|
for (t > S && (t = S + 1); ; ) {
|
|
221
221
|
if (!y.value[t]?.disabled) {
|
|
@@ -246,11 +246,11 @@ const tl = (l, v, g) => {
|
|
|
246
246
|
{
|
|
247
247
|
ignore: [
|
|
248
248
|
I,
|
|
249
|
-
z,
|
|
250
249
|
W,
|
|
251
250
|
J,
|
|
251
|
+
Q,
|
|
252
252
|
m,
|
|
253
|
-
|
|
253
|
+
k.ref
|
|
254
254
|
]
|
|
255
255
|
}
|
|
256
256
|
);
|
|
@@ -259,16 +259,16 @@ const tl = (l, v, g) => {
|
|
|
259
259
|
};
|
|
260
260
|
Le(async () => {
|
|
261
261
|
l.autoFocus && (await K(), setTimeout(() => {
|
|
262
|
-
|
|
263
|
-
})), s.goToOption(0), l.multi && !
|
|
262
|
+
j.value.focus();
|
|
263
|
+
})), s.goToOption(0), l.multi && !B && (l.groupedOptions ? D.value = X(
|
|
264
264
|
o,
|
|
265
265
|
a
|
|
266
266
|
) : D.value = l.options.length === l.selected.length);
|
|
267
267
|
});
|
|
268
268
|
const le = () => {
|
|
269
|
-
l.multi && (D.value = M.value,
|
|
269
|
+
l.multi && (D.value = M.value, u.value = a.value, Array.isArray(u.value) && (d.value = P(u.value).slice())), v("apply", u.value), v("allSelectedChanged", M.value), A(!1), Me();
|
|
270
270
|
}, te = () => {
|
|
271
|
-
|
|
271
|
+
p.value && Array.isArray(d.value) && (u.value = P(d.value).slice()), h.value = "", A(!1);
|
|
272
272
|
}, Ne = (e) => {
|
|
273
273
|
if (!l.disableKeyboardEvents)
|
|
274
274
|
switch (e.key) {
|
|
@@ -318,24 +318,24 @@ const tl = (l, v, g) => {
|
|
|
318
318
|
A(!0);
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
|
|
321
|
+
G(o.value[f.value], f.value), s.mode === T.Single && !l.keepOpen && A(!1), e.preventDefault();
|
|
322
322
|
break;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
}, Ke = c(() => {
|
|
326
326
|
if (l.loading)
|
|
327
327
|
return 8.5;
|
|
328
|
-
const e = l.loadMoreLoading && g.MAX_NUMBER_OF_OPTIONS || l.customNumberOfDisplayedOptions ||
|
|
328
|
+
const e = l.loadMoreLoading && g.MAX_NUMBER_OF_OPTIONS || l.customNumberOfDisplayedOptions || V.value.reduce((L, Re) => {
|
|
329
329
|
const Ee = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Re.data) : 1;
|
|
330
|
-
return
|
|
330
|
+
return L + Ee;
|
|
331
331
|
}, 0), t = l.multi && l.showSelectAll && !h.value ? 1 : 0, i = e > g.MAX_NUMBER_OF_OPTIONS, S = e + t;
|
|
332
|
-
let
|
|
333
|
-
return l.loadMoreLoading && l.multi && (
|
|
334
|
-
|
|
332
|
+
let n = i ? g.MAX_NUMBER_OF_OPTIONS + 0.1 : S;
|
|
333
|
+
return l.loadMoreLoading && l.multi && (V.value.length ? n = n + 0.1 : n = n - 0.9), l.noResultsText && n === 0 && (n = n + 1), l.withConditions && h.value && (n = n + 1), $e(
|
|
334
|
+
n * ee.value + g.PADDING_PX
|
|
335
335
|
);
|
|
336
336
|
});
|
|
337
337
|
return qe(
|
|
338
|
-
|
|
338
|
+
k.ref,
|
|
339
339
|
() => {
|
|
340
340
|
!l.loadMoreLoading && l.infiniteLoading && v("loadMore");
|
|
341
341
|
},
|
|
@@ -349,9 +349,9 @@ const tl = (l, v, g) => {
|
|
|
349
349
|
toggleMenu: A,
|
|
350
350
|
onButtonKeydown: Ne,
|
|
351
351
|
displayedValue: me,
|
|
352
|
-
labelRef:
|
|
352
|
+
labelRef: z,
|
|
353
353
|
query: h,
|
|
354
|
-
containerProps:
|
|
354
|
+
containerProps: k,
|
|
355
355
|
calculateTableHeight: Ke,
|
|
356
356
|
wrapperProps: Te,
|
|
357
357
|
filteredOptions: o,
|
|
@@ -359,12 +359,12 @@ const tl = (l, v, g) => {
|
|
|
359
359
|
allSelectedApplied: D,
|
|
360
360
|
isIndeterminate: Ae,
|
|
361
361
|
onSelectAll: Ie,
|
|
362
|
-
virtualOptions:
|
|
362
|
+
virtualOptions: V,
|
|
363
363
|
isSelected: ce,
|
|
364
|
-
selectedOption:
|
|
364
|
+
selectedOption: u,
|
|
365
365
|
selectedOptionPrevious: d,
|
|
366
|
-
selectedValue:
|
|
367
|
-
onSelect:
|
|
366
|
+
selectedValue: F,
|
|
367
|
+
onSelect: G,
|
|
368
368
|
activeIndex: f,
|
|
369
369
|
onCancel: te,
|
|
370
370
|
onApply: le,
|
|
@@ -372,13 +372,13 @@ const tl = (l, v, g) => {
|
|
|
372
372
|
onClickOutside: ne,
|
|
373
373
|
listRef: w,
|
|
374
374
|
buttonRef: I,
|
|
375
|
-
apply:
|
|
376
|
-
cancel:
|
|
377
|
-
el:
|
|
375
|
+
apply: W,
|
|
376
|
+
cancel: J,
|
|
377
|
+
el: j,
|
|
378
378
|
triggerRef: de,
|
|
379
|
-
clearAll:
|
|
379
|
+
clearAll: Q,
|
|
380
380
|
onClearAllSelections: xe,
|
|
381
|
-
isGroup:
|
|
381
|
+
isGroup: q
|
|
382
382
|
};
|
|
383
383
|
};
|
|
384
384
|
export {
|