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.
- package/dist/composables/useConfirm.d.ts +6 -0
- package/dist/index101.js +3 -3
- package/dist/index103.js +2 -2
- package/dist/index11.js +2 -2
- package/dist/index111.js +3 -3
- package/dist/index113.js +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.js +1 -1
- package/dist/index121.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index131.js +2 -2
- package/dist/index15.js +8 -8
- package/dist/index17.js +9 -9
- package/dist/index19.js +11 -15
- package/dist/index19.js.map +1 -1
- package/dist/index196.js +2 -2
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +2 -4
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +4 -2
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +3 -378
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +3 -134
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -5
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -19
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +3 -2
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +35 -2
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +6 -174
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -23
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +14 -371
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +16 -3
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +19 -35
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +2 -2
- package/dist/index210.js +20 -6
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +29 -235
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +8 -16
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +2 -16
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +10 -20
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +376 -27
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +2 -8
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +373 -3
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +134 -3
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +172 -8
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +23 -2
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +235 -2
- package/dist/index221.js.map +1 -1
- package/dist/index223.js +4 -4
- package/dist/index224.js +1 -1
- package/dist/index226.js +1 -1
- package/dist/index228.js +223 -5
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +258 -2
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +1 -1
- package/dist/index230.js +431 -291
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +89 -2
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +200 -2
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +294 -116
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +5 -105
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +2 -435
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -89
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +2 -2
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +2 -224
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +2 -258
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +2 -200
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -2
- package/dist/index242.js +117 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +106 -2
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +2 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +2 -162
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +162 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +2 -2
- package/dist/index247.js.map +1 -1
- package/dist/index249.js +15 -2
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +2 -2
- package/dist/index253.js +2 -15
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +2 -2
- package/dist/index29.js +3 -3
- package/dist/index3.js +25 -23
- package/dist/index3.js.map +1 -1
- package/dist/index31.js +6 -6
- package/dist/index33.js +2 -2
- package/dist/index35.js +2 -2
- package/dist/index47.js +1 -1
- package/dist/index49.js +1 -1
- package/dist/index59.js +23 -23
- package/dist/index59.js.map +1 -1
- package/dist/index65.js +3 -3
- package/dist/index72.js +1 -1
- package/dist/index75.js +1 -1
- package/dist/index79.js +3 -3
- package/dist/index81.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Sizes } from '../components/BaseDialog/BaseDialog.vue';
|
|
2
2
|
type State = {
|
|
3
3
|
description: string;
|
|
4
|
+
theme: string;
|
|
4
5
|
loading: boolean;
|
|
5
6
|
noText: string;
|
|
6
7
|
open: boolean;
|
|
@@ -34,6 +35,10 @@ type UserOptions = {
|
|
|
34
35
|
* Text content of the modal.
|
|
35
36
|
*/
|
|
36
37
|
text: State["text"];
|
|
38
|
+
/**
|
|
39
|
+
* The name of the theme it applies a css class to BbConfirm for styling.
|
|
40
|
+
*/
|
|
41
|
+
theme?: State["theme"];
|
|
37
42
|
/**
|
|
38
43
|
* Tittle of the modal
|
|
39
44
|
*/
|
|
@@ -53,6 +58,7 @@ type UserOptions = {
|
|
|
53
58
|
};
|
|
54
59
|
export declare const state: {
|
|
55
60
|
description: string;
|
|
61
|
+
theme: string;
|
|
56
62
|
loading: boolean;
|
|
57
63
|
noText: string;
|
|
58
64
|
open: boolean;
|
package/dist/index101.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as ie, ref as O, computed as p, onMounted as de, watch as q, openBlock as c, createBlock as be, resolveDynamicComponent as re, normalizeClass as f, withCtx as ue, createElementBlock as d, toDisplayString as m, createCommentVNode as v, createElementVNode as o, renderSlot as y, createVNode as J, unref as C, Fragment as N, renderList as T, createTextVNode as pe, mergeProps as fe } from "vue";
|
|
2
|
-
import { add as me } from "./
|
|
3
|
-
import { clamp as ye } from "./
|
|
2
|
+
import { add as me } from "./index244.js";
|
|
3
|
+
import { clamp as ye } from "./index196.js";
|
|
4
4
|
import { deepEqual as he } from "./index123.js";
|
|
5
5
|
import { isNil as j } from "./index120.js";
|
|
6
6
|
import { isNotNil as _e } from "./index124.js";
|
|
7
7
|
import { useId as ke } from "./index7.js";
|
|
8
8
|
import { useItemValue as ge } from "./index126.js";
|
|
9
|
-
import { when as ve } from "./
|
|
9
|
+
import { when as ve } from "./index198.js";
|
|
10
10
|
import G from "./index11.js";
|
|
11
11
|
import "./index12.js";
|
|
12
12
|
import Ce from "./index25.js";
|
package/dist/index103.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as m, openBlock as c, createBlock as b, withCtx as a, renderSlot as r, normalizeProps as i, guardReactiveProps as n, createVNode as h, mergeProps as y } from "vue";
|
|
2
2
|
import f from "./index21.js";
|
|
3
3
|
import "./index22.js";
|
|
4
|
-
import v from "./
|
|
5
|
-
import "./
|
|
4
|
+
import v from "./index246.js";
|
|
5
|
+
import "./index247.js";
|
|
6
6
|
const w = /* @__PURE__ */ m({
|
|
7
7
|
__name: "BbTag",
|
|
8
8
|
props: {
|
package/dist/index11.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as B, ref as h, computed as n, watch as L, openBlock as c, createElementBlock as i, normalizeClass as E, normalizeProps as p, mergeProps as d, createCommentVNode as I, createElementVNode as l, renderSlot as F, guardReactiveProps as M } from "vue";
|
|
2
|
-
import { isCssColor as f } from "./
|
|
3
|
-
import { when as N } from "./
|
|
2
|
+
import { isCssColor as f } from "./index197.js";
|
|
3
|
+
import { when as N } from "./index198.js";
|
|
4
4
|
const A = {
|
|
5
5
|
class: "bb-base-checkbox-container",
|
|
6
6
|
"aria-hidden": "true"
|
package/dist/index111.js
CHANGED
|
@@ -4,9 +4,9 @@ import { useId as K } from "./index7.js";
|
|
|
4
4
|
import { wait as P } from "./index122.js";
|
|
5
5
|
import Q from "./index9.js";
|
|
6
6
|
import "./index10.js";
|
|
7
|
-
import { throttle as v } from "./
|
|
8
|
-
import { waitFor as W } from "./
|
|
9
|
-
import { autoUpdate as X, flip as Y, shift as Z } from "./
|
|
7
|
+
import { throttle as v } from "./index203.js";
|
|
8
|
+
import { waitFor as W } from "./index205.js";
|
|
9
|
+
import { autoUpdate as X, flip as Y, shift as Z } from "./index215.js";
|
|
10
10
|
const ee = { class: "bb-tooltip__bubble" }, te = /* @__PURE__ */ i("svg", {
|
|
11
11
|
viewBox: "0 0 24 24",
|
|
12
12
|
fill: "none",
|
package/dist/index113.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as $, computed as g, resolveComponent as y, openBlock as f, createElementBlock as i, Fragment as v, renderList as h, normalizeClass as b, createElementVNode as s, renderSlot as p, createVNode as k, createSlots as B, withCtx as C, normalizeProps as T, guardReactiveProps as _ } from "vue";
|
|
2
|
-
import { flattenTree as P } from "./
|
|
2
|
+
import { flattenTree as P } from "./index245.js";
|
|
3
3
|
const w = { class: "bb-tree-row" }, z = { class: "bb-tree-main-content" }, I = /* @__PURE__ */ $({
|
|
4
4
|
__name: "BbTree",
|
|
5
5
|
props: {
|
package/dist/index116.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as i, ref as a, watch as s, computed as u, openBlock as c, createElementBlock as p, normalizeProps as d, guardReactiveProps as m, createElementVNode as b, renderSlot as v, createCommentVNode as f } from "vue";
|
|
2
2
|
import { wait as V } from "./index122.js";
|
|
3
|
-
import { throttle as _ } from "./
|
|
3
|
+
import { throttle as _ } from "./index203.js";
|
|
4
4
|
const h = { class: "bb-collapsible__content" }, k = /* @__PURE__ */ i({
|
|
5
5
|
__name: "BbCollapsible",
|
|
6
6
|
props: {
|
package/dist/index117.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as m, getCurrentInstance as d, inject as x, computed as l, ref as y, watchEffect as _, openBlock as b, createElementBlock as h, mergeProps as w } from "vue";
|
|
2
|
-
import { isCssColor as z } from "./
|
|
2
|
+
import { isCssColor as z } from "./index197.js";
|
|
3
3
|
const g = ["innerHTML"], $ = /* @__PURE__ */ m({
|
|
4
4
|
__name: "BbIcon",
|
|
5
5
|
props: {
|
package/dist/index118.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as v, ref as r, onMounted as p, onBeforeUnmount as h, openBlock as i, createBlock as l, resolveDynamicComponent as u, normalizeStyle as m, withCtx as f, renderSlot as d } from "vue";
|
|
2
|
-
import { throttle as g } from "./
|
|
2
|
+
import { throttle as g } from "./index203.js";
|
|
3
3
|
const O = /* @__PURE__ */ v({
|
|
4
4
|
__name: "BbSmoothHeight",
|
|
5
5
|
props: {
|
package/dist/index119.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as m, computed as r, openBlock as a, createElementBlock as d, normalizeProps as u, guardReactiveProps as z, createElementVNode as c } from "vue";
|
|
2
|
-
import { isCssColor as f } from "./
|
|
2
|
+
import { isCssColor as f } from "./index197.js";
|
|
3
3
|
const _ = /* @__PURE__ */ c("svg", {
|
|
4
4
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
5
|
viewBox: "0 0 512 512"
|
package/dist/index121.js
CHANGED
package/dist/index125.js
CHANGED
package/dist/index126.js
CHANGED
package/dist/index127.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isArray as b, isPlainObject as m } from "./
|
|
1
|
+
import { isArray as b, isPlainObject as m } from "./index249.js";
|
|
2
2
|
function i(e, n, l, o, r) {
|
|
3
3
|
const u = {}.propertyIsEnumerable.call(o, n) ? "enumerable" : "nonenumerable";
|
|
4
4
|
u === "enumerable" && (e[n] = l), r && u === "nonenumerable" && Object.defineProperty(e, n, {
|
package/dist/index131.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toValue as B } from "./
|
|
2
|
-
import { tryOnScopeDispose as E } from "./
|
|
1
|
+
import { toValue as B } from "./index214.js";
|
|
2
|
+
import { tryOnScopeDispose as E } from "./index214.js";
|
|
3
3
|
import { ref as c, computed as t } from "vue";
|
|
4
4
|
function h(a) {
|
|
5
5
|
var l;
|
package/dist/index15.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as de, ref as k, computed as h, watch as ue, openBlock as d, createElementBlock as u, mergeProps as ce, createElementVNode as i, createTextVNode as be, toDisplayString as f, unref as p, withDirectives as L, createVNode as g, Transition as V, withCtx as w, vShow as z, createCommentVNode as A, normalizeClass as x, Fragment as O, renderList as S, renderSlot as R, nextTick as me } from "vue";
|
|
2
|
-
import c from "./
|
|
3
|
-
import fe from "./
|
|
4
|
-
import pe from "./
|
|
5
|
-
import he from "./
|
|
6
|
-
import ye from "./
|
|
7
|
-
import _e from "./
|
|
8
|
-
import { groupBy as W } from "./
|
|
2
|
+
import c from "./index206.js";
|
|
3
|
+
import fe from "./index207.js";
|
|
4
|
+
import pe from "./index208.js";
|
|
5
|
+
import he from "./index209.js";
|
|
6
|
+
import ye from "./index210.js";
|
|
7
|
+
import _e from "./index211.js";
|
|
8
|
+
import { groupBy as W } from "./index212.js";
|
|
9
9
|
import { isNil as ve } from "./index120.js";
|
|
10
|
-
import { last as $ } from "./
|
|
10
|
+
import { last as $ } from "./index213.js";
|
|
11
11
|
const ke = { class: "bb-base-date-picker__header" }, ge = ["disabled"], Ve = /* @__PURE__ */ i("span", null, null, -1), we = {
|
|
12
12
|
class: "bb-base-date-picker__selected-day-label",
|
|
13
13
|
"aria-live": "polite"
|
package/dist/index17.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineComponent as R, ref as l, computed as Y, watch as J, onMounted as Q, onBeforeUnmount as X, openBlock as B, createElementBlock as Z, normalizeClass as C, renderSlot as u, createElementVNode as g, withDirectives as x, mergeProps as T, unref as d, toDisplayString as ee, createBlock as ae, Teleport as te, createVNode as ne, createSlots as oe, renderList as le, withCtx as ie, normalizeProps as re, guardReactiveProps as se } from "vue";
|
|
2
|
-
import { autoUpdate as ue, computePosition as de, flip as ce, shift as fe } from "./
|
|
3
|
-
import pe from "./
|
|
4
|
-
import c from "./
|
|
5
|
-
import me from "./
|
|
6
|
-
import { identity as be } from "./
|
|
7
|
-
import { last as ve } from "./
|
|
2
|
+
import { autoUpdate as ue, computePosition as de, flip as ce, shift as fe } from "./index215.js";
|
|
3
|
+
import pe from "./index218.js";
|
|
4
|
+
import c from "./index206.js";
|
|
5
|
+
import me from "./index209.js";
|
|
6
|
+
import { identity as be } from "./index202.js";
|
|
7
|
+
import { last as ve } from "./index213.js";
|
|
8
8
|
import { useId as ye } from "./index7.js";
|
|
9
|
-
import { vMaska as ge } from "./
|
|
9
|
+
import { vMaska as ge } from "./index219.js";
|
|
10
10
|
import { wait as I } from "./index122.js";
|
|
11
11
|
import he from "./index15.js";
|
|
12
12
|
import "./index16.js";
|
|
13
|
-
import O from "./
|
|
14
|
-
import { offset as ke } from "./
|
|
13
|
+
import O from "./index220.js";
|
|
14
|
+
import { offset as ke } from "./index217.js";
|
|
15
15
|
const we = ["autocomplete", "autofocus", "data-maska", "disabled", "id", "name", "placeholder", "readonly", "value", "aria-describedby"], Ee = ["id"], Pe = /* @__PURE__ */ R({
|
|
16
16
|
__name: "BaseDatePickerInput",
|
|
17
17
|
props: {
|
package/dist/index19.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as J, ref as o, useAttrs as Q, computed as h, onMounted as X, onBeforeUnmount as E, watchPostEffect as Y, openBlock as _, createBlock as Z, Teleport as ee, createElementVNode as l, mergeProps as N, createElementBlock as B, renderSlot as i, createTextVNode as te, toDisplayString as V, createCommentVNode as D, nextTick as T } from "vue";
|
|
2
|
-
import { throttle as oe } from "./
|
|
3
|
-
import { useFocusTrap as le } from "./
|
|
2
|
+
import { throttle as oe } from "./index203.js";
|
|
3
|
+
import { useFocusTrap as le } from "./index204.js";
|
|
4
4
|
import { useId as A } from "./index7.js";
|
|
5
5
|
import { wait as L } from "./index122.js";
|
|
6
|
-
import { waitFor as ae } from "./
|
|
6
|
+
import { waitFor as ae } from "./index205.js";
|
|
7
7
|
const se = { class: "bb-base-dialog-close" }, ne = { class: "bb-base-dialog-close__content" }, ie = { class: "bb-base-dialog-close__label" }, re = /* @__PURE__ */ l("span", { class: "bb-base-dialog-close__icon" }, [
|
|
8
8
|
/* @__PURE__ */ l("svg", {
|
|
9
9
|
viewBox: "0 0 24 24",
|
|
@@ -77,11 +77,9 @@ const se = { class: "bb-base-dialog-close" }, ne = { class: "bb-base-dialog-clos
|
|
|
77
77
|
e--, document.body.dataset.openModals = e.toString(), e || (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px"), b.value = !1, M.value = !0, r("hidden");
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
Y(
|
|
81
|
-
()
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
);
|
|
80
|
+
Y(() => {
|
|
81
|
+
!t.modelValue && !v.value || G();
|
|
82
|
+
});
|
|
85
83
|
const g = (e) => {
|
|
86
84
|
e.target === m.value && e.preventDefault();
|
|
87
85
|
}, K = (e) => {
|
|
@@ -143,19 +141,17 @@ const se = { class: "bb-base-dialog-close" }, ne = { class: "bb-base-dialog-clos
|
|
|
143
141
|
style: q,
|
|
144
142
|
...s
|
|
145
143
|
};
|
|
146
|
-
}), f = oe(() => {
|
|
144
|
+
}), f = oe(async () => {
|
|
147
145
|
if (t.fullscreen) {
|
|
148
146
|
I.value = window.innerHeight;
|
|
149
147
|
return;
|
|
150
148
|
}
|
|
151
149
|
if (d.value && a.value && u.value) {
|
|
152
150
|
const e = d.value.scrollHeight + a.value.scrollHeight + u.value.scrollHeight + 2;
|
|
153
|
-
y.value && (y.value.style.height = "0px", y.value.style.height = `${e}px`, L(30).
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
}));
|
|
151
|
+
if (y.value && (y.value.style.height = "0px", y.value.style.height = `${e + 10}px`, await L(30), d.value && a.value && u.value)) {
|
|
152
|
+
const s = d.value.scrollHeight + a.value.scrollHeight + u.value.scrollHeight + 20;
|
|
153
|
+
e !== s && f();
|
|
154
|
+
}
|
|
159
155
|
}
|
|
160
156
|
}, 200);
|
|
161
157
|
return (e, s) => (_(), Z(ee, { to: "body" }, [
|
package/dist/index19.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index19.js","sources":["../src/components/BaseDialog/BaseDialog.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-dialog-close\" }\nconst _hoisted_2 = { class: \"bb-base-dialog-close__content\" }\nconst _hoisted_3 = { class: \"bb-base-dialog-close__label\" }\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-base-dialog-close__icon\" }, [\n /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\"\n }, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n ])\n], -1)\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"10000 10000 0%\"} }, null, -1)\n\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n useAttrs,\n watch,\n nextTick,\nwatchPostEffect,\n} from \"vue\";\nimport { throttle } from \"@/utilities/functions/throttle\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport { waitFor } from \"@/utilities/functions/waitFor\";\nimport type { CommonProps, Size } from \"@/types/CommonProps\";\n\nexport type Sizes = {\n sm: number;\n md: number;\n lg: number;\n};\n\nexport type BaseDialogProps = Pick<\n CommonProps,\n | \"closeLabel\"\n | \"compact\"\n | \"disabled\"\n | \"eager\"\n | \"panelClasses\"\n | \"overlayClasses\"\n | \"persistent\"\n | \"showClose\"\n | \"title\"\n | \"transition\"\n | \"transitionDuration\"\n> &\n Size<Sizes> & {\n /**\n * Description of the content of the modal. Extremely useful for accessibility reasons.\n */\n description?: string;\n /**\n * Displays the modala as fulscreen with no margin to the page\n */\n fullscreen?: boolean;\n /**\n * Defines the state open / closed of the modal.\n */\n modelValue?: boolean | null;\n };\n\nexport type BaseDialogSlots = {\n header?: (props: {\n titleId: typeof titleId;\n close: typeof onCloseClick;\n title: BaseDialogProps[\"title\"];\n }) => any;\n title?: (props: { text: BaseDialogProps[\"title\"] }) => any;\n close?: (props: { text: BaseDialogProps[\"closeLabel\"] }) => any;\n description?: (props: {\n descriptionId: typeof descriptionId;\n text: BaseDialogProps[\"description\"];\n }) => any;\n default?: (props: {}) => any;\n footer?: (props: {}) => any;\n};\n\nexport type BaseDialogEvents = {\n (e: \"shown\"): void;\n (e: \"hidden\"): void;\n (e: \"update:modelValue\", value: boolean): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseDialog',\n props: {\n closeLabel: { default: \"Chiudi modale\" },\n compact: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n panelClasses: { default: () => [] },\n overlayClasses: { default: () => [] },\n persistent: { type: Boolean },\n showClose: { type: Boolean, default: true },\n title: {},\n transition: { default: \"fade\" },\n transitionDuration: { default: 350 },\n size: { default: \"sm\" },\n description: {},\n fullscreen: { type: Boolean },\n modelValue: { type: [Boolean, null] }\n },\n emits: [\"shown\", \"hidden\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\n\n\nconst emit = __emit;\n\nconst titleId = `title_${useId().id.value}`;\nconst descriptionId = `description_${useId().id.value}`;\n\nconst observer = ref<MutationObserver | null>(null);\nconst overlay = ref<HTMLElement | null>(null);\nconst panel = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst header = ref<HTMLElement | null>(null);\nconst body = ref<HTMLElement | null>(null);\nconst footer = ref<HTMLElement | null>(null);\nconst height = ref<number | null>(null);\n\nconst { activate, deactivate } = useFocusTrap(panel, {\n clickOutsideDeactivates: true,\n /* On esc deactivate the trap, return focus and then close the modal */\n escapeDeactivates: () => {\n nextTick(() => {\n emit(\"update:modelValue\", false);\n });\n return true;\n },\n});\n\nconst attrs = useAttrs();\n\nconst closeLabel = computed(() => props.closeLabel);\n\nonMounted(async () => {\n if (body.value) {\n observer.value = new MutationObserver(onContentGrow);\n observer.value.observe(body.value, { childList: true, subtree: true });\n }\n window.addEventListener(\"resize\", onContentGrow);\n});\nonBeforeUnmount(() => {\n window.removeEventListener(\"resize\", onContentGrow);\n});\n\nconst open = ref(false);\nconst opening = ref(false);\nconst closed = ref(true);\nconst closing = ref(false);\nconst hasRenderedAtLeastOnce = ref(props.eager || props.modelValue);\n\nconst busy = computed(() => opening.value || closing.value);\n\nonBeforeUnmount(() => {\n if (props.modelValue) {\n let currentlyOpenModals = Number(\n document.body.dataset[\"openModals\"] ?? \"0\"\n );\n // This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n currentlyOpenModals--;\n document.body.dataset[\"openModals\"] = currentlyOpenModals.toString();\n if (!currentlyOpenModals) {\n document.body.style.overflow = \"auto\";\n document.body.style.paddingRight = \"0px\";\n }\n }\n});\n\n\n/**\n * When modelValue becomes true if the component wasn't rendered render it\n * and wait for it to be on the page (or transitions would not work).\n * Stash the latest focused element so we can return it later when it closes.\n * Focus on the panel upon opening.\n * ---\n * Notice all interactions update modelValue and then this function aligns the display to it\n */\nconst alignToModelValue = async () => {\n if (props.modelValue) {\n if (!hasRenderedAtLeastOnce.value) {\n hasRenderedAtLeastOnce.value = true;\n await waitFor(() => !!body.value);\n await nextTick();\n if (body.value) {\n observer.value = new MutationObserver(onContentGrow);\n observer.value.observe(body.value, { childList: true, subtree: true });\n }\n }\n\n closed.value = false;\n closing.value = false;\n opening.value = true;\n\n // This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\n let currentlyOpenModals = Number(\n document.body.dataset[\"openModals\"] ?? \"0\"\n );\n currentlyOpenModals++;\n document.body.dataset[\"openModals\"] = currentlyOpenModals.toString();\n const scrollBarWidth =\n window.innerWidth - document.documentElement.clientWidth;\n document.body.style.overflow = \"hidden\";\n document.body.style.paddingRight = `${scrollBarWidth}px`;\n\n await wait(props.transitionDuration);\n opening.value = false;\n open.value = true;\n emit(\"shown\");\n activate();\n } else {\n deactivate();\n opening.value = false;\n open.value = false;\n closing.value = true;\n\n await wait(props.transitionDuration);\n\n let currentlyOpenModals = Number(\n document.body.dataset[\"openModals\"] ?? \"0\"\n );\n // This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n currentlyOpenModals--;\n document.body.dataset[\"openModals\"] = currentlyOpenModals.toString();\n if (!currentlyOpenModals) {\n document.body.style.overflow = \"auto\";\n document.body.style.paddingRight = \"0px\";\n }\n closing.value = false;\n closed.value = true;\n emit(\"hidden\");\n }\n};\n\n/**\n * Every time modelValue changes align the display to it\n */\nwatchPostEffect(\n () => {\n if(!props.modelValue && !hasRenderedAtLeastOnce.value) return;\n alignToModelValue();\n }\n);\n\n/**\n * Disable scrolling\n */\nconst onOverlayScroll = (event: UIEvent) => {\n if (event.target === overlay.value) {\n event.preventDefault();\n }\n};\n\n/**\n * Close the modal on overlay click if not persistent\n */\nconst onOverlayClick = (event: MouseEvent) => {\n if (props.disabled || busy.value) return;\n if (overlay.value) {\n if (event.target === overlay.value) {\n if (!props.persistent) {\n emit(\"update:modelValue\", false);\n }\n }\n }\n};\n\n/**\n * On click on the X button\n */\nconst onCloseClick = () => {\n if (props.disabled || busy.value) return;\n deactivate();\n emit(\"update:modelValue\", false);\n};\n\nconst overlayAttributes = computed(() => {\n const classes = [\n {\n \"bb-base-dialog bb-base-dialog__overlay\": true,\n \"bb-base-dialog--fullscreen\": props.fullscreen,\n \"bb-base-dialog--open\": open.value,\n \"bb-base-dialog--opening\": opening.value,\n \"bb-base-dialog--closed\": closed.value,\n \"bb-base-dialog--closing\": closing.value,\n [`bb-base-dialog--transition-${props.transition}`]: true,\n },\n props.overlayClasses,\n ].flat();\n const eventListeners = {\n onClick: onOverlayClick,\n onScroll: onOverlayScroll,\n onTouchmove: onOverlayScroll,\n onWheel: onOverlayScroll,\n onKeydown: onOverlayScroll,\n };\n\n const style = {\n transitionDuration: props.transitionDuration / 1000 + \"s\",\n };\n return {\n class: classes,\n style,\n ...eventListeners,\n ...attrs,\n };\n});\n\nconst panelAttributes = computed(() => {\n const classes = [\n {\n \"bb-base-dialog__panel\": true,\n \"bb-base-dialog__panel--compact\": props.compact,\n },\n props.panelClasses,\n ].flat();\n\n const accessibilityAttrs: {\n [key: string]: string | boolean;\n } = {\n role: \"dialog\",\n \"aria-modal\": true,\n };\n\n if (hasRenderedAtLeastOnce.value) {\n accessibilityAttrs[\"aria-labelledby\"] = titleId;\n\n if (props.description)\n accessibilityAttrs[\"aria-describedby\"] = descriptionId;\n }\n\n let maxWidth;\n const sizes: Sizes = {\n sm: 384,\n md: 652,\n lg: 896,\n };\n if (props.fullscreen) maxWidth = \"100%\";\n else if (typeof props.size === \"number\") maxWidth = props.size + \"px\";\n else if (props.size in sizes)\n maxWidth = sizes[props.size as keyof Sizes] + \"px\";\n else maxWidth = props.size + \"px\";\n\n const style = {\n maxWidth,\n transitionDuration: props.transitionDuration / 1000 + \"s\",\n };\n\n return {\n class: classes,\n style,\n ...accessibilityAttrs,\n };\n});\n\n/**\n * This is called when content inside body changes.\n * Gets the total height the panel needs to be\n * It could be called numerous times so throttle every 300ms\n */\nconst onContentGrow = throttle(() => {\n if (props.fullscreen) {\n height.value = window.innerHeight;\n return;\n }\n if (header.value && body.value && footer.value) {\n const contentHeight =\n header.value.scrollHeight +\n body.value.scrollHeight +\n footer.value.scrollHeight +\n 2;\n /* Add two so renderless elements at the bottom are not cut off */\n if (content.value) {\n content.value.style.height = \"0px\";\n content.value.style.height = `${contentHeight}px`;\n /**\n * Run until all transitions inside have completed\n */\n wait(30).then(() => {\n if (header.value && body.value && footer.value) {\n const contentHeight2 =\n header.value.scrollHeight +\n body.value.scrollHeight +\n footer.value.scrollHeight +\n 2;\n if (contentHeight !== contentHeight2) onContentGrow();\n }\n });\n }\n }\n}, 200);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"div\", _mergeProps(overlayAttributes.value, {\n ref_key: \"overlay\",\n ref: overlay\n }), [\n _createElementVNode(\"div\", _mergeProps(panelAttributes.value, {\n ref_key: \"panel\",\n ref: panel\n }), [\n (hasRenderedAtLeastOnce.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"bb-base-dialog__content\",\n ref_key: \"content\",\n ref: content\n }, [\n _createElementVNode(\"div\", {\n class: \"bb-base-dialog__header\",\n ref_key: \"header\",\n ref: header\n }, [\n _renderSlot(_ctx.$slots, \"header\", {\n titleId: titleId,\n close: onCloseClick,\n title: _ctx.title\n }, () => [\n _createElementVNode(\"span\", {\n class: \"bb-base-dialog__title\",\n id: titleId\n }, [\n _renderSlot(_ctx.$slots, \"title\", { text: _ctx.title }, () => [\n _createTextVNode(_toDisplayString(_ctx.title), 1)\n ])\n ]),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.showClose)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n onClick: onCloseClick,\n type: \"button\"\n }, [\n _renderSlot(_ctx.$slots, \"close\", { text: closeLabel.value }, () => [\n _createElementVNode(\"span\", _hoisted_2, [\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(closeLabel.value), 1),\n _hoisted_4\n ])\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ])\n ], 512),\n _createElementVNode(\"div\", {\n class: \"bb-base-dialog__body\",\n ref_key: \"body\",\n ref: body\n }, [\n _renderSlot(_ctx.$slots, \"description\", {\n descriptionId: descriptionId,\n text: _ctx.description\n }, () => [\n (_ctx.description)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n id: descriptionId,\n class: \"bb-base-dialog__description\"\n }, _toDisplayString(_ctx.description), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _renderSlot(_ctx.$slots, \"default\")\n ], 512),\n _hoisted_5,\n _createElementVNode(\"div\", {\n class: \"bb-base-dialog__footer\",\n ref_key: \"footer\",\n ref: footer\n }, [\n _renderSlot(_ctx.$slots, \"footer\")\n ], 512)\n ], 512))\n : _createCommentVNode(\"\", true)\n ], 16)\n ], 16)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_createElementVNode","_hoisted_5","_sfc_main","_defineComponent","__props","__emit","props","emit","titleId","useId","descriptionId","observer","ref","overlay","panel","content","header","body","footer","height","activate","deactivate","useFocusTrap","nextTick","attrs","useAttrs","closeLabel","computed","onMounted","onContentGrow","onBeforeUnmount","open","opening","closed","closing","hasRenderedAtLeastOnce","busy","currentlyOpenModals","alignToModelValue","waitFor","scrollBarWidth","wait","watchPostEffect","onOverlayScroll","event","onOverlayClick","onCloseClick","overlayAttributes","classes","eventListeners","style","panelAttributes","accessibilityAttrs","maxWidth","sizes","throttle","contentHeight","contentHeight2","_ctx","_cache","_openBlock","_createBlock","_Teleport","_mergeProps","_createElementBlock","_render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hC,EAAW,MAAM,GAAG,MAAM;AAAA,sBAClE1B,EAAoB,QAAQH,IAAY;AAAA,wBACtCG,EAAoB,QAAQF,IAAYqE,EAAiBzC,EAAW,KAAK,GAAG,CAAC;AAAA,wBAC7E3B;AAAA,sBAAA,CACD;AAAA,oBAAA,CACF;AAAA,kBAAA,CACF,KACDqE,EAAoB,IAAI,EAAI;AAAA,gBAAA,CACjC;AAAA,cAAA,CACF;AAAA,eACA,GAAG;AAAA,YACNpE,EAAoB,OAAO;AAAA,cACzB,OAAO;AAAA,cACP,SAAS;AAAA,cACT,KAAKiB;AAAA,YAAA,GACJ;AAAA,cACDgD,EAAYP,EAAK,QAAQ,eAAe;AAAA,gBACtC,eAAAhD;AAAA,gBACA,MAAMgD,EAAK;AAAA,cAAA,GACV,MAAM;AAAA,gBACNA,EAAK,eACDE,KAAcI,EAAoB,OAAO;AAAA,kBACxC,KAAK;AAAA,kBACL,IAAItD;AAAA,kBACJ,OAAO;AAAA,gBAAA,GACNyD,EAAiBT,EAAK,WAAW,GAAG,CAAC,KACxCU,EAAoB,IAAI,EAAI;AAAA,cAAA,CACjC;AAAA,cACDH,EAAYP,EAAK,QAAQ,SAAS;AAAA,eACjC,GAAG;AAAA,YACNzD;AAAA,YACAD,EAAoB,OAAO;AAAA,cACzB,OAAO;AAAA,cACP,SAAS;AAAA,cACT,KAAKkB;AAAA,YAAA,GACJ;AAAA,cACD+C,EAAYP,EAAK,QAAQ,QAAQ;AAAA,eAChC,GAAG;AAAA,UACL,GAAA,GAAG,KACNU,EAAoB,IAAI,EAAI;AAAA,WAC/B,EAAE;AAAA,SACJ,EAAE;AAAA,IAAA,CACN;AAAA,EAEH;AAEA,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index19.js","sources":["../src/components/BaseDialog/BaseDialog.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-dialog-close\" }\nconst _hoisted_2 = { class: \"bb-base-dialog-close__content\" }\nconst _hoisted_3 = { class: \"bb-base-dialog-close__label\" }\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-base-dialog-close__icon\" }, [\n /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\"\n }, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n ])\n], -1)\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"10000 10000 0%\"} }, null, -1)\n\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n useAttrs,\n watch,\n nextTick,\n watchPostEffect,\n} from \"vue\";\nimport { throttle } from \"@/utilities/functions/throttle\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport { waitFor } from \"@/utilities/functions/waitFor\";\nimport type { CommonProps, Size } from \"@/types/CommonProps\";\n\nexport type Sizes = {\n sm: number;\n md: number;\n lg: number;\n};\n\nexport type BaseDialogProps = Pick<\n CommonProps,\n | \"closeLabel\"\n | \"compact\"\n | \"disabled\"\n | \"eager\"\n | \"panelClasses\"\n | \"overlayClasses\"\n | \"persistent\"\n | \"showClose\"\n | \"title\"\n | \"transition\"\n | \"transitionDuration\"\n> &\n Size<Sizes> & {\n /**\n * Description of the content of the modal. Extremely useful for accessibility reasons.\n */\n description?: string;\n /**\n * Displays the modala as fulscreen with no margin to the page\n */\n fullscreen?: boolean;\n /**\n * Defines the state open / closed of the modal.\n */\n modelValue?: boolean | null;\n };\n\nexport type BaseDialogSlots = {\n header?: (props: {\n titleId: typeof titleId;\n close: typeof onCloseClick;\n title: BaseDialogProps[\"title\"];\n }) => any;\n title?: (props: { text: BaseDialogProps[\"title\"] }) => any;\n close?: (props: { text: BaseDialogProps[\"closeLabel\"] }) => any;\n description?: (props: {\n descriptionId: typeof descriptionId;\n text: BaseDialogProps[\"description\"];\n }) => any;\n default?: (props: {}) => any;\n footer?: (props: {}) => any;\n};\n\nexport type BaseDialogEvents = {\n (e: \"shown\"): void;\n (e: \"hidden\"): void;\n (e: \"update:modelValue\", value: boolean): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseDialog',\n props: {\n closeLabel: { default: \"Chiudi modale\" },\n compact: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n panelClasses: { default: () => [] },\n overlayClasses: { default: () => [] },\n persistent: { type: Boolean },\n showClose: { type: Boolean, default: true },\n title: {},\n transition: { default: \"fade\" },\n transitionDuration: { default: 350 },\n size: { default: \"sm\" },\n description: {},\n fullscreen: { type: Boolean },\n modelValue: { type: [Boolean, null] }\n },\n emits: [\"shown\", \"hidden\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\n\n\nconst emit = __emit;\n\nconst titleId = `title_${useId().id.value}`;\nconst descriptionId = `description_${useId().id.value}`;\n\nconst observer = ref<MutationObserver | null>(null);\nconst overlay = ref<HTMLElement | null>(null);\nconst panel = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst header = ref<HTMLElement | null>(null);\nconst body = ref<HTMLElement | null>(null);\nconst footer = ref<HTMLElement | null>(null);\nconst height = ref<number | null>(null);\n\nconst { activate, deactivate } = useFocusTrap(panel, {\n clickOutsideDeactivates: true,\n /* On esc deactivate the trap, return focus and then close the modal */\n escapeDeactivates: () => {\n nextTick(() => {\n emit(\"update:modelValue\", false);\n });\n return true;\n },\n});\n\nconst attrs = useAttrs();\n\nconst closeLabel = computed(() => props.closeLabel);\n\nonMounted(async () => {\n if (body.value) {\n observer.value = new MutationObserver(onContentGrow);\n observer.value.observe(body.value, { childList: true, subtree: true });\n }\n window.addEventListener(\"resize\", onContentGrow);\n});\nonBeforeUnmount(() => {\n window.removeEventListener(\"resize\", onContentGrow);\n});\n\nconst open = ref(false);\nconst opening = ref(false);\nconst closed = ref(true);\nconst closing = ref(false);\nconst hasRenderedAtLeastOnce = ref(props.eager || props.modelValue);\n\nconst busy = computed(() => opening.value || closing.value);\n\nonBeforeUnmount(() => {\n if (props.modelValue) {\n let currentlyOpenModals = Number(\n document.body.dataset[\"openModals\"] ?? \"0\"\n );\n // This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n currentlyOpenModals--;\n document.body.dataset[\"openModals\"] = currentlyOpenModals.toString();\n if (!currentlyOpenModals) {\n document.body.style.overflow = \"auto\";\n document.body.style.paddingRight = \"0px\";\n }\n }\n});\n\n/**\n * When modelValue becomes true if the component wasn't rendered render it\n * and wait for it to be on the page (or transitions would not work).\n * Stash the latest focused element so we can return it later when it closes.\n * Focus on the panel upon opening.\n * ---\n * Notice all interactions update modelValue and then this function aligns the display to it\n */\nconst alignToModelValue = async () => {\n if (props.modelValue) {\n if (!hasRenderedAtLeastOnce.value) {\n hasRenderedAtLeastOnce.value = true;\n await waitFor(() => !!body.value);\n await nextTick();\n if (body.value) {\n observer.value = new MutationObserver(onContentGrow);\n observer.value.observe(body.value, { childList: true, subtree: true });\n }\n }\n\n closed.value = false;\n closing.value = false;\n opening.value = true;\n\n // This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\n let currentlyOpenModals = Number(\n document.body.dataset[\"openModals\"] ?? \"0\"\n );\n currentlyOpenModals++;\n document.body.dataset[\"openModals\"] = currentlyOpenModals.toString();\n const scrollBarWidth =\n window.innerWidth - document.documentElement.clientWidth;\n document.body.style.overflow = \"hidden\";\n document.body.style.paddingRight = `${scrollBarWidth}px`;\n\n await wait(props.transitionDuration);\n opening.value = false;\n open.value = true;\n emit(\"shown\");\n activate();\n } else {\n deactivate();\n opening.value = false;\n open.value = false;\n closing.value = true;\n\n await wait(props.transitionDuration);\n\n let currentlyOpenModals = Number(\n document.body.dataset[\"openModals\"] ?? \"0\"\n );\n // This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n currentlyOpenModals--;\n document.body.dataset[\"openModals\"] = currentlyOpenModals.toString();\n if (!currentlyOpenModals) {\n document.body.style.overflow = \"auto\";\n document.body.style.paddingRight = \"0px\";\n }\n closing.value = false;\n closed.value = true;\n emit(\"hidden\");\n }\n};\n\n/**\n * Every time modelValue changes align the display to it\n */\nwatchPostEffect(() => {\n if (!props.modelValue && !hasRenderedAtLeastOnce.value) return;\n alignToModelValue();\n});\n\n/**\n * Disable scrolling\n */\nconst onOverlayScroll = (event: UIEvent) => {\n if (event.target === overlay.value) {\n event.preventDefault();\n }\n};\n\n/**\n * Close the modal on overlay click if not persistent\n */\nconst onOverlayClick = (event: MouseEvent) => {\n if (props.disabled || busy.value) return;\n if (overlay.value) {\n if (event.target === overlay.value) {\n if (!props.persistent) {\n emit(\"update:modelValue\", false);\n }\n }\n }\n};\n\n/**\n * On click on the X button\n */\nconst onCloseClick = () => {\n if (props.disabled || busy.value) return;\n deactivate();\n emit(\"update:modelValue\", false);\n};\n\nconst overlayAttributes = computed(() => {\n const classes = [\n {\n \"bb-base-dialog bb-base-dialog__overlay\": true,\n \"bb-base-dialog--fullscreen\": props.fullscreen,\n \"bb-base-dialog--open\": open.value,\n \"bb-base-dialog--opening\": opening.value,\n \"bb-base-dialog--closed\": closed.value,\n \"bb-base-dialog--closing\": closing.value,\n [`bb-base-dialog--transition-${props.transition}`]: true,\n },\n props.overlayClasses,\n ].flat();\n const eventListeners = {\n onClick: onOverlayClick,\n onScroll: onOverlayScroll,\n onTouchmove: onOverlayScroll,\n onWheel: onOverlayScroll,\n onKeydown: onOverlayScroll,\n };\n\n const style = {\n transitionDuration: props.transitionDuration / 1000 + \"s\",\n };\n return {\n class: classes,\n style,\n ...eventListeners,\n ...attrs,\n };\n});\n\nconst panelAttributes = computed(() => {\n const classes = [\n {\n \"bb-base-dialog__panel\": true,\n \"bb-base-dialog__panel--compact\": props.compact,\n },\n props.panelClasses,\n ].flat();\n\n const accessibilityAttrs: {\n [key: string]: string | boolean;\n } = {\n role: \"dialog\",\n \"aria-modal\": true,\n };\n\n if (hasRenderedAtLeastOnce.value) {\n accessibilityAttrs[\"aria-labelledby\"] = titleId;\n\n if (props.description)\n accessibilityAttrs[\"aria-describedby\"] = descriptionId;\n }\n\n let maxWidth;\n const sizes: Sizes = {\n sm: 384,\n md: 652,\n lg: 896,\n };\n if (props.fullscreen) maxWidth = \"100%\";\n else if (typeof props.size === \"number\") maxWidth = props.size + \"px\";\n else if (props.size in sizes)\n maxWidth = sizes[props.size as keyof Sizes] + \"px\";\n else maxWidth = props.size + \"px\";\n\n const style = {\n maxWidth,\n transitionDuration: props.transitionDuration / 1000 + \"s\",\n };\n\n return {\n class: classes,\n style,\n ...accessibilityAttrs,\n };\n});\n\n/**\n * This is called when content inside body changes.\n * Gets the total height the panel needs to be\n * It could be called numerous times so throttle every 300ms\n */\nconst onContentGrow = throttle(async () => {\n if (props.fullscreen) {\n height.value = window.innerHeight;\n return;\n }\n if (header.value && body.value && footer.value) {\n const contentHeight =\n header.value.scrollHeight +\n body.value.scrollHeight +\n footer.value.scrollHeight +\n 2;\n /* Add two so renderless elements at the bottom are not cut off */\n if (content.value) {\n content.value.style.height = \"0px\";\n content.value.style.height = `${contentHeight + 10}px`;\n /**\n * Run until all transitions inside have completed\n */\n await wait(30);\n if (header.value && body.value && footer.value) {\n const contentHeight2 =\n header.value.scrollHeight +\n body.value.scrollHeight +\n footer.value.scrollHeight +\n 20;\n if (contentHeight !== contentHeight2) onContentGrow();\n }\n }\n }\n}, 200);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"div\", _mergeProps(overlayAttributes.value, {\n ref_key: \"overlay\",\n ref: overlay\n }), [\n _createElementVNode(\"div\", _mergeProps(panelAttributes.value, {\n ref_key: \"panel\",\n ref: panel\n }), [\n (hasRenderedAtLeastOnce.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"bb-base-dialog__content\",\n ref_key: \"content\",\n ref: content\n }, [\n _createElementVNode(\"div\", {\n class: \"bb-base-dialog__header\",\n ref_key: \"header\",\n ref: header\n }, [\n _renderSlot(_ctx.$slots, \"header\", {\n titleId: titleId,\n close: onCloseClick,\n title: _ctx.title\n }, () => [\n _createElementVNode(\"span\", {\n class: \"bb-base-dialog__title\",\n id: titleId\n }, [\n _renderSlot(_ctx.$slots, \"title\", { text: _ctx.title }, () => [\n _createTextVNode(_toDisplayString(_ctx.title), 1)\n ])\n ]),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.showClose)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n onClick: onCloseClick,\n type: \"button\"\n }, [\n _renderSlot(_ctx.$slots, \"close\", { text: closeLabel.value }, () => [\n _createElementVNode(\"span\", _hoisted_2, [\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(closeLabel.value), 1),\n _hoisted_4\n ])\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ])\n ], 512),\n _createElementVNode(\"div\", {\n class: \"bb-base-dialog__body\",\n ref_key: \"body\",\n ref: body\n }, [\n _renderSlot(_ctx.$slots, \"description\", {\n descriptionId: descriptionId,\n text: _ctx.description\n }, () => [\n (_ctx.description)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n id: descriptionId,\n class: \"bb-base-dialog__description\"\n }, _toDisplayString(_ctx.description), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _renderSlot(_ctx.$slots, \"default\")\n ], 512),\n _hoisted_5,\n _createElementVNode(\"div\", {\n class: \"bb-base-dialog__footer\",\n ref_key: \"footer\",\n ref: footer\n }, [\n _renderSlot(_ctx.$slots, \"footer\")\n ], 512)\n ], 512))\n : _createCommentVNode(\"\", true)\n ], 16)\n ], 16)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_createElementVNode","_hoisted_5","_sfc_main","_defineComponent","__props","__emit","props","emit","titleId","useId","descriptionId","observer","ref","overlay","panel","content","header","body","footer","height","activate","deactivate","useFocusTrap","nextTick","attrs","useAttrs","closeLabel","computed","onMounted","onContentGrow","onBeforeUnmount","open","opening","closed","closing","hasRenderedAtLeastOnce","busy","currentlyOpenModals","alignToModelValue","waitFor","scrollBarWidth","wait","watchPostEffect","onOverlayScroll","event","onOverlayClick","onCloseClick","overlayAttributes","classes","eventListeners","style","panelAttributes","accessibilityAttrs","maxWidth","sizes","throttle","contentHeight","contentHeight2","_ctx","_cache","_openBlock","_createBlock","_Teleport","_mergeProps","_createElementBlock","_renderSlot","_createTextVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,0BACtBC,KAAa,EAAE,OAAO,mCACtBC,KAAa,EAAE,OAAO,iCACtBC,KAA8CC,gBAAAA,EAAA,QAAQ,EAAE,OAAO,gCAAgC;AAAA,oBAClE,OAAO;AAAA,IACtC,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,EAAA,GACd;AAAA,sBACgC,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,IAAA,CACnB;AAAA,EAAA,CACF;AACH,GAAG,EAAE,GACCC,KAA8CD,gBAAAA,EAAA,OAAO,EAAE,OAAO,EAAC,MAAO,mBAAqB,GAAA,MAAM,EAAE,GA6E7EE,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;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,GAAG,CAAC,KACxCU,EAAoB,IAAI,EAAI;AAAA,cAAA,CACjC;AAAA,cACDH,EAAYP,EAAK,QAAQ,SAAS;AAAA,eACjC,GAAG;AAAA,YACNzD;AAAA,YACAD,EAAoB,OAAO;AAAA,cACzB,OAAO;AAAA,cACP,SAAS;AAAA,cACT,KAAKkB;AAAA,YAAA,GACJ;AAAA,cACD+C,EAAYP,EAAK,QAAQ,QAAQ;AAAA,eAChC,GAAG;AAAA,UACL,GAAA,GAAG,KACNU,EAAoB,IAAI,EAAI;AAAA,WAC/B,EAAE;AAAA,SACJ,EAAE;AAAA,IAAA,CACN;AAAA,EAEH;AAEA,CAAC;"}
|
package/dist/index196.js
CHANGED
package/dist/index196.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index196.js","sources":["../src/utilities/functions/
|
|
1
|
+
{"version":3,"file":"index196.js","sources":["../src/utilities/functions/clamp.ts"],"sourcesContent":["/**\n * Returns value ensuring it doesn't go below min and exceed max.\n * EXAMPLE: clamp(5, 7, 20) === 7\n * @param value The value to clamp\n * @param min Minimum bound\n * @param max Maximum bound\n * @returns \n */\n\nexport const clamp = (value: number, min: number, max: number) => {\n return Math.min(Math.max(value, min), max);\n};\n"],"names":["clamp","value","min","max"],"mappings":"AASO,MAAMA,IAAQ,CAACC,GAAeC,GAAaC,MACzC,KAAK,IAAI,KAAK,IAAIF,GAAOC,CAAG,GAAGC,CAAG;"}
|
package/dist/index197.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const t = (n, o, r) => n(r) ? o(r) : r, s = e(t);
|
|
1
|
+
const s = (r) => !!r && !!r.match(/^(#|var\(--|(rgb|hsl)a?\()/);
|
|
3
2
|
export {
|
|
4
|
-
|
|
5
|
-
s as when
|
|
3
|
+
s as isCssColor
|
|
6
4
|
};
|
|
7
5
|
//# sourceMappingURL=index197.js.map
|
package/dist/index197.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index197.js","sources":["../src/utilities/functions/
|
|
1
|
+
{"version":3,"file":"index197.js","sources":["../src/utilities/functions/isCssColor.ts"],"sourcesContent":["/**\n * Taken from vuetify colorable mixin\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/mixins/colorable/index.ts\n */\nexport const isCssColor = (color: string): boolean => {\n return !!color && !!color.match(/^(#|var\\(--|(rgb|hsl)a?\\()/);\n};\n"],"names":["isCssColor","color"],"mappings":"AAIa,MAAAA,IAAa,CAACC,MAClB,CAAC,CAACA,KAAS,CAAC,CAACA,EAAM,MAAM,4BAA4B;"}
|
package/dist/index198.js
CHANGED
package/dist/index198.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index198.js","sources":["../src/utilities/functions/
|
|
1
|
+
{"version":3,"file":"index198.js","sources":["../src/utilities/functions/when.ts"],"sourcesContent":["import { curry } from \"./curry\"\n/**\n * Runs fn on item if iteratee(item) is thruthy\n * @param iteratee The test\n * @param item The item to test\n * @param fn The transformer function\n * @returns\n */\nexport const baseWhen = <T, U>(\n iteratee: (item: T) => boolean,\n fn: (item: T) => U,\n item: T\n) => {\n if (iteratee(item)) return fn(item);\n return item;\n};\n\nexport const when = curry(baseWhen);\n"],"names":["baseWhen","iteratee","fn","item","when","curry"],"mappings":";AAQO,MAAMA,IAAW,CACtBC,GACAC,GACAC,MAEIF,EAASE,CAAI,IAAUD,EAAGC,CAAI,IAC3BA,GAGIC,IAAOC,EAAML,CAAQ;"}
|