bitboss-ui 0.2.26 → 0.2.27

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 (138) hide show
  1. package/dist/composables/useConfirm.d.ts +6 -0
  2. package/dist/index101.js +3 -3
  3. package/dist/index103.js +2 -2
  4. package/dist/index11.js +2 -2
  5. package/dist/index111.js +3 -3
  6. package/dist/index113.js +1 -1
  7. package/dist/index116.js +1 -1
  8. package/dist/index117.js +1 -1
  9. package/dist/index118.js +1 -1
  10. package/dist/index119.js +1 -1
  11. package/dist/index121.js +1 -1
  12. package/dist/index125.js +1 -1
  13. package/dist/index126.js +1 -1
  14. package/dist/index127.js +1 -1
  15. package/dist/index131.js +2 -2
  16. package/dist/index15.js +8 -8
  17. package/dist/index17.js +9 -9
  18. package/dist/index19.js +11 -15
  19. package/dist/index19.js.map +1 -1
  20. package/dist/index196.js +2 -2
  21. package/dist/index196.js.map +1 -1
  22. package/dist/index197.js +2 -4
  23. package/dist/index197.js.map +1 -1
  24. package/dist/index198.js +4 -2
  25. package/dist/index198.js.map +1 -1
  26. package/dist/index199.js +3 -378
  27. package/dist/index199.js.map +1 -1
  28. package/dist/index200.js +3 -134
  29. package/dist/index200.js.map +1 -1
  30. package/dist/index201.js +2 -5
  31. package/dist/index201.js.map +1 -1
  32. package/dist/index202.js +2 -19
  33. package/dist/index202.js.map +1 -1
  34. package/dist/index203.js +3 -2
  35. package/dist/index203.js.map +1 -1
  36. package/dist/index204.js +35 -2
  37. package/dist/index204.js.map +1 -1
  38. package/dist/index205.js +6 -174
  39. package/dist/index205.js.map +1 -1
  40. package/dist/index206.js +5 -23
  41. package/dist/index206.js.map +1 -1
  42. package/dist/index207.js +14 -371
  43. package/dist/index207.js.map +1 -1
  44. package/dist/index208.js +16 -3
  45. package/dist/index208.js.map +1 -1
  46. package/dist/index209.js +19 -35
  47. package/dist/index209.js.map +1 -1
  48. package/dist/index21.js +2 -2
  49. package/dist/index210.js +20 -6
  50. package/dist/index210.js.map +1 -1
  51. package/dist/index211.js +29 -235
  52. package/dist/index211.js.map +1 -1
  53. package/dist/index212.js +8 -16
  54. package/dist/index212.js.map +1 -1
  55. package/dist/index213.js +2 -16
  56. package/dist/index213.js.map +1 -1
  57. package/dist/index214.js +10 -20
  58. package/dist/index214.js.map +1 -1
  59. package/dist/index215.js +376 -27
  60. package/dist/index215.js.map +1 -1
  61. package/dist/index216.js +2 -8
  62. package/dist/index216.js.map +1 -1
  63. package/dist/index217.js +373 -3
  64. package/dist/index217.js.map +1 -1
  65. package/dist/index218.js +134 -3
  66. package/dist/index218.js.map +1 -1
  67. package/dist/index219.js +172 -8
  68. package/dist/index219.js.map +1 -1
  69. package/dist/index220.js +23 -2
  70. package/dist/index220.js.map +1 -1
  71. package/dist/index221.js +235 -2
  72. package/dist/index221.js.map +1 -1
  73. package/dist/index223.js +4 -4
  74. package/dist/index224.js +1 -1
  75. package/dist/index226.js +1 -1
  76. package/dist/index228.js +223 -5
  77. package/dist/index228.js.map +1 -1
  78. package/dist/index229.js +258 -2
  79. package/dist/index229.js.map +1 -1
  80. package/dist/index23.js +1 -1
  81. package/dist/index230.js +431 -291
  82. package/dist/index230.js.map +1 -1
  83. package/dist/index231.js +89 -2
  84. package/dist/index231.js.map +1 -1
  85. package/dist/index232.js +200 -2
  86. package/dist/index232.js.map +1 -1
  87. package/dist/index233.js +294 -116
  88. package/dist/index233.js.map +1 -1
  89. package/dist/index234.js +5 -105
  90. package/dist/index234.js.map +1 -1
  91. package/dist/index235.js +2 -435
  92. package/dist/index235.js.map +1 -1
  93. package/dist/index236.js +2 -89
  94. package/dist/index236.js.map +1 -1
  95. package/dist/index237.js +2 -2
  96. package/dist/index237.js.map +1 -1
  97. package/dist/index238.js +2 -224
  98. package/dist/index238.js.map +1 -1
  99. package/dist/index239.js +2 -258
  100. package/dist/index239.js.map +1 -1
  101. package/dist/index240.js +2 -200
  102. package/dist/index240.js.map +1 -1
  103. package/dist/index241.js +2 -2
  104. package/dist/index242.js +117 -2
  105. package/dist/index242.js.map +1 -1
  106. package/dist/index243.js +106 -2
  107. package/dist/index243.js.map +1 -1
  108. package/dist/index244.js +2 -2
  109. package/dist/index244.js.map +1 -1
  110. package/dist/index245.js +2 -162
  111. package/dist/index245.js.map +1 -1
  112. package/dist/index246.js +162 -2
  113. package/dist/index246.js.map +1 -1
  114. package/dist/index247.js +2 -2
  115. package/dist/index247.js.map +1 -1
  116. package/dist/index249.js +15 -2
  117. package/dist/index249.js.map +1 -1
  118. package/dist/index25.js +2 -2
  119. package/dist/index253.js +2 -15
  120. package/dist/index253.js.map +1 -1
  121. package/dist/index254.js +2 -2
  122. package/dist/index29.js +3 -3
  123. package/dist/index3.js +25 -23
  124. package/dist/index3.js.map +1 -1
  125. package/dist/index31.js +6 -6
  126. package/dist/index33.js +2 -2
  127. package/dist/index35.js +2 -2
  128. package/dist/index47.js +1 -1
  129. package/dist/index49.js +1 -1
  130. package/dist/index59.js +23 -23
  131. package/dist/index59.js.map +1 -1
  132. package/dist/index65.js +3 -3
  133. package/dist/index72.js +1 -1
  134. package/dist/index75.js +1 -1
  135. package/dist/index79.js +3 -3
  136. package/dist/index81.js +1 -1
  137. package/dist/style.css +1 -1
  138. package/package.json +1 -1
