@adyen/bento-vue2 1.7.0 → 1.8.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/components.d.ts +2 -0
- package/dist/@types/packages/core/src/components/button/button.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/action-bar/action-bar.vue.d.ts +11 -0
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +7 -2
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +28 -18
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +25 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +13 -1
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +153 -12
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +18 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +320 -21
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +12 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +30 -24
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.types.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.vue.d.ts +11 -1
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.types.d.ts +13 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.types.d.ts +14 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.types.d.ts +22 -0
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +48 -0
- package/dist/@types/packages/vue2/src/components/internal/field-label/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/grid-layout/grid-layout.vue.d.ts +11 -0
- package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/popover/popover.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +16 -22
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +20 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +19 -2
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +4 -2
- package/dist/@types/packages/vue2/src/components/timeline/timeline.vue.d.ts +18 -2
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +112 -93
- package/dist/action-bar.js.map +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/controls-group.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/field-label.css +1 -0
- package/dist/assets/grid-layout.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +38 -35
- package/dist/button.js.map +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +5 -5
- package/dist/chunks/{base-modal.88e7b9d4.js → base-modal.31634fe8.js} +60 -49
- package/dist/chunks/base-modal.31634fe8.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.a5413243.js → button-actions-with-menu.5faea13e.js} +5 -5
- package/dist/chunks/{button-actions-with-menu.a5413243.js.map → button-actions-with-menu.5faea13e.js.map} +1 -1
- package/dist/chunks/button.e09d5980.js.map +1 -1
- package/dist/chunks/calendar.47e9e755.js +959 -0
- package/dist/chunks/calendar.47e9e755.js.map +1 -0
- package/dist/chunks/{checkbox.5343e28e.js → checkbox.2277450e.js} +67 -56
- package/dist/chunks/checkbox.2277450e.js.map +1 -0
- package/dist/chunks/controls-group.6c5bfccd.js +79 -0
- package/dist/chunks/controls-group.6c5bfccd.js.map +1 -0
- package/dist/chunks/{copy.346eadb1.js → copy.a85c2e9f.js} +3 -3
- package/dist/chunks/{copy.346eadb1.js.map → copy.a85c2e9f.js.map} +1 -1
- package/dist/chunks/{dropdown.f1253a54.js → dropdown.ce937989.js} +200 -196
- package/dist/chunks/dropdown.ce937989.js.map +1 -0
- package/dist/chunks/field-label.330edb60.js +107 -0
- package/dist/chunks/field-label.330edb60.js.map +1 -0
- package/dist/chunks/{grid-layout.b7e0d964.js → grid-layout.a806acb2.js} +36 -27
- package/dist/chunks/grid-layout.a806acb2.js.map +1 -0
- package/dist/chunks/index.210d2169.js +290 -0
- package/dist/chunks/index.210d2169.js.map +1 -0
- package/dist/chunks/{index.8ac70774.js → index.66503760.js} +3 -3
- package/dist/chunks/{index.8ac70774.js.map → index.66503760.js.map} +1 -1
- package/dist/chunks/{index.2625175a.js → index.86fc63ca.js} +30 -28
- package/dist/chunks/{index.2625175a.js.map → index.86fc63ca.js.map} +1 -1
- package/dist/chunks/{index.a201f750.js → index.89942d3a.js} +4 -5
- package/dist/chunks/{index.a201f750.js.map → index.89942d3a.js.map} +1 -1
- package/dist/chunks/index.a5de5242.js +130 -0
- package/dist/chunks/index.a5de5242.js.map +1 -0
- package/dist/chunks/index.a99ffd48.js +634 -0
- package/dist/chunks/index.a99ffd48.js.map +1 -0
- package/dist/chunks/index.d80206ed.js +10 -0
- package/dist/chunks/index.d80206ed.js.map +1 -0
- package/dist/chunks/{index.37283390.js → index.d8bd7596.js} +96 -99
- package/dist/chunks/{index.37283390.js.map → index.d8bd7596.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.6a09e8e2.js → listbox-option-tag.97af47fc.js} +6 -7
- package/dist/chunks/{listbox-option-tag.6a09e8e2.js.map → listbox-option-tag.97af47fc.js.map} +1 -1
- package/dist/chunks/{listbox.73c38f38.js → listbox.d039b178.js} +5 -6
- package/dist/chunks/{listbox.73c38f38.js.map → listbox.d039b178.js.map} +1 -1
- package/dist/chunks/loading-button.9a9cbbad.js +89 -0
- package/dist/chunks/loading-button.9a9cbbad.js.map +1 -0
- package/dist/chunks/{tooltip.104e5fac.js → tooltip.ecd0f707.js} +2 -2
- package/dist/chunks/{tooltip.104e5fac.js.map → tooltip.ecd0f707.js.map} +1 -1
- package/dist/code-snippet.js +4 -4
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +1 -1
- package/dist/data-grid.js +563 -541
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +83 -80
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/empty-state.js +1 -1
- package/dist/filter-bar.js +13 -12
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header.js +63 -67
- package/dist/header.js.map +1 -1
- package/dist/index.js +211 -209
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +57 -55
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +13 -12
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +2 -2
- package/dist/payment-method.js +1 -1
- package/dist/popover.js +3 -305
- package/dist/popover.js.map +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +3 -3
- package/dist/search-bar.js +2 -2
- package/dist/segmented-control.js +2 -2
- package/dist/sidepanel.js +2 -2
- package/dist/status.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +2 -2
- package/dist/textarea.js +59 -56
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +226 -173
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +7 -7
- package/dist/web-types.json +519 -393
- package/package.json +3 -3
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +0 -118
- package/dist/assets/error-message.css +0 -1
- package/dist/chunks/base-modal.88e7b9d4.js.map +0 -1
- package/dist/chunks/calendar.24d0ac04.js +0 -821
- package/dist/chunks/calendar.24d0ac04.js.map +0 -1
- package/dist/chunks/checkbox.5343e28e.js.map +0 -1
- package/dist/chunks/controls-group.2a21bd83.js +0 -87
- package/dist/chunks/controls-group.2a21bd83.js.map +0 -1
- package/dist/chunks/dropdown.f1253a54.js.map +0 -1
- package/dist/chunks/error-message.8302a46c.js +0 -47
- package/dist/chunks/error-message.8302a46c.js.map +0 -1
- package/dist/chunks/grid-layout.b7e0d964.js.map +0 -1
- package/dist/chunks/index.d6b5f5e1.js +0 -112
- package/dist/chunks/index.d6b5f5e1.js.map +0 -1
- package/dist/chunks/index.e566354f.js +0 -532
- package/dist/chunks/index.e566354f.js.map +0 -1
- package/dist/chunks/loading-button.c65682d6.js +0 -86
- package/dist/chunks/loading-button.c65682d6.js.map +0 -1
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
import { defineComponent as Re, reactive as Z, ref as E, computed as b, onMounted as Ue, toRef as ue, watch as Ae } from "vue";
|
|
2
|
+
import { a as Ne } from "./index.210d2169.js";
|
|
3
|
+
import { B as Te } from "./index.965ac1af.js";
|
|
4
|
+
import { c as Be } from "./dropdown-default-textbox.25134789.js";
|
|
5
|
+
import { g as q } from "./unique-id.a2a2b458.js";
|
|
6
|
+
import { u as ee } from "./i18n.155748d6.js";
|
|
7
|
+
import { t as te, f as N } from "./index.b83f8b7e.js";
|
|
8
|
+
import { r as z, t as G, e as k, d as ae, f as ne } from "./index.f55fdc32.js";
|
|
9
|
+
import { f as ce, v as Le, D as y } from "./date-input.9186a0bf.js";
|
|
10
|
+
import { u as $e } from "./use-form-layout-loading.d03e5d48.js";
|
|
11
|
+
import { BentoInputField as Ye } from "../input-field.js";
|
|
12
|
+
import { B as qe } from "./dropdown.ce937989.js";
|
|
13
|
+
import { BentoSegmentedControl as Ge } from "../segmented-control.js";
|
|
14
|
+
import { d as H } from "./debounce.b5ef6acf.js";
|
|
15
|
+
import { u as We } from "./use-has-slot.6052d56a.js";
|
|
16
|
+
import { s as Ve, c as De, i as K, e as me, d as fe, f as Q, g as He, C as h, u as Ke } from "./calendar.47e9e755.js";
|
|
17
|
+
import { e as j } from "./index.fdf12170.js";
|
|
18
|
+
import { e as je } from "./index.d80206ed.js";
|
|
19
|
+
import { n as Ie } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
20
|
+
import { E as ze, F as Je } from "./field-label.330edb60.js";
|
|
21
|
+
import { B as Qe } from "./directive.0408e565.js";
|
|
22
|
+
import "../assets/index13.css";
|
|
23
|
+
function pe(t, e) {
|
|
24
|
+
z(2, arguments);
|
|
25
|
+
var n = G(t), o = G(e);
|
|
26
|
+
return n.getTime() === o.getTime();
|
|
27
|
+
}
|
|
28
|
+
function Xe(t, e) {
|
|
29
|
+
z(2, arguments);
|
|
30
|
+
var n = G(t), o = te(e);
|
|
31
|
+
return n.setHours(o), n;
|
|
32
|
+
}
|
|
33
|
+
function Ze(t, e) {
|
|
34
|
+
z(2, arguments);
|
|
35
|
+
var n = G(t), o = te(e);
|
|
36
|
+
return n.setMinutes(o), n;
|
|
37
|
+
}
|
|
38
|
+
function et(t, e) {
|
|
39
|
+
z(2, arguments);
|
|
40
|
+
var n = G(t), o = te(e);
|
|
41
|
+
return n.setSeconds(o), n;
|
|
42
|
+
}
|
|
43
|
+
const tt = ({
|
|
44
|
+
firstDayOfWeek: t,
|
|
45
|
+
min: e,
|
|
46
|
+
max: n
|
|
47
|
+
}) => ({ getGranularCalendarLimits: (l) => {
|
|
48
|
+
let d = Ve(e), s = j(n);
|
|
49
|
+
if ((l == null ? void 0 : l.type) === "weekly") {
|
|
50
|
+
if (l.earliest)
|
|
51
|
+
d = l.earliest;
|
|
52
|
+
else {
|
|
53
|
+
const c = De(d, { weekStartsOn: t });
|
|
54
|
+
K(d, c) || (d = me(d, { weekStartsOn: t }));
|
|
55
|
+
}
|
|
56
|
+
if (l.latest)
|
|
57
|
+
s = l.latest;
|
|
58
|
+
else {
|
|
59
|
+
const c = me(s, { weekStartsOn: t });
|
|
60
|
+
K(s, c) || (s = fe(De(s, { weekStartsOn: t }), 1));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if ((l == null ? void 0 : l.type) === "monthly") {
|
|
64
|
+
if (l.earliest)
|
|
65
|
+
d = l.earliest;
|
|
66
|
+
else {
|
|
67
|
+
const c = Q(d);
|
|
68
|
+
K(d, c) || (d = Q(He(d, 1)));
|
|
69
|
+
}
|
|
70
|
+
if (l.latest)
|
|
71
|
+
s = l.latest;
|
|
72
|
+
else {
|
|
73
|
+
const c = je(s);
|
|
74
|
+
K(s, c) || (s = fe(Q(s), 1));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { min: d, max: s };
|
|
78
|
+
} });
|
|
79
|
+
var D = /* @__PURE__ */ ((t) => (t.CUSTOM_RANGE = "custom-range", t.INPUT = "input", t.ERROR = "error", t.FORM_DATE = "form-date", t))(D || {});
|
|
80
|
+
const at = /[\d]/, nt = /^\d{2}$/, rt = /^\d{2}:\d{2}$/, st = (t) => {
|
|
81
|
+
const { selectionStart: e } = t.target, n = at.test(t.key) || t.key === "Backspace", o = [1, 2, 4, 5].includes(e) && t.key === ":";
|
|
82
|
+
!n && !o && t.preventDefault();
|
|
83
|
+
}, ge = (t) => {
|
|
84
|
+
if (!t)
|
|
85
|
+
return t;
|
|
86
|
+
let e = t;
|
|
87
|
+
if (e.length === 1 && parseInt(t, 10) > 2)
|
|
88
|
+
return `0${e}:`;
|
|
89
|
+
const [n, o] = e.slice(-2);
|
|
90
|
+
return [2, 5].includes(e.length) && o === ":" && (e = `${e.slice(0, e.length - 2)}0${n}`), (nt.test(e) || rt.test(e)) && (e += ":"), e;
|
|
91
|
+
}, it = {
|
|
92
|
+
"en-US": {
|
|
93
|
+
customRange: "Custom range",
|
|
94
|
+
daily: "Daily",
|
|
95
|
+
dateFrom: "Date from",
|
|
96
|
+
dateTo: "Date to",
|
|
97
|
+
lastMonth: "Last month",
|
|
98
|
+
lastSevenDays: "Last 7 days",
|
|
99
|
+
lastThreeMonths: "Last three months",
|
|
100
|
+
monthly: "Monthly",
|
|
101
|
+
timeFrom: "Time from",
|
|
102
|
+
timeTo: "Time to",
|
|
103
|
+
weekly: "Weekly"
|
|
104
|
+
}
|
|
105
|
+
}, ve = 300, X = "customRange", _e = "daily", ot = Re({
|
|
106
|
+
i18n: { messages: it },
|
|
107
|
+
name: "date-range-picker-calendar",
|
|
108
|
+
components: {
|
|
109
|
+
BentoDropdown: qe,
|
|
110
|
+
BentoInputField: Ye,
|
|
111
|
+
BentoSegmentedControl: Ge,
|
|
112
|
+
BentoTypography: Te,
|
|
113
|
+
Calendar: h
|
|
114
|
+
},
|
|
115
|
+
props: {
|
|
116
|
+
/**
|
|
117
|
+
* Allows user to enter time values in the form
|
|
118
|
+
*/
|
|
119
|
+
allowTimeInput: { type: Boolean, default: !1 },
|
|
120
|
+
/**
|
|
121
|
+
* Ranges form persistance data
|
|
122
|
+
*/
|
|
123
|
+
dateFormData: {
|
|
124
|
+
type: Object,
|
|
125
|
+
default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
129
|
+
*/
|
|
130
|
+
firstDayOfWeek: h.props.firstDayOfWeek,
|
|
131
|
+
/**
|
|
132
|
+
* A list of available granularities.
|
|
133
|
+
* If present, the date picker will display a segmented control to change granularity.
|
|
134
|
+
*/
|
|
135
|
+
granularities: {
|
|
136
|
+
type: Array,
|
|
137
|
+
default: null
|
|
138
|
+
},
|
|
139
|
+
/**
|
|
140
|
+
* Indicate if a date should be disabled or not
|
|
141
|
+
*/
|
|
142
|
+
isDateDisabled: h.props.isDateDisabled,
|
|
143
|
+
/**
|
|
144
|
+
* Set a maximum number of dates to be selectable by the range.
|
|
145
|
+
*/
|
|
146
|
+
maxRange: h.props.maxRange,
|
|
147
|
+
/**
|
|
148
|
+
* Sets a minimum limit for selectable dates - dates before `min` will not be selectable
|
|
149
|
+
*/
|
|
150
|
+
min: h.props.min,
|
|
151
|
+
/**
|
|
152
|
+
* Sets a maximum limit for selectable dates - dates after `max` will not be selectable
|
|
153
|
+
*/
|
|
154
|
+
max: h.props.max,
|
|
155
|
+
/**
|
|
156
|
+
* Number of months rendered on pane
|
|
157
|
+
*/
|
|
158
|
+
numberOfMonths: h.props.numberOfMonths,
|
|
159
|
+
/**
|
|
160
|
+
* Enables the custom range selector.
|
|
161
|
+
* If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
|
|
162
|
+
* `label` - label of custom range item.
|
|
163
|
+
* `value` - a unique key of the custom range item.
|
|
164
|
+
* `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
|
|
165
|
+
*/
|
|
166
|
+
quickSelectRanges: {
|
|
167
|
+
type: Array,
|
|
168
|
+
default: void 0
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* Selected date
|
|
172
|
+
*/
|
|
173
|
+
value: { type: Object, default: void 0 }
|
|
174
|
+
},
|
|
175
|
+
emits: [
|
|
176
|
+
D.CUSTOM_RANGE,
|
|
177
|
+
D.INPUT,
|
|
178
|
+
D.ERROR,
|
|
179
|
+
D.FORM_DATE
|
|
180
|
+
],
|
|
181
|
+
setup(t, { emit: e, slots: n }) {
|
|
182
|
+
var se, ie, oe, le, de;
|
|
183
|
+
const { locale: o, t: l } = ee(), d = { de: ae, enUS: k, fr: ne }, s = Z({
|
|
184
|
+
startDate: (se = t.value) == null ? void 0 : se.startDate,
|
|
185
|
+
endDate: (ie = t.value) == null ? void 0 : ie.endDate,
|
|
186
|
+
...t.granularities ? {
|
|
187
|
+
granularity: ((oe = t.value) == null ? void 0 : oe.granularity) || _e
|
|
188
|
+
} : {}
|
|
189
|
+
}), c = E(
|
|
190
|
+
((de = (le = t == null ? void 0 : t.quickSelectRanges) == null ? void 0 : le.find(
|
|
191
|
+
({ data: a }) => pe(a.startDate, s.startDate) && pe(a.endDate, s.endDate)
|
|
192
|
+
)) == null ? void 0 : de.value) ?? X
|
|
193
|
+
), B = b(() => ({
|
|
194
|
+
"b-date-range-picker-calendar__form-input-wrapper": t.allowTimeInput
|
|
195
|
+
})), L = b(() => t.quickSelectRanges ? [
|
|
196
|
+
{ label: l("customRange"), value: X },
|
|
197
|
+
...t.quickSelectRanges
|
|
198
|
+
] : []), R = b(
|
|
199
|
+
() => {
|
|
200
|
+
var a;
|
|
201
|
+
return ((a = t.granularities) == null ? void 0 : a.find(({ type: r }) => r === s.granularity)) || null;
|
|
202
|
+
}
|
|
203
|
+
), f = b(
|
|
204
|
+
() => t.granularities.map(({ type: a, disabled: r }) => ({
|
|
205
|
+
label: l(a),
|
|
206
|
+
value: a,
|
|
207
|
+
disabled: r
|
|
208
|
+
}))
|
|
209
|
+
), { getGranularCalendarLimits: P } = tt(t), p = b(
|
|
210
|
+
() => t.granularities ? P(R.value) : { min: t.min, max: t.max }
|
|
211
|
+
), {
|
|
212
|
+
adjustStartDateInputForWeekly: U,
|
|
213
|
+
adjustEndDateInputForWeekly: T,
|
|
214
|
+
adjustStartDateInputForMonthly: M,
|
|
215
|
+
adjustEndDateInputForMonthly: g
|
|
216
|
+
} = Ke(t.firstDayOfWeek, t.min, t.max), O = () => {
|
|
217
|
+
t != null && t.quickSelectRanges && (c.value = X);
|
|
218
|
+
}, _ = (a) => a ? N(a, y.NUMERIC_DATE_YEAR_FIRST, {
|
|
219
|
+
locale: d[o.value.substring(0, 2)] || k
|
|
220
|
+
}) : "", $ = (a) => a ? N(a, y.HOUR_MINUTE_SECONDS, {
|
|
221
|
+
locale: d[o.value.substring(0, 2)] || k
|
|
222
|
+
}) : "", C = E(!1), x = E(!1), w = E(!1), F = E(!1), i = Z({
|
|
223
|
+
startDate: t.dateFormData.startDate,
|
|
224
|
+
endDate: t.dateFormData.endDate,
|
|
225
|
+
startTime: t.dateFormData.startTime,
|
|
226
|
+
endTime: t.dateFormData.endTime
|
|
227
|
+
}), re = (a) => {
|
|
228
|
+
s.startDate = a.startDate, s.endDate = a.endDate, e(D.INPUT, s);
|
|
229
|
+
}, W = (a) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(a), u = (a, r) => {
|
|
230
|
+
if (!r || !W(r))
|
|
231
|
+
return a;
|
|
232
|
+
let m = new Date(a);
|
|
233
|
+
const [S, J, Pe] = r.split(":");
|
|
234
|
+
return m = Xe(m, parseInt(S, 10)), m = Ze(m, parseInt(J, 10)), m = et(m, parseInt(Pe, 10)), m;
|
|
235
|
+
}, v = (a) => {
|
|
236
|
+
const r = (S) => t.min && S <= t.min || t.max && S >= t.max ? !1 : t.isDateDisabled ? !t.isDateDisabled(S) : !0;
|
|
237
|
+
return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) && r(new Date(a));
|
|
238
|
+
};
|
|
239
|
+
Ue(() => {
|
|
240
|
+
t.dateFormData.startDate && !v(t.dateFormData.startDate) ? C.value = !0 : (C.value = !1, w.value = !1), t.dateFormData.endDate && !v(t.dateFormData.endDate) ? x.value = !0 : (x.value = !1, F.value = !1);
|
|
241
|
+
});
|
|
242
|
+
const Y = (a) => {
|
|
243
|
+
var r;
|
|
244
|
+
O(), i.startDate = _(a), i.startTime ? w.value && (i.startTime = (r = t.dateFormData) == null ? void 0 : r.startTime) : i.startTime = $(a), C.value = !1, w.value = !1;
|
|
245
|
+
}, be = (a) => {
|
|
246
|
+
var r;
|
|
247
|
+
i.endDate = _(a), i.endTime ? F.value && (i.endTime = (r = t.dateFormData) == null ? void 0 : r.endTime) : i.endTime = $(j(a)), x.value = !1, F.value = !1;
|
|
248
|
+
}, V = (a) => {
|
|
249
|
+
const r = t.value[a];
|
|
250
|
+
if (r)
|
|
251
|
+
return r;
|
|
252
|
+
if (t.dateFormData[a] && v(t.dateFormData[a]))
|
|
253
|
+
return new Date(t.dateFormData[a]);
|
|
254
|
+
}, ye = H((a) => {
|
|
255
|
+
if (v(a)) {
|
|
256
|
+
let r = a;
|
|
257
|
+
switch (C.value = !1, R.value.type) {
|
|
258
|
+
case "weekly":
|
|
259
|
+
r = U(a, _), i.startDate = r;
|
|
260
|
+
break;
|
|
261
|
+
case "monthly":
|
|
262
|
+
r = M(a, _), i.startDate = r;
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
s.startDate = u(new Date(r), i.startTime);
|
|
266
|
+
const m = V("endDate");
|
|
267
|
+
e(D.FORM_DATE, {
|
|
268
|
+
startDate: new Date(r),
|
|
269
|
+
endDate: m
|
|
270
|
+
}), e(D.INPUT, {
|
|
271
|
+
startDate: new Date(r),
|
|
272
|
+
endDate: m
|
|
273
|
+
});
|
|
274
|
+
} else
|
|
275
|
+
C.value = !0, e(D.ERROR, { ...i });
|
|
276
|
+
}, ve), ke = (a) => {
|
|
277
|
+
O(), i.startDate = ce(a), ye(i.startDate);
|
|
278
|
+
}, Se = H((a) => {
|
|
279
|
+
if (v(a)) {
|
|
280
|
+
let r = a;
|
|
281
|
+
switch (x.value = !1, R.value.type) {
|
|
282
|
+
case "weekly":
|
|
283
|
+
r = T(a, _), i.endDate = r;
|
|
284
|
+
break;
|
|
285
|
+
case "monthly":
|
|
286
|
+
r = g(a, _), i.endDate = r;
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
s.endDate = u(new Date(r), i.endTime);
|
|
290
|
+
const m = V("startDate");
|
|
291
|
+
e(D.FORM_DATE, {
|
|
292
|
+
startDate: m,
|
|
293
|
+
endDate: new Date(s.endDate),
|
|
294
|
+
startTime: t.dateFormData.endTime,
|
|
295
|
+
endTime: r
|
|
296
|
+
}), e(D.INPUT, {
|
|
297
|
+
startDate: m,
|
|
298
|
+
endDate: new Date(s.endDate)
|
|
299
|
+
});
|
|
300
|
+
} else
|
|
301
|
+
x.value = !0, e(D.ERROR, { ...i });
|
|
302
|
+
}, ve), Ee = (a) => {
|
|
303
|
+
O(), i.endDate = ce(a), Se(i.endDate);
|
|
304
|
+
}, Me = (a) => {
|
|
305
|
+
Le(a);
|
|
306
|
+
}, Oe = H((a) => {
|
|
307
|
+
if (W(a)) {
|
|
308
|
+
w.value = !1, s.startDate = u(s.startDate, a);
|
|
309
|
+
const r = V("endDate");
|
|
310
|
+
e(D.FORM_DATE, {
|
|
311
|
+
startDate: new Date(s.startDate),
|
|
312
|
+
endDate: r,
|
|
313
|
+
startTime: a,
|
|
314
|
+
endTime: t.dateFormData.endTime
|
|
315
|
+
}), e(D.INPUT, {
|
|
316
|
+
startDate: new Date(s.startDate),
|
|
317
|
+
endDate: r
|
|
318
|
+
});
|
|
319
|
+
} else
|
|
320
|
+
w.value = !0, e(D.ERROR, { ...i });
|
|
321
|
+
}), Ce = H((a) => {
|
|
322
|
+
if (W(a)) {
|
|
323
|
+
F.value = !1, s.endDate = u(s.endDate, a);
|
|
324
|
+
const r = V("startDate");
|
|
325
|
+
e(D.FORM_DATE, {
|
|
326
|
+
startDate: r,
|
|
327
|
+
endDate: new Date(s.endDate),
|
|
328
|
+
startTime: t.dateFormData.startTime,
|
|
329
|
+
endTime: a
|
|
330
|
+
}), e(D.INPUT, {
|
|
331
|
+
startDate: r,
|
|
332
|
+
endDate: new Date(s.endDate)
|
|
333
|
+
});
|
|
334
|
+
} else
|
|
335
|
+
F.value = !0, e(D.ERROR, { ...i });
|
|
336
|
+
}), xe = (a) => {
|
|
337
|
+
O(), i.startTime = ge(a), Oe(i.startTime);
|
|
338
|
+
}, we = (a) => {
|
|
339
|
+
O(), i.endTime = ge(a), Ce(i.endTime);
|
|
340
|
+
}, Fe = (a) => {
|
|
341
|
+
st(a);
|
|
342
|
+
}, he = (a) => {
|
|
343
|
+
var m, S;
|
|
344
|
+
c.value = a;
|
|
345
|
+
const r = (S = (m = t.quickSelectRanges) == null ? void 0 : m.find(({ value: J }) => J === a)) == null ? void 0 : S.data;
|
|
346
|
+
r && (i.startDate = _(r.startDate), i.endDate = _(r.endDate), t.granularities && (s.granularity = r.granularity || _e), i.startTime || (i.startTime = $(j(r.startDate))), i.endTime || (i.endTime = $(j(r.endDate))), e(D.CUSTOM_RANGE, r));
|
|
347
|
+
};
|
|
348
|
+
return {
|
|
349
|
+
// Values
|
|
350
|
+
internalRangeDate: s,
|
|
351
|
+
dateTextInput: i,
|
|
352
|
+
endDateError: x,
|
|
353
|
+
endTimeError: F,
|
|
354
|
+
granularityItems: f,
|
|
355
|
+
selectedGranularity: R,
|
|
356
|
+
computedMinMax: p,
|
|
357
|
+
selectedRangeSelectorValue: c,
|
|
358
|
+
startDateError: C,
|
|
359
|
+
startTimeError: w,
|
|
360
|
+
quickSelectRangeDefaultItems: L,
|
|
361
|
+
formInputWrapperConditionalClasses: B,
|
|
362
|
+
// Methods
|
|
363
|
+
hasSlot: We(n),
|
|
364
|
+
t: l,
|
|
365
|
+
// Events
|
|
366
|
+
onDateInput: re,
|
|
367
|
+
onDateInputKeyDown: Me,
|
|
368
|
+
onEndDateInput: Ee,
|
|
369
|
+
onEndDateSelected: be,
|
|
370
|
+
onEndTimeInput: we,
|
|
371
|
+
onRangeSelectorInput: he,
|
|
372
|
+
onStartDateInput: ke,
|
|
373
|
+
onStartDateSelected: Y,
|
|
374
|
+
onStartTimeInput: xe,
|
|
375
|
+
onTimeInputKeyDown: Fe
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
var lt = function() {
|
|
380
|
+
var e = this, n = e._self._c;
|
|
381
|
+
return e._self._setupProxy, n("div", { staticClass: "b-date-range-picker-calendar" }, [n("div", { staticClass: "b-date-range-picker-calendar__form-container" }, [n("div", { staticClass: "b-date-range-picker-calendar__form" }, [e.quickSelectRanges ? n("bento-dropdown", { attrs: { "aria-label": e.t("customRange"), items: e.quickSelectRangeDefaultItems, value: e.selectedRangeSelectorValue }, on: { input: e.onRangeSelectorInput } }) : e._e(), e.granularities ? n("bento-segmented-control", { attrs: { items: e.granularityItems, "model-value": e.internalRangeDate.granularity, "full-width": "" }, on: { "update:model-value": function(o) {
|
|
382
|
+
e.internalRangeDate.granularity = o;
|
|
383
|
+
} } }) : e._e(), e.hasSlot("title") ? [e._t("title")] : e._e(), n("div", [n("bento-typography", { staticClass: "b-date-range-picker-calendar__label", attrs: { stronger: "", el: "span" } }, [e._v(" From ")]), n("div", { class: e.formInputWrapperConditionalClasses }, [n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.$t("dateFrom"), value: e.dateTextInput.startDate, error: e.startDateError }, on: { input: e.onStartDateInput, keydown: e.onDateInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
|
|
384
|
+
return [e._v("YYYY-MM-DD")];
|
|
385
|
+
}, proxy: !0 }]) }), e.allowTimeInput ? n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("timeFrom"), value: e.dateTextInput.startTime, error: e.startTimeError }, on: { input: e.onStartTimeInput, keydown: e.onTimeInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
|
|
386
|
+
return [e._v("HH:MM:SS")];
|
|
387
|
+
}, proxy: !0 }], null, !1, 3442289499) }) : e._e()], 1)], 1), n("div", [n("bento-typography", { staticClass: "b-date-range-picker-calendar__label", attrs: { stronger: "", el: "span" } }, [e._v(" To ")]), n("div", { class: e.formInputWrapperConditionalClasses }, [n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.$t("dateTo"), value: e.dateTextInput.endDate, error: e.endDateError }, on: { input: e.onEndDateInput, keydown: e.onDateInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
|
|
388
|
+
return [e._v("YYYY-MM-DD")];
|
|
389
|
+
}, proxy: !0 }]) }), e.allowTimeInput ? n("bento-input-field", { staticClass: "b-date-range-picker-calendar__form-input", attrs: { "aria-label": e.t("timeTo"), value: e.dateTextInput.endTime, error: e.endTimeError }, on: { input: e.onEndTimeInput, keydown: e.onTimeInputKeyDown }, scopedSlots: e._u([{ key: "description", fn: function() {
|
|
390
|
+
return [e._v("HH:MM:SS")];
|
|
391
|
+
}, proxy: !0 }], null, !1, 3442289499) }) : e._e()], 1)], 1)], 2), e.hasSlot("actions") ? n("div", [e._t("actions")], 2) : e._e()]), n("div", { staticClass: "b-date-range-picker-calendar__calendars-container" }, [n("calendar", { attrs: { value: e.value, "first-day-of-week": e.firstDayOfWeek, "is-date-disabled": e.isDateDisabled, "max-range": e.maxRange, min: e.computedMinMax.min, max: e.computedMinMax.max, "number-of-months": e.numberOfMonths, granularity: e.selectedGranularity, "is-range": "" }, on: { input: e.onDateInput, "start-date-selected": e.onStartDateSelected, "end-date-selected": e.onEndDateSelected } })], 1)]);
|
|
392
|
+
}, dt = [], ut = /* @__PURE__ */ Ie(
|
|
393
|
+
ot,
|
|
394
|
+
lt,
|
|
395
|
+
dt,
|
|
396
|
+
!1,
|
|
397
|
+
null,
|
|
398
|
+
"c2c219df",
|
|
399
|
+
null,
|
|
400
|
+
null
|
|
401
|
+
);
|
|
402
|
+
const I = ut.exports, ct = ({
|
|
403
|
+
datePickerValue: t,
|
|
404
|
+
isDateIncorrect: e
|
|
405
|
+
}) => {
|
|
406
|
+
var R, f, P, p, U;
|
|
407
|
+
const { locale: n, t: o } = ee(), l = { de: ae, enUS: k, fr: ne }, d = (T, M) => N(T, M, {
|
|
408
|
+
locale: l[n.value.substring(0, 2)] || k
|
|
409
|
+
}), s = (T) => N(T, y.HOUR_MINUTE_SECONDS, {
|
|
410
|
+
locale: l[n.value.substring(0, 2)] || k
|
|
411
|
+
}), c = Z({
|
|
412
|
+
startDate: (R = t.value) != null && R.startDate ? d(t.value.startDate, y.NUMERIC_DATE_YEAR_FIRST) : void 0,
|
|
413
|
+
endDate: (f = t.value) != null && f.endDate ? d(t.value.endDate, y.NUMERIC_DATE_YEAR_FIRST) : void 0,
|
|
414
|
+
// Set time if the startDate/endDate are set
|
|
415
|
+
startTime: (P = t.value) != null && P.startDate ? s((p = t.value) == null ? void 0 : p.startDate) : void 0,
|
|
416
|
+
endTime: (U = t.value) != null && U.endDate ? s(t.value.endDate) : void 0
|
|
417
|
+
});
|
|
418
|
+
return {
|
|
419
|
+
// Values
|
|
420
|
+
dateDisplayValue: b(() => {
|
|
421
|
+
if (e.value)
|
|
422
|
+
return `${c.startDate || ""} - ${c.endDate || ""}`;
|
|
423
|
+
if (!t.value || !t.value.startDate && !t.value.endDate)
|
|
424
|
+
return o("selectDateRange");
|
|
425
|
+
const { startDate: T, endDate: M } = c;
|
|
426
|
+
return `${d(new Date(T), y.FULL_DATE_MONTH_FIRST)} - ${d(
|
|
427
|
+
new Date(M),
|
|
428
|
+
y.FULL_DATE_MONTH_FIRST
|
|
429
|
+
)}`;
|
|
430
|
+
}),
|
|
431
|
+
textInputDisplayValue: c,
|
|
432
|
+
// Methods
|
|
433
|
+
formatTextInputDisplayValue: () => ""
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
var A = /* @__PURE__ */ ((t) => (t.INPUT = "input", t))(A || {});
|
|
437
|
+
const Dt = {
|
|
438
|
+
"en-US": {
|
|
439
|
+
dateRangePicker: "Date range picker {name}",
|
|
440
|
+
provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
|
|
441
|
+
selectDate: "Select a date",
|
|
442
|
+
selectDateRange: "Select a date range",
|
|
443
|
+
selectedDateIsNotAvailable: "Selected date is not available"
|
|
444
|
+
}
|
|
445
|
+
}, mt = Re({
|
|
446
|
+
i18n: { messages: Dt },
|
|
447
|
+
name: "bento-date-range-picker",
|
|
448
|
+
components: {
|
|
449
|
+
BentoTypography: Te,
|
|
450
|
+
BentoPopover: Ne,
|
|
451
|
+
DateRangePickerCalendar: I,
|
|
452
|
+
DropdownInputDefault: Be,
|
|
453
|
+
ErrorMessage: ze,
|
|
454
|
+
FieldLabel: Je
|
|
455
|
+
},
|
|
456
|
+
directives: { BentoClickOutsideDirective: Qe },
|
|
457
|
+
props: {
|
|
458
|
+
/**
|
|
459
|
+
* Allows user to enter time values in the form
|
|
460
|
+
*/
|
|
461
|
+
allowTimeInput: { type: Boolean, default: !1 },
|
|
462
|
+
/**
|
|
463
|
+
* Descriptive supporting text visbile underneath the dropdown.
|
|
464
|
+
*/
|
|
465
|
+
description: { type: String, default: void 0 },
|
|
466
|
+
/**
|
|
467
|
+
* Disables dropdown functionality.
|
|
468
|
+
*/
|
|
469
|
+
disabled: { type: Boolean, default: !1 },
|
|
470
|
+
/**
|
|
471
|
+
* Displays component in an error state with an error message
|
|
472
|
+
*/
|
|
473
|
+
errorMessage: { type: String, default: null },
|
|
474
|
+
/**
|
|
475
|
+
* Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
476
|
+
*/
|
|
477
|
+
firstDayOfWeek: I.props.firstDayOfWeek,
|
|
478
|
+
/**
|
|
479
|
+
* A list of available granularities.
|
|
480
|
+
* If present, the date picker will display a segmented control to change granularity.
|
|
481
|
+
*/
|
|
482
|
+
granularities: I.props.granularities,
|
|
483
|
+
/**
|
|
484
|
+
* Indicate if a date should be disabled or not
|
|
485
|
+
*/
|
|
486
|
+
isDateDisabled: I.props.isDateDisabled,
|
|
487
|
+
/**
|
|
488
|
+
* Text that is displayed as a label above the element.
|
|
489
|
+
*/
|
|
490
|
+
label: { type: String, default: void 0 },
|
|
491
|
+
/**
|
|
492
|
+
* Highlights the dropdown is optional.
|
|
493
|
+
*/
|
|
494
|
+
optional: { type: Boolean, default: !1 },
|
|
495
|
+
/**
|
|
496
|
+
* The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date range picker.
|
|
497
|
+
*/
|
|
498
|
+
readonly: { type: Boolean, default: !1 },
|
|
499
|
+
/**
|
|
500
|
+
* Highlights the dropdown is required.
|
|
501
|
+
*/
|
|
502
|
+
required: { type: Boolean, default: !1 },
|
|
503
|
+
/**
|
|
504
|
+
* Adds a info icon next to the label to display the passed tooltip message.
|
|
505
|
+
*/
|
|
506
|
+
tooltipText: { type: String, default: null },
|
|
507
|
+
/**
|
|
508
|
+
* Enables the range selector.
|
|
509
|
+
* If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
|
|
510
|
+
* `label` - label of custom range item.
|
|
511
|
+
* `value` - a unique key of the custom range item.
|
|
512
|
+
* `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
|
|
513
|
+
*/
|
|
514
|
+
quickSelectRanges: {
|
|
515
|
+
type: Array,
|
|
516
|
+
default: void 0
|
|
517
|
+
},
|
|
518
|
+
/**
|
|
519
|
+
* Set a maximum number of dates to be selectable by the range.
|
|
520
|
+
*/
|
|
521
|
+
maxRange: I.props.maxRange,
|
|
522
|
+
/**
|
|
523
|
+
* Sets a minimum limit for selectable dates - dates before `min` will not be selectable
|
|
524
|
+
*/
|
|
525
|
+
min: I.props.min,
|
|
526
|
+
/**
|
|
527
|
+
* Sets a maximum limit for selectable dates - dates after `max` will not be selectable
|
|
528
|
+
*/
|
|
529
|
+
max: I.props.max,
|
|
530
|
+
/**
|
|
531
|
+
* Number of months rendered on pane
|
|
532
|
+
*/
|
|
533
|
+
numberOfMonths: I.props.numberOfMonths,
|
|
534
|
+
/**
|
|
535
|
+
* Selected date
|
|
536
|
+
*/
|
|
537
|
+
value: I.props.value
|
|
538
|
+
},
|
|
539
|
+
emits: [A.INPUT],
|
|
540
|
+
setup(t, { emit: e }) {
|
|
541
|
+
const { locale: n, t: o } = ee(), l = { de: ae, enUS: k, fr: ne }, d = q("bento-date-range-picker-container"), s = q("bento-date-range-picker-label"), c = q("bento-date-range-picker-description"), B = q("bento-date-range-picker-error"), L = q("bento-date-range-picker-date-error"), R = b(
|
|
542
|
+
() => t.label || o("dateRangePicker", { name: d })
|
|
543
|
+
), f = E(!1), P = E(null), p = E(!1), { isReadOnly: U } = $e(ue(t, "readonly"));
|
|
544
|
+
Ae(
|
|
545
|
+
() => t.disabled,
|
|
546
|
+
() => {
|
|
547
|
+
t.disabled && p.value && (p.value = !1);
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
const T = b(() => ({
|
|
551
|
+
"b-date-range-picker__description--error": !!t.errorMessage || f.value
|
|
552
|
+
})), { dateDisplayValue: M, textInputDisplayValue: g, formatTextInputDisplayValue: O } = ct({
|
|
553
|
+
datePickerValue: ue(t, "value"),
|
|
554
|
+
isDateIncorrect: f
|
|
555
|
+
}), _ = b(
|
|
556
|
+
() => `${t.description ? c : ""} ${t.errorMessage ? B : ""} ${f.value ? L : ""}`.trim() || null
|
|
557
|
+
);
|
|
558
|
+
return {
|
|
559
|
+
// Refs
|
|
560
|
+
inputContainerRef: P,
|
|
561
|
+
// Values,
|
|
562
|
+
dateDisplayValue: M,
|
|
563
|
+
datePickerContainerId: d,
|
|
564
|
+
descriptionConditionalClasses: T,
|
|
565
|
+
isDateIncorrect: f,
|
|
566
|
+
isDateRangePickerOpen: p,
|
|
567
|
+
isReadOnly: U,
|
|
568
|
+
labelId: s,
|
|
569
|
+
descriptionId: c,
|
|
570
|
+
dateErrorId: L,
|
|
571
|
+
errorId: B,
|
|
572
|
+
popoverAriaLabel: R,
|
|
573
|
+
ariaDescribedBy: _,
|
|
574
|
+
textInputDisplayValue: g,
|
|
575
|
+
// Events
|
|
576
|
+
closeDateRangePicker: () => {
|
|
577
|
+
p.value = !1;
|
|
578
|
+
},
|
|
579
|
+
clearDateRangePickerValue: async () => {
|
|
580
|
+
f.value && (f.value = !1), e(A.INPUT, null);
|
|
581
|
+
},
|
|
582
|
+
openDateRangePicker: () => {
|
|
583
|
+
p.value = !0, O();
|
|
584
|
+
},
|
|
585
|
+
onRangeSelectorInput: (u) => {
|
|
586
|
+
if (u) {
|
|
587
|
+
const v = (Y) => N(Y, y.NUMERIC_DATE_YEAR_FIRST, {
|
|
588
|
+
locale: l[n.value.substring(0, 2)] || k
|
|
589
|
+
});
|
|
590
|
+
g.startDate = v(u.startDate), g.endDate = v(u.endDate), e(A.INPUT, u);
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
onEnterPressedOverInput: () => {
|
|
594
|
+
f.value || (p.value = !1);
|
|
595
|
+
},
|
|
596
|
+
onDateRangePickerInput: (u) => {
|
|
597
|
+
f.value = !1;
|
|
598
|
+
const v = (Y) => N(Y, y.NUMERIC_DATE_YEAR_FIRST, {
|
|
599
|
+
locale: l[n.value.substring(0, 2)] || k
|
|
600
|
+
});
|
|
601
|
+
g.startDate = v(u.startDate), g.endDate = v(u.endDate), e(A.INPUT, u);
|
|
602
|
+
},
|
|
603
|
+
onDateRangePickerError: (u) => {
|
|
604
|
+
f.value = !0, g.startDate = u.startDate, g.endDate = u.endDate, e(A.INPUT, { startDate: null, endDate: null });
|
|
605
|
+
},
|
|
606
|
+
onDateRangePickerFormDateInputUpdate: (u) => {
|
|
607
|
+
f.value = !1, u.startTime && (g.startTime = u.startTime), u.endTime && (g.endTime = u.endTime);
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
var ft = function() {
|
|
613
|
+
var e = this, n = e._self._c;
|
|
614
|
+
return e._self._setupProxy, n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeDateRangePicker, expression: "closeDateRangePicker" }], staticClass: "b-date-range-picker" }, [e.label ? n("field-label", { attrs: { id: e.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), n("div", { on: { keydown: function(o) {
|
|
615
|
+
return !o.type.indexOf("key") && e._k(o.keyCode, "enter", 13, o.key, "Enter") ? null : e.onEnterPressedOverInput.apply(null, arguments);
|
|
616
|
+
} } }, [n("dropdown-input-default", { ref: "inputContainerRef", attrs: { ariaControls: e.datePickerContainerId, ariaExpanded: e.isDateRangePickerOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "is-invalid": !!e.errorMessage || e.isDateIncorrect, open: e.isDateRangePickerOpen, "display-value": e.dateDisplayValue, readonly: e.isReadOnly }, on: { open: e.openDateRangePicker, clear: e.clearDateRangePickerValue, close: e.closeDateRangePicker } })], 1), e.isDateIncorrect ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.$t("provideDateInAFormat").toString() } }) : e._e(), e.errorMessage ? n("error-message", { staticClass: "b-date-range-picker__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? n("bento-typography", { staticClass: "b-date-range-picker__description", class: e.descriptionConditionalClasses, attrs: { id: e.descriptionId, el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), e.inputContainerRef ? n("bento-popover", { staticClass: "b-date-range-picker__container", attrs: { id: e.datePickerContainerId, open: e.isDateRangePickerOpen, "target-element": e.inputContainerRef, "disable-focus-trap": !0, "aria-label": e.popoverAriaLabel, position: "bottom-start", "without-space": "", "fit-content": "" } }, [n("date-range-picker-calendar", { attrs: { "allow-time-input": e.allowTimeInput, "quick-select-ranges": e.quickSelectRanges, value: e.value, "first-day-of-week": e.firstDayOfWeek, granularities: e.granularities, "is-date-disabled": e.isDateDisabled, "max-range": e.maxRange, min: e.min, max: e.max, "number-of-months": e.numberOfMonths, "date-form-data": e.textInputDisplayValue }, on: { "custom-range": e.onRangeSelectorInput, input: e.onDateRangePickerInput, error: e.onDateRangePickerError, "form-date": e.onDateRangePickerFormDateInputUpdate } })], 1) : e._e()], 1);
|
|
617
|
+
}, pt = [], gt = /* @__PURE__ */ Ie(
|
|
618
|
+
mt,
|
|
619
|
+
ft,
|
|
620
|
+
pt,
|
|
621
|
+
!1,
|
|
622
|
+
null,
|
|
623
|
+
"4511bb26",
|
|
624
|
+
null,
|
|
625
|
+
null
|
|
626
|
+
);
|
|
627
|
+
const Bt = gt.exports;
|
|
628
|
+
export {
|
|
629
|
+
Bt as B,
|
|
630
|
+
I as D,
|
|
631
|
+
A as a,
|
|
632
|
+
pe as i
|
|
633
|
+
};
|
|
634
|
+
//# sourceMappingURL=index.a99ffd48.js.map
|