bitboss-ui 0.2.31 → 0.2.32

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 (326) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +6 -6
  2. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +16 -16
  3. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +36 -36
  4. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +20 -20
  5. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +21 -21
  6. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +8 -8
  7. package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +6 -6
  8. package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +20 -20
  9. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +20 -20
  10. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +36 -36
  11. package/dist/components/BaseRating/BaseRating.vue.d.ts +17 -17
  12. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +23 -23
  13. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +15 -15
  14. package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +1 -1
  15. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +20 -20
  16. package/dist/components/BaseTag/BaseTag.vue.d.ts +20 -20
  17. package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +19 -19
  18. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +18 -18
  19. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +3 -3
  20. package/dist/components/BbAlert/BbAlert.vue.d.ts +3 -3
  21. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +8 -8
  22. package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
  23. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +6 -6
  24. package/dist/components/BbButton/BbButton.vue.d.ts +1 -1
  25. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +11 -11
  26. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +27 -27
  27. package/dist/components/BbChip/BbChip.vue.d.ts +2 -2
  28. package/dist/components/BbConfirm/BbConfirm.vue.d.ts +4 -4
  29. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +16 -24
  30. package/dist/components/BbDialog/BbDialog.vue.d.ts +2 -2
  31. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +11 -11
  32. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +14 -14
  33. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +4 -4
  34. package/dist/components/BbIntersection/BbIntersection.vue.d.ts +3 -3
  35. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +10 -10
  36. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +9 -9
  37. package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
  38. package/dist/components/BbPopover/BbPopover.vue.d.ts +8 -8
  39. package/dist/components/BbRadio/BbRadio.vue.d.ts +10 -10
  40. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +27 -27
  41. package/dist/components/BbRating/BbRating.vue.d.ts +10 -10
  42. package/dist/components/BbSelect/BbSelect.vue.d.ts +19 -19
  43. package/dist/components/BbSlider/BbSlider.vue.d.ts +8 -8
  44. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
  45. package/dist/components/BbSpinner/BbSpinner.vue.d.ts +2 -2
  46. package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -2
  47. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +20 -20
  48. package/dist/components/BbTab/BbTab.vue.d.ts +5 -5
  49. package/dist/components/BbTable/BbTable.vue.d.ts +11 -11
  50. package/dist/components/BbTable/types.d.ts +107 -107
  51. package/dist/components/BbTag/BbTag.vue.d.ts +13 -13
  52. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +11 -11
  53. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +10 -10
  54. package/dist/components/BbToast/BbToast.vue.d.ts +1 -1
  55. package/dist/components/BbToast/BbToastMessage.vue.d.ts +1 -1
  56. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +3 -3
  57. package/dist/components/BbTree/BbTree.vue.d.ts +1 -1
  58. package/dist/composables/useConfirm.d.ts +10 -10
  59. package/dist/composables/useOptions.d.ts +2 -2
  60. package/dist/composables/useRoute.d.ts +2 -2
  61. package/dist/composables/useRouter.d.ts +1 -1
  62. package/dist/composables/useToast.d.ts +5 -5
  63. package/dist/composables/useWizard.d.ts +1 -1
  64. package/dist/index.d.ts +126 -126
  65. package/dist/index101.js +32 -37
  66. package/dist/index101.js.map +1 -1
  67. package/dist/index103.js +19 -19
  68. package/dist/index103.js.map +1 -1
  69. package/dist/index105.js +16 -16
  70. package/dist/index105.js.map +1 -1
  71. package/dist/index107.js +15 -15
  72. package/dist/index107.js.map +1 -1
  73. package/dist/index109.js.map +1 -1
  74. package/dist/index11.js +7 -7
  75. package/dist/index11.js.map +1 -1
  76. package/dist/index111.js +16 -16
  77. package/dist/index111.js.map +1 -1
  78. package/dist/index113.js +3 -3
  79. package/dist/index113.js.map +1 -1
  80. package/dist/index115.js +6 -6
  81. package/dist/index115.js.map +1 -1
  82. package/dist/index116.js +1 -1
  83. package/dist/index116.js.map +1 -1
  84. package/dist/index117.js +1 -1
  85. package/dist/index117.js.map +1 -1
  86. package/dist/index118.js +4 -4
  87. package/dist/index118.js.map +1 -1
  88. package/dist/index119.js +5 -5
  89. package/dist/index119.js.map +1 -1
  90. package/dist/index120.js.map +1 -1
  91. package/dist/index121.js.map +1 -1
  92. package/dist/index122.js.map +1 -1
  93. package/dist/index124.js.map +1 -1
  94. package/dist/index125.js +4 -4
  95. package/dist/index125.js.map +1 -1
  96. package/dist/index126.js +1 -1
  97. package/dist/index126.js.map +1 -1
  98. package/dist/index127.js +1 -1
  99. package/dist/index128.js +4 -1
  100. package/dist/index128.js.map +1 -1
  101. package/dist/index129.js.map +1 -1
  102. package/dist/index13.js +11 -11
  103. package/dist/index13.js.map +1 -1
  104. package/dist/index130.js.map +1 -1
  105. package/dist/index131.js +2 -2
  106. package/dist/index15.js +226 -224
  107. package/dist/index15.js.map +1 -1
  108. package/dist/index17.js +61 -62
  109. package/dist/index17.js.map +1 -1
  110. package/dist/index19.js +22 -22
  111. package/dist/index19.js.map +1 -1
  112. package/dist/index196.js.map +1 -1
  113. package/dist/index197.js +2 -5
  114. package/dist/index197.js.map +1 -1
  115. package/dist/index198.js +4 -16
  116. package/dist/index198.js.map +1 -1
  117. package/dist/index199.js +293 -14
  118. package/dist/index199.js.map +1 -1
  119. package/dist/index2.js +23 -23
  120. package/dist/index2.js.map +1 -1
  121. package/dist/index200.js +15 -18
  122. package/dist/index200.js.map +1 -1
  123. package/dist/index201.js +13 -17
  124. package/dist/index201.js.map +1 -1
  125. package/dist/index202.js +18 -28
  126. package/dist/index202.js.map +1 -1
  127. package/dist/index203.js +20 -8
  128. package/dist/index203.js.map +1 -1
  129. package/dist/index204.js +29 -2
  130. package/dist/index204.js.map +1 -1
  131. package/dist/index205.js +8 -378
  132. package/dist/index205.js.map +1 -1
  133. package/dist/index206.js +2 -134
  134. package/dist/index206.js.map +1 -1
  135. package/dist/index207.js +235 -2
  136. package/dist/index207.js.map +1 -1
  137. package/dist/index208.js +3 -174
  138. package/dist/index208.js.map +1 -1
  139. package/dist/index209.js +35 -23
  140. package/dist/index209.js.map +1 -1
  141. package/dist/index21.js +4 -4
  142. package/dist/index21.js.map +1 -1
  143. package/dist/index210.js +6 -373
  144. package/dist/index210.js.map +1 -1
  145. package/dist/index211.js +10 -2
  146. package/dist/index211.js.map +1 -1
  147. package/dist/index212.js +378 -4
  148. package/dist/index212.js.map +1 -1
  149. package/dist/index213.js +134 -3
  150. package/dist/index213.js.map +1 -1
  151. package/dist/index214.js +2 -3
  152. package/dist/index214.js.map +1 -1
  153. package/dist/index215.js +172 -8
  154. package/dist/index215.js.map +1 -1
  155. package/dist/index216.js +23 -3
  156. package/dist/index216.js.map +1 -1
  157. package/dist/index217.js +369 -31
  158. package/dist/index217.js.map +1 -1
  159. package/dist/index218.js +3 -6
  160. package/dist/index218.js.map +1 -1
  161. package/dist/index219.js +3 -2
  162. package/dist/index219.js.map +1 -1
  163. package/dist/index220.js.map +1 -1
  164. package/dist/index221.js +26 -233
  165. package/dist/index221.js.map +1 -1
  166. package/dist/index222.js +16 -8
  167. package/dist/index222.js.map +1 -1
  168. package/dist/index223.js +2 -121
  169. package/dist/index223.js.map +1 -1
  170. package/dist/index224.js +8 -27
  171. package/dist/index224.js.map +1 -1
  172. package/dist/index225.js +120 -12
  173. package/dist/index225.js.map +1 -1
  174. package/dist/index226.js +1 -1
  175. package/dist/index227.js +4 -295
  176. package/dist/index227.js.map +1 -1
  177. package/dist/index228.js +2 -6
  178. package/dist/index228.js.map +1 -1
  179. package/dist/index229.js +6 -2
  180. package/dist/index229.js.map +1 -1
  181. package/dist/index23.js +14 -16
  182. package/dist/index23.js.map +1 -1
  183. package/dist/index230.js +2 -2
  184. package/dist/index235.js +2 -2
  185. package/dist/index236.js +428 -110
  186. package/dist/index236.js.map +1 -1
  187. package/dist/index237.js +88 -105
  188. package/dist/index237.js.map +1 -1
  189. package/dist/index238.js +199 -3
  190. package/dist/index238.js.map +1 -1
  191. package/dist/index239.js +1 -1
  192. package/dist/index240.js +1 -1
  193. package/dist/index241.js +2 -435
  194. package/dist/index241.js.map +1 -1
  195. package/dist/index242.js +115 -87
  196. package/dist/index242.js.map +1 -1
  197. package/dist/index243.js +104 -198
  198. package/dist/index243.js.map +1 -1
  199. package/dist/index244.js +160 -2
  200. package/dist/index244.js.map +1 -1
  201. package/dist/index245.js +2 -2
  202. package/dist/index245.js.map +1 -1
  203. package/dist/index246.js +9 -9
  204. package/dist/index246.js.map +1 -1
  205. package/dist/index247.js +5 -162
  206. package/dist/index247.js.map +1 -1
  207. package/dist/index248.js +1 -1
  208. package/dist/index249.js +37 -14
  209. package/dist/index249.js.map +1 -1
  210. package/dist/index25.js +4 -4
  211. package/dist/index25.js.map +1 -1
  212. package/dist/index250.js +2 -38
  213. package/dist/index250.js.map +1 -1
  214. package/dist/index251.js +2 -2
  215. package/dist/index251.js.map +1 -1
  216. package/dist/index252.js +15 -2
  217. package/dist/index252.js.map +1 -1
  218. package/dist/index253.js +3 -2
  219. package/dist/index253.js.map +1 -1
  220. package/dist/index255.js +2 -3
  221. package/dist/index255.js.map +1 -1
  222. package/dist/index27.js +7 -7
  223. package/dist/index27.js.map +1 -1
  224. package/dist/index29.js +15 -15
  225. package/dist/index29.js.map +1 -1
  226. package/dist/index3.js +2 -1
  227. package/dist/index3.js.map +1 -1
  228. package/dist/index31.js +28 -28
  229. package/dist/index31.js.map +1 -1
  230. package/dist/index33.js +10 -11
  231. package/dist/index33.js.map +1 -1
  232. package/dist/index35.js +2 -2
  233. package/dist/index35.js.map +1 -1
  234. package/dist/index37.js +12 -12
  235. package/dist/index37.js.map +1 -1
  236. package/dist/index39.js +5 -7
  237. package/dist/index39.js.map +1 -1
  238. package/dist/index4.js.map +1 -1
  239. package/dist/index41.js +5 -5
  240. package/dist/index41.js.map +1 -1
  241. package/dist/index43.js +19 -16
  242. package/dist/index43.js.map +1 -1
  243. package/dist/index45.js +9 -9
  244. package/dist/index45.js.map +1 -1
  245. package/dist/index47.js +4 -4
  246. package/dist/index47.js.map +1 -1
  247. package/dist/index49.js +1 -1
  248. package/dist/index49.js.map +1 -1
  249. package/dist/index5.js +7 -6
  250. package/dist/index5.js.map +1 -1
  251. package/dist/index51.js +6 -6
  252. package/dist/index51.js.map +1 -1
  253. package/dist/index53.js.map +1 -1
  254. package/dist/index55.js +20 -20
  255. package/dist/index55.js.map +1 -1
  256. package/dist/index57.js +35 -35
  257. package/dist/index57.js.map +1 -1
  258. package/dist/index59.js +8 -8
  259. package/dist/index59.js.map +1 -1
  260. package/dist/index6.js +38 -38
  261. package/dist/index6.js.map +1 -1
  262. package/dist/index61.js +27 -27
  263. package/dist/index61.js.map +1 -1
  264. package/dist/index63.js +4 -4
  265. package/dist/index63.js.map +1 -1
  266. package/dist/index65.js +20 -20
  267. package/dist/index65.js.map +1 -1
  268. package/dist/index67.js +26 -26
  269. package/dist/index67.js.map +1 -1
  270. package/dist/index69.js +21 -19
  271. package/dist/index69.js.map +1 -1
  272. package/dist/index7.js.map +1 -1
  273. package/dist/index71.js +2 -2
  274. package/dist/index71.js.map +1 -1
  275. package/dist/index72.js +3 -3
  276. package/dist/index72.js.map +1 -1
  277. package/dist/index73.js +14 -14
  278. package/dist/index73.js.map +1 -1
  279. package/dist/index75.js +18 -18
  280. package/dist/index75.js.map +1 -1
  281. package/dist/index77.js +11 -11
  282. package/dist/index77.js.map +1 -1
  283. package/dist/index79.js +15 -15
  284. package/dist/index79.js.map +1 -1
  285. package/dist/index8.js +10 -7
  286. package/dist/index8.js.map +1 -1
  287. package/dist/index81.js.map +1 -1
  288. package/dist/index83.js +20 -20
  289. package/dist/index83.js.map +1 -1
  290. package/dist/index85.js +34 -34
  291. package/dist/index85.js.map +1 -1
  292. package/dist/index87.js +18 -18
  293. package/dist/index87.js.map +1 -1
  294. package/dist/index89.js.map +1 -1
  295. package/dist/index9.js.map +1 -1
  296. package/dist/index91.js +53 -53
  297. package/dist/index91.js.map +1 -1
  298. package/dist/index93.js +16 -16
  299. package/dist/index93.js.map +1 -1
  300. package/dist/index95.js +21 -21
  301. package/dist/index95.js.map +1 -1
  302. package/dist/index97.js +37 -37
  303. package/dist/index97.js.map +1 -1
  304. package/dist/index99.js +18 -18
  305. package/dist/index99.js.map +1 -1
  306. package/dist/style.css +1 -1
  307. package/dist/types/CommonProps.d.ts +18 -18
  308. package/dist/types/ExtractGenericFromComputedRef.d.ts +1 -1
  309. package/dist/types/ExtractGenericFromRef.d.ts +1 -1
  310. package/dist/types/VoidHtmlElements.d.ts +1 -1
  311. package/dist/utilities/functions/cloneDeep.d.ts +1 -1
  312. package/dist/utilities/functions/debounce.d.ts +1 -1
  313. package/dist/utilities/functions/flow.d.ts +1 -1
  314. package/dist/utilities/functions/get.d.ts +1 -1
  315. package/dist/utilities/functions/isNotNil.d.ts +1 -1
  316. package/dist/utilities/functions/mapValues.d.ts +1 -1
  317. package/dist/utilities/functions/merge.d.ts +1 -1
  318. package/dist/utilities/functions/millisecondsTo.d.ts +1 -1
  319. package/dist/utilities/functions/overEvery.d.ts +1 -1
  320. package/dist/utilities/functions/percentage.d.ts +4 -4
  321. package/dist/utilities/functions/pick.d.ts +1 -1
  322. package/dist/utilities/functions/pickBy.d.ts +1 -1
  323. package/dist/utilities/functions/roundToTheNearest.d.ts +1 -1
  324. package/package.json +93 -77
  325. package/dist/index256.js +0 -5
  326. package/dist/index256.js.map +0 -1
