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