bitboss-ui 2.1.25 → 2.1.26

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 (179) hide show
  1. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +2 -7
  2. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +2 -7
  3. package/dist/index.css +1 -1
  4. package/dist/index106.js +9 -9
  5. package/dist/index111.js +1 -1
  6. package/dist/index113.js +1 -1
  7. package/dist/index121.js +11 -11
  8. package/dist/index13.js +1 -1
  9. package/dist/index131.js +4 -4
  10. package/dist/index133.js +1 -1
  11. package/dist/index137.js +2 -2
  12. package/dist/index138.js +1 -1
  13. package/dist/index15.js +8 -8
  14. package/dist/index17.js +3 -3
  15. package/dist/index19.js +8 -8
  16. package/dist/index206.js +2 -138
  17. package/dist/index207.js +138 -2
  18. package/dist/index209.js +10 -34
  19. package/dist/index21.js +16 -16
  20. package/dist/index210.js +3 -86
  21. package/dist/index211.js +15 -0
  22. package/dist/index212.js +13 -29
  23. package/dist/index213.js +69 -17
  24. package/dist/index215.js +34 -15
  25. package/dist/index216.js +5 -3
  26. package/dist/index217.js +5 -12
  27. package/dist/index218.js +5 -16
  28. package/dist/index219.js +5 -5
  29. package/dist/index220.js +4 -4
  30. package/dist/index221.js +5 -5
  31. package/dist/index222.js +5 -5
  32. package/dist/index223.js +3 -5
  33. package/dist/index224.js +2 -5
  34. package/dist/index225.js +8 -2
  35. package/dist/index226.js +250 -2
  36. package/dist/index227.js +52 -2
  37. package/dist/index228.js +43 -12
  38. package/dist/index229.js +5 -11
  39. package/dist/index23.js +15 -15
  40. package/dist/index230.js +58 -18
  41. package/dist/index231.js +12 -68
  42. package/dist/index232.js +13 -0
  43. package/dist/index233.js +2 -13
  44. package/dist/index234.js +8 -113
  45. package/dist/index235.js +116 -0
  46. package/dist/index237.js +23 -18
  47. package/dist/index238.js +182 -11
  48. package/dist/index239.js +3 -6
  49. package/dist/index240.js +5 -4
  50. package/dist/index241.js +2 -106
  51. package/dist/index242.js +4 -0
  52. package/dist/index243.js +19 -99
  53. package/dist/index244.js +4 -0
  54. package/dist/index245.js +4 -229
  55. package/dist/index246.js +86 -3
  56. package/dist/index248.js +29 -2
  57. package/dist/index249.js +17 -4
  58. package/dist/index25.js +59 -57
  59. package/dist/index250.js +49 -195
  60. package/dist/index251.js +17 -0
  61. package/dist/index252.js +12 -5
  62. package/dist/index253.js +16 -5
  63. package/dist/index254.js +104 -6
  64. package/dist/index256.js +95 -47
  65. package/dist/index258.js +6 -5
  66. package/dist/index259.js +15 -59
  67. package/dist/index260.js +8 -182
  68. package/dist/index261.js +2 -2
  69. package/dist/index262.js +18 -2
  70. package/dist/index263.js +11 -6
  71. package/dist/index264.js +6 -7
  72. package/dist/index265.js +229 -6
  73. package/dist/index266.js +2 -16
  74. package/dist/index267.js +6 -9
  75. package/dist/index268.js +7 -3
  76. package/dist/index269.js +4 -9
  77. package/dist/index27.js +1 -1
  78. package/dist/index270.js +196 -7
  79. package/dist/index272.js +3 -9
  80. package/dist/index273.js +5 -9
  81. package/dist/index274.js +9 -23
  82. package/dist/index275.js +8 -2
  83. package/dist/index276.js +2 -5
  84. package/dist/index277.js +1 -1
  85. package/dist/index278.js +1 -1
  86. package/dist/index279.js +1 -1
  87. package/dist/index280.js +7 -2
  88. package/dist/index281.js +11 -3
  89. package/dist/index283.js +7 -28
  90. package/dist/index284.js +3 -280
  91. package/dist/index285.js +2 -2
  92. package/dist/index286.js +3 -124
  93. package/dist/index287.js +280 -2
  94. package/dist/index288.js +2 -15
  95. package/dist/index289.js +16 -2
  96. package/dist/index29.js +3 -3
  97. package/dist/index290.js +2 -16
  98. package/dist/index291.js +16 -2
  99. package/dist/index292.js +2 -16
  100. package/dist/index293.js +19 -2
  101. package/dist/index294.js +2 -19
  102. package/dist/index295.js +15 -2
  103. package/dist/index296.js +2 -3
  104. package/dist/index297.js +21 -0
  105. package/dist/index298.js +2 -7
  106. package/dist/index299.js +27 -3
  107. package/dist/index300.js +2 -7
  108. package/dist/index301.js +2 -11
  109. package/dist/index302.js +2 -4
  110. package/dist/index303.js +2 -6
  111. package/dist/index304.js +2 -3
  112. package/dist/index305.js +28 -3
  113. package/dist/index306.js +21 -1
  114. package/dist/index308.js +3 -5
  115. package/dist/index309.js +6 -3
  116. package/dist/index31.js +2 -2
  117. package/dist/index310.js +5 -19
  118. package/dist/index311.js +125 -2
  119. package/dist/index312.js +2 -27
  120. package/dist/index313.js +4 -2
  121. package/dist/index314.js +3 -2
  122. package/dist/index315.js +17 -2
  123. package/dist/index316.js +3 -2
  124. package/dist/index317.js +3 -2
  125. package/dist/index318.js +718 -22
  126. package/dist/index319.js +368 -0
  127. package/dist/index320.js +58 -718
  128. package/dist/index321.js +2 -366
  129. package/dist/index322.js +5 -58
  130. package/dist/index323.js +3 -5
  131. package/dist/index324.js +33 -2
  132. package/dist/index325.js +27 -128
  133. package/dist/index327.js +2 -58
  134. package/dist/index328.js +7 -58
  135. package/dist/index329.js +6 -227
  136. package/dist/index33.js +8 -8
  137. package/dist/index330.js +18 -32
  138. package/dist/index331.js +57 -27
  139. package/dist/index332.js +60 -0
  140. package/dist/index333.js +126 -44
  141. package/dist/index334.js +368 -6
  142. package/dist/index335.js +45 -17
  143. package/dist/index336.js +227 -6
  144. package/dist/index337.js +92 -7
  145. package/dist/index338.js +7 -5
  146. package/dist/index339.js +6 -8
  147. package/dist/index340.js +7 -92
  148. package/dist/index342.js +1 -1
  149. package/dist/index35.js +4 -4
  150. package/dist/index37.js +20 -20
  151. package/dist/index39.js +6 -6
  152. package/dist/index41.js +2 -2
  153. package/dist/index43.js +8 -8
  154. package/dist/index45.js +8 -8
  155. package/dist/index47.js +2 -2
  156. package/dist/index49.js +3 -3
  157. package/dist/index53.js +1 -1
  158. package/dist/index55.js +1 -1
  159. package/dist/index57.js +2 -2
  160. package/dist/index61.js +3 -3
  161. package/dist/index67.js +1 -1
  162. package/dist/index79.js +4 -4
  163. package/dist/index81.js +1 -1
  164. package/dist/index83.js +2 -2
  165. package/dist/index85.js +1 -1
  166. package/dist/index87.js +1 -1
  167. package/dist/index90.js +59 -57
  168. package/dist/index92.js +2 -2
  169. package/dist/index94.js +3 -3
  170. package/package.json +1 -1
  171. package/dist/index214.js +0 -53
  172. package/dist/index236.js +0 -15
  173. package/dist/index247.js +0 -4
  174. package/dist/index255.js +0 -252
  175. package/dist/index257.js +0 -46
  176. package/dist/index271.js +0 -5
  177. package/dist/index282.js +0 -19
  178. package/dist/index307.js +0 -6
  179. package/dist/index326.js +0 -371