package/dist/index246.js CHANGED
@@ -1,5 +1,165 @@
1
- const e = "";
1
+ import { defineComponent as K, ref as s, computed as y, openBlock as p, createElementBlock as m, normalizeClass as g, renderSlot as v, createElementVNode as k, Fragment as E, renderList as C, toDisplayString as B, createBlock as S, withDirectives as z, mergeProps as H, vModelDynamic as J } from "vue";
2
+ import { clamp as P } from "./index196.js";
3
+ import { drop as q } from "./index256.js";
4
+ import { isNil as R } from "./index120.js";
5
+ import { isNotNil as w } from "./index124.js";
6
+ import { wait as L } from "./index122.js";
7
+ import U from "./index115.js";
8
+ import "./index158.js";
9
+ const j = { class: "bb-base-tag__input-container" }, G = ["autocomplete", "autofocus", "disabled", "id", "placeholder", "readonly"], te = /* @__PURE__ */ K({
10
+ __name: "BaseTag",
11
+ props: {
12
+ autocomplete: {},
13
+ autofocus: {},
14
+ comma: { type: Boolean },
15
+ disabled: { type: Boolean },
16
+ divider: { default: "Enter" },
17
+ hasErrors: { type: Boolean },
18
+ id: {},
19
+ modelValue: {},
20
+ multiple: { type: Boolean, default: !0 },
21
+ name: {},
22
+ placeholder: {},
23
+ readonly: {}
24
+ },
25
+ emits: ["blur", "change", "click", "duplicate", "focus", "inactive", "input", "keydown", "keyup", "update:modelValue"],
26
+ setup(N, { emit: I }) {
27
+ const a = N, u = I;
28
+ if (a.multiple && !Array.isArray(a.modelValue))
29
+ throw new Error('Multiple is set to "true" but modelValue is not an array.');
30
+ const i = s(null), $ = s(null), c = s(null), t = s(""), D = y(() => a.placeholder), o = y(
31
+ () => [].concat(a.modelValue).filter(w)
32
+ ), h = y(() => {
33
+ let e = {};
34
+ return o.value.forEach((n, r) => {
35
+ e[JSON.stringify(n)] = r;
36
+ }), {
37
+ get: (n) => e[JSON.stringify(n)]
38
+ };
39
+ }), f = s(!1), l = s(null), A = (e) => {
40
+ if (u("keyup", e), a.readonly || a.disabled) {
41
+ e.preventDefault();
42
+ return;
43
+ }
44
+ if (e.key === a.divider) {
45
+ if (t.value[t.value.length - 1] === e.key && (t.value = t.value.slice(0, t.value.length - 1)), !t.value)
46
+ return;
47
+ l.value = null;
48
+ const n = h.value.get(t.value);
49
+ R(n) ? F(t.value) : u("duplicate", t.value), t.value = "";
50
+ } else if (e.key === "ArrowLeft")
51
+ l.value === null ? l.value = o.value.length - 1 : l.value === 0 ? l.value = null : l.value--;
52
+ else if (e.key === "ArrowRight")
53
+ l.value === null ? l.value = 1 : l.value === o.value.length - 1 ? l.value = null : l.value++;
54
+ else if (e.key === "Backspace") {
55
+ if (t.value)
56
+ return;
57
+ w(l.value) ? (b(l.value), l.value = P(
58
+ l.value,
59
+ 0,
60
+ o.value.length - 2
61
+ ), o.value.length === 1 && (l.value = null)) : l.value = o.value.length - 1;
62
+ } else
63
+ (e.key === "Tab" || e.key === "Escape") && (l.value = null);
64
+ }, F = (e) => {
65
+ a.multiple ? u("update:modelValue", a.modelValue.concat(e)) : u("update:modelValue", e);
66
+ }, b = (e) => {
67
+ if (typeof e == "number")
68
+ a.multiple ? u("update:modelValue", q(a.modelValue, 1, e)) : u("update:modelValue", null);
69
+ else {
70
+ const n = h.value.get(t.value);
71
+ b(n);
72
+ }
73
+ }, M = (e) => {
74
+ u("focus", e), f.value = !0, document.addEventListener("click", _), document.addEventListener("focusin", V), c.value instanceof HTMLInputElement && c.value.select();
75
+ }, O = (e) => {
76
+ u("click", e), !(a.disabled || a.readonly) && c.value instanceof HTMLElement && c.value.focus();
77
+ }, _ = (e) => {
78
+ if (e.target instanceof Node && i.value && !i.value.contains(e.target)) {
79
+ u("inactive"), document.removeEventListener("click", _), f.value = !1, a.multiple && L(500).then(() => {
80
+ t.value = "";
81
+ });
82
+ return;
83
+ }
84
+ }, V = (e) => {
85
+ if (e.target instanceof Node && i.value && !i.value.contains(e.target)) {
86
+ u("inactive"), document.removeEventListener("focusin", V), f.value = !1, a.multiple && L(500).then(() => {
87
+ t.value = "";
88
+ });
89
+ return;
90
+ }
91
+ }, T = {
92
+ onBlur: (e) => u("blur", e),
93
+ onChange: (e) => u("change", e),
94
+ onKeydown: (e) => {
95
+ e.key === "Enter" && a.divider === "Enter" && e.preventDefault(), u("keydown", e);
96
+ },
97
+ onInput: (e) => u("input", e)
98
+ };
99
+ return (e, n) => (p(), m("span", {
100
+ class: g({
101
+ "bb-base-tag": !0,
102
+ "bb-base-tag--active": f.value,
103
+ "bb-base-tag--disabled": e.disabled,
104
+ "bb-base-tag--errors": e.hasErrors,
105
+ "bb-base-tag--readonly": e.readonly
106
+ }),
107
+ onClick: O,
108
+ ref_key: "outerContainer",
109
+ ref: i
110
+ }, [
111
+ v(e.$slots, "prepend-outer"),
112
+ k("span", {
113
+ class: "bb-base-tag__inner-container",
114
+ ref_key: "innerContainer",
115
+ ref: $
116
+ }, [
117
+ v(e.$slots, "prepend"),
118
+ k("span", j, [
119
+ e.comma ? (p(!0), m(E, { key: 0 }, C(o.value, (r, d) => (p(), m("span", {
120
+ class: g({
121
+ "bb-base-tag__selected": !0,
122
+ "bb-base-tag__selected--comma": !0,
123
+ "bb-base-tag__selected--focused": d === l.value
124
+ }),
125
+ key: r
126
+ }, B(r) + B(d < o.value.length - 1 ? "," : ""), 3))), 128)) : (p(!0), m(E, { key: 1 }, C(o.value, (r, d) => (p(), S(U, {
127
+ class: g({
128
+ "bb-base-tag__selected": !0,
129
+ "bb-base-tag__selected--chip": !0,
130
+ "bb-base-tag__selected--focused": d === l.value
131
+ }),
132
+ clearable: !0,
133
+ key: r,
134
+ text: r,
135
+ "onClick:clear": (Q) => b(d)
136
+ }, null, 8, ["class", "text", "onClick:clear"]))), 128)),
137
+ z(k("input", H({
138
+ autocomplete: e.autocomplete,
139
+ autofocus: e.autofocus,
140
+ class: "bb-base-tag__text-input",
141
+ disabled: e.disabled,
142
+ id: e.id,
143
+ placeholder: D.value,
144
+ readonly: e.readonly,
145
+ type: "text",
146
+ onKeyup: A,
147
+ onFocus: M
148
+ }, T, {
149
+ "onUpdate:modelValue": n[0] || (n[0] = (r) => t.value = r),
150
+ ref_key: "input",
151
+ ref: c
152
+ }), null, 16, G), [
153
+ [J, t.value]
154
+ ])
155
+ ]),
156
+ v(e.$slots, "append")
157
+ ], 512),
158
+ v(e.$slots, "append-outer")
159
+ ], 2));
160
+ }
161
+ });
2
162
  export {
3
- e as default
163
+ te as default
4
164
  };
