@adyen/bento-vue3 1.66.0 → 1.67.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 +65 -29
- package/dist/action-bar.js +1 -1
- 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/dropdown-default-textbox.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/footer-actions.css +1 -1
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field.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/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/chunks/{action-bar.OzhLTUKc.js → action-bar.ComuZPet.js} +4 -4
- package/dist/chunks/{action-bar.OzhLTUKc.js.map → action-bar.ComuZPet.js.map} +1 -1
- package/dist/chunks/{base-modal.CCwWuH6k.js → base-modal.DzJrvis_.js} +2 -2
- package/dist/chunks/{base-modal.CCwWuH6k.js.map → base-modal.DzJrvis_.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.xZYmwO7S.js → button-actions-with-menu.B0nWCTwZ.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.xZYmwO7S.js.map → button-actions-with-menu.B0nWCTwZ.js.map} +1 -1
- package/dist/chunks/{button-actions.D1pXI1AJ.js → button-actions.BwpznQ6c.js} +2 -2
- package/dist/chunks/button-actions.BwpznQ6c.js.map +1 -0
- package/dist/chunks/{card.DiBtLuRU.js → card.JBOvn2BO.js} +2 -2
- package/dist/chunks/{card.DiBtLuRU.js.map → card.JBOvn2BO.js.map} +1 -1
- package/dist/chunks/{code-snippet.DPIhpuKa.js → code-snippet.vrlSqi9k.js} +3 -3
- package/dist/chunks/{code-snippet.DPIhpuKa.js.map → code-snippet.vrlSqi9k.js.map} +1 -1
- package/dist/chunks/{dashboard-section.BmtN9b0B.js → dashboard-section.Bg0dfNs-.js} +2 -2
- package/dist/chunks/{dashboard-section.BmtN9b0B.js.map → dashboard-section.Bg0dfNs-.js.map} +1 -1
- package/dist/chunks/{dashed-underline.ywc0ydgS.js → dashed-underline.DgE-UB-x.js} +2 -2
- package/dist/chunks/{dashed-underline.ywc0ydgS.js.map → dashed-underline.DgE-UB-x.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DAuqLhPI.js → data-grid-template.Df7j2oxe.js} +2 -2
- package/dist/chunks/{data-grid-template.DAuqLhPI.js.map → data-grid-template.Df7j2oxe.js.map} +1 -1
- package/dist/chunks/{data-grid.BrYCmbPR.js → data-grid.rDZadZwc.js} +367 -365
- package/dist/chunks/data-grid.rDZadZwc.js.map +1 -0
- package/dist/chunks/{date-picker.Bk4FNLyR.js → date-picker.CZ6zU-NJ.js} +15 -15
- package/dist/chunks/{date-picker.Bk4FNLyR.js.map → date-picker.CZ6zU-NJ.js.map} +1 -1
- package/dist/chunks/date-range-picker.Dw4R9bIs.js +1225 -0
- package/dist/chunks/date-range-picker.Dw4R9bIs.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.B05elQig.js → dropdown-default-textbox.Ce5D3ipi.js} +40 -39
- package/dist/chunks/dropdown-default-textbox.Ce5D3ipi.js.map +1 -0
- package/dist/chunks/{dropdown-tag.BUDNO3d0.js → dropdown-tag.BlHovDol.js} +2 -2
- package/dist/chunks/{dropdown-tag.BUDNO3d0.js.map → dropdown-tag.BlHovDol.js.map} +1 -1
- package/dist/chunks/{dropdown.usAqDecC.js → dropdown.B5ZaFDn_.js} +30 -30
- package/dist/chunks/{dropdown.usAqDecC.js.map → dropdown.B5ZaFDn_.js.map} +1 -1
- package/dist/chunks/{filter-bar.BxfaFHTk.js → filter-bar.XonJn7ao.js} +11 -11
- package/dist/chunks/{filter-bar.BxfaFHTk.js.map → filter-bar.XonJn7ao.js.map} +1 -1
- package/dist/chunks/{footer-actions.vQ4flLqU.js → footer-actions.CdJLLWNR.js} +2 -2
- package/dist/chunks/{footer-actions.vQ4flLqU.js.map → footer-actions.CdJLLWNR.js.map} +1 -1
- package/dist/chunks/{header-with-views.COrWDbtU.js → header-with-views.CHbH1_1V.js} +669 -652
- package/dist/chunks/header-with-views.CHbH1_1V.js.map +1 -0
- package/dist/chunks/{header.DAEUKoX5.js → header.CJJWPB5Z.js} +4 -4
- package/dist/chunks/{header.DAEUKoX5.js.map → header.CJJWPB5Z.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.Duk1tj5G.js → info-icon-with-popover.DVH46dPy.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.Duk1tj5G.js.map → info-icon-with-popover.DVH46dPy.js.map} +1 -1
- package/dist/chunks/{input-field-password.XrXAnMpT.js → input-field-password.DWZAf1Oh.js} +86 -85
- package/dist/chunks/input-field-password.DWZAf1Oh.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.CNurVdiF.js → input-field-phone-number.CbpRItYf.js} +3 -3
- package/dist/chunks/{input-field-phone-number.CNurVdiF.js.map → input-field-phone-number.CbpRItYf.js.map} +1 -1
- package/dist/chunks/input-field.DExw_Cow.js +303 -0
- package/dist/chunks/input-field.DExw_Cow.js.map +1 -0
- package/dist/chunks/{menu.CiyYOoKd.js → menu.CeLJ1gIz.js} +2 -2
- package/dist/chunks/{menu.CiyYOoKd.js.map → menu.CeLJ1gIz.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CuL9oSAq.js → modal-fullscreen.CZnLS-fQ.js} +2 -2
- package/dist/chunks/{modal-fullscreen.CuL9oSAq.js.map → modal-fullscreen.CZnLS-fQ.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.LnD61fHp.js → modal.vue_vue_type_script_setup_true_lang.CP7dV1Yy.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.LnD61fHp.js.map → modal.vue_vue_type_script_setup_true_lang.CP7dV1Yy.js.map} +1 -1
- package/dist/chunks/{pagination._rYMF2W_.js → pagination.DL9LmFMJ.js} +2 -2
- package/dist/chunks/{pagination._rYMF2W_.js.map → pagination.DL9LmFMJ.js.map} +1 -1
- package/dist/chunks/{popover.maCMPyz8.js → popover.VI3TrUkL.js} +2 -2
- package/dist/chunks/{popover.maCMPyz8.js.map → popover.VI3TrUkL.js.map} +1 -1
- package/dist/chunks/promo-banner.CQp3z2CP.js.map +1 -1
- package/dist/chunks/{rich-text-editor.RD8aCPTi.js → rich-text-editor.Dl9PsYbk.js} +4 -3
- package/dist/chunks/{rich-text-editor.RD8aCPTi.js.map → rich-text-editor.Dl9PsYbk.js.map} +1 -1
- package/dist/chunks/{search-bar.i7BY4IGB.js → search-bar.a-jzP1UA.js} +3 -3
- package/dist/chunks/{search-bar.i7BY4IGB.js.map → search-bar.a-jzP1UA.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DkRQsIx7.js → secondary-nav.UrmIAVGD.js} +2 -2
- package/dist/chunks/{secondary-nav.DkRQsIx7.js.map → secondary-nav.UrmIAVGD.js.map} +1 -1
- package/dist/chunks/{sidepanel.CTIjklfG.js → sidepanel.BuNmgmpj.js} +2 -2
- package/dist/chunks/{sidepanel.CTIjklfG.js.map → sidepanel.BuNmgmpj.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BTr6x5cg.js → summary-grid.types.CoSCUI1V.js} +2 -2
- package/dist/chunks/{summary-grid.types.BTr6x5cg.js.map → summary-grid.types.CoSCUI1V.js.map} +1 -1
- package/dist/chunks/{timeline-item.Coz_LRD3.js → timeline-item.BRHwCA1F.js} +2 -2
- package/dist/chunks/{timeline-item.Coz_LRD3.js.map → timeline-item.BRHwCA1F.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.E8oBlhrC.js → tutorial.vue_vue_type_script_setup_true_lang.CAf69UYO.js} +4 -4
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.E8oBlhrC.js.map → tutorial.vue_vue_type_script_setup_true_lang.CAf69UYO.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.rqtiP4Nd.js → use-cached-selected-values.D7dOPJSO.js} +87 -83
- package/dist/chunks/use-cached-selected-values.D7dOPJSO.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +33 -33
- 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/internal.js +4 -4
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +6 -6
- package/dist/chunks/button-actions.D1pXI1AJ.js.map +0 -1
- package/dist/chunks/data-grid.BrYCmbPR.js.map +0 -1
- package/dist/chunks/date-range-picker.-YsRuGmp.js +0 -1208
- package/dist/chunks/date-range-picker.-YsRuGmp.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.B05elQig.js.map +0 -1
- package/dist/chunks/header-with-views.COrWDbtU.js.map +0 -1
- package/dist/chunks/input-field-password.XrXAnMpT.js.map +0 -1
- package/dist/chunks/input-field.EOIwm2tq.js +0 -298
- package/dist/chunks/input-field.EOIwm2tq.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.rqtiP4Nd.js.map +0 -1
|
@@ -0,0 +1,1225 @@
|
|
|
1
|
+
import { reactive as Te, defineComponent as xe, ref as A, computed as I, onMounted as et, toRaw as he, resolveComponent as M, createElementBlock as we, openBlock as _, createElementVNode as Q, createCommentVNode as N, renderSlot as Ne, createBlock as K, createVNode as G, withCtx as j, createTextVNode as se, normalizeClass as Oe, toRef as Be, watch as Ee, resolveDirective as Tt, withDirectives as bt, withKeys as It, toDisplayString as Rt, createSlots as St } from "vue";
|
|
2
|
+
import { B as kt } from "./divider.qUOSAbU6.js";
|
|
3
|
+
import { B as Et } from "./popover.VI3TrUkL.js";
|
|
4
|
+
import { B as tt, d as ht } from "./typography.DN5eC5ch.js";
|
|
5
|
+
import { D as wt } from "./dropdown-default-textbox.Ce5D3ipi.js";
|
|
6
|
+
import { e as P, a as Pe, g as Me } from "./get-date-locale.CAyOIbcp.js";
|
|
7
|
+
import { g as De } from "./generate-uid.NJ8tVoha.js";
|
|
8
|
+
import { u as Ce } from "./i18n.B6g5VX0q.js";
|
|
9
|
+
import { e as at, t as me, g as ce, i as B, h as F, j as qe, k as Ot, l as $e, m as Mt, s as Le, n as Ct, o as Ye, a as x, u as At, f as de } from "./calendar._oPk_A1C.js";
|
|
10
|
+
import { f as Ve, v as Ft, D as E } from "./date-input.BqBdAO1E.js";
|
|
11
|
+
import { r as C, t as H } from "./index.BrH1t1iu.js";
|
|
12
|
+
import { u as _t } from "./use-form-layout-loading.D3lALhtC.js";
|
|
13
|
+
import { B as Ut } from "./directive.Cbdox5VL.js";
|
|
14
|
+
import "./events.FNmSWp_P.js";
|
|
15
|
+
import { B as Nt } from "./input-field.DExw_Cow.js";
|
|
16
|
+
import { B as Bt } from "./dropdown.B5ZaFDn_.js";
|
|
17
|
+
import { B as Pt } from "./segmented-control.5-vlm8Gt.js";
|
|
18
|
+
import { d as ge } from "./debounce.DUTu11PS.js";
|
|
19
|
+
import { u as qt } from "./use-has-slot.B7eQSabc.js";
|
|
20
|
+
import { _ as nt } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
21
|
+
import { F as $t, E as Lt } from "./error-message.DHMHq9bR.js";
|
|
22
|
+
import { B as Yt, c as Vt } from "./button-actions.BwpznQ6c.js";
|
|
23
|
+
import "../assets/date-range-picker.css";
|
|
24
|
+
function rt(e, a) {
|
|
25
|
+
C(2, arguments);
|
|
26
|
+
var s = me(a), d = s * 3;
|
|
27
|
+
return at(e, d);
|
|
28
|
+
}
|
|
29
|
+
function Qe(e) {
|
|
30
|
+
C(1, arguments);
|
|
31
|
+
var a = H(e), s = Math.floor(a.getMonth() / 3) + 1;
|
|
32
|
+
return s;
|
|
33
|
+
}
|
|
34
|
+
function je(e) {
|
|
35
|
+
return C(1, arguments), H(e).getFullYear();
|
|
36
|
+
}
|
|
37
|
+
function pe(e, a) {
|
|
38
|
+
C(2, arguments);
|
|
39
|
+
var s = H(e), d = H(a);
|
|
40
|
+
return s.getTime() === d.getTime();
|
|
41
|
+
}
|
|
42
|
+
function Qt(e, a) {
|
|
43
|
+
C(2, arguments);
|
|
44
|
+
var s = ce(e), d = ce(a);
|
|
45
|
+
return s.getTime() === d.getTime();
|
|
46
|
+
}
|
|
47
|
+
function Ke(e) {
|
|
48
|
+
C(1, arguments);
|
|
49
|
+
var a = H(e);
|
|
50
|
+
return a.setMilliseconds(0), a;
|
|
51
|
+
}
|
|
52
|
+
function Ge(e, a) {
|
|
53
|
+
C(2, arguments);
|
|
54
|
+
var s = Ke(e), d = Ke(a);
|
|
55
|
+
return s.getTime() === d.getTime();
|
|
56
|
+
}
|
|
57
|
+
function jt(e) {
|
|
58
|
+
return C(1, arguments), B(e, Date.now());
|
|
59
|
+
}
|
|
60
|
+
function Kt(e, a) {
|
|
61
|
+
C(2, arguments);
|
|
62
|
+
var s = H(e), d = me(a);
|
|
63
|
+
return s.setHours(d), s;
|
|
64
|
+
}
|
|
65
|
+
function He(e, a) {
|
|
66
|
+
C(2, arguments);
|
|
67
|
+
var s = H(e), d = me(a);
|
|
68
|
+
return s.setMilliseconds(d), s;
|
|
69
|
+
}
|
|
70
|
+
function Gt(e, a) {
|
|
71
|
+
C(2, arguments);
|
|
72
|
+
var s = H(e), d = me(a);
|
|
73
|
+
return s.setMinutes(d), s;
|
|
74
|
+
}
|
|
75
|
+
function Ht(e, a) {
|
|
76
|
+
C(2, arguments);
|
|
77
|
+
var s = H(e), d = me(a);
|
|
78
|
+
return s.setSeconds(d), s;
|
|
79
|
+
}
|
|
80
|
+
function Wt(e, a) {
|
|
81
|
+
C(2, arguments);
|
|
82
|
+
var s = me(a);
|
|
83
|
+
return rt(e, -s);
|
|
84
|
+
}
|
|
85
|
+
function le(e) {
|
|
86
|
+
if (e == null)
|
|
87
|
+
return F(/* @__PURE__ */ new Date());
|
|
88
|
+
const [a, s, d] = e.split("-").map((l) => parseInt(l, 10));
|
|
89
|
+
return new Date(a, s - 1, d);
|
|
90
|
+
}
|
|
91
|
+
const zt = ({
|
|
92
|
+
firstDayOfWeek: e,
|
|
93
|
+
min: a,
|
|
94
|
+
max: s
|
|
95
|
+
}) => ({ getGranularCalendarLimits: (l) => {
|
|
96
|
+
let D = F(a), c = P(s);
|
|
97
|
+
if ((l == null ? void 0 : l.type) === "weekly") {
|
|
98
|
+
if (l.earliest)
|
|
99
|
+
D = F(l.earliest);
|
|
100
|
+
else {
|
|
101
|
+
const p = qe(D, { weekStartsOn: e });
|
|
102
|
+
B(D, p) || (D = F(Ot($e(D, { weekStartsOn: e }), 1)));
|
|
103
|
+
}
|
|
104
|
+
if (l.latest)
|
|
105
|
+
c = P(l.latest);
|
|
106
|
+
else {
|
|
107
|
+
const p = $e(c, { weekStartsOn: e });
|
|
108
|
+
B(c, p) || (c = P(Mt(qe(c, { weekStartsOn: e }), 1)));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if ((l == null ? void 0 : l.type) === "monthly") {
|
|
112
|
+
if (l.earliest)
|
|
113
|
+
D = F(l.earliest);
|
|
114
|
+
else {
|
|
115
|
+
const p = Le(D);
|
|
116
|
+
B(D, p) || (D = Le(at(D, 1)));
|
|
117
|
+
}
|
|
118
|
+
if (l.latest)
|
|
119
|
+
c = P(l.latest);
|
|
120
|
+
else {
|
|
121
|
+
const p = Pe(c);
|
|
122
|
+
B(c, p) || (c = Pe(Ct(c, 1)));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if ((l == null ? void 0 : l.type) === "quarterly") {
|
|
126
|
+
if (l.earliest)
|
|
127
|
+
D = ce(l.earliest);
|
|
128
|
+
else {
|
|
129
|
+
const p = ce(D);
|
|
130
|
+
B(D, p) || (D = ce(rt(D, 1)));
|
|
131
|
+
}
|
|
132
|
+
if (l.latest)
|
|
133
|
+
c = P(l.latest);
|
|
134
|
+
else {
|
|
135
|
+
const p = Ye(c);
|
|
136
|
+
B(c, p) || (c = Ye(Wt(c, 1)));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return { min: D, max: c };
|
|
140
|
+
} }), Jt = () => {
|
|
141
|
+
const e = Te({
|
|
142
|
+
daily: null,
|
|
143
|
+
weekly: null,
|
|
144
|
+
monthly: null,
|
|
145
|
+
quarterly: null
|
|
146
|
+
});
|
|
147
|
+
return {
|
|
148
|
+
savedRanges: e,
|
|
149
|
+
saveRange: (d, l) => {
|
|
150
|
+
e[d] = l;
|
|
151
|
+
},
|
|
152
|
+
resetSavedRanges: () => {
|
|
153
|
+
e.daily = null, e.weekly = null, e.monthly = null, e.quarterly = null;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
var y = /* @__PURE__ */ ((e) => (e.CUSTOM_RANGE = "custom-range", e.INPUT = "input", e.ERROR = "error", e.FORM_DATE = "form-date", e.START_DATE_SELECTED = "start-date-selected", e))(y || {});
|
|
158
|
+
const Xt = /[\d]/, Zt = /^\d{2}$/, xt = /^\d{2}:\d{2}$/, ea = (e) => {
|
|
159
|
+
const { selectionStart: a } = e.target, s = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"], d = Xt.test(e.key) || s.includes(e.key), l = [1, 2, 4, 5].includes(a) && e.key === ":";
|
|
160
|
+
!d && !l && e.preventDefault();
|
|
161
|
+
}, We = (e) => {
|
|
162
|
+
if (!e)
|
|
163
|
+
return e;
|
|
164
|
+
let a = e;
|
|
165
|
+
if (a.length === 1 && parseInt(e, 10) > 2)
|
|
166
|
+
return `0${a}:`;
|
|
167
|
+
const [s, d] = a.slice(-2);
|
|
168
|
+
return [2, 5].includes(a.length) && d === ":" && (a = `${a.slice(0, a.length - 2)}0${s}`), (Zt.test(a) || xt.test(a)) && (a += ":"), a;
|
|
169
|
+
}, ze = {
|
|
170
|
+
"en-US": {
|
|
171
|
+
customRange: "Custom range",
|
|
172
|
+
daily: "Daily",
|
|
173
|
+
dateFrom: "Date from",
|
|
174
|
+
dateTo: "Date to",
|
|
175
|
+
lastMonth: "Last month",
|
|
176
|
+
lastSevenDays: "Last 7 days",
|
|
177
|
+
lastThreeMonths: "Last three months",
|
|
178
|
+
monthly: "Monthly",
|
|
179
|
+
quarterly: "Quarterly",
|
|
180
|
+
timeFrom: "Time from",
|
|
181
|
+
timeTo: "Time to",
|
|
182
|
+
weekly: "Weekly"
|
|
183
|
+
},
|
|
184
|
+
"ja-JP": {
|
|
185
|
+
customRange: "カスタム範囲を選択",
|
|
186
|
+
daily: "毎日",
|
|
187
|
+
lastMonth: "先月",
|
|
188
|
+
lastSevenDays: "過去7日間",
|
|
189
|
+
monthly: "毎月",
|
|
190
|
+
weekly: "毎週"
|
|
191
|
+
},
|
|
192
|
+
"pt-BR": {
|
|
193
|
+
customRange: "Selecione um intervalo personalizado",
|
|
194
|
+
daily: "Diário",
|
|
195
|
+
lastMonth: "Último mês",
|
|
196
|
+
lastSevenDays: "Últimos 7 dias",
|
|
197
|
+
monthly: "Mensal",
|
|
198
|
+
weekly: "Semanal"
|
|
199
|
+
}
|
|
200
|
+
}, Je = 300, Xe = "customRange", ta = xe({
|
|
201
|
+
i18n: { messages: ze },
|
|
202
|
+
name: "date-range-picker-calendar",
|
|
203
|
+
components: {
|
|
204
|
+
BentoDropdown: Bt,
|
|
205
|
+
BentoInputField: Nt,
|
|
206
|
+
BentoSegmentedControl: Pt,
|
|
207
|
+
BentoTypography: tt,
|
|
208
|
+
Calendar: x
|
|
209
|
+
},
|
|
210
|
+
props: {
|
|
211
|
+
/**
|
|
212
|
+
* Allows user to enter time values in the form
|
|
213
|
+
*/
|
|
214
|
+
allowTimeInput: { type: Boolean, default: !1 },
|
|
215
|
+
/**
|
|
216
|
+
* Ranges form persistance data
|
|
217
|
+
*/
|
|
218
|
+
dateFormData: {
|
|
219
|
+
type: Object,
|
|
220
|
+
default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
224
|
+
*/
|
|
225
|
+
firstDayOfWeek: x.props.firstDayOfWeek,
|
|
226
|
+
/**
|
|
227
|
+
* A list of available granularities.
|
|
228
|
+
* If present, the date picker will display a segmented control to change granularity.
|
|
229
|
+
*/
|
|
230
|
+
granularities: {
|
|
231
|
+
type: Array,
|
|
232
|
+
default: null
|
|
233
|
+
},
|
|
234
|
+
/**
|
|
235
|
+
* Indicate if a date should be disabled or not
|
|
236
|
+
*/
|
|
237
|
+
isDateDisabled: x.props.isDateDisabled,
|
|
238
|
+
/**
|
|
239
|
+
* Set a maximum number of dates to be selectable by the range.
|
|
240
|
+
*/
|
|
241
|
+
maxRange: x.props.maxRange,
|
|
242
|
+
/**
|
|
243
|
+
* Sets a minimum limit for selectable dates - dates before `min` will not be selectable
|
|
244
|
+
*/
|
|
245
|
+
min: x.props.min,
|
|
246
|
+
/**
|
|
247
|
+
* Sets a maximum limit for selectable dates - dates after `max` will not be selectable
|
|
248
|
+
*/
|
|
249
|
+
max: x.props.max,
|
|
250
|
+
/**
|
|
251
|
+
* Number of months rendered on pane
|
|
252
|
+
*/
|
|
253
|
+
numberOfMonths: x.props.numberOfMonths,
|
|
254
|
+
/**
|
|
255
|
+
* Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
|
|
256
|
+
*/
|
|
257
|
+
showEndDateOnOpen: { type: Boolean, default: !1 },
|
|
258
|
+
/**
|
|
259
|
+
* Enables the custom range selector.
|
|
260
|
+
* If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
|
|
261
|
+
* `label` - label of custom range item.
|
|
262
|
+
* `value` - a unique key of the custom range item.
|
|
263
|
+
* `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
|
|
264
|
+
*/
|
|
265
|
+
quickSelectRanges: {
|
|
266
|
+
type: Array,
|
|
267
|
+
default: void 0
|
|
268
|
+
},
|
|
269
|
+
/**
|
|
270
|
+
* Selected date
|
|
271
|
+
*/
|
|
272
|
+
value: { type: Object, default: void 0 },
|
|
273
|
+
/**
|
|
274
|
+
* The type of calendar to display. Defaults to showing days.
|
|
275
|
+
*/
|
|
276
|
+
variant: x.props.variant
|
|
277
|
+
},
|
|
278
|
+
emits: [
|
|
279
|
+
y.CUSTOM_RANGE,
|
|
280
|
+
y.INPUT,
|
|
281
|
+
y.ERROR,
|
|
282
|
+
y.FORM_DATE,
|
|
283
|
+
y.START_DATE_SELECTED
|
|
284
|
+
],
|
|
285
|
+
setup(e, { emit: a, slots: s }) {
|
|
286
|
+
var Ae, Fe, _e, Ue;
|
|
287
|
+
const { locale: d, t: l } = Ce({ messages: ze }), D = Me(), c = A({}), p = I(() => e.variant === "month" ? "monthly" : "daily"), n = Te({
|
|
288
|
+
startDate: (Ae = e.value) == null ? void 0 : Ae.startDate,
|
|
289
|
+
endDate: (Fe = e.value) == null ? void 0 : Fe.endDate,
|
|
290
|
+
range: (_e = e.value) == null ? void 0 : _e.range,
|
|
291
|
+
...e.granularities ? {
|
|
292
|
+
granularity: ((Ue = e.value) == null ? void 0 : Ue.granularity) || p.value
|
|
293
|
+
} : {}
|
|
294
|
+
});
|
|
295
|
+
function f(t) {
|
|
296
|
+
return t ? new Date(
|
|
297
|
+
t.getUTCFullYear(),
|
|
298
|
+
t.getUTCMonth(),
|
|
299
|
+
t.getUTCDate(),
|
|
300
|
+
t.getUTCHours(),
|
|
301
|
+
t.getUTCMinutes(),
|
|
302
|
+
t.getUTCSeconds()
|
|
303
|
+
) : null;
|
|
304
|
+
}
|
|
305
|
+
const h = I(() => {
|
|
306
|
+
var t, o;
|
|
307
|
+
return (
|
|
308
|
+
// eslint-disable-next-line consistent-return
|
|
309
|
+
((o = (t = e == null ? void 0 : e.quickSelectRanges) == null ? void 0 : t.find(({ value: i, data: u }) => {
|
|
310
|
+
var R;
|
|
311
|
+
if (!u.endDate) {
|
|
312
|
+
if (u.isRelativeToNow) {
|
|
313
|
+
const O = (R = c.value) == null ? void 0 : R[i];
|
|
314
|
+
return O ? pe(
|
|
315
|
+
f(O.startDate),
|
|
316
|
+
f(n.startDate)
|
|
317
|
+
) && pe(
|
|
318
|
+
f(O.endDate),
|
|
319
|
+
f(n.endDate)
|
|
320
|
+
) : (
|
|
321
|
+
// If not stored calculated dates, fall back to comparing the quick select item's value
|
|
322
|
+
// with the internal range's stored range identifier.
|
|
323
|
+
i === n.range
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
return pe(
|
|
327
|
+
f(u.startDate),
|
|
328
|
+
f(n.startDate)
|
|
329
|
+
) && pe(
|
|
330
|
+
f(n.endDate),
|
|
331
|
+
f(P(n.endDate))
|
|
332
|
+
) && jt(f(n.endDate));
|
|
333
|
+
}
|
|
334
|
+
if (e.allowTimeInput)
|
|
335
|
+
return Ge(
|
|
336
|
+
f(u.startDate),
|
|
337
|
+
f(n.startDate)
|
|
338
|
+
) && Ge(f(u.endDate), f(n.endDate));
|
|
339
|
+
if (u.endDate)
|
|
340
|
+
return B(u.startDate, n.startDate) && B(u.endDate, n.endDate);
|
|
341
|
+
})) == null ? void 0 : o.value) ?? Xe
|
|
342
|
+
);
|
|
343
|
+
}), ee = I(() => ({
|
|
344
|
+
"b-date-range-picker-calendar__form-input-wrapper": e.allowTimeInput
|
|
345
|
+
})), T = I(() => [
|
|
346
|
+
{ label: l("customRange"), value: Xe },
|
|
347
|
+
...e.quickSelectRanges ? e.quickSelectRanges : []
|
|
348
|
+
]), U = I(
|
|
349
|
+
() => {
|
|
350
|
+
var t;
|
|
351
|
+
return ((t = e.granularities) == null ? void 0 : t.find(({ type: o }) => o === n.granularity)) || null;
|
|
352
|
+
}
|
|
353
|
+
), S = I(
|
|
354
|
+
() => {
|
|
355
|
+
var t;
|
|
356
|
+
return ((t = e.granularities) == null ? void 0 : t.map(({ type: o, disabled: i }) => ({
|
|
357
|
+
label: l(o),
|
|
358
|
+
value: o,
|
|
359
|
+
disabled: i
|
|
360
|
+
}))) ?? [];
|
|
361
|
+
}
|
|
362
|
+
), { getGranularCalendarLimits: W } = zt(e), v = I(
|
|
363
|
+
() => e.granularities ? W(U.value) : { min: F(e.min), max: P(e.max) }
|
|
364
|
+
), {
|
|
365
|
+
adjustDateForQuarterly: te,
|
|
366
|
+
adjustDateForMonthly: ie,
|
|
367
|
+
adjustDateForWeekly: q,
|
|
368
|
+
adjustStartDateInputForWeekly: g,
|
|
369
|
+
adjustEndDateInputForWeekly: $,
|
|
370
|
+
adjustStartDateInputForMonthly: L,
|
|
371
|
+
adjustEndDateInputForMonthly: ae,
|
|
372
|
+
adjustStartDateInputForQuarterly: be,
|
|
373
|
+
adjustEndDateInputForQuarterly: fe
|
|
374
|
+
} = At(e.firstDayOfWeek), { savedRanges: Y, saveRange: z, resetSavedRanges: ne } = Jt(), w = (t) => t ? de(t, E.NUMERIC_DATE_YEAR_FIRST, {
|
|
375
|
+
locale: D[d.value.substring(0, 2)] || D.enUS
|
|
376
|
+
}) : "", J = (t) => t ? de(t, E.HOUR_MINUTE_SECONDS, {
|
|
377
|
+
locale: D[d.value.substring(0, 2)] || D.enUS
|
|
378
|
+
}) : "", re = A(!1), ue = A(!1), X = A(!1), Z = A(!1), r = Te({
|
|
379
|
+
startDate: e.dateFormData.startDate,
|
|
380
|
+
endDate: e.dateFormData.endDate,
|
|
381
|
+
startTime: e.dateFormData.startTime,
|
|
382
|
+
endTime: e.dateFormData.endTime
|
|
383
|
+
}), Ie = (t, o) => {
|
|
384
|
+
let i = new Date(t);
|
|
385
|
+
const [u, R, O] = o.split(":");
|
|
386
|
+
return i = Kt(i, parseInt(u, 10)), i = Gt(i, parseInt(R, 10)), i = Ht(i, parseInt(O, 10)), i;
|
|
387
|
+
}, Re = (t) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(t), m = (t, o) => {
|
|
388
|
+
const i = () => {
|
|
389
|
+
if (o && k(o)) {
|
|
390
|
+
const u = Ie(new Date(o), t);
|
|
391
|
+
if (e.min && u < He(e.min, 0) || e.max && u > He(e.max, 0))
|
|
392
|
+
return !1;
|
|
393
|
+
}
|
|
394
|
+
return !0;
|
|
395
|
+
};
|
|
396
|
+
return Re(t) && i();
|
|
397
|
+
}, b = (t, o) => !o || !Re(o) || e.variant === "month" ? t : Ie(new Date(t), o), oe = (t) => {
|
|
398
|
+
r.startTime = J(
|
|
399
|
+
e.min && e.allowTimeInput && B(e.min, t.startDate) ? e.min : F(t.startDate)
|
|
400
|
+
), r.endTime = J(
|
|
401
|
+
e.max && e.allowTimeInput && B(e.max, t.endDate) ? e.max : P(t.endDate)
|
|
402
|
+
), n.startDate = b(t.startDate, r.startTime), n.endDate = b(t.endDate, r.endTime), n.range = null, e.granularities && ne(), a(y.INPUT, {
|
|
403
|
+
...n,
|
|
404
|
+
range: h.value
|
|
405
|
+
});
|
|
406
|
+
}, k = (t) => {
|
|
407
|
+
const o = (u) => e.min && F(u) < F(e.min) || e.max && F(u) > F(e.max) ? !1 : e.isDateDisabled ? !e.isDateDisabled(F(u)) : !0;
|
|
408
|
+
return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(t) && o(new Date(t));
|
|
409
|
+
};
|
|
410
|
+
et(() => {
|
|
411
|
+
re.value = !!(e.dateFormData.startDate && !k(e.dateFormData.startDate)), e.allowTimeInput ? X.value = !!(e.dateFormData.startTime && !m(e.dateFormData.startTime, e.dateFormData.startDate)) : X.value = !1, ue.value = !!(e.dateFormData.endDate && !k(e.dateFormData.endDate)), e.allowTimeInput ? Z.value = !!(e.dateFormData.endTime && !m(e.dateFormData.endTime, e.dateFormData.endDate)) : Z.value = !1;
|
|
412
|
+
});
|
|
413
|
+
const Se = (t) => {
|
|
414
|
+
var o;
|
|
415
|
+
r.startDate = w(t), r.startTime ? X.value && (r.startTime = (o = e.dateFormData) == null ? void 0 : o.startTime) : r.startTime = J(t), re.value = !1, X.value = !1, a(y.START_DATE_SELECTED, t);
|
|
416
|
+
}, ot = (t) => {
|
|
417
|
+
var o;
|
|
418
|
+
r.endDate = w(t), r.endTime ? Z.value && (r.endTime = (o = e.dateFormData) == null ? void 0 : o.endTime) : r.endTime = J(P(t)), ue.value = !1, Z.value = !1;
|
|
419
|
+
}, ke = (t) => {
|
|
420
|
+
const o = e.value[t];
|
|
421
|
+
if (o)
|
|
422
|
+
return o;
|
|
423
|
+
if (e.dateFormData[t] && k(e.dateFormData[t]))
|
|
424
|
+
return new Date(e.dateFormData[t]);
|
|
425
|
+
}, st = ge((t) => {
|
|
426
|
+
var o;
|
|
427
|
+
if (k(t)) {
|
|
428
|
+
let i = t;
|
|
429
|
+
switch (re.value = !1, (o = U.value) == null ? void 0 : o.type) {
|
|
430
|
+
case "weekly":
|
|
431
|
+
i = g(
|
|
432
|
+
t,
|
|
433
|
+
w,
|
|
434
|
+
v.value.min,
|
|
435
|
+
v.value.max
|
|
436
|
+
), r.startDate = i;
|
|
437
|
+
break;
|
|
438
|
+
case "monthly":
|
|
439
|
+
i = L(
|
|
440
|
+
t,
|
|
441
|
+
w,
|
|
442
|
+
v.value.min,
|
|
443
|
+
v.value.max
|
|
444
|
+
), r.startDate = i;
|
|
445
|
+
break;
|
|
446
|
+
case "quarterly":
|
|
447
|
+
i = be(
|
|
448
|
+
t,
|
|
449
|
+
w,
|
|
450
|
+
v.value.min,
|
|
451
|
+
v.value.max
|
|
452
|
+
), r.startDate = i;
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
const u = le(i);
|
|
456
|
+
n.startDate = b(u, r.startTime), n.endDate = b(
|
|
457
|
+
le(r.endDate),
|
|
458
|
+
r.endTime
|
|
459
|
+
), k(r.endDate) && (n.endDate = b(
|
|
460
|
+
le(r.endDate),
|
|
461
|
+
r.endTime
|
|
462
|
+
));
|
|
463
|
+
const R = ke("endDate");
|
|
464
|
+
n.range = null, a(y.FORM_DATE, {
|
|
465
|
+
startDate: u,
|
|
466
|
+
endDate: R
|
|
467
|
+
}), a(y.INPUT, {
|
|
468
|
+
...n,
|
|
469
|
+
range: h.value
|
|
470
|
+
});
|
|
471
|
+
} else
|
|
472
|
+
re.value = !0, a(y.ERROR, { ...r });
|
|
473
|
+
}, Je), lt = (t) => {
|
|
474
|
+
r.startDate = Ve(t), st(r.startDate);
|
|
475
|
+
}, it = ge((t) => {
|
|
476
|
+
var o;
|
|
477
|
+
if (k(t)) {
|
|
478
|
+
let i = t;
|
|
479
|
+
switch (ue.value = !1, (o = U.value) == null ? void 0 : o.type) {
|
|
480
|
+
case "weekly":
|
|
481
|
+
i = $(
|
|
482
|
+
t,
|
|
483
|
+
w,
|
|
484
|
+
v.value.min,
|
|
485
|
+
v.value.max
|
|
486
|
+
), r.endDate = i;
|
|
487
|
+
break;
|
|
488
|
+
case "monthly":
|
|
489
|
+
i = ae(
|
|
490
|
+
t,
|
|
491
|
+
w,
|
|
492
|
+
v.value.min,
|
|
493
|
+
v.value.max
|
|
494
|
+
), r.endDate = i;
|
|
495
|
+
break;
|
|
496
|
+
case "quarterly":
|
|
497
|
+
i = fe(
|
|
498
|
+
t,
|
|
499
|
+
w,
|
|
500
|
+
v.value.min,
|
|
501
|
+
v.value.max
|
|
502
|
+
), r.endDate = i;
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
const u = le(i);
|
|
506
|
+
n.endDate = b(u, r.endTime), k(r.startDate) && (n.startDate = b(
|
|
507
|
+
le(r.startDate),
|
|
508
|
+
r.startTime
|
|
509
|
+
));
|
|
510
|
+
const R = ke("startDate");
|
|
511
|
+
n.range = null, a(y.FORM_DATE, {
|
|
512
|
+
startDate: R,
|
|
513
|
+
endDate: u
|
|
514
|
+
}), a(y.INPUT, {
|
|
515
|
+
...n,
|
|
516
|
+
range: h.value
|
|
517
|
+
});
|
|
518
|
+
} else
|
|
519
|
+
ue.value = !0, a(y.ERROR, { ...r });
|
|
520
|
+
}, Je), ut = (t) => {
|
|
521
|
+
r.endDate = Ve(t), it(r.endDate);
|
|
522
|
+
}, dt = (t) => {
|
|
523
|
+
Ft(t);
|
|
524
|
+
}, mt = ge((t) => {
|
|
525
|
+
if (m(t, e.dateFormData.startDate)) {
|
|
526
|
+
X.value = !1, n.startDate = b(n.startDate, t);
|
|
527
|
+
const o = ke("endDate");
|
|
528
|
+
a(y.FORM_DATE, {
|
|
529
|
+
startDate: n.startDate,
|
|
530
|
+
endDate: o,
|
|
531
|
+
startTime: t,
|
|
532
|
+
endTime: r.endTime ?? e.dateFormData.endTime
|
|
533
|
+
}), a(y.INPUT, {
|
|
534
|
+
...n,
|
|
535
|
+
range: h.value
|
|
536
|
+
});
|
|
537
|
+
} else
|
|
538
|
+
X.value = !0, a(y.ERROR, { ...r });
|
|
539
|
+
}), Dt = ge((t) => {
|
|
540
|
+
m(t, e.dateFormData.endDate) ? (Z.value = !1, n.endDate = b(n.endDate, t), a(y.FORM_DATE, {
|
|
541
|
+
startDate: n.startDate,
|
|
542
|
+
endDate: n.endDate,
|
|
543
|
+
startTime: r.startTime ?? e.dateFormData.startTime,
|
|
544
|
+
endTime: t
|
|
545
|
+
}), a(y.INPUT, {
|
|
546
|
+
...n,
|
|
547
|
+
range: h.value
|
|
548
|
+
})) : (Z.value = !0, a(y.ERROR, { ...r }));
|
|
549
|
+
}), ct = (t) => {
|
|
550
|
+
r.startTime = We(t), mt(r.startTime);
|
|
551
|
+
}, ft = (t) => {
|
|
552
|
+
r.endTime = We(t), Dt(r.endTime);
|
|
553
|
+
}, vt = (t) => {
|
|
554
|
+
ea(t);
|
|
555
|
+
}, ve = (t, o, i, u) => {
|
|
556
|
+
n.startDate = t, n.endDate = o, i && (n.granularity = i), u && (n.range = u);
|
|
557
|
+
}, gt = (t) => {
|
|
558
|
+
var i;
|
|
559
|
+
const o = (i = e.quickSelectRanges) == null ? void 0 : i.find(({ value: u }) => u === t);
|
|
560
|
+
if (o) {
|
|
561
|
+
ne();
|
|
562
|
+
const u = o.data, R = u.endDate || (u.isRelativeToNow ? new Date(Date.now()) : P(new Date(Date.now()))), O = u.isRelativeToNow && u.timeDifference ? new Date(R.getTime() - u.timeDifference) : u.startDate;
|
|
563
|
+
r.endDate = w(R), r.startDate = w(O), ve(O, R, null, t), e.granularities && (n.granularity = u.granularity || p.value), r.startTime = J(O), r.endTime = J(R), n.startDate = O, n.endDate = R, u.isRelativeToNow && (c.value = {
|
|
564
|
+
...c.value,
|
|
565
|
+
[t]: {
|
|
566
|
+
startDate: O,
|
|
567
|
+
endDate: R
|
|
568
|
+
}
|
|
569
|
+
}), a(y.CUSTOM_RANGE, {
|
|
570
|
+
...o.data,
|
|
571
|
+
startDate: O,
|
|
572
|
+
endDate: R,
|
|
573
|
+
range: o.value
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
}, pt = {
|
|
577
|
+
weekly: q,
|
|
578
|
+
monthly: ie,
|
|
579
|
+
quarterly: te
|
|
580
|
+
}, yt = (t) => {
|
|
581
|
+
const o = n.granularity;
|
|
582
|
+
if (n.granularity = t, o && z(o, structuredClone(he(n))), n.startDate && n.endDate) {
|
|
583
|
+
switch (t) {
|
|
584
|
+
case "quarterly":
|
|
585
|
+
case "monthly":
|
|
586
|
+
case "weekly": {
|
|
587
|
+
if (Y[t]) {
|
|
588
|
+
ve(Y[t].startDate, Y[t].endDate, t);
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
const { startDate: i, endDate: u } = pt[t](
|
|
592
|
+
n.startDate,
|
|
593
|
+
n.endDate,
|
|
594
|
+
v.value.min,
|
|
595
|
+
v.value.max
|
|
596
|
+
);
|
|
597
|
+
ve(i, u, t);
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
case "daily":
|
|
601
|
+
Y.daily && ve(Y.daily.startDate, Y.daily.endDate, t);
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
r.startDate = w(n.startDate), r.endDate = w(n.endDate), a(y.INPUT, {
|
|
605
|
+
...n,
|
|
606
|
+
range: h.value
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
return {
|
|
611
|
+
// Values
|
|
612
|
+
internalRangeDate: n,
|
|
613
|
+
dateTextInput: r,
|
|
614
|
+
endDateError: ue,
|
|
615
|
+
endTimeError: Z,
|
|
616
|
+
granularityItems: S,
|
|
617
|
+
selectedGranularity: U,
|
|
618
|
+
computedMinMax: v,
|
|
619
|
+
selectedRangeSelectorValue: h,
|
|
620
|
+
startDateError: re,
|
|
621
|
+
startTimeError: X,
|
|
622
|
+
quickSelectRangeDefaultItems: T,
|
|
623
|
+
formInputWrapperConditionalClasses: ee,
|
|
624
|
+
// Methods
|
|
625
|
+
hasSlot: qt(s),
|
|
626
|
+
t: l,
|
|
627
|
+
// Events
|
|
628
|
+
onDateInput: oe,
|
|
629
|
+
onDateInputKeyDown: dt,
|
|
630
|
+
onEndDateInput: ut,
|
|
631
|
+
onEndDateSelected: ot,
|
|
632
|
+
onEndTimeInput: ft,
|
|
633
|
+
onGranularityInput: yt,
|
|
634
|
+
onRangeSelectorInput: gt,
|
|
635
|
+
onStartDateInput: lt,
|
|
636
|
+
onStartDateSelected: Se,
|
|
637
|
+
onStartTimeInput: ct,
|
|
638
|
+
onTimeInputKeyDown: vt
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
}), aa = { class: "b-date-range-picker-calendar" }, na = { class: "b-date-range-picker-calendar__form-container" }, ra = { class: "b-date-range-picker-calendar__form" }, oa = { key: 0 }, sa = { class: "b-date-range-picker-calendar__calendars-container" };
|
|
642
|
+
function la(e, a, s, d, l, D) {
|
|
643
|
+
const c = M("bento-dropdown"), p = M("bento-segmented-control"), n = M("bento-typography"), f = M("bento-input-field"), h = M("calendar");
|
|
644
|
+
return _(), we("div", aa, [
|
|
645
|
+
Q("div", na, [
|
|
646
|
+
Q("div", ra, [
|
|
647
|
+
e.hasSlot("title") ? Ne(e.$slots, "title", { key: 0 }, void 0, !0) : N("", !0),
|
|
648
|
+
e.quickSelectRanges ? (_(), K(c, {
|
|
649
|
+
key: 1,
|
|
650
|
+
"aria-label": e.t("customRange"),
|
|
651
|
+
items: e.quickSelectRangeDefaultItems,
|
|
652
|
+
value: e.selectedRangeSelectorValue,
|
|
653
|
+
onInput: e.onRangeSelectorInput
|
|
654
|
+
}, null, 8, ["aria-label", "items", "value", "onInput"])) : N("", !0),
|
|
655
|
+
e.granularities ? (_(), K(p, {
|
|
656
|
+
key: 2,
|
|
657
|
+
items: e.granularityItems,
|
|
658
|
+
"model-value": e.internalRangeDate.granularity,
|
|
659
|
+
"full-width": "",
|
|
660
|
+
"onUpdate:modelValue": e.onGranularityInput
|
|
661
|
+
}, null, 8, ["items", "model-value", "onUpdate:modelValue"])) : N("", !0),
|
|
662
|
+
Q("div", null, [
|
|
663
|
+
G(n, {
|
|
664
|
+
stronger: "",
|
|
665
|
+
el: "span",
|
|
666
|
+
class: "b-date-range-picker-calendar__label"
|
|
667
|
+
}, {
|
|
668
|
+
default: j(() => a[0] || (a[0] = [
|
|
669
|
+
se(" From ")
|
|
670
|
+
])),
|
|
671
|
+
_: 1
|
|
672
|
+
}),
|
|
673
|
+
Q("div", {
|
|
674
|
+
class: Oe(e.formInputWrapperConditionalClasses)
|
|
675
|
+
}, [
|
|
676
|
+
G(f, {
|
|
677
|
+
"aria-label": e.t("dateFrom"),
|
|
678
|
+
value: e.dateTextInput.startDate,
|
|
679
|
+
error: e.startDateError,
|
|
680
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
681
|
+
onInput: e.onStartDateInput,
|
|
682
|
+
onKeydown: e.onDateInputKeyDown
|
|
683
|
+
}, {
|
|
684
|
+
description: j(() => a[1] || (a[1] = [
|
|
685
|
+
se("YYYY-MM-DD")
|
|
686
|
+
])),
|
|
687
|
+
_: 1
|
|
688
|
+
}, 8, ["aria-label", "value", "error", "onInput", "onKeydown"]),
|
|
689
|
+
e.allowTimeInput ? (_(), K(f, {
|
|
690
|
+
key: 0,
|
|
691
|
+
"aria-label": e.t("timeFrom"),
|
|
692
|
+
value: e.dateTextInput.startTime,
|
|
693
|
+
error: e.startTimeError,
|
|
694
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
695
|
+
onInput: e.onStartTimeInput,
|
|
696
|
+
onKeydown: e.onTimeInputKeyDown
|
|
697
|
+
}, {
|
|
698
|
+
description: j(() => a[2] || (a[2] = [
|
|
699
|
+
se("HH:MM:SS")
|
|
700
|
+
])),
|
|
701
|
+
_: 1
|
|
702
|
+
}, 8, ["aria-label", "value", "error", "onInput", "onKeydown"])) : N("", !0)
|
|
703
|
+
], 2)
|
|
704
|
+
]),
|
|
705
|
+
Q("div", null, [
|
|
706
|
+
G(n, {
|
|
707
|
+
stronger: "",
|
|
708
|
+
el: "span",
|
|
709
|
+
class: "b-date-range-picker-calendar__label"
|
|
710
|
+
}, {
|
|
711
|
+
default: j(() => a[3] || (a[3] = [
|
|
712
|
+
se(" To ")
|
|
713
|
+
])),
|
|
714
|
+
_: 1
|
|
715
|
+
}),
|
|
716
|
+
Q("div", {
|
|
717
|
+
class: Oe(e.formInputWrapperConditionalClasses)
|
|
718
|
+
}, [
|
|
719
|
+
G(f, {
|
|
720
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
721
|
+
"aria-label": e.t("dateTo"),
|
|
722
|
+
value: e.dateTextInput.endDate,
|
|
723
|
+
error: e.endDateError,
|
|
724
|
+
onInput: e.onEndDateInput,
|
|
725
|
+
onKeydown: e.onDateInputKeyDown
|
|
726
|
+
}, {
|
|
727
|
+
description: j(() => a[4] || (a[4] = [
|
|
728
|
+
se("YYYY-MM-DD")
|
|
729
|
+
])),
|
|
730
|
+
_: 1
|
|
731
|
+
}, 8, ["aria-label", "value", "error", "onInput", "onKeydown"]),
|
|
732
|
+
e.allowTimeInput ? (_(), K(f, {
|
|
733
|
+
key: 0,
|
|
734
|
+
"aria-label": e.t("timeTo"),
|
|
735
|
+
value: e.dateTextInput.endTime,
|
|
736
|
+
error: e.endTimeError,
|
|
737
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
738
|
+
onInput: e.onEndTimeInput,
|
|
739
|
+
onKeydown: e.onTimeInputKeyDown
|
|
740
|
+
}, {
|
|
741
|
+
description: j(() => a[5] || (a[5] = [
|
|
742
|
+
se("HH:MM:SS")
|
|
743
|
+
])),
|
|
744
|
+
_: 1
|
|
745
|
+
}, 8, ["aria-label", "value", "error", "onInput", "onKeydown"])) : N("", !0)
|
|
746
|
+
], 2)
|
|
747
|
+
])
|
|
748
|
+
]),
|
|
749
|
+
e.hasSlot("actions") ? (_(), we("div", oa, [
|
|
750
|
+
Ne(e.$slots, "actions", {}, void 0, !0)
|
|
751
|
+
])) : N("", !0)
|
|
752
|
+
]),
|
|
753
|
+
Q("div", sa, [
|
|
754
|
+
G(h, {
|
|
755
|
+
value: e.internalRangeDate,
|
|
756
|
+
"first-day-of-week": e.firstDayOfWeek,
|
|
757
|
+
"is-date-disabled": e.isDateDisabled,
|
|
758
|
+
"max-range": e.maxRange,
|
|
759
|
+
min: e.computedMinMax.min,
|
|
760
|
+
max: e.computedMinMax.max,
|
|
761
|
+
"number-of-months": e.numberOfMonths,
|
|
762
|
+
"show-end-date-on-open": e.showEndDateOnOpen,
|
|
763
|
+
granularity: e.selectedGranularity,
|
|
764
|
+
variant: e.variant,
|
|
765
|
+
"is-range": "",
|
|
766
|
+
onInput: e.onDateInput,
|
|
767
|
+
onStartDateSelected: e.onStartDateSelected,
|
|
768
|
+
onEndDateSelected: e.onEndDateSelected
|
|
769
|
+
}, null, 8, ["value", "first-day-of-week", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "granularity", "variant", "onInput", "onStartDateSelected", "onEndDateSelected"])
|
|
770
|
+
])
|
|
771
|
+
]);
|
|
772
|
+
}
|
|
773
|
+
const V = /* @__PURE__ */ nt(ta, [["render", la], ["__scopeId", "data-v-4b996e1b"]]), ia = ({
|
|
774
|
+
datePickerValue: e,
|
|
775
|
+
isDateIncorrect: a,
|
|
776
|
+
quickSelectRanges: s,
|
|
777
|
+
isMonthVariant: d
|
|
778
|
+
}) => {
|
|
779
|
+
var T, U, S, W;
|
|
780
|
+
const { locale: l, t: D } = Ce(), c = Me(), p = (v) => !!v && !isNaN(v.getTime()), n = (v, te) => p(v) ? de(v, te, {
|
|
781
|
+
locale: c[l.value.substring(0, 2)] || c.enUS
|
|
782
|
+
}) : void 0, f = Te({
|
|
783
|
+
startDate: n((T = e.value) == null ? void 0 : T.startDate, E.NUMERIC_DATE_YEAR_FIRST),
|
|
784
|
+
endDate: n((U = e.value) == null ? void 0 : U.endDate, E.NUMERIC_DATE_YEAR_FIRST),
|
|
785
|
+
startTime: n((S = e.value) == null ? void 0 : S.startDate, E.HOUR_MINUTE_SECONDS),
|
|
786
|
+
endTime: n((W = e.value) == null ? void 0 : W.endDate, E.HOUR_MINUTE_SECONDS)
|
|
787
|
+
});
|
|
788
|
+
return {
|
|
789
|
+
// Values
|
|
790
|
+
dateDisplayValue: I(() => {
|
|
791
|
+
var q;
|
|
792
|
+
if (a.value)
|
|
793
|
+
return `${f.startDate || ""} - ${f.endDate || ""}`;
|
|
794
|
+
if (!e.value || !e.value.startDate && !e.value.endDate)
|
|
795
|
+
return D("selectDateRange");
|
|
796
|
+
if ((q = s.value) != null && q.length) {
|
|
797
|
+
const g = s.value.find(({ value: $ }) => {
|
|
798
|
+
var L;
|
|
799
|
+
return $ === ((L = e.value) == null ? void 0 : L.range);
|
|
800
|
+
});
|
|
801
|
+
if (g)
|
|
802
|
+
return g.label;
|
|
803
|
+
}
|
|
804
|
+
if (e.value.granularity === "quarterly") {
|
|
805
|
+
const { startDate: g, endDate: $ } = e.value, L = D("quarter", { quarter: Qe(g), year: je(g) });
|
|
806
|
+
if (Qt(g, $))
|
|
807
|
+
return L;
|
|
808
|
+
const ae = D("quarter", { quarter: Qe($), year: je($) });
|
|
809
|
+
return `${L} - ${ae}`;
|
|
810
|
+
}
|
|
811
|
+
const { startDate: v, endDate: te } = f, ie = d != null && d.value ? E.LONG_MONTH_YEAR : E.FULL_DATE_MONTH_FIRST;
|
|
812
|
+
return `${n(le(v), ie)} - ${n(
|
|
813
|
+
le(te),
|
|
814
|
+
ie
|
|
815
|
+
)}`;
|
|
816
|
+
}),
|
|
817
|
+
textInputDisplayValue: f,
|
|
818
|
+
// Methods
|
|
819
|
+
formatTextInputDisplayValue: () => ""
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
var ye = /* @__PURE__ */ ((e) => (e.INPUT = "input", e))(ye || {});
|
|
823
|
+
const Ze = {
|
|
824
|
+
"en-US": {
|
|
825
|
+
apply: "Apply",
|
|
826
|
+
cancel: "Cancel",
|
|
827
|
+
dateRangePicker: "Date range picker {name}",
|
|
828
|
+
provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
|
|
829
|
+
quarter: "Q{quarter} {year}",
|
|
830
|
+
selectDate: "Select a date",
|
|
831
|
+
selectDateRange: "Select a date range",
|
|
832
|
+
selectedDateIsNotAvailable: "Selected date is not available"
|
|
833
|
+
},
|
|
834
|
+
"ja-JP": {
|
|
835
|
+
apply: "適用",
|
|
836
|
+
cancel: "キャンセル",
|
|
837
|
+
selectDate: "日付を選択"
|
|
838
|
+
},
|
|
839
|
+
"pt-BR": {
|
|
840
|
+
apply: "Aplicar",
|
|
841
|
+
cancel: "Cancelar",
|
|
842
|
+
selectDate: "Selecione uma data"
|
|
843
|
+
}
|
|
844
|
+
}, ua = xe({
|
|
845
|
+
i18n: { messages: Ze },
|
|
846
|
+
name: "bento-date-range-picker",
|
|
847
|
+
components: {
|
|
848
|
+
BentoButtonActions: Yt,
|
|
849
|
+
BentoDivider: kt,
|
|
850
|
+
BentoTypography: tt,
|
|
851
|
+
BentoPopover: Et,
|
|
852
|
+
DateRangePickerCalendar: V,
|
|
853
|
+
DropdownInputDefault: wt,
|
|
854
|
+
ErrorMessage: Lt,
|
|
855
|
+
FieldLabel: $t
|
|
856
|
+
},
|
|
857
|
+
directives: { BentoClickOutsideDirective: Ut },
|
|
858
|
+
props: {
|
|
859
|
+
/**
|
|
860
|
+
* Allows user to enter time values in the form
|
|
861
|
+
*/
|
|
862
|
+
allowTimeInput: { type: Boolean, default: !1 },
|
|
863
|
+
/**
|
|
864
|
+
* Descriptive supporting text visbile underneath the dropdown.
|
|
865
|
+
*/
|
|
866
|
+
description: { type: String, default: void 0 },
|
|
867
|
+
/**
|
|
868
|
+
* Disables dropdown functionality.
|
|
869
|
+
*/
|
|
870
|
+
disabled: { type: Boolean, default: !1 },
|
|
871
|
+
/**
|
|
872
|
+
* Displays component in an error state with an error message
|
|
873
|
+
*/
|
|
874
|
+
errorMessage: { type: String, default: null },
|
|
875
|
+
/**
|
|
876
|
+
* Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
877
|
+
*/
|
|
878
|
+
firstDayOfWeek: V.props.firstDayOfWeek,
|
|
879
|
+
/**
|
|
880
|
+
* A list of available granularities.
|
|
881
|
+
* If present, the date picker will display a segmented control to change granularity.
|
|
882
|
+
*/
|
|
883
|
+
granularities: V.props.granularities,
|
|
884
|
+
/**
|
|
885
|
+
* Indicate if a date should be disabled or not
|
|
886
|
+
*/
|
|
887
|
+
isDateDisabled: V.props.isDateDisabled,
|
|
888
|
+
/**
|
|
889
|
+
* Text that is displayed as a label above the element.
|
|
890
|
+
*/
|
|
891
|
+
label: { type: String, default: void 0 },
|
|
892
|
+
/**
|
|
893
|
+
* Upon opening date range picker, end date's month will be pre-selected.
|
|
894
|
+
*/
|
|
895
|
+
showEndDateOnOpen: { type: Boolean, default: !1 },
|
|
896
|
+
/**
|
|
897
|
+
* Highlights the dropdown is optional.
|
|
898
|
+
*/
|
|
899
|
+
optional: { type: Boolean, default: !1 },
|
|
900
|
+
/**
|
|
901
|
+
* The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date range picker.
|
|
902
|
+
*/
|
|
903
|
+
readonly: { type: Boolean, default: !1 },
|
|
904
|
+
/**
|
|
905
|
+
* Highlights the dropdown is required.
|
|
906
|
+
*/
|
|
907
|
+
required: { type: Boolean, default: !1 },
|
|
908
|
+
/**
|
|
909
|
+
* Adds a info icon next to the label to display the passed tooltip message.
|
|
910
|
+
*/
|
|
911
|
+
tooltipText: { type: String, default: null },
|
|
912
|
+
/**
|
|
913
|
+
* Enables the range selector.
|
|
914
|
+
* If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
|
|
915
|
+
* `label` - label of custom range item.
|
|
916
|
+
* `value` - a unique key of the custom range item.
|
|
917
|
+
* `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
|
|
918
|
+
*/
|
|
919
|
+
quickSelectRanges: {
|
|
920
|
+
type: Array,
|
|
921
|
+
default: void 0
|
|
922
|
+
},
|
|
923
|
+
/**
|
|
924
|
+
* Set a maximum number of dates to be selectable by the range.
|
|
925
|
+
*/
|
|
926
|
+
maxRange: V.props.maxRange,
|
|
927
|
+
/**
|
|
928
|
+
* Sets a minimum limit for selectable dates - dates before `min` will not be selectable
|
|
929
|
+
*/
|
|
930
|
+
min: V.props.min,
|
|
931
|
+
/**
|
|
932
|
+
* Sets a maximum limit for selectable dates - dates after `max` will not be selectable
|
|
933
|
+
*/
|
|
934
|
+
max: V.props.max,
|
|
935
|
+
/**
|
|
936
|
+
* Number of months rendered on pane
|
|
937
|
+
*/
|
|
938
|
+
numberOfMonths: V.props.numberOfMonths,
|
|
939
|
+
/**
|
|
940
|
+
* Selected date
|
|
941
|
+
*/
|
|
942
|
+
value: V.props.value,
|
|
943
|
+
/**
|
|
944
|
+
* The type of calendar to display. Defaults to showing days.
|
|
945
|
+
*/
|
|
946
|
+
variant: {
|
|
947
|
+
type: String,
|
|
948
|
+
default: void 0
|
|
949
|
+
// Default will be set by @/internal/calendar
|
|
950
|
+
},
|
|
951
|
+
/**
|
|
952
|
+
* Enables the date picker selection to persist until it is explicitly applied.
|
|
953
|
+
* Displays a set of buttons: Apply and Cancel.
|
|
954
|
+
*
|
|
955
|
+
* @deprecated This will be the default behaviour in v2.0.0.
|
|
956
|
+
*/
|
|
957
|
+
hasActions: { type: Boolean, default: !1 }
|
|
958
|
+
},
|
|
959
|
+
emits: [ye.INPUT],
|
|
960
|
+
setup(e, { emit: a }) {
|
|
961
|
+
const { locale: s, t: d } = Ce({ messages: Ze }), l = Me(), D = De("bento-date-range-picker-container"), c = De("bento-date-range-picker-label"), p = De("bento-date-range-picker-description"), n = De("bento-date-range-picker-error"), f = De("bento-date-range-picker-date-error"), h = I(
|
|
962
|
+
() => e.label || d("dateRangePicker", { name: D })
|
|
963
|
+
), ee = I(() => (e == null ? void 0 : e.quickSelectRanges) && e.quickSelectRanges.map((m) => {
|
|
964
|
+
const b = m.data.endDate ? void 0 : new Date(Date.now()).getTime() - m.data.startDate.getTime();
|
|
965
|
+
return {
|
|
966
|
+
...m,
|
|
967
|
+
data: {
|
|
968
|
+
...m.data,
|
|
969
|
+
// Adding timeDifference to calculate an up-to-date endDate on range selection
|
|
970
|
+
timeDifference: b
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
})), T = A(!1), U = A(null), S = A(!1), { isReadOnly: W } = _t(Be(e, "readonly"));
|
|
974
|
+
Ee(
|
|
975
|
+
() => e.disabled,
|
|
976
|
+
() => {
|
|
977
|
+
e.disabled && S.value && (S.value = !1);
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
const v = I(() => e.hasActions ? !ne.value && T.value : T.value), te = I(() => ({
|
|
981
|
+
"b-date-range-picker__description--error": !!e.errorMessage || v.value
|
|
982
|
+
})), ie = I(() => e.variant === "month"), { dateDisplayValue: q, textInputDisplayValue: g } = ia({
|
|
983
|
+
datePickerValue: Be(e, "value"),
|
|
984
|
+
isDateIncorrect: T,
|
|
985
|
+
quickSelectRanges: ee,
|
|
986
|
+
isMonthVariant: ie
|
|
987
|
+
}), $ = I(
|
|
988
|
+
() => `${e.description ? p : ""} ${e.errorMessage ? n : ""} ${T.value ? f : ""}`.trim() || null
|
|
989
|
+
), L = I(() => e.allowTimeInput && e.variant !== "month"), ae = () => {
|
|
990
|
+
S.value = !1;
|
|
991
|
+
}, be = () => {
|
|
992
|
+
S.value = !0;
|
|
993
|
+
}, fe = A(q.value), Y = A(
|
|
994
|
+
// textInputDisplayValue is a reactive object
|
|
995
|
+
structuredClone(he(g))
|
|
996
|
+
), z = A(e.value), ne = A(!0), w = I(
|
|
997
|
+
() => e.hasActions ? Y.value : g
|
|
998
|
+
), J = I(
|
|
999
|
+
() => e.hasActions ? fe.value : q.value
|
|
1000
|
+
);
|
|
1001
|
+
et(() => {
|
|
1002
|
+
if (e.hasActions || ht(
|
|
1003
|
+
'BentoDateRangePicker "hasActions" property',
|
|
1004
|
+
`Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
|
|
1005
|
+
This will be the default behavior in the v2 and "hasActions" will be removed.`,
|
|
1006
|
+
"2.0.0"
|
|
1007
|
+
), e.granularities && e.variant !== "month" && e.granularities.find(({ type: m }) => m === "quarterly"))
|
|
1008
|
+
throw new Error(
|
|
1009
|
+
'Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"'
|
|
1010
|
+
);
|
|
1011
|
+
}), Ee(
|
|
1012
|
+
() => e.value,
|
|
1013
|
+
() => {
|
|
1014
|
+
fe.value = q.value, Y.value = structuredClone(he(g));
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
const re = I(() => [
|
|
1018
|
+
{
|
|
1019
|
+
title: d("apply"),
|
|
1020
|
+
event: () => {
|
|
1021
|
+
a(ye.INPUT, z.value), ae(), ne.value = !0;
|
|
1022
|
+
},
|
|
1023
|
+
disabled: ne.value
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
title: d("cancel"),
|
|
1027
|
+
event: ae
|
|
1028
|
+
}
|
|
1029
|
+
]);
|
|
1030
|
+
return Ee(z, (m) => {
|
|
1031
|
+
if (e.hasActions) {
|
|
1032
|
+
ne.value = T.value;
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
a(ye.INPUT, m);
|
|
1036
|
+
}), {
|
|
1037
|
+
// Refs
|
|
1038
|
+
inputContainerRef: U,
|
|
1039
|
+
// Values,
|
|
1040
|
+
adjustedQuickSelectRanges: ee,
|
|
1041
|
+
dateDisplayValue: q,
|
|
1042
|
+
datePickerContainerId: D,
|
|
1043
|
+
descriptionConditionalClasses: te,
|
|
1044
|
+
displayedTextInputValue: w,
|
|
1045
|
+
displayedDateValue: J,
|
|
1046
|
+
isDateIncorrect: T,
|
|
1047
|
+
isDateRangePickerOpen: S,
|
|
1048
|
+
isReadOnly: W,
|
|
1049
|
+
labelId: c,
|
|
1050
|
+
descriptionId: p,
|
|
1051
|
+
dateErrorId: f,
|
|
1052
|
+
errorId: n,
|
|
1053
|
+
popoverAriaLabel: h,
|
|
1054
|
+
shouldDisplayError: v,
|
|
1055
|
+
ariaDescribedBy: $,
|
|
1056
|
+
textInputDisplayValue: g,
|
|
1057
|
+
rangePickerButtonActions: re,
|
|
1058
|
+
BentoButtonActionsLayout: Vt,
|
|
1059
|
+
withTimeInput: L,
|
|
1060
|
+
// Events
|
|
1061
|
+
closeDateRangePicker: ae,
|
|
1062
|
+
clearDateRangePickerValue: async () => {
|
|
1063
|
+
T.value && (T.value = !1), z.value = null;
|
|
1064
|
+
},
|
|
1065
|
+
openDateRangePicker: be,
|
|
1066
|
+
onRangeSelectorInput: (m) => {
|
|
1067
|
+
if (m) {
|
|
1068
|
+
const b = (k, Se) => k ? de(k, Se, {
|
|
1069
|
+
locale: l[s.value.substring(0, 2)] || l.enUS
|
|
1070
|
+
}) : void 0, oe = (k) => de(k, E.NUMERIC_DATE_YEAR_FIRST, {
|
|
1071
|
+
locale: l[s.value.substring(0, 2)] || l.enUS
|
|
1072
|
+
});
|
|
1073
|
+
g.startDate = oe(m.startDate), g.endDate = oe(m.endDate), g.startTime = b(
|
|
1074
|
+
m.startDate,
|
|
1075
|
+
E.HOUR_MINUTE_SECONDS
|
|
1076
|
+
), g.endTime = b(
|
|
1077
|
+
m.endDate,
|
|
1078
|
+
E.HOUR_MINUTE_SECONDS
|
|
1079
|
+
), z.value = m;
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
onEnterPressedOverInput: () => {
|
|
1083
|
+
if (!S.value) {
|
|
1084
|
+
S.value = !0;
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
T.value || (S.value = !1);
|
|
1088
|
+
},
|
|
1089
|
+
onDateRangePickerInput: (m) => {
|
|
1090
|
+
T.value = !1;
|
|
1091
|
+
const b = (oe, k) => oe ? de(oe, k, {
|
|
1092
|
+
locale: l[s.value.substring(0, 2)] || l.enUS
|
|
1093
|
+
}) : void 0;
|
|
1094
|
+
g.startDate = b(
|
|
1095
|
+
m.startDate,
|
|
1096
|
+
E.NUMERIC_DATE_YEAR_FIRST
|
|
1097
|
+
), g.endDate = b(m.endDate, E.NUMERIC_DATE_YEAR_FIRST), g.startTime = b(m.startDate, E.HOUR_MINUTE_SECONDS), g.endTime = b(m.endDate, E.HOUR_MINUTE_SECONDS), z.value = m;
|
|
1098
|
+
},
|
|
1099
|
+
onDateRangePickerError: (m) => {
|
|
1100
|
+
T.value = !0, g.startDate = m.startDate, g.endDate = m.endDate, z.value = { startDate: null, endDate: null };
|
|
1101
|
+
},
|
|
1102
|
+
onDateRangePickerFormDateInputUpdate: (m) => {
|
|
1103
|
+
T.value = !1, m.startTime && (g.startTime = m.startTime), m.endTime && (g.endTime = m.endTime);
|
|
1104
|
+
},
|
|
1105
|
+
// Translations
|
|
1106
|
+
t: d
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
}), da = { class: "b-date-range-picker" }, ma = { class: "b-date-range-picker__footer" };
|
|
1110
|
+
function Da(e, a, s, d, l, D) {
|
|
1111
|
+
const c = M("field-label"), p = M("dropdown-input-default"), n = M("error-message"), f = M("bento-typography"), h = M("bento-divider"), ee = M("bento-button-actions"), T = M("date-range-picker-calendar"), U = M("bento-popover"), S = Tt("bento-click-outside-directive");
|
|
1112
|
+
return bt((_(), we("div", da, [
|
|
1113
|
+
e.label ? (_(), K(c, {
|
|
1114
|
+
key: 0,
|
|
1115
|
+
id: e.labelId,
|
|
1116
|
+
label: e.label,
|
|
1117
|
+
"tooltip-text": e.tooltipText,
|
|
1118
|
+
optional: e.optional,
|
|
1119
|
+
required: e.required
|
|
1120
|
+
}, null, 8, ["id", "label", "tooltip-text", "optional", "required"])) : N("", !0),
|
|
1121
|
+
Q("div", {
|
|
1122
|
+
onKeydown: a[0] || (a[0] = It((...W) => e.onEnterPressedOverInput && e.onEnterPressedOverInput(...W), ["enter"]))
|
|
1123
|
+
}, [
|
|
1124
|
+
G(p, {
|
|
1125
|
+
ref: "inputContainerRef",
|
|
1126
|
+
"always-combobox-is-input": "",
|
|
1127
|
+
ariaControls: e.datePickerContainerId,
|
|
1128
|
+
ariaExpanded: e.isDateRangePickerOpen,
|
|
1129
|
+
"aria-labelledby": e.label ? e.labelId : null,
|
|
1130
|
+
"aria-describedby": e.ariaDescribedBy,
|
|
1131
|
+
disabled: e.disabled,
|
|
1132
|
+
"is-invalid": !!e.errorMessage || e.shouldDisplayError,
|
|
1133
|
+
open: e.isDateRangePickerOpen,
|
|
1134
|
+
"display-value": e.displayedDateValue,
|
|
1135
|
+
readonly: e.isReadOnly,
|
|
1136
|
+
onOpen: e.openDateRangePicker,
|
|
1137
|
+
onClear: e.clearDateRangePickerValue,
|
|
1138
|
+
onClose: e.closeDateRangePicker
|
|
1139
|
+
}, null, 8, ["ariaControls", "ariaExpanded", "aria-labelledby", "aria-describedby", "disabled", "is-invalid", "open", "display-value", "readonly", "onOpen", "onClear", "onClose"])
|
|
1140
|
+
], 32),
|
|
1141
|
+
e.shouldDisplayError ? (_(), K(n, {
|
|
1142
|
+
key: 1,
|
|
1143
|
+
id: e.dateErrorId,
|
|
1144
|
+
"error-message": e.t("provideDateInAFormat"),
|
|
1145
|
+
class: "b-date-range-picker__error-message"
|
|
1146
|
+
}, null, 8, ["id", "error-message"])) : N("", !0),
|
|
1147
|
+
e.errorMessage ? (_(), K(n, {
|
|
1148
|
+
key: 2,
|
|
1149
|
+
id: e.errorId,
|
|
1150
|
+
"error-message": e.errorMessage,
|
|
1151
|
+
class: "b-date-range-picker__error-message"
|
|
1152
|
+
}, null, 8, ["id", "error-message"])) : N("", !0),
|
|
1153
|
+
e.description ? (_(), K(f, {
|
|
1154
|
+
key: 3,
|
|
1155
|
+
id: e.descriptionId,
|
|
1156
|
+
class: Oe(["b-date-range-picker__description", e.descriptionConditionalClasses]),
|
|
1157
|
+
el: "span"
|
|
1158
|
+
}, {
|
|
1159
|
+
default: j(() => [
|
|
1160
|
+
se(Rt(e.description), 1)
|
|
1161
|
+
]),
|
|
1162
|
+
_: 1
|
|
1163
|
+
}, 8, ["id", "class"])) : N("", !0),
|
|
1164
|
+
e.inputContainerRef ? (_(), K(U, {
|
|
1165
|
+
key: 4,
|
|
1166
|
+
id: e.datePickerContainerId,
|
|
1167
|
+
class: "b-date-range-picker__container",
|
|
1168
|
+
open: e.isDateRangePickerOpen,
|
|
1169
|
+
"target-element": e.inputContainerRef,
|
|
1170
|
+
"disable-focus-trap": !0,
|
|
1171
|
+
"aria-label": e.popoverAriaLabel,
|
|
1172
|
+
position: "bottom-start",
|
|
1173
|
+
"without-space": "",
|
|
1174
|
+
"fit-content": ""
|
|
1175
|
+
}, {
|
|
1176
|
+
default: j(() => [
|
|
1177
|
+
G(T, {
|
|
1178
|
+
"allow-time-input": e.withTimeInput,
|
|
1179
|
+
"quick-select-ranges": e.adjustedQuickSelectRanges,
|
|
1180
|
+
value: e.value,
|
|
1181
|
+
"first-day-of-week": e.firstDayOfWeek,
|
|
1182
|
+
granularities: e.granularities,
|
|
1183
|
+
"is-date-disabled": e.isDateDisabled,
|
|
1184
|
+
"max-range": e.maxRange,
|
|
1185
|
+
min: e.min,
|
|
1186
|
+
max: e.max,
|
|
1187
|
+
"number-of-months": e.numberOfMonths,
|
|
1188
|
+
"show-end-date-on-open": e.showEndDateOnOpen,
|
|
1189
|
+
"date-form-data": e.displayedTextInputValue,
|
|
1190
|
+
variant: e.variant,
|
|
1191
|
+
onCustomRange: e.onRangeSelectorInput,
|
|
1192
|
+
onInput: e.onDateRangePickerInput,
|
|
1193
|
+
onError: e.onDateRangePickerError,
|
|
1194
|
+
onFormDate: e.onDateRangePickerFormDateInputUpdate
|
|
1195
|
+
}, St({ _: 2 }, [
|
|
1196
|
+
e.hasActions ? {
|
|
1197
|
+
name: "actions",
|
|
1198
|
+
fn: j(() => [
|
|
1199
|
+
G(h),
|
|
1200
|
+
Q("div", ma, [
|
|
1201
|
+
G(ee, {
|
|
1202
|
+
actions: e.rangePickerButtonActions,
|
|
1203
|
+
layout: e.BentoButtonActionsLayout.SPACE_BETWEEN
|
|
1204
|
+
}, null, 8, ["actions", "layout"])
|
|
1205
|
+
])
|
|
1206
|
+
]),
|
|
1207
|
+
key: "0"
|
|
1208
|
+
} : void 0
|
|
1209
|
+
]), 1032, ["allow-time-input", "quick-select-ranges", "value", "first-day-of-week", "granularities", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "date-form-data", "variant", "onCustomRange", "onInput", "onError", "onFormDate"])
|
|
1210
|
+
]),
|
|
1211
|
+
_: 1
|
|
1212
|
+
}, 8, ["id", "open", "target-element", "aria-label"])) : N("", !0)
|
|
1213
|
+
])), [
|
|
1214
|
+
[S, e.closeDateRangePicker]
|
|
1215
|
+
]);
|
|
1216
|
+
}
|
|
1217
|
+
const Na = /* @__PURE__ */ nt(ua, [["render", Da], ["__scopeId", "data-v-6a927a91"]]);
|
|
1218
|
+
export {
|
|
1219
|
+
Na as B,
|
|
1220
|
+
V as D,
|
|
1221
|
+
ye as a,
|
|
1222
|
+
jt as b,
|
|
1223
|
+
pe as i
|
|
1224
|
+
};
|
|
1225
|
+
//# sourceMappingURL=date-range-picker.Dw4R9bIs.js.map
|