package/dist/index229.js CHANGED
@@ -1,13 +1,7 @@
1
- import { ref as a, watch as c, toValue as u } from "vue";
2
- const i = (e, { initialValue: o = !1, nextValue: r = !0 } = {}) => {
3
- const t = a(o), n = c(
4
- () => u(e),
5
- (s) => {
6
- s && (t.value = r, n());
7
- }
8
- );
9
- return t;
10
- };
1
+ import o from "./index306.js";
2
+ /* empty css */
3
+ import t from "./index283.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8c6b13bd"]]);
11
5
  export {
12
- i as useUntil
6
+ m as default
13
7
  };
package/dist/index23.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { defineComponent as K, watchEffect as Q, ref as i, computed as g, watch as D, createBlock as C, openBlock as Y, normalizeClass as w, withCtx as s, createElementVNode as n, createVNode as B, createCommentVNode as X, unref as r, withDirectives as x, mergeProps as S, withModifiers as ee, toDisplayString as E, renderSlot as c } from "vue";
2
2
  import { _config as te } from "./index4.js";
3
- import o from "./index219.js";
4
- import ae from "./index220.js";
5
- import oe from "./index221.js";
6
- import ne from "./index222.js";
7
- import re from "./index223.js";
8
- import le from "./index224.js";
9
- import { identity as ie } from "./index225.js";
10
- import { isEmpty as se } from "./index226.js";
11
- import { last as de } from "./index227.js";
3
+ import o from "./index216.js";
4
+ import ae from "./index240.js";
5
+ import oe from "./index220.js";
6
+ import ne from "./index217.js";
7
+ import re from "./index218.js";
8
+ import le from "./index219.js";
9
+ import { identity as ie } from "./index241.js";
10
+ import { isEmpty as se } from "./index242.js";
11
+ import { last as de } from "./index224.js";
12
12
  import { useId as ue } from "./index8.js";