5
165
  //# sourceMappingURL=index246.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index246.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index246.js","sources":["../src/components/BaseTag/BaseTag.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, createBlock as _createBlock, vModelDynamic as _vModelDynamic, mergeProps as _mergeProps, createElementVNode as _createElementVNode, withDirectives as _withDirectives } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-tag__input-container\" }\nconst _hoisted_2 = [\"autocomplete\", \"autofocus\", \"disabled\", \"id\", \"placeholder\", \"readonly\"]\n\nimport { clamp } from \"@/utilities/functions/clamp\";\nimport { computed, ref } from \"vue\";\nimport { drop } from \"@/utilities/functions/drop\";\nimport { isNil } from \"@/utilities/functions/isNil\";\nimport { isNotNil } from \"@/utilities/functions/isNotNil\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BbChip from \"../BbChip/BbChip.vue\";\nimport type { InputHTMLAttributes, HTMLAttributes } from \"vue\";\n\nexport type BaseTagProps = {\n /**\n * Guides to the browser as to the type of information expected in the field.\n */\n autocomplete?: InputHTMLAttributes[\"autocomplete\"];\n\n /**\n * Sets autofocus on page load.\n */\n autofocus?: InputHTMLAttributes[\"autofocus\"];\n\n /**\n * Sets the display model for selected values to a list\n * of comma separated string. In this mode the user\n * cannot deselect an option by pressing the close button.\n */\n comma?: boolean;\n\n /**\n * Disables the component\n */\n disabled?: boolean;\n\n /**\n * The divider key used to separate values from one another. By default it is \"Enter\"\n */\n divider?: KeyboardEvent[\"key\"];\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 by v-model. Can be any serializable type.\n */\n modelValue: any;\n\n /**\n * Allows the selection of multiple items.\n */\n multiple?: boolean;\n\n /**\n * Defines the name of the input.\n */\n name?: InputHTMLAttributes[\"name\"];\n\n /**\n * String displayed when there's no data.\n */\n placeholder?: InputHTMLAttributes[\"placeholder\"];\n\n /**\n * Sets the input in a readonly state.\n */\n readonly?: InputHTMLAttributes[\"readonly\"];\n};\n\nexport type BaseTagEvents = {\n (e: \"blur\", event: FocusEvent): void;\n\n (e: \"change\", event: Event): void;\n\n (e: \"click\", event: MouseEvent): void;\n\n (e: \"duplicate\", string: string): void;\n\n (e: \"focus\", event: FocusEvent): void;\n\n (e: \"inactive\"): void;\n\n (e: \"input\", event: Event): void;\n\n (e: \"keydown\", event: KeyboardEvent): void;\n\n (e: \"keyup\", event: KeyboardEvent): void;\n\n (e: \"update:modelValue\", value: any): void;\n};\n\nexport type BaseTagSlots = {\n append?: (props: {}) => any;\n\n \"append-outer\"?: (props: {}) => any;\n\n prepend?: (props: {}) => any;\n\n \"prepend-outer\"?: (props: {}) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseTag',\n props: {\n autocomplete: {},\n autofocus: {},\n comma: { type: Boolean },\n disabled: { type: Boolean },\n divider: { default: \"Enter\" },\n hasErrors: { type: Boolean },\n id: {},\n modelValue: {},\n multiple: { type: Boolean, default: true },\n name: {},\n placeholder: {},\n readonly: {}\n },\n emits: [\"blur\", \"change\", \"click\", \"duplicate\", \"focus\", \"inactive\", \"input\", \"keydown\", \"keyup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n throw new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst query = ref<string>(\"\");\nconst computedPlaceholder = computed(() => {\n return props.placeholder;\n});\n\nconst modelValueNormalized = computed(() =>\n [].concat(props.modelValue).filter(isNotNil)\n);\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n */\nconst modelValueIndexed = computed(() => {\n let map: { [key: string]: number } = {};\n modelValueNormalized.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});\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 options so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst focusedIndex = ref<null | number>(null);\n\nconst onInputKeyup = (event: KeyboardEvent) => {\n emit(\"keyup\", event);\n if (props.readonly || props.disabled) {\n event.preventDefault();\n return;\n }\n if (event.key === props.divider) {\n if (query.value[query.value.length - 1] === event.key) {\n query.value = query.value.slice(0, query.value.length - 1);\n }\n if (!query.value) return;\n focusedIndex.value = null;\n const currentIndex = modelValueIndexed.value.get(query.value);\n if (isNil(currentIndex)) selectValue(query.value);\n else emit(\"duplicate\", query.value);\n query.value = \"\";\n } else if (event.key === \"ArrowLeft\") {\n if (focusedIndex.value === null)\n focusedIndex.value = modelValueNormalized.value.length - 1;\n else if (focusedIndex.value === 0) focusedIndex.value = null;\n else focusedIndex.value--;\n } else if (event.key === \"ArrowRight\") {\n if (focusedIndex.value === null) focusedIndex.value = 1;\n else if (focusedIndex.value === modelValueNormalized.value.length - 1)\n focusedIndex.value = null;\n else focusedIndex.value++;\n } else if (event.key === \"Backspace\") {\n if (query.value) return;\n if (isNotNil(focusedIndex.value)) {\n removeValue(focusedIndex.value);\n focusedIndex.value = clamp(\n focusedIndex.value,\n 0,\n modelValueNormalized.value.length - 2\n );\n if (modelValueNormalized.value.length === 1) focusedIndex.value = null;\n } else focusedIndex.value = modelValueNormalized.value.length - 1;\n } else if (event.key === \"Tab\" || event.key === \"Escape\") {\n focusedIndex.value = null;\n }\n};\n\nconst selectValue = (text: string) => {\n if (props.multiple) emit(\"update:modelValue\", props.modelValue.concat(text));\n else emit(\"update:modelValue\", text);\n};\n\nconst removeValue = (indexOrString: number | string) => {\n if (typeof indexOrString === \"number\") {\n if (props.multiple)\n emit(\"update:modelValue\", drop(props.modelValue, 1, indexOrString));\n else emit(\"update:modelValue\", null);\n } else {\n const currentIndex = modelValueIndexed.value.get(query.value);\n removeValue(currentIndex);\n }\n};\n\nconst onInputFocus = (event: FocusEvent) => {\n emit(\"focus\", event);\n active.value = true;\n document.addEventListener(\"click\", onClickOutside);\n document.addEventListener(\"focusin\", onFocusOutside);\n if (input.value instanceof HTMLInputElement) input.value.select();\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n emit(\"click\", event);\n if (props.disabled || props.readonly) return;\n if (input.value instanceof HTMLElement) {\n input.value.focus();\n }\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onClickOutside = (event: Event) => {\n if (event.target instanceof Node) {\n if (outerContainer.value) {\n if (!outerContainer.value.contains(event.target)) {\n emit(\"inactive\");\n document.removeEventListener(\"click\", onClickOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\nconst onFocusOutside = (event: FocusEvent) => {\n if (event.target instanceof Node) {\n if (outerContainer.value) {\n if (!outerContainer.value.contains(event.target)) {\n emit(\"inactive\");\n document.removeEventListener(\"focusin\", onFocusOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\nconst eventListeners = {\n onBlur: (event: FocusEvent) => emit(\"blur\", event),\n onChange: (event: Event) => emit(\"change\", event),\n onKeydown: (event: KeyboardEvent) => {\n if (event.key === \"Enter\" && props.divider === \"Enter\") {\n event.preventDefault();\n }\n emit(\"keydown\", event);\n },\n onInput: (event: Event) => emit(\"input\", event),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-tag': true,\n 'bb-base-tag--active': active.value,\n 'bb-base-tag--disabled': _ctx.disabled,\n 'bb-base-tag--errors': _ctx.hasErrors,\n 'bb-base-tag--readonly': _ctx.readonly,\n }),\n onClick: onOuterContainerClick,\n ref_key: \"outerContainer\",\n ref: outerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n class: \"bb-base-tag__inner-container\",\n ref_key: \"innerContainer\",\n ref: innerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.comma)\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(modelValueNormalized.value, (option, index) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-tag__selected': true,\n 'bb-base-tag__selected--comma': true,\n 'bb-base-tag__selected--focused': index === focusedIndex.value,\n }),\n key: option\n }, _toDisplayString(option) + _toDisplayString(index < modelValueNormalized.value.length - 1 ? \",\" : \"\"), 3))\n }), 128))\n : (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(modelValueNormalized.value, (option, index) => {\n return (_openBlock(), _createBlock(BbChip, {\n class: _normalizeClass({\n 'bb-base-tag__selected': true,\n 'bb-base-tag__selected--chip': true,\n 'bb-base-tag__selected--focused': index === focusedIndex.value,\n }),\n clearable: true,\n key: option,\n text: option,\n \"onClick:clear\": ($event: any) => (removeValue(index))\n }, null, 8, [\"class\", \"text\", \"onClick:clear\"]))\n }), 128)),\n _withDirectives(_createElementVNode(\"input\", _mergeProps({\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n class: 'bb-base-tag__text-input',\n disabled: _ctx.disabled,\n id: _ctx.id,\n placeholder: computedPlaceholder.value,\n readonly: _ctx.readonly,\n type: 'text',\n onKeyup: onInputKeyup,\n onFocus: onInputFocus\n }, eventListeners, {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((query).value = $event)),\n ref_key: \"input\",\n ref: input\n }), null, 16, _hoisted_2), [\n [_vModelDynamic, query.value]\n ])\n ]),\n _renderSlot(_ctx.$slots, \"append\")\n ], 512),\n _renderSlot(_ctx.$slots, \"append-outer\")\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","__emit","props","emit","outerContainer","ref","innerContainer","input","query","computedPlaceholder","computed","modelValueNormalized","isNotNil","modelValueIndexed","map","value","index","active","focusedIndex","onInputKeyup","event","currentIndex","isNil","selectValue","removeValue","clamp","text","indexOrString","drop","onInputFocus","onClickOutside","onFocusOutside","onOuterContainerClick","wait","eventListeners","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_Fragment","_renderList","option","_toDisplayString","_createBlock","BbChip","$event","_withDirectives","_mergeProps","_vModelDynamic"],"mappings":";;;;;;;;AAGA,MAAMA,IAAa,EAAE,OAAO,kCACtBC,IAAa,CAAC,gBAAgB,aAAa,YAAY,MAAM,eAAe,UAAU,GA6GhEC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,CAAC;AAAA,IACf,WAAW,CAAC;AAAA,IACZ,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,SAAS,EAAE,SAAS,QAAQ;AAAA,IAC5B,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,YAAY,CAAC;AAAA,IACb,UAAU,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IACzC,MAAM,CAAC;AAAA,IACP,aAAa,CAAC;AAAA,IACd,UAAU,CAAC;AAAA,EACb;AAAA,EACA,OAAO,CAAC,QAAQ,UAAU,SAAS,aAAa,SAAS,YAAY,SAAS,WAAW,SAAS,mBAAmB;AAAA,EACrH,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAExC,UAAMC,IAAQF,GAERG,IAAOF;AAIb,QAAIC,EAAM,YAAY,CAAC,MAAM,QAAQA,EAAM,UAAU;AAC7C,YAAA,IAAI,MAAM,2DAA2D;AAGvE,UAAAE,IAAiBC,EAAwB,IAAI,GAC7CC,IAAiBD,EAAwB,IAAI,GAC7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AK;AAAA,YACnB,WAAWA,EAAK;AAAA,YAChB,OAAO;AAAA,YACP,UAAUA,EAAK;AAAA,YACf,IAAIA,EAAK;AAAA,YACT,aAAa1B,EAAoB;AAAA,YACjC,UAAU0B,EAAK;AAAA,YACf,MAAM;AAAA,YACN,SAAShB;AAAA,YACT,SAASU;AAAA,aACRK,GAAgB;AAAA,YACjB,uBAAuBE,EAAO,CAAC,MAAMA,EAAO,CAAC,IAAI,CAACY,MAAkBxC,EAAO,QAAQwC;AAAA,YACnF,SAAS;AAAA,YACT,KAAKzC;AAAA,UACN,CAAA,GAAG,MAAM,IAAIV,CAAU,GAAG;AAAA,YACzB,CAACsD,GAAgB3C,EAAM,KAAK;AAAA,UAAA,CAC7B;AAAA,QAAA,CACF;AAAA,QACDgC,EAAYL,EAAK,QAAQ,QAAQ;AAAA,SAChC,GAAG;AAAA,MACNK,EAAYL,EAAK,QAAQ,cAAc;AAAA,OACtC,CAAC;AAAA,EAEN;AAEA,CAAC;"}
