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