@adyen/bento-vue2 1.87.0 → 1.87.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/button-actions.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/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/chunks/{data-grid.ZjYQaN9_.js → data-grid.BvukOpky.js} +12 -12
- package/dist/chunks/{data-grid.ZjYQaN9_.js.map → data-grid.BvukOpky.js.map} +1 -1
- package/dist/chunks/{date-range-picker.CJexeNJg.js → date-range-picker.BJ-ARlkH.js} +330 -350
- package/dist/chunks/{date-range-picker.CJexeNJg.js.map → date-range-picker.BJ-ARlkH.js.map} +1 -1
- package/dist/chunks/{filter-bar.DkKvGUEm.js → filter-bar.DrkWf7T6.js} +2 -2
- package/dist/chunks/{filter-bar.DkKvGUEm.js.map → filter-bar.DrkWf7T6.js.map} +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/index.js +3 -3
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { j as
|
|
3
|
-
import { B as
|
|
4
|
-
import { h as
|
|
5
|
-
import { B as
|
|
6
|
-
import { B as
|
|
7
|
-
import { B as
|
|
8
|
-
import { B as
|
|
1
|
+
import { reactive as fe, defineComponent as Qe, useSlots as ot, ref as S, computed as f, onMounted as We, toRaw as _e, watch as pe, useAttrs as lt, toRef as ye } from "vue";
|
|
2
|
+
import { j as it } from "./index.CwzYJHw2.js";
|
|
3
|
+
import { B as ut } from "./divider.DX5gwN7p.js";
|
|
4
|
+
import { h as dt, B as ct } from "./button-actions.DyPS54Yi.js";
|
|
5
|
+
import { B as $e, d as Ce } from "./typography.C8lPlsbD.js";
|
|
6
|
+
import { B as mt } from "./input-field.CSCJTxk1.js";
|
|
7
|
+
import { B as Dt } from "./dropdown.ET_mq1_P.js";
|
|
8
|
+
import { B as pt } from "./segmented-control.BqIiX9hv.js";
|
|
9
9
|
import { u as be } from "./index.B6WW_F-J.js";
|
|
10
|
-
import { d as
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as
|
|
13
|
-
import { e as
|
|
14
|
-
import { e as
|
|
10
|
+
import { d as De } from "./debounce.DUTu11PS.js";
|
|
11
|
+
import { u as ft } from "./use-has-slot.C9lQZ6nz.js";
|
|
12
|
+
import { u as Ie, a as vt } from "./use-date-input-formatter.Dcjry8op.js";
|
|
13
|
+
import { e as Ge, f as se, i as w, h as I, j as yt, k as Be, l as gt, s as xe, m as Tt, n as Ae, b as P, u as _t, o as E, g as bt } from "./calendar.BNg7mSj5.js";
|
|
14
|
+
import { e as A, a as qe } from "./differenceInMonths.CIYECBxK.js";
|
|
15
15
|
import { s as Ye } from "./startOfWeek.CXhhX-R7.js";
|
|
16
|
-
import { t as
|
|
17
|
-
import { c as
|
|
16
|
+
import { t as N, n as It, c as Rt } from "./en-US.YeSsZuOc.js";
|
|
17
|
+
import { c as ht } from "./constructNow.CIc7d13I.js";
|
|
18
18
|
import { n as Ke } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
19
|
-
import { D as
|
|
20
|
-
import { g as
|
|
21
|
-
import { u as
|
|
19
|
+
import { D as kt } from "./dropdown-default-textbox.CKnrDQ2z.js";
|
|
20
|
+
import { g as re } from "./generate-uid.NJ8tVoha.js";
|
|
21
|
+
import { u as Mt } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
22
22
|
import "./index.Cl4_42j5.js";
|
|
23
|
-
import { u as
|
|
23
|
+
import { u as St } from "./form-field.D_2g7vaP.js";
|
|
24
24
|
import { B as Et } from "./directive.rXUeDb8p.js";
|
|
25
|
-
import { F as
|
|
25
|
+
import { F as Ft, E as Ot } from "./error-message.CYfT0Qsi.js";
|
|
26
26
|
import { B as wt } from "./button-actions.types.BptAXjD8.js";
|
|
27
27
|
import "../assets/date-range-picker.css";
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function He(r, t, e) {
|
|
29
|
+
return Ge(r, t * 3, e);
|
|
30
30
|
}
|
|
31
31
|
function Pe(r, t) {
|
|
32
|
-
const e =
|
|
32
|
+
const e = N(r, t == null ? void 0 : t.in);
|
|
33
33
|
return Math.trunc(e.getMonth() / 3) + 1;
|
|
34
34
|
}
|
|
35
35
|
function Ne(r, t) {
|
|
36
|
-
return
|
|
36
|
+
return N(r, t == null ? void 0 : t.in).getFullYear();
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return +
|
|
38
|
+
function ge(r, t) {
|
|
39
|
+
return +N(r) == +N(t);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Ct(r, t, e) {
|
|
42
42
|
const [a, l] = It(
|
|
43
43
|
e == null ? void 0 : e.in,
|
|
44
44
|
r,
|
|
45
45
|
t
|
|
46
46
|
);
|
|
47
|
-
return +
|
|
47
|
+
return +se(a) == +se(l);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const e =
|
|
49
|
+
function Le(r, t) {
|
|
50
|
+
const e = N(r, t == null ? void 0 : t.in);
|
|
51
51
|
return e.setMilliseconds(0), e;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
return +
|
|
53
|
+
function Te(r, t) {
|
|
54
|
+
return +Le(r) == +Le(t);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Bt(r, t) {
|
|
57
57
|
return w(
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
Rt(r, r),
|
|
59
|
+
ht(r)
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const a =
|
|
62
|
+
function xt(r, t, e) {
|
|
63
|
+
const a = N(r, e == null ? void 0 : e.in);
|
|
64
64
|
return a.setHours(t), a;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const a =
|
|
66
|
+
function Ue(r, t, e) {
|
|
67
|
+
const a = N(r, e == null ? void 0 : e.in);
|
|
68
68
|
return a.setMilliseconds(t), a;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const a =
|
|
70
|
+
function At(r, t, e) {
|
|
71
|
+
const a = N(r, e == null ? void 0 : e.in);
|
|
72
72
|
return a.setMinutes(t), a;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const a =
|
|
74
|
+
function qt(r, t, e) {
|
|
75
|
+
const a = N(r, e == null ? void 0 : e.in);
|
|
76
76
|
return a.setSeconds(t), a;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return
|
|
78
|
+
function Yt(r, t, e) {
|
|
79
|
+
return He(r, -1, e);
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const Pt = ({
|
|
82
82
|
firstDayOfWeek: r,
|
|
83
83
|
min: t,
|
|
84
84
|
max: e
|
|
85
85
|
}) => ({ getGranularCalendarLimits: (l) => {
|
|
86
86
|
if (!t && !e)
|
|
87
87
|
return { min: null, max: null };
|
|
88
|
-
let m = t ?
|
|
88
|
+
let m = t ? I(t) : null, D = e ? A(e) : null;
|
|
89
89
|
if ((l == null ? void 0 : l.type) === "weekly") {
|
|
90
90
|
if (l.earliest)
|
|
91
|
-
m =
|
|
91
|
+
m = I(l.earliest);
|
|
92
92
|
else if (m) {
|
|
93
93
|
const v = Ye(m, { weekStartsOn: r });
|
|
94
|
-
w(m, v) || (m =
|
|
94
|
+
w(m, v) || (m = I(yt(Be(m, { weekStartsOn: r }), 1)));
|
|
95
95
|
}
|
|
96
96
|
if (l.latest)
|
|
97
|
-
D =
|
|
97
|
+
D = A(l.latest);
|
|
98
98
|
else if (D) {
|
|
99
99
|
const v = Be(D, { weekStartsOn: r });
|
|
100
|
-
w(D, v) || (D =
|
|
100
|
+
w(D, v) || (D = A(gt(Ye(D, { weekStartsOn: r }), 1)));
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
if ((l == null ? void 0 : l.type) === "monthly") {
|
|
104
104
|
if (l.earliest)
|
|
105
|
-
m =
|
|
105
|
+
m = I(l.earliest);
|
|
106
106
|
else if (m) {
|
|
107
107
|
const v = xe(m);
|
|
108
|
-
w(m, v) || (m = xe(
|
|
108
|
+
w(m, v) || (m = xe(Ge(m, 1)));
|
|
109
109
|
}
|
|
110
110
|
if (l.latest)
|
|
111
|
-
D =
|
|
111
|
+
D = A(l.latest);
|
|
112
112
|
else if (D) {
|
|
113
113
|
const v = qe(D);
|
|
114
|
-
w(D, v) || (D = qe(
|
|
114
|
+
w(D, v) || (D = qe(Tt(D, 1)));
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
if ((l == null ? void 0 : l.type) === "quarterly") {
|
|
118
118
|
if (l.earliest)
|
|
119
|
-
m =
|
|
119
|
+
m = se(l.earliest);
|
|
120
120
|
else if (m) {
|
|
121
|
-
const v =
|
|
122
|
-
w(m, v) || (m =
|
|
121
|
+
const v = se(m);
|
|
122
|
+
w(m, v) || (m = se(He(m, 1)));
|
|
123
123
|
}
|
|
124
124
|
if (l.latest)
|
|
125
|
-
D =
|
|
125
|
+
D = A(l.latest);
|
|
126
126
|
else if (D) {
|
|
127
127
|
const v = Ae(D);
|
|
128
|
-
w(D, v) || (D = Ae(
|
|
128
|
+
w(D, v) || (D = Ae(Yt(D)));
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
return { min: m, max: D };
|
|
132
|
-
} }),
|
|
133
|
-
const r =
|
|
132
|
+
} }), Nt = () => {
|
|
133
|
+
const r = fe({
|
|
134
134
|
daily: null,
|
|
135
135
|
weekly: null,
|
|
136
136
|
monthly: null,
|
|
@@ -147,18 +147,18 @@ const Nt = ({
|
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
149
|
var g = /* @__PURE__ */ ((r) => (r.CUSTOM_RANGE = "custom-range", r.INPUT = "input", r.ERROR = "error", r.FORM_DATE = "form-date", r.START_DATE_SELECTED = "start-date-selected", r))(g || {});
|
|
150
|
-
const Lt = /[\d]/,
|
|
150
|
+
const Lt = /[\d]/, Ut = /^\d{2}$/, jt = /^\d{2}:\d{2}$/, Qt = (r) => {
|
|
151
151
|
const { selectionStart: t } = r.target, e = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"], a = Lt.test(r.key) || e.includes(r.key), l = [1, 2, 4, 5].includes(t) && r.key === ":";
|
|
152
152
|
!a && !l && r.preventDefault();
|
|
153
|
-
},
|
|
153
|
+
}, je = (r) => {
|
|
154
154
|
if (!r)
|
|
155
155
|
return r;
|
|
156
156
|
let t = r;
|
|
157
157
|
if (t.length === 1 && parseInt(r, 10) > 2)
|
|
158
158
|
return `0${t}:`;
|
|
159
159
|
const [e, a] = t.slice(-2);
|
|
160
|
-
return [2, 5].includes(t.length) && a === ":" && (t = `${t.slice(0, t.length - 2)}0${e}`), (
|
|
161
|
-
},
|
|
160
|
+
return [2, 5].includes(t.length) && a === ":" && (t = `${t.slice(0, t.length - 2)}0${e}`), (Ut.test(t) || jt.test(t)) && (t += ":"), t;
|
|
161
|
+
}, Wt = {
|
|
162
162
|
"en-US": {
|
|
163
163
|
"DD-MM-YYYY": "DD-MM-YYYY",
|
|
164
164
|
"MM-DD-YYYY": "MM-DD-YYYY",
|
|
@@ -204,11 +204,11 @@ const Lt = /[\d]/, jt = /^\d{2}$/, Qt = /^\d{2}:\d{2}$/, Wt = (r) => {
|
|
|
204
204
|
timeTo: "Hora de",
|
|
205
205
|
weekly: "Semanal"
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, $t = {
|
|
208
208
|
name: "date-range-picker-calendar",
|
|
209
|
-
i18n: { messages:
|
|
210
|
-
},
|
|
211
|
-
|
|
209
|
+
i18n: { messages: Wt }
|
|
210
|
+
}, Gt = /* @__PURE__ */ Qe({
|
|
211
|
+
...$t,
|
|
212
212
|
props: {
|
|
213
213
|
/**
|
|
214
214
|
* Allows user to enter time values in the form
|
|
@@ -224,7 +224,7 @@ const Lt = /[\d]/, jt = /^\d{2}$/, Qt = /^\d{2}:\d{2}$/, Wt = (r) => {
|
|
|
224
224
|
/**
|
|
225
225
|
* Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
226
226
|
*/
|
|
227
|
-
firstDayOfWeek:
|
|
227
|
+
firstDayOfWeek: P.props.firstDayOfWeek,
|
|
228
228
|
/**
|
|
229
229
|
* A list of available granularities.
|
|
230
230
|
* If present, the date picker will display a segmented control to change granularity.
|
|
@@ -236,25 +236,25 @@ const Lt = /[\d]/, jt = /^\d{2}$/, Qt = /^\d{2}:\d{2}$/, Wt = (r) => {
|
|
|
236
236
|
/**
|
|
237
237
|
* Indicate if a date should be disabled or not
|
|
238
238
|
*/
|
|
239
|
-
isDateDisabled:
|
|
239
|
+
isDateDisabled: P.props.isDateDisabled,
|
|
240
240
|
/**
|
|
241
241
|
* Set a maximum number of dates to be selectable by the range.
|
|
242
242
|
*/
|
|
243
|
-
maxRange:
|
|
243
|
+
maxRange: P.props.maxRange,
|
|
244
244
|
/**
|
|
245
245
|
* Sets a minimum limit for selectable dates - dates before `min` will not be selectable
|
|
246
246
|
*/
|
|
247
|
-
min:
|
|
247
|
+
min: P.props.min,
|
|
248
248
|
/**
|
|
249
249
|
* Sets a maximum limit for selectable dates - dates after `max` will not be selectable
|
|
250
250
|
*/
|
|
251
|
-
max:
|
|
251
|
+
max: P.props.max,
|
|
252
252
|
/**
|
|
253
253
|
* Number of months rendered on pane
|
|
254
254
|
*/
|
|
255
255
|
numberOfMonths: {
|
|
256
|
-
type:
|
|
257
|
-
default:
|
|
256
|
+
type: P.props.numberOfMonths.type,
|
|
257
|
+
default: P.props.numberOfMonths.default,
|
|
258
258
|
validator: (r) => r >= 0
|
|
259
259
|
},
|
|
260
260
|
/**
|
|
@@ -279,7 +279,7 @@ const Lt = /[\d]/, jt = /^\d{2}$/, Qt = /^\d{2}:\d{2}$/, Wt = (r) => {
|
|
|
279
279
|
/**
|
|
280
280
|
* The type of calendar to display. Defaults to showing days.
|
|
281
281
|
*/
|
|
282
|
-
variant:
|
|
282
|
+
variant: P.props.variant
|
|
283
283
|
},
|
|
284
284
|
emits: [
|
|
285
285
|
g.CUSTOM_RANGE,
|
|
@@ -289,247 +289,227 @@ const Lt = /[\d]/, jt = /^\d{2}$/, Qt = /^\d{2}:\d{2}$/, Wt = (r) => {
|
|
|
289
289
|
g.START_DATE_SELECTED
|
|
290
290
|
],
|
|
291
291
|
setup(r, { emit: t }) {
|
|
292
|
-
var
|
|
293
|
-
const e = r, a = 300, l = "customRange", m =
|
|
294
|
-
dateFormat:
|
|
295
|
-
isFormatValid:
|
|
292
|
+
var Ee, Fe, Oe, we;
|
|
293
|
+
const e = r, a = 300, l = "customRange", m = ot(), D = ft(m), { t: v } = be(), {
|
|
294
|
+
dateFormat: W,
|
|
295
|
+
isFormatValid: L,
|
|
296
296
|
parseDate: y,
|
|
297
|
-
onKeyDown:
|
|
297
|
+
onKeyDown: Z,
|
|
298
298
|
autoFormat: H,
|
|
299
299
|
formatDate: p
|
|
300
|
-
} =
|
|
301
|
-
startDate: (
|
|
302
|
-
endDate: (
|
|
300
|
+
} = Ie(), q = S({}), h = f(() => e.variant === "month" ? "monthly" : "daily"), C = f(() => e.numberOfMonths === 0), s = fe({
|
|
301
|
+
startDate: (Ee = e.value) == null ? void 0 : Ee.startDate,
|
|
302
|
+
endDate: (Fe = e.value) == null ? void 0 : Fe.endDate,
|
|
303
303
|
range: (Oe = e.value) == null ? void 0 : Oe.range,
|
|
304
304
|
...e.granularities ? {
|
|
305
|
-
granularity: ((
|
|
305
|
+
granularity: ((we = e.value) == null ? void 0 : we.granularity) || h.value
|
|
306
306
|
} : {}
|
|
307
|
-
})
|
|
308
|
-
function _(n) {
|
|
309
|
-
return n ? new Date(
|
|
310
|
-
n.getUTCFullYear(),
|
|
311
|
-
n.getUTCMonth(),
|
|
312
|
-
n.getUTCDate(),
|
|
313
|
-
n.getUTCHours(),
|
|
314
|
-
n.getUTCMinutes(),
|
|
315
|
-
n.getUTCSeconds()
|
|
316
|
-
) : null;
|
|
317
|
-
}
|
|
318
|
-
const R = f(() => {
|
|
307
|
+
}), F = f(() => {
|
|
319
308
|
var n, i;
|
|
320
309
|
return (
|
|
321
310
|
// eslint-disable-next-line consistent-return
|
|
322
|
-
((i = (n = e == null ? void 0 : e.quickSelectRanges) == null ? void 0 : n.find(({ value:
|
|
323
|
-
var
|
|
311
|
+
((i = (n = e == null ? void 0 : e.quickSelectRanges) == null ? void 0 : n.find(({ value: d, data: c }) => {
|
|
312
|
+
var b;
|
|
324
313
|
if (!c.endDate) {
|
|
325
314
|
if (c.isRelativeToNow) {
|
|
326
|
-
const
|
|
327
|
-
return
|
|
328
|
-
_(E.startDate),
|
|
329
|
-
_(s.startDate)
|
|
330
|
-
) && fe(
|
|
331
|
-
_(E.endDate),
|
|
332
|
-
_(s.endDate)
|
|
333
|
-
) : (
|
|
315
|
+
const k = (b = q.value) == null ? void 0 : b[d];
|
|
316
|
+
return k ? ge(k.startDate, s.startDate) && ge(k.endDate, s.endDate) : (
|
|
334
317
|
// If not stored calculated dates, fall back to comparing the quick select item's value
|
|
335
318
|
// with the internal range's stored range identifier.
|
|
336
|
-
|
|
319
|
+
d === s.range
|
|
337
320
|
);
|
|
338
321
|
}
|
|
339
|
-
return
|
|
340
|
-
_(s.endDate),
|
|
341
|
-
_(x(s.endDate))
|
|
342
|
-
) && xt(_(s.endDate)) && (e.granularities ? c.granularity === s.granularity : !0);
|
|
322
|
+
return ge(c.startDate, s.startDate) && Bt(s.endDate) && (!e.allowTimeInput || Te(s.endDate, A(s.endDate))) && (e.granularities ? c.granularity === s.granularity : !0);
|
|
343
323
|
}
|
|
344
324
|
if (e.allowTimeInput)
|
|
345
|
-
return
|
|
325
|
+
return Te(c.startDate, s.startDate) && Te(c.endDate, s.endDate) && (e.granularities ? c.granularity === s.granularity : !0);
|
|
346
326
|
if (c.endDate)
|
|
347
327
|
return w(c.startDate, s.startDate) && w(c.endDate, s.endDate) && (e.granularities ? c.granularity === s.granularity : !0);
|
|
348
328
|
})) == null ? void 0 : i.value) ?? l
|
|
349
329
|
);
|
|
350
|
-
}),
|
|
330
|
+
}), B = f(() => ({
|
|
351
331
|
"b-date-range-picker-calendar__form-input-wrapper": e.allowTimeInput
|
|
352
|
-
})),
|
|
332
|
+
})), ve = f(() => [
|
|
353
333
|
{ label: v("customRange"), value: l },
|
|
354
334
|
...e.quickSelectRanges ? e.quickSelectRanges : []
|
|
355
|
-
]),
|
|
335
|
+
]), U = f(
|
|
356
336
|
() => {
|
|
357
337
|
var n;
|
|
358
338
|
return ((n = e.granularities) == null ? void 0 : n.find(({ type: i }) => i === s.granularity)) || null;
|
|
359
339
|
}
|
|
360
|
-
),
|
|
340
|
+
), oe = f(
|
|
361
341
|
() => {
|
|
362
342
|
var n;
|
|
363
|
-
return ((n = e.granularities) == null ? void 0 : n.map(({ type: i, disabled:
|
|
343
|
+
return ((n = e.granularities) == null ? void 0 : n.map(({ type: i, disabled: d }) => ({
|
|
364
344
|
label: v(i),
|
|
365
345
|
value: i,
|
|
366
|
-
disabled:
|
|
346
|
+
disabled: d
|
|
367
347
|
}))) ?? [];
|
|
368
348
|
}
|
|
369
|
-
), { getGranularCalendarLimits:
|
|
370
|
-
() => e.granularities ?
|
|
349
|
+
), { getGranularCalendarLimits: ee } = Pt(e), _ = f(
|
|
350
|
+
() => e.granularities ? ee(U.value) : { min: e.min ? I(e.min) : null, max: e.max ? A(e.max) : null }
|
|
371
351
|
), {
|
|
372
|
-
adjustDateForQuarterly:
|
|
373
|
-
adjustDateForMonthly:
|
|
374
|
-
adjustDateForWeekly:
|
|
375
|
-
adjustStartDateInputForWeekly:
|
|
376
|
-
adjustEndDateInputForWeekly:
|
|
377
|
-
adjustStartDateInputForMonthly:
|
|
378
|
-
adjustEndDateInputForMonthly:
|
|
379
|
-
adjustStartDateInputForQuarterly:
|
|
380
|
-
adjustEndDateInputForQuarterly:
|
|
381
|
-
} =
|
|
352
|
+
adjustDateForQuarterly: te,
|
|
353
|
+
adjustDateForMonthly: ae,
|
|
354
|
+
adjustDateForWeekly: $,
|
|
355
|
+
adjustStartDateInputForWeekly: T,
|
|
356
|
+
adjustEndDateInputForWeekly: le,
|
|
357
|
+
adjustStartDateInputForMonthly: ie,
|
|
358
|
+
adjustEndDateInputForMonthly: V,
|
|
359
|
+
adjustStartDateInputForQuarterly: ue,
|
|
360
|
+
adjustEndDateInputForQuarterly: z
|
|
361
|
+
} = _t(e.firstDayOfWeek), { savedRanges: O, saveRange: x, resetSavedRanges: Y } = Nt(), R = (n) => n ? p(n) : "", G = S(!1), K = S(!1), j = S(!1), Q = S(!1), o = fe({
|
|
382
362
|
startDate: e.dateFormData.startDate,
|
|
383
363
|
endDate: e.dateFormData.endDate,
|
|
384
364
|
startTime: e.dateFormData.startTime,
|
|
385
365
|
endTime: e.dateFormData.endTime
|
|
386
366
|
}), de = (n, i) => {
|
|
387
|
-
let
|
|
388
|
-
const [c,
|
|
389
|
-
return
|
|
390
|
-
}, ce = (n) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(n),
|
|
391
|
-
const
|
|
392
|
-
if (i &&
|
|
367
|
+
let d = new Date(n);
|
|
368
|
+
const [c, b, k] = i.split(":");
|
|
369
|
+
return d = xt(d, parseInt(c, 10)), d = At(d, parseInt(b, 10)), d = qt(d, parseInt(k, 10)), d;
|
|
370
|
+
}, ce = (n) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(n), J = (n, i) => {
|
|
371
|
+
const d = () => {
|
|
372
|
+
if (i && M(i)) {
|
|
393
373
|
const c = de(y(i), n);
|
|
394
|
-
if (e.min && c <
|
|
374
|
+
if (e.min && c < Ue(e.min, 0) || e.max && c > Ue(e.max, 0))
|
|
395
375
|
return !1;
|
|
396
376
|
}
|
|
397
377
|
return !0;
|
|
398
378
|
};
|
|
399
|
-
return ce(n) &&
|
|
400
|
-
},
|
|
401
|
-
o.startTime =
|
|
402
|
-
e.min && e.allowTimeInput && w(e.min, n.startDate) ? e.min :
|
|
403
|
-
), o.endTime =
|
|
404
|
-
e.max && e.allowTimeInput && w(e.max, n.endDate) ? e.max :
|
|
405
|
-
), s.startDate =
|
|
379
|
+
return ce(n) && d();
|
|
380
|
+
}, u = (n, i) => !i || !ce(i) || e.variant === "month" ? n : de(new Date(n), i), X = (n) => {
|
|
381
|
+
o.startTime = E(
|
|
382
|
+
e.min && e.allowTimeInput && w(e.min, n.startDate) ? e.min : I(n.startDate)
|
|
383
|
+
), o.endTime = E(
|
|
384
|
+
e.max && e.allowTimeInput && w(e.max, n.endDate) ? e.max : A(n.endDate)
|
|
385
|
+
), s.startDate = u(n.startDate, o.startTime), s.endDate = u(n.endDate, o.endTime), s.range = null, e.granularities && Y(), t(g.INPUT, {
|
|
406
386
|
...s,
|
|
407
|
-
range:
|
|
387
|
+
range: F.value
|
|
408
388
|
});
|
|
409
|
-
},
|
|
389
|
+
}, M = (n) => {
|
|
410
390
|
if (!n)
|
|
411
391
|
return !1;
|
|
412
|
-
const i = (
|
|
413
|
-
return
|
|
392
|
+
const i = (d) => e.min && I(d) < I(e.min) || e.max && I(d) > I(e.max) ? !1 : e.isDateDisabled ? !e.isDateDisabled(I(d)) : !0;
|
|
393
|
+
return L(n) && i(y(n));
|
|
414
394
|
};
|
|
415
|
-
|
|
416
|
-
G.value = !!(e.dateFormData.startDate && !
|
|
395
|
+
We(() => {
|
|
396
|
+
G.value = !!(e.dateFormData.startDate && !M(e.dateFormData.startDate)), e.allowTimeInput ? j.value = !!(e.dateFormData.startTime && !J(e.dateFormData.startTime, e.dateFormData.startDate)) : j.value = !1, K.value = !!(e.dateFormData.endDate && !M(e.dateFormData.endDate)), e.allowTimeInput ? Q.value = !!(e.dateFormData.endTime && !J(e.dateFormData.endTime, e.dateFormData.endDate)) : Q.value = !1;
|
|
417
397
|
});
|
|
418
398
|
const Ve = (n) => {
|
|
419
399
|
var i;
|
|
420
|
-
o.startDate =
|
|
421
|
-
},
|
|
400
|
+
o.startDate = R(n), o.startTime ? j.value && (o.startTime = (i = e.dateFormData) == null ? void 0 : i.startTime) : o.startTime = E(n), G.value = !1, j.value = !1, t(g.START_DATE_SELECTED, n);
|
|
401
|
+
}, ze = (n) => {
|
|
422
402
|
var i;
|
|
423
|
-
o.endDate =
|
|
424
|
-
},
|
|
403
|
+
o.endDate = R(n), o.endTime ? Q.value && (o.endTime = (i = e.dateFormData) == null ? void 0 : i.endTime) : o.endTime = E(A(n)), K.value = !1, Q.value = !1;
|
|
404
|
+
}, me = (n) => {
|
|
425
405
|
const i = e.value[n];
|
|
426
406
|
if (i)
|
|
427
407
|
return i;
|
|
428
|
-
if (e.dateFormData[n] &&
|
|
408
|
+
if (e.dateFormData[n] && M(e.dateFormData[n]))
|
|
429
409
|
return y(e.dateFormData[n]);
|
|
430
|
-
},
|
|
410
|
+
}, Re = De((n) => {
|
|
431
411
|
var i;
|
|
432
|
-
if (
|
|
433
|
-
let
|
|
434
|
-
switch (G.value = !1, (i =
|
|
412
|
+
if (M(n)) {
|
|
413
|
+
let d = n;
|
|
414
|
+
switch (G.value = !1, (i = U.value) == null ? void 0 : i.type) {
|
|
435
415
|
case "weekly":
|
|
436
|
-
|
|
416
|
+
d = T(
|
|
437
417
|
n,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
), o.startDate =
|
|
418
|
+
R,
|
|
419
|
+
_.value.min,
|
|
420
|
+
_.value.max
|
|
421
|
+
), o.startDate = d;
|
|
442
422
|
break;
|
|
443
423
|
case "monthly":
|
|
444
|
-
|
|
424
|
+
d = ie(
|
|
445
425
|
n,
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
), o.startDate =
|
|
426
|
+
R,
|
|
427
|
+
_.value.min,
|
|
428
|
+
_.value.max
|
|
429
|
+
), o.startDate = d;
|
|
450
430
|
break;
|
|
451
431
|
case "quarterly":
|
|
452
|
-
|
|
432
|
+
d = ue(
|
|
453
433
|
n,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
), o.startDate =
|
|
434
|
+
R,
|
|
435
|
+
_.value.min,
|
|
436
|
+
_.value.max
|
|
437
|
+
), o.startDate = d;
|
|
458
438
|
break;
|
|
459
439
|
}
|
|
460
|
-
const c =
|
|
461
|
-
s.startDate =
|
|
462
|
-
|
|
440
|
+
const c = I(y(d));
|
|
441
|
+
s.startDate = u(c, o.startTime), s.endDate = u(
|
|
442
|
+
I(y(o.endDate)),
|
|
463
443
|
o.endTime
|
|
464
|
-
),
|
|
465
|
-
|
|
444
|
+
), M(o.endDate) && (s.endDate = u(
|
|
445
|
+
I(y(o.endDate)),
|
|
466
446
|
o.endTime
|
|
467
447
|
));
|
|
468
|
-
const
|
|
448
|
+
const b = me("endDate");
|
|
469
449
|
s.range = null, t(g.FORM_DATE, {
|
|
470
450
|
startDate: c,
|
|
471
|
-
endDate:
|
|
451
|
+
endDate: b
|
|
472
452
|
}), t(g.INPUT, {
|
|
473
453
|
...s,
|
|
474
|
-
range:
|
|
454
|
+
range: F.value
|
|
475
455
|
});
|
|
476
456
|
} else
|
|
477
457
|
G.value = !0, t(g.ERROR, { ...o });
|
|
478
|
-
}, a),
|
|
479
|
-
o.startDate = H(n),
|
|
480
|
-
}, he =
|
|
458
|
+
}, a), Je = (n) => {
|
|
459
|
+
o.startDate = H(n), Re(o.startDate);
|
|
460
|
+
}, he = De((n) => {
|
|
481
461
|
var i;
|
|
482
|
-
if (
|
|
483
|
-
let
|
|
484
|
-
switch (
|
|
462
|
+
if (M(n)) {
|
|
463
|
+
let d = n;
|
|
464
|
+
switch (K.value = !1, (i = U.value) == null ? void 0 : i.type) {
|
|
485
465
|
case "weekly":
|
|
486
|
-
|
|
466
|
+
d = le(
|
|
487
467
|
n,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
), o.endDate =
|
|
468
|
+
R,
|
|
469
|
+
_.value.min,
|
|
470
|
+
_.value.max
|
|
471
|
+
), o.endDate = d;
|
|
492
472
|
break;
|
|
493
473
|
case "monthly":
|
|
494
|
-
|
|
474
|
+
d = V(
|
|
495
475
|
n,
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
), o.endDate =
|
|
476
|
+
R,
|
|
477
|
+
_.value.min,
|
|
478
|
+
_.value.max
|
|
479
|
+
), o.endDate = d;
|
|
500
480
|
break;
|
|
501
481
|
case "quarterly":
|
|
502
|
-
|
|
482
|
+
d = z(
|
|
503
483
|
n,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
), o.endDate =
|
|
484
|
+
R,
|
|
485
|
+
_.value.min,
|
|
486
|
+
_.value.max
|
|
487
|
+
), o.endDate = d;
|
|
508
488
|
break;
|
|
509
489
|
}
|
|
510
|
-
const c =
|
|
511
|
-
s.endDate =
|
|
512
|
-
|
|
490
|
+
const c = I(y(d));
|
|
491
|
+
s.endDate = u(c, o.endTime), M(o.startDate) && (s.startDate = u(
|
|
492
|
+
I(y(o.startDate)),
|
|
513
493
|
o.startTime
|
|
514
494
|
));
|
|
515
|
-
const
|
|
495
|
+
const b = me("startDate");
|
|
516
496
|
s.range = null, t(g.FORM_DATE, {
|
|
517
|
-
startDate:
|
|
497
|
+
startDate: b,
|
|
518
498
|
endDate: c
|
|
519
499
|
}), t(g.INPUT, {
|
|
520
500
|
...s,
|
|
521
|
-
range:
|
|
501
|
+
range: F.value
|
|
522
502
|
});
|
|
523
503
|
} else
|
|
524
|
-
|
|
525
|
-
}, a),
|
|
504
|
+
K.value = !0, t(g.ERROR, { ...o });
|
|
505
|
+
}, a), Xe = (n) => {
|
|
526
506
|
o.endDate = H(n), he(o.endDate);
|
|
527
|
-
},
|
|
528
|
-
|
|
529
|
-
}, ke =
|
|
530
|
-
if (
|
|
531
|
-
|
|
532
|
-
const i =
|
|
507
|
+
}, Ze = (n) => {
|
|
508
|
+
Z(n);
|
|
509
|
+
}, ke = De((n) => {
|
|
510
|
+
if (J(n, e.dateFormData.startDate)) {
|
|
511
|
+
j.value = !1, s.startDate = u(s.startDate, n);
|
|
512
|
+
const i = me("endDate");
|
|
533
513
|
t(g.FORM_DATE, {
|
|
534
514
|
startDate: s.startDate,
|
|
535
515
|
endDate: i,
|
|
@@ -537,84 +517,84 @@ const Lt = /[\d]/, jt = /^\d{2}$/, Qt = /^\d{2}:\d{2}$/, Wt = (r) => {
|
|
|
537
517
|
endTime: o.endTime ?? e.dateFormData.endTime
|
|
538
518
|
}), t(g.INPUT, {
|
|
539
519
|
...s,
|
|
540
|
-
range:
|
|
520
|
+
range: F.value
|
|
541
521
|
});
|
|
542
522
|
} else
|
|
543
|
-
|
|
544
|
-
}), Me =
|
|
545
|
-
|
|
523
|
+
j.value = !0, t(g.ERROR, { ...o });
|
|
524
|
+
}), Me = De((n) => {
|
|
525
|
+
J(n, e.dateFormData.endDate) ? (Q.value = !1, s.endDate = u(s.endDate, n), t(g.FORM_DATE, {
|
|
546
526
|
startDate: s.startDate,
|
|
547
527
|
endDate: s.endDate,
|
|
548
528
|
startTime: o.startTime ?? e.dateFormData.startTime,
|
|
549
529
|
endTime: n
|
|
550
530
|
}), t(g.INPUT, {
|
|
551
531
|
...s,
|
|
552
|
-
range:
|
|
553
|
-
})) : (
|
|
554
|
-
}),
|
|
555
|
-
o.startTime =
|
|
532
|
+
range: F.value
|
|
533
|
+
})) : (Q.value = !0, t(g.ERROR, { ...o }));
|
|
534
|
+
}), et = (n) => {
|
|
535
|
+
o.startTime = je(n), ke(o.startTime);
|
|
536
|
+
}, tt = (n) => {
|
|
537
|
+
o.endTime = je(n), Me(o.endTime);
|
|
556
538
|
}, at = (n) => {
|
|
557
|
-
|
|
539
|
+
Qt(n);
|
|
540
|
+
}, ne = (n, i, d, c) => {
|
|
541
|
+
s.startDate = n, s.endDate = i, d && (s.granularity = d), c && (s.range = c);
|
|
558
542
|
}, nt = (n) => {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
s.startDate = n, s.endDate = i, u && (s.granularity = u), c && (s.range = c);
|
|
562
|
-
}, rt = (n) => {
|
|
563
|
-
var u;
|
|
564
|
-
const i = (u = e.quickSelectRanges) == null ? void 0 : u.find(({ value: c }) => c === n);
|
|
543
|
+
var d;
|
|
544
|
+
const i = (d = e.quickSelectRanges) == null ? void 0 : d.find(({ value: c }) => c === n);
|
|
565
545
|
if (i) {
|
|
566
|
-
|
|
567
|
-
const c = i.data,
|
|
568
|
-
o.endDate =
|
|
569
|
-
...
|
|
546
|
+
Y();
|
|
547
|
+
const c = i.data, b = c.endDate || (c.isRelativeToNow ? new Date(Date.now()) : A(new Date(Date.now()))), k = c.isRelativeToNow && c.timeDifference ? new Date(b.getTime() - c.timeDifference) : c.startDate;
|
|
548
|
+
o.endDate = R(b), o.startDate = R(k), ne(k, b, null, n), e.granularities && (s.granularity = c.granularity || h.value), o.startTime = E(k), o.endTime = E(b), s.startDate = k, s.endDate = b, c.isRelativeToNow && (q.value = {
|
|
549
|
+
...q.value,
|
|
570
550
|
[n]: {
|
|
571
|
-
startDate:
|
|
572
|
-
endDate:
|
|
551
|
+
startDate: k,
|
|
552
|
+
endDate: b
|
|
573
553
|
}
|
|
574
554
|
}), t(g.CUSTOM_RANGE, {
|
|
575
555
|
...i.data,
|
|
576
|
-
startDate:
|
|
577
|
-
endDate:
|
|
556
|
+
startDate: k,
|
|
557
|
+
endDate: b,
|
|
578
558
|
range: i.value
|
|
579
559
|
});
|
|
580
560
|
}
|
|
581
561
|
}, Se = {
|
|
582
|
-
weekly:
|
|
583
|
-
monthly:
|
|
584
|
-
quarterly:
|
|
585
|
-
},
|
|
562
|
+
weekly: $,
|
|
563
|
+
monthly: ae,
|
|
564
|
+
quarterly: te
|
|
565
|
+
}, rt = (n) => {
|
|
586
566
|
const i = s.granularity;
|
|
587
|
-
if (s.granularity = n, i &&
|
|
567
|
+
if (s.granularity = n, i && x(i, structuredClone(_e(s))), s.startDate && s.endDate) {
|
|
588
568
|
switch (n) {
|
|
589
569
|
case "quarterly":
|
|
590
570
|
case "monthly":
|
|
591
571
|
case "weekly": {
|
|
592
|
-
if (
|
|
593
|
-
|
|
572
|
+
if (O[n]) {
|
|
573
|
+
ne(O[n].startDate, O[n].endDate, n);
|
|
594
574
|
break;
|
|
595
575
|
}
|
|
596
|
-
const { startDate:
|
|
576
|
+
const { startDate: d, endDate: c } = Se[n](
|
|
597
577
|
s.startDate,
|
|
598
578
|
s.endDate,
|
|
599
|
-
|
|
600
|
-
|
|
579
|
+
_.value.min,
|
|
580
|
+
_.value.max
|
|
601
581
|
);
|
|
602
|
-
|
|
582
|
+
ne(d, c, n);
|
|
603
583
|
break;
|
|
604
584
|
}
|
|
605
585
|
case "daily":
|
|
606
|
-
|
|
586
|
+
O.daily && ne(O.daily.startDate, O.daily.endDate, n);
|
|
607
587
|
break;
|
|
608
588
|
}
|
|
609
|
-
o.startDate =
|
|
589
|
+
o.startDate = R(s.startDate), o.endDate = R(s.endDate), t(g.INPUT, {
|
|
610
590
|
...s,
|
|
611
|
-
range:
|
|
591
|
+
range: F.value
|
|
612
592
|
});
|
|
613
593
|
}
|
|
614
|
-
},
|
|
615
|
-
"b-date-range-picker-calendar__form-container--no-calendars":
|
|
594
|
+
}, st = f(() => ({
|
|
595
|
+
"b-date-range-picker-calendar__form-container--no-calendars": C.value
|
|
616
596
|
}));
|
|
617
|
-
return { __sfc: !0, FORM_INPUT_DEBOUNCE_TIME: a, RANGE_SELECTOR_CUSTOM_RANGE_KEY: l, props: e, emit: t, slots: m, hasSlot: D, t: v, dateFormat:
|
|
597
|
+
return { __sfc: !0, FORM_INPUT_DEBOUNCE_TIME: a, RANGE_SELECTOR_CUSTOM_RANGE_KEY: l, props: e, emit: t, slots: m, hasSlot: D, t: v, dateFormat: W, isFormatValid: L, parseDate: y, onKeyDown: Z, autoFormat: H, formatDateUtil: p, calculatedIsRelativeToNowQuickSelectRanges: q, defaultGranularity: h, hasNoCalendars: C, internalRangeDate: s, selectedRangeSelectorValue: F, formInputWrapperConditionalClasses: B, quickSelectRangeDefaultItems: ve, selectedGranularity: U, granularityItems: oe, getGranularCalendarLimits: ee, computedMinMax: _, adjustDateForQuarterly: te, adjustDateForMonthly: ae, adjustDateForWeekly: $, adjustStartDateInputForWeekly: T, adjustEndDateInputForWeekly: le, adjustStartDateInputForMonthly: ie, adjustEndDateInputForMonthly: V, adjustStartDateInputForQuarterly: ue, adjustEndDateInputForQuarterly: z, savedRanges: O, saveRange: x, resetSavedRanges: Y, formatDate: R, startDateError: G, endDateError: K, startTimeError: j, endTimeError: Q, dateTextInput: o, setTimeInDateObject: de, isValidTimeString: ce, isValidTime: J, setTimeInDateRef: u, onDateInput: X, isValidDate: M, onStartDateSelected: Ve, onEndDateSelected: ze, getDate: me, validateStartDate: Re, onStartDateInput: Je, validateEndDate: he, onEndDateInput: Xe, onDateInputKeyDown: Ze, validateStartTime: ke, validateEndTime: Me, onStartTimeInput: et, onEndTimeInput: tt, onTimeInputKeyDown: at, setInternalRange: ne, onRangeSelectorInput: nt, adjustDate: Se, onGranularityInput: rt, computedFormContainerClasses: st, Calendar: P, BentoTypography: $e, BentoInputField: mt, BentoDropdown: Dt, BentoSegmentedControl: pt };
|
|
618
598
|
}
|
|
619
599
|
});
|
|
620
600
|
var Kt = function() {
|
|
@@ -628,15 +608,15 @@ var Kt = function() {
|
|
|
628
608
|
}, proxy: !0 }]) }), t.allowTimeInput ? e(a.BentoInputField, { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": a.t("timeTo"), "model-value": a.dateTextInput.endTime, error: a.endTimeError }, on: { "update:model-value": a.onEndTimeInput, keydown: a.onTimeInputKeyDown }, scopedSlots: t._u([{ key: "description", fn: function() {
|
|
629
609
|
return [t._v("HH:MM:SS")];
|
|
630
610
|
}, proxy: !0 }], null, !1, 3442289499) }) : t._e()], 1)], 1)], 2), a.hasSlot("actions") ? e("div", [t._t("actions")], 2) : t._e()]), a.hasNoCalendars ? t._e() : e("div", { staticClass: "b-date-range-picker-calendar__calendars-container", attrs: { "data-testid": "date-range-picker-calendar-calendar-container" } }, [e(a.Calendar, { attrs: { value: a.internalRangeDate, "first-day-of-week": t.firstDayOfWeek, "is-date-disabled": t.isDateDisabled, "max-range": t.maxRange, min: a.computedMinMax.min, max: a.computedMinMax.max, "number-of-months": t.numberOfMonths, "show-end-date-on-open": t.showEndDateOnOpen, granularity: a.selectedGranularity, variant: t.variant, "is-range": "" }, on: { input: a.onDateInput, "start-date-selected": a.onStartDateSelected, "end-date-selected": a.onEndDateSelected } })], 1)]);
|
|
631
|
-
},
|
|
632
|
-
|
|
611
|
+
}, Ht = [], Vt = /* @__PURE__ */ Ke(
|
|
612
|
+
Gt,
|
|
633
613
|
Kt,
|
|
634
|
-
|
|
614
|
+
Ht,
|
|
635
615
|
!1,
|
|
636
616
|
null,
|
|
637
|
-
"
|
|
617
|
+
"8b3a8a9a"
|
|
638
618
|
);
|
|
639
|
-
const
|
|
619
|
+
const zt = Vt.exports, Jt = {
|
|
640
620
|
"en-US": {
|
|
641
621
|
apply: "Apply",
|
|
642
622
|
cancel: "Cancel",
|
|
@@ -667,7 +647,7 @@ const Jt = Vt.exports, Xt = {
|
|
|
667
647
|
selectDateRange: "Selecione um intervalo de datas",
|
|
668
648
|
selectedDateIsNotAvailable: "A data selecionada não está disponível"
|
|
669
649
|
}
|
|
670
|
-
},
|
|
650
|
+
}, Xt = ({
|
|
671
651
|
datePickerValue: r,
|
|
672
652
|
isDateIncorrect: t,
|
|
673
653
|
quickSelectRanges: e,
|
|
@@ -675,42 +655,42 @@ const Jt = Vt.exports, Xt = {
|
|
|
675
655
|
withTimeInput: l,
|
|
676
656
|
placeholder: m
|
|
677
657
|
}) => {
|
|
678
|
-
const { locale: D, t: v } = be(), { dateToInputDateString:
|
|
658
|
+
const { locale: D, t: v } = be(), { dateToInputDateString: W } = Ie(), L = (p) => !!p && !isNaN(p.getTime()), y = fe({
|
|
679
659
|
startDate: null,
|
|
680
660
|
endDate: null,
|
|
681
661
|
startTime: null,
|
|
682
662
|
endTime: null
|
|
683
663
|
});
|
|
684
|
-
return
|
|
664
|
+
return pe(
|
|
685
665
|
r,
|
|
686
666
|
(p) => {
|
|
687
|
-
y.startDate =
|
|
667
|
+
y.startDate = W(p == null ? void 0 : p.startDate), y.endDate = W(p == null ? void 0 : p.endDate), y.startTime = E(p == null ? void 0 : p.startDate), y.endTime = E(p == null ? void 0 : p.endDate);
|
|
688
668
|
},
|
|
689
669
|
{ immediate: !0 }
|
|
690
670
|
), {
|
|
691
671
|
// Values
|
|
692
672
|
dateDisplayValue: f(() => {
|
|
693
|
-
var
|
|
673
|
+
var q;
|
|
694
674
|
if (t.value)
|
|
695
675
|
return `${y.startDate || ""} - ${y.endDate || ""}`;
|
|
696
676
|
if (!r.value || !r.value.startDate && !r.value.endDate)
|
|
697
677
|
return (m == null ? void 0 : m.value) || v("selectDateRange");
|
|
698
|
-
if ((
|
|
699
|
-
const
|
|
678
|
+
if ((q = e.value) != null && q.length) {
|
|
679
|
+
const h = e.value.find(({ value: C }) => {
|
|
700
680
|
var s;
|
|
701
|
-
return
|
|
681
|
+
return C === ((s = r.value) == null ? void 0 : s.range);
|
|
702
682
|
});
|
|
703
|
-
if (
|
|
704
|
-
return
|
|
683
|
+
if (h)
|
|
684
|
+
return h.label;
|
|
705
685
|
}
|
|
706
686
|
if (r.value.granularity === "quarterly") {
|
|
707
|
-
const { startDate:
|
|
708
|
-
if (
|
|
687
|
+
const { startDate: h, endDate: C } = r.value, s = v("quarter", { quarter: Pe(h), year: Ne(h) });
|
|
688
|
+
if (Ct(h, C))
|
|
709
689
|
return s;
|
|
710
|
-
const
|
|
711
|
-
return `${s} - ${
|
|
690
|
+
const F = v("quarter", { quarter: Pe(C), year: Ne(C) });
|
|
691
|
+
return `${s} - ${F}`;
|
|
712
692
|
}
|
|
713
|
-
if (!
|
|
693
|
+
if (!L(r.value.startDate) || !L(r.value.endDate))
|
|
714
694
|
return `${y.startDate || ""} - ${y.endDate || ""}`;
|
|
715
695
|
let p = a != null && a.value ? { month: "long", year: "numeric" } : { month: "short", day: "2-digit", year: "numeric" };
|
|
716
696
|
return l.value && (p = {
|
|
@@ -719,7 +699,7 @@ const Jt = Vt.exports, Xt = {
|
|
|
719
699
|
minute: "numeric",
|
|
720
700
|
second: "numeric",
|
|
721
701
|
hour12: !1
|
|
722
|
-
}),
|
|
702
|
+
}), bt(D.value, p).formatRange(
|
|
723
703
|
r.value.startDate,
|
|
724
704
|
r.value.endDate
|
|
725
705
|
);
|
|
@@ -728,12 +708,12 @@ const Jt = Vt.exports, Xt = {
|
|
|
728
708
|
// Methods
|
|
729
709
|
formatTextInputDisplayValue: () => ""
|
|
730
710
|
};
|
|
731
|
-
},
|
|
732
|
-
i18n: { messages:
|
|
711
|
+
}, Zt = {
|
|
712
|
+
i18n: { messages: Jt },
|
|
733
713
|
name: "bento-date-range-picker",
|
|
734
714
|
model: { prop: "modelValue" }
|
|
735
|
-
},
|
|
736
|
-
...
|
|
715
|
+
}, ea = /* @__PURE__ */ Qe({
|
|
716
|
+
...Zt,
|
|
737
717
|
props: {
|
|
738
718
|
description: { default: void 0 },
|
|
739
719
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -761,7 +741,7 @@ const Jt = Vt.exports, Xt = {
|
|
|
761
741
|
},
|
|
762
742
|
emits: ["update:model-value", "input"],
|
|
763
743
|
setup(r, { emit: t }) {
|
|
764
|
-
const e = r, a =
|
|
744
|
+
const e = r, a = lt(), { t: l } = be(), { dateToInputDateString: m } = Ie(), D = re("bento-date-range-picker-container"), v = re("bento-date-range-picker-label"), W = re("bento-date-range-picker-description"), L = re("bento-date-range-picker-error"), y = re("bento-date-range-picker-date-error"), Z = f(() => e.label || l("dateRangePicker", { name: D })), { resolvedFirstDayOfWeek: H } = vt(ye(e, "firstDayOfWeek")), p = it({
|
|
765
745
|
none: 0,
|
|
766
746
|
one: 710,
|
|
767
747
|
// width of date range picker with one panes
|
|
@@ -769,111 +749,111 @@ const Jt = Vt.exports, Xt = {
|
|
|
769
749
|
// width of date range picker with two panes
|
|
770
750
|
three: 1290
|
|
771
751
|
// width of date range picker with three panes
|
|
772
|
-
}),
|
|
773
|
-
const
|
|
752
|
+
}), q = f(() => {
|
|
753
|
+
const u = p.active().value, X = {
|
|
774
754
|
none: 0,
|
|
775
755
|
one: 1,
|
|
776
756
|
two: 2
|
|
777
757
|
};
|
|
778
|
-
if (
|
|
779
|
-
const
|
|
780
|
-
return e.numberOfMonths === void 0 ?
|
|
758
|
+
if (u in X) {
|
|
759
|
+
const M = X[u];
|
|
760
|
+
return e.numberOfMonths === void 0 ? M : Math.min(e.numberOfMonths, M);
|
|
781
761
|
}
|
|
782
762
|
return e.numberOfMonths;
|
|
783
|
-
}),
|
|
784
|
-
const
|
|
763
|
+
}), h = f(() => (e == null ? void 0 : e.quickSelectRanges) && e.quickSelectRanges.map((u) => {
|
|
764
|
+
const X = u.data.endDate ? void 0 : new Date(Date.now()).getTime() - u.data.startDate.getTime();
|
|
785
765
|
return {
|
|
786
|
-
...
|
|
766
|
+
...u,
|
|
787
767
|
data: {
|
|
788
|
-
...
|
|
768
|
+
...u.data,
|
|
789
769
|
// Adding timeDifference to calculate an up-to-date endDate on range selection
|
|
790
|
-
timeDifference:
|
|
770
|
+
timeDifference: X
|
|
791
771
|
}
|
|
792
772
|
};
|
|
793
|
-
})),
|
|
794
|
-
|
|
773
|
+
})), C = f(() => e.label ? v : (a == null ? void 0 : a["aria-labelledby"]) ?? null), s = S(!1), F = S(null), B = S(!1), { isReadOnly: ve } = Mt(ye(e, "readonly")), { emitValue: U } = St(t);
|
|
774
|
+
pe(
|
|
795
775
|
() => e.disabled,
|
|
796
776
|
() => {
|
|
797
|
-
e.disabled &&
|
|
777
|
+
e.disabled && B.value && (B.value = !1);
|
|
798
778
|
}
|
|
799
779
|
);
|
|
800
|
-
const
|
|
801
|
-
"b-date-range-picker__description--error": !!e.errorMessage ||
|
|
802
|
-
})),
|
|
803
|
-
datePickerValue:
|
|
780
|
+
const oe = f(() => e.modelValue || e.value), ee = f(() => e.hasActions ? !Y.value && s.value : s.value), _ = f(() => ({
|
|
781
|
+
"b-date-range-picker__description--error": !!e.errorMessage || ee.value
|
|
782
|
+
})), te = f(() => e.variant === "month"), ae = f(() => e.allowTimeInput && e.variant !== "month"), { dateDisplayValue: $, textInputDisplayValue: T, formatTextInputDisplayValue: le } = Xt({
|
|
783
|
+
datePickerValue: oe,
|
|
804
784
|
isDateIncorrect: s,
|
|
805
|
-
quickSelectRanges:
|
|
806
|
-
isMonthVariant:
|
|
807
|
-
withTimeInput:
|
|
808
|
-
placeholder:
|
|
785
|
+
quickSelectRanges: h,
|
|
786
|
+
isMonthVariant: te,
|
|
787
|
+
withTimeInput: ae,
|
|
788
|
+
placeholder: ye(e, "placeholder")
|
|
809
789
|
}), ie = f(
|
|
810
|
-
() => `${e.description ?
|
|
811
|
-
),
|
|
812
|
-
|
|
790
|
+
() => `${e.description ? W : ""} ${e.errorMessage ? L : ""} ${s.value ? y : ""}`.trim() || null
|
|
791
|
+
), V = () => {
|
|
792
|
+
B.value = !1;
|
|
813
793
|
}, ue = () => {
|
|
814
|
-
|
|
815
|
-
}, z =
|
|
794
|
+
B.value = !0;
|
|
795
|
+
}, z = S($.value), O = S(
|
|
816
796
|
// textInputDisplayValue is a reactive object
|
|
817
797
|
structuredClone(_e(T))
|
|
818
|
-
),
|
|
819
|
-
() => e.hasActions ?
|
|
820
|
-
),
|
|
798
|
+
), x = S(e.modelValue ?? e.value), Y = S(!0), R = f(
|
|
799
|
+
() => e.hasActions ? O.value : T
|
|
800
|
+
), G = f(
|
|
821
801
|
() => e.hasActions ? z.value : $.value
|
|
822
802
|
);
|
|
823
|
-
|
|
824
|
-
if (e.hasActions ||
|
|
803
|
+
We(() => {
|
|
804
|
+
if (e.hasActions || Ce(
|
|
825
805
|
'BentoDateRangePicker "hasActions" property',
|
|
826
806
|
`Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
|
|
827
807
|
This will be the default behavior in the v2 and "hasActions" will be removed.`,
|
|
828
808
|
"2.0.0"
|
|
829
|
-
), e.value &&
|
|
809
|
+
), e.value && Ce(
|
|
830
810
|
'BentoDateRangePicker "value" property',
|
|
831
811
|
'The use of "value" prop in "BentoDateRangePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
|
|
832
812
|
"2.0.0"
|
|
833
|
-
), e.granularities && e.variant !== "month" && e.granularities.find(({ type:
|
|
813
|
+
), e.granularities && e.variant !== "month" && e.granularities.find(({ type: u }) => u === "quarterly"))
|
|
834
814
|
throw new Error('Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"');
|
|
835
|
-
}),
|
|
836
|
-
z.value = $.value,
|
|
815
|
+
}), pe([() => e.value, () => e.modelValue], () => {
|
|
816
|
+
z.value = $.value, O.value = structuredClone(_e(T));
|
|
837
817
|
});
|
|
838
|
-
const
|
|
818
|
+
const K = f(() => [
|
|
839
819
|
{
|
|
840
820
|
title: l("apply"),
|
|
841
821
|
event: () => {
|
|
842
|
-
|
|
822
|
+
U(x.value), V(), Y.value = !0;
|
|
843
823
|
},
|
|
844
|
-
disabled:
|
|
824
|
+
disabled: Y.value
|
|
845
825
|
},
|
|
846
826
|
{
|
|
847
827
|
title: l("cancel"),
|
|
848
|
-
event:
|
|
828
|
+
event: V
|
|
849
829
|
}
|
|
850
830
|
]);
|
|
851
|
-
return
|
|
831
|
+
return pe(x, (u) => {
|
|
852
832
|
if (e.hasActions) {
|
|
853
|
-
|
|
833
|
+
Y.value = s.value;
|
|
854
834
|
return;
|
|
855
835
|
}
|
|
856
|
-
|
|
857
|
-
}), { __sfc: !0, emit: t, props: e, attrs: a, t: l, dateToInputDateString: m, datePickerContainerId: D, labelId: v, descriptionId:
|
|
858
|
-
s.value = !1, T.startDate = m(
|
|
836
|
+
U(u);
|
|
837
|
+
}), { __sfc: !0, emit: t, props: e, attrs: a, t: l, dateToInputDateString: m, datePickerContainerId: D, labelId: v, descriptionId: W, errorId: L, dateErrorId: y, popoverAriaLabel: Z, resolvedFirstDayOfWeek: H, breakpoints: p, computedNumberOfMonths: q, adjustedQuickSelectRanges: h, dropdownInputAriaLabelledBy: C, isDateIncorrect: s, inputContainerRef: F, isDateRangePickerOpen: B, isReadOnly: ve, emitValue: U, internalModelValue: oe, shouldDisplayError: ee, descriptionConditionalClasses: _, isMonthVariant: te, withTimeInput: ae, dateDisplayValue: $, textInputDisplayValue: T, formatTextInputDisplayValue: le, ariaDescribedBy: ie, closeDateRangePicker: V, openDateRangePicker: ue, localDateDisplayValue: z, localTextInputDisplayValue: O, selectedDate: x, isApplyDisabled: Y, displayedTextInputValue: R, displayedDateValue: G, rangePickerButtonActions: K, onDateRangePickerInput: (u) => {
|
|
838
|
+
s.value = !1, T.startDate = m(u.startDate), T.endDate = m(u.endDate), T.startTime = E(u.startDate), T.endTime = E(u.endDate), x.value = u;
|
|
859
839
|
}, clearDateRangePickerValue: async () => {
|
|
860
|
-
s.value && (s.value = !1),
|
|
840
|
+
s.value && (s.value = !1), x.value = null;
|
|
861
841
|
}, onEnterPressedOverInput: () => {
|
|
862
|
-
if (!
|
|
863
|
-
|
|
842
|
+
if (!B.value) {
|
|
843
|
+
B.value = !0;
|
|
864
844
|
return;
|
|
865
845
|
}
|
|
866
|
-
s.value || (
|
|
867
|
-
}, onDateRangePickerFormDateInputUpdate: (
|
|
868
|
-
s.value = !1,
|
|
869
|
-
}, onDateRangePickerError: (
|
|
870
|
-
s.value = !0, T.startDate =
|
|
871
|
-
}, onRangeSelectorInput: (
|
|
872
|
-
|
|
873
|
-
}, BentoButtonActions:
|
|
846
|
+
s.value || (B.value = !1);
|
|
847
|
+
}, onDateRangePickerFormDateInputUpdate: (u) => {
|
|
848
|
+
s.value = !1, u.startTime && (T.startTime = u.startTime), u.endTime && (T.endTime = u.endTime);
|
|
849
|
+
}, onDateRangePickerError: (u) => {
|
|
850
|
+
s.value = !0, T.startDate = u.startDate, T.endDate = u.endDate, x.value = { startDate: null, endDate: null };
|
|
851
|
+
}, onRangeSelectorInput: (u) => {
|
|
852
|
+
u && (T.startDate = m(u.startDate), T.endDate = m(u.endDate), T.startTime = E(u.startDate), T.endTime = E(u.endDate), x.value = u);
|
|
853
|
+
}, BentoButtonActions: ct, BentoButtonActionsLayout: wt, BentoDivider: ut, BentoPopover: dt, BentoTypography: $e, DateRangePickerCalendar: zt, DropdownInputDefault: kt, ErrorMessage: Ot, FieldLabel: Ft, vBentoClickOutsideDirective: Et };
|
|
874
854
|
}
|
|
875
855
|
});
|
|
876
|
-
var
|
|
856
|
+
var ta = function() {
|
|
877
857
|
var t = this, e = t._self._c, a = t._self._setupProxy;
|
|
878
858
|
return e("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: a.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [t.label ? e(a.FieldLabel, { attrs: { id: a.labelId, label: t.label, "tooltip-text": t.tooltipText, optional: t.optional, required: t.required } }) : t._e(), e("div", { on: { keydown: function(l) {
|
|
879
859
|
return !l.type.indexOf("key") && t._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : a.onEnterPressedOverInput.apply(null, arguments);
|
|
@@ -882,19 +862,19 @@ var aa = function() {
|
|
|
882
862
|
} } }, [e(a.DateRangePickerCalendar, { attrs: { "allow-time-input": a.withTimeInput, "quick-select-ranges": a.adjustedQuickSelectRanges, value: a.internalModelValue, "first-day-of-week": a.resolvedFirstDayOfWeek, granularities: t.granularities, "is-date-disabled": t.isDateDisabled, "max-range": t.maxRange, min: t.min, max: t.max, "number-of-months": a.computedNumberOfMonths, "show-end-date-on-open": t.showEndDateOnOpen, "date-form-data": a.displayedTextInputValue, variant: t.variant }, on: { "custom-range": a.onRangeSelectorInput, input: a.onDateRangePickerInput, error: a.onDateRangePickerError, "form-date": a.onDateRangePickerFormDateInputUpdate }, scopedSlots: t._u([t.hasActions ? { key: "actions", fn: function() {
|
|
883
863
|
return [e(a.BentoDivider), e("div", { staticClass: "b-date-range-picker__footer" }, [e(a.BentoButtonActions, { attrs: { actions: a.rangePickerButtonActions, layout: a.BentoButtonActionsLayout.SPACE_BETWEEN } })], 1)];
|
|
884
864
|
}, proxy: !0 } : null], null, !0) })], 1) : t._e()], 1);
|
|
885
|
-
},
|
|
865
|
+
}, aa = [], na = /* @__PURE__ */ Ke(
|
|
866
|
+
ea,
|
|
886
867
|
ta,
|
|
887
868
|
aa,
|
|
888
|
-
na,
|
|
889
869
|
!1,
|
|
890
870
|
null,
|
|
891
871
|
"fbf1b83e"
|
|
892
872
|
);
|
|
893
|
-
const
|
|
873
|
+
const Oa = na.exports;
|
|
894
874
|
export {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
875
|
+
Oa as B,
|
|
876
|
+
zt as D,
|
|
877
|
+
Bt as a,
|
|
878
|
+
ge as i
|
|
899
879
|
};
|
|
900
|
-
//# sourceMappingURL=date-range-picker.
|
|
880
|
+
//# sourceMappingURL=date-range-picker.BJ-ARlkH.js.map
|