bitboss-ui 1.0.14 → 1.0.16

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 (142) hide show
  1. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +5 -0
  2. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +1 -1
  3. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +5 -0
  4. package/dist/index102.js +3 -3
  5. package/dist/index104.js +2 -2
  6. package/dist/index110.js +1 -1
  7. package/dist/index112.js +4 -4
  8. package/dist/index114.js +1 -1
  9. package/dist/index118.js +1 -1
  10. package/dist/index119.js +1 -1
  11. package/dist/index12.js +3 -3
  12. package/dist/index120.js +1 -1
  13. package/dist/index122.js +1 -1
  14. package/dist/index126.js +1 -1
  15. package/dist/index127.js +1 -1
  16. package/dist/index132.js +2 -2
  17. package/dist/index14.js +10 -10
  18. package/dist/index14.js.map +1 -1
  19. package/dist/index16.js +8 -8
  20. package/dist/index18.js +11 -11
  21. package/dist/index18.js.map +1 -1
  22. package/dist/index197.js +2 -235
  23. package/dist/index197.js.map +1 -1
  24. package/dist/index198.js +235 -5
  25. package/dist/index198.js.map +1 -1
  26. package/dist/index199.js +79 -16
  27. package/dist/index199.js.map +1 -1
  28. package/dist/index20.js +16 -14
  29. package/dist/index20.js.map +1 -1
  30. package/dist/index200.js +2 -16
  31. package/dist/index200.js.map +1 -1
  32. package/dist/index201.js +4 -19
  33. package/dist/index201.js.map +1 -1
  34. package/dist/index202.js +2 -20
  35. package/dist/index202.js.map +1 -1
  36. package/dist/index203.js +5 -29
  37. package/dist/index203.js.map +1 -1
  38. package/dist/index204.js +16 -8
  39. package/dist/index204.js.map +1 -1
  40. package/dist/index205.js +16 -2
  41. package/dist/index205.js.map +1 -1
  42. package/dist/index206.js +19 -79
  43. package/dist/index206.js.map +1 -1
  44. package/dist/index207.js +18 -119
  45. package/dist/index207.js.map +1 -1
  46. package/dist/index208.js +25 -130
  47. package/dist/index208.js.map +1 -1
  48. package/dist/index209.js +8 -2
  49. package/dist/index209.js.map +1 -1
  50. package/dist/index210.js +2 -35
  51. package/dist/index210.js.map +1 -1
  52. package/dist/index211.js +3 -174
  53. package/dist/index211.js.map +1 -1
  54. package/dist/index212.js +35 -6
  55. package/dist/index212.js.map +1 -1
  56. package/dist/index213.js +6 -368
  57. package/dist/index213.js.map +1 -1
  58. package/dist/index214.js +111 -363
  59. package/dist/index214.js.map +1 -1
  60. package/dist/index215.js +134 -3
  61. package/dist/index215.js.map +1 -1
  62. package/dist/index216.js +2 -2
  63. package/dist/index216.js.map +1 -1
  64. package/dist/index217.js +174 -4
  65. package/dist/index217.js.map +1 -1
  66. package/dist/index218.js +368 -2
  67. package/dist/index218.js.map +1 -1
  68. package/dist/index219.js +373 -2
  69. package/dist/index219.js.map +1 -1
  70. package/dist/index22.js +2 -2
  71. package/dist/index22.js.map +1 -1
  72. package/dist/index220.js +1 -1
  73. package/dist/index221.js +1 -1
  74. package/dist/index227.js +1 -1
  75. package/dist/index228.js +2 -295
  76. package/dist/index228.js.map +1 -1
  77. package/dist/index229.js +164 -6
  78. package/dist/index229.js.map +1 -1
  79. package/dist/index230.js +1 -4
  80. package/dist/index230.js.map +1 -1
  81. package/dist/index231.js +5 -2
  82. package/dist/index231.js.map +1 -1
  83. package/dist/index232.js +69 -2
  84. package/dist/index232.js.map +1 -1
  85. package/dist/index233.js +4 -2
  86. package/dist/index233.js.map +1 -1
  87. package/dist/index234.js +295 -2
  88. package/dist/index234.js.map +1 -1
  89. package/dist/index235.js +6 -2
  90. package/dist/index235.js.map +1 -1
  91. package/dist/index236.js +2 -2
  92. package/dist/index236.js.map +1 -1
  93. package/dist/index237.js +2 -69
  94. package/dist/index237.js.map +1 -1
  95. package/dist/index238.js +2 -5
  96. package/dist/index238.js.map +1 -1
  97. package/dist/index239.js +2 -164
  98. package/dist/index239.js.map +1 -1
  99. package/dist/index24.js +1 -1
  100. package/dist/index240.js +4 -1
  101. package/dist/index240.js.map +1 -1
  102. package/dist/index241.js +2 -2
  103. package/dist/index242.js +428 -99
  104. package/dist/index242.js.map +1 -1
  105. package/dist/index243.js +82 -428
  106. package/dist/index243.js.map +1 -1
  107. package/dist/index244.js +224 -2
  108. package/dist/index244.js.map +1 -1
  109. package/dist/index245.js +252 -83
  110. package/dist/index245.js.map +1 -1
  111. package/dist/index246.js +2 -200
  112. package/dist/index246.js.map +1 -1
  113. package/dist/index247.js +100 -111
  114. package/dist/index247.js.map +1 -1
  115. package/dist/index248.js +199 -3
  116. package/dist/index248.js.map +1 -1
  117. package/dist/index249.js +111 -218
  118. package/dist/index249.js.map +1 -1
  119. package/dist/index250.js +2 -258
  120. package/dist/index250.js.map +1 -1
  121. package/dist/index255.js +3 -2
  122. package/dist/index255.js.map +1 -1
  123. package/dist/index256.js +2 -3
  124. package/dist/index256.js.map +1 -1
  125. package/dist/index26.js +49 -38
  126. package/dist/index26.js.map +1 -1
  127. package/dist/index30.js +3 -3
  128. package/dist/index32.js +7 -7
  129. package/dist/index34.js +2 -2
  130. package/dist/index36.js +2 -2
  131. package/dist/index48.js +1 -1
  132. package/dist/index50.js +1 -1
  133. package/dist/index64.js +11 -10
  134. package/dist/index64.js.map +1 -1
  135. package/dist/index66.js +3 -3
  136. package/dist/index73.js +1 -1
  137. package/dist/index76.js +20 -18
  138. package/dist/index76.js.map +1 -1
  139. package/dist/index80.js +4 -4
  140. package/dist/index82.js +1 -1
  141. package/dist/style.css +1 -1
  142. package/package.json +2 -2
@@ -9,6 +9,11 @@ export type BaseDialogProps = Pick<CommonProps, 'closeLabel' | 'compact' | 'disa
9
9
  * Description of the content of the modal. Extremely useful for accessibility reasons.
10
10
  */
11
11
  description?: string;
12
+ /**
13
+ * Elements that obtains focus immediately after opening the dialog.
14
+ * By default it's the first tabbable item.
15
+ */
16
+ focusTarget?: string;
12
17
  /**
13
18
  * Displays the modala as fulscreen with no margin to the page
14
19
  */
@@ -67,7 +67,7 @@ export type SlotAttributes = {
67
67
  hasErrors: Exclude<BaseRadioProps['hasErrors'], undefined>;
68
68
  id: BaseRadioProps['id'];
69
69
  name: BaseRadioProps['name'];
70
- parsedValue: any;
70
+ parsedValue: string;
71
71
  readonly: BaseRadioProps['readonly'];
72
72
  value: any;
73
73
  };
@@ -9,6 +9,11 @@ export type BbOffCanvasProps = Pick<CommonProps, 'closeLabel' | 'compact' | 'dis
9
9
  * Description of the content of the modal. Extremely useful for accessibility reasons.
10
10
  */
11
11
  description?: string;
12
+ /**
13
+ * Elements that obtains focus immediately after opening the offcanvas.
14
+ * By default it's the first tabbable item.
15
+ */
16
+ focusTarget?: string;
12
17
  /**
13
18
  * Displays the modala as fulscreen with no margin to the page
14
19
  */