13
- import { useLocale as pe } from "./index228.js";
13
+ import { useLocale as pe } from "./index211.js";
14
14
  import { useMobile as ce } from "./index9.js";
15
- import { useUntil as me } from "./index229.js";
16
- import { vMaska as fe } from "./index230.js";
15
+ import { useUntil as me } from "./index232.js";
16
+ import { vMaska as fe } from "./index243.js";
17
17
  import be from "./index21.js";
18
18
  /* empty css */
19
- import ke from "./index231.js";
19
+ import ke from "./index213.js";
20
20
  /* empty css */
21
- import ge from "./index233.js";
22
- import ye from "./index234.js";
21
+ import ge from "./index212.js";
22
+ import ye from "./index235.js";
23
23
  /* empty css */
24
24
  const ve = { class: "bb-base-date-picker-input__inner-wrapper" }, Ve = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska", "disabled", "inputmode", "name", "placeholder", "readonly", "required", "value"], he = ["aria-label", "disabled"], Me = ["id"], De = ["inert"], Ze = /* @__PURE__ */ K({
25
25
  __name: "BaseDatePickerInput",
package/dist/index230.js CHANGED
@@ -1,22 +1,62 @@
1
- import { MaskInput as r } from "./index260.js";
2
- const u = /* @__PURE__ */ new WeakMap(), p = (a, n) => {
3
- if (a.arg == null || a.instance == null) return;
4
- const s = "setup" in a.instance.$.type;
5
- a.arg in a.instance ? a.instance[a.arg] = n : s && console.warn("Maska: please expose `%s` using defineExpose", a.arg);
6
- }, k = (a, n) => {
7
- var s;
8
- const t = a instanceof HTMLInputElement ? a : a.querySelector("input");
9
- if (t == null || (t == null ? void 0 : t.type) === "file") return;
10
- let e = {};
11
- if (n.value != null && (e = typeof n.value == "string" ? { mask: n.value } : { ...n.value }), n.arg != null) {
12
- const l = (o) => {
13
- const i = n.modifiers.unmasked ? o.unmasked : n.modifiers.completed ? o.completed : o.masked;
14
- p(n, i);
1
+ import { defineComponent as g, ref as i, computed as d, onMounted as h, createElementBlock as m, openBlock as u, createElementVNode as y, Fragment as x, renderList as B, createBlock as C, normalizeClass as S, withCtx as T, createTextVNode as E, toDisplayString as w } from "vue";
2
+ import { range as H } from "./index328.js";
3
+ import M from "./index13.js";
4
+ /* empty css */
5
+ const n = 10, l = 3, V = /* @__PURE__ */ g({
6
+ __name: "BaseDatePickerYearSelector",
7
+ props: {
8
+ cursor: {},
9
+ disabled: { type: Boolean }
10
+ },
11
+ emits: ["update:year"],
12
+ setup(p, { emit: _ }) {
13
+ const f = p, b = _, o = i(), r = d(() => f.cursor.year()), c = i(r.value - n * l), s = i(r.value + n * l), v = d(
14
+ () => H(c.value, s.value).map((e) => ({
15
+ text: e,
16
+ key: e,
17
+ selected: e === r.value,
18
+ handler: () => b("update:year", e)
19
+ }))
20
+ ), k = (e) => {
21
+ const t = e.target;
22
+ t.scrollTop <= 100 ? c.value = Math.max(
23
+ c.value - n * l,
24
+ r.value - 200
25
+ ) : t.scrollHeight - t.scrollTop === t.clientHeight && (s.value = Math.min(s.value + n * l, 2101));
15
26
  };
16
- e.onMaska = e.onMaska == null ? l : Array.isArray(e.onMaska) ? [...e.onMaska, l] : [e.onMaska, l];
27
+ return h(() => {
28
+ if (!o.value) return;
29
+ const e = o.value.querySelector(
30
+ ".content__btn--selected"
31
+ );
32
+ e && (e.parentElement.scrollTop = e.offsetTop - e.parentElement.clientHeight / 2 + 16);
33
+ }), (e, t) => (u(), m("div", {
34
+ ref_key: "container",
35
+ ref: o,
36
+ class: "bb-base-date-picker__button-menu bb-base-date-picker__year-selector scrollbar-border"
37
+ }, [
38
+ y("div", {
39
+ class: "content",
40
+ onScrollPassive: k
41
+ }, [
42
+ (u(!0), m(x, null, B(v.value, (a) => (u(), C(M, {
43
+ key: a.key,
44
+ class: S({
45
+ content__btn: !0,
46
+ "content__btn--selected": a.selected
47
+ }),
48
+ disabled: e.disabled,
49
+ onClick: a.handler
50
+ }, {
51
+ default: T(() => [
52
+ E(w(a.text), 1)
53
+ ]),
54
+ _: 2
55
+ }, 1032, ["class", "disabled", "onClick"]))), 128))
56
+ ], 32)
57
+ ], 512));
17
58
  }
18
- u.has(t) ? (s = u.get(t)) == null || s.update(e) : u.set(t, new r(t, e));
19
- };
59
+ });
20
60
  export {
21
- k as vMaska
61
+ V as default
22
62
  };
package/dist/index231.js CHANGED
@@ -1,71 +1,15 @@
1
- import { defineComponent as k, ref as y, createElementBlock as C, openBlock as t, normalizeClass as N, renderSlot as n, createBlock as s, createCommentVNode as l, createVNode as a, createElementVNode as m, unref as i } from "vue";
2
- /* empty css */
3
- /* empty css */
4
- import u from "./index85.js";
5
- /* empty css */
6
- import h from "./index113.js";
7
- /* empty css */
8
- import v from "./index330.js";
9
- import B from "./index331.js";
10
- /* empty css */
11
- const E = { class: "bb-common-input-inner-container__prefix" }, I = { class: "bb-common-input-inner-container__suffix" }, R = /* @__PURE__ */ k({
12
- __name: "CommonInputInnerContainer",
13
- props: {
14
- "append:icon": {},
15
- clearable: { type: Boolean },
16
- "prepend:icon": {},
17
- preventFocus: { type: Boolean }
18
- },
19
- emits: ["click:clear"],
20
- setup(f, { emit: d }) {
21
- const p = f, b = d, o = y(), _ = (e) => {
22
- var c;
23
- if (!o.value || p.preventFocus) return;
24
- const r = e.target;
25
- r.tagName === "INPUT" || r.tagName === "TEXTAREA" || (c = o.value.querySelector("input,textarea")) == null || c.focus();
26
- }, $ = () => {
27
- var e;
28
- b("click:clear"), (e = o.value.querySelector("input,textarea")) == null || e.focus();
29
- };
30
- return (e, r) => (t(), C("span", {
31
- ref_key: "container",
32
- ref: o,
33
- class: N(["bb-common-input-inner-container", {
34
- "bb-common-input-inner-container--clearable": p.clearable
35
- }]),
36
- onClick: _
37
- }, [
38
- n(e.$slots, "prepend", {}, () => [
39
- m("span", E, [
40
- n(e.$slots, "prefix")
41
- ])
42
- ]),
43
- e.$props["prepend:icon"] ? (t(), s(i(u), {
44
- key: 0,
45
- class: "bb-common-input-inner-container__prepend-icon",
46
- type: e.$props["prepend:icon"]
47
- }, null, 8, ["type"])) : l("", !0),
48
- n(e.$slots, "default"),
49
- a(B, {
50
- "aria-hidden": !e.clearable,
51
- tabindex: e.clearable ? 0 : -1,
52
- onClick: $
53
- }, null, 8, ["aria-hidden", "tabindex"]),
54
- e.$props["append:icon"] ? (t(), s(i(u), {
55
- key: 1,
56
- class: "bb-common-input-inner-container__append-icon",
57
- type: e.$props["append:icon"]
58
- }, null, 8, ["type"])) : l("", !0),
59
- a(v),
60
- a(i(h)),
61
- n(e.$slots, "append", {}, () => [
62
- m("span", I, [
63
- n(e.$slots, "suffix")
64
- ])
65
- ])
66
- ], 2));
1
+ const c = (t, r) => {
2
+ if (typeof t == "string") {
3
+ const e = /^(\d+)([a-zA-Z%]+)?$/, n = t.match(e);
4
+ if (n) {
5
+ const [, o, a] = n;
6
+ return a ? t : o + "px";
7
+ } else if (t in r)
8
+ return r[t] + "px";
9
+ throw new Error(`Invalid size: ${t}`);
67
10
  }
68
- });
11
+ return t + "px";
12
+ };
69
13
  export {
70
- R as default
14
+ c as parseSize
71
15
  };
@@ -0,0 +1,13 @@
1
+ import { ref as a, watch as c, toValue as u } from "vue";
2
+ const i = (e, { initialValue: o = !1, nextValue: r = !0 } = {}) => {
3
+ const t = a(o), n = c(
4
+ () => u(e),
5
+ (s) => {
6
+ s && (t.value = r, n());
7
+ }
8
+ );
9
+ return t;
10
+ };
11
+ export {
12
+ i as useUntil
13
+ };
package/dist/index233.js CHANGED
@@ -1,15 +1,4 @@
1
- import { createElementBlock as t, openBlock as n, renderSlot as e } from "vue";
2
- /* empty css */
3
- import r from "./index298.js";
4
- const s = {}, c = { class: "bb-common-input-outer-container" };
5
- function p(o, a) {
6
- return n(), t("span", c, [
7
- e(o.$slots, "prepend-outer"),
8
- e(o.$slots, "default"),
9
- e(o.$slots, "append-outer")
10
- ]);
11
- }
12
- const i = /* @__PURE__ */ r(s, [["render", p]]);
1
+ const s = (r) => !!r && !!r.match(/^(#|var\(--|(rgb|hsl)a?\()/);
13
2
  export {
14
- i as default
3
+ s as isCssColor
15
4
  };
package/dist/index234.js CHANGED
@@ -1,116 +1,11 @@
1
- import { defineComponent as P, mergeModels as D, useModel as V, ref as r, watch as A, onMounted as x, computed as S, createBlock as b, openBlock as v, resolveDynamicComponent as g, normalizeStyle as z, normalizeClass as E, unref as l, withCtx as w, renderSlot as y, createCommentVNode as N, mergeProps as h, createElementVNode as C } from "vue";
2
- import { wait as F } from "./index135.js";
3
- import { useFloating as U, arrow as j } from "./index325.js";
4
- import { flip as q, offset as G, shift as H, hide as I, autoUpdate as J } from "./index326.js";
5
- const K = { class: "bb-common-popover__bubble" }, W = /* @__PURE__ */ P({
6
- __name: "CommonPopover",
7
- props: /* @__PURE__ */ D({
8
- arrowPadding: {},
9
- offset: {},
10
- block: { type: Boolean },
11
- padding: { default: 0 },
12
- placement: {},
13
- transitionDuration: { default: 250 },
14
- containerAttributes: {},
15
- dialog: { type: Boolean },
16
- renderContent: { type: Boolean, default: !0 },
17
- tag: { default: "span" },
18
- flip: { type: Boolean, default: !0 }
19
- }, {
20
- modelValue: { type: Boolean, default: !1 },
21
- modelModifiers: {}
22
- }),
23
- emits: ["update:modelValue"],
24
- setup(s) {
25
- const o = s, a = V(s, "modelValue"), i = r(), t = r(), p = r(), { floatingStyles: k, placement: _, middlewareData: n, update: B } = U(
26
- i,
27
- t,
28
- {
29
- placement: o.placement,
30
- whileElementsMounted: J,
31
- middleware: [
32
- ...o.flip ? [q()] : [],
33
- G(o.offset),
34
- H({ padding: o.padding }),
35
- I(),
36
- j({
37
- element: p,
38
- padding: o.arrowPadding
39
- })
40
- ],
41
- strategy: "fixed"
42
- }
43
- ), d = (e) => {
44
- e ? (B(), o.dialog ? t.value.showModal() : t.value.showPopover()) : F(o.transitionDuration).then(() => {
45
- t.value && (o.dialog ? t.value.close() : t.value.hidePopover());
46
- });
47
- };
48
- A(a, d, { flush: "post" }), x(() => {
49
- a.value && d(a.value);
50
- });
51
- const M = S(() => {
52
- if (n.value.arrow) {
53
- const { x: e, y: u } = n.value.arrow;
54
- return {
55
- style: {
56
- left: `${e}px`,
57
- top: `${u}px`
58
- }
59
- };
60
- }
61
- }), $ = () => {
62
- a.value = !1;
63
- };
64
- return (e, u) => (v(), b(g(e.dialog ? "div" : e.tag), {
65
- ref_key: "wrapper",
66
- ref: i,
67
- class: E(["bb-common-popover", {
68
- "bb-common-popover--open": a.value && !!t.value,
69
- "bb-common-popover--block": o.block,
70
- [`bb-common-popover--${l(_)}`]: !0
71
- }]),
72
- style: z({
73
- "--transition-duration": `${o.transitionDuration}ms`
74
- })
75
- }, {
76
- default: w(() => {
77
- var m, f, c;
78
- return [
79
- y(e.$slots, "activator"),
80
- e.renderContent ? (v(), b(g(e.dialog ? "dialog" : e.tag), h({
81
- key: 0,
82
- ref_key: "content",
83
- ref: t,
84
- class: ["bb-common-popover__bubble-container", {
85
- "bb-common-popover__bubble-container--open": a.value && !!t.value
86
- }],
87
- popover: "manual",
88
- style: {
89
- ...((m = e.containerAttributes) == null ? void 0 : m.style) ?? {},
90
- ...l(k),
91
- "--arrow-offset-x": Math.round(((c = (f = l(n)) == null ? void 0 : f.arrow) == null ? void 0 : c.x) ?? 0) + "px",
92
- "--page-padding": `${e.padding}px`
93
- },
94
- tabindex: a.value ? void 0 : -1
95
- }, e.containerAttributes, { onClose: l($) }), {
96
- default: w(() => [
97
- C("span", h({
98
- ref_key: "bubblearrow",
99
- ref: p,
100
- class: "bb-common-popover__arrow"
101
- }, M.value), null, 16),
102
- C("span", K, [
103
- y(e.$slots, "default")
104
- ])
105
- ]),
106
- _: 3
107
- }, 16, ["class", "style", "tabindex", "onClose"])) : N("", !0)
108
- ];
109
- }),
110
- _: 3
111
- }, 8, ["class", "style"]));
1
+ const o = (n, t) => {
2
+ for (let e = n.length - 1; e >= 0; e--) {
3
+ const i = n[e];
4
+ if (t(i, e, n))
5
+ return e;
112
6
  }
113
- });
7
+ return -1;
8
+ };
114
9
  export {
115
- W as default
10
+ o as findRightIndex
116
11
  };
@@ -0,0 +1,116 @@
1
+ import { defineComponent as P, mergeModels as D, useModel as V, ref as r, watch as A, onMounted as x, computed as S, createBlock as b, openBlock as v, resolveDynamicComponent as g, normalizeStyle as z, normalizeClass as E, unref as l, withCtx as w, renderSlot as y, createCommentVNode as N, mergeProps as h, createElementVNode as C } from "vue";
2
+ import { wait as F } from "./index135.js";
3
+ import { useFloating as U, arrow as j } from "./index333.js";
4
+ import { flip as q, offset as G, shift as H, hide as I, autoUpdate as J } from "./index334.js";
5
+ const K = { class: "bb-common-popover__bubble" }, W = /* @__PURE__ */ P({
6
+ __name: "CommonPopover",
7
+ props: /* @__PURE__ */ D({
8
+ arrowPadding: {},
9
+ offset: {},
10
+ block: { type: Boolean },
11
+ padding: { default: 0 },
12
+ placement: {},
13
+ transitionDuration: { default: 250 },
14
+ containerAttributes: {},
15
+ dialog: { type: Boolean },
16
+ renderContent: { type: Boolean, default: !0 },
17
+ tag: { default: "span" },
18
+ flip: { type: Boolean, default: !0 }
19
+ }, {
20
+ modelValue: { type: Boolean, default: !1 },
21
+ modelModifiers: {}
22
+ }),
23
+ emits: ["update:modelValue"],
24
+ setup(s) {
25
+ const o = s, a = V(s, "modelValue"), i = r(), t = r(), p = r(), { floatingStyles: k, placement: _, middlewareData: n, update: B } = U(
26
+ i,
27
+ t,
28
+ {
29
+ placement: o.placement,
30
+ whileElementsMounted: J,
31
+ middleware: [
32
+ ...o.flip ? [q()] : [],
33
+ G(o.offset),
34
+ H({ padding: o.padding }),
35
+ I(),
36
+ j({
37
+ element: p,
38
+ padding: o.arrowPadding
39
+ })
40
+ ],
41
+ strategy: "fixed"
42
+ }
43
+ ), d = (e) => {
44
+ e ? (B(), o.dialog ? t.value.showModal() : t.value.showPopover()) : F(o.transitionDuration).then(() => {
45
+ t.value && (o.dialog ? t.value.close() : t.value.hidePopover());
46
+ });
47
+ };
48
+ A(a, d, { flush: "post" }), x(() => {
49
+ a.value && d(a.value);
50
+ });
51
+ const M = S(() => {
52
+ if (n.value.arrow) {
53
+ const { x: e, y: u } = n.value.arrow;
54
+ return {
55
+ style: {
56
+ left: `${e}px`,
57
+ top: `${u}px`
58
+ }
59
+ };
60
+ }
61
+ }), $ = () => {
62
+ a.value = !1;
63
+ };
64
+ return (e, u) => (v(), b(g(e.dialog ? "div" : e.tag), {
65
+ ref_key: "wrapper",
66
+ ref: i,
67
+ class: E(["bb-common-popover", {
68
+ "bb-common-popover--open": a.value && !!t.value,
69
+ "bb-common-popover--block": o.block,
70
+ [`bb-common-popover--${l(_)}`]: !0
71
+ }]),
72
+ style: z({
73
+ "--transition-duration": `${o.transitionDuration}ms`
74
+ })
75
+ }, {
76
+ default: w(() => {
77
+ var m, f, c;
78
+ return [
79
+ y(e.$slots, "activator"),
80
+ e.renderContent ? (v(), b(g(e.dialog ? "dialog" : e.tag), h({
81
+ key: 0,
82
+ ref_key: "content",
83
+ ref: t,
84
+ class: ["bb-common-popover__bubble-container", {
85
+ "bb-common-popover__bubble-container--open": a.value && !!t.value
86
+ }],
87
+ popover: "manual",
88
+ style: {
89
+ ...((m = e.containerAttributes) == null ? void 0 : m.style) ?? {},
90
+ ...l(k),
91
+ "--arrow-offset-x": Math.round(((c = (f = l(n)) == null ? void 0 : f.arrow) == null ? void 0 : c.x) ?? 0) + "px",
92
+ "--page-padding": `${e.padding}px`
93
+ },
94
+ tabindex: a.value ? void 0 : -1
95
+ }, e.containerAttributes, { onClose: l($) }), {
96
+ default: w(() => [
97
+ C("span", h({
98
+ ref_key: "bubblearrow",
99
+ ref: p,
100
+ class: "bb-common-popover__arrow"
101
+ }, M.value), null, 16),
102
+ C("span", K, [
103
+ y(e.$slots, "default")
104
+ ])
105
+ ]),
106
+ _: 3
107
+ }, 16, ["class", "style", "tabindex", "onClose"])) : N("", !0)
108
+ ];
109
+ }),
110
+ _: 3
111
+ }, 8, ["class", "style"]));
112
+ }
113
+ });
114
+ export {
115
+ W as default
116
+ };
package/dist/index237.js CHANGED
@@ -1,20 +1,25 @@
1
- import { isNil as c } from "./index262.js";
2
- const a = (t, r) => {
3
- if (!Object.prototype.hasOwnProperty.call(t, r))
4
- throw new Error(
5
- `Object ${JSON.stringify(t, null, 2)} has no property named "${r.toString()}"`
6
- );
7
- }, l = (t) => typeof t == "string" ? t.toLocaleLowerCase() : JSON.stringify(t).toLowerCase(), y = (t, r, s) => {
8
- const i = s.toLocaleLowerCase();
9
- for (let e = 0; e < r.length; e++) {
10
- const n = r[e];
11
- a(t, n);
12
- const o = t[n];
13
- if (c(o)) continue;
14
- if (l(o).includes(i)) return !0;
15
- }
16
- return !1;
17
- };
1
+ const e = {
2
+ inert: ":not([inert]):not([inert] *)",
3
+ negTabIndex: ':not([tabindex^="-"])',
4
+ disabled: ":not(:disabled)"
5
+ }, n = [
6
+ `a[href]${e.inert}${e.negTabIndex}`,
7
+ `area[href]${e.inert}${e.negTabIndex}`,
8
+ `input:not([type="hidden"]):not([type="radio"])${e.inert}${e.negTabIndex}${e.disabled}`,
9
+ `input[type="radio"]${e.inert}${e.negTabIndex}${e.disabled}`,
10
+ `select${e.inert}${e.negTabIndex}${e.disabled}`,
11
+ `textarea${e.inert}${e.negTabIndex}${e.disabled}`,
12
+ `button${e.inert}${e.negTabIndex}${e.disabled}`,
13
+ `details${e.inert} > summary:first-of-type${e.negTabIndex}`,
14
+ // Discard until Firefox supports `:has()`
15
+ // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
16
+ // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
17
+ `iframe${e.inert}${e.negTabIndex}`,
18
+ `audio[controls]${e.inert}${e.negTabIndex}`,
19
+ `video[controls]${e.inert}${e.negTabIndex}`,
20
+ `[contenteditable]${e.inert}${e.negTabIndex}`,
21
+ `[tabindex]${e.inert}${e.negTabIndex}`
22
+ ];
18
23
  export {
19
- y as matchAnyKey
24
+ n as default
20
25
  };