@ironsource/shared-ui 2.1.12-test.88 → 2.1.12-test.89
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/DateRangeV4.vue_vue_type_style_index_0_scoped_9b958611_lang.css +1 -0
- package/components/dateRange/common/DateRange.common.js +81 -75
- package/components/dateRange/v4/DateRangeV4.vue.js +3 -3
- package/components/dateRange/v4/DateRangeV4.vue2.js +49 -48
- package/index.js +1 -1
- package/package.json +1 -1
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.label[data-v-9b958611]{color:#41454d}.pop-up[data-v-9b958611]{width:668px;position:absolute;z-index:1000;top:32px;left:1px;overflow:hidden;border-radius:8px;border:1px solid var(--common-divider, #e4e4e4);background:var(--background-modelElevation, #fff);box-shadow:var(--elevation-lg)}.pop-up.open-on-top[data-v-9b958611]{top:0}.pop-up.hide-presets[data-v-9b958611],.pop-up.hide-presets .calendar-wrap[data-v-9b958611]{width:520px}.pop-up.hide-presets .date-picker-calendar[data-v-9b958611]{padding:15px 16px}.pop-up .date-picker-menu[data-v-9b958611]{width:164px;background:#ffffff;vertical-align:top;border-right:1px solid var(--common-divider-elevation-0, #e4e4e4);background:var(--background-paper, #fcfcfc)}.pop-up .date-picker-menu .preset-element[data-v-9b958611]{padding-left:8px;height:32px;border-radius:8px;color:var(--text-primary, #202020);line-height:32px}.pop-up .date-picker-menu .preset-element[data-v-9b958611]:hover{background:var(--action-hover, rgba(0, 0, 0, .05))}.pop-up .date-picker-menu .selected-preset[data-v-9b958611]{border-radius:8px;background:var(--action-selected, #ebebeb)}.pop-up .date-picker-menu li[data-v-9b958611]{cursor:pointer;margin-bottom:2px}.pop-up .left-box[data-v-9b958611]{left:-1px}.pop-up .date-picker-calendar[data-v-9b958611]{box-sizing:border-box;height:100%;padding:16px;display:grid;grid-template-columns:1fr 1fr;grid-gap:24px}.pop-up .calendars-wrapper[data-v-9b958611]{padding-left:6px}.pop-up .preset-dropdown ul[data-v-9b958611]{list-style:none;margin:0;padding:8px;line-height:32px}.pop-up .buttons-cover[data-v-9b958611]{height:48px;position:absolute;bottom:0;width:100%;right:0;box-sizing:border-box;border-top:1px solid var(--common-divider-elevation-0, #e4e4e4);background:var(--background-modelElevation, #fff);align-items:center;display:flex;justify-content:space-between;padding:12px 16px}.pop-up .buttons-cover .text-container[data-v-9b958611]{flex:1;color:var(--text-secondary, #646464)}.pop-up button[data-v-9b958611]{float:right;margin-left:8px}.pop-up .error[data-v-9b958611]{display:none;position:absolute;left:270px;top:22px}.pop-up .inline-block[data-v-9b958611]{display:inline-block}.pop-up.right[data-v-9b958611]{left:initial;right:1px}.calendar-wrap[data-v-9b958611]{width:504px;height:372px;position:relative;border-bottom-right-radius:8px;border-top-right-radius:8px;vertical-align:top}.type-picker[data-v-9b958611]{height:60px;line-height:60px;padding-left:15px;box-shadow:0 1px 3px #0000003b}.range-type[data-v-9b958611]{color:#8e959d;padding-left:15px;padding-right:15px;cursor:pointer}.selected-range-type[data-v-9b958611]{color:#fff;background-color:#3083ff;border-radius:20px;padding:6px 15px;cursor:default}.date-range-field[data-v-9b958611]{display:inline-block;width:100%;height:28px;position:relative;cursor:pointer;border-radius:3px}.date-range-field.selected-item-as-title[data-v-9b958611]{left:0;border:none;background-image:none;max-width:100%;height:22px;color:#3083ff;overflow:visible}.date-range-field.selected-item-as-title .small-triangle[data-v-9b958611]{right:-25px}.date-range-field.selected-item-as-title .small-triangle[data-v-9b958611]:after{border-top-color:currentColor}.date-range-field.selected-item-as-title span[data-v-9b958611]{padding-left:12px}.date-range-field.no-button-limit[data-v-9b958611]{overflow:visible}.date-range-field.no-button-limit span[data-v-9b958611]{width:100%;line-height:22px}.date-range-field span[data-v-9b958611]{line-height:26px;padding-left:15px;overflow:hidden;text-overflow:ellipsis;display:inline-block;width:calc(100% - 26px);white-space:nowrap;position:relative}.date-range-disabled .date-range-field[data-v-9b958611]{cursor:default;color:#8e959d;pointer-events:none}.date-range-disabled .small-triangle[data-v-9b958611]:after{border-top-color:#8e959d}.pop-up-content[data-v-9b958611]{margin-top:1px}.type-message[data-v-9b958611]{color:#8e959d;padding:10px 20px;line-height:1.5}.relative-wrap[data-v-9b958611]{position:relative}.space-right[data-v-9b958611]{margin-right:13px}.space-left[data-v-9b958611]{margin-left:9px}.top-date[data-v-9b958611]{line-height:13px}.flex[data-v-9b958611]{display:flex}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { onClickOutside as ie } from "@vueuse/core";
|
|
2
2
|
import { useToggle as fe } from "../../../composables/useToggle.js";
|
|
3
|
-
import { ref as r, computed as b, onMounted as
|
|
3
|
+
import { ref as r, computed as b, onMounted as de, onBeforeMount as ce, onUnmounted as ve, watch as Q } from "vue";
|
|
4
4
|
import { min as me, addDays as ge, format as X } from "date-fns";
|
|
5
5
|
import { presetsList as he, formatError as De, mandatoryValuesError as Me, navigatePrev as Z, navigateNext as V } from "./consts.common.js";
|
|
6
6
|
import m from "./DateServices.common.js";
|
|
7
|
-
const
|
|
8
|
-
const N = r(null),
|
|
7
|
+
const pe = (o, y) => {
|
|
8
|
+
const N = r(null), d = r({ started: !1, date: null }), x = r(!1), _ = 2, S = r({ from: null, to: null }), u = r({}), g = r([]), k = r(null), i = r({}), p = r({}), C = r(!1), w = r(null), s = r(null), j = r("left"), P = r(null), O = r(null), E = r([]), K = r(null), [D] = fe({ initialValue: !1 }), q = r(null);
|
|
9
9
|
ie(q, () => {
|
|
10
|
-
|
|
10
|
+
D.value = !1;
|
|
11
11
|
});
|
|
12
12
|
const L = (e, t) => {
|
|
13
13
|
const a = {
|
|
@@ -17,27 +17,27 @@ const Te = (o, y) => {
|
|
|
17
17
|
year: t
|
|
18
18
|
};
|
|
19
19
|
let n, l;
|
|
20
|
-
const
|
|
20
|
+
const c = new Date(t, e, 1).getDay();
|
|
21
21
|
let v = 1;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
22
|
+
const f = /* @__PURE__ */ new Date();
|
|
23
|
+
f.setHours(0, 0, 0, 0);
|
|
24
|
+
const ue = m.daysInMonth(e, t);
|
|
25
25
|
for (let I = 0; I < 6; I++) {
|
|
26
26
|
l = [];
|
|
27
27
|
for (let H = 0; H < 7; H++)
|
|
28
|
-
n = {}, I === 0 &&
|
|
28
|
+
n = {}, I === 0 && c > 0 && H < c && (n.value = 0), v > ue && (n.value = 0), !n.value && n.value !== 0 && (n.value = v, v += 1, a.days[n.value] = n, n.date = new Date(t, e, n.value), f < n.date ? n.isFuture = !0 : n.date.getTime() === f.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
|
|
29
29
|
a.weeks.push(l);
|
|
30
30
|
}
|
|
31
31
|
return a;
|
|
32
|
-
},
|
|
32
|
+
}, T = () => {
|
|
33
33
|
let e = m.getCurrentTimeUTC();
|
|
34
|
-
if (
|
|
35
|
-
|
|
34
|
+
if (s.value && s.value.toEnd ? e = s.value.toEnd : o.range && o.range.to && (e = o.range.to), !u.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
|
|
35
|
+
u.value = {}, g.value = [];
|
|
36
36
|
for (let t = 0; t < _; t++) {
|
|
37
37
|
const a = new Date(e);
|
|
38
38
|
a.setDate(1), a.setMonth(e.getMonth() - t);
|
|
39
39
|
const n = `${a.getFullYear().toString()}_${a.getMonth().toString()}`;
|
|
40
|
-
|
|
40
|
+
u.value[n] = {
|
|
41
41
|
parsedMonth: L(
|
|
42
42
|
a.getMonth(),
|
|
43
43
|
a.getFullYear()
|
|
@@ -47,60 +47,60 @@ const Te = (o, y) => {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}, z = (e, t) => {
|
|
50
|
-
|
|
50
|
+
w.value = e;
|
|
51
51
|
let a = e;
|
|
52
|
-
e === "date" && (a = o.datePresetList), E.value = he[a], t && (
|
|
52
|
+
e === "date" && (a = o.datePresetList), E.value = he[a], t && (s.value = {
|
|
53
53
|
fromStart: null,
|
|
54
54
|
fromEnd: null,
|
|
55
55
|
toStart: null,
|
|
56
56
|
toEnd: null
|
|
57
|
-
}, S.value.from = "", S.value.to = "",
|
|
57
|
+
}, S.value.from = "", S.value.to = "", d.value = { started: !1, date: null }, i.value = "custom"), y("rangeTypeChanged", w.value);
|
|
58
58
|
}, ee = (e) => {
|
|
59
|
-
|
|
60
|
-
},
|
|
59
|
+
i.value = e.id, M(k.value[e.id].dates()), T();
|
|
60
|
+
}, M = (e, t = !1) => {
|
|
61
61
|
let a = e;
|
|
62
|
-
return (!e || !e.from && !e.to) && (a = k.value[E.value[0]]), o.maxDaysInRange && (K.value = t ? ge(a.from, o.maxDaysInRange) : null),
|
|
63
|
-
|
|
62
|
+
return !e.from && !e.to && e.preset ? a = k.value[e.preset]?.dates() : (!e || !e.from && !e.to) && (a = k.value[E.value[0]]), o.maxDaysInRange && (K.value = t ? ge(a.from, o.maxDaysInRange) : null), C.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (O.value = De, C.value = !0, !1) : a.from > a.to ? (O.value = `"From" date can't be bigger than "To" date`, C.value = !0, !1) : (s.value = R(a), S.value.from = X(
|
|
63
|
+
s.value.fromStart,
|
|
64
64
|
o.dateFormat
|
|
65
|
-
), S.value.to = X(
|
|
65
|
+
), S.value.to = X(s.value.toEnd, o.dateFormat), !0);
|
|
66
66
|
}, F = () => {
|
|
67
|
-
|
|
67
|
+
i.value === "custom" ? P.value = m.getDateRangeString(s.value) : P.value = J.value, y("currentDateChanged", P.value);
|
|
68
68
|
}, te = () => {
|
|
69
|
-
if (
|
|
70
|
-
|
|
69
|
+
if (s.value.fromStart == null || s.value.toEnd == null) {
|
|
70
|
+
C.value = !0, O.value = Me;
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
const e = m.getCurrentTimeUTC();
|
|
74
|
-
|
|
75
|
-
from:
|
|
76
|
-
to:
|
|
77
|
-
preset:
|
|
74
|
+
s.value.toEnd > e && (s.value.toEnd = e), F(), p.value = i.value, y("rangeChanged", {
|
|
75
|
+
from: s.value.fromStart,
|
|
76
|
+
to: s.value.toEnd,
|
|
77
|
+
preset: p.value
|
|
78
78
|
}), W(!1);
|
|
79
79
|
}, ae = (e, t) => e ? Z : t ? V : null, ne = (e) => {
|
|
80
80
|
let t = null, a = null;
|
|
81
81
|
const n = _ - 1;
|
|
82
|
-
let l = "",
|
|
82
|
+
let l = "", h = null, c = null;
|
|
83
83
|
switch (e) {
|
|
84
84
|
case V:
|
|
85
|
-
Object.keys(
|
|
86
|
-
const
|
|
87
|
-
|
|
85
|
+
Object.keys(u.value).forEach((v) => {
|
|
86
|
+
const f = u.value[v];
|
|
87
|
+
f.order === 0 && (h = f), f.order === n ? (g.value.splice(
|
|
88
88
|
g.value.indexOf(v),
|
|
89
89
|
1
|
|
90
|
-
), delete
|
|
91
|
-
}), t =
|
|
90
|
+
), delete u.value[v]) : f.order += 1;
|
|
91
|
+
}), t = h.parsedMonth.month + 1, a = h.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
|
|
92
92
|
parsedMonth: L(t, a),
|
|
93
93
|
order: 0
|
|
94
94
|
}, g.value.push(l);
|
|
95
95
|
break;
|
|
96
96
|
case Z:
|
|
97
|
-
Object.keys(
|
|
98
|
-
const
|
|
99
|
-
|
|
97
|
+
Object.keys(u.value).forEach((v) => {
|
|
98
|
+
const f = u.value[v];
|
|
99
|
+
f.order === n && (c = f), f.order === 0 ? (g.value.splice(
|
|
100
100
|
g.value.indexOf(v),
|
|
101
101
|
1
|
|
102
|
-
), delete
|
|
103
|
-
}), t =
|
|
102
|
+
), delete u.value[v]) : f.order -= 1;
|
|
103
|
+
}), t = c.parsedMonth.month - 1, a = c.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
|
|
104
104
|
parsedMonth: L(t, a),
|
|
105
105
|
order: n
|
|
106
106
|
}, g.value.unshift(l);
|
|
@@ -108,7 +108,7 @@ const Te = (o, y) => {
|
|
|
108
108
|
}
|
|
109
109
|
}, R = (e) => {
|
|
110
110
|
let t;
|
|
111
|
-
switch (
|
|
111
|
+
switch (w.value) {
|
|
112
112
|
case "week":
|
|
113
113
|
t = {
|
|
114
114
|
fromStart: m.getFirstDayOfWeek(e.from),
|
|
@@ -146,6 +146,12 @@ const Te = (o, y) => {
|
|
|
146
146
|
return t;
|
|
147
147
|
}, U = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), $ = (e) => {
|
|
148
148
|
let t = !1;
|
|
149
|
+
if (!e.from && !e.to && e.preset) {
|
|
150
|
+
const l = E.value.find(
|
|
151
|
+
(h) => h.id === e.preset
|
|
152
|
+
);
|
|
153
|
+
i.value = l.id, t = !0;
|
|
154
|
+
}
|
|
149
155
|
const a = {
|
|
150
156
|
from: new Date(e.from),
|
|
151
157
|
to: new Date(e.to)
|
|
@@ -153,53 +159,53 @@ const Te = (o, y) => {
|
|
|
153
159
|
a.from.setHours(0, 0, 0, 0), a.to.setHours(0, 0, 0, 0);
|
|
154
160
|
const n = E.value.map((l) => l.id);
|
|
155
161
|
if (Object.keys(k.value).forEach((l) => {
|
|
156
|
-
const
|
|
162
|
+
const h = k.value[l];
|
|
157
163
|
if (l !== "custom" && !t && n.indexOf(l) !== -1) {
|
|
158
|
-
const
|
|
159
|
-
|
|
164
|
+
const c = h.dates();
|
|
165
|
+
c.from.setHours(0, 0, 0, 0), c.to.setHours(0, 0, 0, 0), U(c.from, a.from) && U(c.to, a.to) && (i.value = l, t = !0);
|
|
160
166
|
}
|
|
161
167
|
}), t) {
|
|
162
168
|
const l = E.value.find(
|
|
163
|
-
(
|
|
169
|
+
(h) => h.id === i.value
|
|
164
170
|
);
|
|
165
171
|
y("dateRangePresetNameChanged", l.name);
|
|
166
172
|
} else
|
|
167
|
-
y("dateRangePresetNameChanged", null),
|
|
168
|
-
|
|
173
|
+
y("dateRangePresetNameChanged", null), i.value = "custom";
|
|
174
|
+
p.value = i.value;
|
|
169
175
|
}, A = (e, t, a) => {
|
|
170
|
-
if (!
|
|
171
|
-
|
|
172
|
-
{ from:
|
|
176
|
+
if (!d.value.started)
|
|
177
|
+
i.value = "custom", d.value.started = !0, d.value.date = new Date(a, t, e.value), M(
|
|
178
|
+
{ from: d.value.date, to: d.value.date },
|
|
173
179
|
!0
|
|
174
180
|
);
|
|
175
181
|
else {
|
|
176
|
-
const n = new Date(a, t, e.value), l =
|
|
177
|
-
|
|
182
|
+
const n = new Date(a, t, e.value), l = d.value.date;
|
|
183
|
+
d.value.started = !1, d.value.date = null, n < l ? A(e, t, a) : M({ from: l, to: n });
|
|
178
184
|
}
|
|
179
185
|
}, B = () => {
|
|
180
186
|
const e = N.value.offsetLeft;
|
|
181
187
|
return window.innerWidth - e > 930 ? "left" : "right";
|
|
182
188
|
}, W = (e = !0) => {
|
|
183
|
-
|
|
189
|
+
D.value = !D.value, D.value ? (j.value = B(), M(o.range), T(), y("opened")) : (M(o.range), T(), i.value = p.value, e && y("dismissed"));
|
|
184
190
|
}, G = () => {
|
|
185
|
-
|
|
191
|
+
D.value && W();
|
|
186
192
|
}, le = () => {
|
|
187
193
|
k.value = m.getPresetsFunctions(o.includeToday), k.value.custom = {
|
|
188
194
|
dates: () => o.range
|
|
189
195
|
};
|
|
190
196
|
}, oe = b(() => (g.value || []).reduce((e, t) => {
|
|
191
|
-
const n =
|
|
197
|
+
const n = u.value[t].parsedMonth.weeks[u.value[t].parsedMonth.weeks.length - 1].filter(
|
|
192
198
|
(l) => l.value !== 0
|
|
193
199
|
).length;
|
|
194
200
|
return e && !n;
|
|
195
201
|
}, !0)), Y = () => {
|
|
196
|
-
o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range),
|
|
202
|
+
o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), M(o.range), T(), F());
|
|
197
203
|
};
|
|
198
|
-
|
|
204
|
+
de(() => {
|
|
199
205
|
Y();
|
|
200
|
-
}),
|
|
206
|
+
}), ce(() => {
|
|
201
207
|
const e = (t) => {
|
|
202
|
-
t.key === "Escape" &&
|
|
208
|
+
t.key === "Escape" && D.value && G();
|
|
203
209
|
};
|
|
204
210
|
document.addEventListener("keyup", e), ve(() => {
|
|
205
211
|
document.removeEventListener("keyup", e);
|
|
@@ -207,44 +213,44 @@ const Te = (o, y) => {
|
|
|
207
213
|
}), Q(
|
|
208
214
|
() => o.range,
|
|
209
215
|
(e, t) => {
|
|
210
|
-
e && e !== t && (x.value ? ($(e),
|
|
216
|
+
e && e !== t && (x.value ? ($(e), M(e), F()) : Y());
|
|
211
217
|
}
|
|
212
|
-
), Q(
|
|
213
|
-
e || (
|
|
218
|
+
), Q(D, (e) => {
|
|
219
|
+
e || (d.value.started = !1);
|
|
214
220
|
});
|
|
215
221
|
const J = b(() => {
|
|
216
222
|
const e = E.value.find(
|
|
217
|
-
(t) => t.id ===
|
|
223
|
+
(t) => t.id === i.value
|
|
218
224
|
);
|
|
219
225
|
return e ? e.name : "";
|
|
220
|
-
}), re = b(() => `datepicker${o.uniqueId}`),
|
|
226
|
+
}), re = b(() => `datepicker${o.uniqueId}`), se = b(() => {
|
|
221
227
|
const e = [o.maxDate, K.value].filter((t) => t);
|
|
222
228
|
return e.length ? me(e) : null;
|
|
223
229
|
});
|
|
224
230
|
return {
|
|
225
231
|
datePicker: N,
|
|
226
232
|
datePickerId: re,
|
|
227
|
-
getMaxAllowedDate:
|
|
233
|
+
getMaxAllowedDate: se,
|
|
228
234
|
selectedPresetName: J,
|
|
229
|
-
selectedPreset:
|
|
230
|
-
displayError:
|
|
231
|
-
rangeType:
|
|
232
|
-
selectedRange:
|
|
235
|
+
selectedPreset: i,
|
|
236
|
+
displayError: C,
|
|
237
|
+
rangeType: w,
|
|
238
|
+
selectedRange: s,
|
|
233
239
|
placement: j,
|
|
234
|
-
currentDate:
|
|
240
|
+
currentDate: P,
|
|
235
241
|
error: O,
|
|
236
242
|
presets: E,
|
|
237
|
-
isOpen:
|
|
243
|
+
isOpen: D,
|
|
238
244
|
popup: q,
|
|
239
|
-
selectionStart:
|
|
245
|
+
selectionStart: d,
|
|
240
246
|
initialized: x,
|
|
241
247
|
textDates: S,
|
|
242
|
-
currentMonths:
|
|
248
|
+
currentMonths: u,
|
|
243
249
|
displayedMonthsKeys: g,
|
|
244
|
-
initMonths:
|
|
250
|
+
initMonths: T,
|
|
245
251
|
changeType: z,
|
|
246
252
|
presetChanged: ee,
|
|
247
|
-
initRange:
|
|
253
|
+
initRange: M,
|
|
248
254
|
setCurrentDate: F,
|
|
249
255
|
apply: te,
|
|
250
256
|
getNavigation: ae,
|
|
@@ -261,5 +267,5 @@ const Te = (o, y) => {
|
|
|
261
267
|
};
|
|
262
268
|
};
|
|
263
269
|
export {
|
|
264
|
-
|
|
270
|
+
pe as dateRangeCommon
|
|
265
271
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./DateRangeV4.vue2.js";
|
|
2
2
|
/* empty css */import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../../DateRangeV4.
|
|
4
|
-
const
|
|
3
|
+
// import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_9b958611_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-9b958611"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../../DateRangeV4.
|
|
1
|
+
import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_9b958611_lang.css"; import { defineComponent as J, watch as Q, openBlock as n, createElementBlock as s, unref as e, normalizeClass as r, createTextVNode as c, toDisplayString as p, createElementVNode as d, renderSlot as x, createVNode as i, withDirectives as k, Fragment as C, renderList as $, withCtx as l, createCommentVNode as E, vShow as I, normalizeStyle as X, setBlockTracking as R } from "vue";
|
|
2
2
|
import Z from "./CalendarMonthV4.vue.js";
|
|
3
3
|
import { typeToName as _, messagePerType as ee } from "../common/consts.common.js";
|
|
4
4
|
import A from "../../button/v4/ButtonV4.vue.js";
|
|
@@ -17,7 +17,7 @@ import "../../dropdown/v4/OptionV4.vue.js";
|
|
|
17
17
|
import "../../dropdown/v4/ConditionalDropdown.vue.js";
|
|
18
18
|
import { DateRangeTestIdModifiers as o, DatePickerTestIdModifiers as ae } from "../../../testids/index.js";
|
|
19
19
|
import { dateRangeCommon as de } from "../common/DateRange.common.js";
|
|
20
|
-
import
|
|
20
|
+
import y from "../../typography/v4/Typography.vue.js";
|
|
21
21
|
const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid"], oe = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "type-picker"
|
|
@@ -49,21 +49,21 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
49
49
|
"dismissed"
|
|
50
50
|
],
|
|
51
51
|
setup(t, { emit: B }) {
|
|
52
|
-
const
|
|
52
|
+
const w = t, {
|
|
53
53
|
datePicker: M,
|
|
54
54
|
datePickerId: S,
|
|
55
55
|
getMaxAllowedDate: q,
|
|
56
|
-
selectedPreset:
|
|
56
|
+
selectedPreset: f,
|
|
57
57
|
displayError: O,
|
|
58
|
-
rangeType:
|
|
58
|
+
rangeType: h,
|
|
59
59
|
selectedRange: L,
|
|
60
60
|
placement: V,
|
|
61
61
|
currentDate: T,
|
|
62
62
|
error: z,
|
|
63
63
|
presets: U,
|
|
64
|
-
isOpen:
|
|
64
|
+
isOpen: v,
|
|
65
65
|
popup: F,
|
|
66
|
-
currentMonths:
|
|
66
|
+
currentMonths: g,
|
|
67
67
|
displayedMonthsKeys: b,
|
|
68
68
|
changeType: P,
|
|
69
69
|
presetChanged: G,
|
|
@@ -73,38 +73,39 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
73
73
|
selectionChanged: j,
|
|
74
74
|
toggle: D,
|
|
75
75
|
isCompact: H
|
|
76
|
-
} = de(
|
|
76
|
+
} = de(w, B);
|
|
77
77
|
return Q(
|
|
78
|
-
() =>
|
|
78
|
+
() => w.datePresetList,
|
|
79
79
|
() => {
|
|
80
80
|
P("date", !1);
|
|
81
81
|
}
|
|
82
|
-
), (N,
|
|
82
|
+
), (N, u) => (n(), s("div", {
|
|
83
83
|
id: e(S),
|
|
84
84
|
ref_key: "datePicker",
|
|
85
85
|
ref: M,
|
|
86
86
|
class: r(["relative-wrap", { "date-range-disabled": t.disabled }]),
|
|
87
87
|
"data-testid": `${t.testId}-${e(o).WRAPPER}`
|
|
88
88
|
}, [
|
|
89
|
+
c(p(e(f)) + " ", 1),
|
|
89
90
|
d("div", {
|
|
90
91
|
class: "date-range-field",
|
|
91
92
|
"data-testid": `${t.testId}-${e(o).TRIGGER}`,
|
|
92
|
-
onClick:
|
|
93
|
+
onClick: u[0] || (u[0] = (a) => e(D)())
|
|
93
94
|
}, [
|
|
94
95
|
x(N.$slots, "field", {
|
|
95
96
|
currentDate: e(T),
|
|
96
|
-
isOpen: e(
|
|
97
|
+
isOpen: e(v)
|
|
97
98
|
}, () => [
|
|
98
99
|
i(e(te), {
|
|
99
100
|
label: e(T),
|
|
100
101
|
"start-icon-name": "calendar-blank",
|
|
101
102
|
variant: "outlined",
|
|
102
103
|
"test-id": `${t.testId}-${e(ae).INPUT}`,
|
|
103
|
-
open: e(
|
|
104
|
+
open: e(v)
|
|
104
105
|
}, null, 8, ["label", "test-id", "open"])
|
|
105
106
|
], !0)
|
|
106
107
|
], 8, se),
|
|
107
|
-
|
|
108
|
+
k(d("div", {
|
|
108
109
|
id: "datepickerPopup" + t.uniqueId,
|
|
109
110
|
ref_key: "popup",
|
|
110
111
|
ref: F,
|
|
@@ -116,14 +117,14 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
116
117
|
"data-testid": `${t.testId}-${e(o).CONTAINER}`
|
|
117
118
|
}, [
|
|
118
119
|
t.types.length > 1 ? (n(), s("div", oe, [
|
|
119
|
-
(n(!0), s(
|
|
120
|
+
(n(!0), s(C, null, $(t.types, (a) => (n(), s("span", {
|
|
120
121
|
key: a,
|
|
121
|
-
class: r(["range-type", { "selected-range-type": e(
|
|
122
|
-
onClick: (
|
|
122
|
+
class: r(["range-type", { "selected-range-type": e(h) === a }]),
|
|
123
|
+
onClick: (m) => e(P)(a, !0)
|
|
123
124
|
}, [
|
|
124
|
-
i(e(
|
|
125
|
+
i(e(y), { variant: "h1" }, {
|
|
125
126
|
default: l(() => [
|
|
126
|
-
|
|
127
|
+
c(p(e(_)[a]), 1)
|
|
127
128
|
]),
|
|
128
129
|
_: 2
|
|
129
130
|
}, 1024)
|
|
@@ -144,28 +145,28 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
144
145
|
d("ul", {
|
|
145
146
|
id: "customDropDownList" + t.uniqueId
|
|
146
147
|
}, [
|
|
147
|
-
(n(!0), s(
|
|
148
|
+
(n(!0), s(C, null, $(e(U), (a) => (n(), s("li", {
|
|
148
149
|
key: a.id,
|
|
149
150
|
class: r({
|
|
150
|
-
"selected-preset-container": e(
|
|
151
|
+
"selected-preset-container": e(f) === a.id
|
|
151
152
|
})
|
|
152
153
|
}, [
|
|
153
154
|
d("div", {
|
|
154
|
-
class: r([{ "selected-preset": e(
|
|
155
|
-
onClick: (
|
|
155
|
+
class: r([{ "selected-preset": e(f) === a.id }, "preset-element"]),
|
|
156
|
+
onClick: (m) => e(G)(a)
|
|
156
157
|
}, [
|
|
157
|
-
i(e(
|
|
158
|
+
i(e(y), {
|
|
158
159
|
variant: "body2",
|
|
159
160
|
"data-testid": `${t.testId}-${e(o).MENU}-${a.id}`
|
|
160
161
|
}, {
|
|
161
162
|
default: l(() => [
|
|
162
|
-
|
|
163
|
+
c(p(a.name), 1)
|
|
163
164
|
]),
|
|
164
165
|
_: 2
|
|
165
166
|
}, 1032, ["data-testid"])
|
|
166
167
|
], 10, me),
|
|
167
|
-
|
|
168
|
-
[
|
|
168
|
+
k(d("div", pe, null, 512), [
|
|
169
|
+
[I, a.id === "custom"]
|
|
169
170
|
])
|
|
170
171
|
], 2))), 128))
|
|
171
172
|
], 8, ue)
|
|
@@ -173,29 +174,29 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
173
174
|
d("div", {
|
|
174
175
|
class: "type-message",
|
|
175
176
|
"data-testid": `${t.testId}-${e(o).MESSAGE}`
|
|
176
|
-
},
|
|
177
|
+
}, p(e(ee)[e(h)]), 9, ye)
|
|
177
178
|
], 8, re)) : E("", !0),
|
|
178
179
|
d("div", {
|
|
179
180
|
class: "calendar-wrap",
|
|
180
181
|
style: X({ height: e(H) ? "336px" : "372px" })
|
|
181
182
|
}, [
|
|
182
183
|
d("div", ge, [
|
|
183
|
-
(n(!0), s(
|
|
184
|
+
(n(!0), s(C, null, $(e(b), (a, m) => (n(), s("div", { key: a }, [
|
|
184
185
|
i(Z, {
|
|
185
186
|
id: t.uniqueId,
|
|
186
187
|
navigation: e(W)(
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
m === 0,
|
|
189
|
+
m === e(b).length - 1
|
|
189
190
|
),
|
|
190
|
-
year: e(
|
|
191
|
-
days: e(
|
|
192
|
-
weeks: e(
|
|
193
|
-
month: e(
|
|
191
|
+
year: e(g)[a].parsedMonth.year,
|
|
192
|
+
days: e(g)[a].parsedMonth.days,
|
|
193
|
+
weeks: e(g)[a].parsedMonth.weeks,
|
|
194
|
+
month: e(g)[a].parsedMonth.month,
|
|
194
195
|
range: e(L),
|
|
195
|
-
type: e(
|
|
196
|
+
type: e(h),
|
|
196
197
|
"allowed-days": t.allowedDays,
|
|
197
198
|
"max-allowed-date": e(q),
|
|
198
|
-
"test-id": `${t.testId}-${
|
|
199
|
+
"test-id": `${t.testId}-${m}`,
|
|
199
200
|
onSelectionChanged: e(j),
|
|
200
201
|
onNavigation: e(Y)
|
|
201
202
|
}, null, 8, ["id", "navigation", "year", "days", "weeks", "month", "range", "type", "allowed-days", "max-allowed-date", "test-id", "onSelectionChanged", "onNavigation"])
|
|
@@ -205,17 +206,17 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
205
206
|
x(N.$slots, "footer", {}, void 0, !0)
|
|
206
207
|
]),
|
|
207
208
|
d("div", ve, [
|
|
208
|
-
i(e(
|
|
209
|
+
i(e(y), { variant: "body2" }, {
|
|
209
210
|
default: l(() => [
|
|
210
|
-
|
|
211
|
+
c("All dates are in UTC")
|
|
211
212
|
]),
|
|
212
213
|
_: 1
|
|
213
214
|
})
|
|
214
215
|
]),
|
|
215
|
-
|
|
216
|
-
[
|
|
216
|
+
k(d("div", { class: "error" }, p(e(z)), 513), [
|
|
217
|
+
[I, e(O)]
|
|
217
218
|
]),
|
|
218
|
-
|
|
219
|
+
u[1] || (R(-1), u[1] = d("div", { class: "buttons" }, [
|
|
219
220
|
i(e(A), {
|
|
220
221
|
id: "button-ok" + t.uniqueId,
|
|
221
222
|
size: "small",
|
|
@@ -225,9 +226,9 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
225
226
|
onClick: (a) => e(K)()
|
|
226
227
|
}, {
|
|
227
228
|
default: l(() => [
|
|
228
|
-
i(e(
|
|
229
|
+
i(e(y), { variant: "button" }, {
|
|
229
230
|
default: l(() => [
|
|
230
|
-
|
|
231
|
+
c("Apply")
|
|
231
232
|
]),
|
|
232
233
|
_: 1
|
|
233
234
|
})
|
|
@@ -245,22 +246,22 @@ const ne = ["id", "data-testid"], se = ["data-testid"], ie = ["id", "data-testid
|
|
|
245
246
|
onClick: (a) => e(D)()
|
|
246
247
|
}, {
|
|
247
248
|
default: l(() => [
|
|
248
|
-
i(e(
|
|
249
|
+
i(e(y), { variant: "button" }, {
|
|
249
250
|
default: l(() => [
|
|
250
|
-
|
|
251
|
+
c(" Cancel ")
|
|
251
252
|
]),
|
|
252
253
|
_: 1
|
|
253
254
|
})
|
|
254
255
|
]),
|
|
255
256
|
_: 1
|
|
256
257
|
}, 8, ["id", "data-testid", "onClick"])
|
|
257
|
-
]), R(1),
|
|
258
|
+
]), R(1), u[1])
|
|
258
259
|
])
|
|
259
260
|
])
|
|
260
261
|
], 4)
|
|
261
262
|
], 2)
|
|
262
263
|
], 10, ie), [
|
|
263
|
-
[
|
|
264
|
+
[I, e(v)]
|
|
264
265
|
])
|
|
265
266
|
], 10, ne));
|
|
266
267
|
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './AutocompleteDropdown.vue_vue_type_style_index_0_scoped_214ddaf4_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
|
-
.label[data-v-a849128a]{color:#41454d}.pop-up[data-v-a849128a]{width:668px;position:absolute;z-index:1000;top:32px;left:1px;overflow:hidden;border-radius:8px;border:1px solid var(--common-divider, #e4e4e4);background:var(--background-modelElevation, #fff);box-shadow:var(--elevation-lg)}.pop-up.open-on-top[data-v-a849128a]{top:0}.pop-up.hide-presets[data-v-a849128a],.pop-up.hide-presets .calendar-wrap[data-v-a849128a]{width:520px}.pop-up.hide-presets .date-picker-calendar[data-v-a849128a]{padding:15px 16px}.pop-up .date-picker-menu[data-v-a849128a]{width:164px;background:#ffffff;vertical-align:top;border-right:1px solid var(--common-divider-elevation-0, #e4e4e4);background:var(--background-paper, #fcfcfc)}.pop-up .date-picker-menu .preset-element[data-v-a849128a]{padding-left:8px;height:32px;border-radius:8px;color:var(--text-primary, #202020);line-height:32px}.pop-up .date-picker-menu .preset-element[data-v-a849128a]:hover{background:var(--action-hover, rgba(0, 0, 0, .05))}.pop-up .date-picker-menu .selected-preset[data-v-a849128a]{border-radius:8px;background:var(--action-selected, #ebebeb)}.pop-up .date-picker-menu li[data-v-a849128a]{cursor:pointer;margin-bottom:2px}.pop-up .left-box[data-v-a849128a]{left:-1px}.pop-up .date-picker-calendar[data-v-a849128a]{box-sizing:border-box;height:100%;padding:16px;display:grid;grid-template-columns:1fr 1fr;grid-gap:24px}.pop-up .calendars-wrapper[data-v-a849128a]{padding-left:6px}.pop-up .preset-dropdown ul[data-v-a849128a]{list-style:none;margin:0;padding:8px;line-height:32px}.pop-up .buttons-cover[data-v-a849128a]{height:48px;position:absolute;bottom:0;width:100%;right:0;box-sizing:border-box;border-top:1px solid var(--common-divider-elevation-0, #e4e4e4);background:var(--background-modelElevation, #fff);align-items:center;display:flex;justify-content:space-between;padding:12px 16px}.pop-up .buttons-cover .text-container[data-v-a849128a]{flex:1;color:var(--text-secondary, #646464)}.pop-up button[data-v-a849128a]{float:right;margin-left:8px}.pop-up .error[data-v-a849128a]{display:none;position:absolute;left:270px;top:22px}.pop-up .inline-block[data-v-a849128a]{display:inline-block}.pop-up.right[data-v-a849128a]{left:initial;right:1px}.calendar-wrap[data-v-a849128a]{width:504px;height:372px;position:relative;border-bottom-right-radius:8px;border-top-right-radius:8px;vertical-align:top}.type-picker[data-v-a849128a]{height:60px;line-height:60px;padding-left:15px;box-shadow:0 1px 3px #0000003b}.range-type[data-v-a849128a]{color:#8e959d;padding-left:15px;padding-right:15px;cursor:pointer}.selected-range-type[data-v-a849128a]{color:#fff;background-color:#3083ff;border-radius:20px;padding:6px 15px;cursor:default}.date-range-field[data-v-a849128a]{display:inline-block;width:100%;height:28px;position:relative;cursor:pointer;border-radius:3px}.date-range-field.selected-item-as-title[data-v-a849128a]{left:0;border:none;background-image:none;max-width:100%;height:22px;color:#3083ff;overflow:visible}.date-range-field.selected-item-as-title .small-triangle[data-v-a849128a]{right:-25px}.date-range-field.selected-item-as-title .small-triangle[data-v-a849128a]:after{border-top-color:currentColor}.date-range-field.selected-item-as-title span[data-v-a849128a]{padding-left:12px}.date-range-field.no-button-limit[data-v-a849128a]{overflow:visible}.date-range-field.no-button-limit span[data-v-a849128a]{width:100%;line-height:22px}.date-range-field span[data-v-a849128a]{line-height:26px;padding-left:15px;overflow:hidden;text-overflow:ellipsis;display:inline-block;width:calc(100% - 26px);white-space:nowrap;position:relative}.date-range-disabled .date-range-field[data-v-a849128a]{cursor:default;color:#8e959d;pointer-events:none}.date-range-disabled .small-triangle[data-v-a849128a]:after{border-top-color:#8e959d}.pop-up-content[data-v-a849128a]{margin-top:1px}.type-message[data-v-a849128a]{color:#8e959d;padding:10px 20px;line-height:1.5}.relative-wrap[data-v-a849128a]{position:relative}.space-right[data-v-a849128a]{margin-right:13px}.space-left[data-v-a849128a]{margin-left:9px}.top-date[data-v-a849128a]{line-height:13px}.flex[data-v-a849128a]{display:flex}
|