@ironsource/shared-ui 2.1.6-test.1 → 2.1.6-test.12
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/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_39c47ad1_lang.css +1 -0
- package/AppHeader.vue_vue_type_style_index_0_scoped_538ccdc6_lang.css +1 -0
- package/Autocomplete.vue_vue_type_style_index_0_scoped_a7bfd237_lang.css +1 -0
- package/CalendarMonth.vue_vue_type_style_index_0_scoped_acd3440c_lang.css +1 -0
- package/CalendarMonthV4.vue_vue_type_style_index_0_scoped_b0d3ea50_lang.css +1 -0
- package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_a8fdae89_lang.css +1 -0
- package/DataGrid.vue_vue_type_style_index_0_scoped_6df3b70f_lang.css +1 -0
- package/DatePicker.vue_vue_type_style_index_0_scoped_67b44cbe_lang.css +1 -0
- package/DatePickerMonth.vue_vue_type_style_index_0_scoped_929d3028_lang.css +1 -0
- package/DatePickerMonthV4.vue_vue_type_style_index_0_scoped_11288104_lang.css +1 -0
- package/DatePickerV4.vue_vue_type_style_index_0_scoped_be93e5a9_lang.css +1 -0
- package/DateRange.vue_vue_type_style_index_0_scoped_70e316e9_lang.css +1 -0
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_f6d9f41d_lang.css +1 -0
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_ad524750_lang.css +1 -0
- package/DialogV4.vue_vue_type_style_index_0_scoped_09c488cf_lang.css +1 -0
- package/Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_0363db63_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_1_lang.css +1 -1
- package/FieldLabel.vue_vue_type_style_index_0_scoped_96ee1c98_lang.css +1 -0
- package/{FormCard.vue_vue_type_style_index_0_scoped_ef8b4e81_lang.css → FormCard.vue_vue_type_style_index_0_scoped_52ade67c_lang.css} +1 -1
- package/InlineCopy.vue_vue_type_style_index_0_scoped_6a7b3795_lang.css +1 -0
- package/MultiBar.vue_vue_type_style_index_0_scoped_71617643_lang.css +1 -0
- package/OptionV4.vue_vue_type_style_index_0_scoped_e0c24b6a_lang.css +1 -0
- package/TextAreaV4.vue_vue_type_style_index_0_scoped_8199b662_lang.css +1 -0
- package/TextField.vue_vue_type_style_index_0_scoped_a6457440_lang.css +1 -0
- package/TooltipV4.vue_vue_type_style_index_0_scoped_fcdb9d02_lang.css +1 -0
- package/components/appHeader/AppHeader.vue.d.ts +6 -2
- package/components/appHeader/AppHeader.vue.js +2 -2
- package/components/appHeader/AppHeader.vue2.js +30 -28
- package/components/appHeader/index.d.ts +6 -2
- package/components/autocomplete/Autocomplete.vue.d.ts +5 -0
- package/components/autocomplete/Autocomplete.vue.js +3 -3
- package/components/autocomplete/Autocomplete.vue2.js +82 -61
- package/components/autocomplete/index.d.ts +20 -1
- package/components/datePicker/common/DatePicker.common.d.ts +11 -0
- package/components/datePicker/common/DatePicker.common.js +52 -0
- package/components/datePicker/common/DatePickerMonth.common.d.ts +85 -0
- package/components/datePicker/common/DatePickerMonth.common.js +66 -0
- package/components/datePicker/{DatePicker.vue.d.ts → v3/DatePicker.vue.d.ts} +1 -1
- package/components/datePicker/v3/DatePicker.vue.js +7 -0
- package/components/datePicker/v3/DatePicker.vue2.js +69 -0
- package/components/datePicker/v3/DatePickerMonth.vue.js +7 -0
- package/components/datePicker/v3/DatePickerMonth.vue2.js +40 -0
- package/components/datePicker/{index.d.ts → v3/index.d.ts} +3 -3
- package/components/datePicker/v4/DatePickerMonthV4.vue.d.ts +53 -0
- package/components/datePicker/v4/DatePickerMonthV4.vue.js +7 -0
- package/components/datePicker/v4/DatePickerMonthV4.vue2.js +40 -0
- package/components/datePicker/v4/DatePickerV4.vue.d.ts +67 -0
- package/components/datePicker/v4/DatePickerV4.vue.js +7 -0
- package/components/datePicker/v4/DatePickerV4.vue2.js +73 -0
- package/components/datePicker/v4/index.d.ts +184 -0
- package/components/datePicker/v4/index.js +6 -0
- package/components/dateRange/common/CalendarMonth.common.d.ts +17 -0
- package/components/dateRange/common/CalendarMonth.common.js +131 -0
- package/components/dateRange/common/DateRange.common.d.ts +47 -0
- package/components/dateRange/common/DateRange.common.js +265 -0
- package/components/dateRange/common/DateRangePicker.common.d.ts +3 -0
- package/components/dateRange/{DateServices.d.ts → common/DateServices.common.d.ts} +1 -0
- package/components/dateRange/common/DateServices.common.js +248 -0
- package/components/dateRange/{consts.js → common/consts.common.js} +5 -9
- package/components/dateRange/{CalendarMonth.vue.d.ts → v3/CalendarMonth.vue.d.ts} +1 -1
- package/components/dateRange/v3/CalendarMonth.vue.js +7 -0
- package/components/dateRange/v3/CalendarMonth.vue2.js +147 -0
- package/components/dateRange/{DateRange.vue.d.ts → v3/DateRange.vue.d.ts} +9 -9
- package/components/dateRange/v3/DateRange.vue.js +7 -0
- package/components/dateRange/v3/DateRange.vue2.js +226 -0
- package/components/dateRange/{DateRangePicker.vue.d.ts → v3/DateRangePicker.vue.d.ts} +9 -9
- package/components/dateRange/{index.d.ts → v3/index.d.ts} +21 -21
- package/components/dateRange/v4/CalendarMonthV4.vue.d.ts +75 -0
- package/components/dateRange/v4/CalendarMonthV4.vue.js +7 -0
- package/components/dateRange/v4/CalendarMonthV4.vue2.js +132 -0
- package/components/dateRange/v4/DateRangePickerV4.vue.d.ts +115 -0
- package/components/dateRange/v4/DateRangeV4.vue.d.ts +127 -0
- package/components/dateRange/v4/DateRangeV4.vue.js +7 -0
- package/components/dateRange/v4/DateRangeV4.vue2.js +262 -0
- package/components/dateRange/v4/index.d.ts +408 -0
- package/components/dateRange/v4/index.js +6 -0
- package/components/dialog/v4/DialogV4.vue.js +3 -3
- package/components/dialog/v4/DialogV4.vue2.js +67 -62
- package/components/dropdown/common/Dropdown.common.js +21 -21
- package/components/dropdown/v3/Dropdown.vue.d.ts +4 -0
- package/components/dropdown/v3/Dropdown.vue.js +4 -4
- package/components/dropdown/v3/Dropdown.vue2.js +32 -32
- package/components/dropdown/v3/index.d.ts +13 -1
- package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +2 -0
- package/components/dropdown/v4/AppDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/AppDropdownTrigger.vue2.js +16 -16
- package/components/dropdown/v4/ChipDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +1 -1
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +40 -49
- package/components/dropdown/v4/DropdownV4.vue.d.ts +16 -0
- package/components/dropdown/v4/DropdownV4.vue.js +3 -3
- package/components/dropdown/v4/DropdownV4.vue2.js +140 -128
- package/components/dropdown/v4/OptionV4.vue.d.ts +11 -0
- package/components/dropdown/v4/OptionV4.vue.js +3 -3
- package/components/dropdown/v4/OptionV4.vue2.js +61 -44
- package/components/dropdown/v4/index.d.ts +105 -4
- package/components/filtersPanel/v3/Filter.d.ts +1 -1
- package/components/forms/FormCard.vue.js +2 -2
- package/components/forms/FormCard.vue2.js +9 -9
- package/components/inlineCopy/InlineCopy.vue.d.ts +6 -2
- package/components/inlineCopy/InlineCopy.vue.js +3 -3
- package/components/inlineCopy/InlineCopy.vue2.js +23 -22
- package/components/inlineCopy/index.d.ts +6 -2
- package/components/input/v4/TextField.vue.d.ts +5 -0
- package/components/input/v4/TextField.vue.js +2 -2
- package/components/input/v4/TextField.vue2.js +43 -43
- package/components/input/v4/index.d.ts +20 -1
- package/components/multibar/MultiBar.vue.js +3 -3
- package/components/multibar/MultiBar.vue2.js +21 -21
- package/components/shared/FieldLabel.vue.js +3 -3
- package/components/shared/FieldLabel.vue2.js +9 -9
- package/components/table/v4/DataGrid.vue.d.ts +4 -0
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +147 -147
- package/components/table/v4/index.d.ts +14 -2
- package/components/textArea/v4/TextAreaV4.vue.js +3 -3
- package/components/textArea/v4/TextAreaV4.vue2.js +1 -1
- package/components/tooltip/v4/TooltipV4.vue.d.ts +6 -2
- package/components/tooltip/v4/TooltipV4.vue.js +2 -2
- package/components/tooltip/v4/TooltipV4.vue2.js +21 -19
- package/components/tooltip/v4/index.d.ts +17 -5
- package/index.d.ts +1512 -34
- package/index.js +116 -116
- package/package.json +13 -6
- package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_0267d003_lang.css +0 -1
- package/AppHeader.vue_vue_type_style_index_0_scoped_c148fc7a_lang.css +0 -1
- package/Autocomplete.vue_vue_type_style_index_0_scoped_d2d1dc1d_lang.css +0 -1
- package/CalendarMonth.vue_vue_type_style_index_0_scoped_b2206adb_lang.css +0 -1
- package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_889042cf_lang.css +0 -1
- package/DataGrid.vue_vue_type_style_index_0_scoped_c96fba2c_lang.css +0 -1
- package/DatePicker.vue_vue_type_style_index_0_scoped_e108ef3b_lang.css +0 -1
- package/DatePickerMonth.vue_vue_type_style_index_0_scoped_b171cdab_lang.css +0 -1
- package/DateRange.vue_vue_type_style_index_0_scoped_eb5d155e_lang.css +0 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_c3033d90_lang.css +0 -1
- package/DialogV4.vue_vue_type_style_index_0_scoped_c3004ba3_lang.css +0 -1
- package/Dropdown.vue_vue_type_style_index_0_scoped_d4f8e790_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_bf8e7ff5_lang.css +0 -1
- package/FieldLabel.vue_vue_type_style_index_0_scoped_72ab1f25_lang.css +0 -1
- package/InlineCopy.vue_vue_type_style_index_0_scoped_ff9f4a0f_lang.css +0 -1
- package/MultiBar.vue_vue_type_style_index_0_scoped_b473b35e_lang.css +0 -1
- package/OptionV4.vue_vue_type_style_index_0_scoped_b8375219_lang.css +0 -1
- package/TextAreaV4.vue_vue_type_style_index_0_scoped_0336a92f_lang.css +0 -1
- package/TextField.vue_vue_type_style_index_0_scoped_01778240_lang.css +0 -1
- package/TooltipV4.vue_vue_type_style_index_0_scoped_25809092_lang.css +0 -1
- package/components/datePicker/DatePicker.vue.js +0 -7
- package/components/datePicker/DatePicker.vue2.js +0 -97
- package/components/datePicker/DatePickerMonth.vue.js +0 -7
- package/components/datePicker/DatePickerMonth.vue2.js +0 -85
- package/components/dateRange/CalendarMonth.vue.js +0 -7
- package/components/dateRange/CalendarMonth.vue2.js +0 -244
- package/components/dateRange/DateRange.vue.js +0 -7
- package/components/dateRange/DateRange.vue2.js +0 -417
- package/components/dateRange/DateServices.js +0 -245
- /package/components/datePicker/{DatePickerMonth.vue.d.ts → v3/DatePickerMonth.vue.d.ts} +0 -0
- /package/components/datePicker/{index.js → v3/index.js} +0 -0
- /package/components/dateRange/{consts.d.ts → common/consts.common.d.ts} +0 -0
- /package/components/dateRange/{index.js → v3/index.js} +0 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { onClickOutside as ie } from "@vueuse/core";
|
|
2
|
+
import { useToggle as fe } from "../../../composables/useToggle.js";
|
|
3
|
+
import { ref as r, computed as b, onMounted as ce, onBeforeMount as de, onUnmounted as ve, watch as Q } from "vue";
|
|
4
|
+
import { min as me, addDays as ge, format as X } from "date-fns";
|
|
5
|
+
import { presetsList as he, formatError as De, mandatoryValuesError as Me, navigatePrev as Z, navigateNext as V } from "./consts.common.js";
|
|
6
|
+
import m from "./DateServices.common.js";
|
|
7
|
+
const Te = (o, y) => {
|
|
8
|
+
const N = r(null), c = r({ started: !1, date: null }), x = r(!1), _ = 2, S = r({ from: null, to: null }), s = r({}), g = r([]), k = r(null), f = r({}), T = r({}), w = r(!1), P = r(null), u = r(null), j = r("left"), p = r(null), O = r(null), E = r([]), K = r(null), [h] = fe({ initialValue: !1 }), q = r(null);
|
|
9
|
+
ie(q, () => {
|
|
10
|
+
h.value = !1;
|
|
11
|
+
});
|
|
12
|
+
const L = (e, t) => {
|
|
13
|
+
const a = {
|
|
14
|
+
weeks: [],
|
|
15
|
+
days: {},
|
|
16
|
+
month: e,
|
|
17
|
+
year: t
|
|
18
|
+
};
|
|
19
|
+
let n, l;
|
|
20
|
+
const d = new Date(t, e, 1).getDay();
|
|
21
|
+
let v = 1;
|
|
22
|
+
const i = /* @__PURE__ */ new Date();
|
|
23
|
+
i.setHours(0, 0, 0, 0);
|
|
24
|
+
const se = m.daysInMonth(e, t);
|
|
25
|
+
for (let I = 0; I < 6; I++) {
|
|
26
|
+
l = [];
|
|
27
|
+
for (let H = 0; H < 7; H++)
|
|
28
|
+
n = {}, I === 0 && d > 0 && H < d && (n.value = 0), v > se && (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), i < n.date ? n.isFuture = !0 : n.date.getTime() === i.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
|
|
29
|
+
a.weeks.push(l);
|
|
30
|
+
}
|
|
31
|
+
return a;
|
|
32
|
+
}, C = () => {
|
|
33
|
+
let e = m.getCurrentTimeUTC();
|
|
34
|
+
if (u.value && u.value.toEnd ? e = u.value.toEnd : o.range && o.range.to && (e = o.range.to), !s.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
|
|
35
|
+
s.value = {}, g.value = [];
|
|
36
|
+
for (let t = 0; t < _; t++) {
|
|
37
|
+
const a = new Date(e);
|
|
38
|
+
a.setDate(1), a.setMonth(e.getMonth() - t);
|
|
39
|
+
const n = `${a.getFullYear().toString()}_${a.getMonth().toString()}`;
|
|
40
|
+
s.value[n] = {
|
|
41
|
+
parsedMonth: L(
|
|
42
|
+
a.getMonth(),
|
|
43
|
+
a.getFullYear()
|
|
44
|
+
),
|
|
45
|
+
order: t
|
|
46
|
+
}, g.value.unshift(n);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, z = (e, t) => {
|
|
50
|
+
P.value = e;
|
|
51
|
+
let a = e;
|
|
52
|
+
e === "date" && (a = o.datePresetList), E.value = he[a], t && (u.value = {
|
|
53
|
+
fromStart: null,
|
|
54
|
+
fromEnd: null,
|
|
55
|
+
toStart: null,
|
|
56
|
+
toEnd: null
|
|
57
|
+
}, S.value.from = "", S.value.to = "", c.value = { started: !1, date: null }, f.value = "custom"), y("rangeTypeChanged", P.value);
|
|
58
|
+
}, ee = (e) => {
|
|
59
|
+
f.value = e.id, D(k.value[e.id].dates()), C();
|
|
60
|
+
}, D = (e, t = !1) => {
|
|
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), w.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (O.value = De, w.value = !0, !1) : a.from > a.to ? (O.value = `"From" date can't be bigger than "To" date`, w.value = !0, !1) : (u.value = R(a), S.value.from = X(
|
|
63
|
+
u.value.fromStart,
|
|
64
|
+
o.dateFormat
|
|
65
|
+
), S.value.to = X(u.value.toEnd, o.dateFormat), !0);
|
|
66
|
+
}, F = () => {
|
|
67
|
+
f.value === "custom" ? p.value = m.getDateRangeString(u.value) : p.value = J.value, y("currentDateChanged", p.value);
|
|
68
|
+
}, te = () => {
|
|
69
|
+
if (u.value.fromStart == null || u.value.toEnd == null) {
|
|
70
|
+
w.value = !0, O.value = Me;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const e = m.getCurrentTimeUTC();
|
|
74
|
+
u.value.toEnd > e && (u.value.toEnd = e), F(), T.value = f.value, y("rangeChanged", {
|
|
75
|
+
from: u.value.fromStart,
|
|
76
|
+
to: u.value.toEnd,
|
|
77
|
+
preset: T.value
|
|
78
|
+
}), W(!1);
|
|
79
|
+
}, ae = (e, t) => e ? Z : t ? V : null, ne = (e) => {
|
|
80
|
+
let t = null, a = null;
|
|
81
|
+
const n = _ - 1;
|
|
82
|
+
let l = "", M = null, d = null;
|
|
83
|
+
switch (e) {
|
|
84
|
+
case V:
|
|
85
|
+
Object.keys(s.value).forEach((v) => {
|
|
86
|
+
const i = s.value[v];
|
|
87
|
+
i.order === 0 && (M = i), i.order === n ? (g.value.splice(
|
|
88
|
+
g.value.indexOf(v),
|
|
89
|
+
1
|
|
90
|
+
), delete s.value[v]) : i.order += 1;
|
|
91
|
+
}), t = M.parsedMonth.month + 1, a = M.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, s.value[l] = {
|
|
92
|
+
parsedMonth: L(t, a),
|
|
93
|
+
order: 0
|
|
94
|
+
}, g.value.push(l);
|
|
95
|
+
break;
|
|
96
|
+
case Z:
|
|
97
|
+
Object.keys(s.value).forEach((v) => {
|
|
98
|
+
const i = s.value[v];
|
|
99
|
+
i.order === n && (d = i), i.order === 0 ? (g.value.splice(
|
|
100
|
+
g.value.indexOf(v),
|
|
101
|
+
1
|
|
102
|
+
), delete s.value[v]) : i.order -= 1;
|
|
103
|
+
}), t = d.parsedMonth.month - 1, a = d.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, s.value[l] = {
|
|
104
|
+
parsedMonth: L(t, a),
|
|
105
|
+
order: n
|
|
106
|
+
}, g.value.unshift(l);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}, R = (e) => {
|
|
110
|
+
let t;
|
|
111
|
+
switch (P.value) {
|
|
112
|
+
case "week":
|
|
113
|
+
t = {
|
|
114
|
+
fromStart: m.getFirstDayOfWeek(e.from),
|
|
115
|
+
fromEnd: m.getLastDayOfWeek(e.from),
|
|
116
|
+
toStart: m.getFirstDayOfWeek(e.to),
|
|
117
|
+
toEnd: m.getLastDayOfWeek(e.to)
|
|
118
|
+
};
|
|
119
|
+
break;
|
|
120
|
+
case "month":
|
|
121
|
+
t = {
|
|
122
|
+
fromStart: new Date(
|
|
123
|
+
e.from.getFullYear(),
|
|
124
|
+
e.from.getMonth(),
|
|
125
|
+
1
|
|
126
|
+
),
|
|
127
|
+
fromEnd: m.getLastDayOfMonth(e.from),
|
|
128
|
+
toStart: new Date(
|
|
129
|
+
e.to.getFullYear(),
|
|
130
|
+
e.to.getMonth(),
|
|
131
|
+
1
|
|
132
|
+
),
|
|
133
|
+
toEnd: m.getLastDayOfMonth(e.to)
|
|
134
|
+
};
|
|
135
|
+
break;
|
|
136
|
+
case "date":
|
|
137
|
+
default:
|
|
138
|
+
t = {
|
|
139
|
+
fromStart: e.from,
|
|
140
|
+
fromEnd: e.from,
|
|
141
|
+
toStart: e.to,
|
|
142
|
+
toEnd: e.to
|
|
143
|
+
};
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
return t;
|
|
147
|
+
}, U = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), $ = (e) => {
|
|
148
|
+
let t = !1;
|
|
149
|
+
const a = {
|
|
150
|
+
from: new Date(e.from),
|
|
151
|
+
to: new Date(e.to)
|
|
152
|
+
};
|
|
153
|
+
a.from.setHours(0, 0, 0, 0), a.to.setHours(0, 0, 0, 0);
|
|
154
|
+
const n = E.value.map((l) => l.id);
|
|
155
|
+
if (Object.keys(k.value).forEach((l) => {
|
|
156
|
+
const M = k.value[l];
|
|
157
|
+
if (l !== "custom" && !t && n.indexOf(l) !== -1) {
|
|
158
|
+
const d = M.dates();
|
|
159
|
+
d.from.setHours(0, 0, 0, 0), d.to.setHours(0, 0, 0, 0), U(d.from, a.from) && U(d.to, a.to) && (f.value = l, t = !0);
|
|
160
|
+
}
|
|
161
|
+
}), t) {
|
|
162
|
+
const l = E.value.find(
|
|
163
|
+
(M) => M.id === f.value
|
|
164
|
+
);
|
|
165
|
+
y("dateRangePresetNameChanged", l.name);
|
|
166
|
+
} else
|
|
167
|
+
y("dateRangePresetNameChanged", null), f.value = "custom";
|
|
168
|
+
T.value = f.value;
|
|
169
|
+
}, A = (e, t, a) => {
|
|
170
|
+
if (!c.value.started)
|
|
171
|
+
f.value = "custom", c.value.started = !0, c.value.date = new Date(a, t, e.value), D(
|
|
172
|
+
{ from: c.value.date, to: c.value.date },
|
|
173
|
+
!0
|
|
174
|
+
);
|
|
175
|
+
else {
|
|
176
|
+
const n = new Date(a, t, e.value), l = c.value.date;
|
|
177
|
+
c.value.started = !1, c.value.date = null, n < l ? A(e, t, a) : D({ from: l, to: n });
|
|
178
|
+
}
|
|
179
|
+
}, B = () => {
|
|
180
|
+
const e = N.value.offsetLeft;
|
|
181
|
+
return window.innerWidth - e > 930 ? "left" : "right";
|
|
182
|
+
}, W = (e = !0) => {
|
|
183
|
+
h.value = !h.value, h.value ? (j.value = B(), D(o.range), C(), y("opened")) : (D(o.range), C(), f.value = T.value, e && y("dismissed"));
|
|
184
|
+
}, G = () => {
|
|
185
|
+
h.value && W();
|
|
186
|
+
}, le = () => {
|
|
187
|
+
k.value = m.getPresetsFunctions(o.includeToday), k.value.custom = {
|
|
188
|
+
dates: () => o.range
|
|
189
|
+
};
|
|
190
|
+
}, oe = b(() => (g.value || []).reduce((e, t) => {
|
|
191
|
+
const n = s.value[t].parsedMonth.weeks[s.value[t].parsedMonth.weeks.length - 1].filter(
|
|
192
|
+
(l) => l.value !== 0
|
|
193
|
+
).length;
|
|
194
|
+
return e && !n;
|
|
195
|
+
}, !0)), Y = () => {
|
|
196
|
+
o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), D(o.range), C(), F());
|
|
197
|
+
};
|
|
198
|
+
ce(() => {
|
|
199
|
+
Y();
|
|
200
|
+
}), de(() => {
|
|
201
|
+
const e = (t) => {
|
|
202
|
+
t.key === "Escape" && h.value && G();
|
|
203
|
+
};
|
|
204
|
+
document.addEventListener("keyup", e), ve(() => {
|
|
205
|
+
document.removeEventListener("keyup", e);
|
|
206
|
+
});
|
|
207
|
+
}), Q(
|
|
208
|
+
() => o.range,
|
|
209
|
+
(e, t) => {
|
|
210
|
+
e && e !== t && (x.value ? ($(e), D(e), F()) : Y());
|
|
211
|
+
}
|
|
212
|
+
), Q(h, (e) => {
|
|
213
|
+
e || (c.value.started = !1);
|
|
214
|
+
});
|
|
215
|
+
const J = b(() => {
|
|
216
|
+
const e = E.value.find(
|
|
217
|
+
(t) => t.id === f.value
|
|
218
|
+
);
|
|
219
|
+
return e ? e.name : "";
|
|
220
|
+
}), re = b(() => `datepicker${o.uniqueId}`), ue = b(() => {
|
|
221
|
+
const e = [o.maxDate, K.value].filter((t) => t);
|
|
222
|
+
return e.length ? me(e) : null;
|
|
223
|
+
});
|
|
224
|
+
return {
|
|
225
|
+
datePicker: N,
|
|
226
|
+
datePickerId: re,
|
|
227
|
+
getMaxAllowedDate: ue,
|
|
228
|
+
selectedPresetName: J,
|
|
229
|
+
selectedPreset: f,
|
|
230
|
+
displayError: w,
|
|
231
|
+
rangeType: P,
|
|
232
|
+
selectedRange: u,
|
|
233
|
+
placement: j,
|
|
234
|
+
currentDate: p,
|
|
235
|
+
error: O,
|
|
236
|
+
presets: E,
|
|
237
|
+
isOpen: h,
|
|
238
|
+
popup: q,
|
|
239
|
+
selectionStart: c,
|
|
240
|
+
initialized: x,
|
|
241
|
+
textDates: S,
|
|
242
|
+
currentMonths: s,
|
|
243
|
+
displayedMonthsKeys: g,
|
|
244
|
+
initMonths: C,
|
|
245
|
+
changeType: z,
|
|
246
|
+
presetChanged: ee,
|
|
247
|
+
initRange: D,
|
|
248
|
+
setCurrentDate: F,
|
|
249
|
+
apply: te,
|
|
250
|
+
getNavigation: ae,
|
|
251
|
+
navigationCallback: ne,
|
|
252
|
+
getSelectedRangeByType: R,
|
|
253
|
+
compareDates: U,
|
|
254
|
+
determinePreset: $,
|
|
255
|
+
selectionChanged: A,
|
|
256
|
+
checkPlacement: B,
|
|
257
|
+
toggle: W,
|
|
258
|
+
closeDatePicker: G,
|
|
259
|
+
isCompact: oe,
|
|
260
|
+
init: Y
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
export {
|
|
264
|
+
Te as dateRangeCommon
|
|
265
|
+
};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { isSameDay as C, format as l } from "date-fns";
|
|
2
|
+
const m = "MMM d, yyyy", u = 7;
|
|
3
|
+
class c {
|
|
4
|
+
// eslint-disable-next-line class-methods-use-this
|
|
5
|
+
getCurrentTimeUTC() {
|
|
6
|
+
const n = /* @__PURE__ */ new Date();
|
|
7
|
+
return new Date(n.getTime() + n.getTimezoneOffset() * 6e4);
|
|
8
|
+
}
|
|
9
|
+
// eslint-disable-next-line class-methods-use-this
|
|
10
|
+
daysInMonth(n, a) {
|
|
11
|
+
return 32 - new Date(a, n, 32).getDate();
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line consistent-return
|
|
14
|
+
getDateRangeString(n) {
|
|
15
|
+
if (C(n.fromStart, n.toEnd))
|
|
16
|
+
return l(n.fromStart, m);
|
|
17
|
+
if (n.fromStart && n.toEnd)
|
|
18
|
+
return `${l(n.fromStart, m)} - ${l(
|
|
19
|
+
n.toEnd,
|
|
20
|
+
m
|
|
21
|
+
)}`;
|
|
22
|
+
}
|
|
23
|
+
// eslint-disable-next-line class-methods-use-this
|
|
24
|
+
getFirstDayOfWeek(n) {
|
|
25
|
+
const a = new Date(n), r = a.getDay(), s = a.getDate() - r;
|
|
26
|
+
return a.setDate(s), a;
|
|
27
|
+
}
|
|
28
|
+
getLastDayOfWeek(n) {
|
|
29
|
+
let a = new Date(n);
|
|
30
|
+
const r = a.getDay(), s = a.getDate() + (6 - r);
|
|
31
|
+
a.setDate(s);
|
|
32
|
+
const t = this.getCurrentTimeUTC();
|
|
33
|
+
return a > t && (a = t), a;
|
|
34
|
+
}
|
|
35
|
+
getLastDayOfMonth(n) {
|
|
36
|
+
const a = this.getCurrentTimeUTC();
|
|
37
|
+
let r = new Date(n.getFullYear(), n.getMonth() + 1, 0);
|
|
38
|
+
return r > a && (r = a), r;
|
|
39
|
+
}
|
|
40
|
+
createMonth(n, a, r = !0, e = !0) {
|
|
41
|
+
const s = {
|
|
42
|
+
weeks: [],
|
|
43
|
+
days: {},
|
|
44
|
+
month: n,
|
|
45
|
+
year: a
|
|
46
|
+
};
|
|
47
|
+
let t, o;
|
|
48
|
+
const T = new Date(a, n, 1).getDay();
|
|
49
|
+
let D = 1;
|
|
50
|
+
const i = /* @__PURE__ */ new Date();
|
|
51
|
+
i.setHours(0, 0, 0, 0);
|
|
52
|
+
const g = this.daysInMonth(n, a);
|
|
53
|
+
for (let d = 0; d < 6; d++) {
|
|
54
|
+
o = [];
|
|
55
|
+
for (let f = 0; f < 7; f++)
|
|
56
|
+
t = {}, d === 0 && T > 0 && f < T && (t.value = 0), D > g && (t.value = 0), !t.value && t.value !== 0 && (t.value = D, D += 1, s.days[t.value] = t, t.date = new Date(a, n, t.value), i < t.date && e ? t.isFuture = !0 : t.date.getTime() === i.getTime() && (t.isToday = !0, r || (t.disabled = !0))), o.push(t);
|
|
57
|
+
this.isWeekEmpty(o) || s.weeks.push(o);
|
|
58
|
+
}
|
|
59
|
+
return s;
|
|
60
|
+
}
|
|
61
|
+
isWeekEmpty(n) {
|
|
62
|
+
return n.every((a) => !a.value);
|
|
63
|
+
}
|
|
64
|
+
// eslint-disable-next-line class-methods-use-this
|
|
65
|
+
getPresetsFunctions(n = !0) {
|
|
66
|
+
const a = n, r = this;
|
|
67
|
+
return {
|
|
68
|
+
today: {
|
|
69
|
+
dates() {
|
|
70
|
+
const e = {};
|
|
71
|
+
return (e.from = r.getCurrentTimeUTC()).setHours(0, 0, 0, 0), (e.to = new Date(e.from)).setHours(23, 59, 59, 0), e;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
yesterday: {
|
|
75
|
+
dates() {
|
|
76
|
+
const e = {};
|
|
77
|
+
return e.from = new Date(
|
|
78
|
+
r.getCurrentTimeUTC() - 24 * 3600 * 1e3
|
|
79
|
+
), (e.to = new Date(e.from)).setHours(23, 59, 59, 0), e;
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
last7days: {
|
|
83
|
+
dates() {
|
|
84
|
+
const e = {};
|
|
85
|
+
let s = 0, t = 6 * 24 * 3600 * 1e3;
|
|
86
|
+
return a || (s = 24 * 3600 * 1e3, t = 7 * 24 * 3600 * 1e3), e.from = new Date(
|
|
87
|
+
r.getCurrentTimeUTC() - t
|
|
88
|
+
), e.to = new Date(
|
|
89
|
+
r.getCurrentTimeUTC().setHours(23, 59, 59, 0) - s
|
|
90
|
+
), e;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
last14days: {
|
|
94
|
+
dates() {
|
|
95
|
+
const e = {};
|
|
96
|
+
let s = 0, t = 13 * 24 * 3600 * 1e3;
|
|
97
|
+
return a || (s = 24 * 3600 * 1e3, t = 14 * 24 * 3600 * 1e3), e.from = new Date(
|
|
98
|
+
r.getCurrentTimeUTC() - t
|
|
99
|
+
), e.to = new Date(
|
|
100
|
+
r.getCurrentTimeUTC().setHours(23, 59, 59, 0) - s
|
|
101
|
+
), e;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
last30days: {
|
|
105
|
+
dates() {
|
|
106
|
+
const e = {};
|
|
107
|
+
let s = 0, t = 29 * 24 * 3600 * 1e3;
|
|
108
|
+
return a || (s = 24 * 3600 * 1e3, t = 30 * 24 * 3600 * 1e3), e.from = new Date(
|
|
109
|
+
r.getCurrentTimeUTC() - t
|
|
110
|
+
), e.to = new Date(
|
|
111
|
+
r.getCurrentTimeUTC().setHours(23, 59, 59, 0) - s
|
|
112
|
+
), e;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
last31days: {
|
|
116
|
+
dates() {
|
|
117
|
+
const e = {};
|
|
118
|
+
let s = 0, t = 30 * 24 * 3600 * 1e3;
|
|
119
|
+
return a || (s = 24 * 3600 * 1e3, t = 31 * 24 * 3600 * 1e3), e.from = new Date(
|
|
120
|
+
r.getCurrentTimeUTC() - t
|
|
121
|
+
), e.to = new Date(
|
|
122
|
+
r.getCurrentTimeUTC().setHours(23, 59, 59, 0) - s
|
|
123
|
+
), e;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
last60days: {
|
|
127
|
+
dates() {
|
|
128
|
+
const e = {};
|
|
129
|
+
let s = 0, t = 59 * 24 * 3600 * 1e3;
|
|
130
|
+
return a || (s = 24 * 3600 * 1e3, t = 60 * 24 * 3600 * 1e3), e.from = new Date(
|
|
131
|
+
r.getCurrentTimeUTC() - t
|
|
132
|
+
), e.to = new Date(
|
|
133
|
+
r.getCurrentTimeUTC().setHours(23, 59, 59, 0) - s
|
|
134
|
+
), e;
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
last90days: {
|
|
138
|
+
dates() {
|
|
139
|
+
const e = {};
|
|
140
|
+
let s = 0, t = 89 * 24 * 3600 * 1e3;
|
|
141
|
+
return a || (s = 24 * 3600 * 1e3, t = 90 * 24 * 3600 * 1e3), e.from = new Date(
|
|
142
|
+
r.getCurrentTimeUTC() - t
|
|
143
|
+
), e.to = new Date(
|
|
144
|
+
r.getCurrentTimeUTC().setHours(23, 59, 59, 0) - s
|
|
145
|
+
), e;
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
thisMonth: {
|
|
149
|
+
dates() {
|
|
150
|
+
const e = {}, s = /* @__PURE__ */ new Date(), t = new Date(s.getFullYear(), s.getMonth(), 1);
|
|
151
|
+
if (a)
|
|
152
|
+
(e.to = r.getCurrentTimeUTC()).setHours(0, 0, 0, 0);
|
|
153
|
+
else {
|
|
154
|
+
const o = new Date(
|
|
155
|
+
r.getCurrentTimeUTC().setHours(0, 0, 0, 0) - 864e5
|
|
156
|
+
);
|
|
157
|
+
o < t ? e.to = t : e.to = o;
|
|
158
|
+
}
|
|
159
|
+
return e.from = t, e;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
lastMonth: {
|
|
163
|
+
dates() {
|
|
164
|
+
const e = {}, s = /* @__PURE__ */ new Date();
|
|
165
|
+
return e.from = new Date(s.getFullYear(), s.getMonth() - 1, 1), e.to = new Date(s.getFullYear(), s.getMonth(), 0), e;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
last4weeks: {
|
|
169
|
+
dates() {
|
|
170
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = r.getFirstDayOfWeek(s);
|
|
171
|
+
return e.from = new Date(
|
|
172
|
+
t.setDate(t.getDate() - u * 3)
|
|
173
|
+
), e.to = new Date(s.setHours(23, 59, 59, 0)), e;
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
last12weeks: {
|
|
177
|
+
dates() {
|
|
178
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = r.getFirstDayOfWeek(s);
|
|
179
|
+
return e.from = new Date(
|
|
180
|
+
t.setDate(t.getDate() - u * 11)
|
|
181
|
+
), e.to = new Date(s.setHours(23, 59, 59, 0)), e;
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
last26weeks: {
|
|
185
|
+
dates() {
|
|
186
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = r.getFirstDayOfWeek(s);
|
|
187
|
+
return e.from = new Date(
|
|
188
|
+
t.setDate(t.getDate() - u * 25)
|
|
189
|
+
), e.to = new Date(s.setHours(23, 59, 59, 0)), e;
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
last52weeks: {
|
|
193
|
+
dates() {
|
|
194
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = r.getFirstDayOfWeek(s);
|
|
195
|
+
return e.from = new Date(
|
|
196
|
+
t.setDate(t.getDate() - u * 51)
|
|
197
|
+
), e.to = new Date(s.setHours(23, 59, 59, 0)), e;
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
last3months: {
|
|
201
|
+
dates() {
|
|
202
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = new Date(s.getFullYear(), s.getMonth() - 2, 1);
|
|
203
|
+
return (e.to = r.getCurrentTimeUTC()).setHours(0, 0, 0, 0), e.from = t, e;
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
last6months: {
|
|
207
|
+
dates() {
|
|
208
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = new Date(s.getFullYear(), s.getMonth() - 5, 1);
|
|
209
|
+
return (e.to = r.getCurrentTimeUTC()).setHours(0, 0, 0, 0), e.from = t, e;
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
last12months: {
|
|
213
|
+
dates() {
|
|
214
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = new Date(
|
|
215
|
+
s.getFullYear(),
|
|
216
|
+
s.getMonth() - 11,
|
|
217
|
+
1
|
|
218
|
+
);
|
|
219
|
+
return (e.to = r.getCurrentTimeUTC()).setHours(0, 0, 0, 0), e.from = t, e;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
last24months: {
|
|
223
|
+
dates() {
|
|
224
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = new Date(
|
|
225
|
+
s.getFullYear(),
|
|
226
|
+
s.getMonth() - 23,
|
|
227
|
+
1
|
|
228
|
+
);
|
|
229
|
+
return (e.to = r.getCurrentTimeUTC()).setHours(0, 0, 0, 0), e.from = t, e;
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
last36months: {
|
|
233
|
+
dates() {
|
|
234
|
+
const e = {}, s = r.getCurrentTimeUTC(), t = new Date(
|
|
235
|
+
s.getFullYear(),
|
|
236
|
+
s.getMonth() - 35,
|
|
237
|
+
1
|
|
238
|
+
);
|
|
239
|
+
return (e.to = r.getCurrentTimeUTC()).setHours(0, 0, 0, 0), e.from = t, e;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
const h = new c();
|
|
246
|
+
export {
|
|
247
|
+
h as default
|
|
248
|
+
};
|
|
@@ -2,7 +2,7 @@ const a = {
|
|
|
2
2
|
date: "Days",
|
|
3
3
|
week: "Weeks",
|
|
4
4
|
month: "Months"
|
|
5
|
-
}, s = "Date range is in an invalid format",
|
|
5
|
+
}, s = "Date range is in an invalid format", d = "Please select a date range", t = {
|
|
6
6
|
week: "For more than 52 weeks switch to months"
|
|
7
7
|
}, n = "previous", e = "next", i = {
|
|
8
8
|
date: [
|
|
@@ -11,8 +11,7 @@ const a = {
|
|
|
11
11
|
{ name: "Last 7 Days", id: "last7days", numid: 3 },
|
|
12
12
|
{ name: "Last 14 Days", id: "last14days", numid: 4 },
|
|
13
13
|
{ name: "Last 30 Days", id: "last30days", numid: 7 },
|
|
14
|
-
{ name: "This Month", id: "thisMonth", numid: 5 }
|
|
15
|
-
{ name: "Last Month", id: "lastMonth", numid: 6 }
|
|
14
|
+
{ name: "This Month", id: "thisMonth", numid: 5 }
|
|
16
15
|
],
|
|
17
16
|
"date1-7-14-30-90": [
|
|
18
17
|
{ name: "Today", id: "today", numid: 1 },
|
|
@@ -20,7 +19,6 @@ const a = {
|
|
|
20
19
|
{ name: "Last 7 Days", id: "last7days", numid: 3 },
|
|
21
20
|
{ name: "Last 14 Days", id: "last14days", numid: 4 },
|
|
22
21
|
{ name: "This Month", id: "thisMonth", numid: 5 },
|
|
23
|
-
{ name: "Last Month", id: "lastMonth", numid: 6 },
|
|
24
22
|
{ name: "Last 30 Days", id: "last30days", numid: 7 },
|
|
25
23
|
{ name: "Last 90 Days", id: "last90days", numid: 9 }
|
|
26
24
|
],
|
|
@@ -43,7 +41,6 @@ const a = {
|
|
|
43
41
|
{ name: "Last 7 Days", id: "last7days", numid: 3 },
|
|
44
42
|
{ name: "Last 14 Days", id: "last14days", numid: 4 },
|
|
45
43
|
{ name: "This Month", id: "thisMonth", numid: 5 },
|
|
46
|
-
{ name: "Last Month", id: "lastMonth", numid: 6 },
|
|
47
44
|
{ name: "Last 30 Days", id: "last30days", numid: 7 }
|
|
48
45
|
],
|
|
49
46
|
dateWithoutLastMonth: [
|
|
@@ -51,8 +48,7 @@ const a = {
|
|
|
51
48
|
{ name: "Yesterday", id: "yesterday", numid: 2 },
|
|
52
49
|
{ name: "Last 7 Days", id: "last7days", numid: 3 },
|
|
53
50
|
{ name: "Last 14 Days", id: "last14days", numid: 4 },
|
|
54
|
-
{ name: "Last 30 Days", id: "last30days", numid: 5 }
|
|
55
|
-
{ name: "This Month", id: "thisMonth", numid: 6 }
|
|
51
|
+
{ name: "Last 30 Days", id: "last30days", numid: 5 }
|
|
56
52
|
],
|
|
57
53
|
week: [
|
|
58
54
|
{ name: "Last 4 Weeks", id: "last4weeks", numid: 1 },
|
|
@@ -70,8 +66,8 @@ const a = {
|
|
|
70
66
|
};
|
|
71
67
|
export {
|
|
72
68
|
s as formatError,
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
d as mandatoryValuesError,
|
|
70
|
+
t as messagePerType,
|
|
75
71
|
e as navigateNext,
|
|
76
72
|
n as navigatePrev,
|
|
77
73
|
i as presetsList,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import o from "./CalendarMonth.vue2.js";
|
|
2
|
+
/* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../../CalendarMonth.vue_vue_type_style_index_0_scoped_acd3440c_lang.css"; //*');
|
|
4
|
+
const c = /* @__PURE__ */ e(o, [["__scopeId", "data-v-acd3440c"]]);
|
|
5
|
+
export {
|
|
6
|
+
c as default
|
|
7
|
+
};
|