@adyen/bento-vue2 1.72.0 → 1.73.0
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/@types/index.d.ts +25 -0
- 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-template.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/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/form-layout-title.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/segmented-control.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{checkbox-group.Cr3WdkDM.js → checkbox-group.B85s9nzq.js} +2 -2
- package/dist/chunks/{checkbox-group.Cr3WdkDM.js.map → checkbox-group.B85s9nzq.js.map} +1 -1
- package/dist/chunks/{checkbox.D7-f9Y6w.js → checkbox.BOIfb1fc.js} +18 -18
- package/dist/chunks/{checkbox.D7-f9Y6w.js.map → checkbox.BOIfb1fc.js.map} +1 -1
- package/dist/chunks/{code-snippet.BGrwAxWy.js → code-snippet.Dsc6Zuas.js} +2 -2
- package/dist/chunks/{code-snippet.BGrwAxWy.js.map → code-snippet.Dsc6Zuas.js.map} +1 -1
- package/dist/chunks/{data-grid.B_Ha2vma.js → data-grid.BeClbIY3.js} +1247 -1188
- package/dist/chunks/data-grid.BeClbIY3.js.map +1 -0
- package/dist/chunks/{date-range-picker.ChGfJUPq.js → date-range-picker.DR2nDLqc.js} +125 -122
- package/dist/chunks/date-range-picker.DR2nDLqc.js.map +1 -0
- package/dist/chunks/{dropdown-tag.Bwl0fY7o.js → dropdown-tag.CUwoeCwu.js} +2 -2
- package/dist/chunks/{dropdown-tag.Bwl0fY7o.js.map → dropdown-tag.CUwoeCwu.js.map} +1 -1
- package/dist/chunks/{dropdown.DQbTuKc5.js → dropdown.B4urOhfH.js} +158 -154
- package/dist/chunks/{dropdown.DQbTuKc5.js.map → dropdown.B4urOhfH.js.map} +1 -1
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{filter-bar.Dnnv0rpV.js → filter-bar.B0Dl_8-M.js} +6 -6
- package/dist/chunks/{filter-bar.Dnnv0rpV.js.map → filter-bar.B0Dl_8-M.js.map} +1 -1
- package/dist/chunks/{form-layout-title.aXVuAWiG.js → form-layout-title.vQNmD6vk.js} +21 -14
- package/dist/chunks/form-layout-title.vQNmD6vk.js.map +1 -0
- package/dist/chunks/{header-with-views.DjZa4Wob.js → header-with-views.BWwSFABv.js} +3 -3
- package/dist/chunks/{header-with-views.DjZa4Wob.js.map → header-with-views.BWwSFABv.js.map} +1 -1
- package/dist/chunks/{input-field-password.BPujvbx8.js → input-field-password.BdZrUcJy.js} +3 -3
- package/dist/chunks/{input-field-password.BPujvbx8.js.map → input-field-password.BdZrUcJy.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.bqUe_CVf.js → input-field-phone-number.Bm0n9ycw.js} +8 -5
- package/dist/chunks/{input-field-phone-number.bqUe_CVf.js.map → input-field-phone-number.Bm0n9ycw.js.map} +1 -1
- package/dist/chunks/{input-field.CwF6ldRY.js → input-field.DYVXuVxT.js} +2 -2
- package/dist/chunks/{input-field.CwF6ldRY.js.map → input-field.DYVXuVxT.js.map} +1 -1
- package/dist/chunks/{pagination.BWTyXMRW.js → pagination.CcH5IWXH.js} +2 -2
- package/dist/chunks/{pagination.BWTyXMRW.js.map → pagination.CcH5IWXH.js.map} +1 -1
- package/dist/chunks/{radio-group.DHUa6baR.js → radio-group.BuDqrwGq.js} +9 -9
- package/dist/chunks/radio-group.BuDqrwGq.js.map +1 -0
- package/dist/chunks/{radio-input.D8mv2EYC.js → radio-input.kzb4gxLW.js} +17 -17
- package/dist/chunks/radio-input.kzb4gxLW.js.map +1 -0
- package/dist/chunks/{rich-text-editor.C905JEDW.js → rich-text-editor.EU6Dltjl.js} +2 -2
- package/dist/chunks/{rich-text-editor.C905JEDW.js.map → rich-text-editor.EU6Dltjl.js.map} +1 -1
- package/dist/chunks/{search-bar.CKt_-tZH.js → search-bar.PC1n90UR.js} +3 -3
- package/dist/chunks/{search-bar.CKt_-tZH.js.map → search-bar.PC1n90UR.js.map} +1 -1
- package/dist/chunks/{secondary-nav.B5L2bLmm.js → secondary-nav.BXGVjZJX.js} +2 -2
- package/dist/chunks/{secondary-nav.B5L2bLmm.js.map → secondary-nav.BXGVjZJX.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CBVKMu6b.js → selection-card-group.VAJ3ifoH.js} +8 -8
- package/dist/chunks/{selection-card-group.CBVKMu6b.js.map → selection-card-group.VAJ3ifoH.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +2 -2
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +20 -20
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/radio-group.js +2 -2
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/styles/bento-dark.css +20 -13
- package/dist/styles/bento-light.css +4 -1
- package/dist/styles/bento.css +4 -1
- package/dist/styles/legacy.css +4 -1
- package/dist/styles/styleguide.css +4 -1
- package/dist/web-types.json +29 -10
- package/package.json +2 -2
- package/dist/chunks/data-grid.B_Ha2vma.js.map +0 -1
- package/dist/chunks/date-range-picker.ChGfJUPq.js.map +0 -1
- package/dist/chunks/form-layout-title.aXVuAWiG.js.map +0 -1
- package/dist/chunks/radio-group.DHUa6baR.js.map +0 -1
- package/dist/chunks/radio-input.D8mv2EYC.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { reactive as ve, defineComponent as Ye, ref as A, computed as I, onMounted as je, toRaw as Te, toRef as Ee, watch as ye } from "vue";
|
|
2
2
|
import { B as it } from "./divider.CFbtmKeQ.js";
|
|
3
|
-
import { h as
|
|
3
|
+
import { h as lt, B as ot } from "./button-actions.55vIvDsX.js";
|
|
4
4
|
import { B as Qe, d as ut } from "./typography.hlOAxsEn.js";
|
|
5
5
|
import { D as dt } from "./dropdown-default-textbox.CDm-PQfc.js";
|
|
6
6
|
import { e as N, a as he, g as _e } from "./get-date-locale.CAyOIbcp.js";
|
|
7
|
-
import { g as
|
|
7
|
+
import { g as oe } from "./generate-uid.NJ8tVoha.js";
|
|
8
8
|
import { u as Re } from "./i18n.BQkEbtPM.js";
|
|
9
9
|
import { e as $e, t as ne, g as ue, i as B, h as F, j as Oe, k as ct, l as we, m as Dt, s as Me, n as mt, o as Ce, a as G, u as ft, f as ae } from "./calendar.M69sfyB9.js";
|
|
10
10
|
import { r as w, t as j } from "./index.BrH1t1iu.js";
|
|
11
11
|
import { f as xe, v as vt, D as k } from "./date-input.BqBdAO1E.js";
|
|
12
12
|
import { u as pt } from "./use-form-layout-loading.D3lALhtC.js";
|
|
13
13
|
import "./index.Cl4_42j5.js";
|
|
14
|
-
import { B as gt } from "./input-field.
|
|
15
|
-
import { B as yt } from "./dropdown.
|
|
14
|
+
import { B as gt } from "./input-field.DYVXuVxT.js";
|
|
15
|
+
import { B as yt } from "./dropdown.B4urOhfH.js";
|
|
16
16
|
import { B as Tt } from "./segmented-control.Dc34mUMM.js";
|
|
17
17
|
import { d as De } from "./debounce.DUTu11PS.js";
|
|
18
18
|
import { u as _t } from "./use-has-slot.C9lQZ6nz.js";
|
|
@@ -85,52 +85,52 @@ function Mt(t, e) {
|
|
|
85
85
|
function J(t) {
|
|
86
86
|
if (t == null)
|
|
87
87
|
return F(/* @__PURE__ */ new Date());
|
|
88
|
-
const [e, n, r] = t.split("-").map((
|
|
88
|
+
const [e, n, r] = t.split("-").map((l) => parseInt(l, 10));
|
|
89
89
|
return new Date(e, n - 1, r);
|
|
90
90
|
}
|
|
91
91
|
const Ct = ({
|
|
92
92
|
firstDayOfWeek: t,
|
|
93
93
|
min: e,
|
|
94
94
|
max: n
|
|
95
|
-
}) => ({ getGranularCalendarLimits: (
|
|
95
|
+
}) => ({ getGranularCalendarLimits: (l) => {
|
|
96
96
|
let c = F(e), m = N(n);
|
|
97
|
-
if ((
|
|
98
|
-
if (
|
|
99
|
-
c = F(
|
|
97
|
+
if ((l == null ? void 0 : l.type) === "weekly") {
|
|
98
|
+
if (l.earliest)
|
|
99
|
+
c = F(l.earliest);
|
|
100
100
|
else {
|
|
101
101
|
const _ = Oe(c, { weekStartsOn: t });
|
|
102
102
|
B(c, _) || (c = F(ct(we(c, { weekStartsOn: t }), 1)));
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
m = N(
|
|
104
|
+
if (l.latest)
|
|
105
|
+
m = N(l.latest);
|
|
106
106
|
else {
|
|
107
107
|
const _ = we(m, { weekStartsOn: t });
|
|
108
108
|
B(m, _) || (m = N(Dt(Oe(m, { weekStartsOn: t }), 1)));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
if ((
|
|
112
|
-
if (
|
|
113
|
-
c = F(
|
|
111
|
+
if ((l == null ? void 0 : l.type) === "monthly") {
|
|
112
|
+
if (l.earliest)
|
|
113
|
+
c = F(l.earliest);
|
|
114
114
|
else {
|
|
115
115
|
const _ = Me(c);
|
|
116
116
|
B(c, _) || (c = Me($e(c, 1)));
|
|
117
117
|
}
|
|
118
|
-
if (
|
|
119
|
-
m = N(
|
|
118
|
+
if (l.latest)
|
|
119
|
+
m = N(l.latest);
|
|
120
120
|
else {
|
|
121
121
|
const _ = he(m);
|
|
122
122
|
B(m, _) || (m = he(mt(m, 1)));
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
if ((
|
|
126
|
-
if (
|
|
127
|
-
c = ue(
|
|
125
|
+
if ((l == null ? void 0 : l.type) === "quarterly") {
|
|
126
|
+
if (l.earliest)
|
|
127
|
+
c = ue(l.earliest);
|
|
128
128
|
else {
|
|
129
129
|
const _ = ue(c);
|
|
130
130
|
B(c, _) || (c = ue(He(c, 1)));
|
|
131
131
|
}
|
|
132
|
-
if (
|
|
133
|
-
m = N(
|
|
132
|
+
if (l.latest)
|
|
133
|
+
m = N(l.latest);
|
|
134
134
|
else {
|
|
135
135
|
const _ = Ce(m);
|
|
136
136
|
B(m, _) || (m = Ce(Mt(m, 1)));
|
|
@@ -146,8 +146,8 @@ const Ct = ({
|
|
|
146
146
|
});
|
|
147
147
|
return {
|
|
148
148
|
savedRanges: t,
|
|
149
|
-
saveRange: (r,
|
|
150
|
-
t[r] =
|
|
149
|
+
saveRange: (r, l) => {
|
|
150
|
+
t[r] = l;
|
|
151
151
|
},
|
|
152
152
|
resetSavedRanges: () => {
|
|
153
153
|
t.daily = null, t.weekly = null, t.monthly = null, t.quarterly = null;
|
|
@@ -156,8 +156,8 @@ const Ct = ({
|
|
|
156
156
|
};
|
|
157
157
|
var p = /* @__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))(p || {});
|
|
158
158
|
const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
159
|
-
const { selectionStart: e } = t.target, n = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"], r = At.test(t.key) || n.includes(t.key),
|
|
160
|
-
!r && !
|
|
159
|
+
const { selectionStart: e } = t.target, n = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"], r = At.test(t.key) || n.includes(t.key), l = [1, 2, 4, 5].includes(e) && t.key === ":";
|
|
160
|
+
!r && !l && t.preventDefault();
|
|
161
161
|
}, Ne = (t) => {
|
|
162
162
|
if (!t)
|
|
163
163
|
return t;
|
|
@@ -284,7 +284,7 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
284
284
|
],
|
|
285
285
|
setup(t, { emit: e, slots: n }) {
|
|
286
286
|
var Ie, Se, be, ke;
|
|
287
|
-
const { locale: r, t:
|
|
287
|
+
const { locale: r, t: l } = Re(), c = _e(), m = A({}), _ = I(() => t.variant === "month" ? "monthly" : "daily"), s = ve({
|
|
288
288
|
startDate: (Ie = t.value) == null ? void 0 : Ie.startDate,
|
|
289
289
|
endDate: (Se = t.value) == null ? void 0 : Se.endDate,
|
|
290
290
|
range: (be = t.value) == null ? void 0 : be.range,
|
|
@@ -303,14 +303,14 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
303
303
|
) : null;
|
|
304
304
|
}
|
|
305
305
|
const b = I(() => {
|
|
306
|
-
var a,
|
|
306
|
+
var a, o;
|
|
307
307
|
return (
|
|
308
308
|
// eslint-disable-next-line consistent-return
|
|
309
|
-
((
|
|
309
|
+
((o = (a = t == null ? void 0 : t.quickSelectRanges) == null ? void 0 : a.find(({ value: d, data: u }) => {
|
|
310
310
|
var S;
|
|
311
|
-
if (!
|
|
312
|
-
if (
|
|
313
|
-
const O = (S = m.value) == null ? void 0 : S[
|
|
311
|
+
if (!u.endDate) {
|
|
312
|
+
if (u.isRelativeToNow) {
|
|
313
|
+
const O = (S = m.value) == null ? void 0 : S[d];
|
|
314
314
|
return O ? me(
|
|
315
315
|
v(O.startDate),
|
|
316
316
|
v(s.startDate)
|
|
@@ -320,43 +320,46 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
320
320
|
) : (
|
|
321
321
|
// If not stored calculated dates, fall back to comparing the quick select item's value
|
|
322
322
|
// with the internal range's stored range identifier.
|
|
323
|
-
|
|
323
|
+
d === s.range
|
|
324
324
|
);
|
|
325
325
|
}
|
|
326
326
|
return me(
|
|
327
|
-
v(
|
|
327
|
+
v(u.startDate),
|
|
328
328
|
v(s.startDate)
|
|
329
329
|
) && me(
|
|
330
330
|
v(s.endDate),
|
|
331
331
|
v(N(s.endDate))
|
|
332
|
-
) && Et(v(s.endDate));
|
|
332
|
+
) && Et(v(s.endDate)) && (t.granularities ? u.granularity === s.granularity : !0);
|
|
333
333
|
}
|
|
334
334
|
if (t.allowTimeInput)
|
|
335
335
|
return Be(
|
|
336
|
-
v(
|
|
336
|
+
v(u.startDate),
|
|
337
337
|
v(s.startDate)
|
|
338
|
-
) && Be(
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
) && Be(
|
|
339
|
+
v(u.endDate),
|
|
340
|
+
v(s.endDate)
|
|
341
|
+
) && (t.granularities ? u.granularity === s.granularity : !0);
|
|
342
|
+
if (u.endDate)
|
|
343
|
+
return B(u.startDate, s.startDate) && B(u.endDate, s.endDate) && (t.granularities ? u.granularity === s.granularity : !0);
|
|
344
|
+
})) == null ? void 0 : o.value) ?? Le
|
|
342
345
|
);
|
|
343
346
|
}), de = I(() => ({
|
|
344
347
|
"b-date-range-picker-calendar__form-input-wrapper": t.allowTimeInput
|
|
345
348
|
})), re = I(() => [
|
|
346
|
-
{ label:
|
|
349
|
+
{ label: l("customRange"), value: Le },
|
|
347
350
|
...t.quickSelectRanges ? t.quickSelectRanges : []
|
|
348
351
|
]), y = I(
|
|
349
352
|
() => {
|
|
350
353
|
var a;
|
|
351
|
-
return ((a = t.granularities) == null ? void 0 : a.find(({ type:
|
|
354
|
+
return ((a = t.granularities) == null ? void 0 : a.find(({ type: o }) => o === s.granularity)) || null;
|
|
352
355
|
}
|
|
353
356
|
), X = I(
|
|
354
357
|
() => {
|
|
355
358
|
var a;
|
|
356
|
-
return ((a = t.granularities) == null ? void 0 : a.map(({ type:
|
|
357
|
-
label: o
|
|
358
|
-
value:
|
|
359
|
-
disabled:
|
|
359
|
+
return ((a = t.granularities) == null ? void 0 : a.map(({ type: o, disabled: d }) => ({
|
|
360
|
+
label: l(o),
|
|
361
|
+
value: o,
|
|
362
|
+
disabled: d
|
|
360
363
|
}))) ?? [];
|
|
361
364
|
}
|
|
362
365
|
), { getGranularCalendarLimits: h } = Ct(t), T = I(
|
|
@@ -380,21 +383,21 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
380
383
|
endDate: t.dateFormData.endDate,
|
|
381
384
|
startTime: t.dateFormData.startTime,
|
|
382
385
|
endTime: t.dateFormData.endTime
|
|
383
|
-
}), pe = (a,
|
|
384
|
-
let
|
|
385
|
-
const [
|
|
386
|
-
return
|
|
387
|
-
}, ge = (a) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(a), ie = (a,
|
|
388
|
-
const
|
|
389
|
-
if (
|
|
390
|
-
const
|
|
391
|
-
if (t.min &&
|
|
386
|
+
}), pe = (a, o) => {
|
|
387
|
+
let d = new Date(a);
|
|
388
|
+
const [u, S, O] = o.split(":");
|
|
389
|
+
return d = ht(d, parseInt(u, 10)), d = Ot(d, parseInt(S, 10)), d = wt(d, parseInt(O, 10)), d;
|
|
390
|
+
}, ge = (a) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(a), ie = (a, o) => {
|
|
391
|
+
const d = () => {
|
|
392
|
+
if (o && R(o)) {
|
|
393
|
+
const u = pe(new Date(o), a);
|
|
394
|
+
if (t.min && u < Pe(t.min, 0) || t.max && u > Pe(t.max, 0))
|
|
392
395
|
return !1;
|
|
393
396
|
}
|
|
394
397
|
return !0;
|
|
395
398
|
};
|
|
396
|
-
return ge(a) &&
|
|
397
|
-
}, P = (a,
|
|
399
|
+
return ge(a) && d();
|
|
400
|
+
}, P = (a, o) => !o || !ge(o) || t.variant === "month" ? a : pe(new Date(a), o), D = (a) => {
|
|
398
401
|
i.startTime = E(
|
|
399
402
|
t.min && t.allowTimeInput && B(t.min, a.startDate) ? t.min : F(a.startDate)
|
|
400
403
|
), i.endTime = E(
|
|
@@ -404,65 +407,65 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
404
407
|
range: b.value
|
|
405
408
|
});
|
|
406
409
|
}, R = (a) => {
|
|
407
|
-
const
|
|
408
|
-
return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) &&
|
|
410
|
+
const o = (u) => t.min && F(u) < F(t.min) || t.max && F(u) > F(t.max) ? !1 : t.isDateDisabled ? !t.isDateDisabled(F(u)) : !0;
|
|
411
|
+
return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) && o(new Date(a));
|
|
409
412
|
};
|
|
410
413
|
je(() => {
|
|
411
414
|
W.value = !!(t.dateFormData.startDate && !R(t.dateFormData.startDate)), t.allowTimeInput ? L.value = !!(t.dateFormData.startTime && !ie(t.dateFormData.startTime, t.dateFormData.startDate)) : L.value = !1, K.value = !!(t.dateFormData.endDate && !R(t.dateFormData.endDate)), t.allowTimeInput ? Q.value = !!(t.dateFormData.endTime && !ie(t.dateFormData.endTime, t.dateFormData.endDate)) : Q.value = !1;
|
|
412
415
|
});
|
|
413
416
|
const z = (a) => {
|
|
414
|
-
var
|
|
415
|
-
i.startDate = f(a), i.startTime ? L.value && (i.startTime = (
|
|
417
|
+
var o;
|
|
418
|
+
i.startDate = f(a), i.startTime ? L.value && (i.startTime = (o = t.dateFormData) == null ? void 0 : o.startTime) : i.startTime = E(a), W.value = !1, L.value = !1, e(p.START_DATE_SELECTED, a);
|
|
416
419
|
}, $ = (a) => {
|
|
417
|
-
var
|
|
418
|
-
i.endDate = f(a), i.endTime ? Q.value && (i.endTime = (
|
|
419
|
-
},
|
|
420
|
-
const
|
|
421
|
-
if (
|
|
422
|
-
return
|
|
420
|
+
var o;
|
|
421
|
+
i.endDate = f(a), i.endTime ? Q.value && (i.endTime = (o = t.dateFormData) == null ? void 0 : o.endTime) : i.endTime = E(N(a)), K.value = !1, Q.value = !1;
|
|
422
|
+
}, le = (a) => {
|
|
423
|
+
const o = t.value[a];
|
|
424
|
+
if (o)
|
|
425
|
+
return o;
|
|
423
426
|
if (t.dateFormData[a] && R(t.dateFormData[a]))
|
|
424
427
|
return new Date(t.dateFormData[a]);
|
|
425
428
|
}, Ve = De((a) => {
|
|
426
|
-
var
|
|
429
|
+
var o;
|
|
427
430
|
if (R(a)) {
|
|
428
|
-
let
|
|
429
|
-
switch (W.value = !1, (
|
|
431
|
+
let d = a;
|
|
432
|
+
switch (W.value = !1, (o = y.value) == null ? void 0 : o.type) {
|
|
430
433
|
case "weekly":
|
|
431
|
-
|
|
434
|
+
d = ee(
|
|
432
435
|
a,
|
|
433
436
|
f,
|
|
434
437
|
T.value.min,
|
|
435
438
|
T.value.max
|
|
436
|
-
), i.startDate =
|
|
439
|
+
), i.startDate = d;
|
|
437
440
|
break;
|
|
438
441
|
case "monthly":
|
|
439
|
-
|
|
442
|
+
d = g(
|
|
440
443
|
a,
|
|
441
444
|
f,
|
|
442
445
|
T.value.min,
|
|
443
446
|
T.value.max
|
|
444
|
-
), i.startDate =
|
|
447
|
+
), i.startDate = d;
|
|
445
448
|
break;
|
|
446
449
|
case "quarterly":
|
|
447
|
-
|
|
450
|
+
d = se(
|
|
448
451
|
a,
|
|
449
452
|
f,
|
|
450
453
|
T.value.min,
|
|
451
454
|
T.value.max
|
|
452
|
-
), i.startDate =
|
|
455
|
+
), i.startDate = d;
|
|
453
456
|
break;
|
|
454
457
|
}
|
|
455
|
-
const
|
|
456
|
-
s.startDate = P(
|
|
458
|
+
const u = J(d);
|
|
459
|
+
s.startDate = P(u, i.startTime), s.endDate = P(
|
|
457
460
|
J(i.endDate),
|
|
458
461
|
i.endTime
|
|
459
462
|
), R(i.endDate) && (s.endDate = P(
|
|
460
463
|
J(i.endDate),
|
|
461
464
|
i.endTime
|
|
462
465
|
));
|
|
463
|
-
const S =
|
|
466
|
+
const S = le("endDate");
|
|
464
467
|
s.range = null, e(p.FORM_DATE, {
|
|
465
|
-
startDate:
|
|
468
|
+
startDate: u,
|
|
466
469
|
endDate: S
|
|
467
470
|
}), e(p.INPUT, {
|
|
468
471
|
...s,
|
|
@@ -473,44 +476,44 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
473
476
|
}, qe), We = (a) => {
|
|
474
477
|
i.startDate = xe(a), Ve(i.startDate);
|
|
475
478
|
}, Ke = De((a) => {
|
|
476
|
-
var
|
|
479
|
+
var o;
|
|
477
480
|
if (R(a)) {
|
|
478
|
-
let
|
|
479
|
-
switch (K.value = !1, (
|
|
481
|
+
let d = a;
|
|
482
|
+
switch (K.value = !1, (o = y.value) == null ? void 0 : o.type) {
|
|
480
483
|
case "weekly":
|
|
481
|
-
|
|
484
|
+
d = q(
|
|
482
485
|
a,
|
|
483
486
|
f,
|
|
484
487
|
T.value.min,
|
|
485
488
|
T.value.max
|
|
486
|
-
), i.endDate =
|
|
489
|
+
), i.endDate = d;
|
|
487
490
|
break;
|
|
488
491
|
case "monthly":
|
|
489
|
-
|
|
492
|
+
d = te(
|
|
490
493
|
a,
|
|
491
494
|
f,
|
|
492
495
|
T.value.min,
|
|
493
496
|
T.value.max
|
|
494
|
-
), i.endDate =
|
|
497
|
+
), i.endDate = d;
|
|
495
498
|
break;
|
|
496
499
|
case "quarterly":
|
|
497
|
-
|
|
500
|
+
d = V(
|
|
498
501
|
a,
|
|
499
502
|
f,
|
|
500
503
|
T.value.min,
|
|
501
504
|
T.value.max
|
|
502
|
-
), i.endDate =
|
|
505
|
+
), i.endDate = d;
|
|
503
506
|
break;
|
|
504
507
|
}
|
|
505
|
-
const
|
|
506
|
-
s.endDate = P(
|
|
508
|
+
const u = J(d);
|
|
509
|
+
s.endDate = P(u, i.endTime), R(i.startDate) && (s.startDate = P(
|
|
507
510
|
J(i.startDate),
|
|
508
511
|
i.startTime
|
|
509
512
|
));
|
|
510
|
-
const S =
|
|
513
|
+
const S = le("startDate");
|
|
511
514
|
s.range = null, e(p.FORM_DATE, {
|
|
512
515
|
startDate: S,
|
|
513
|
-
endDate:
|
|
516
|
+
endDate: u
|
|
514
517
|
}), e(p.INPUT, {
|
|
515
518
|
...s,
|
|
516
519
|
range: b.value
|
|
@@ -524,10 +527,10 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
524
527
|
}, Xe = De((a) => {
|
|
525
528
|
if (ie(a, t.dateFormData.startDate)) {
|
|
526
529
|
L.value = !1, s.startDate = P(s.startDate, a);
|
|
527
|
-
const
|
|
530
|
+
const o = le("endDate");
|
|
528
531
|
e(p.FORM_DATE, {
|
|
529
532
|
startDate: s.startDate,
|
|
530
|
-
endDate:
|
|
533
|
+
endDate: o,
|
|
531
534
|
startTime: a,
|
|
532
535
|
endTime: i.endTime ?? t.dateFormData.endTime
|
|
533
536
|
}), e(p.INPUT, {
|
|
@@ -552,25 +555,25 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
552
555
|
i.endTime = Ne(a), Ze(i.endTime);
|
|
553
556
|
}, at = (a) => {
|
|
554
557
|
Bt(a);
|
|
555
|
-
}, ce = (a,
|
|
556
|
-
s.startDate = a, s.endDate =
|
|
558
|
+
}, ce = (a, o, d, u) => {
|
|
559
|
+
s.startDate = a, s.endDate = o, d && (s.granularity = d), u && (s.range = u);
|
|
557
560
|
}, nt = (a) => {
|
|
558
|
-
var
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
+
var d;
|
|
562
|
+
const o = (d = t.quickSelectRanges) == null ? void 0 : d.find(({ value: u }) => u === a);
|
|
563
|
+
if (o) {
|
|
561
564
|
x();
|
|
562
|
-
const
|
|
563
|
-
i.endDate = f(S), i.startDate = f(O), ce(O, S, null, a), t.granularities && (s.granularity =
|
|
565
|
+
const u = o.data, S = u.endDate || (u.isRelativeToNow ? new Date(Date.now()) : N(new Date(Date.now()))), O = u.isRelativeToNow && u.timeDifference ? new Date(S.getTime() - u.timeDifference) : u.startDate;
|
|
566
|
+
i.endDate = f(S), i.startDate = f(O), ce(O, S, null, a), t.granularities && (s.granularity = u.granularity || _.value), i.startTime = E(O), i.endTime = E(S), s.startDate = O, s.endDate = S, u.isRelativeToNow && (m.value = {
|
|
564
567
|
...m.value,
|
|
565
568
|
[a]: {
|
|
566
569
|
startDate: O,
|
|
567
570
|
endDate: S
|
|
568
571
|
}
|
|
569
572
|
}), e(p.CUSTOM_RANGE, {
|
|
570
|
-
...
|
|
573
|
+
...o.data,
|
|
571
574
|
startDate: O,
|
|
572
575
|
endDate: S,
|
|
573
|
-
range:
|
|
576
|
+
range: o.value
|
|
574
577
|
});
|
|
575
578
|
}
|
|
576
579
|
}, rt = {
|
|
@@ -578,8 +581,8 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
578
581
|
monthly: H,
|
|
579
582
|
quarterly: M
|
|
580
583
|
}, st = (a) => {
|
|
581
|
-
const
|
|
582
|
-
if (s.granularity = a,
|
|
584
|
+
const o = s.granularity;
|
|
585
|
+
if (s.granularity = a, o && C(o, structuredClone(Te(s))), s.startDate && s.endDate) {
|
|
583
586
|
switch (a) {
|
|
584
587
|
case "quarterly":
|
|
585
588
|
case "monthly":
|
|
@@ -588,13 +591,13 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
588
591
|
ce(U[a].startDate, U[a].endDate, a);
|
|
589
592
|
break;
|
|
590
593
|
}
|
|
591
|
-
const { startDate:
|
|
594
|
+
const { startDate: d, endDate: u } = rt[a](
|
|
592
595
|
s.startDate,
|
|
593
596
|
s.endDate,
|
|
594
597
|
T.value.min,
|
|
595
598
|
T.value.max
|
|
596
599
|
);
|
|
597
|
-
ce(
|
|
600
|
+
ce(d, u, a);
|
|
598
601
|
break;
|
|
599
602
|
}
|
|
600
603
|
case "daily":
|
|
@@ -623,7 +626,7 @@ const At = /[\d]/, Ft = /^\d{2}$/, Ut = /^\d{2}:\d{2}$/, Bt = (t) => {
|
|
|
623
626
|
formInputWrapperConditionalClasses: de,
|
|
624
627
|
// Methods
|
|
625
628
|
hasSlot: _t(n),
|
|
626
|
-
t:
|
|
629
|
+
t: l,
|
|
627
630
|
// Events
|
|
628
631
|
onDateInput: D,
|
|
629
632
|
onDateInputKeyDown: Je,
|
|
@@ -656,14 +659,14 @@ var qt = function() {
|
|
|
656
659
|
Lt,
|
|
657
660
|
!1,
|
|
658
661
|
null,
|
|
659
|
-
"
|
|
662
|
+
"66ed8c79"
|
|
660
663
|
);
|
|
661
664
|
const Y = Yt.exports, jt = ({
|
|
662
665
|
datePickerValue: t,
|
|
663
666
|
isDateIncorrect: e,
|
|
664
667
|
quickSelectRanges: n,
|
|
665
668
|
isMonthVariant: r,
|
|
666
|
-
withTimeInput:
|
|
669
|
+
withTimeInput: l
|
|
667
670
|
}) => {
|
|
668
671
|
var y, X, h, T;
|
|
669
672
|
const { locale: c, t: m } = Re(), _ = _e(), s = (M) => !!M && !isNaN(M.getTime()), v = (M, H) => s(M) ? ae(M, H, {
|
|
@@ -698,7 +701,7 @@ const Y = Yt.exports, jt = ({
|
|
|
698
701
|
return `${f} - ${E}`;
|
|
699
702
|
}
|
|
700
703
|
const { startDate: M, endDate: H, startTime: Z, endTime: ee } = b, q = r != null && r.value ? k.LONG_MONTH_YEAR : k.FULL_DATE_MONTH_FIRST, g = v(J(M), q), te = v(J(H), q);
|
|
701
|
-
if (!
|
|
704
|
+
if (!l.value)
|
|
702
705
|
return `${g} - ${te}`;
|
|
703
706
|
const se = [g, Z].filter(Boolean).join(", "), V = [te, ee].filter(Boolean).join(", ");
|
|
704
707
|
return `${se} - ${V}`;
|
|
@@ -838,7 +841,7 @@ const Qt = {
|
|
|
838
841
|
},
|
|
839
842
|
emits: [fe.INPUT],
|
|
840
843
|
setup(t, { emit: e }) {
|
|
841
|
-
const n = t, { locale: r, t:
|
|
844
|
+
const n = t, { locale: r, t: l } = Re(), c = _e(), m = oe("bento-date-range-picker-container"), _ = oe("bento-date-range-picker-label"), s = oe("bento-date-range-picker-description"), v = oe("bento-date-range-picker-error"), b = oe("bento-date-range-picker-date-error"), de = I(() => n.label || l("dateRangePicker", { name: m })), re = I(() => (n == null ? void 0 : n.quickSelectRanges) && n.quickSelectRanges.map((D) => {
|
|
842
845
|
const R = D.data.endDate ? void 0 : new Date(Date.now()).getTime() - D.data.startDate.getTime();
|
|
843
846
|
return {
|
|
844
847
|
...D,
|
|
@@ -893,14 +896,14 @@ const Qt = {
|
|
|
893
896
|
);
|
|
894
897
|
const L = I(() => [
|
|
895
898
|
{
|
|
896
|
-
title:
|
|
899
|
+
title: l("apply"),
|
|
897
900
|
event: () => {
|
|
898
901
|
e(fe.INPUT, f.value), V(), E.value = !0;
|
|
899
902
|
},
|
|
900
903
|
disabled: E.value
|
|
901
904
|
},
|
|
902
905
|
{
|
|
903
|
-
title:
|
|
906
|
+
title: l("cancel"),
|
|
904
907
|
event: V
|
|
905
908
|
}
|
|
906
909
|
]);
|
|
@@ -910,7 +913,7 @@ const Qt = {
|
|
|
910
913
|
return;
|
|
911
914
|
}
|
|
912
915
|
e(fe.INPUT, D);
|
|
913
|
-
}), { __sfc: !0, emit: e, props: n, locale: r, t:
|
|
916
|
+
}), { __sfc: !0, emit: e, props: n, locale: r, t: l, locales: c, datePickerContainerId: m, labelId: _, descriptionId: s, errorId: v, dateErrorId: b, popoverAriaLabel: de, adjustedQuickSelectRanges: re, isDateIncorrect: y, inputContainerRef: X, isDateRangePickerOpen: h, isReadOnly: T, shouldDisplayError: M, descriptionConditionalClasses: H, isMonthVariant: Z, withTimeInput: ee, dateDisplayValue: q, textInputDisplayValue: g, formatTextInputDisplayValue: te, ariaDescribedBy: se, closeDateRangePicker: V, openDateRangePicker: U, localDateDisplayValue: C, localTextInputDisplayValue: x, selectedDate: f, isApplyDisabled: E, displayedTextInputValue: W, displayedDateValue: K, rangePickerButtonActions: L, onDateRangePickerInput: (D) => {
|
|
914
917
|
y.value = !1;
|
|
915
918
|
const R = (z, $) => z ? ae(z, $, {
|
|
916
919
|
locale: c[r.value.substring(0, 2)] || c.enUS
|
|
@@ -930,7 +933,7 @@ const Qt = {
|
|
|
930
933
|
y.value = !0, g.startDate = D.startDate, g.endDate = D.endDate, f.value = { startDate: null, endDate: null };
|
|
931
934
|
}, onRangeSelectorInput: (D) => {
|
|
932
935
|
if (D) {
|
|
933
|
-
const R = ($,
|
|
936
|
+
const R = ($, le) => $ ? ae($, le, {
|
|
934
937
|
locale: c[r.value.substring(0, 2)] || c.enUS
|
|
935
938
|
}) : void 0, z = ($) => ae($, k.NUMERIC_DATE_YEAR_FIRST, {
|
|
936
939
|
locale: c[r.value.substring(0, 2)] || c.enUS
|
|
@@ -940,15 +943,15 @@ const Qt = {
|
|
|
940
943
|
k.HOUR_MINUTE_SECONDS
|
|
941
944
|
), g.endTime = R(D.endDate, k.HOUR_MINUTE_SECONDS), f.value = D;
|
|
942
945
|
}
|
|
943
|
-
}, BentoButtonActions:
|
|
946
|
+
}, BentoButtonActions: ot, BentoButtonActionsLayout: bt, BentoDivider: it, BentoPopover: lt, BentoTypography: Qe, DateRangePickerCalendar: Y, DropdownInputDefault: dt, ErrorMessage: St, FieldLabel: It, vBentoClickOutsideDirective: Rt };
|
|
944
947
|
}
|
|
945
948
|
});
|
|
946
949
|
var Ht = function() {
|
|
947
950
|
var e = this, n = e._self._c, r = e._self._setupProxy;
|
|
948
|
-
return n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: r.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [e.label ? n(r.FieldLabel, { attrs: { id: r.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), n("div", { on: { keydown: function(
|
|
949
|
-
return !
|
|
950
|
-
} } }, [n(r.DropdownInputDefault, { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: r.datePickerContainerId, ariaExpanded: r.isDateRangePickerOpen, "aria-labelledby": e.label ? r.labelId : null, "aria-describedby": r.ariaDescribedBy, disabled: e.disabled, "is-invalid": !!e.errorMessage || r.shouldDisplayError, open: r.isDateRangePickerOpen, "display-value": r.displayedDateValue, readonly: r.isReadOnly }, on: { open: r.openDateRangePicker, clear: r.clearDateRangePickerValue, close: r.closeDateRangePicker } })], 1), r.shouldDisplayError ? n(r.ErrorMessage, { staticClass: "b-date-range-picker__error-message", attrs: { id: r.dateErrorId, "error-message": r.t("provideDateInAFormat") } }) : e._e(), e.errorMessage ? n(r.ErrorMessage, { staticClass: "b-date-range-picker__error-message", attrs: { id: r.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? n(r.BentoTypography, { staticClass: "b-date-range-picker__description", class: r.descriptionConditionalClasses, attrs: { id: r.descriptionId, el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), r.inputContainerRef ? n(r.BentoPopover, { staticClass: "b-date-range-picker__container", attrs: { id: r.datePickerContainerId, open: r.isDateRangePickerOpen, "target-element": r.inputContainerRef, "aria-label": r.popoverAriaLabel, position: "bottom-start", "without-space": "", "fit-content": "", "trap-all": "" }, nativeOn: { keydown: function(
|
|
951
|
-
return !
|
|
951
|
+
return n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: r.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [e.label ? n(r.FieldLabel, { attrs: { id: r.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), n("div", { on: { keydown: function(l) {
|
|
952
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : r.onEnterPressedOverInput.apply(null, arguments);
|
|
953
|
+
} } }, [n(r.DropdownInputDefault, { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: r.datePickerContainerId, ariaExpanded: r.isDateRangePickerOpen, "aria-labelledby": e.label ? r.labelId : null, "aria-describedby": r.ariaDescribedBy, disabled: e.disabled, "is-invalid": !!e.errorMessage || r.shouldDisplayError, open: r.isDateRangePickerOpen, "display-value": r.displayedDateValue, readonly: r.isReadOnly }, on: { open: r.openDateRangePicker, clear: r.clearDateRangePickerValue, close: r.closeDateRangePicker } })], 1), r.shouldDisplayError ? n(r.ErrorMessage, { staticClass: "b-date-range-picker__error-message", attrs: { id: r.dateErrorId, "error-message": r.t("provideDateInAFormat") } }) : e._e(), e.errorMessage ? n(r.ErrorMessage, { staticClass: "b-date-range-picker__error-message", attrs: { id: r.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? n(r.BentoTypography, { staticClass: "b-date-range-picker__description", class: r.descriptionConditionalClasses, attrs: { id: r.descriptionId, el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), r.inputContainerRef ? n(r.BentoPopover, { staticClass: "b-date-range-picker__container", attrs: { id: r.datePickerContainerId, open: r.isDateRangePickerOpen, "target-element": r.inputContainerRef, "aria-label": r.popoverAriaLabel, position: "bottom-start", "without-space": "", "fit-content": "", "trap-all": "" }, nativeOn: { keydown: function(l) {
|
|
954
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : r.closeDateRangePicker.apply(null, arguments);
|
|
952
955
|
} } }, [n(r.DateRangePickerCalendar, { attrs: { "allow-time-input": r.withTimeInput, "quick-select-ranges": r.adjustedQuickSelectRanges, 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": r.displayedTextInputValue, variant: e.variant }, on: { "custom-range": r.onRangeSelectorInput, input: r.onDateRangePickerInput, error: r.onDateRangePickerError, "form-date": r.onDateRangePickerFormDateInputUpdate }, scopedSlots: e._u([e.hasActions ? { key: "actions", fn: function() {
|
|
953
956
|
return [n(r.BentoDivider), n("div", { staticClass: "b-date-range-picker__footer" }, [n(r.BentoButtonActions, { attrs: { actions: r.rangePickerButtonActions, layout: r.BentoButtonActionsLayout.SPACE_BETWEEN } })], 1)];
|
|
954
957
|
}, proxy: !0 } : null], null, !0) })], 1) : e._e()], 1);
|
|
@@ -968,4 +971,4 @@ export {
|
|
|
968
971
|
Et as b,
|
|
969
972
|
me as i
|
|
970
973
|
};
|
|
971
|
-
//# sourceMappingURL=date-range-picker.
|
|
974
|
+
//# sourceMappingURL=date-range-picker.DR2nDLqc.js.map
|