package/dist/index57.js CHANGED
@@ -1,9 +1,9 @@
1
- import { defineComponent as m, openBlock as u, createBlock as c, withCtx as a, renderSlot as r, normalizeProps as l, guardReactiveProps as i, createVNode as b, mergeProps as h } from "vue";
1
+ import { defineComponent as m, openBlock as u, createBlock as c, withCtx as a, renderSlot as r, normalizeProps as l, guardReactiveProps as d, createVNode as b, mergeProps as h } from "vue";
2
2
  import g from "./index13.js";
3
3
  import "./index14.js";
4
- import T from "./index21.js";
4
+ import f from "./index21.js";
5
5
  import "./index22.js";
6
- const k = /* @__PURE__ */ m({
6
+ const D = /* @__PURE__ */ m({
7
7
  __name: "BbCheckboxGroup",
8
8
  props: {
9
9
  autofocus: {},
@@ -32,7 +32,7 @@ const k = /* @__PURE__ */ m({
32
32
  legend: {}
33
33
  },
34
34
  emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
35
- setup(f, { emit: s }) {
35
+ setup(y, { emit: s }) {
36
36
  const n = s, t = {
37
37
  onBlur: (e) => n("blur", e),
38
38
  onChange: (e) => n("change", e),
@@ -45,77 +45,77 @@ const k = /* @__PURE__ */ m({
45
45
  onMouseup: (e) => n("mouseup", e),
46
46
  "onUpdate:modelValue": (e) => n("update:modelValue", e)
47
47
  };
48
- return (e, y) => (u(), c(T, {
48
+ return (e, v) => (u(), c(f, {
49
+ id: e.id,
49
50
  class: "bb-checkbox-group",
50
51
  direction: "vertical",
51
52
  errors: e.errors,
52
- hasErrors: e.hasErrors,
53
- hideLabel: e.hideLegend,
54
- id: e.id,
53
+ "has-errors": e.hasErrors,
54
+ "hide-label": e.hideLegend,
55
55
  label: e.legend,
56
- labelTag: "legend",
56
+ "label-tag": "legend",
57
57
  name: e.name,
58
58
  reverse: e.reverse,
59
59
  tag: "fieldset"
60
60
  }, {
61
- label: a((d) => [
62
- r(e.$slots, "legend", l(i(d)))
61
+ label: a((i) => [
62
+ r(e.$slots, "legend", l(d(i)))
63
63
  ]),
64
- input: a(({ id: d, name: p }) => [
64
+ input: a(({ id: i, name: p }) => [
65
65
  b(g, h({
66
+ id: i,
66
67
  autofocus: e.autofocus,
67
68
  color: e.color,
68
69
  dependencies: e.dependencies,
69
- depsDebounceTime: e.depsDebounceTime,
70
+ "deps-debounce-time": e.depsDebounceTime,
70
71
  direction: e.inputDirection,
71
72
  disabled: e.disabled,
72
- enforceCoherence: e.enforceCoherence,
73
- hasErrors: e.hasErrors,
74
- hideLabel: e.hideLabel,
75
- id: d,
73
+ "enforce-coherence": e.enforceCoherence,
74
+ "has-errors": e.hasErrors,
75
+ "hide-label": e.hideLabel,
76
+ "item-text": e.itemText,
77
+ "item-value": e.itemValue,
76
78
  items: e.items,
77
- itemText: e.itemText,
78
- itemValue: e.itemValue,
79
- loadingText: e.loadingText,
80
- matchStrategy: e.matchStrategy,
81
- modelValue: e.modelValue,
82
- modelValueDebounceTime: e.modelValueDebounceTime,
79
+ "loading-text": e.loadingText,
80
+ "match-strategy": e.matchStrategy,
81
+ "model-value": e.modelValue,
82
+ "model-value-debounce-time": e.modelValueDebounceTime,
83
83
  name: p,
84
- noDataText: e.noDataText,
84
+ "no-data-text": e.noDataText,
85
85
  readonly: e.readonly
86
86
  }, t), {
87
87
  prepend: a((o) => [
88
- r(e.$slots, "prepend", l(i(o)))
88
+ r(e.$slots, "prepend", l(d(o)))
89
89
  ]),
90
90
  loading: a((o) => [
91
- r(e.$slots, "loading", l(i(o)))
91
+ r(e.$slots, "loading", l(d(o)))
92
92
  ]),
93
93
  "no-data": a((o) => [
94
- r(e.$slots, "no-data", l(i(o)))
94
+ r(e.$slots, "no-data", l(d(o)))
95
95
  ]),
96
96
  "option:prepend": a((o) => [
97
- r(e.$slots, "option:prepend", l(i(o)))
97
+ r(e.$slots, "option:prepend", l(d(o)))
98
98
  ]),
99
99
  icon: a((o) => [
100
- r(e.$slots, "icon", l(i(o)))
100
+ r(e.$slots, "icon", l(d(o)))
101
101
  ]),
102
102
  label: a((o) => [
103
- r(e.$slots, "label", l(i(o)))
103
+ r(e.$slots, "label", l(d(o)))
104
104
  ]),
105
105
  "option:append": a((o) => [
106
- r(e.$slots, "option:append", l(i(o)))
106
+ r(e.$slots, "option:append", l(d(o)))
107
107
  ]),
108
108
  append: a((o) => [
109
- r(e.$slots, "append", l(i(o)))
109
+ r(e.$slots, "append", l(d(o)))
110
110
  ]),
111
111
  _: 2
112
- }, 1040, ["autofocus", "color", "dependencies", "depsDebounceTime", "direction", "disabled", "enforceCoherence", "hasErrors", "hideLabel", "id", "items", "itemText", "itemValue", "loadingText", "matchStrategy", "modelValue", "modelValueDebounceTime", "name", "noDataText", "readonly"])
112
+ }, 1040, ["id", "autofocus", "color", "dependencies", "deps-debounce-time", "direction", "disabled", "enforce-coherence", "has-errors", "hide-label", "item-text", "item-value", "items", "loading-text", "match-strategy", "model-value", "model-value-debounce-time", "name", "no-data-text", "readonly"])
113
113
  ]),
114
114
  _: 3
115
- }, 8, ["errors", "hasErrors", "hideLabel", "id", "label", "name", "reverse"]));
115
+ }, 8, ["id", "errors", "has-errors", "hide-label", "label", "name", "reverse"]));
116
116
  }
117
117
  });
118
118
  export {
119
- k as default
119
+ D as default
120
120
  };
121
121
  //# sourceMappingURL=index57.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index57.js","sources":["../src/components/BbCheckboxGroup/BbCheckboxGroup.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport BaseCheckboxGroup from \"../BaseCheckboxGroup/BaseCheckboxGroup.vue\";\nimport BaseInputContainer from \"../BaseInputContainer/BaseInputContainer.vue\";\nimport type { BaseCheckboxGroupEvents } from \"../BaseCheckboxGroup/BaseCheckboxGroup.vue\";\nimport type { HTMLAttributes, InputHTMLAttributes } from \"vue\";\nimport type { NestedKeyOf } from \"@/types/NestedKeyOf\";\nimport type { SlotAttributes } from \"../BaseCheckbox/BaseCheckbox.vue\";\n\nexport type BbCheckboxGroupProps<T> = {\n /**\n * Sets autofocus on page load.\n */\n autofocus?: InputHTMLAttributes[\"autofocus\"];\n\n /**\n * Define a color for the component.\n *\n * Either a custom color or a coded color in common HEX, RGB, etc... format.\n */\n color?: string;\n\n /**\n * Defines an array of dependencies that will trigger actions in the component upon change.\n */\n dependencies?: any[];\n\n /**\n * Timeout used to debounce response to changes to dependencies.\n */\n depsDebounceTime?: number;\n /**\n * Disables the component\n */\n disabled?: boolean;\n\n /**\n * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n *\n * e.g. You cannot set v-model to a user that is not present in the items passed.\n *\n * modelValue will be reset upon incoherence.\n */\n enforceCoherence?: boolean;\n\n /**\n * Define if the component should be in an error state.\n * It usually attaches a CSS class for styling purposes.\n */\n hasErrors?: boolean;\n\n /**\n * The identifier of the component.\n */\n id?: HTMLAttributes[\"id\"];\n\n /**\n * Used to retrieve items can be an array or a function.\n */\n items:\n | T[]\n | ((prefill: boolean, modelValue?: any[]) => Promise<T[]>)\n | ((prefill: boolean, modelValue?: any[]) => T[]);\n\n /**\n * Defines a path that returns a property of the object to use as text or a function that returns a string\n */\n itemText?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => string) | undefined;\n\n /**\n * Defines a path that returns a property of the object to use as value or a function that returns any value\n */\n itemValue?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => any) | undefined;\n\n /**\n * String displayed while items are being loaded.\n */\n loadingText?: string;\n\n /**\n * Defines the strategy used to understand whether an option has been selected.\n * `string` is 40% faster but relies on property order.\n * `equality` is more reliable but is slower.\n */\n matchStrategy?: \"string\" | \"equality\";\n\n /**\n * Used by v-model. Can be an array of any serializable type.\n */\n modelValue: any[];\n\n /**\n * Timeout used to debounce response to changes to modelValue.\n */\n modelValueDebounceTime?: number;\n\n /**\n * Defines the name of the input.\n */\n name?: InputHTMLAttributes[\"name\"];\n\n /**\n * String displayed when there are no items to display.\n */\n noDataText?: string;\n\n /**\n * Sets the input in a readonly state.\n */\n readonly?: InputHTMLAttributes[\"readonly\"];\n /**\n * Can be a string or an array of string containing the messages to display.\n */\n errors?: string | string[];\n\n /**\n * Visually hides the label of the input while maintaining accessibility.\n */\n hideLabel?: boolean;\n\n /**\n * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n */\n reverse?: boolean;\n /**\n * Visually hides the legend of the fieldset while maintaining accessibility.\n */\n hideLegend?: boolean;\n\n /**\n * Defines the direction of the inputs in the fieldset\n */\n inputDirection?: \"horizontal\" | \"vertical\";\n\n /**\n * Text content of the legend.\n */\n legend: string;\n\n}\n\nexport type BbCheckboxGroupEvents = BaseCheckboxGroupEvents;\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbCheckboxGroup',\n props: {\n autofocus: {},\n color: {},\n dependencies: {},\n depsDebounceTime: {},\n disabled: { type: Boolean },\n enforceCoherence: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n items: {},\n itemText: {},\n itemValue: {},\n loadingText: {},\n matchStrategy: {},\n modelValue: {},\n modelValueDebounceTime: {},\n name: {},\n noDataText: {},\n readonly: {},\n errors: {},\n hideLabel: { type: Boolean },\n reverse: { type: Boolean },\n hideLegend: { type: Boolean },\n inputDirection: {},\n legend: {}\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"inactive\", \"input\", \"keydown\", \"mousedown\", \"mouseup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\nconst emit = __emit;\n\n\n\nconst eventListeners = {\n onBlur: (event: FocusEvent) => emit(\"blur\", event),\n onChange: (event: Event) => emit(\"change\", event),\n onClick: (event: MouseEvent) => emit(\"click\", event),\n onFocus: (event: FocusEvent) => emit(\"focus\", event),\n onInactive: () => emit(\"inactive\"),\n onInput: (event: Event) => emit(\"input\", event),\n onKeydown: (event: KeyboardEvent) => emit(\"keydown\", event),\n onMousedown: (event: MouseEvent) => emit(\"mousedown\", event),\n onMouseup: (event: MouseEvent) => emit(\"mouseup\", event),\n \"onUpdate:modelValue\": (event: any) => emit(\"update:modelValue\", event),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseInputContainer, {\n class: \"bb-checkbox-group\",\n direction: 'vertical',\n errors: _ctx.errors,\n hasErrors: _ctx.hasErrors,\n hideLabel: _ctx.hideLegend,\n id: _ctx.id,\n label: _ctx.legend,\n labelTag: 'legend',\n name: _ctx.name,\n reverse: _ctx.reverse,\n tag: 'fieldset'\n }, {\n label: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"legend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n input: _withCtx(({ id, name }) => [\n _createVNode(BaseCheckboxGroup, _mergeProps({\n autofocus: _ctx.autofocus,\n color: _ctx.color,\n dependencies: _ctx.dependencies,\n depsDebounceTime: _ctx.depsDebounceTime,\n direction: _ctx.inputDirection,\n disabled: _ctx.disabled,\n enforceCoherence: _ctx.enforceCoherence,\n hasErrors: _ctx.hasErrors,\n hideLabel: _ctx.hideLabel,\n id: id,\n items: _ctx.items,\n itemText: (_ctx.itemText as any),\n itemValue: (_ctx.itemValue as any),\n loadingText: _ctx.loadingText,\n matchStrategy: _ctx.matchStrategy,\n modelValue: _ctx.modelValue,\n modelValueDebounceTime: _ctx.modelValueDebounceTime,\n name: name,\n noDataText: _ctx.noDataText,\n readonly: _ctx.readonly\n }, eventListeners), {\n prepend: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n loading: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"loading\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"no-data\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"no-data\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"option:prepend\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"option:prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n icon: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"icon\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n label: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"label\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"option:append\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"option:append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n append: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n _: 2\n }, 1040, [\"autofocus\", \"color\", \"dependencies\", \"depsDebounceTime\", \"direction\", \"disabled\", \"enforceCoherence\", \"hasErrors\", \"hideLabel\", \"id\", \"items\", \"itemText\", \"itemValue\", \"loadingText\", \"matchStrategy\", \"modelValue\", \"modelValueDebounceTime\", \"name\", \"noDataText\", \"readonly\"])\n ]),\n _: 3\n }, 8, [\"errors\", \"hasErrors\", \"hideLabel\", \"id\", \"label\", \"name\", \"reverse\"]))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","__emit","emit","eventListeners","event","_ctx","_cache","_openBlock","_createBlock","BaseInputContainer","_withCtx","data","_renderSlot","_normalizeProps","_guardReactiveProps","id","name","_createVNode","BaseCheckboxGroup","_mergeProps"],"mappings":";;;;;AAqJA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,WAAW,CAAC;AAAA,IACZ,OAAO,CAAC;AAAA,IACR,cAAc,CAAC;AAAA,IACf,kBAAkB,CAAC;AAAA,IACnB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,kBAAkB,EAAE,MAAM,QAAQ;AAAA,IAClC,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,OAAO,CAAC;AAAA,IACR,UAAU,CAAC;AAAA,IACX,WAAW,CAAC;AAAA,IACZ,aAAa,CAAC;AAAA,IACd,eAAe,CAAC;AAAA,IAChB,YAAY,CAAC;AAAA,IACb,wBAAwB,CAAC;AAAA,IACzB,MAAM,CAAC;AAAA,IACP,YAAY,CAAC;AAAA,IACb,UAAU,CAAC;AAAA,IACX,QAAQ,CAAC;AAAA,IACT,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,SAAS,EAAE,MAAM,QAAQ;AAAA,IACzB,YAAY,EAAE,MAAM,QAAQ;AAAA,IAC5B,gBAAgB,CAAC;AAAA,IACjB,QAAQ,CAAC;AAAA,EACX;AAAA,EACA,OAAO,CAAC,QAAQ,UAAU,SAAS,SAAS,YAAY,SAAS,WAAW,aAAa,WAAW,mBAAmB;AAAA,EACvH,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAIxC,UAAMC,IAAOD,GAIPE,IAAiB;AAAA,MACrB,QAAQ,CAACC,MAAsBF,EAAK,QAAQE,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBF,EAAK,UAAUE,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBF,EAAK,SAASE,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBF,EAAK,SAASE,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E;AAAA,UACD,GAAG;AAAA,QACL,GAAG,MAAM,CAAC,aAAa,SAAS,gBAAgB,oBAAoB,aAAa,YAAY,oBAAoB,aAAa,aAAa,MAAM,SAAS,YAAY,aAAa,eAAe,iBAAiB,cAAc,0BAA0B,QAAQ,cAAc,UAAU,CAAC;AAAA,MAAA,CAC7R;AAAA,MACD,GAAG;AAAA,IAAA,GACF,GAAG,CAAC,UAAU,aAAa,aAAa,MAAM,SAAS,QAAQ,SAAS,CAAC;AAAA,EAE9E;AAEA,CAAC;"}
1
+ {"version":3,"file":"index57.js","sources":["../src/components/BbCheckboxGroup/BbCheckboxGroup.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport BaseCheckboxGroup from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type { BaseCheckboxGroupEvents } from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BbCheckboxGroupProps<T> = {\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\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 * 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\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\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 * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\t/**\n\t * Visually hides the legend of the fieldset while maintaining accessibility.\n\t */\n\thideLegend?: boolean;\n\n\t/**\n\t * Defines the direction of the inputs in the fieldset\n\t */\n\tinputDirection?: 'horizontal' | 'vertical';\n\n\t/**\n\t * Text content of the legend.\n\t */\n\tlegend: string;\n};\n\nexport type BbCheckboxGroupEvents = BaseCheckboxGroupEvents;\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbCheckboxGroup',\n props: {\n autofocus: {},\n color: {},\n dependencies: {},\n depsDebounceTime: {},\n disabled: { type: Boolean },\n enforceCoherence: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n items: {},\n itemText: {},\n itemValue: {},\n loadingText: {},\n matchStrategy: {},\n modelValue: {},\n modelValueDebounceTime: {},\n name: {},\n noDataText: {},\n readonly: {},\n errors: {},\n hideLabel: { type: Boolean },\n reverse: { type: Boolean },\n hideLegend: { type: Boolean },\n inputDirection: {},\n legend: {}\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"inactive\", \"input\", \"keydown\", \"mousedown\", \"mouseup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\nconst emit = __emit;\n\n\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonInactive: () => emit('inactive'),\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\t'onUpdate:modelValue': (event: any) => emit('update:modelValue', event),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseInputContainer, {\n id: _ctx.id,\n class: \"bb-checkbox-group\",\n direction: 'vertical',\n errors: _ctx.errors,\n \"has-errors\": _ctx.hasErrors,\n \"hide-label\": _ctx.hideLegend,\n label: _ctx.legend,\n \"label-tag\": 'legend',\n name: _ctx.name,\n reverse: _ctx.reverse,\n tag: 'fieldset'\n }, {\n label: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"legend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n input: _withCtx(({ id, name }) => [\n _createVNode(BaseCheckboxGroup, _mergeProps({\n id: id,\n autofocus: _ctx.autofocus,\n color: _ctx.color,\n dependencies: _ctx.dependencies,\n \"deps-debounce-time\": _ctx.depsDebounceTime,\n direction: _ctx.inputDirection,\n disabled: _ctx.disabled,\n \"enforce-coherence\": _ctx.enforceCoherence,\n \"has-errors\": _ctx.hasErrors,\n \"hide-label\": _ctx.hideLabel,\n \"item-text\": _ctx.itemText as any,\n \"item-value\": _ctx.itemValue as any,\n items: _ctx.items,\n \"loading-text\": _ctx.loadingText,\n \"match-strategy\": _ctx.matchStrategy,\n \"model-value\": _ctx.modelValue,\n \"model-value-debounce-time\": _ctx.modelValueDebounceTime,\n name: name,\n \"no-data-text\": _ctx.noDataText,\n readonly: _ctx.readonly\n }, eventListeners), {\n prepend: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n loading: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"loading\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"no-data\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"no-data\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"option:prepend\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"option:prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n icon: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"icon\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n label: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"label\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"option:append\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"option:append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n append: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n _: 2\n }, 1040, [\"id\", \"autofocus\", \"color\", \"dependencies\", \"deps-debounce-time\", \"direction\", \"disabled\", \"enforce-coherence\", \"has-errors\", \"hide-label\", \"item-text\", \"item-value\", \"items\", \"loading-text\", \"match-strategy\", \"model-value\", \"model-value-debounce-time\", \"name\", \"no-data-text\", \"readonly\"])\n ]),\n _: 3\n }, 8, [\"id\", \"errors\", \"has-errors\", \"hide-label\", \"label\", \"name\", \"reverse\"]))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","__emit","emit","eventListeners","event","_ctx","_cache","_openBlock","_createBlock","BaseInputContainer","_withCtx","data","_renderSlot","_normalizeProps","_guardReactiveProps","id","name","_createVNode","BaseCheckboxGroup","_mergeProps"],"mappings":";;;;;AAoJA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,WAAW,CAAC;AAAA,IACZ,OAAO,CAAC;AAAA,IACR,cAAc,CAAC;AAAA,IACf,kBAAkB,CAAC;AAAA,IACnB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,kBAAkB,EAAE,MAAM,QAAQ;AAAA,IAClC,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,OAAO,CAAC;AAAA,IACR,UAAU,CAAC;AAAA,IACX,WAAW,CAAC;AAAA,IACZ,aAAa,CAAC;AAAA,IACd,eAAe,CAAC;AAAA,IAChB,YAAY,CAAC;AAAA,IACb,wBAAwB,CAAC;AAAA,IACzB,MAAM,CAAC;AAAA,IACP,YAAY,CAAC;AAAA,IACb,UAAU,CAAC;AAAA,I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BH,CAAI,CAAC,CAAC;AAAA,UAAA,CACtF;AAAA,UACD,MAAMD,EAAS,CAACC,MAAS;AAAA,YACvBC,EAAYP,EAAK,QAAQ,QAAQQ,EAAgBC,EAAoBH,CAAI,CAAC,CAAC;AAAA,UAAA,CAC5E;AAAA,UACD,OAAOD,EAAS,CAACC,MAAS;AAAA,YACxBC,EAAYP,EAAK,QAAQ,SAASQ,EAAgBC,EAAoBH,CAAI,CAAC,CAAC;AAAA,UAAA,CAC7E;AAAA,UACD,iBAAiBD,EAAS,CAACC,MAAS;AAAA,YAClCC,EAAYP,EAAK,QAAQ,iBAAiBQ,EAAgBC,EAAoBH,CAAI,CAAC,CAAC;AAAA,UAAA,CACrF;AAAA,UACD,QAAQD,EAAS,CAACC,MAAS;AAAA,YACzBC,EAAYP,EAAK,QAAQ,UAAUQ,EAAgBC,EAAoBH,CAAI,CAAC,CAAC;AAAA,UAAA,CAC9E;AAAA,UACD,GAAG;AAAA,QACL,GAAG,MAAM,CAAC,MAAM,aAAa,SAAS,gBAAgB,sBAAsB,aAAa,YAAY,qBAAqB,cAAc,cAAc,aAAa,cAAc,SAAS,gBAAgB,kBAAkB,eAAe,6BAA6B,QAAQ,gBAAgB,UAAU,CAAC;AAAA,MAAA,CAC5S;AAAA,MACD,GAAG;AAAA,IAAA,GACF,GAAG,CAAC,MAAM,UAAU,cAAc,cAAc,SAAS,QAAQ,SAAS,CAAC;AAAA,EAEhF;AAEA,CAAC;"}
package/dist/index59.js CHANGED
@@ -46,17 +46,17 @@ const N = {
46
46
  name: "footer",
47
47
  fn: s((a) => [
48
48
  d(t.$slots, "footer", z({
49
- loading: e(o).loading,
50
49
  actions: e(o).actions,
51
- yes: e(o).yes,
50
+ loading: e(o).loading,
52
51
  no: e(o).no,
53
- yesAction: r.value,
54
- noAction: i.value
52
+ noAction: i.value,
53
+ yes: e(o).yes,
54
+ yesAction: r.value
55
55
  }, a), () => [
56
56
  e(o).no ? (n(), l(v, {
57
57
  key: 0,
58
- onClick: i.value.handler,
59
- class: "bb-confirm__no"
58
+ class: "bb-confirm__no",
59
+ onClick: i.value.handler
60
60
  }, {
61
61
  default: s(() => [
62
62
  u(c(i.value.text), 1)
@@ -65,8 +65,8 @@ const N = {
65
65
  }, 8, ["onClick"])) : m("", !0),
66
66
  e(o).yes ? (n(), l(v, {
67
67
  key: 1,
68
- onClick: r.value.handler,
69
- class: "bb-confirm__yes"
68
+ class: "bb-confirm__yes",
69
+ onClick: r.value.handler
70
70
  }, {
71
71
  default: s(() => [
72
72
  u(c(r.value.text), 1)
@@ -1 +1 @@
1
- {"version":3,"file":"index59.js","sources":["../src/components/BbConfirm/BbConfirm.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, createElementVNode as _createElementVNode, mergeProps as _mergeProps, createTextVNode as _createTextVNode, withCtx as _withCtx, createBlock as _createBlock, renderList as _renderList, createSlots as _createSlots } from \"vue\"\n\nconst _hoisted_1 = {\n key: 0,\n class: \"bb-confirm__content\"\n}\nconst _hoisted_2 = {\n key: 0,\n class: \"bb-confirm__text\"\n}\nconst _hoisted_3 = { class: \"bb-confirm__spinner\" }\n\nimport { actions, state } from \"@/composables/useConfirm\";\nimport { computed } from \"vue\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport BaseDialog from \"../BaseDialog/BaseDialog.vue\";\nimport BbSpinner from \"../BbSpinner/BbSpinner.vue\";\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbConfirm',\n setup(__props) {\n\nconst noAction = computed(() => actions.value[0]);\nconst yesAction = computed(() => actions.value[1]);\nconst onModelValueUpdate = (value: boolean) => {\n if (value) yesAction.value.handler();\n else noAction.value.handler();\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseDialog, {\n \"model-value\": _unref(state).open || _unref(state).loading,\n \"overlay-classes\": ['bb-confirm', `bb-confirm--${_unref(state).theme}`],\n size: _unref(state).size,\n title: _unref(state).title,\n \"onUpdate:modelValue\": onModelValueUpdate\n }, _createSlots({\n default: _withCtx(() => [\n (!_unref(state).loading)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(state).text)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_unref(state).text), 1))\n : _createCommentVNode(\"\", true)\n ]))\n : _renderSlot(_ctx.$slots, \"spinner\", { key: 1 }, () => [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(BbSpinner, { size: \"60\" })\n ])\n ])\n ]),\n _: 2\n }, [\n _renderList(['header', 'title', 'close', 'description'], (name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n }),\n (!_unref(state).loading && _unref(state).actions)\n ? {\n name: \"footer\",\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"footer\", _mergeProps({\n loading: _unref(state).loading,\n actions: _unref(state).actions,\n yes: _unref(state).yes,\n no: _unref(state).no,\n yesAction: yesAction.value,\n noAction: noAction.value\n }, data), () => [\n (_unref(state).no)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n onClick: noAction.value.handler,\n class: \"bb-confirm__no\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(noAction.value.text), 1)\n ]),\n _: 1\n }, 8, [\"onClick\"]))\n : _createCommentVNode(\"\", true),\n (_unref(state).yes)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 1,\n onClick: yesAction.value.handler,\n class: \"bb-confirm__yes\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(yesAction.value.text), 1)\n ]),\n _: 1\n }, 8, [\"onClick\"]))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n key: \"0\"\n }\n : undefined\n ]), 1032, [\"model-value\", \"overlay-classes\", \"size\", \"title\"]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_sfc_main","_defineComponent","__props","noAction","computed","actions","yesAction","onModelValueUpdate","value","_ctx","_cache","_openBlock","_createBlock","BaseDialog","_unref","state","_createSlots","_withCtx","_renderSlot","_createElementVNode","_createVNode","BbSpinner","_createElementBlock","_toDisplayString","_createCommentVNode","_renderList","name","data","_normalizeProps","_guardReactiveProps","_mergeProps","BaseButton","_createTextVNode"],"mappings":";;;;;;;;AAGA,MAAMA,IAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,IAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,IAAa,EAAE,OAAO,yBASAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,MAAMC,GAAS;AAEjB,UAAMC,IAAWC,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC1CC,IAAYF,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC3CE,IAAqB,CAACC,MAAmB;AACzC,MAAAA,IAAOF,EAAU,MAAM,YACtBH,EAAS,MAAM;IAAQ;AAGvB,WAAA,CAACM,GAAUC,OACRC,EAAA,GAAcC,EAAaC,GAAY;AAAA,MAC7C,eAAeC,EAAOC,CAAK,EAAE,QAAQD,EAAOC,CAAK,EAAE;AAAA,MACnD,mBAAmB,CAAC,cAAc,eAAeD,EAAOC,CAAK,EAAE,KAAK,EAAE;AAAA,MACtE,MAAMD,EAAOC,CAAK,EAAE;AAAA,MACpB,OAAOD,EAAOC,CAAK,EAAE;AAAA,MACrB,uBAAuBR;AAAA,OACtBS,EAAa;AAAA,MACd,SAASC,EAAS,MAAM;AAAA,QACpBH,EAAOC,CAAK,EAAE,UAMZG,EAAYT,EAAK,QAAQ,WAAW,EAAE,KAAK,EAAE,GAAG,MAAM;AAA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AS,MAAM,IAAI,GAAG,CAAC;AAAA,cAAA,CAC1D;AAAA,cACD,GAAG;AAAA,YAAA,GACF,GAAG,CAAC,SAAS,CAAC,KACjBqB,EAAoB,IAAI,EAAI;AAAA,YAC/BV,EAAOC,CAAK,EAAE,OACVJ,EAAW,GAAGC,EAAamB,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,SAASzB,EAAU,MAAM;AAAA,cACzB,OAAO;AAAA,YAAA,GACN;AAAA,cACD,SAASW,EAAS,MAAM;AAAA,gBACtBe,EAAiBT,EAAiBjB,EAAU,MAAM,IAAI,GAAG,CAAC;AAAA,cAAA,CAC3D;AAAA,cACD,GAAG;AAAA,YAAA,GACF,GAAG,CAAC,SAAS,CAAC,KACjBkB,EAAoB,IAAI,EAAI;AAAA,UAAA,CACjC;AAAA,QAAA,CACF;AAAA,QACD,KAAK;AAAA,MAEP,IAAA;AAAA,IAAA,CACL,GAAG,MAAM,CAAC,eAAe,mBAAmB,QAAQ,OAAO,CAAC;AAAA,EAE/D;AAEA,CAAC;"}
1
+ {"version":3,"file":"index59.js","sources":["../src/components/BbConfirm/BbConfirm.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, createElementVNode as _createElementVNode, mergeProps as _mergeProps, createTextVNode as _createTextVNode, withCtx as _withCtx, createBlock as _createBlock, renderList as _renderList, createSlots as _createSlots } from \"vue\"\n\nconst _hoisted_1 = {\n key: 0,\n class: \"bb-confirm__content\"\n}\nconst _hoisted_2 = {\n key: 0,\n class: \"bb-confirm__text\"\n}\nconst _hoisted_3 = { class: \"bb-confirm__spinner\" }\n\nimport { actions, state } from '@/composables/useConfirm';\nimport { computed } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BaseDialog from '../BaseDialog/BaseDialog.vue';\nimport BbSpinner from '../BbSpinner/BbSpinner.vue';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbConfirm',\n setup(__props) {\n\nconst noAction = computed(() => actions.value[0]);\nconst yesAction = computed(() => actions.value[1]);\nconst onModelValueUpdate = (value: boolean) => {\n\tif (value) yesAction.value.handler();\n\telse noAction.value.handler();\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseDialog, {\n \"model-value\": _unref(state).open || _unref(state).loading,\n \"overlay-classes\": ['bb-confirm', `bb-confirm--${_unref(state).theme}`],\n size: _unref(state).size,\n title: _unref(state).title,\n \"onUpdate:modelValue\": onModelValueUpdate\n }, _createSlots({\n default: _withCtx(() => [\n (!_unref(state).loading)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(state).text)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_unref(state).text), 1))\n : _createCommentVNode(\"\", true)\n ]))\n : _renderSlot(_ctx.$slots, \"spinner\", { key: 1 }, () => [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(BbSpinner, { size: \"60\" })\n ])\n ])\n ]),\n _: 2\n }, [\n _renderList(['header', 'title', 'close', 'description'], (name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n }),\n (!_unref(state).loading && _unref(state).actions)\n ? {\n name: \"footer\",\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"footer\", _mergeProps({\n actions: _unref(state).actions,\n loading: _unref(state).loading,\n no: _unref(state).no,\n noAction: noAction.value,\n yes: _unref(state).yes,\n yesAction: yesAction.value\n }, data), () => [\n (_unref(state).no)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n class: \"bb-confirm__no\",\n onClick: noAction.value.handler\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(noAction.value.text), 1)\n ]),\n _: 1\n }, 8, [\"onClick\"]))\n : _createCommentVNode(\"\", true),\n (_unref(state).yes)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 1,\n class: \"bb-confirm__yes\",\n onClick: yesAction.value.handler\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(yesAction.value.text), 1)\n ]),\n _: 1\n }, 8, [\"onClick\"]))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n key: \"0\"\n }\n : undefined\n ]), 1032, [\"model-value\", \"overlay-classes\", \"size\", \"title\"]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_sfc_main","_defineComponent","__props","noAction","computed","actions","yesAction","onModelValueUpdate","value","_ctx","_cache","_openBlock","_createBlock","BaseDialog","_unref","state","_createSlots","_withCtx","_renderSlot","_createElementVNode","_createVNode","BbSpinner","_createElementBlock","_toDisplayString","_createCommentVNode","_renderList","name","data","_normalizeProps","_guardReactiveProps","_mergeProps","BaseButton","_createTextVNode"],"mappings":";;;;;;;;AAGA,MAAMA,IAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,IAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,IAAa,EAAE,OAAO,yBASAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,MAAMC,GAAS;AAEjB,UAAMC,IAAWC,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC1CC,IAAYF,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC3CE,IAAqB,CAACC,MAAmB;AAC1C,MAAAA,IAAOF,EAAU,MAAM,YACtBH,EAAS,MAAM;IAAQ;AAGtB,WAAA,CAACM,GAAUC,OACRC,EAAA,GAAcC,EAAaC,GAAY;AAAA,MAC7C,eAAeC,EAAOC,CAAK,EAAE,QAAQD,EAAOC,CAAK,EAAE;AAAA,MACnD,mBAAmB,CAAC,cAAc,eAA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EAAE;AAAA,YACnB,WAAWT,EAAU;AAAA,UAAA,GACpBqB,CAAI,GAAG,MAAM;AAAA,YACbb,EAAOC,CAAK,EAAE,MACVJ,EAAW,GAAGC,EAAamB,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,OAAO;AAAA,cACP,SAAS5B,EAAS,MAAM;AAAA,YAAA,GACvB;AAAA,cACD,SAASc,EAAS,MAAM;AAAA,gBACtBe,EAAiBT,EAAiBpB,EAAS,MAAM,IAAI,GAAG,CAAC;AAAA,cAAA,CAC1D;AAAA,cACD,GAAG;AAAA,YAAA,GACF,GAAG,CAAC,SAAS,CAAC,KACjBqB,EAAoB,IAAI,EAAI;AAAA,YAC/BV,EAAOC,CAAK,EAAE,OACVJ,EAAW,GAAGC,EAAamB,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,OAAO;AAAA,cACP,SAASzB,EAAU,MAAM;AAAA,YAAA,GACxB;AAAA,cACD,SAASW,EAAS,MAAM;AAAA,gBACtBe,EAAiBT,EAAiBjB,EAAU,MAAM,IAAI,GAAG,CAAC;AAAA,cAAA,CAC3D;AAAA,cACD,GAAG;AAAA,YAAA,GACF,GAAG,CAAC,SAAS,CAAC,KACjBkB,EAAoB,IAAI,EAAI;AAAA,UAAA,CACjC;AAAA,QAAA,CACF;AAAA,QACD,KAAK;AAAA,MAEP,IAAA;AAAA,IAAA,CACL,GAAG,MAAM,CAAC,eAAe,mBAAmB,QAAQ,OAAO,CAAC;AAAA,EAE/D;AAEA,CAAC;"}
package/dist/index6.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ref as _, computed as T, watch as h } from "vue";
2
2
  import { deepEqual as j } from "./index123.js";
3
- import { isNotNil as f } from "./index124.js";
3
+ import { isNotNil as o } from "./index124.js";
4
4
  import { useItemText as D } from "./index125.js";
5
5
  import { useItemValue as G } from "./index126.js";
6
6
  const U = ({
@@ -11,21 +11,21 @@ const U = ({
11
11
  /** Boolean, flag if the component is disabled, as a whole */
12
12
  disabled: g,
13
13
  /** Function used to emit update:modelValue */
14
- emitter: s,
14
+ emitter: l,
15
15
  /** Flag to enforce coherence between the items and modelValue. If `enforceCoherence` is active whenever a change made to props would result in a modelValue that is not present among the selectable items, it will be reset */
16
- enforceCoherence: i,
16
+ enforceCoherence: f,
17
17
  /** ID of the component */
18
18
  id: E,
19
19
  /** Flag to trigger immediate search for the items on first load. If set to false items are not retrieved until a change to props happens or getOptions is called */
20
20
  immediate: S,
21
21
  /** Items from which to compute options */
22
- initialItems: o,
22
+ initialItems: i,
23
23
  /** Transformer to obtain a text label for the item */
24
24
  itemText: k,
25
25
  /** Transformer to obtain a value for the option */
26
26
  itemValue: B,
27
27
  /** Strategy used to identify unique objects in the component */
28
- matchStrategy: c,
28
+ matchStrategy: d,
29
29
  /** modelValue of the component */
30
30
  modelValue: u,
31
31
  /** Time the component will wait before triggering a response from changed modelValue */
@@ -34,23 +34,23 @@ const U = ({
34
34
  }) => {
35
35
  const y = _(0), A = _([]), v = async ({ prefill: e = !1 }) => {
36
36
  let t = [];
37
- Array.isArray(o.value) ? t = o.value : typeof o.value == "function" && (y.value++, t = await o.value(e, u.value), y.value--), A.value = t;
37
+ Array.isArray(i.value) ? t = i.value : typeof i.value == "function" && (y.value++, t = await i.value(e, u.value), y.value--), A.value = t;
38
38
  }, { getItemText: R } = D(), { getItemValue: W } = G(), w = T(() => A.value.map((e, t) => {
39
39
  const n = R(e, k), r = W(e, B);
40
40
  if (r === void 0)
41
41
  throw new Error(
42
42
  'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(e) + " please check itemValue property is correct."
43
43
  );
44
- const a = JSON.stringify(r), d = e, I = !!(g != null && g.value || e != null && e.disabled);
44
+ const s = JSON.stringify(r), c = e, I = !!(g != null && g.value || e != null && e.disabled);
45
45
  let x;
46
- (E || e != null && e.id) && (x = [E, f(e == null ? void 0 : e.id) ? e.id : a.replace(/\W/g, "_")].filter(f).join("_"));
46
+ (E || e != null && e.id) && (x = [E, o(e == null ? void 0 : e.id) ? e.id : s.replace(/\W/g, "_")].filter(o).join("_"));
47
47
  const J = z.value.get(r);
48
- return f(J) ? {
48
+ return o(J) ? {
49
49
  disabled: I,
50
50
  id: x,
51
51
  index: t,
52
- jsonValue: a,
53
- original: d,
52
+ jsonValue: s,
53
+ original: c,
54
54
  selected: !0,
55
55
  selectedIndex: J,
56
56
  text: n,
@@ -59,24 +59,24 @@ const U = ({
59
59
  disabled: I,
60
60
  id: x,
61
61
  index: t,
62
- jsonValue: a,
63
- original: d,
62
+ jsonValue: s,
63
+ original: c,
64
64
  selected: !1,
65
65
  selectedIndex: J,
66
66
  text: n,
67
67
  value: r
68
68
  };
69
- })), l = T(() => {
70
- if (c === "string") {
71
- let e = w.value.reduce(
69
+ })), a = T(() => {
70
+ if (d === "string") {
71
+ const e = w.value.reduce(
72
72
  (t, n) => (t[n.jsonValue] = n, t),
73
73
  {}
74
74
  );
75
75
  return {
76
76
  get: (t) => e[JSON.stringify(t)]
77
77
  };
78
- } else if (c === "equality") {
79
- let e = w.value.map((t) => [
78
+ } else if (d === "equality") {
79
+ const e = w.value.map((t) => [
80
80
  t.value,
81
81
  t
82
82
  ]);
@@ -89,14 +89,14 @@ const U = ({
89
89
  } else
90
90
  throw new Error("No match strategy has been defined");
91
91
  }), z = T(() => {
92
- if (c === "string") {
93
- let e = {};
92
+ if (d === "string") {
93
+ const e = {};
94
94
  return [].concat(u.value).forEach((t, n) => {
95
95
  e[JSON.stringify(t)] = n;
96
96
  }), {
97
97
  get: (t) => e[JSON.stringify(t)]
98
98
  };
99
- } else if (c === "equality") {
99
+ } else if (d === "equality") {
100
100
  const e = [].concat(u.value).map((t, n) => [t, n]);
101
101
  return {
102
102
  get: (t) => {
@@ -117,17 +117,17 @@ const U = ({
117
117
  if (!Array.isArray(u.value))
118
118
  throw new Error("Passed modelValue is not an array.");
119
119
  let n = u.value.every(
120
- (r) => l.value.get(r)
120
+ (r) => a.value.get(r)
121
121
  );
122
122
  if ((!n || t === void 0) && (await v({ prefill: !0 }), n = u.value.every(
123
- (r) => l.value.get(r)
123
+ (r) => a.value.get(r)
124
124
  )), !n) {
125
- const r = e.filter((a) => l.value.get(a));
126
- i.value && s(r);
125
+ const r = e.filter((s) => a.value.get(s));
126
+ f.value && l(r);
127
127
  }
128
128
  } else {
129
- let n = l.value.get(u.value);
130
- (!n && f(u.value) || t === void 0) && await v({ prefill: !0 }), n = l.value.get(u.value), n || i.value && f(e) && s(null);
129
+ let n = a.value.get(u.value);
130
+ (!n && o(u.value) || t === void 0) && await v({ prefill: !0 }), n = a.value.get(u.value), n || f.value && o(e) && l(null);
131
131
  }
132
132
  },
133
133
  F || !S ? P : 0
@@ -135,18 +135,18 @@ const U = ({
135
135
  },
136
136
  // Immediate here triggers first search for items
137
137
  { immediate: S, deep: !0 }
138
- ), h(o, async (e, t) => {
138
+ ), h(i, async (e, t) => {
139
139
  if (typeof e == "function" || // Circumvent arrays defined in the template by the parent
140
140
  JSON.stringify(e) !== JSON.stringify(t))
141
141
  if (await v({ prefill: !0 }), p) {
142
142
  if (!u.value.every(
143
- (r) => l.value.get(r)
144
- ) && i) {
145
- const r = u.value.filter((a) => l.value.get(a));
146
- s(r);
143
+ (r) => a.value.get(r)
144
+ ) && f) {
145
+ const r = u.value.filter((s) => a.value.get(s));
146
+ l(r);
147
147
  }
148
148
  } else
149
- !l.value.get(u.value) && i && f(u.value) && s(null);
149
+ !a.value.get(u.value) && f && o(u.value) && l(null);
150
150
  });
151
151
  let O;
152
152
  return h(
@@ -155,13 +155,13 @@ const U = ({
155
155
  JSON.stringify(e) !== JSON.stringify(t) && (O && clearTimeout(O), O = setTimeout(async () => {
156
156
  if (await v({ prefill: !0 }), p) {
157
157
  if (!u.value.every(
158
- (r) => l.value.get(r)
159
- ) && i) {
160
- const r = u.value.filter((a) => l.value.get(a));
161
- s(r);
158
+ (r) => a.value.get(r)
159
+ ) && f) {
160
+ const r = u.value.filter((s) => a.value.get(s));
161
+ l(r);
162
162
  }
163
163
  } else
164
- !l.value.get(u.value) && i && f(u.value) && s(null);
164
+ !a.value.get(u.value) && f && o(u.value) && l(null);
165
165
  }, b));
166
166
  },
167
167
  { deep: !0 }
@@ -1 +1 @@
1
- {"version":3,"file":"index6.js","sources":["../src/composables/useOptions.ts"],"sourcesContent":["import { computed, ref, watch } from \"vue\";\nimport { deepEqual } from \"fast-equals\";\nimport { isNotNil } from \"@/utilities/functions/isNotNil\";\nimport { useItemText } from \"@/composables/useItemText\";\nimport { useItemValue } from \"@/composables/useItemValue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\nimport type { Ref } from \"vue\";\n\nexport type BaseOption = {\n disabled?: boolean;\n id?: string;\n jsonValue: string;\n name?: string;\n original: any;\n readonly?: boolean;\n text: string;\n value: any;\n};\n\nexport type Option = BaseOption & { index: number } & (\n | {\n selected: true;\n selectedIndex: number;\n }\n | {\n selected: false;\n selectedIndex: undefined;\n }\n );\n\ntype Params = {\n dependencies: Ref<any[] | undefined>;\n depsDebounceTime: number;\n disabled?: Ref<boolean>;\n emitter: (...args: any[]) => any;\n enforceCoherence: Ref<boolean>;\n id?: string;\n immediate: boolean;\n initialItems: Ref<\n | any[]\n | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>)\n | ((prefill: boolean, modelValue?: any[]) => any[])\n >;\n itemText?: string | ((item: any) => string);\n itemValue?: string | ((item: any) => any);\n matchStrategy: Exclude<CommonProps[\"matchStrategy\"], undefined>;\n modelValue: Ref<any>;\n modelValueDebounceTime: number;\n multiple?: boolean;\n};\n\nexport const useOptions = ({\n /** Component dependencies */\n dependencies,\n /** Time the component will wait before triggering a response from changed dependencies */\n depsDebounceTime,\n /** Boolean, flag if the component is disabled, as a whole */\n disabled,\n /** Function used to emit update:modelValue */\n emitter,\n /** Flag to enforce coherence between the items and modelValue. If `enforceCoherence` is active whenever a change made to props would result in a modelValue that is not present among the selectable items, it will be reset */\n enforceCoherence,\n /** ID of the component */\n id,\n /** Flag to trigger immediate search for the items on first load. If set to false items are not retrieved until a change to props happens or getOptions is called */\n immediate,\n /** Items from which to compute options */\n initialItems,\n /** Transformer to obtain a text label for the item */\n itemText,\n /** Transformer to obtain a value for the option */\n itemValue,\n /** Strategy used to identify unique objects in the component */\n matchStrategy,\n /** modelValue of the component */\n modelValue,\n /** Time the component will wait before triggering a response from changed modelValue */\n modelValueDebounceTime,\n multiple,\n}: Params) => {\n /**\n * Loading is a counter so it can be accumulated\n */\n const loading = ref(0);\n\n /**\n * Items as retrieved from outside\n */\n const internalItems = ref<BaseOption[]>([]);\n\n /**\n * The option getter\n * @param options\n */\n const getOptions = async ({ prefill = false }) => {\n let items = [];\n if (Array.isArray(initialItems.value)) {\n items = initialItems.value;\n } else {\n if (typeof initialItems.value === \"function\") {\n loading.value++;\n items = await initialItems.value(prefill, modelValue.value);\n loading.value--;\n }\n }\n internalItems.value = items;\n };\n\n /**\n * Map the items returned from outside to a set of useful information.\n * If a value can't be obtained throw an error\n */\n const { getItemText } = useItemText();\n const { getItemValue } = useItemValue();\n const options = computed<Option[]>(() => {\n return internalItems.value.map((item: any, index: number) => {\n const text = getItemText(item, itemText);\n const value = getItemValue(item, itemValue);\n\n // Undefined is not JSONable\n if (value === undefined)\n throw new Error(\n 'The result of extracting \"value\" from option was undefined. Affected item is ' +\n JSON.stringify(item) +\n \" please check itemValue property is correct.\"\n );\n\n const jsonValue = JSON.stringify(value);\n const original = item;\n const _disabled = !!(disabled?.value || item?.disabled);\n\n let _id;\n\n // Props that are handled externally\n if (id || item?.id) {\n _id = [id, isNotNil(item?.id) ? item.id : jsonValue.replace(/\\W/g, \"_\")]\n .filter(isNotNil)\n .join(\"_\");\n }\n\n const selectedIndex = modelValueIndexed.value.get(value);\n\n // Workaround for TS discriminated union not being resolved\n if (isNotNil(selectedIndex))\n return {\n disabled: _disabled,\n id: _id,\n index,\n jsonValue,\n original,\n selected: true,\n selectedIndex,\n text,\n value,\n };\n\n return {\n disabled: _disabled,\n id: _id,\n index,\n jsonValue,\n original,\n selected: false,\n selectedIndex,\n text,\n value,\n };\n });\n });\n\n /**\n * Indexes options by their value\n * (using JSON to circumvent identical objects not being equal in JS)\n */\n const optionsIndexedByValue = computed(() => {\n if (matchStrategy === \"string\") {\n let indexed = options.value.reduce(\n (acc: { [key: string]: BaseOption }, curr: BaseOption) => {\n acc[curr.jsonValue] = curr;\n return acc;\n },\n {}\n );\n return {\n get: (key: any) => {\n return indexed[JSON.stringify(key)];\n },\n };\n } else if (matchStrategy === \"equality\") {\n let indexed: [any, BaseOption][] = options.value.map((option) => [\n option.value,\n option,\n ]);\n\n return {\n get: (key: any) => {\n return indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n });\n\n /**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\n const modelValueIndexed = computed(() => {\n if (matchStrategy === \"string\") {\n let map: { [key: string]: number } = {};\n [].concat(modelValue.value).forEach((value: any, index: number) => {\n map[JSON.stringify(value)] = index;\n });\n return {\n get: (value: any) => map[JSON.stringify(value)],\n };\n } else if (matchStrategy === \"equality\") {\n const map = []\n .concat(modelValue.value)\n .map((value, index) => [value, index]);\n\n return {\n get: (key: any) => {\n return map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n });\n\n /**\n * When modelValue changes see if we already have the new value in the current options.\n * If we don't - try searching again in case the prefill might return the correct items\n * If not found and coherence is enforced reset modelValue\n */\n let modelValueTimeout: ReturnType<typeof setTimeout>;\n let hasRunOnce = false;\n watch(\n modelValue,\n (current, previous) => {\n if (modelValueTimeout) clearTimeout(modelValueTimeout);\n modelValueTimeout = setTimeout(\n async () => {\n hasRunOnce = true;\n if (multiple) {\n if (!Array.isArray(modelValue.value)) {\n throw new Error(\"Passed modelValue is not an array.\");\n }\n let allFound = modelValue.value.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n\n if (!allFound || previous === undefined) {\n await getOptions({ prefill: true });\n allFound = modelValue.value.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n }\n if (!allFound) {\n const coherent = current.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n return found;\n });\n if (enforceCoherence.value) {\n emitter(coherent);\n }\n }\n } else {\n let found = optionsIndexedByValue.value.get(modelValue.value);\n if (\n (!found && isNotNil(modelValue.value)) ||\n previous === undefined\n ) {\n await getOptions({ prefill: true });\n }\n found = optionsIndexedByValue.value.get(modelValue.value);\n if (!found) {\n if (enforceCoherence.value && isNotNil(current)) {\n emitter(null);\n }\n }\n }\n // Run immediately the first time to load intiial items\n },\n hasRunOnce || !immediate ? modelValueDebounceTime : 0\n );\n },\n // Immediate here triggers first search for items\n { immediate, deep: true }\n );\n\n /**\n * Refresh items on change.\n * To avoid refreshing every time the parent rerenders (happens when items are an array defined in the template)\n * we check by comparing the stringified version\n */\n watch(initialItems, async (current, previous) => {\n if (\n typeof current === \"function\" ||\n // Circumvent arrays defined in the template by the parent\n JSON.stringify(current) !== JSON.stringify(previous)\n ) {\n await getOptions({ prefill: true });\n\n if (multiple) {\n const allFound = modelValue.value.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n\n if (!allFound) {\n if (enforceCoherence) {\n const coherent = modelValue.value.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n return found;\n });\n emitter(coherent);\n }\n }\n } else {\n let found = optionsIndexedByValue.value.get(modelValue.value);\n if (!found && enforceCoherence && isNotNil(modelValue.value)) {\n emitter(null);\n }\n }\n }\n });\n\n /**\n * When dependencies change\n * Check dependencies are the same by value and not reference\n * Otherwise we search again for options as they might be different base on dependencies.\n * If coherence is enforced we set the state accordingly\n */\n let depsTimeout: ReturnType<typeof setTimeout>;\n watch(\n dependencies,\n (current, previous) => {\n // Circumvent array defined in the template by the parent\n if (JSON.stringify(current) === JSON.stringify(previous)) {\n return;\n }\n\n if (depsTimeout) clearTimeout(depsTimeout);\n depsTimeout = setTimeout(async () => {\n await getOptions({ prefill: true });\n if (multiple) {\n let allFound = modelValue.value.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n if (!allFound && enforceCoherence) {\n const coherent = modelValue.value.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n return found;\n });\n emitter(coherent);\n }\n } else {\n let found = optionsIndexedByValue.value.get(modelValue.value);\n if (!found && enforceCoherence && isNotNil(modelValue.value)) {\n emitter(null);\n }\n }\n }, depsDebounceTime);\n },\n { deep: true }\n );\n\n return {\n getOptions,\n loading,\n options,\n };\n};\n"],"names":["useOptions","dependencies","depsDebounceTime","disabled","emitter","enforceCoherence","id","immediate","initialItems","itemText","itemValue","matchStrategy","modelValue","modelValueDebounceTime","multiple","loading","ref","internalItems","getOptions","prefill","items","getItemText","useItemText","getItemValue","useItemValue","options","computed","item","index","text","value","jsonValue","original","_disabled","_id","isNotNil","selectedIndex","modelValueIndexed","optionsIndexedByValue","indexed","acc","curr","key","option","_a","pairs","deepEqual","map","modelValueTimeout","hasRunOnce","watch","current","previous","allFound","coherent","found","depsTimeout"],"mappings":";;;;;AAmDO,MAAMA,IAAa,CAAC;AAAA;AAAA,EAEzB,cAAAC;AAAA;AAAA,EAEA,kBAAAC;AAAA;AAAA,EAEA,UAAAC;AAAA;AAAA,EAEA,SAAAC;AAAA;AAAA,EAEA,kBAAAC;AAAA;AAAA,EAEA,IAAAC;AAAA;AAAA,EAEA,WAAAC;AAAA;AAAA,EAEA,cAAAC;AAAA;AAAA,EAEA,UAAAC;AAAA;AAAA,EAEA,WAAAC;AAAA;AAAA,EAEA,eAAAC;AAAA;AAAA,EAEA,YAAAC;AAAA;AAAA,EAEA,wBAAAC;AAAA,EACA,UAAAC;AACF,MAAc;AAIN,QAAAC,IAAUC,EAAI,CAAC,GAKfC,IAAgBD,EAAkB,CAAA,CAAE,GAMpCE,IAAa,OAAO,EAAE,SAAAC,IAAU,SAAY;AAChD,QAAIC,IAAQ,CAAA;AACZ,IAAI,MAAM,QAAQZ,EAAa,KA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AA,IACrB;AAAA,IACA,EAAE,MAAM,GAAK;AAAA,EAAA,GAGR;AAAA,IACL,YAAAgB;AAAA,IACA,SAAAH;AAAA,IACA,SAAAU;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"index6.js","sources":["../src/composables/useOptions.ts"],"sourcesContent":["import { computed, ref, watch } from 'vue';\nimport { deepEqual } from 'fast-equals';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { useItemText } from '@/composables/useItemText';\nimport { useItemValue } from '@/composables/useItemValue';\nimport type { CommonProps } from '@/types/CommonProps';\nimport type { Ref } from 'vue';\n\nexport type BaseOption = {\n\tdisabled?: boolean;\n\tid?: string;\n\tjsonValue: string;\n\tname?: string;\n\toriginal: any;\n\treadonly?: boolean;\n\ttext: string;\n\tvalue: any;\n};\n\nexport type Option = BaseOption & { index: number } & (\n\t\t| {\n\t\t\t\tselected: true;\n\t\t\t\tselectedIndex: number;\n\t\t }\n\t\t| {\n\t\t\t\tselected: false;\n\t\t\t\tselectedIndex: undefined;\n\t\t }\n\t);\n\ntype Params = {\n\tdependencies: Ref<any[] | undefined>;\n\tdepsDebounceTime: number;\n\tdisabled?: Ref<boolean>;\n\temitter: (...args: any[]) => any;\n\tenforceCoherence: Ref<boolean>;\n\tid?: string;\n\timmediate: boolean;\n\tinitialItems: Ref<\n\t\t| any[]\n\t\t| ((prefill: boolean, modelValue?: any[]) => Promise<any[]>)\n\t\t| ((prefill: boolean, modelValue?: any[]) => any[])\n\t>;\n\titemText?: string | ((item: any) => string);\n\titemValue?: string | ((item: any) => any);\n\tmatchStrategy: Exclude<CommonProps['matchStrategy'], undefined>;\n\tmodelValue: Ref<any>;\n\tmodelValueDebounceTime: number;\n\tmultiple?: boolean;\n};\n\nexport const useOptions = ({\n\t/** Component dependencies */\n\tdependencies,\n\t/** Time the component will wait before triggering a response from changed dependencies */\n\tdepsDebounceTime,\n\t/** Boolean, flag if the component is disabled, as a whole */\n\tdisabled,\n\t/** Function used to emit update:modelValue */\n\temitter,\n\t/** Flag to enforce coherence between the items and modelValue. If `enforceCoherence` is active whenever a change made to props would result in a modelValue that is not present among the selectable items, it will be reset */\n\tenforceCoherence,\n\t/** ID of the component */\n\tid,\n\t/** Flag to trigger immediate search for the items on first load. If set to false items are not retrieved until a change to props happens or getOptions is called */\n\timmediate,\n\t/** Items from which to compute options */\n\tinitialItems,\n\t/** Transformer to obtain a text label for the item */\n\titemText,\n\t/** Transformer to obtain a value for the option */\n\titemValue,\n\t/** Strategy used to identify unique objects in the component */\n\tmatchStrategy,\n\t/** modelValue of the component */\n\tmodelValue,\n\t/** Time the component will wait before triggering a response from changed modelValue */\n\tmodelValueDebounceTime,\n\tmultiple,\n}: Params) => {\n\t/**\n\t * Loading is a counter so it can be accumulated\n\t */\n\tconst loading = ref(0);\n\n\t/**\n\t * Items as retrieved from outside\n\t */\n\tconst internalItems = ref<BaseOption[]>([]);\n\n\t/**\n\t * The option getter\n\t * @param options\n\t */\n\tconst getOptions = async ({ prefill = false }) => {\n\t\tlet items = [];\n\t\tif (Array.isArray(initialItems.value)) {\n\t\t\titems = initialItems.value;\n\t\t} else {\n\t\t\tif (typeof initialItems.value === 'function') {\n\t\t\t\tloading.value++;\n\t\t\t\titems = await initialItems.value(prefill, modelValue.value);\n\t\t\t\tloading.value--;\n\t\t\t}\n\t\t}\n\t\tinternalItems.value = items;\n\t};\n\n\t/**\n\t * Map the items returned from outside to a set of useful information.\n\t * If a value can't be obtained throw an error\n\t */\n\tconst { getItemText } = useItemText();\n\tconst { getItemValue } = useItemValue();\n\tconst options = computed<Option[]>(() => {\n\t\treturn internalItems.value.map((item: any, index: number) => {\n\t\t\tconst text = getItemText(item, itemText);\n\t\t\tconst value = getItemValue(item, itemValue);\n\n\t\t\t// Undefined is not JSONable\n\t\t\tif (value === undefined)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'The result of extracting \"value\" from option was undefined. Affected item is ' +\n\t\t\t\t\t\tJSON.stringify(item) +\n\t\t\t\t\t\t' please check itemValue property is correct.'\n\t\t\t\t);\n\n\t\t\tconst jsonValue = JSON.stringify(value);\n\t\t\tconst original = item;\n\t\t\tconst _disabled = !!(disabled?.value || item?.disabled);\n\n\t\t\tlet _id;\n\n\t\t\t// Props that are handled externally\n\t\t\tif (id || item?.id) {\n\t\t\t\t_id = [id, isNotNil(item?.id) ? item.id : jsonValue.replace(/\\W/g, '_')]\n\t\t\t\t\t.filter(isNotNil)\n\t\t\t\t\t.join('_');\n\t\t\t}\n\n\t\t\tconst selectedIndex = modelValueIndexed.value.get(value);\n\n\t\t\t// Workaround for TS discriminated union not being resolved\n\t\t\tif (isNotNil(selectedIndex))\n\t\t\t\treturn {\n\t\t\t\t\tdisabled: _disabled,\n\t\t\t\t\tid: _id,\n\t\t\t\t\tindex,\n\t\t\t\t\tjsonValue,\n\t\t\t\t\toriginal,\n\t\t\t\t\tselected: true,\n\t\t\t\t\tselectedIndex,\n\t\t\t\t\ttext,\n\t\t\t\t\tvalue,\n\t\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tdisabled: _disabled,\n\t\t\t\tid: _id,\n\t\t\t\tindex,\n\t\t\t\tjsonValue,\n\t\t\t\toriginal,\n\t\t\t\tselected: false,\n\t\t\t\tselectedIndex,\n\t\t\t\ttext,\n\t\t\t\tvalue,\n\t\t\t};\n\t\t});\n\t});\n\n\t/**\n\t * Indexes options by their value\n\t * (using JSON to circumvent identical objects not being equal in JS)\n\t */\n\tconst optionsIndexedByValue = computed(() => {\n\t\tif (matchStrategy === 'string') {\n\t\t\tconst indexed = options.value.reduce(\n\t\t\t\t(acc: { [key: string]: BaseOption }, curr: BaseOption) => {\n\t\t\t\t\tacc[curr.jsonValue] = curr;\n\t\t\t\t\treturn acc;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tget: (key: any) => {\n\t\t\t\t\treturn indexed[JSON.stringify(key)];\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (matchStrategy === 'equality') {\n\t\t\tconst indexed: [any, BaseOption][] = options.value.map((option) => [\n\t\t\t\toption.value,\n\t\t\t\toption,\n\t\t\t]);\n\n\t\t\treturn {\n\t\t\t\tget: (key: any) => {\n\t\t\t\t\treturn indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t\t},\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new Error('No match strategy has been defined');\n\t\t}\n\t});\n\n\t/**\n\t * Indexes modelValue to a map so when can easily know which values are selected\n\t * (using JSON to circumvent identical object not being equal in JS)\n\t */\n\tconst modelValueIndexed = computed(() => {\n\t\tif (matchStrategy === 'string') {\n\t\t\tconst map: { [key: string]: number } = {};\n\t\t\t[].concat(modelValue.value).forEach((value: any, index: number) => {\n\t\t\t\tmap[JSON.stringify(value)] = index;\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tget: (value: any) => map[JSON.stringify(value)],\n\t\t\t};\n\t\t} else if (matchStrategy === 'equality') {\n\t\t\tconst map = []\n\t\t\t\t.concat(modelValue.value)\n\t\t\t\t.map((value, index) => [value, index]);\n\n\t\t\treturn {\n\t\t\t\tget: (key: any) => {\n\t\t\t\t\treturn map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t\t},\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new Error('No match strategy has been defined');\n\t\t}\n\t});\n\n\t/**\n\t * When modelValue changes see if we already have the new value in the current options.\n\t * If we don't - try searching again in case the prefill might return the correct items\n\t * If not found and coherence is enforced reset modelValue\n\t */\n\tlet modelValueTimeout: ReturnType<typeof setTimeout>;\n\tlet hasRunOnce = false;\n\twatch(\n\t\tmodelValue,\n\t\t(current, previous) => {\n\t\t\tif (modelValueTimeout) clearTimeout(modelValueTimeout);\n\t\t\tmodelValueTimeout = setTimeout(\n\t\t\t\tasync () => {\n\t\t\t\t\thasRunOnce = true;\n\t\t\t\t\tif (multiple) {\n\t\t\t\t\t\tif (!Array.isArray(modelValue.value)) {\n\t\t\t\t\t\t\tthrow new Error('Passed modelValue is not an array.');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet allFound = modelValue.value.every((value: any) =>\n\t\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (!allFound || previous === undefined) {\n\t\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\t\tallFound = modelValue.value.every((value: any) =>\n\t\t\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!allFound) {\n\t\t\t\t\t\t\tconst coherent = current.filter((value: any) => {\n\t\t\t\t\t\t\t\tconst found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (enforceCoherence.value) {\n\t\t\t\t\t\t\t\temitter(coherent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(modelValue.value);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(!found && isNotNil(modelValue.value)) ||\n\t\t\t\t\t\t\tprevious === undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfound = optionsIndexedByValue.value.get(modelValue.value);\n\t\t\t\t\t\tif (!found) {\n\t\t\t\t\t\t\tif (enforceCoherence.value && isNotNil(current)) {\n\t\t\t\t\t\t\t\temitter(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Run immediately the first time to load intiial items\n\t\t\t\t},\n\t\t\t\thasRunOnce || !immediate ? modelValueDebounceTime : 0\n\t\t\t);\n\t\t},\n\t\t// Immediate here triggers first search for items\n\t\t{ immediate, deep: true }\n\t);\n\n\t/**\n\t * Refresh items on change.\n\t * To avoid refreshing every time the parent rerenders (happens when items are an array defined in the template)\n\t * we check by comparing the stringified version\n\t */\n\twatch(initialItems, async (current, previous) => {\n\t\tif (\n\t\t\ttypeof current === 'function' ||\n\t\t\t// Circumvent arrays defined in the template by the parent\n\t\t\tJSON.stringify(current) !== JSON.stringify(previous)\n\t\t) {\n\t\t\tawait getOptions({ prefill: true });\n\n\t\t\tif (multiple) {\n\t\t\t\tconst allFound = modelValue.value.every((value: any) =>\n\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t);\n\n\t\t\t\tif (!allFound) {\n\t\t\t\t\tif (enforceCoherence) {\n\t\t\t\t\t\tconst coherent = modelValue.value.filter((value: any) => {\n\t\t\t\t\t\t\tconst found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\temitter(coherent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst found = optionsIndexedByValue.value.get(modelValue.value);\n\t\t\t\tif (!found && enforceCoherence && isNotNil(modelValue.value)) {\n\t\t\t\t\temitter(null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * When dependencies change\n\t * Check dependencies are the same by value and not reference\n\t * Otherwise we search again for options as they might be different base on dependencies.\n\t * If coherence is enforced we set the state accordingly\n\t */\n\tlet depsTimeout: ReturnType<typeof setTimeout>;\n\twatch(\n\t\tdependencies,\n\t\t(current, previous) => {\n\t\t\t// Circumvent array defined in the template by the parent\n\t\t\tif (JSON.stringify(current) === JSON.stringify(previous)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (depsTimeout) clearTimeout(depsTimeout);\n\t\t\tdepsTimeout = setTimeout(async () => {\n\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\tif (multiple) {\n\t\t\t\t\tconst allFound = modelValue.value.every((value: any) =>\n\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t);\n\t\t\t\t\tif (!allFound && enforceCoherence) {\n\t\t\t\t\t\tconst coherent = modelValue.value.filter((value: any) => {\n\t\t\t\t\t\t\tconst found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\temitter(coherent);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst found = optionsIndexedByValue.value.get(modelValue.value);\n\t\t\t\t\tif (!found && enforceCoherence && isNotNil(modelValue.value)) {\n\t\t\t\t\t\temitter(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, depsDebounceTime);\n\t\t},\n\t\t{ deep: true }\n\t);\n\n\treturn {\n\t\tgetOptions,\n\t\tloading,\n\t\toptions,\n\t};\n};\n"],"names":["useOptions","dependencies","depsDebounceTime","disabled","emitter","enforceCoherence","id","immediate","initialItems","itemText","itemValue","matchStrategy","modelValue","modelValueDebounceTime","multiple","loading","ref","internalItems","getOptions","prefill","items","getItemText","useItemText","getItemValue","useItemValue","options","computed","item","index","text","value","jsonValue","original","_disabled","_id","isNotNil","selectedIndex","modelValueIndexed","optionsIndexedByValue","indexed","acc","curr","key","option","_a","pairs","deepEqual","map","modelValueTimeout","hasRunOnce","watch","current","previous","allFound","coherent","found","depsTimeout"],"mappings":";;;;;AAmDO,MAAMA,IAAa,CAAC;AAAA;AAAA,EAE1B,cAAAC;AAAA;AAAA,EAEA,kBAAAC;AAAA;AAAA,EAEA,UAAAC;AAAA;AAAA,EAEA,SAAAC;AAAA;AAAA,EAEA,kBAAAC;AAAA;AAAA,EAEA,IAAAC;AAAA;AAAA,EAEA,WAAAC;AAAA;AAAA,EAEA,cAAAC;AAAA;AAAA,EAEA,UAAAC;AAAA;AAAA,EAEA,WAAAC;AAAA;AAAA,EAEA,eAAAC;AAAA;AAAA,EAEA,YAAAC;AAAA;AAAA,EAEA,wBAAAC;AAAA,EACA,UAAAC;AACD,MAAc;AAIP,QAAAC,IAAUC,EAAI,CAAC,GAKfC,IAAgBD,EAAkB,CAAA,CAAE,GAMp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