package/dist/index247.js CHANGED
@@ -1,5 +1,5 @@
1
- const o = (l, n, f = (r) => r, u) => l.map((r) => Array.isArray(r[n]) ? [f(r, u), ...o(r[n], n, f, f(r, u))] : [f(r, u)]).flat();
1
+ const e = "";
2
2
  export {
3
- o as flattenTree
3
+ e as default
4
4
  };
5
5
  //# sourceMappingURL=index247.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index247.js","sources":["../src/utilities/functions/flattenTree.ts"],"sourcesContent":["export const flattenTree = <T extends Record<string, any>, U>(\n items: T[],\n keyName: keyof T,\n mapper: (item: T, parent?: U) => U = (x:any) => x,\n parent?: ReturnType<typeof mapper>\n): ReturnType<typeof mapper>[] => {\n return items\n .map((item) => {\n if (Array.isArray(item[keyName])) {\n return [mapper(item, parent), ...flattenTree(item[keyName], keyName, mapper, mapper(item, parent))];\n }\n return [mapper(item, parent)];\n })\n .flat();\n};\n"],"names":["flattenTree","items","keyName","mapper","x","parent","item"],"mappings":"AAAa,MAAAA,IAAc,CACzBC,GACAC,GACAC,IAAqC,CAACC,MAAUA,GAChDC,MAEOJ,EACJ,IAAI,CAACK,MACA,MAAM,QAAQA,EAAKJ,CAAO,CAAC,IACtB,CAACC,EAAOG,GAAMD,CAAM,GAAG,GAAGL,EAAYM,EAAKJ,CAAO,GAAGA,GAASC,GAAQA,EAAOG,GAAMD,CAAM,CAAC,CAAC,IAE7F,CAACF,EAAOG,GAAMD,CAAM,CAAC,CAC7B,EACA,KAAK;"}
