@adyen/bento-vue2 1.58.0 → 1.58.1
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/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/chunks/{calendar.C7onA58P.js → calendar.C4vFYvsY.js} +3 -3
- package/dist/chunks/{calendar.C7onA58P.js.map → calendar.C4vFYvsY.js.map} +1 -1
- package/dist/chunks/{data-grid.Dl3xh62_.js → data-grid.BS_x1UJr.js} +2 -2
- package/dist/chunks/{data-grid.Dl3xh62_.js.map → data-grid.BS_x1UJr.js.map} +1 -1
- package/dist/chunks/{date-picker.DgF85qSC.js → date-picker.mm_Z28Ef.js} +2 -2
- package/dist/chunks/{date-picker.DgF85qSC.js.map → date-picker.mm_Z28Ef.js.map} +1 -1
- package/dist/chunks/{date-range-picker.CAQY6v7g.js → date-range-picker.Cx4vdGUZ.js} +388 -389
- package/dist/chunks/date-range-picker.Cx4vdGUZ.js.map +1 -0
- package/dist/chunks/{filter-bar.CcsUi7Xg.js → filter-bar.CJOZfPv2.js} +854 -826
- package/dist/chunks/filter-bar.CJOZfPv2.js.map +1 -0
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/filter-bar.js +1 -1
- package/dist/index.js +5 -5
- package/dist/internal.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +6 -6
- package/dist/chunks/date-range-picker.CAQY6v7g.js.map +0 -1
- package/dist/chunks/filter-bar.CcsUi7Xg.js.map +0 -1
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { B as
|
|
3
|
-
import { B as
|
|
4
|
-
import { B as Ne, d as
|
|
5
|
-
import { D as
|
|
6
|
-
import { r as
|
|
7
|
-
import { g as
|
|
1
|
+
import { reactive as De, defineComponent as Pe, computed as g, ref as w, onMounted as Be, toRaw as pe, toRef as fe, watch as ve } from "vue";
|
|
2
|
+
import { B as tt } from "./divider.Cc4JFWG_.js";
|
|
3
|
+
import { B as at } from "./popover.CuOrBXcF.js";
|
|
4
|
+
import { B as Ne, d as nt } from "./typography.J1v_SPG3.js";
|
|
5
|
+
import { D as rt } from "./dropdown-default-textbox.AUsF-RIc.js";
|
|
6
|
+
import { r as h, t as Y, g as ge } from "./get-date-locale.BN8xEjY0.js";
|
|
7
|
+
import { g as te } from "./generate-uid.NJ8tVoha.js";
|
|
8
8
|
import { u as ye } from "./i18n.BQkEbtPM.js";
|
|
9
|
-
import { t as
|
|
10
|
-
import { e as qe, f as
|
|
11
|
-
import { f as he, v as
|
|
12
|
-
import { u as
|
|
9
|
+
import { t as re, f as ne } from "./date.dYFFEunA.js";
|
|
10
|
+
import { e as qe, f as ae, i as B, g as Z, h as Ie, j as st, k as Se, l as ot, s as ke, m as it, n as Ee, a as L, u as lt } from "./calendar.C4vFYvsY.js";
|
|
11
|
+
import { f as he, v as ut, D as k } from "./date-input.BqBdAO1E.js";
|
|
12
|
+
import { u as dt } from "./use-form-layout-loading.D3lALhtC.js";
|
|
13
13
|
import "./index.Cl4_42j5.js";
|
|
14
|
-
import { B as
|
|
15
|
-
import { B as
|
|
16
|
-
import { B as
|
|
17
|
-
import { d as
|
|
18
|
-
import { u as
|
|
19
|
-
import { e as
|
|
14
|
+
import { B as ct } from "./input-field.CP8Qui6G.js";
|
|
15
|
+
import { B as Dt } from "./dropdown.C01pOog2.js";
|
|
16
|
+
import { B as mt } from "./segmented-control.BffWAGrf.js";
|
|
17
|
+
import { d as de } from "./debounce.DUTu11PS.js";
|
|
18
|
+
import { u as ft } from "./use-has-slot.C9lQZ6nz.js";
|
|
19
|
+
import { e as W, a as Oe } from "./index.BDuTpjD8.js";
|
|
20
20
|
import { n as Le } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
21
|
-
import { B as
|
|
22
|
-
import { F as
|
|
23
|
-
import { B as
|
|
21
|
+
import { B as vt } from "./directive.Cbdox5VL.js";
|
|
22
|
+
import { F as pt, E as gt } from "./error-message.dQtl9mYG.js";
|
|
23
|
+
import { B as yt, c as Tt } from "./button-actions.V0te_IrY.js";
|
|
24
24
|
import "../assets/date-range-picker.css";
|
|
25
25
|
function Ye(t, e) {
|
|
26
|
-
|
|
27
|
-
var n =
|
|
26
|
+
h(2, arguments);
|
|
27
|
+
var n = re(e), i = n * 3;
|
|
28
28
|
return qe(t, i);
|
|
29
29
|
}
|
|
30
30
|
function Me(t) {
|
|
31
|
-
|
|
32
|
-
var e =
|
|
31
|
+
h(1, arguments);
|
|
32
|
+
var e = Y(t), n = Math.floor(e.getMonth() / 3) + 1;
|
|
33
33
|
return n;
|
|
34
34
|
}
|
|
35
35
|
function we(t) {
|
|
36
|
-
return
|
|
36
|
+
return h(1, arguments), Y(t).getFullYear();
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
var n =
|
|
38
|
+
function _t(t, e) {
|
|
39
|
+
h(2, arguments);
|
|
40
|
+
var n = Y(t), i = Y(e);
|
|
41
41
|
return n.getTime() === i.getTime();
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
var n =
|
|
43
|
+
function Rt(t, e) {
|
|
44
|
+
h(2, arguments);
|
|
45
|
+
var n = ae(t), i = ae(e);
|
|
46
46
|
return n.getTime() === i.getTime();
|
|
47
47
|
}
|
|
48
48
|
function Ce(t) {
|
|
49
|
-
|
|
50
|
-
var e =
|
|
49
|
+
h(1, arguments);
|
|
50
|
+
var e = Y(t);
|
|
51
51
|
return e.setMilliseconds(0), e;
|
|
52
52
|
}
|
|
53
53
|
function xe(t, e) {
|
|
54
|
-
|
|
54
|
+
h(2, arguments);
|
|
55
55
|
var n = Ce(t), i = Ce(e);
|
|
56
56
|
return n.getTime() === i.getTime();
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function bt(t) {
|
|
59
|
+
return h(1, arguments), B(t, Date.now());
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
var n =
|
|
61
|
+
function It(t, e) {
|
|
62
|
+
h(2, arguments);
|
|
63
|
+
var n = Y(t), i = re(e);
|
|
64
64
|
return n.setHours(i), n;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
var n =
|
|
66
|
+
function St(t, e) {
|
|
67
|
+
h(2, arguments);
|
|
68
|
+
var n = Y(t), i = re(e);
|
|
69
69
|
return n.setMinutes(i), n;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
var n =
|
|
71
|
+
function kt(t, e) {
|
|
72
|
+
h(2, arguments);
|
|
73
|
+
var n = Y(t), i = re(e);
|
|
74
74
|
return n.setSeconds(i), n;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
var n =
|
|
76
|
+
function Et(t, e) {
|
|
77
|
+
h(2, arguments);
|
|
78
|
+
var n = re(e);
|
|
79
79
|
return Ye(t, -n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function K(t) {
|
|
82
82
|
if (t == null)
|
|
83
|
-
return
|
|
83
|
+
return Z(/* @__PURE__ */ new Date());
|
|
84
84
|
const [e, n, i] = t.split("-").map((l) => parseInt(l, 10));
|
|
85
85
|
return new Date(e, n - 1, i);
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const ht = ({
|
|
88
88
|
firstDayOfWeek: t,
|
|
89
89
|
min: e,
|
|
90
90
|
max: n
|
|
91
91
|
}) => ({ getGranularCalendarLimits: (l) => {
|
|
92
|
-
let
|
|
92
|
+
let c = Z(e), D = W(n);
|
|
93
93
|
if ((l == null ? void 0 : l.type) === "weekly") {
|
|
94
94
|
if (l.earliest)
|
|
95
|
-
|
|
95
|
+
c = Z(l.earliest);
|
|
96
96
|
else {
|
|
97
|
-
const r = Ie(
|
|
98
|
-
B(
|
|
97
|
+
const r = Ie(c, { weekStartsOn: t });
|
|
98
|
+
B(c, r) || (c = Z(st(Se(c, { weekStartsOn: t }), 1)));
|
|
99
99
|
}
|
|
100
100
|
if (l.latest)
|
|
101
|
-
|
|
101
|
+
D = W(l.latest);
|
|
102
102
|
else {
|
|
103
|
-
const r = Se(
|
|
104
|
-
B(
|
|
103
|
+
const r = Se(D, { weekStartsOn: t });
|
|
104
|
+
B(D, r) || (D = W(ot(Ie(D, { weekStartsOn: t }), 1)));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
if ((l == null ? void 0 : l.type) === "monthly") {
|
|
108
108
|
if (l.earliest)
|
|
109
|
-
|
|
109
|
+
c = Z(l.earliest);
|
|
110
110
|
else {
|
|
111
|
-
const r = ke(
|
|
112
|
-
B(
|
|
111
|
+
const r = ke(c);
|
|
112
|
+
B(c, r) || (c = ke(qe(c, 1)));
|
|
113
113
|
}
|
|
114
114
|
if (l.latest)
|
|
115
|
-
|
|
115
|
+
D = W(l.latest);
|
|
116
116
|
else {
|
|
117
|
-
const r = Oe(
|
|
118
|
-
B(
|
|
117
|
+
const r = Oe(D);
|
|
118
|
+
B(D, r) || (D = Oe(it(D, 1)));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
if ((l == null ? void 0 : l.type) === "quarterly") {
|
|
122
122
|
if (l.earliest)
|
|
123
|
-
|
|
123
|
+
c = ae(l.earliest);
|
|
124
124
|
else {
|
|
125
|
-
const r =
|
|
126
|
-
B(
|
|
125
|
+
const r = ae(c);
|
|
126
|
+
B(c, r) || (c = ae(Ye(c, 1)));
|
|
127
127
|
}
|
|
128
128
|
if (l.latest)
|
|
129
|
-
|
|
129
|
+
D = W(l.latest);
|
|
130
130
|
else {
|
|
131
|
-
const r = Ee(
|
|
132
|
-
B(
|
|
131
|
+
const r = Ee(D);
|
|
132
|
+
B(D, r) || (D = Ee(Et(D, 1)));
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
return { min:
|
|
136
|
-
} }),
|
|
137
|
-
const t =
|
|
135
|
+
return { min: c, max: D };
|
|
136
|
+
} }), Ot = () => {
|
|
137
|
+
const t = De({
|
|
138
138
|
daily: null,
|
|
139
139
|
weekly: null,
|
|
140
140
|
monthly: null,
|
|
@@ -150,9 +150,9 @@ const Ot = ({
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
|
-
var
|
|
154
|
-
const
|
|
155
|
-
const { selectionStart: e } = t.target, n =
|
|
153
|
+
var f = /* @__PURE__ */ ((t) => (t.CUSTOM_RANGE = "custom-range", t.INPUT = "input", t.ERROR = "error", t.FORM_DATE = "form-date", t.START_DATE_SELECTED = "start-date-selected", t))(f || {});
|
|
154
|
+
const Mt = /[\d]/, wt = /^\d{2}$/, Ct = /^\d{2}:\d{2}$/, xt = (t) => {
|
|
155
|
+
const { selectionStart: e } = t.target, n = Mt.test(t.key) || t.key === "Backspace" || t.key === "Tab", i = [1, 2, 4, 5].includes(e) && t.key === ":";
|
|
156
156
|
!n && !i && t.preventDefault();
|
|
157
157
|
}, Ae = (t) => {
|
|
158
158
|
if (!t)
|
|
@@ -161,8 +161,8 @@ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
|
|
|
161
161
|
if (e.length === 1 && parseInt(t, 10) > 2)
|
|
162
162
|
return `0${e}:`;
|
|
163
163
|
const [n, i] = e.slice(-2);
|
|
164
|
-
return [2, 5].includes(e.length) && i === ":" && (e = `${e.slice(0, e.length - 2)}0${n}`), (
|
|
165
|
-
},
|
|
164
|
+
return [2, 5].includes(e.length) && i === ":" && (e = `${e.slice(0, e.length - 2)}0${n}`), (wt.test(e) || Ct.test(e)) && (e += ":"), e;
|
|
165
|
+
}, At = {
|
|
166
166
|
"en-US": {
|
|
167
167
|
customRange: "Custom range",
|
|
168
168
|
daily: "Daily",
|
|
@@ -193,15 +193,15 @@ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
|
|
|
193
193
|
monthly: "Mensal",
|
|
194
194
|
weekly: "Semanal"
|
|
195
195
|
}
|
|
196
|
-
}, Fe = 300, Ue = "customRange",
|
|
197
|
-
i18n: { messages:
|
|
196
|
+
}, Fe = 300, Ue = "customRange", Ft = Pe({
|
|
197
|
+
i18n: { messages: At },
|
|
198
198
|
name: "date-range-picker-calendar",
|
|
199
199
|
components: {
|
|
200
|
-
BentoDropdown:
|
|
201
|
-
BentoInputField:
|
|
202
|
-
BentoSegmentedControl:
|
|
200
|
+
BentoDropdown: Dt,
|
|
201
|
+
BentoInputField: ct,
|
|
202
|
+
BentoSegmentedControl: mt,
|
|
203
203
|
BentoTypography: Ne,
|
|
204
|
-
Calendar:
|
|
204
|
+
Calendar: L
|
|
205
205
|
},
|
|
206
206
|
props: {
|
|
207
207
|
/**
|
|
@@ -218,7 +218,7 @@ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
|
|
|
218
218
|
/**
|
|
219
219
|
* Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
220
220
|
*/
|
|
221
|
-
firstDayOfWeek:
|
|
221
|
+
firstDayOfWeek: L.props.firstDayOfWeek,
|
|
222
222
|
/**
|
|
223
223
|
* A list of available granularities.
|
|
224
224
|
* If present, the date picker will display a segmented control to change granularity.
|
|
@@ -230,23 +230,23 @@ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
|
|
|
230
230
|
/**
|
|
231
231
|
* Indicate if a date should be disabled or not
|
|
232
232
|
*/
|
|
233
|
-
isDateDisabled:
|
|
233
|
+
isDateDisabled: L.props.isDateDisabled,
|
|
234
234
|
/**
|
|
235
235
|
* Set a maximum number of dates to be selectable by the range.
|
|
236
236
|
*/
|
|
237
|
-
maxRange:
|
|
237
|
+
maxRange: L.props.maxRange,
|
|
238
238
|
/**
|
|
239
239
|
* Sets a minimum limit for selectable dates - dates before `min` will not be selectable
|
|
240
240
|
*/
|
|
241
|
-
min:
|
|
241
|
+
min: L.props.min,
|
|
242
242
|
/**
|
|
243
243
|
* Sets a maximum limit for selectable dates - dates after `max` will not be selectable
|
|
244
244
|
*/
|
|
245
|
-
max:
|
|
245
|
+
max: L.props.max,
|
|
246
246
|
/**
|
|
247
247
|
* Number of months rendered on pane
|
|
248
248
|
*/
|
|
249
|
-
numberOfMonths:
|
|
249
|
+
numberOfMonths: L.props.numberOfMonths,
|
|
250
250
|
/**
|
|
251
251
|
* Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
|
|
252
252
|
*/
|
|
@@ -269,45 +269,45 @@ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
|
|
|
269
269
|
/**
|
|
270
270
|
* The type of calendar to display. Defaults to showing days.
|
|
271
271
|
*/
|
|
272
|
-
variant:
|
|
272
|
+
variant: L.props.variant
|
|
273
273
|
},
|
|
274
274
|
emits: [
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
275
|
+
f.CUSTOM_RANGE,
|
|
276
|
+
f.INPUT,
|
|
277
|
+
f.ERROR,
|
|
278
|
+
f.FORM_DATE,
|
|
279
|
+
f.START_DATE_SELECTED
|
|
280
280
|
],
|
|
281
281
|
setup(t, { emit: e, slots: n }) {
|
|
282
282
|
var Te, _e, Re, be;
|
|
283
|
-
const { locale: i, t: l } = ye(),
|
|
283
|
+
const { locale: i, t: l } = ye(), c = ge(), D = g(() => t.variant === "month" ? "monthly" : "daily"), r = De({
|
|
284
284
|
startDate: (Te = t.value) == null ? void 0 : Te.startDate,
|
|
285
285
|
endDate: (_e = t.value) == null ? void 0 : _e.endDate,
|
|
286
286
|
range: (Re = t.value) == null ? void 0 : Re.range,
|
|
287
287
|
...t.granularities ? {
|
|
288
|
-
granularity: ((be = t.value) == null ? void 0 : be.granularity) ||
|
|
288
|
+
granularity: ((be = t.value) == null ? void 0 : be.granularity) || D.value
|
|
289
289
|
} : {}
|
|
290
290
|
});
|
|
291
291
|
function y(a) {
|
|
292
|
-
return new Date(
|
|
292
|
+
return a ? new Date(
|
|
293
293
|
a.getUTCFullYear(),
|
|
294
294
|
a.getUTCMonth(),
|
|
295
295
|
a.getUTCDate(),
|
|
296
296
|
a.getUTCHours(),
|
|
297
297
|
a.getUTCMinutes(),
|
|
298
298
|
a.getUTCSeconds()
|
|
299
|
-
);
|
|
299
|
+
) : null;
|
|
300
300
|
}
|
|
301
301
|
const T = g(() => {
|
|
302
|
-
var a,
|
|
302
|
+
var a, o;
|
|
303
303
|
return (
|
|
304
304
|
// eslint-disable-next-line consistent-return
|
|
305
|
-
((
|
|
305
|
+
((o = (a = t == null ? void 0 : t.quickSelectRanges) == null ? void 0 : a.find(({ value: u, data: d }) => {
|
|
306
306
|
if (!d.endDate)
|
|
307
|
-
return u === r.range ||
|
|
307
|
+
return u === r.range || _t(
|
|
308
308
|
y(d.startDate),
|
|
309
309
|
y(r.startDate)
|
|
310
|
-
) &&
|
|
310
|
+
) && bt(r.endDate);
|
|
311
311
|
if (t.allowTimeInput)
|
|
312
312
|
return xe(
|
|
313
313
|
y(d.startDate),
|
|
@@ -315,257 +315,257 @@ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
|
|
|
315
315
|
) && xe(y(d.endDate), y(r.endDate));
|
|
316
316
|
if (d.endDate)
|
|
317
317
|
return B(d.startDate, r.startDate) && B(d.endDate, r.endDate);
|
|
318
|
-
})) == null ? void 0 :
|
|
318
|
+
})) == null ? void 0 : o.value) ?? Ue
|
|
319
319
|
);
|
|
320
|
-
}),
|
|
320
|
+
}), se = g(() => ({
|
|
321
321
|
"b-date-range-picker-calendar__form-input-wrapper": t.allowTimeInput
|
|
322
322
|
})), _ = g(() => [
|
|
323
323
|
{ label: l("customRange"), value: Ue },
|
|
324
|
-
...
|
|
325
|
-
]),
|
|
324
|
+
...t.quickSelectRanges ? t.quickSelectRanges : []
|
|
325
|
+
]), x = g(
|
|
326
326
|
() => {
|
|
327
327
|
var a;
|
|
328
|
-
return ((a = t.granularities) == null ? void 0 : a.find(({ type:
|
|
328
|
+
return ((a = t.granularities) == null ? void 0 : a.find(({ type: o }) => o === r.granularity)) || null;
|
|
329
329
|
}
|
|
330
|
-
),
|
|
330
|
+
), I = g(
|
|
331
331
|
() => {
|
|
332
332
|
var a;
|
|
333
|
-
return ((a = t.granularities) == null ? void 0 : a.map(({ type:
|
|
334
|
-
label: l(
|
|
335
|
-
value:
|
|
333
|
+
return ((a = t.granularities) == null ? void 0 : a.map(({ type: o, disabled: u }) => ({
|
|
334
|
+
label: l(o),
|
|
335
|
+
value: o,
|
|
336
336
|
disabled: u
|
|
337
337
|
}))) ?? [];
|
|
338
338
|
}
|
|
339
|
-
),
|
|
340
|
-
() => t.
|
|
341
|
-
...a,
|
|
342
|
-
data: {
|
|
343
|
-
...a.data,
|
|
344
|
-
// Adding timeDifference to calculate an up-to-date endDate on range selection
|
|
345
|
-
timeDifference: a.data.endDate ? void 0 : new Date(Date.now()).getTime() - a.data.startDate.getTime()
|
|
346
|
-
}
|
|
347
|
-
}))
|
|
348
|
-
), { getGranularCalendarLimits: Y } = Ot(t), m = g(
|
|
349
|
-
() => t.granularities ? Y(C.value) : { min: z(t.min), max: N(t.max) }
|
|
339
|
+
), { getGranularCalendarLimits: z } = ht(t), v = g(
|
|
340
|
+
() => t.granularities ? z(x.value) : { min: Z(t.min), max: W(t.max) }
|
|
350
341
|
), {
|
|
351
|
-
adjustDateForQuarterly:
|
|
352
|
-
adjustDateForMonthly:
|
|
353
|
-
adjustDateForWeekly:
|
|
354
|
-
adjustStartDateInputForWeekly:
|
|
355
|
-
adjustEndDateInputForWeekly:
|
|
356
|
-
adjustStartDateInputForMonthly:
|
|
357
|
-
adjustEndDateInputForMonthly:
|
|
358
|
-
adjustStartDateInputForQuarterly:
|
|
359
|
-
adjustEndDateInputForQuarterly:
|
|
360
|
-
} =
|
|
361
|
-
locale:
|
|
362
|
-
}) : "",
|
|
363
|
-
locale:
|
|
364
|
-
}) : "",
|
|
342
|
+
adjustDateForQuarterly: O,
|
|
343
|
+
adjustDateForMonthly: $,
|
|
344
|
+
adjustDateForWeekly: A,
|
|
345
|
+
adjustStartDateInputForWeekly: p,
|
|
346
|
+
adjustEndDateInputForWeekly: C,
|
|
347
|
+
adjustStartDateInputForMonthly: F,
|
|
348
|
+
adjustEndDateInputForMonthly: M,
|
|
349
|
+
adjustStartDateInputForQuarterly: ee,
|
|
350
|
+
adjustEndDateInputForQuarterly: oe
|
|
351
|
+
} = lt(t.firstDayOfWeek), { savedRanges: U, saveRange: N, resetSavedRanges: G } = Ot(), b = (a) => a ? ne(a, k.NUMERIC_DATE_YEAR_FIRST, {
|
|
352
|
+
locale: c[i.value.substring(0, 2)] || c.enUS
|
|
353
|
+
}) : "", J = (a) => a ? ne(a, k.HOUR_MINUTE_SECONDS, {
|
|
354
|
+
locale: c[i.value.substring(0, 2)] || c.enUS
|
|
355
|
+
}) : "", q = w(!1), j = w(!1), Q = w(!1), H = w(!1), s = De({
|
|
365
356
|
startDate: t.dateFormData.startDate,
|
|
366
357
|
endDate: t.dateFormData.endDate,
|
|
367
358
|
startTime: t.dateFormData.startTime,
|
|
368
359
|
endTime: t.dateFormData.endTime
|
|
369
|
-
}),
|
|
370
|
-
if (!
|
|
360
|
+
}), ie = (a) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(a), E = (a, o) => {
|
|
361
|
+
if (!o || !ie(o) || t.variant === "month")
|
|
371
362
|
return a;
|
|
372
363
|
let u = new Date(a);
|
|
373
|
-
const [d, S, V] =
|
|
374
|
-
return u =
|
|
375
|
-
},
|
|
376
|
-
r.startDate =
|
|
364
|
+
const [d, S, V] = o.split(":");
|
|
365
|
+
return u = It(u, parseInt(d, 10)), u = St(u, parseInt(S, 10)), u = kt(u, parseInt(V, 10)), u;
|
|
366
|
+
}, m = (a) => {
|
|
367
|
+
r.startDate = E(a.startDate, s.startTime), r.endDate = E(a.endDate, s.endTime), r.range = null, t.granularities && G(), e(f.INPUT, {
|
|
377
368
|
...r,
|
|
378
369
|
range: T.value
|
|
379
370
|
});
|
|
380
|
-
},
|
|
381
|
-
const
|
|
382
|
-
return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) &&
|
|
371
|
+
}, R = (a) => {
|
|
372
|
+
const o = (d) => t.min && d <= t.min || t.max && d >= t.max ? !1 : t.isDateDisabled ? !t.isDateDisabled(d) : !0;
|
|
373
|
+
return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) && o(new Date(a));
|
|
383
374
|
};
|
|
384
375
|
Be(() => {
|
|
385
|
-
t.dateFormData.startDate && !
|
|
376
|
+
t.dateFormData.startDate && !R(t.dateFormData.startDate) ? q.value = !0 : (q.value = !1, Q.value = !1), t.dateFormData.endDate && !R(t.dateFormData.endDate) ? j.value = !0 : (j.value = !1, H.value = !1);
|
|
386
377
|
});
|
|
387
|
-
const
|
|
388
|
-
var
|
|
389
|
-
|
|
390
|
-
},
|
|
391
|
-
var
|
|
392
|
-
|
|
393
|
-
},
|
|
394
|
-
const
|
|
395
|
-
if (
|
|
396
|
-
return
|
|
397
|
-
if (t.dateFormData[a] &&
|
|
378
|
+
const X = (a) => {
|
|
379
|
+
var o;
|
|
380
|
+
s.startDate = b(a), s.startTime ? Q.value && (s.startTime = (o = t.dateFormData) == null ? void 0 : o.startTime) : s.startTime = J(a), q.value = !1, Q.value = !1, e(f.START_DATE_SELECTED, a);
|
|
381
|
+
}, me = (a) => {
|
|
382
|
+
var o;
|
|
383
|
+
s.endDate = b(a), s.endTime ? H.value && (s.endTime = (o = t.dateFormData) == null ? void 0 : o.endTime) : s.endTime = J(W(a)), j.value = !1, H.value = !1;
|
|
384
|
+
}, le = (a) => {
|
|
385
|
+
const o = t.value[a];
|
|
386
|
+
if (o)
|
|
387
|
+
return o;
|
|
388
|
+
if (t.dateFormData[a] && R(t.dateFormData[a]))
|
|
398
389
|
return new Date(t.dateFormData[a]);
|
|
399
|
-
},
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
390
|
+
}, $e = de((a) => {
|
|
391
|
+
var o;
|
|
392
|
+
if (R(a)) {
|
|
402
393
|
let u = a;
|
|
403
|
-
switch (
|
|
394
|
+
switch (q.value = !1, (o = x.value) == null ? void 0 : o.type) {
|
|
404
395
|
case "weekly":
|
|
405
|
-
u =
|
|
396
|
+
u = p(
|
|
406
397
|
a,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
),
|
|
398
|
+
b,
|
|
399
|
+
v.value.min,
|
|
400
|
+
v.value.max
|
|
401
|
+
), s.startDate = u;
|
|
411
402
|
break;
|
|
412
403
|
case "monthly":
|
|
413
|
-
u =
|
|
404
|
+
u = F(
|
|
414
405
|
a,
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
),
|
|
406
|
+
b,
|
|
407
|
+
v.value.min,
|
|
408
|
+
v.value.max
|
|
409
|
+
), s.startDate = u;
|
|
419
410
|
break;
|
|
420
411
|
case "quarterly":
|
|
421
|
-
u =
|
|
412
|
+
u = ee(
|
|
422
413
|
a,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
),
|
|
414
|
+
b,
|
|
415
|
+
v.value.min,
|
|
416
|
+
v.value.max
|
|
417
|
+
), s.startDate = u;
|
|
427
418
|
break;
|
|
428
419
|
}
|
|
429
|
-
const d =
|
|
430
|
-
r.startDate =
|
|
431
|
-
|
|
432
|
-
|
|
420
|
+
const d = K(u);
|
|
421
|
+
r.startDate = E(d, s.startTime), r.endDate = E(
|
|
422
|
+
K(s.endDate),
|
|
423
|
+
s.endTime
|
|
424
|
+
), R(s.endDate) && (r.endDate = E(
|
|
425
|
+
K(s.endDate),
|
|
426
|
+
s.endTime
|
|
427
|
+
));
|
|
428
|
+
const S = le("endDate");
|
|
429
|
+
r.range = null, e(f.FORM_DATE, {
|
|
433
430
|
startDate: d,
|
|
434
431
|
endDate: S
|
|
435
|
-
}), e(
|
|
432
|
+
}), e(f.INPUT, {
|
|
436
433
|
...r,
|
|
437
434
|
range: T.value
|
|
438
435
|
});
|
|
439
436
|
} else
|
|
440
|
-
|
|
441
|
-
}, Fe),
|
|
442
|
-
|
|
443
|
-
},
|
|
444
|
-
var
|
|
445
|
-
if (
|
|
437
|
+
q.value = !0, e(f.ERROR, { ...s });
|
|
438
|
+
}, Fe), Ge = (a) => {
|
|
439
|
+
s.startDate = he(a), $e(s.startDate);
|
|
440
|
+
}, je = de((a) => {
|
|
441
|
+
var o;
|
|
442
|
+
if (R(a)) {
|
|
446
443
|
let u = a;
|
|
447
|
-
switch (
|
|
444
|
+
switch (j.value = !1, (o = x.value) == null ? void 0 : o.type) {
|
|
448
445
|
case "weekly":
|
|
449
|
-
u =
|
|
446
|
+
u = C(
|
|
450
447
|
a,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
),
|
|
448
|
+
b,
|
|
449
|
+
v.value.min,
|
|
450
|
+
v.value.max
|
|
451
|
+
), s.endDate = u;
|
|
455
452
|
break;
|
|
456
453
|
case "monthly":
|
|
457
|
-
u =
|
|
454
|
+
u = M(
|
|
458
455
|
a,
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
),
|
|
456
|
+
b,
|
|
457
|
+
v.value.min,
|
|
458
|
+
v.value.max
|
|
459
|
+
), s.endDate = u;
|
|
463
460
|
break;
|
|
464
461
|
case "quarterly":
|
|
465
|
-
u =
|
|
462
|
+
u = oe(
|
|
466
463
|
a,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
),
|
|
464
|
+
b,
|
|
465
|
+
v.value.min,
|
|
466
|
+
v.value.max
|
|
467
|
+
), s.endDate = u;
|
|
471
468
|
break;
|
|
472
469
|
}
|
|
473
|
-
const d =
|
|
474
|
-
r.endDate =
|
|
475
|
-
|
|
476
|
-
|
|
470
|
+
const d = K(u);
|
|
471
|
+
r.endDate = E(d, s.endTime), R(s.startDate) && (r.startDate = E(
|
|
472
|
+
K(s.startDate),
|
|
473
|
+
s.startTime
|
|
474
|
+
));
|
|
475
|
+
const S = le("startDate");
|
|
476
|
+
r.range = null, e(f.FORM_DATE, {
|
|
477
477
|
startDate: S,
|
|
478
478
|
endDate: d
|
|
479
|
-
}), e(
|
|
479
|
+
}), e(f.INPUT, {
|
|
480
480
|
...r,
|
|
481
481
|
range: T.value
|
|
482
482
|
});
|
|
483
483
|
} else
|
|
484
|
-
|
|
485
|
-
}, Fe),
|
|
486
|
-
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
if (
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
e(
|
|
484
|
+
j.value = !0, e(f.ERROR, { ...s });
|
|
485
|
+
}, Fe), Qe = (a) => {
|
|
486
|
+
s.endDate = he(a), je(s.endDate);
|
|
487
|
+
}, He = (a) => {
|
|
488
|
+
ut(a);
|
|
489
|
+
}, Ve = de((a) => {
|
|
490
|
+
if (ie(a)) {
|
|
491
|
+
Q.value = !1, r.startDate = E(r.startDate, a);
|
|
492
|
+
const o = le("endDate");
|
|
493
|
+
e(f.FORM_DATE, {
|
|
494
494
|
startDate: new Date(r.startDate),
|
|
495
|
-
endDate:
|
|
495
|
+
endDate: o,
|
|
496
496
|
startTime: a,
|
|
497
497
|
endTime: t.dateFormData.endTime
|
|
498
|
-
}), e(
|
|
498
|
+
}), e(f.INPUT, {
|
|
499
499
|
...r,
|
|
500
500
|
range: T.value
|
|
501
501
|
});
|
|
502
502
|
} else
|
|
503
|
-
|
|
504
|
-
}),
|
|
505
|
-
if (
|
|
506
|
-
H.value = !1, r.endDate =
|
|
507
|
-
const
|
|
508
|
-
r.startDate =
|
|
509
|
-
startDate:
|
|
503
|
+
Q.value = !0, e(f.ERROR, { ...s });
|
|
504
|
+
}), We = de((a) => {
|
|
505
|
+
if (ie(a)) {
|
|
506
|
+
H.value = !1, r.endDate = E(r.endDate, a);
|
|
507
|
+
const o = le("startDate");
|
|
508
|
+
r.startDate = E(new Date(o), t.dateFormData.startTime), e(f.FORM_DATE, {
|
|
509
|
+
startDate: E(new Date(o), t.dateFormData.startTime),
|
|
510
510
|
endDate: new Date(r.endDate),
|
|
511
511
|
startTime: t.dateFormData.startTime,
|
|
512
512
|
endTime: a
|
|
513
|
-
}), e(
|
|
513
|
+
}), e(f.INPUT, {
|
|
514
514
|
...r,
|
|
515
515
|
range: T.value
|
|
516
516
|
});
|
|
517
517
|
} else
|
|
518
|
-
H.value = !0, e(
|
|
519
|
-
}),
|
|
520
|
-
|
|
518
|
+
H.value = !0, e(f.ERROR, { ...s });
|
|
519
|
+
}), Ke = (a) => {
|
|
520
|
+
s.startTime = Ae(a), Ve(s.startTime);
|
|
521
|
+
}, ze = (a) => {
|
|
522
|
+
s.endTime = Ae(a), We(s.endTime);
|
|
521
523
|
}, Je = (a) => {
|
|
522
|
-
|
|
524
|
+
xt(a);
|
|
525
|
+
}, ue = (a, o, u, d) => {
|
|
526
|
+
r.startDate = a, r.endDate = o, u && (r.granularity = u), d && (r.range = d);
|
|
523
527
|
}, Xe = (a) => {
|
|
524
|
-
At(a);
|
|
525
|
-
}, le = (a, s, u, d) => {
|
|
526
|
-
r.startDate = a, r.endDate = s, u && (r.granularity = u), d && (r.range = d);
|
|
527
|
-
}, Ze = (a) => {
|
|
528
528
|
var u;
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
531
|
-
|
|
532
|
-
const d =
|
|
533
|
-
|
|
534
|
-
...
|
|
529
|
+
const o = (u = t.quickSelectRanges) == null ? void 0 : u.find(({ value: d }) => d === a);
|
|
530
|
+
if (o) {
|
|
531
|
+
G();
|
|
532
|
+
const d = o.data, S = d.endDate || new Date(Date.now()), V = d.timeDifference ? new Date(S.getTime() - d.timeDifference) : d.startDate;
|
|
533
|
+
s.endDate = b(S), s.startDate = b(V), ue(V, S, null, a), t.granularities && (r.granularity = d.granularity || D.value), s.startTime = J(V), s.endTime = J(S), r.endDate = S, r.startDate = V, e(f.CUSTOM_RANGE, {
|
|
534
|
+
...o.data,
|
|
535
535
|
startDate: V,
|
|
536
536
|
endDate: S,
|
|
537
|
-
range:
|
|
537
|
+
range: o.value
|
|
538
538
|
});
|
|
539
539
|
}
|
|
540
|
-
},
|
|
541
|
-
weekly:
|
|
542
|
-
monthly:
|
|
543
|
-
quarterly:
|
|
544
|
-
},
|
|
545
|
-
const
|
|
546
|
-
if (r.granularity = a,
|
|
540
|
+
}, Ze = {
|
|
541
|
+
weekly: A,
|
|
542
|
+
monthly: $,
|
|
543
|
+
quarterly: O
|
|
544
|
+
}, et = (a) => {
|
|
545
|
+
const o = r.granularity;
|
|
546
|
+
if (r.granularity = a, o && N(o, structuredClone(pe(r))), r.startDate && r.endDate) {
|
|
547
547
|
switch (a) {
|
|
548
548
|
case "quarterly":
|
|
549
549
|
case "monthly":
|
|
550
550
|
case "weekly": {
|
|
551
|
-
if (
|
|
552
|
-
|
|
551
|
+
if (U[a]) {
|
|
552
|
+
ue(U[a].startDate, U[a].endDate, a);
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
|
-
const { startDate: u, endDate: d } =
|
|
555
|
+
const { startDate: u, endDate: d } = Ze[a](
|
|
556
556
|
r.startDate,
|
|
557
557
|
r.endDate,
|
|
558
|
-
|
|
559
|
-
|
|
558
|
+
v.value.min,
|
|
559
|
+
v.value.max
|
|
560
560
|
);
|
|
561
|
-
|
|
561
|
+
ue(u, d, a);
|
|
562
562
|
break;
|
|
563
563
|
}
|
|
564
564
|
case "daily":
|
|
565
|
-
|
|
565
|
+
U.daily && ue(U.daily.startDate, U.daily.endDate, a);
|
|
566
566
|
break;
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
s.startDate = b(r.startDate), s.endDate = b(r.endDate), e(f.INPUT, {
|
|
569
569
|
...r,
|
|
570
570
|
range: T.value
|
|
571
571
|
});
|
|
@@ -574,39 +574,38 @@ const wt = /[\d]/, Ct = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, At = (t) => {
|
|
|
574
574
|
return {
|
|
575
575
|
// Values
|
|
576
576
|
internalRangeDate: r,
|
|
577
|
-
dateTextInput:
|
|
578
|
-
endDateError:
|
|
577
|
+
dateTextInput: s,
|
|
578
|
+
endDateError: j,
|
|
579
579
|
endTimeError: H,
|
|
580
|
-
granularityItems:
|
|
581
|
-
selectedGranularity:
|
|
582
|
-
computedMinMax:
|
|
580
|
+
granularityItems: I,
|
|
581
|
+
selectedGranularity: x,
|
|
582
|
+
computedMinMax: v,
|
|
583
583
|
selectedRangeSelectorValue: T,
|
|
584
|
-
startDateError:
|
|
585
|
-
startTimeError:
|
|
586
|
-
adjustedQuickSelectRanges: x,
|
|
584
|
+
startDateError: q,
|
|
585
|
+
startTimeError: Q,
|
|
587
586
|
quickSelectRangeDefaultItems: _,
|
|
588
|
-
formInputWrapperConditionalClasses:
|
|
587
|
+
formInputWrapperConditionalClasses: se,
|
|
589
588
|
// Methods
|
|
590
|
-
hasSlot:
|
|
589
|
+
hasSlot: ft(n),
|
|
591
590
|
t: l,
|
|
592
591
|
// Events
|
|
593
|
-
onDateInput:
|
|
594
|
-
onDateInputKeyDown:
|
|
595
|
-
onEndDateInput:
|
|
596
|
-
onEndDateSelected:
|
|
597
|
-
onEndTimeInput:
|
|
598
|
-
onGranularityInput:
|
|
599
|
-
onRangeSelectorInput:
|
|
600
|
-
onStartDateInput:
|
|
601
|
-
onStartDateSelected:
|
|
602
|
-
onStartTimeInput:
|
|
603
|
-
onTimeInputKeyDown:
|
|
592
|
+
onDateInput: m,
|
|
593
|
+
onDateInputKeyDown: He,
|
|
594
|
+
onEndDateInput: Qe,
|
|
595
|
+
onEndDateSelected: me,
|
|
596
|
+
onEndTimeInput: ze,
|
|
597
|
+
onGranularityInput: et,
|
|
598
|
+
onRangeSelectorInput: Xe,
|
|
599
|
+
onStartDateInput: Ge,
|
|
600
|
+
onStartDateSelected: X,
|
|
601
|
+
onStartTimeInput: Ke,
|
|
602
|
+
onTimeInputKeyDown: Je
|
|
604
603
|
};
|
|
605
604
|
}
|
|
606
605
|
});
|
|
607
|
-
var
|
|
606
|
+
var Ut = function() {
|
|
608
607
|
var e = this, n = e._self._c;
|
|
609
|
-
return e._self._setupProxy, n("div", { staticClass: "b-date-range-picker-calendar" }, [n("div", { staticClass: "b-date-range-picker-calendar__form-container" }, [n("div", { staticClass: "b-date-range-picker-calendar__form" }, [e.hasSlot("title") ? [e._t("title")] : e._e(), e.
|
|
608
|
+
return e._self._setupProxy, n("div", { staticClass: "b-date-range-picker-calendar" }, [n("div", { staticClass: "b-date-range-picker-calendar__form-container" }, [n("div", { staticClass: "b-date-range-picker-calendar__form" }, [e.hasSlot("title") ? [e._t("title")] : e._e(), e.quickSelectRanges ? n("bento-dropdown", { attrs: { "aria-label": e.t("customRange"), items: e.quickSelectRangeDefaultItems, value: e.selectedRangeSelectorValue }, on: { input: e.onRangeSelectorInput } }) : e._e(), e.granularities ? n("bento-segmented-control", { attrs: { items: e.granularityItems, "model-value": e.internalRangeDate.granularity, "full-width": "" }, on: { "update:model-value": e.onGranularityInput } }) : e._e(), n("div", [n("bento-typography", { staticClass: "b-date-range-picker-calendar__label", attrs: { stronger: "", el: "span" } }, [e._v(" From ")]), n("div", { class: e.formInputWrapperConditionalClasses }, [n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("dateFrom"), value: e.dateTextInput.startDate, error: e.startDateError }, on: { input: e.onStartDateInput, keydown: e.onDateInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
|
|
610
609
|
return [e._v("YYYY-MM-DD")];
|
|
611
610
|
}, proxy: !0 }]) }), e.allowTimeInput ? n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("timeFrom"), value: e.dateTextInput.startTime, error: e.startTimeError }, on: { input: e.onStartTimeInput, keydown: e.onTimeInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
|
|
612
611
|
return [e._v("HH:MM:SS")];
|
|
@@ -615,28 +614,28 @@ var Pt = function() {
|
|
|
615
614
|
}, proxy: !0 }]) }), e.allowTimeInput ? n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("timeTo"), value: e.dateTextInput.endTime, error: e.endTimeError }, on: { input: e.onEndTimeInput, keydown: e.onTimeInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
|
|
616
615
|
return [e._v("HH:MM:SS")];
|
|
617
616
|
}, proxy: !0 }], null, !1, 3442289499) }) : e._e()], 1)], 1)], 2), e.hasSlot("actions") ? n("div", [e._t("actions")], 2) : e._e()]), n("div", { staticClass: "b-date-range-picker-calendar__calendars-container" }, [n("calendar", { attrs: { value: e.internalRangeDate, "first-day-of-week": e.firstDayOfWeek, "is-date-disabled": e.isDateDisabled, "max-range": e.maxRange, min: e.computedMinMax.min, max: e.computedMinMax.max, "number-of-months": e.numberOfMonths, "show-end-date-on-open": e.showEndDateOnOpen, granularity: e.selectedGranularity, variant: e.variant, "is-range": "" }, on: { input: e.onDateInput, "start-date-selected": e.onStartDateSelected, "end-date-selected": e.onEndDateSelected } })], 1)]);
|
|
618
|
-
},
|
|
617
|
+
}, Pt = [], Bt = /* @__PURE__ */ Le(
|
|
618
|
+
Ft,
|
|
619
619
|
Ut,
|
|
620
620
|
Pt,
|
|
621
|
-
Bt,
|
|
622
621
|
!1,
|
|
623
622
|
null,
|
|
624
|
-
"
|
|
623
|
+
"0477a483"
|
|
625
624
|
);
|
|
626
|
-
const P =
|
|
625
|
+
const P = Bt.exports, Nt = ({
|
|
627
626
|
datePickerValue: t,
|
|
628
627
|
isDateIncorrect: e,
|
|
629
628
|
quickSelectRanges: n,
|
|
630
629
|
isMonthVariant: i
|
|
631
630
|
}) => {
|
|
632
|
-
var
|
|
633
|
-
const { locale: l, t:
|
|
634
|
-
locale:
|
|
635
|
-
}) : void 0, T =
|
|
636
|
-
startDate: y((
|
|
637
|
-
endDate: y((
|
|
638
|
-
startTime: y((
|
|
639
|
-
endTime: y((
|
|
631
|
+
var x, I, z, v;
|
|
632
|
+
const { locale: l, t: c } = ye(), D = ge(), r = (O) => !!O && !isNaN(O.getTime()), y = (O, $) => r(O) ? ne(O, $, {
|
|
633
|
+
locale: D[l.value.substring(0, 2)] || D.enUS
|
|
634
|
+
}) : void 0, T = De({
|
|
635
|
+
startDate: y((x = t.value) == null ? void 0 : x.startDate, k.NUMERIC_DATE_YEAR_FIRST),
|
|
636
|
+
endDate: y((I = t.value) == null ? void 0 : I.endDate, k.NUMERIC_DATE_YEAR_FIRST),
|
|
637
|
+
startTime: y((z = t.value) == null ? void 0 : z.startDate, k.HOUR_MINUTE_SECONDS),
|
|
638
|
+
endTime: y((v = t.value) == null ? void 0 : v.endDate, k.HOUR_MINUTE_SECONDS)
|
|
640
639
|
});
|
|
641
640
|
return {
|
|
642
641
|
// Values
|
|
@@ -645,25 +644,25 @@ const P = Nt.exports, qt = ({
|
|
|
645
644
|
if (e.value)
|
|
646
645
|
return `${T.startDate || ""} - ${T.endDate || ""}`;
|
|
647
646
|
if (!t.value || !t.value.startDate && !t.value.endDate)
|
|
648
|
-
return
|
|
647
|
+
return c("selectDateRange");
|
|
649
648
|
if ((p = n.value) != null && p.length) {
|
|
650
|
-
const
|
|
651
|
-
var
|
|
652
|
-
return F === ((
|
|
649
|
+
const C = n.value.find(({ value: F }) => {
|
|
650
|
+
var M;
|
|
651
|
+
return F === ((M = t.value) == null ? void 0 : M.range);
|
|
653
652
|
});
|
|
654
|
-
if (
|
|
655
|
-
return
|
|
653
|
+
if (C)
|
|
654
|
+
return C.label;
|
|
656
655
|
}
|
|
657
656
|
if (t.value.granularity === "quarterly") {
|
|
658
|
-
const { startDate:
|
|
659
|
-
if (
|
|
660
|
-
return
|
|
661
|
-
const
|
|
662
|
-
return `${
|
|
657
|
+
const { startDate: C, endDate: F } = t.value, M = c("quarter", { quarter: Me(C), year: we(C) });
|
|
658
|
+
if (Rt(C, F))
|
|
659
|
+
return M;
|
|
660
|
+
const ee = c("quarter", { quarter: Me(F), year: we(F) });
|
|
661
|
+
return `${M} - ${ee}`;
|
|
663
662
|
}
|
|
664
|
-
const { startDate:
|
|
665
|
-
return `${y(
|
|
666
|
-
|
|
663
|
+
const { startDate: O, endDate: $ } = T, A = i != null && i.value ? k.LONG_MONTH_YEAR : k.FULL_DATE_MONTH_FIRST;
|
|
664
|
+
return `${y(K(O), A)} - ${y(
|
|
665
|
+
K($),
|
|
667
666
|
A
|
|
668
667
|
)}`;
|
|
669
668
|
}),
|
|
@@ -672,8 +671,8 @@ const P = Nt.exports, qt = ({
|
|
|
672
671
|
formatTextInputDisplayValue: () => ""
|
|
673
672
|
};
|
|
674
673
|
};
|
|
675
|
-
var
|
|
676
|
-
const
|
|
674
|
+
var ce = /* @__PURE__ */ ((t) => (t.INPUT = "input", t))(ce || {});
|
|
675
|
+
const qt = {
|
|
677
676
|
"en-US": {
|
|
678
677
|
apply: "Apply",
|
|
679
678
|
cancel: "Cancel",
|
|
@@ -694,20 +693,20 @@ const Lt = {
|
|
|
694
693
|
cancel: "Cancelar",
|
|
695
694
|
selectDate: "Selecione uma data"
|
|
696
695
|
}
|
|
697
|
-
},
|
|
698
|
-
i18n: { messages:
|
|
696
|
+
}, Lt = Pe({
|
|
697
|
+
i18n: { messages: qt },
|
|
699
698
|
name: "bento-date-range-picker",
|
|
700
699
|
components: {
|
|
701
|
-
BentoButtonActions:
|
|
702
|
-
BentoDivider:
|
|
700
|
+
BentoButtonActions: yt,
|
|
701
|
+
BentoDivider: tt,
|
|
703
702
|
BentoTypography: Ne,
|
|
704
|
-
BentoPopover:
|
|
703
|
+
BentoPopover: at,
|
|
705
704
|
DateRangePickerCalendar: P,
|
|
706
|
-
DropdownInputDefault:
|
|
707
|
-
ErrorMessage:
|
|
708
|
-
FieldLabel:
|
|
705
|
+
DropdownInputDefault: rt,
|
|
706
|
+
ErrorMessage: gt,
|
|
707
|
+
FieldLabel: pt
|
|
709
708
|
},
|
|
710
|
-
directives: { BentoClickOutsideDirective:
|
|
709
|
+
directives: { BentoClickOutsideDirective: vt },
|
|
711
710
|
props: {
|
|
712
711
|
/**
|
|
713
712
|
* Allows user to enter time values in the form
|
|
@@ -809,159 +808,159 @@ const Lt = {
|
|
|
809
808
|
*/
|
|
810
809
|
hasActions: { type: Boolean, default: !1 }
|
|
811
810
|
},
|
|
812
|
-
emits: [
|
|
811
|
+
emits: [ce.INPUT],
|
|
813
812
|
setup(t, { emit: e }) {
|
|
814
|
-
const { locale: n, t: i } = ye(), l = ge(),
|
|
815
|
-
() => t.label || i("dateRangePicker", { name:
|
|
816
|
-
), _ =
|
|
813
|
+
const { locale: n, t: i } = ye(), l = ge(), c = te("bento-date-range-picker-container"), D = te("bento-date-range-picker-label"), r = te("bento-date-range-picker-description"), y = te("bento-date-range-picker-error"), T = te("bento-date-range-picker-date-error"), se = g(
|
|
814
|
+
() => t.label || i("dateRangePicker", { name: c })
|
|
815
|
+
), _ = w(!1), x = w(null), I = w(!1), { isReadOnly: z } = dt(fe(t, "readonly"));
|
|
817
816
|
ve(
|
|
818
817
|
() => t.disabled,
|
|
819
818
|
() => {
|
|
820
|
-
t.disabled &&
|
|
819
|
+
t.disabled && I.value && (I.value = !1);
|
|
821
820
|
}
|
|
822
821
|
);
|
|
823
|
-
const
|
|
824
|
-
"b-date-range-picker__description--error": !!t.errorMessage ||
|
|
825
|
-
})), $ = g(() => t.variant === "month"), { dateDisplayValue: A, textInputDisplayValue: p } =
|
|
822
|
+
const v = g(() => t.hasActions ? !G.value && _.value : _.value), O = g(() => ({
|
|
823
|
+
"b-date-range-picker__description--error": !!t.errorMessage || v.value
|
|
824
|
+
})), $ = g(() => t.variant === "month"), { dateDisplayValue: A, textInputDisplayValue: p } = Nt({
|
|
826
825
|
datePickerValue: fe(t, "value"),
|
|
827
826
|
isDateIncorrect: _,
|
|
828
827
|
quickSelectRanges: fe(t, "quickSelectRanges"),
|
|
829
828
|
isMonthVariant: $
|
|
830
|
-
}),
|
|
829
|
+
}), C = g(
|
|
831
830
|
() => `${t.description ? r : ""} ${t.errorMessage ? y : ""} ${_.value ? T : ""}`.trim() || null
|
|
832
|
-
), F = g(() => t.allowTimeInput && t.variant !== "month"),
|
|
833
|
-
|
|
834
|
-
},
|
|
835
|
-
|
|
836
|
-
},
|
|
831
|
+
), F = g(() => t.allowTimeInput && t.variant !== "month"), M = () => {
|
|
832
|
+
I.value = !1;
|
|
833
|
+
}, ee = () => {
|
|
834
|
+
I.value = !0;
|
|
835
|
+
}, oe = w(A.value), U = w(
|
|
837
836
|
// textInputDisplayValue is a reactive object
|
|
838
837
|
structuredClone(pe(p))
|
|
839
|
-
),
|
|
840
|
-
() => t.hasActions ?
|
|
841
|
-
),
|
|
842
|
-
() => t.hasActions ?
|
|
838
|
+
), N = w(t.value), G = w(!0), b = g(
|
|
839
|
+
() => t.hasActions ? U.value : p
|
|
840
|
+
), J = g(
|
|
841
|
+
() => t.hasActions ? oe.value : A.value
|
|
843
842
|
);
|
|
844
843
|
Be(() => {
|
|
845
|
-
if (t.hasActions ||
|
|
844
|
+
if (t.hasActions || nt(
|
|
846
845
|
'BentoDateRangePicker "hasActions" property',
|
|
847
846
|
`Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
|
|
848
847
|
This will be the default behavior in the v2 and "hasActions" will be removed.`,
|
|
849
848
|
"2.0.0"
|
|
850
|
-
), t.granularities && t.variant !== "month" && t.granularities.find(({ type:
|
|
849
|
+
), t.granularities && t.variant !== "month" && t.granularities.find(({ type: m }) => m === "quarterly"))
|
|
851
850
|
throw new Error(
|
|
852
851
|
'Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"'
|
|
853
852
|
);
|
|
854
853
|
}), ve(
|
|
855
854
|
() => t.value,
|
|
856
855
|
() => {
|
|
857
|
-
|
|
856
|
+
oe.value = A.value, U.value = structuredClone(pe(p));
|
|
858
857
|
}
|
|
859
858
|
);
|
|
860
|
-
const
|
|
859
|
+
const q = g(() => [
|
|
861
860
|
{
|
|
862
861
|
title: i("apply"),
|
|
863
862
|
event: () => {
|
|
864
|
-
e(
|
|
863
|
+
e(ce.INPUT, N.value), M(), G.value = !0;
|
|
865
864
|
},
|
|
866
|
-
disabled:
|
|
865
|
+
disabled: G.value
|
|
867
866
|
},
|
|
868
867
|
{
|
|
869
868
|
title: i("cancel"),
|
|
870
|
-
event:
|
|
869
|
+
event: M
|
|
871
870
|
}
|
|
872
871
|
]);
|
|
873
|
-
return ve(
|
|
872
|
+
return ve(N, (m) => {
|
|
874
873
|
if (t.hasActions) {
|
|
875
|
-
|
|
874
|
+
G.value = _.value;
|
|
876
875
|
return;
|
|
877
876
|
}
|
|
878
|
-
e(
|
|
877
|
+
e(ce.INPUT, m);
|
|
879
878
|
}), {
|
|
880
879
|
// Refs
|
|
881
|
-
inputContainerRef:
|
|
880
|
+
inputContainerRef: x,
|
|
882
881
|
// Values,
|
|
883
882
|
dateDisplayValue: A,
|
|
884
|
-
datePickerContainerId:
|
|
885
|
-
descriptionConditionalClasses:
|
|
886
|
-
displayedTextInputValue:
|
|
887
|
-
displayedDateValue:
|
|
883
|
+
datePickerContainerId: c,
|
|
884
|
+
descriptionConditionalClasses: O,
|
|
885
|
+
displayedTextInputValue: b,
|
|
886
|
+
displayedDateValue: J,
|
|
888
887
|
isDateIncorrect: _,
|
|
889
|
-
isDateRangePickerOpen:
|
|
890
|
-
isReadOnly:
|
|
891
|
-
labelId:
|
|
888
|
+
isDateRangePickerOpen: I,
|
|
889
|
+
isReadOnly: z,
|
|
890
|
+
labelId: D,
|
|
892
891
|
descriptionId: r,
|
|
893
892
|
dateErrorId: T,
|
|
894
893
|
errorId: y,
|
|
895
|
-
popoverAriaLabel:
|
|
896
|
-
shouldDisplayError:
|
|
897
|
-
ariaDescribedBy:
|
|
894
|
+
popoverAriaLabel: se,
|
|
895
|
+
shouldDisplayError: v,
|
|
896
|
+
ariaDescribedBy: C,
|
|
898
897
|
textInputDisplayValue: p,
|
|
899
|
-
rangePickerButtonActions:
|
|
900
|
-
BentoButtonActionsLayout:
|
|
898
|
+
rangePickerButtonActions: q,
|
|
899
|
+
BentoButtonActionsLayout: Tt,
|
|
901
900
|
withTimeInput: F,
|
|
902
901
|
// Events
|
|
903
|
-
closeDateRangePicker:
|
|
902
|
+
closeDateRangePicker: M,
|
|
904
903
|
clearDateRangePickerValue: async () => {
|
|
905
|
-
_.value && (_.value = !1),
|
|
904
|
+
_.value && (_.value = !1), N.value = null;
|
|
906
905
|
},
|
|
907
|
-
openDateRangePicker:
|
|
908
|
-
onRangeSelectorInput: (
|
|
909
|
-
if (
|
|
910
|
-
const
|
|
906
|
+
openDateRangePicker: ee,
|
|
907
|
+
onRangeSelectorInput: (m) => {
|
|
908
|
+
if (m) {
|
|
909
|
+
const R = (X) => ne(X, k.NUMERIC_DATE_YEAR_FIRST, {
|
|
911
910
|
locale: l[n.value.substring(0, 2)] || l.enUS
|
|
912
911
|
});
|
|
913
|
-
p.startDate =
|
|
912
|
+
p.startDate = R(m.startDate), p.endDate = R(m.endDate), N.value = m;
|
|
914
913
|
}
|
|
915
914
|
},
|
|
916
915
|
onEnterPressedOverInput: () => {
|
|
917
|
-
if (!
|
|
918
|
-
|
|
916
|
+
if (!I.value) {
|
|
917
|
+
I.value = !0;
|
|
919
918
|
return;
|
|
920
919
|
}
|
|
921
|
-
_.value || (
|
|
920
|
+
_.value || (I.value = !1);
|
|
922
921
|
},
|
|
923
|
-
onDateRangePickerInput: (
|
|
922
|
+
onDateRangePickerInput: (m) => {
|
|
924
923
|
_.value = !1;
|
|
925
|
-
const
|
|
924
|
+
const R = (X, me) => X ? ne(X, me, {
|
|
926
925
|
locale: l[n.value.substring(0, 2)] || l.enUS
|
|
927
926
|
}) : void 0;
|
|
928
|
-
p.startDate =
|
|
929
|
-
|
|
927
|
+
p.startDate = R(
|
|
928
|
+
m.startDate,
|
|
930
929
|
k.NUMERIC_DATE_YEAR_FIRST
|
|
931
|
-
), p.endDate =
|
|
930
|
+
), p.endDate = R(m.endDate, k.NUMERIC_DATE_YEAR_FIRST), p.startTime = R(m.startDate, k.HOUR_MINUTE_SECONDS), p.endTime = R(m.endDate, k.HOUR_MINUTE_SECONDS), N.value = m;
|
|
932
931
|
},
|
|
933
|
-
onDateRangePickerError: (
|
|
934
|
-
_.value = !0, p.startDate =
|
|
932
|
+
onDateRangePickerError: (m) => {
|
|
933
|
+
_.value = !0, p.startDate = m.startDate, p.endDate = m.endDate, N.value = { startDate: null, endDate: null };
|
|
935
934
|
},
|
|
936
|
-
onDateRangePickerFormDateInputUpdate: (
|
|
937
|
-
_.value = !1,
|
|
935
|
+
onDateRangePickerFormDateInputUpdate: (m) => {
|
|
936
|
+
_.value = !1, m.startTime && (p.startTime = m.startTime), m.endTime && (p.endTime = m.endTime);
|
|
938
937
|
},
|
|
939
938
|
// Translations
|
|
940
939
|
t: i
|
|
941
940
|
};
|
|
942
941
|
}
|
|
943
942
|
});
|
|
944
|
-
var
|
|
943
|
+
var Yt = function() {
|
|
945
944
|
var e = this, n = e._self._c;
|
|
946
945
|
return e._self._setupProxy, n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [e.label ? n("field-label", { attrs: { id: e.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), n("div", { on: { keydown: function(i) {
|
|
947
946
|
return !i.type.indexOf("key") && e._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : e.onEnterPressedOverInput.apply(null, arguments);
|
|
948
947
|
} } }, [n("dropdown-input-default", { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: e.datePickerContainerId, ariaExpanded: e.isDateRangePickerOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "is-invalid": !!e.errorMessage || e.shouldDisplayError, open: e.isDateRangePickerOpen, "display-value": e.displayedDateValue, readonly: e.isReadOnly }, on: { open: e.openDateRangePicker, clear: e.clearDateRangePickerValue, close: e.closeDateRangePicker } })], 1), e.shouldDisplayError ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.t("provideDateInAFormat") } }) : e._e(), e.errorMessage ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? n("bento-typography", { staticClass: "b-date-range-picker__description", class: e.descriptionConditionalClasses, attrs: { id: e.descriptionId, el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), e.inputContainerRef ? n("bento-popover", { staticClass: "b-date-range-picker__container", attrs: { id: e.datePickerContainerId, open: e.isDateRangePickerOpen, "target-element": e.inputContainerRef, "disable-focus-trap": !0, "aria-label": e.popoverAriaLabel, position: "bottom-start", "without-space": "", "fit-content": "" } }, [n("date-range-picker-calendar", { attrs: { "allow-time-input": e.withTimeInput, "quick-select-ranges": e.quickSelectRanges, value: e.value, "first-day-of-week": e.firstDayOfWeek, granularities: e.granularities, "is-date-disabled": e.isDateDisabled, "max-range": e.maxRange, min: e.min, max: e.max, "number-of-months": e.numberOfMonths, "show-end-date-on-open": e.showEndDateOnOpen, "date-form-data": e.displayedTextInputValue, variant: e.variant }, on: { "custom-range": e.onRangeSelectorInput, input: e.onDateRangePickerInput, error: e.onDateRangePickerError, "form-date": e.onDateRangePickerFormDateInputUpdate }, scopedSlots: e._u([e.hasActions ? { key: "actions", fn: function() {
|
|
949
948
|
return [n("bento-divider"), n("div", { staticClass: "b-date-range-picker__footer" }, [n("bento-button-actions", { attrs: { actions: e.rangePickerButtonActions, layout: e.BentoButtonActionsLayout.SPACE_BETWEEN } })], 1)];
|
|
950
949
|
}, proxy: !0 } : null], null, !0) })], 1) : e._e()], 1);
|
|
951
|
-
},
|
|
950
|
+
}, $t = [], Gt = /* @__PURE__ */ Le(
|
|
951
|
+
Lt,
|
|
952
952
|
Yt,
|
|
953
953
|
$t,
|
|
954
|
-
jt,
|
|
955
954
|
!1,
|
|
956
955
|
null,
|
|
957
956
|
"f7eae115"
|
|
958
957
|
);
|
|
959
|
-
const
|
|
958
|
+
const ma = Gt.exports;
|
|
960
959
|
export {
|
|
961
|
-
|
|
960
|
+
ma as B,
|
|
962
961
|
P as D,
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
962
|
+
ce as a,
|
|
963
|
+
bt as b,
|
|
964
|
+
_t as i
|
|
966
965
|
};
|
|
967
|
-
//# sourceMappingURL=date-range-picker.
|
|
966
|
+
//# sourceMappingURL=date-range-picker.Cx4vdGUZ.js.map
|