package/dist/index102.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as de, ref as O, computed as p, onMounted as be, watch as q, openBlock as n, createBlock as re, resolveDynamicComponent as ue, normalizeClass as f, withCtx as pe, createElementBlock as d, toDisplayString as m, createCommentVNode as v, createElementVNode as o, renderSlot as y, createVNode as J, unref as C, Fragment as N, renderList as T, createTextVNode as fe, mergeProps as me } from "vue";
2
- import { add as ye } from "./index236.js";
3
- import { clamp as he } from "./index219.js";
2
+ import { add as ye } from "./index228.js";
3
+ import { clamp as he } from "./index197.js";
4
4
  import { deepEqual as G } from "./index124.js";
5
5
  import { isNil as j } from "./index121.js";
6
6
  import { isNotNil as _e } from "./index125.js";
7
7
  import { useId as ke } from "./index8.js";
8
8
  import { useItemValue as ge } from "./index127.js";
9
- import { when as ve } from "./index217.js";
9
+ import { when as ve } from "./index201.js";
10
10
  import K from "./index12.js";
11
11
  import "./index13.js";
12
12
  import Ce from "./index26.js";
package/dist/index104.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as y, ref as f, computed as B, openBlock as k, createBlock as g, withCtx as l, renderSlot as r, normalizeProps as i, guardReactiveProps as n, createVNode as w, mergeProps as V } from "vue";
2
2
  import $ from "./index22.js";
3
3
  import "./index23.js";