1
+ {"version":3,"file":"index247.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index249.js CHANGED
@@ -1,5 +1,18 @@
1
- import e from "./index211.js";
1
+ function r(t) {
2
+ return Object.prototype.toString.call(t).slice(8, -1);
3
+ }
4
+ function o(t) {
5
+ return r(t) === "Array";
6
+ }
7
+ function c(t) {
8
+ if (r(t) !== "Object")
9
+ return !1;
10
+ const e = Object.getPrototypeOf(t);
11
+ return !!e && e.constructor === Object && e === Object.prototype;
12
+ }
2
13
  export {
3
- e as default
14
+ r as getType,
15
+ o as isArray,
16
+ c as isPlainObject
4
17
  };
5
18
  //# sourceMappingURL=index249.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index249.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index249.js","sources":["../node_modules/is-what/dist/index.js"],"sourcesContent":["function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\n\nfunction isAnyObject(payload) {\n return getType(payload) === \"Object\";\n}\n\nfunction isArray(payload) {\n return getType(payload) === \"Array\";\n}\n\nfunction isBlob(payload) {\n return getType(payload) === \"Blob\";\n}\n\nfunction isBoolean(payload) {\n return getType(payload) === \"Boolean\";\n}\n\nfunction isDate(payload) {\n return getType(payload) === \"Date\" && !isNaN(payload);\n}\n\nfunction isEmptyArray(payload) {\n return isArray(payload) && payload.length === 0;\n}\n\nfunction isPlainObject(payload) {\n if (getType(payload) !== \"Object\")\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\n\nfunction isEmptyObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n}\n\nfunction isEmptyString(payload) {\n return payload === \"\";\n}\n\nfunction isError(payload) {\n return getType(payload) === \"Error\" || payload instanceof Error;\n}\n\nfunction isFile(payload) {\n return getType(payload) === \"File\";\n}\n\nfunction isFullArray(payload) {\n return isArray(payload) && payload.length > 0;\n}\n\nfunction isFullObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length > 0;\n}\n\nfunction isString(payload) {\n return getType(payload) === \"String\";\n}\n\nfunction isFullString(payload) {\n return isString(payload) && payload !== \"\";\n}\n\nfunction isFunction(payload) {\n return typeof payload === \"function\";\n}\n\nfunction isType(payload, type) {\n if (!(type instanceof Function)) {\n throw new TypeError(\"Type must be a function\");\n }\n if (!Object.prototype.hasOwnProperty.call(type, \"prototype\")) {\n throw new TypeError(\"Type is not a class\");\n }\n const name = type.name;\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\n}\n\nfunction isInstanceOf(value, classOrClassName) {\n if (typeof classOrClassName === \"function\") {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (isType(p, classOrClassName)) {\n return true;\n }\n }\n return false;\n } else {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (getType(p) === classOrClassName) {\n return true;\n }\n }\n return false;\n }\n}\n\nfunction isMap(payload) {\n return getType(payload) === \"Map\";\n}\n\nfunction isNaNValue(payload) {\n return getType(payload) === \"Number\" && isNaN(payload);\n}\n\nfunction isNumber(payload) {\n return getType(payload) === \"Number\" && !isNaN(payload);\n}\n\nfunction isNegativeNumber(payload) {\n return isNumber(payload) && payload < 0;\n}\n\nfunction isNull(payload) {\n return getType(payload) === \"Null\";\n}\n\nfunction isOneOf(a, b, c, d, e) {\n return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);\n}\n\nfunction isUndefined(payload) {\n return getType(payload) === \"Undefined\";\n}\n\nconst isNullOrUndefined = isOneOf(isNull, isUndefined);\n\nfunction isObject(payload) {\n return isPlainObject(payload);\n}\n\nfunction isObjectLike(payload) {\n return isAnyObject(payload);\n}\n\nfunction isPositiveNumber(payload) {\n return isNumber(payload) && payload > 0;\n}\n\nfunction isSymbol(payload) {\n return getType(payload) === \"Symbol\";\n}\n\nfunction isPrimitive(payload) {\n return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\n}\n\nfunction isPromise(payload) {\n return getType(payload) === \"Promise\";\n}\n\nfunction isRegExp(payload) {\n return getType(payload) === \"RegExp\";\n}\n\nfunction isSet(payload) {\n return getType(payload) === \"Set\";\n}\n\nfunction isWeakMap(payload) {\n return getType(payload) === \"WeakMap\";\n}\n\nfunction isWeakSet(payload) {\n return getType(payload) === \"WeakSet\";\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isInstanceOf, isMap, isNaNValue, isNegativeNumber, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPositiveNumber, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n"],"names":["getType","payload","isArray","isPlainObject","prototype"],"mappings":"AAAA,SAASA,EAAQC,GAAS;AACxB,SAAO,OAAO,UAAU,SAAS,KAAKA,CAAO,EAAE,MAAM,GAAG,EAAE;AAC5D;AAMA,SAASC,EAAQD,GAAS;AACxB,SAAOD,EAAQC,CAAO,MAAM;AAC9B;AAkBA,SAASE,EAAcF,GAAS;AAC9B,MAAID,EAAQC,CAAO,MAAM;AACvB,WAAO;AACT,QAAMG,IAAY,OAAO,eAAeH,CAAO;AAC/C,SAAO,CAAC,CAACG,KAAaA,EAAU,gBAAgB,UAAUA,MAAc,OAAO;AACjF;","x_google_ignoreList":[0]}
package/dist/index25.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as g, computed as n, ref as _, openBlock as w, createElementBlock as B, normalizeClass as C, createElementVNode as l, normalizeProps as t, guardReactiveProps as u, renderSlot as V } from "vue";
2
- import { isCssColor as i } from "./index196.js";
3
- import { when as E } from "./index197.js";
2
+ import { isCssColor as i } from "./index197.js";
3
+ import { when as E } from "./index198.js";
4
4
  const N = {
5
5
  class: "bb-base-radio-container",
6
6
  "aria-hidden": "true"
package/dist/index253.js CHANGED
@@ -1,18 +1,5 @@
1
- function r(t) {
2
- return Object.prototype.toString.call(t).slice(8, -1);
3
- }
4
- function o(t) {
5
- return r(t) === "Array";
6
- }
7
- function c(t) {
8
- if (r(t) !== "Object")
9
- return !1;
10
- const e = Object.getPrototypeOf(t);
11
- return !!e && e.constructor === Object && e === Object.prototype;
12
- }
1
+ import e from "./index221.js";
13
2
  export {
14
- r as getType,
15
- o as isArray,
16
- c as isPlainObject
3
+ e as default
17
4
  };
18
5
  //# sourceMappingURL=index253.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index253.js","sources":["../node_modules/is-what/dist/index.js"],"sourcesContent":["function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\n\nfunction isAnyObject(payload) {\n return getType(payload) === \"Object\";\n}\n\nfunction isArray(payload) {\n return getType(payload) === \"Array\";\n}\n\nfunction isBlob(payload) {\n return getType(payload) === \"Blob\";\n}\n\nfunction isBoolean(payload) {\n return getType(payload) === \"Boolean\";\n}\n\nfunction isDate(payload) {\n return getType(payload) === \"Date\" && !isNaN(payload);\n}\n\nfunction isEmptyArray(payload) {\n return isArray(payload) && payload.length === 0;\n}\n\nfunction isPlainObject(payload) {\n if (getType(payload) !== \"Object\")\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\n\nfunction isEmptyObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n}\n\nfunction isEmptyString(payload) {\n return payload === \"\";\n}\n\nfunction isError(payload) {\n return getType(payload) === \"Error\" || payload instanceof Error;\n}\n\nfunction isFile(payload) {\n return getType(payload) === \"File\";\n}\n\nfunction isFullArray(payload) {\n return isArray(payload) && payload.length > 0;\n}\n\nfunction isFullObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length > 0;\n}\n\nfunction isString(payload) {\n return getType(payload) === \"String\";\n}\n\nfunction isFullString(payload) {\n return isString(payload) && payload !== \"\";\n}\n\nfunction isFunction(payload) {\n return typeof payload === \"function\";\n}\n\nfunction isType(payload, type) {\n if (!(type instanceof Function)) {\n throw new TypeError(\"Type must be a function\");\n }\n if (!Object.prototype.hasOwnProperty.call(type, \"prototype\")) {\n throw new TypeError(\"Type is not a class\");\n }\n const name = type.name;\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\n}\n\nfunction isInstanceOf(value, classOrClassName) {\n if (typeof classOrClassName === \"function\") {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (isType(p, classOrClassName)) {\n return true;\n }\n }\n return false;\n } else {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (getType(p) === classOrClassName) {\n return true;\n }\n }\n return false;\n }\n}\n\nfunction isMap(payload) {\n return getType(payload) === \"Map\";\n}\n\nfunction isNaNValue(payload) {\n return getType(payload) === \"Number\" && isNaN(payload);\n}\n\nfunction isNumber(payload) {\n return getType(payload) === \"Number\" && !isNaN(payload);\n}\n\nfunction isNegativeNumber(payload) {\n return isNumber(payload) && payload < 0;\n}\n\nfunction isNull(payload) {\n return getType(payload) === \"Null\";\n}\n\nfunction isOneOf(a, b, c, d, e) {\n return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);\n}\n\nfunction isUndefined(payload) {\n return getType(payload) === \"Undefined\";\n}\n\nconst isNullOrUndefined = isOneOf(isNull, isUndefined);\n\nfunction isObject(payload) {\n return isPlainObject(payload);\n}\n\nfunction isObjectLike(payload) {\n return isAnyObject(payload);\n}\n\nfunction isPositiveNumber(payload) {\n return isNumber(payload) && payload > 0;\n}\n\nfunction isSymbol(payload) {\n return getType(payload) === \"Symbol\";\n}\n\nfunction isPrimitive(payload) {\n return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\n}\n\nfunction isPromise(payload) {\n return getType(payload) === \"Promise\";\n}\n\nfunction isRegExp(payload) {\n return getType(payload) === \"RegExp\";\n}\n\nfunction isSet(payload) {\n return getType(payload) === \"Set\";\n}\n\nfunction isWeakMap(payload) {\n return getType(payload) === \"WeakMap\";\n}\n\nfunction isWeakSet(payload) {\n return getType(payload) === \"WeakSet\";\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isInstanceOf, isMap, isNaNValue, isNegativeNumber, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPositiveNumber, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n"],"names":["getType","payload","isArray","isPlainObject","prototype"],"mappings":"AAAA,SAASA,EAAQC,GAAS;AACxB,SAAO,OAAO,UAAU,SAAS,KAAKA,CAAO,EAAE,MAAM,GAAG,EAAE;AAC5D;AAMA,SAASC,EAAQD,GAAS;AACxB,SAAOD,EAAQC,CAAO,MAAM;AAC9B;AAkBA,SAASE,EAAcF,GAAS;AAC9B,MAAID,EAAQC,CAAO,MAAM;AACvB,WAAO;AACT,QAAMG,IAAY,OAAO,eAAeH,CAAO;AAC/C,SAAO,CAAC,CAACG,KAAaA,EAAU,gBAAgB,UAAUA,MAAc,OAAO;AACjF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index253.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index254.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index245.js";
2
- import "./index246.js";
1
+ import o from "./index246.js";
2
+ import "./index247.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index29.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as C, ref as b, computed as f, openBlock as l, createElementBlock as i, mergeProps as g, createElementVNode as r, Fragment as I, renderList as V, normalizeClass as B, toDisplayString as h, renderSlot as x } from "vue";
2
- import { booleanishToBoolean as M } from "./index221.js";
3
- import { identity as F } from "./index203.js";
4
- import { isCssColor as p } from "./index196.js";
2
+ import { booleanishToBoolean as M } from "./index201.js";
3
+ import { identity as F } from "./index202.js";
4
+ import { isCssColor as p } from "./index197.js";
5
5
  import { isNotNil as T } from "./index124.js";
6
6
  const H = { class: "bb-base-rating__inner-container" }, D = { class: "bb-base-rating__label-text" }, N = ["autofocus", "checked", "disabled", "id", "name", "value"], j = ["width", "height"], A = /* @__PURE__ */ r("path", {
7
7
  "stroke-linecap": "round",
package/dist/index3.js CHANGED
@@ -1,36 +1,38 @@
1
- import { ref as c, watch as u, reactive as x, computed as f } from "vue";
1
+ import { ref as u, watch as c, reactive as x, computed as f } from "vue";
2
2
  import { isNil as l } from "./index120.js";
3
- let r = [], i = c(null);
4
- u(
3
+ let r = [], i = u(null);
4
+ c(
5
5
  () => i.value,
6
6
  () => {
7
7
  typeof i.value == "boolean" && (r.forEach((s) => s()), r = []);
8
8
  }
9
9
  );
10
10
  const o = {
11
- title: "",
12
- text: "",
11
+ actions: !0,
13
12
  description: "",
14
- yesText: "",
15
- noText: "",
16
13
  loading: !1,
14
+ no: !0,
15
+ noText: "",
17
16
  open: !1,
17
+ size: "sm",
18
+ text: "",
19
+ theme: "default",
20
+ title: "",
18
21
  yes: !0,
19
- no: !0,
20
- actions: !0,
21
- size: "sm"
22
- }, p = {
22
+ yesText: ""
23
+ }, d = {
23
24
  actions: !0,
24
- yes: !0,
25
+ description: "",
25
26
  no: !0,
26
- title: "",
27
+ noText: "Annulla",
27
28
  text: "",
28
- description: "",
29
- yesText: "OK",
30
- noText: "Annulla"
29
+ theme: "default",
30
+ title: "",
31
+ yes: !0,
32
+ yesText: "OK"
31
33
  }, e = x({
32
34
  ...o
33
- }), y = f(() => [
35
+ }), m = f(() => [
34
36
  {
35
37
  text: e.noText,
36
38
  handler: () => {
@@ -43,7 +45,7 @@ const o = {
43
45
  i.value = !0;
44
46
  }
45
47
  }
46
- ]), v = () => ({
48
+ ]), y = () => ({
47
49
  /**
48
50
  * The confirm function. It accepts a set of options defining
49
51
  * the behavior of the modal and returns `Promise<boolean>`
@@ -51,8 +53,8 @@ const o = {
51
53
  */
52
54
  confirm: (s) => {
53
55
  i.value = null;
54
- const n = { ...p, ...s }, t = { ...o };
55
- return t.title = n.title, t.text = n.text, n.description && (t.description = n.description), n.noText && (t.noText = n.noText), n.yesText && (t.yesText = n.yesText), n.size && (t.size = n.size), l(n.yes) || (t.yes = !!n.yes), l(n.no) || (t.no = !!n.no), l(n.actions) || (t.actions = !!n.actions), e.description = t.description, e.noText = t.noText, e.text = t.text, e.title = t.title, e.yesText = t.yesText, e.open = !0, e.actions = t.actions, e.yes = t.yes, e.no = t.no, e.size = t.size, new Promise((a) => {
56
+ const n = { ...d, ...s }, t = { ...o };
57
+ return t.title = n.title, t.text = n.text, n.description && (t.description = n.description), n.noText && (t.noText = n.noText), n.yesText && (t.yesText = n.yesText), n.size && (t.size = n.size), n.theme && (t.theme = n.theme), l(n.yes) || (t.yes = !!n.yes), l(n.no) || (t.no = !!n.no), l(n.actions) || (t.actions = !!n.actions), e.actions = t.actions, e.description = t.description, e.no = t.no, e.noText = t.noText, e.open = !0, e.size = t.size, e.text = t.text, e.theme = t.theme, e.title = t.title, e.yes = t.yes, e.yesText = t.yesText, new Promise((a) => {
56
58
  r.push(() => a(i.value));
57
59
  });
58
60
  },
@@ -66,13 +68,13 @@ const o = {
66
68
  * Closes the confirmation modal. It is a manual operation
67
69
  * so you can update the state while the modal is still open.
68
70
  */
69
- close: () => (e.description = o.description, e.loading = o.loading, e.noText = o.noText, e.open = o.open, e.text = o.text, e.title = o.title, e.yesText = o.yesText, i.value = !1, Promise.resolve().then(() => {
71
+ close: () => (e.description = o.description, e.loading = o.loading, e.noText = o.noText, e.open = o.open, e.text = o.text, e.theme = o.theme, e.title = o.title, e.yesText = o.yesText, i.value = !1, Promise.resolve().then(() => {
70
72
  i.value = null;
71
73
  }))
72
74
  });
73
75
  export {
74
- y as actions,
76
+ m as actions,
75
77
  e as state,
76
- v as useConfirm
78
+ y as useConfirm
77
79
  };
78
80
  //# sourceMappingURL=index3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index3.js","sources":["../src/composables/useConfirm.ts"],"sourcesContent":["import { computed, getCurrentInstance, reactive, ref, watch } from \"vue\";\nimport { isNil } from \"@/utilities/functions/isNil\";\nimport type { Sizes } from \"@/components/BaseDialog/BaseDialog.vue\";\n\ntype State = {\n description: string;\n loading: boolean;\n noText: string;\n open: boolean;\n text: string;\n title: string;\n yesText: string;\n yes: boolean;\n no: boolean;\n actions: boolean;\n size: keyof Sizes;\n};\n\ntype UserOptions = {\n /**\n * Boolean that sets whether to display or hide the buttons.\n * Confirms without actions can only be dismissed by clicking on the overlay or the close button.\n */\n actions?: State[\"actions\"];\n /**\n * Description of the content of the modal for accessibility purposes.\n */\n description?: State[\"description\"];\n /**\n * Boolean that defines whether to display or hide the \"No\" action.\n */\n no?: State[\"no\"];\n /**\n * Text content of the \"No\" action.\n */\n noText?: State[\"noText\"];\n /**\n * Text content of the modal.\n */\n text: State[\"text\"];\n /**\n * Tittle of the modal\n */\n title: State[\"title\"];\n /**\n * Boolean that defines whether to display or hide the \"Yes\" action.\n */\n yes?: State[\"yes\"];\n /**\n * Text content of the \"Yes\" action.\n */\n yesText?: State[\"yesText\"];\n /**\n * Size of the confirm modal. Use any sizes valid for `BbModal`.\n */\n size?: State[\"size\"];\n};\n\n// Stash all instances of current dialogs\nlet subscribers: Function[] = [];\n\nlet value = ref<boolean | null>(null);\n\nwatch(\n () => value.value,\n () => {\n if (typeof value.value === \"boolean\") {\n // Every time a dialog is resolved resolve all dialogs\n subscribers.forEach((fn) => fn());\n subscribers = [];\n }\n }\n);\n\nconst defaultState: State = {\n title: \"\",\n text: \"\",\n description: \"\",\n yesText: \"\",\n noText: \"\",\n loading: false,\n open: false,\n yes: true,\n no: true,\n actions: true,\n size: \"sm\",\n};\nconst defaultOption: UserOptions = {\n actions: true,\n yes: true,\n no: true,\n title: \"\",\n text: \"\",\n description: \"\",\n yesText: \"OK\",\n noText: \"Annulla\",\n};\n\nexport const state = reactive<State>({\n ...defaultState,\n});\n\nexport const actions = computed(() => [\n {\n text: state.noText,\n handler: () => {\n value.value = false;\n },\n },\n {\n text: state.yesText,\n handler: () => {\n value.value = true;\n },\n },\n]);\n\nexport const useConfirm = () => {\n return {\n /**\n * The confirm function. It accepts a set of options defining\n * the behavior of the modal and returns `Promise<boolean>`\n * when the user accepts, declines, or ignores the modal.\n */\n confirm: (options: UserOptions) => {\n value.value = null;\n const newOptions = { ...defaultOption, ...options };\n const newState = { ...defaultState };\n newState.title = newOptions.title;\n newState.text = newOptions.text;\n if (newOptions.description) newState.description = newOptions.description;\n if (newOptions.noText) newState.noText = newOptions.noText;\n if (newOptions.yesText) newState.yesText = newOptions.yesText;\n if (newOptions.size) newState.size = newOptions.size;\n if (!isNil(newOptions.yes)) newState.yes = !!newOptions.yes;\n if (!isNil(newOptions.no)) newState.no = !!newOptions.no;\n if (!isNil(newOptions.actions)) newState.actions = !!newOptions.actions;\n\n state.description = newState.description;\n state.noText = newState.noText;\n state.text = newState.text;\n state.title = newState.title;\n state.yesText = newState.yesText;\n state.open = true;\n state.actions = newState.actions;\n state.yes = newState.yes;\n state.no = newState.no;\n state.size = newState.size;\n\n return new Promise<boolean>((resolve) => {\n subscribers.push(() => resolve(value.value as boolean));\n });\n },\n /**\n * Sets the state of the confirm to loading and displays a spinner.\n */\n setLoading: (value: boolean = true) => {\n state.loading = value;\n },\n /**\n * Closes the confirmation modal. It is a manual operation\n * so you can update the state while the modal is still open.\n */\n close: () => {\n state.description = defaultState.description;\n state.loading = defaultState.loading;\n state.noText = defaultState.noText;\n state.open = defaultState.open;\n state.text = defaultState.text;\n state.title = defaultState.title;\n state.yesText = defaultState.yesText;\n value.value = false;\n return Promise.resolve().then(() => {\n value.value = null;\n });\n },\n };\n};\n"],"names":["subscribers","value","ref","watch","fn","defaultState","defaultOption","state","reactive","actions","computed","useConfirm","options","newOptions","newState","isNil","resolve"],"mappings":";;AA2DA,IAAIA,IAA0B,CAAA,GAE1BC,IAAQC,EAAoB,IAAI;AAEpCC;AAAA,EACE,MAAMF,EAAM;AAAA,EACZ,MAAM;AACA,IAAA,OAAOA,EAAM,SAAU,cAEzBD,EAAY,QAAQ,CAACI,MAAOA,EAAI,CAAA,GAChCJ,IAAc,CAAA;AAAA,EAElB;AACF;AAEA,MAAMK,IAAsB;AAAA,EAC1B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AACR,GACMC,IAA6B;AAAA,EACjC,SAAS;AAAA,EACT,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AACV,GAEaC,IAAQC,EAAgB;AAAA,EACnC,GAAGH;AACL,CAAC,GAEYI,IAAUC,EAAS,MAAM;AAAA,EACpC;AAAA,IACE,MAAMH,EAAM;AAAA,IACZ,SAAS,MAAM;AACb,MAAAN,EAAM,QAAQ;AAAA,IAChB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAMM,EAAM;AAAA,IACZ,SAAS,MAAM;AACb,MAAAN,EAAM,QAAQ;AAAA,IAChB;AAAA,EACF;AACF,CAAC,GAEYU,IAAa,OACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAML,SAAS,CAACC,MAAyB;AACjC,IAAAX,EAAM,QAAQ;AAC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U,KAAK,MAAM;AAClC,IAAAA,EAAM,QAAQ;AAAA,EAAA,CACf;AACH;"}
1
+ {"version":3,"file":"index3.js","sources":["../src/composables/useConfirm.ts"],"sourcesContent":["import { computed, reactive, ref, watch } from \"vue\";\nimport { isNil } from \"@/utilities/functions/isNil\";\nimport type { Sizes } from \"@/components/BaseDialog/BaseDialog.vue\";\n\ntype State = {\n description: string;\n theme: string;\n loading: boolean;\n noText: string;\n open: boolean;\n text: string;\n title: string;\n yesText: string;\n yes: boolean;\n no: boolean;\n actions: boolean;\n size: keyof Sizes;\n};\n\ntype UserOptions = {\n /**\n * Boolean that sets whether to display or hide the buttons.\n * Confirms without actions can only be dismissed by clicking on the overlay or the close button.\n */\n actions?: State[\"actions\"];\n /**\n * Description of the content of the modal for accessibility purposes.\n */\n description?: State[\"description\"];\n /**\n * Boolean that defines whether to display or hide the \"No\" action.\n */\n no?: State[\"no\"];\n /**\n * Text content of the \"No\" action.\n */\n noText?: State[\"noText\"];\n /**\n * Text content of the modal.\n */\n text: State[\"text\"];\n /**\n * The name of the theme it applies a css class to BbConfirm for styling.\n */\n theme?: State[\"theme\"];\n /**\n * Tittle of the modal\n */\n title: State[\"title\"];\n /**\n * Boolean that defines whether to display or hide the \"Yes\" action.\n */\n yes?: State[\"yes\"];\n /**\n * Text content of the \"Yes\" action.\n */\n yesText?: State[\"yesText\"];\n /**\n * Size of the confirm modal. Use any sizes valid for `BbModal`.\n */\n size?: State[\"size\"];\n};\n\n// Stash all instances of current dialogs\nlet subscribers: Function[] = [];\n\nlet value = ref<boolean | null>(null);\n\nwatch(\n () => value.value,\n () => {\n if (typeof value.value === \"boolean\") {\n // Every time a dialog is resolved resolve all dialogs\n subscribers.forEach((fn) => fn());\n subscribers = [];\n }\n }\n);\n\nconst defaultState: State = {\n actions: true,\n description: \"\",\n loading: false,\n no: true,\n noText: \"\",\n open: false,\n size: \"sm\",\n text: \"\",\n theme: \"default\",\n title: \"\",\n yes: true,\n yesText: \"\",\n};\nconst defaultOption: UserOptions = {\n actions: true,\n description: \"\",\n no: true,\n noText: \"Annulla\",\n text: \"\",\n theme: \"default\",\n title: \"\",\n yes: true,\n yesText: \"OK\",\n};\n\nexport const state = reactive<State>({\n ...defaultState,\n});\n\nexport const actions = computed(() => [\n {\n text: state.noText,\n handler: () => {\n value.value = false;\n },\n },\n {\n text: state.yesText,\n handler: () => {\n value.value = true;\n },\n },\n]);\n\nexport const useConfirm = () => {\n return {\n /**\n * The confirm function. It accepts a set of options defining\n * the behavior of the modal and returns `Promise<boolean>`\n * when the user accepts, declines, or ignores the modal.\n */\n confirm: (options: UserOptions) => {\n value.value = null;\n const newOptions = { ...defaultOption, ...options };\n const newState = { ...defaultState };\n newState.title = newOptions.title;\n newState.text = newOptions.text;\n if (newOptions.description) newState.description = newOptions.description;\n if (newOptions.noText) newState.noText = newOptions.noText;\n if (newOptions.yesText) newState.yesText = newOptions.yesText;\n if (newOptions.size) newState.size = newOptions.size;\n if (newOptions.theme) newState.theme = newOptions.theme;\n if (!isNil(newOptions.yes)) newState.yes = !!newOptions.yes;\n if (!isNil(newOptions.no)) newState.no = !!newOptions.no;\n if (!isNil(newOptions.actions)) newState.actions = !!newOptions.actions;\n\n state.actions = newState.actions;\n state.description = newState.description;\n state.no = newState.no;\n state.noText = newState.noText;\n state.open = true;\n state.size = newState.size;\n state.text = newState.text;\n state.theme = newState.theme;\n state.title = newState.title;\n state.yes = newState.yes;\n state.yesText = newState.yesText;\n\n return new Promise<boolean>((resolve) => {\n subscribers.push(() => resolve(value.value as boolean));\n });\n },\n /**\n * Sets the state of the confirm to loading and displays a spinner.\n */\n setLoading: (value: boolean = true) => {\n state.loading = value;\n },\n /**\n * Closes the confirmation modal. It is a manual operation\n * so you can update the state while the modal is still open.\n */\n close: () => {\n state.description = defaultState.description;\n state.loading = defaultState.loading;\n state.noText = defaultState.noText;\n state.open = defaultState.open;\n state.text = defaultState.text;\n state.theme = defaultState.theme;\n state.title = defaultState.title;\n state.yesText = defaultState.yesText;\n value.value = false;\n return Promise.resolve().then(() => {\n value.value = null;\n });\n },\n };\n};\n"],"names":["subscribers","value","ref","watch","fn","defaultState","defaultOption","state","reactive","actions","computed","useConfirm","options","newOptions","newState","isNil","resolve"],"mappings":";;AAgEA,IAAIA,IAA0B,CAAA,GAE1BC,IAAQC,EAAoB,IAAI;AAEpCC;AAAA,EACE,MAAMF,EAAM;AAAA,EACZ,MAAM;AACA,IAAA,OAAOA,EAAM,SAAU,cAEzBD,EAAY,QAAQ,CAACI,MAAOA,EAAI,CAAA,GAChCJ,IAAc,CAAA;AAAA,EAElB;AACF;AAEA,MAAMK,IAAsB;AAAA,EAC1B,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,SAAS;AACX,GACMC,IAA6B;AAAA,EACjC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,SAAS;AACX,GAEaC,IAAQC,EAAgB;AAAA,EACnC,GAAGH;AACL,CAAC,GAEYI,IAAUC,EAAS,MAAM;AAAA,EACpC;AAAA,IACE,MAAMH,EAAM;AAAA,IACZ,SAAS,MAAM;AACb,MAAAN,EAAM,QAAQ;AAAA,IAChB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAMM,EAAM;AAAA,IACZ,SAAS,MAAM;AACb,MAAAN,EAAM,QAAQ;AAAA,IAChB;AAAA,EACF;AACF,CAAC,GAEYU,IAAa,OACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAML,SAAS,CAACC,MAAyB;AACjC,IAAAX,EAAM,QAAQ;AACd,UAAMY,IAAa,EAAE,GAAGP,GAAe,GAAGM,E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UAAUF,EAAa,SAC7BJ,EAAM,QAAQ,IACP,QAAQ,UAAU,KAAK,MAAM;AAClC,IAAAA,EAAM,QAAQ;AAAA,EAAA,CACf;AACH;"}
package/dist/index31.js CHANGED
@@ -3,17 +3,17 @@ import Pe from "./index115.js";
3
3
  import "./index158.js";
4
4
  import He from "./index119.js";
5
5
  import "./index185.js";
6
- import { autoUpdate as je, computePosition as Qe, flip as Ue, shift as We } from "./index199.js";
6
+ import { autoUpdate as je, computePosition as Qe, flip as Ue, shift as We } from "./index215.js";
7
7
  import { deepEqual as re } from "./index123.js";
8
- import { head as le } from "./index220.js";
8
+ import { head as le } from "./index216.js";
9
9
  import { isNotNil as I } from "./index124.js";
10
- import { last as Re } from "./index204.js";
10
+ import { last as Re } from "./index213.js";
11
11
  import { useItemText as Ke } from "./index125.js";
12
12
  import { useItemValue as Ye } from "./index126.js";
13
13
  import { wait as q } from "./index122.js";
14
- import { waitFor as Ze } from "./index210.js";
15
- import { when as Ge } from "./index197.js";
16
- import { offset as Xe } from "./index207.js";
14
+ import { waitFor as Ze } from "./index205.js";
15
+ import { when as Ge } from "./index198.js";
16
+ import { offset as Xe } from "./index217.js";
17
17
  const el = { class: "bb-base-select__input-container" }, ll = ["autocomplete", "autofocus", "disabled", "id", "placeholder", "readonly"], tl = {
18
18
  key: 0,
19
19
  class: "bb-base-select__loading-container"
package/dist/index33.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as R, ref as l, onMounted as S, watchEffect as z, computed as y, openBlock as D, createElementBlock as F, mergeProps as h, renderSlot as g, createElementVNode as t, normalizeProps as H, guardReactiveProps as T, normalizeStyle as E, unref as X } from "vue";
2
- import { clamp as K } from "./index198.js";
3
- import { isCssColor as w } from "./index196.js";
2
+ import { clamp as K } from "./index196.js";
3
+ import { isCssColor as w } from "./index197.js";
4
4
  import { isNil as O } from "./index120.js";
5
5
  import { transposeValue as L } from "./index121.js";
6
6
  const Y = { class: "bb-base-slider__slider-container" }, j = ["disabled", "id", "name", "readonly", "value"], q = ["aria-readonly", "aria-valuemax", "aria-valuemin", "aria-valuenow", "tabindex"], W = /* @__PURE__ */ R({
package/dist/index35.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as I, ref as b, computed as n, watch as F, openBlock as m, createElementBlock as p, normalizeClass as N, normalizeProps as c, mergeProps as h, createCommentVNode as S, createElementVNode as l, renderSlot as x, guardReactiveProps as f } from "vue";
2
- import { isCssColor as V } from "./index196.js";
3
- import { when as A } from "./index197.js";
2
+ import { isCssColor as V } from "./index197.js";
3
+ import { when as A } from "./index198.js";
4
4
  const J = { class: "bb-base-switch-container" }, M = /* @__PURE__ */ l("span", { class: "bb-base-switch-container__icon-thumb" }, null, -1), O = [
5
5
  M
6
6
  ], H = /* @__PURE__ */ I({
package/dist/index47.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as p, computed as u, ref as d, watch as f, openBlock as a, createElementBlock as l, normalizeProps as b, guardReactiveProps as z, createElementVNode as v, renderSlot as g, createCommentVNode as h } from "vue";
2
- import { isCssColor as _ } from "./index196.js";
2
+ import { isCssColor as _ } from "./index197.js";
3
3
  const k = { class: "bb-avatar__fallback" }, C = ["alt", "src", "srcset", "sizes"], B = /* @__PURE__ */ p({
4
4
  __name: "BbAvatar",
5
5
  props: {
package/dist/index49.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as p, useSlots as d, computed as n, openBlock as m, createElementBlock as u, normalizeClass as g, createElementVNode as s, renderSlot as l, mergeProps as f, createTextVNode as _, toDisplayString as y } from "vue";
2
- import { isCssColor as r } from "./index196.js";
2
+ import { isCssColor as r } from "./index197.js";
3
3
  import { isNil as B } from "./index120.js";
4
4
  const C = { class: "bb-badge__wrapper" }, h = { class: "bb-badge__content-inner" }, S = /* @__PURE__ */ p({
5
5
  __name: "BbBadge",