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