4
- import P from "./index239.js";
5
- import "./index240.js";
4
+ import P from "./index229.js";
5
+ import "./index230.js";
6
6
  const z = /* @__PURE__ */ y({
7
7
  __name: "BbTag",
8
8
  props: {
package/dist/index110.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as s, openBlock as e, createBlock as o, Teleport as l, createElementVNode as c, normalizeClass as m, createVNode as i, TransitionGroup as p, withCtx as u, createElementBlock as d, Fragment as f, renderList as _, unref as r, mergeProps as b } from "vue";
2
2
  import { state as k, useToast as C } from "./index6.js";
3
- import B from "./index237.js";
3
+ import B from "./index232.js";
4
4
  const N = /* @__PURE__ */ s({
5
5
  __name: "BbToast",
6
6
  props: {
package/dist/index112.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as A, ref as o, computed as E, openBlock as b, createElementBlock as $, mergeProps as D, createElementVNode as i, renderSlot as L, normalizeProps as H, guardReactiveProps as I, unref as s, createBlock as M, Teleport as R, normalizeClass as U, normalizeStyle as j, withCtx as q, createCommentVNode as O } from "vue";
2
- import { useFloating as G, arrow as J } from "./index207.js";
2
+ import { useFloating as G, arrow as J } from "./index214.js";
3
3
  import { useId as K } from "./index8.js";
4
4
  import { wait as P } from "./index123.js";
5
5
  import Q from "./index10.js";
6
6
  import "./index11.js";
7
- import { throttle as v } from "./index215.js";
8
- import { waitFor as W } from "./index212.js";
9
- import { autoUpdate as X, flip as Y, shift as Z } from "./index213.js";
7
+ import { throttle as v } from "./index211.js";
8
+ import { waitFor as W } from "./index213.js";
9
+ import { autoUpdate as X, flip as Y, shift as Z } from "./index218.js";
10
10
  const ee = { class: "bb-tooltip__bubble" }, te = /* @__PURE__ */ i("svg", {
11
11
  fill: "none",
12
12
  viewBox: "0 0 24 24",
package/dist/index114.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as $, computed as g, resolveComponent as y, openBlock as f, createElementBlock as i, Fragment as v, renderList as h, normalizeClass as b, createElementVNode as s, renderSlot as p, createVNode as k, createSlots as B, withCtx as C, normalizeProps as T, guardReactiveProps as _ } from "vue";
2
- import { flattenTree as P } from "./index238.js";
2
+ import { flattenTree as P } from "./index231.js";
3
3
  const w = { class: "bb-tree-row" }, z = { class: "bb-tree-main-content" }, I = /* @__PURE__ */ $({
4
4
  __name: "BbTree",
5
5
  props: {
package/dist/index118.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, getCurrentInstance as d, inject as x, computed as l, ref as y, watchEffect as _, openBlock as b, createElementBlock as h, mergeProps as w } from "vue";
2
- import { isCssColor as z } from "./index216.js";
2
+ import { isCssColor as z } from "./index200.js";
3
3
  const g = ["innerHTML"], $ = /* @__PURE__ */ m({
4
4
  __name: "BbIcon",
5
5
  props: {
package/dist/index119.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, ref as r, onMounted as p, onBeforeUnmount as h, openBlock as i, createBlock as l, resolveDynamicComponent as u, normalizeStyle as m, withCtx as f, renderSlot as d } from "vue";
2
- import { throttle as g } from "./index215.js";
2
+ import { throttle as g } from "./index211.js";
3
3
  const O = /* @__PURE__ */ v({
4
4
  __name: "BbSmoothHeight",
5
5
  props: {
package/dist/index12.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as C, ref as b, computed as n, watch as E, openBlock as m, createElementBlock as p, normalizeProps as c, guardReactiveProps as h, mergeProps as f, createCommentVNode as I, createElementVNode as r, renderSlot as F } from "vue";
2
- import { isCssColor as k } from "./index216.js";
3
- import { when as N } from "./index217.js";
4
- import { booleanishToBoolean as S } from "./index218.js";
2
+ import { isCssColor as k } from "./index200.js";
3
+ import { when as N } from "./index201.js";
4
+ import { booleanishToBoolean as S } from "./index202.js";
5
5
  const A = {
6
6
  "aria-hidden": "true",
7
7
  class: "bb-base-checkbox-container"
package/dist/index120.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, computed as r, openBlock as a, createElementBlock as d, normalizeProps as u, guardReactiveProps as z, createElementVNode as c } from "vue";
2
- import { isCssColor as f } from "./index216.js";
2
+ import { isCssColor as f } from "./index200.js";
3
3
  const _ = /* @__PURE__ */ c("svg", {
4
4
  viewBox: "0 0 512 512",
5
5
  xmlns: "http://www.w3.org/2000/svg"
package/dist/index122.js CHANGED
@@ -1,4 +1,4 @@
1
- import { clamp as o } from "./index219.js";
1
+ import { clamp as o } from "./index197.js";
2
2
  const r = (t, e) => t * 100 / e, p = (t, e) => t / 100 * e, l = (t, e, n) => r(t - e, n - e), P = ({
3
3
  value: t = 0,
4
4
  originalBounds: e,
package/dist/index126.js CHANGED
@@ -1,4 +1,4 @@
1
- import t from "./index197.js";
1
+ import t from "./index198.js";
2
2
  const o = () => ({
3
3
  getItemText(r, n) {
4
4
  if (typeof r == "string" && !n)
package/dist/index127.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index197.js";
1
+ import o from "./index198.js";
2
2
  const e = () => ({
3
3
  getItemValue(n, f) {
4
4
  if (typeof f > "u")
package/dist/index132.js CHANGED
@@ -1,5 +1,5 @@
1
- import { toValue as b, useDebounceFn as I, useThrottleFn as V, tryOnMounted as X, noop as C, isObject as Y, tryOnScopeDispose as $, isClient as q } from "./index206.js";
2
- import { createFilterWrapper as te, debounceFilter as ne, getLifeCycleTarget as oe, throttleFilter as re } from "./index206.js";
1
+ import { toValue as b, useDebounceFn as I, useThrottleFn as V, tryOnMounted as X, noop as C, isObject as Y, tryOnScopeDispose as $, isClient as q } from "./index199.js";
2
+ import { createFilterWrapper as te, debounceFilter as ne, getLifeCycleTarget as oe, throttleFilter as re } from "./index199.js";
3
3
  import { ref as D, computed as g, reactive as P, watch as z } from "vue";
4
4
  function G(u) {
5
5
  var a;
package/dist/index14.js CHANGED
@@ -34,8 +34,8 @@ const M = { class: "bb-base-checkbox-group__container" }, H = {
34
34
  readonly: {}
35
35
  },
36
36
  emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
37
- setup(x, { emit: C }) {
38
- const t = x, o = C, u = y(), d = y(!1), { loading: E, options: m } = N({
37
+ setup(x, { emit: E }) {
38
+ const t = x, o = E, u = y(), d = y(!1), { loading: D, options: m } = N({
39
39
  dependencies: l(() => t.dependencies),
40
40
  depsDebounceTime: t.depsDebounceTime,
41
41
  disabled: l(() => t.disabled),
@@ -50,11 +50,11 @@ const M = { class: "bb-base-checkbox-group__container" }, H = {
50
50
  modelValue: l(() => t.modelValue),
51
51
  modelValueDebounceTime: t.modelValueDebounceTime,
52
52
  multiple: !0
53
- }), D = (e) => {
53
+ }), C = (e) => {
54
54
  let s;
55
55
  e.selected ? s = t.modelValue.slice(0, e.selectedIndex).concat(t.modelValue.slice(e.selectedIndex + 1)) : s = t.modelValue.concat(e.value), o("update:modelValue", s);
56
56
  }, L = (e, s) => {
57
- o("change", e), D(s);
57
+ o("change", e), C(s);
58
58
  }, $ = {
59
59
  onBlur: (e) => o("blur", e),
60
60
  onClick: (e) => o("click", e),
@@ -83,7 +83,7 @@ const M = { class: "bb-base-checkbox-group__container" }, H = {
83
83
  }, [
84
84
  g("span", M, [
85
85
  n(e.$slots, "prepend"),
86
- !i(m).length && i(E) ? (c(), r("span", H, [
86
+ !i(m).length && i(D) ? (c(), r("span", H, [
87
87
  n(e.$slots, "loading", {}, () => [
88
88
  k(v(e.loadingText), 1)
89
89
  ])
@@ -96,9 +96,9 @@ const M = { class: "bb-base-checkbox-group__container" }, H = {
96
96
  key: (a == null ? void 0 : a.id) || a.jsonValue
97
97
  }, [
98
98
  n(e.$slots, "option:prepend", {
99
+ id: a.id,
99
100
  checked: a.selected,
100
101
  disabled: !!a.disabled,
101
- id: a.id,
102
102
  item: a.original,
103
103
  text: a.text
104
104
  }),
@@ -108,15 +108,15 @@ const M = { class: "bb-base-checkbox-group__container" }, H = {
108
108
  }])
109
109
  }, [
110
110
  S(I, T({
111
+ id: a.id,
111
112
  "aria-describedby": e.ariaDescribedby,
112
113
  autofocus: e.autofocus && !B,
113
114
  checked: a.selected,
114
115
  color: e.color,
115
116
  disabled: a.disabled,
116
117
  "has-errors": e.hasErrors,
117
- id: a.id,
118
118
  name: e.name,
119
- onChange: (f) => L(f, a),
119
+ "on-change": (f) => L(f, a),
120
120
  readonly: e.readonly,
121
121
  "true-value": a.value
122
122
  }, $), {
@@ -127,7 +127,7 @@ const M = { class: "bb-base-checkbox-group__container" }, H = {
127
127
  }, f))
128
128
  ]),
129
129
  _: 2
130
- }, 1040, ["aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "id", "name", "onChange", "readonly", "true-value"]),
130
+ }, 1040, ["id", "aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "name", "on-change", "readonly", "true-value"]),
131
131
  g("span", {
132
132
  class: p({
133
133
  "bb-base-checkbox-group-option__text": !0,
@@ -144,9 +144,9 @@ const M = { class: "bb-base-checkbox-group__container" }, H = {
144
144
  ], 2)
145
145
  ], 2),
146
146
  n(e.$slots, "option:append", {
147
+ id: a.id,
147
148
  checked: a.selected,
148
149
  disabled: !!a.disabled,
149
- id: a.id,
150
150
  item: a.original,
151
151
  text: a.text
152
152
  })
@@ -1 +1 @@
1
- {"version":3,"file":"index14.js","sources":["../src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"container\"\n\t\tclass=\"bb-base-checkbox-group\"\n\t\t:class=\"{\n\t\t\t'bb-base-checkbox-group--errors': hasErrors,\n\t\t\t'bb-base-checkbox-group--horizontal': direction === 'horizontal',\n\t\t\t'bb-base-checkbox-group--vertical': direction === 'vertical',\n\t\t}\"\n\t>\n\t\t<span class=\"bb-base-checkbox-group__container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<span\n\t\t\t\tv-if=\"!options.length && loading\"\n\t\t\t\tclass=\"bb-base-checkbox-group__loading-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'loading'\">{{ loadingText }}</slot>\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tv-else-if=\"!options.length\"\n\t\t\t\tclass=\"bb-base-checkbox-group__no-data-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'no-data'\">{{ noDataText }}</slot>\n\t\t\t</span>\n\n\t\t\t<template\n\t\t\t\tv-for=\"(option, index) in options\"\n\t\t\t\t:key=\"option?.id || option.jsonValue\"\n\t\t\t>\n\t\t\t\t<slot\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\tname=\"option:prepend\"\n\t\t\t\t></slot>\n\t\t\t\t<label\n\t\t\t\t\tclass=\"bb-base-checkbox-group-option\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-base-checkbox-group-option__selected': option.selected,\n\t\t\t\t\t}\"\n\t\t\t\t>\n\t\t\t\t\t<BaseCheckbox\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t:color=\"color\"\n\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t\t:onChange=\"(event: Event) => onChange(event, option)\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:true-value=\"option.value\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t\t><template #icon=\"data\"\n\t\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\tv-bind=\"data\" /></template\n\t\t\t\t\t></BaseCheckbox>\n\t\t\t\t\t<span\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-checkbox-group-option__text': true,\n\t\t\t\t\t\t\t'bb-base-checkbox-group-option__text--hidden': hideLabel,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t>{{ option.text }}</slot\n\t\t\t\t\t\t></span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t\t<slot\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\tname=\"option:append\"\n\t\t\t\t></slot>\n\t\t\t</template>\n\t\t\t<slot name=\"append\"></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport BaseCheckbox from '../BaseCheckbox/BaseCheckbox.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { Option } from '@/composables/useOptions';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BaseCheckboxGroupProps<T> = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Direction of the layout of the inputs inside the fieldset. It can be either `horizontal` or `vertical`\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| T[]\n\t\t| ((prefill: boolean, modelValue?: any[]) => Promise<T[]>)\n\t\t| ((prefill: boolean, modelValue?: any[]) => T[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => any) | undefined;\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Defines the strategy used to understand whether an option has been selected.\n\t * `string` is 40% faster but relies on property order.\n\t * `equality` is more reliable but is slower.\n\t */\n\tmatchStrategy?: 'string' | 'equality';\n\n\t/**\n\t * Used by v-model. Can be an array of any serializable type.\n\t */\n\tmodelValue: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n};\n\nexport type BaseCheckboxGroupEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nconst props = withDefaults(defineProps<BaseCheckboxGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmatchStrategy: 'string',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseCheckboxGroupEvents>();\n\ndefineSlots<{\n\tprepend?: (props: object) => any;\n\tloading?: (props: object) => any;\n\t'no-data'?: (props: object) => any;\n\t'option:prepend'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\ticon?: (\n\t\tprops: SlotAttributes & {\n\t\t\titem: T;\n\t\t\ttext: string;\n\t\t}\n\t) => any;\n\tlabel?: (props: { item: T; text: string; checked: boolean }) => any;\n\t'option:append'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\tappend?: (props: object) => any;\n}>();\n\nconst container = ref<HTMLElement>();\nconst active = ref(false);\n\nconst { loading, options } = useOptions({\n\tdependencies: toRef(() => props.dependencies),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(() => props.disabled),\n\temitter: (value) => emit('update:modelValue', value),\n\tenforceCoherence: toRef(() => props.enforceCoherence),\n\tid: props.id,\n\timmediate: true,\n\tinitialItems: toRef(() => props.items),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmatchStrategy: props.matchStrategy,\n\tmodelValue: toRef(() => props.modelValue),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: true,\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option) => {\n\tlet valueToEmit;\n\tif (option.selected) {\n\t\tvalueToEmit = props.modelValue\n\t\t\t.slice(0, option.selectedIndex)\n\t\t\t.concat(props.modelValue.slice(option.selectedIndex + 1));\n\t} else {\n\t\tvalueToEmit = props.modelValue.concat(option.value);\n\t}\n\temit('update:modelValue', valueToEmit);\n};\n\nconst onChange = (event: Event, option: Option) => {\n\temit('change', event);\n\tonOptionSelected(option);\n};\n\nconst onFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tif (!active.value) {\n\t\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\t\tdocument.addEventListener('click', onDocumentClick, { passive: true });\n\t\tactive.value = true;\n\t}\n};\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus,\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseCheckboxGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","useOptions","toRef","value","onOptionSelected","option","valueToEmit","onChange","event","eventListeners","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4OA,UAAMA,IAAQC,GAURC,IAAOC,GA8BPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB,EAAE,SAAAE,GAAS,SAAAC,EAAQ,IAAIC,EAAW;AAAA,MACvC,cAAcC,EAAM,MAAMV,EAAM,YAAY;AAAA,MAC5C,kBAAkBA,EAAM;AAAA,MACxB,UAAUU,EAAM,MAAMV,EAAM,QAAQ;AAAA,MACpC,SAAS,CAACW,MAAUT,EAAK,qBAAqBS,CAAK;AAAA,MACnD,kBAAkBD,EAAM,MAAMV,EAAM,gBAAgB;AAAA,MACpD,IAAIA,EAAM;AAAA,MACV,WAAW;AAAA,MACX,cAAcU,EAAM,MAAMV,EAAM,KAAK;AAAA,MACrC,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,eAAeA,EAAM;AAAA,MACrB,YAAYU,EAAM,MAAMV,EAAM,UAAU;AAAA,MACxC,wBAAwBA,EAAM;AAAA,MAC9B,UAAU;AAAA,IAAA,CACV,GAKKY,IAAmB,CAACC,MAAmB;AACxC,UAAAC;AACJ,MAAID,EAAO,WACVC,IAAcd,EAAM,WAClB,MAAM,GAAGa,EAAO,aAAa,EAC7B,OAAOb,EAAM,WAAW,MAAMa,EAAO,gBAAgB,CAAC,CAAC,IAEzDC,IAAcd,EAAM,WAAW,OAAOa,EAAO,KAAK,GAEnDX,EAAK,qBAAqBY,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;;;;;;"}
1
+ {"version":3,"file":"index14.js","sources":["../src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"container\"\n\t\tclass=\"bb-base-checkbox-group\"\n\t\t:class=\"{\n\t\t\t'bb-base-checkbox-group--errors': hasErrors,\n\t\t\t'bb-base-checkbox-group--horizontal': direction === 'horizontal',\n\t\t\t'bb-base-checkbox-group--vertical': direction === 'vertical',\n\t\t}\"\n\t>\n\t\t<span class=\"bb-base-checkbox-group__container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<span\n\t\t\t\tv-if=\"!options.length && loading\"\n\t\t\t\tclass=\"bb-base-checkbox-group__loading-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'loading'\">{{ loadingText }}</slot>\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tv-else-if=\"!options.length\"\n\t\t\t\tclass=\"bb-base-checkbox-group__no-data-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'no-data'\">{{ noDataText }}</slot>\n\t\t\t</span>\n\n\t\t\t<template\n\t\t\t\tv-for=\"(option, index) in options\"\n\t\t\t\t:key=\"option?.id || option.jsonValue\"\n\t\t\t>\n\t\t\t\t<slot\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\tname=\"option:prepend\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t></slot>\n\t\t\t\t<label\n\t\t\t\t\tclass=\"bb-base-checkbox-group-option\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-base-checkbox-group-option__selected': option.selected,\n\t\t\t\t\t}\"\n\t\t\t\t>\n\t\t\t\t\t<BaseCheckbox\n\t\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t:color=\"color\"\n\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t\t:on-change=\"(event: Event) => onChange(event, option)\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:true-value=\"option.value\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t\t><template #icon=\"data\"\n\t\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\tv-bind=\"data\" /></template\n\t\t\t\t\t></BaseCheckbox>\n\t\t\t\t\t<span\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-checkbox-group-option__text': true,\n\t\t\t\t\t\t\t'bb-base-checkbox-group-option__text--hidden': hideLabel,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t>{{ option.text }}</slot\n\t\t\t\t\t\t></span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t\t<slot\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\tname=\"option:append\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t></slot>\n\t\t\t</template>\n\t\t\t<slot name=\"append\"></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport BaseCheckbox from '../BaseCheckbox/BaseCheckbox.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { Option } from '@/composables/useOptions';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BaseCheckboxGroupProps<T> = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Direction of the layout of the inputs inside the fieldset. It can be either `horizontal` or `vertical`\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| T[]\n\t\t| ((prefill: boolean, modelValue?: any[]) => Promise<T[]>)\n\t\t| ((prefill: boolean, modelValue?: any[]) => T[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => any) | undefined;\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Defines the strategy used to understand whether an option has been selected.\n\t * `string` is 40% faster but relies on property order.\n\t * `equality` is more reliable but is slower.\n\t */\n\tmatchStrategy?: 'string' | 'equality';\n\n\t/**\n\t * Used by v-model. Can be an array of any serializable type.\n\t */\n\tmodelValue: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n};\n\nexport type BaseCheckboxGroupEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nconst props = withDefaults(defineProps<BaseCheckboxGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmatchStrategy: 'string',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseCheckboxGroupEvents>();\n\ndefineSlots<{\n\tprepend?: (props: object) => any;\n\tloading?: (props: object) => any;\n\t'no-data'?: (props: object) => any;\n\t'option:prepend'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\ticon?: (\n\t\tprops: SlotAttributes & {\n\t\t\titem: T;\n\t\t\ttext: string;\n\t\t}\n\t) => any;\n\tlabel?: (props: { item: T; text: string; checked: boolean }) => any;\n\t'option:append'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\tappend?: (props: object) => any;\n}>();\n\nconst container = ref<HTMLElement>();\nconst active = ref(false);\n\nconst { loading, options } = useOptions({\n\tdependencies: toRef(() => props.dependencies),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(() => props.disabled),\n\temitter: (value) => emit('update:modelValue', value),\n\tenforceCoherence: toRef(() => props.enforceCoherence),\n\tid: props.id,\n\timmediate: true,\n\tinitialItems: toRef(() => props.items),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmatchStrategy: props.matchStrategy,\n\tmodelValue: toRef(() => props.modelValue),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: true,\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option) => {\n\tlet valueToEmit;\n\tif (option.selected) {\n\t\tvalueToEmit = props.modelValue\n\t\t\t.slice(0, option.selectedIndex)\n\t\t\t.concat(props.modelValue.slice(option.selectedIndex + 1));\n\t} else {\n\t\tvalueToEmit = props.modelValue.concat(option.value);\n\t}\n\temit('update:modelValue', valueToEmit);\n};\n\nconst onChange = (event: Event, option: Option) => {\n\temit('change', event);\n\tonOptionSelected(option);\n};\n\nconst onFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tif (!active.value) {\n\t\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\t\tdocument.addEventListener('click', onDocumentClick, { passive: true });\n\t\tactive.value = true;\n\t}\n};\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus,\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseCheckboxGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","useOptions","toRef","value","onOptionSelected","option","valueToEmit","onChange","event","eventListeners","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4OA,UAAMA,IAAQC,GAURC,IAAOC,GA8BPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB,EAAE,SAAAE,GAAS,SAAAC,EAAQ,IAAIC,EAAW;AAAA,MACvC,cAAcC,EAAM,MAAMV,EAAM,YAAY;AAAA,MAC5C,kBAAkBA,EAAM;AAAA,MACxB,UAAUU,EAAM,MAAMV,EAAM,QAAQ;AAAA,MACpC,SAAS,CAACW,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,WAAWc,CAAK;AAAA,IAAA,GAGlDE,IAAkB,CAACF,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBI,IAAAhB,EAAU,UAAV,QAAAgB,EAAiB,SAASJ,EAAM,YACpCd,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWY,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD,GAGKA,IAAkB,CAACH,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBI,IAAAhB,EAAU,UAAV,QAAAgB,EAAiB,SAASJ,EAAM,YACpCd,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWY,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index16.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as Ve, ref as k, computed as p, watch as F, nextTick as U, openBlock as d, createElementBlock as u, mergeProps as Se, createElementVNode as r, createTextVNode as De, toDisplayString as f, unref as y, withDirectives as q, createVNode as V, Transition as S, withCtx as D, vShow as j, createCommentVNode as Y, normalizeClass as g, Fragment as w, renderList as O, renderSlot as G } from "vue";
2
- import i from "./index198.js";
3
- import Me from "./index199.js";
4
- import Ae from "./index200.js";
5
- import xe from "./index201.js";
6
- import Ce from "./index202.js";
7
- import Ye from "./index203.js";
8
- import { groupBy as J } from "./index204.js";
2
+ import i from "./index203.js";
3
+ import Me from "./index204.js";
4
+ import Ae from "./index205.js";
5
+ import xe from "./index206.js";
6
+ import Ce from "./index207.js";
7
+ import Ye from "./index208.js";
8
+ import { groupBy as J } from "./index209.js";
9
9
  import { isNil as Be } from "./index121.js";
10
- import { last as Q } from "./index205.js";
10
+ import { last as Q } from "./index210.js";
11
11
  const Ie = { class: "bb-base-date-picker__header" }, Ee = ["disabled"], Ne = /* @__PURE__ */ r("span", null, null, -1), Te = {
12
12
  "aria-live": "polite",
13
13
  class: "bb-base-date-picker__selected-day-label"
package/dist/index18.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import { defineComponent as Z, ref as n, computed as k, watch as x, openBlock as E, createElementBlock as ee, normalizeClass as z, renderSlot as c, createElementVNode as o, withDirectives as ae, mergeProps as B, unref as p, toDisplayString as L, createBlock as te, Teleport as ne, normalizeStyle as re, createVNode as oe, createSlots as le, renderList as se, withCtx as ie, normalizeProps as ue, guardReactiveProps as de, createCommentVNode as ce } from "vue";
2
- import { useFloating as pe } from "./index207.js";
3
- import me from "./index208.js";
4
- import r from "./index198.js";
5
- import fe from "./index201.js";
6
- import { identity as be } from "./index209.js";
7
- import { last as ve } from "./index205.js";
8
- import { useFocusTrap as ye } from "./index210.js";
2
+ import { useFloating as pe } from "./index214.js";
3
+ import me from "./index215.js";
4
+ import r from "./index203.js";
5
+ import fe from "./index206.js";
6
+ import { identity as be } from "./index216.js";
7
+ import { last as ve } from "./index210.js";
8
+ import { useFocusTrap as ye } from "./index212.js";
9
9
  import { useId as ge } from "./index8.js";
10
- import { vMaska as he } from "./index211.js";
10
+ import { vMaska as he } from "./index217.js";
11
11
  import { wait as Y } from "./index123.js";
12
- import { waitFor as ke } from "./index212.js";
12
+ import { waitFor as ke } from "./index213.js";
13
13
  import Me from "./index16.js";
14
14
  import "./index17.js";
15
- import { autoUpdate as we, flip as Ve, shift as _e } from "./index213.js";
16
- import { offset as Ye } from "./index214.js";
15
+ import { autoUpdate as we, flip as Ve, shift as _e } from "./index218.js";
16
+ import { offset as Ye } from "./index219.js";
17
17
  const De = ["aria-describedby", "autocomplete", "autofocus", "data-maska", "disabled", "id", "name", "placeholder", "readonly", "value"], Ae = ["disabled"], Ce = /* @__PURE__ */ o("svg", {
18
18
  xmlns: "http://www.w3.org/2000/svg",
19
19
  viewBox: "-2 -3 24 24"
@@ -1 +1 @@
1
- {"version":3,"file":"index18.js","sources":["../src/components/BaseDatePickerInput/BaseDatePickerInput.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"outerContainer\"\n\t\tclass=\"bb-base-date-picker-input__container\"\n\t\t:class=\"classes\"\n\t\t@focusin=\"onFocusIn\"\n\t>\n\t\t<slot name=\"prepend-outer\"></slot>\n\t\t<span\n\t\t\tref=\"innerContainer\"\n\t\t\tclass=\"bb-base-date-picker-input__inner-container\"\n\t\t>\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<input\n\t\t\t\t:aria-describedby=\"`bdpi_description_${id}`\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:data-maska=\"props.range ? '##/##/#### - ##/##/####' : '##/##/####'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:id=\"id\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly || range || !allowWriting\"\n\t\t\t\t:type=\"'text'\"\n\t\t\t\t:value=\"displayValue\"\n\t\t\t\tref=\"input\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\tv-maska\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t/>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar-btn\"\n\t\t\t\t:disabled=\"disabled || readonly\"\n\t\t\t\t@click=\"onOpenCalendar\"\n\t\t\t>\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-2 -3 24 24\">\n\t\t\t\t\t<path\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\td=\"M18 7V5a1 1 0 0 0-1-1h-1v1a1 1 0 0 1-2 0V4H6v1a1 1 0 1 1-2 0V4H3a1 1 0 0 0-1 1v2zm0 2H2v6a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1zm-2-7h1a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3h1V1a1 1 0 1 1 2 0v1h8V1a1 1 0 0 1 2 0z\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t\t<span>{{ accessibleButtonLabel }}</span>\n\t\t\t</button>\n\n\t\t\t<slot name=\"append\"></slot>\n\t\t\t<span\n\t\t\t\t:id=\"`bdpi_description_${id}`\"\n\t\t\t\tclass=\"bb-base-date-picker-input__accessible-description\"\n\t\t\t\t>Formato della data\n\t\t\t\t{{ props.range ? 'GG/MM/AAAA - GG/MM/AAAA' : 'GG/MM/AAAA' }}</span\n\t\t\t>\n\t\t</span>\n\t\t<slot name=\"append-outer\"></slot>\n\t\t<teleport to=\"body\" v-if=\"shouldRenderCalendar\">\n\t\t\t<span\n\t\t\t\tref=\"calendar\"\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-date-picker-input__calendar--active': active,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--shown': shown,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--showing': showing,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hiding': hiding,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hidden': hidden,\n\t\t\t\t}\"\n\t\t\t\t:style=\"calendarStyles\"\n\t\t\t>\n\t\t\t\t<BaseDatePicker\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tv-bind=\"calendarEventListeners\"\n\t\t\t\t\tref=\"basedatepicker\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:first-day-of-week=\"firstDayOfWeek\"\n\t\t\t\t\t:max=\"max\"\n\t\t\t\t\t:min=\"min\"\n\t\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t\t:range=\"range\"\n\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t:selectable=\"selectable\"\n\t\t\t\t>\n\t\t\t\t\t<template v-for=\"(_, name) in $slots\" #[name]=\"data\">\n\t\t\t\t\t\t<slot :name=\"name\" v-bind=\"data\" />\n\t\t\t\t\t</template>\n\t\t\t\t</BaseDatePicker>\n\t\t\t</span>\n\t\t</teleport>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { autoUpdate, flip, offset, shift, useFloating } from '@floating-ui/vue';\nimport { computed, ref, watch, nextTick } from 'vue';\nimport { default as customParseFormat } from 'dayjs/plugin/customParseFormat';\nimport { default as dayjs } from 'dayjs';\nimport { default as it } from 'dayjs/locale/it';\nimport { identity } from '@/utilities/functions/identity';\nimport { last } from '@/utilities/functions/last';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { vMaska } from 'maska';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport BaseDatePicker from '../BaseDatePicker/BaseDatePicker.vue';\nimport type { BaseDatePickerSlots } from '../BaseDatePicker/BaseDatePicker.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\ndayjs.extend(customParseFormat);\ndayjs.locale(it);\n\nexport type BaseDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Defines the first day of the week with `0` meaning Sunday and `6` meaning Saturday\n\t */\n\tfirstDayOfWeek?: (typeof it)['weekStart'];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Maximum selectable date\n\t */\n\tmax?: Date | string | number;\n\n\t/**\n\t * Minimum selectable date\n\t */\n\tmin?: Date | string | number;\n\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | string[] | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Selects a range of dates between two dates. It selects all of the days between start and end\n\t */\n\trange?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Function that accepts a `Date` object and returns a boolean. `false` meaning the date cannot be selected\n\t * @param date\n\t */\n\tselectable?: (date: Date) => boolean;\n\n\t/**\n\t * Width of the calendar\n\t */\n\twidth?: number | string;\n};\n\nconst props = withDefaults(defineProps<BaseDatePickerInputProps>(), {\n\tallowWriting: true,\n\tautocomplete: 'off',\n\twidth: 290,\n});\n\nexport type BaseDatePickerInputEvents = {\n\t(e: 'active'): void;\n\t(e: 'error', message: string): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'update:modelValue', value: BaseDatePickerInputProps['modelValue']): void;\n};\n\nconst emit = defineEmits<BaseDatePickerInputEvents>();\n\ndefineSlots<\n\t{\n\t\t'prepend-outer'?: (props: object) => any;\n\t\tprepend?: (props: object) => any;\n\t\tappend?: (props: object) => any;\n\t\t'append-outer'?: (props: object) => any;\n\t} & BaseDatePickerSlots\n>();\n\nconst calendar = ref<HTMLElement | null>(null);\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst inputValue = ref<string | null>(null);\nconst basedatepicker = ref();\nconst id = props.id || `bdpi_${useId().id.value}`;\n\nconst classes = computed(() => ({\n\t'bb-base-date-picker-input': true,\n\t'bb-base-date-picker-input--active': active.value,\n\t'bb-base-date-picker-input--errors': props.hasErrors,\n\t'bb-base-date-picker-input--readonly': props.readonly,\n\t'bb-base-date-picker-input--disabled': props.disabled,\n}));\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonInput: (event: Event) => {\n\t\tif (props.range) return;\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tinputValue.value = event.target.value;\n\t\t\tif (/\\d{2}\\/\\d{2}\\/\\d{4}/.test(event.target.value)) {\n\t\t\t\tconst date = dayjs(event.target.value, 'DD/MM/YYYY');\n\t\t\t\tif (!basedatepicker.value.isDateDisabled(date)) {\n\t\t\t\t\temit('update:modelValue', date.toISOString());\n\t\t\t\t} else {\n\t\t\t\t\temit('error', 'invalid_date_typed');\n\t\t\t\t}\n\t\t\t} else if (event.target.value === '') {\n\t\t\t\temit('update:modelValue', null);\n\t\t\t}\n\t\t}\n\t},\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the calendar so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst onFocusIn = () => {\n\tif (active.value) return;\n\temit('active');\n\tactive.value = true;\n\tdocument.addEventListener('focusin', onDocumentInteraction);\n\tdocument.addEventListener('click', onDocumentInteraction);\n};\n\nconst onDocumentInteraction = (event: FocusEvent) => {\n\tif (trapIsActive.value) return;\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\t!outerContainer.value?.contains(event.target) &&\n\t\t\t!calendar.value?.contains(event.target)\n\t\t) {\n\t\t\tactive.value = false;\n\t\t\temit('inactive');\n\t\t\tdocument.removeEventListener('focusin', onDocumentInteraction);\n\t\t\tdocument.removeEventListener('click', onDocumentInteraction);\n\t\t}\n\t}\n};\n\nconst getStringFromModelValue = (value: typeof props.modelValue) => {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tlet head;\n\t\t\tlet tail;\n\t\t\tif (value.length) head = value[0];\n\t\t\tif (value.length > 1) tail = last(value);\n\t\t\treturn [head, tail]\n\t\t\t\t.filter(identity)\n\t\t\t\t.map((el) => dayjs(el).format('DD/MM/YYYY'))\n\t\t\t\t.join(' - ');\n\t\t} else {\n\t\t\treturn dayjs(value).format('DD/MM/YYYY');\n\t\t}\n\t}\n\treturn null;\n};\n\nconst displayValue = computed(() => {\n\tif (inputValue.value) return inputValue.value;\n\treturn getStringFromModelValue(props.modelValue);\n});\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tinputValue.value = getStringFromModelValue(value);\n\t}\n);\n\nconst { floatingStyles } = useFloating(innerContainer, calendar, {\n\tplacement: 'bottom',\n\twhileElementsMounted: autoUpdate,\n\tmiddleware: [flip(), offset(5), shift()],\n});\n\nconst calendarStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t};\n\tif (!calendar.value) return base;\n\n\treturn base;\n});\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n\thidden.value = false;\n\tshowing.value = true;\n\tawait wait(350);\n\tshowing.value = false;\n\n\thidden.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thiding.value = true;\n\tawait wait(350);\n\thiding.value = false;\n\tshown.value = false;\n\thidden.value = true;\n\tbasedatepicker.value?.setSelectionModeToDay();\n\tbasedatepicker.value?.setCursor(props.modelValue);\n};\n\nconst shouldRenderCalendar = ref(false);\nconst onOpenCalendar = async () => {\n\tshouldRenderCalendar.value = true;\n\tawait waitFor(() => !!calendar.value);\n\tawait open();\n\tactivate();\n};\n\nconst trapIsActive = ref(false);\nconst { activate, deactivate } = useFocusTrap(calendar, {\n\tonActivate: () => (trapIsActive.value = true),\n\t// On post activation focus on current date\n\tonPostActivate: () => {\n\t\tcalendar\n\t\t\t.value!.querySelector<HTMLButtonElement>(\n\t\t\t\t'.bb-base-date-picker-date--current button'\n\t\t\t)\n\t\t\t?.focus();\n\t},\n\tonPostDeactivate: async () => {\n\t\t// Wait for transtion to end and for focus to return before\n\t\tawait wait(200);\n\t\ttrapIsActive.value = false;\n\t},\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tclickOutsideDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tallowOutsideClick: true,\n});\n\nconst shouldOpen = ref(!props.allowWriting || props.range);\nconst onFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tif (shouldOpen.value) onOpenCalendar();\n\tshouldOpen.value = !props.allowWriting || props.range;\n};\n\nconst satisfiesSelection = (value: typeof props.modelValue) => {\n\treturn (\n\t\t(props.range && Array.isArray(value) && value.length === 2) ||\n\t\t(!props.range && !!value)\n\t);\n};\n\n/**\n * These events are just propagated\n */\nconst calendarEventListeners = {\n\t'onUpdate:modelValue': (value: string | string[] | null) => {\n\t\temit('update:modelValue', value);\n\t\tif (satisfiesSelection(value)) {\n\t\t\tshouldOpen.value = false;\n\t\t\tdeactivate({ onPostDeactivate: () => close() });\n\t\t}\n\t},\n};\n\nconst accessibleButtonLabel = computed(() => {\n\tif (props.range) {\n\t\tif (!props.modelValue || props.modelValue.length < 2)\n\t\t\treturn `Seleziona un range`;\n\t\tconst start = dayjs(props.modelValue[0]).format('D MMMM YYYY');\n\t\tconst end = dayjs(props.modelValue[1]).format('D MMMM YYYY');\n\t\tif (props.range && props.modelValue.length === 2)\n\t\t\treturn `Cambia selezione, da ${start} a ${end}`;\n\t} else if (typeof props.modelValue === 'string') {\n\t\tconst selected = dayjs(props.modelValue).format('D MMMM YYYY');\n\t\treturn `Cambia selezione, ${selected}`;\n\t}\n\treturn 'Seleziona una data';\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseDatePickerInput';\n</style>\n"],"names":["dayjs","customParseFormat","it","props","__props","emit","__emit","calendar","ref","outerContainer","innerContainer","input","inputValue","basedatepicker","id","useId","classes","computed","active","eventListeners","event","date","onFocusIn","onDocumentInteraction","trapIsActive","_a","_b","getStringFromModelValue","value","head","tail","last","identity","el","displayValue","watch","floatingStyles","useFloating","autoUpdate","flip","offset","shift","calendarStyles","base","shown","showing","hiding","hidden","open","wait","close","shouldRenderCalendar","onOpenCalendar","waitFor","activate","deactivate","useFocusTrap","shouldOpen","onFocus","satisfiesSelection","calendarEventListeners","accessibleButtonLabel","start","end"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GA,IAAAA,EAAM,OAAOC,EAAiB,GAC9BD,EAAM,OAAOE,EAAE;AAsFf,UAAMC,IAAQC,GAcRC,IAAOC,GAWPC,IAAWC,EAAwB,IAAI,GACvCC,IAAiBD,EAAwB,IAAI,GAC7CE,IAAiBF,EAAwB,IAAI,GAC7CG,IAAQH,EAAwB,IAAI,GACpCI,IAAaJ,EAAmB,IAAI,GACpCK,IAAiBL,KACjBM,IAAKX,EAAM,MAAM,QAAQY,KAAQ,GAAG,KAAK,IAEzCC,IAAUC,EAAS,OAAO;AAAA,MAC/B,6BAA6B;AAAA,MAC7B,qCAAqCC,EAAO;AAAA,MAC5C,qCAAqCf,EAAM;AAAA,MAC3C,uCAAuCA,EAAM;AAAA,MAC7C,uCAAuCA,EAAM;AAAA,IAC5C,EAAA,GAKIgB,IAAiB;AAAA,MACtB,SAAS,CAACC,MAAiB;AAC1B,YAAI,CAAAjB,EAAM,SACNiB,EAAM,kBAAkB;AAE3B,cADWR,EAAA,QAAQQ,EAAM,OAAO,OAC5B,sBAAsB,KAAKA,EAAM,OAAO,KAAK,GAAG;AACnD,kBAAMC,IAAOrB,EAAMoB,EAAM,OAAO,OAAO,YAAY;AACnD,YAAKP,EAAe,MAAM,eAAeQ,CAAI,I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;AAEtC,eAAO,qBADUH,EAAMG,EAAM,UAAU,EAAE,OAAO,aAAa,CACzB;AAE9B,aAAA;AAAA,IAAA,CACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index18.js","sources":["../src/components/BaseDatePickerInput/BaseDatePickerInput.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"outerContainer\"\n\t\tclass=\"bb-base-date-picker-input__container\"\n\t\t:class=\"classes\"\n\t\t@focusin=\"onFocusIn\"\n\t>\n\t\t<slot name=\"prepend-outer\"></slot>\n\t\t<span\n\t\t\tref=\"innerContainer\"\n\t\t\tclass=\"bb-base-date-picker-input__inner-container\"\n\t\t>\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<input\n\t\t\t\t:aria-describedby=\"`bdpi_description_${id}`\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:data-maska=\"props.range ? '##/##/#### - ##/##/####' : '##/##/####'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:id=\"id\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly || range || !allowWriting\"\n\t\t\t\t:type=\"'text'\"\n\t\t\t\t:value=\"displayValue\"\n\t\t\t\tref=\"input\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\tv-maska\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t/>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar-btn\"\n\t\t\t\t:disabled=\"disabled || readonly\"\n\t\t\t\t@click=\"onOpenCalendar\"\n\t\t\t>\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-2 -3 24 24\">\n\t\t\t\t\t<path\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\td=\"M18 7V5a1 1 0 0 0-1-1h-1v1a1 1 0 0 1-2 0V4H6v1a1 1 0 1 1-2 0V4H3a1 1 0 0 0-1 1v2zm0 2H2v6a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1zm-2-7h1a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3h1V1a1 1 0 1 1 2 0v1h8V1a1 1 0 0 1 2 0z\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t\t<span>{{ accessibleButtonLabel }}</span>\n\t\t\t</button>\n\n\t\t\t<slot name=\"append\"></slot>\n\t\t\t<span\n\t\t\t\t:id=\"`bdpi_description_${id}`\"\n\t\t\t\tclass=\"bb-base-date-picker-input__accessible-description\"\n\t\t\t\t>Formato della data\n\t\t\t\t{{ props.range ? 'GG/MM/AAAA - GG/MM/AAAA' : 'GG/MM/AAAA' }}</span\n\t\t\t>\n\t\t</span>\n\t\t<slot name=\"append-outer\"></slot>\n\t\t<teleport to=\"body\" v-if=\"shouldRenderCalendar\">\n\t\t\t<span\n\t\t\t\tref=\"calendar\"\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-date-picker-input__calendar--active': active,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--shown': shown,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--showing': showing,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hiding': hiding,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hidden': hidden,\n\t\t\t\t}\"\n\t\t\t\t:style=\"calendarStyles\"\n\t\t\t>\n\t\t\t\t<BaseDatePicker\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tv-bind=\"calendarEventListeners\"\n\t\t\t\t\tref=\"basedatepicker\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:first-day-of-week=\"firstDayOfWeek\"\n\t\t\t\t\t:max=\"max\"\n\t\t\t\t\t:min=\"min\"\n\t\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t\t:range=\"range\"\n\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t:selectable=\"selectable\"\n\t\t\t\t>\n\t\t\t\t\t<template v-for=\"(_, name) in $slots\" #[name]=\"data\">\n\t\t\t\t\t\t<slot :name=\"name\" v-bind=\"data\" />\n\t\t\t\t\t</template>\n\t\t\t\t</BaseDatePicker>\n\t\t\t</span>\n\t\t</teleport>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { autoUpdate, flip, offset, shift, useFloating } from '@floating-ui/vue';\nimport { computed, ref, watch } from 'vue';\nimport { default as customParseFormat } from 'dayjs/plugin/customParseFormat';\nimport { default as dayjs } from 'dayjs';\nimport { default as it } from 'dayjs/locale/it';\nimport { identity } from '@/utilities/functions/identity';\nimport { last } from '@/utilities/functions/last';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { vMaska } from 'maska';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport BaseDatePicker from '../BaseDatePicker/BaseDatePicker.vue';\nimport type { BaseDatePickerSlots } from '../BaseDatePicker/BaseDatePicker.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\ndayjs.extend(customParseFormat);\ndayjs.locale(it);\n\nexport type BaseDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Defines the first day of the week with `0` meaning Sunday and `6` meaning Saturday\n\t */\n\tfirstDayOfWeek?: (typeof it)['weekStart'];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Maximum selectable date\n\t */\n\tmax?: Date | string | number;\n\n\t/**\n\t * Minimum selectable date\n\t */\n\tmin?: Date | string | number;\n\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | string[] | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Selects a range of dates between two dates. It selects all of the days between start and end\n\t */\n\trange?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Function that accepts a `Date` object and returns a boolean. `false` meaning the date cannot be selected\n\t * @param date\n\t */\n\tselectable?: (date: Date) => boolean;\n\n\t/**\n\t * Width of the calendar\n\t */\n\twidth?: number | string;\n};\n\nconst props = withDefaults(defineProps<BaseDatePickerInputProps>(), {\n\tallowWriting: true,\n\tautocomplete: 'off',\n\twidth: 290,\n});\n\nexport type BaseDatePickerInputEvents = {\n\t(e: 'active'): void;\n\t(e: 'error', message: string): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'update:modelValue', value: BaseDatePickerInputProps['modelValue']): void;\n};\n\nconst emit = defineEmits<BaseDatePickerInputEvents>();\n\ndefineSlots<\n\t{\n\t\t'prepend-outer'?: (props: object) => any;\n\t\tprepend?: (props: object) => any;\n\t\tappend?: (props: object) => any;\n\t\t'append-outer'?: (props: object) => any;\n\t} & BaseDatePickerSlots\n>();\n\nconst calendar = ref<HTMLElement | null>(null);\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst inputValue = ref<string | null>(null);\nconst basedatepicker = ref();\nconst id = props.id || `bdpi_${useId().id.value}`;\n\nconst classes = computed(() => ({\n\t'bb-base-date-picker-input': true,\n\t'bb-base-date-picker-input--active': active.value,\n\t'bb-base-date-picker-input--errors': props.hasErrors,\n\t'bb-base-date-picker-input--readonly': props.readonly,\n\t'bb-base-date-picker-input--disabled': props.disabled,\n}));\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonInput: (event: Event) => {\n\t\tif (props.range) return;\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tinputValue.value = event.target.value;\n\t\t\tif (/\\d{2}\\/\\d{2}\\/\\d{4}/.test(event.target.value)) {\n\t\t\t\tconst date = dayjs(event.target.value, 'DD/MM/YYYY');\n\t\t\t\tif (!basedatepicker.value.isDateDisabled(date)) {\n\t\t\t\t\temit('update:modelValue', date.toISOString());\n\t\t\t\t} else {\n\t\t\t\t\temit('error', 'invalid_date_typed');\n\t\t\t\t}\n\t\t\t} else if (event.target.value === '') {\n\t\t\t\temit('update:modelValue', null);\n\t\t\t}\n\t\t}\n\t},\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the calendar so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst onFocusIn = () => {\n\tif (active.value) return;\n\temit('active');\n\tactive.value = true;\n\tdocument.addEventListener('focusin', onDocumentInteraction);\n\tdocument.addEventListener('click', onDocumentInteraction);\n};\n\nconst onDocumentInteraction = (event: FocusEvent) => {\n\tif (trapIsActive.value) return;\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\t!outerContainer.value?.contains(event.target) &&\n\t\t\t!calendar.value?.contains(event.target)\n\t\t) {\n\t\t\tactive.value = false;\n\t\t\temit('inactive');\n\t\t\tdocument.removeEventListener('focusin', onDocumentInteraction);\n\t\t\tdocument.removeEventListener('click', onDocumentInteraction);\n\t\t}\n\t}\n};\n\nconst getStringFromModelValue = (value: typeof props.modelValue) => {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tlet head;\n\t\t\tlet tail;\n\t\t\tif (value.length) head = value[0];\n\t\t\tif (value.length > 1) tail = last(value);\n\t\t\treturn [head, tail]\n\t\t\t\t.filter(identity)\n\t\t\t\t.map((el) => dayjs(el).format('DD/MM/YYYY'))\n\t\t\t\t.join(' - ');\n\t\t} else {\n\t\t\treturn dayjs(value).format('DD/MM/YYYY');\n\t\t}\n\t}\n\treturn null;\n};\n\nconst displayValue = computed(() => {\n\tif (inputValue.value) return inputValue.value;\n\treturn getStringFromModelValue(props.modelValue);\n});\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tinputValue.value = getStringFromModelValue(value);\n\t}\n);\n\nconst { floatingStyles } = useFloating(innerContainer, calendar, {\n\tplacement: 'bottom',\n\twhileElementsMounted: autoUpdate,\n\tmiddleware: [flip(), offset(5), shift()],\n});\n\nconst calendarStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t};\n\tif (!calendar.value) return base;\n\n\treturn base;\n});\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n\thidden.value = false;\n\tshowing.value = true;\n\tawait wait(350);\n\tshowing.value = false;\n\n\thidden.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thiding.value = true;\n\tawait wait(350);\n\thiding.value = false;\n\tshown.value = false;\n\thidden.value = true;\n\tbasedatepicker.value?.setSelectionModeToDay();\n\tbasedatepicker.value?.setCursor(props.modelValue);\n};\n\nconst shouldRenderCalendar = ref(false);\nconst onOpenCalendar = async () => {\n\tshouldRenderCalendar.value = true;\n\tawait waitFor(() => !!calendar.value);\n\tawait open();\n\tactivate();\n};\n\nconst trapIsActive = ref(false);\nconst { activate, deactivate } = useFocusTrap(calendar, {\n\tonActivate: () => (trapIsActive.value = true),\n\t// On post activation focus on current date\n\tonPostActivate: () => {\n\t\tcalendar\n\t\t\t.value!.querySelector<HTMLButtonElement>(\n\t\t\t\t'.bb-base-date-picker-date--current button'\n\t\t\t)\n\t\t\t?.focus();\n\t},\n\tonPostDeactivate: async () => {\n\t\t// Wait for transtion to end and for focus to return before\n\t\tawait wait(200);\n\t\ttrapIsActive.value = false;\n\t},\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tclickOutsideDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tallowOutsideClick: true,\n});\n\nconst shouldOpen = ref(!props.allowWriting || props.range);\nconst onFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tif (shouldOpen.value) onOpenCalendar();\n\tshouldOpen.value = !props.allowWriting || props.range;\n};\n\nconst satisfiesSelection = (value: typeof props.modelValue) => {\n\treturn (\n\t\t(props.range && Array.isArray(value) && value.length === 2) ||\n\t\t(!props.range && !!value)\n\t);\n};\n\n/**\n * These events are just propagated\n */\nconst calendarEventListeners = {\n\t'onUpdate:modelValue': (value: string | string[] | null) => {\n\t\temit('update:modelValue', value);\n\t\tif (satisfiesSelection(value)) {\n\t\t\tshouldOpen.value = false;\n\t\t\tdeactivate({ onPostDeactivate: () => close() });\n\t\t}\n\t},\n};\n\nconst accessibleButtonLabel = computed(() => {\n\tif (props.range) {\n\t\tif (!props.modelValue || props.modelValue.length < 2)\n\t\t\treturn `Seleziona un range`;\n\t\tconst start = dayjs(props.modelValue[0]).format('D MMMM YYYY');\n\t\tconst end = dayjs(props.modelValue[1]).format('D MMMM YYYY');\n\t\tif (props.range && props.modelValue.length === 2)\n\t\t\treturn `Cambia selezione, da ${start} a ${end}`;\n\t} else if (typeof props.modelValue === 'string') {\n\t\tconst selected = dayjs(props.modelValue).format('D MMMM YYYY');\n\t\treturn `Cambia selezione, ${selected}`;\n\t}\n\treturn 'Seleziona una data';\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseDatePickerInput';\n</style>\n"],"names":["dayjs","customParseFormat","it","props","__props","emit","__emit","calendar","ref","outerContainer","innerContainer","input","inputValue","basedatepicker","id","useId","classes","computed","active","eventListeners","event","date","onFocusIn","onDocumentInteraction","trapIsActive","_a","_b","getStringFromModelValue","value","head","tail","last","identity","el","displayValue","watch","floatingStyles","useFloating","autoUpdate","flip","offset","shift","calendarStyles","base","shown","showing","hiding","hidden","open","wait","close","shouldRenderCalendar","onOpenCalendar","waitFor","activate","deactivate","useFocusTrap","shouldOpen","onFocus","satisfiesSelection","calendarEventListeners","accessibleButtonLabel","start","end"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GA,IAAAA,EAAM,OAAOC,EAAiB,GAC9BD,EAAM,OAAOE,EAAE;AAsFf,UAAMC,IAAQC,GAcRC,IAAOC,GAWPC,IAAWC,EAAwB,IAAI,GACvCC,IAAiBD,EAAwB,IAAI,GAC7CE,IAAiBF,EAAwB,IAAI,GAC7CG,IAAQH,EAAwB,IAAI,GACpCI,IAAaJ,EAAmB,IAAI,GACpCK,IAAiBL,KACjBM,IAAKX,EAAM,MAAM,QAAQY,KAAQ,GAAG,KAAK,IAEzCC,IAAUC,EAAS,OAAO;AAAA,MAC/B,6BAA6B;AAAA,MAC7B,qCAAqCC,EAAO;AAAA,MAC5C,qCAAqCf,EAAM;AAAA,MAC3C,uCAAuCA,EAAM;AAAA,MAC7C,uCAAuCA,EAAM;AAAA,IAC5C,EAAA,GAKIgB,IAAiB;AAAA,MACtB,SAAS,CAACC,MAAiB;AAC1B,YAAI,CAAAjB,EA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