bootstrap-vue-next 1.2.2 → 1.2.4
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/{BAccordion-FuQ6sMFy.js → BAccordion-ByAMZCS9.js} +2 -2
- package/dist/{BAccordion-FuQ6sMFy.js.map → BAccordion-ByAMZCS9.js.map} +1 -1
- package/dist/{BAlert-C9Mi4RDx.js → BAlert-DdfFcjWF.js} +2 -2
- package/dist/{BAlert-C9Mi4RDx.js.map → BAlert-DdfFcjWF.js.map} +1 -1
- package/dist/{BApp-Bg5xEz8H.js → BApp-DZ9AITOm.js} +22 -3
- package/dist/BApp-DZ9AITOm.js.map +1 -0
- package/dist/{BCarousel-DQgfW4DN.js → BCarousel-qHGRSVFe.js} +2 -2
- package/dist/{BCarousel-DQgfW4DN.js.map → BCarousel-qHGRSVFe.js.map} +1 -1
- package/dist/{BCollapse-B9fnWSzA.js → BCollapse-DtuJwN7B.js} +2 -2
- package/dist/{BCollapse-B9fnWSzA.js.map → BCollapse-DtuJwN7B.js.map} +1 -1
- package/dist/{BDropdown-CnxUzs42.js → BDropdown-BY-E0SHv.js} +3 -3
- package/dist/{BDropdown-CnxUzs42.js.map → BDropdown-BY-E0SHv.js.map} +1 -1
- package/dist/{BModal-NPsCBNo7.js → BModal-DtQlIFNn.js} +2 -2
- package/dist/{BModal-NPsCBNo7.js.map → BModal-DtQlIFNn.js.map} +1 -1
- package/dist/{BNav-CjXS9tQ5.js → BNav-BMWNXoNo.js} +2 -2
- package/dist/{BNav-CjXS9tQ5.js.map → BNav-BMWNXoNo.js.map} +1 -1
- package/dist/{BOffcanvas-BndaBJoP.js → BOffcanvas-BtvIDgH7.js} +2 -2
- package/dist/{BOffcanvas-BndaBJoP.js.map → BOffcanvas-BtvIDgH7.js.map} +1 -1
- package/dist/{BPagination-D_Hfk6OF.js → BPagination-C85wHRgS.js} +2 -2
- package/dist/{BPagination-D_Hfk6OF.js.map → BPagination-C85wHRgS.js.map} +1 -1
- package/dist/{BTabs-BKmkVWrZ.js → BTabs-Cfe8HOGE.js} +2 -2
- package/dist/{BTabs-BKmkVWrZ.js.map → BTabs-Cfe8HOGE.js.map} +1 -1
- package/dist/{BToast-Di9HwBOV.js → BToast-Cm7TZlZq.js} +2 -2
- package/dist/{BToast-Di9HwBOV.js.map → BToast-Cm7TZlZq.js.map} +1 -1
- package/dist/{BTooltip-BxaUtV4m.js → BTooltip-CAgQ77tS.js} +5 -11
- package/dist/BTooltip-CAgQ77tS.js.map +1 -0
- package/dist/bootstrap-vue-next.mjs +16 -16
- package/dist/{classes-BEWWGbj5.js → classes-DCjKFM2E.js} +12 -2
- package/dist/classes-DCjKFM2E.js.map +1 -0
- package/dist/components/BTooltip/BTooltip.vue.d.mts +3 -3
- package/dist/components/BTooltip/BTooltip.vue.d.ts +3 -3
- package/dist/composables/usePopover/index.d.mts +9 -9
- package/dist/composables/usePopover/index.d.ts +9 -9
- package/dist/{floatingUi-BlKoACvc.js → floatingUi-CSJCHfOw.js} +2 -2
- package/dist/{floatingUi-BlKoACvc.js.map → floatingUi-CSJCHfOw.js.map} +1 -1
- package/dist/src/components/BAccordion/index.mjs +1 -1
- package/dist/src/components/BAlert/index.mjs +1 -1
- package/dist/src/components/BApp/index.mjs +1 -1
- package/dist/src/components/BCarousel/index.mjs +1 -1
- package/dist/src/components/BCollapse/index.mjs +1 -1
- package/dist/src/components/BDropdown/index.mjs +1 -1
- package/dist/src/components/BModal/index.mjs +1 -1
- package/dist/src/components/BNav/index.mjs +1 -1
- package/dist/src/components/BOffcanvas/index.mjs +1 -1
- package/dist/src/components/BPagination/index.mjs +1 -1
- package/dist/src/components/BPopover/index.mjs +1 -1
- package/dist/src/components/BTabs/index.mjs +1 -1
- package/dist/src/components/BToast/index.mjs +1 -1
- package/dist/src/components/BTooltip/index.mjs +1 -1
- package/dist/src/components/index.mjs +14 -14
- package/dist/src/composables/orchestratorShared/index.mjs +169 -23
- package/dist/src/composables/orchestratorShared/index.mjs.map +1 -1
- package/dist/src/composables/useModal/index.mjs +1 -1
- package/dist/src/composables/usePopover/index.mjs +2 -2
- package/dist/src/composables/useToast/index.mjs +1 -1
- package/dist/src/directives/BPopover/index.mjs +2 -2
- package/dist/src/directives/BScrollspy/index.mjs +1 -1
- package/dist/src/directives/BToggle/index.mjs +1 -1
- package/dist/src/directives/BTooltip/index.mjs +2 -2
- package/dist/src/utils/index.mjs +1 -1
- package/dist/types/ComponentOrchestratorTypes.d.mts +8 -1
- package/dist/types/ComponentOrchestratorTypes.d.ts +8 -1
- package/dist/{useShowHide-C95Y9EKL.js → useShowHide-Dpld86ys.js} +124 -54
- package/dist/useShowHide-Dpld86ys.js.map +1 -0
- package/dist/utils/classes.d.mts +10 -0
- package/dist/utils/classes.d.ts +10 -0
- package/dist/{utils-nRGGHA_i.js → utils-DYdkCKBf.js} +2 -2
- package/dist/{utils-nRGGHA_i.js.map → utils-DYdkCKBf.js.map} +1 -1
- package/package.json +1 -1
- package/dist/BApp-Bg5xEz8H.js.map +0 -1
- package/dist/BTooltip-BxaUtV4m.js.map +0 -1
- package/dist/classes-BEWWGbj5.js.map +0 -1
- package/dist/useShowHide-C95Y9EKL.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { r as BvTriggerableEvent } from "./classes-DCjKFM2E.js";
|
|
1
2
|
import { x as showHideRegistryKey } from "./keys-BgLwJbLV.js";
|
|
2
3
|
import { x as useThrottleFn } from "./dist-DKc2ivHS.js";
|
|
3
4
|
import { f as useEventListener } from "./dist-9-XTMhb-.js";
|
|
4
|
-
import { r as BvTriggerableEvent } from "./classes-BEWWGbj5.js";
|
|
5
5
|
import { t as noop } from "./functions-BUZ1y9RA.js";
|
|
6
6
|
import { computed, getCurrentInstance, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted, readonly, ref, watch } from "vue";
|
|
7
7
|
//#region src/composables/useShowHide.ts
|
|
@@ -42,12 +42,17 @@ var useShowHide = ({ modelValue, element, props, emit, id }, options = {
|
|
|
42
42
|
onMounted(() => {
|
|
43
43
|
isMounted = true;
|
|
44
44
|
if (!props.show && initialShow) {
|
|
45
|
-
const
|
|
45
|
+
const requestSignal = currentRequestSignal();
|
|
46
|
+
const event = buildTriggerableEvent("show", {
|
|
47
|
+
cancelable: true,
|
|
48
|
+
signal: requestSignal
|
|
49
|
+
});
|
|
46
50
|
emit("show", event);
|
|
47
51
|
if (event.defaultPrevented) {
|
|
48
|
-
emit("show-prevented", buildTriggerableEvent("show-prevented"));
|
|
52
|
+
emit("show-prevented", buildTriggerableEvent("show-prevented", { signal: requestSignal }));
|
|
49
53
|
return;
|
|
50
54
|
}
|
|
55
|
+
endRequests();
|
|
51
56
|
localNoAnimation.value = true;
|
|
52
57
|
if (!modelValue.value) {
|
|
53
58
|
noAction = true;
|
|
@@ -90,6 +95,40 @@ var useShowHide = ({ modelValue, element, props, emit, id }, options = {
|
|
|
90
95
|
let _Resolve;
|
|
91
96
|
let _Promise;
|
|
92
97
|
let _resolveOnHide;
|
|
98
|
+
/**
|
|
99
|
+
* The show or hide that was last committed. Committing the next one aborts it, which cancels its
|
|
100
|
+
* pending frame and timer, so a superseded show can't reveal the component after a hide (or the
|
|
101
|
+
* reverse). It stays 'hide' after the component is hidden, so repeated hides are ignored until
|
|
102
|
+
* the next show
|
|
103
|
+
*/
|
|
104
|
+
let transition;
|
|
105
|
+
/**
|
|
106
|
+
* Backs `event.signal` on show and hide request events. Requests share it until the component
|
|
107
|
+
* commits to a show or hide (or unmounts), which aborts it. A prevented request leaves it running,
|
|
108
|
+
* so async work started for it stops only once the component actually changes state
|
|
109
|
+
*/
|
|
110
|
+
let requestScope;
|
|
111
|
+
const currentRequestSignal = () => (requestScope ??= new AbortController()).signal;
|
|
112
|
+
const endRequests = () => {
|
|
113
|
+
requestScope?.abort();
|
|
114
|
+
requestScope = void 0;
|
|
115
|
+
};
|
|
116
|
+
const beginTransition = (type) => {
|
|
117
|
+
endRequests();
|
|
118
|
+
transition?.controller.abort();
|
|
119
|
+
const controller = new AbortController();
|
|
120
|
+
transition = {
|
|
121
|
+
type,
|
|
122
|
+
controller
|
|
123
|
+
};
|
|
124
|
+
return controller.signal;
|
|
125
|
+
};
|
|
126
|
+
const afterFrame = (signal, fn) => {
|
|
127
|
+
const frame = requestAnimationFrame(() => {
|
|
128
|
+
if (!signal.aborted) fn();
|
|
129
|
+
});
|
|
130
|
+
signal.addEventListener("abort", () => cancelAnimationFrame(frame), { once: true });
|
|
131
|
+
};
|
|
93
132
|
const show = (resolveOnHide = false) => {
|
|
94
133
|
if (showRef.value && !hideTimeout && !_Promise) return Promise.resolve(true);
|
|
95
134
|
_resolveOnHide = resolveOnHide;
|
|
@@ -97,10 +136,14 @@ var useShowHide = ({ modelValue, element, props, emit, id }, options = {
|
|
|
97
136
|
_Promise = new Promise((resolve) => {
|
|
98
137
|
_Resolve = resolve;
|
|
99
138
|
});
|
|
100
|
-
const
|
|
139
|
+
const requestSignal = currentRequestSignal();
|
|
140
|
+
const event = buildTriggerableEvent("show", {
|
|
141
|
+
cancelable: true,
|
|
142
|
+
signal: requestSignal
|
|
143
|
+
});
|
|
101
144
|
emit("show", event);
|
|
102
145
|
if (event.defaultPrevented) {
|
|
103
|
-
emit("show-prevented", buildTriggerableEvent("show-prevented"));
|
|
146
|
+
emit("show-prevented", buildTriggerableEvent("show-prevented", { signal: requestSignal }));
|
|
104
147
|
if (isVisible.value) isVisible.value = false;
|
|
105
148
|
if (modelValue.value && !isCountdown) {
|
|
106
149
|
noAction = true;
|
|
@@ -111,84 +154,109 @@ var useShowHide = ({ modelValue, element, props, emit, id }, options = {
|
|
|
111
154
|
_Resolve?.("show-prevented");
|
|
112
155
|
return _Promise;
|
|
113
156
|
}
|
|
114
|
-
|
|
115
|
-
clearTimeout(hideTimeout);
|
|
116
|
-
hideTimeout = void 0;
|
|
117
|
-
}
|
|
157
|
+
const signal = beginTransition("show");
|
|
118
158
|
renderRef.value = true;
|
|
119
159
|
renderBackdropRef.value = true;
|
|
120
|
-
|
|
160
|
+
const reveal = () => {
|
|
161
|
+
if (!isMounted) return;
|
|
162
|
+
showTimeout = void 0;
|
|
163
|
+
showRef.value = true;
|
|
164
|
+
options.showFn?.();
|
|
165
|
+
if (!modelValue.value) {
|
|
166
|
+
noAction = true;
|
|
167
|
+
nextTick(() => {
|
|
168
|
+
modelValue.value = true;
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
afterFrame(signal, () => {
|
|
121
173
|
if (localNoAnimation.value || props.delay === void 0) {
|
|
122
|
-
|
|
123
|
-
showTimeout = void 0;
|
|
124
|
-
showRef.value = true;
|
|
125
|
-
options.showFn?.();
|
|
126
|
-
if (!modelValue.value) {
|
|
127
|
-
noAction = true;
|
|
128
|
-
nextTick(() => {
|
|
129
|
-
modelValue.value = true;
|
|
130
|
-
});
|
|
131
|
-
}
|
|
174
|
+
reveal();
|
|
132
175
|
return;
|
|
133
176
|
}
|
|
134
|
-
showTimeout = setTimeout(
|
|
135
|
-
|
|
177
|
+
showTimeout = setTimeout(reveal, typeof props.delay === "number" ? props.delay : props.delay?.show || 0);
|
|
178
|
+
signal.addEventListener("abort", () => {
|
|
179
|
+
clearTimeout(showTimeout);
|
|
136
180
|
showTimeout = void 0;
|
|
137
|
-
|
|
138
|
-
options.showFn?.();
|
|
139
|
-
if (!modelValue.value) {
|
|
140
|
-
noAction = true;
|
|
141
|
-
nextTick(() => {
|
|
142
|
-
modelValue.value = true;
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}, typeof props.delay === "number" ? props.delay : props.delay?.show || 0);
|
|
181
|
+
}, { once: true });
|
|
146
182
|
});
|
|
147
183
|
return _Promise;
|
|
148
184
|
};
|
|
149
185
|
let leaveTrigger;
|
|
150
186
|
const hide = (trigger, noTriggerEmit) => {
|
|
187
|
+
if (transition?.type === "hide") return _Promise ?? Promise.resolve("");
|
|
151
188
|
if (!showRef.value && !showTimeout && !renderRef.value) return Promise.resolve("");
|
|
189
|
+
const ownsPromise = !_Promise;
|
|
152
190
|
if (!_Promise) _Promise = new Promise((resolve) => {
|
|
153
191
|
_Resolve = resolve;
|
|
154
192
|
});
|
|
193
|
+
const hidePromise = _Promise;
|
|
155
194
|
if (typeof trigger !== "string") trigger = void 0;
|
|
156
|
-
|
|
195
|
+
const transitionBefore = transition;
|
|
196
|
+
const requestSignal = currentRequestSignal();
|
|
197
|
+
const prevented = () => {
|
|
198
|
+
emit("hide-prevented", buildTriggerableEvent("hide-prevented", {
|
|
199
|
+
trigger,
|
|
200
|
+
signal: requestSignal
|
|
201
|
+
}));
|
|
202
|
+
if (!ownsPromise) return Promise.resolve("hide-prevented");
|
|
203
|
+
const promise = _Promise;
|
|
204
|
+
_Resolve?.("hide-prevented");
|
|
205
|
+
_Promise = void 0;
|
|
206
|
+
_Resolve = void 0;
|
|
207
|
+
return promise;
|
|
208
|
+
};
|
|
157
209
|
const event = buildTriggerableEvent("hide", {
|
|
158
210
|
cancelable: true,
|
|
159
|
-
trigger
|
|
211
|
+
trigger,
|
|
212
|
+
signal: requestSignal
|
|
160
213
|
});
|
|
161
214
|
const event2 = buildTriggerableEvent(trigger || "ignore", {
|
|
162
215
|
cancelable: true,
|
|
163
|
-
trigger
|
|
216
|
+
trigger,
|
|
217
|
+
signal: requestSignal
|
|
164
218
|
});
|
|
165
|
-
if (trigger === "backdrop" && props.noCloseOnBackdrop || trigger === "esc" && props.noCloseOnEsc)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if (showTimeout) {
|
|
171
|
-
clearTimeout(showTimeout);
|
|
172
|
-
showTimeout = void 0;
|
|
219
|
+
if (trigger === "backdrop" && props.noCloseOnBackdrop || trigger === "esc" && props.noCloseOnEsc) return prevented();
|
|
220
|
+
const hiddenByListener = () => transition !== transitionBefore;
|
|
221
|
+
if (trigger && !noTriggerEmit) {
|
|
222
|
+
emit(trigger, event2);
|
|
223
|
+
if (hiddenByListener()) return hidePromise;
|
|
173
224
|
}
|
|
174
|
-
if (trigger && !noTriggerEmit) emit(trigger, event2);
|
|
175
225
|
emit("hide", event);
|
|
226
|
+
if (hiddenByListener()) return hidePromise;
|
|
176
227
|
if (event.defaultPrevented || event2.defaultPrevented) {
|
|
177
|
-
emit("hide-prevented", buildTriggerableEvent("hide-prevented", { trigger }));
|
|
178
228
|
if (!modelValue.value) nextTick(() => {
|
|
179
229
|
noAction = true;
|
|
180
230
|
modelValue.value = true;
|
|
181
231
|
});
|
|
182
|
-
|
|
183
|
-
return _Promise;
|
|
232
|
+
return prevented();
|
|
184
233
|
}
|
|
234
|
+
const showWasPending = transition?.type === "show" && !showRef.value;
|
|
235
|
+
const leaveIsRunning = showWasPending && isLeaving.value;
|
|
185
236
|
trapActive.value = false;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
237
|
+
const signal = beginTransition("hide");
|
|
238
|
+
if (showWasPending && modelValue.value) {
|
|
239
|
+
noAction = true;
|
|
240
|
+
modelValue.value = isCountdown ? 0 : false;
|
|
241
|
+
}
|
|
242
|
+
if (leaveIsRunning) {
|
|
243
|
+
leaveTrigger = trigger;
|
|
244
|
+
return hidePromise;
|
|
245
|
+
}
|
|
246
|
+
if (showWasPending) {
|
|
189
247
|
if (!localTemporaryHide.value) renderRef.value = false;
|
|
190
248
|
renderBackdropRef.value = false;
|
|
249
|
+
const resolve = _Resolve;
|
|
250
|
+
_Promise = void 0;
|
|
251
|
+
_Resolve = void 0;
|
|
252
|
+
emit("hidden", buildTriggerableEvent("hidden", {
|
|
253
|
+
trigger,
|
|
254
|
+
cancelable: false
|
|
255
|
+
}));
|
|
256
|
+
resolve?.(trigger || "");
|
|
257
|
+
return hidePromise;
|
|
191
258
|
}
|
|
259
|
+
leaveTrigger = trigger;
|
|
192
260
|
hideTimeout = setTimeout(() => {
|
|
193
261
|
if (!isMounted) return;
|
|
194
262
|
hideTimeout = void 0;
|
|
@@ -200,6 +268,10 @@ var useShowHide = ({ modelValue, element, props, emit, id }, options = {
|
|
|
200
268
|
modelValue.value = isCountdown ? 0 : false;
|
|
201
269
|
}
|
|
202
270
|
}, localNoAnimation.value ? 0 : typeof props.delay === "number" ? props.delay : props.delay?.hide || 0);
|
|
271
|
+
signal.addEventListener("abort", () => {
|
|
272
|
+
clearTimeout(hideTimeout);
|
|
273
|
+
hideTimeout = void 0;
|
|
274
|
+
}, { once: true });
|
|
203
275
|
return _Promise;
|
|
204
276
|
};
|
|
205
277
|
const throttleHide = useThrottleFn((a) => hide(a), 500);
|
|
@@ -276,10 +348,8 @@ var useShowHide = ({ modelValue, element, props, emit, id }, options = {
|
|
|
276
348
|
});
|
|
277
349
|
onUnmounted(() => {
|
|
278
350
|
isMounted = false;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
showTimeout = void 0;
|
|
282
|
-
hideTimeout = void 0;
|
|
351
|
+
transition?.controller.abort();
|
|
352
|
+
endRequests();
|
|
283
353
|
});
|
|
284
354
|
const lazyLoadCompleted = ref(false);
|
|
285
355
|
const markLazyLoadCompleted = () => {
|
|
@@ -428,4 +498,4 @@ var useShowHide = ({ modelValue, element, props, emit, id }, options = {
|
|
|
428
498
|
//#endregion
|
|
429
499
|
export { useShowHide as t };
|
|
430
500
|
|
|
431
|
-
//# sourceMappingURL=useShowHide-
|
|
501
|
+
//# sourceMappingURL=useShowHide-Dpld86ys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShowHide-Dpld86ys.js","names":[],"sources":["../src/composables/useShowHide.ts"],"sourcesContent":["import {\n type ComponentInternalInstance,\n computed,\n type EmitFn,\n getCurrentInstance,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n readonly,\n ref,\n type Ref,\n type TransitionProps,\n watch,\n} from 'vue'\nimport {showHideRegistryKey} from '../utils/keys'\nimport {BvTriggerableEvent} from '../utils'\nimport {useEventListener, useThrottleFn} from '@vueuse/core'\nimport {noop} from '../utils/functions'\n\nexport const fadeBaseTransitionProps = {\n name: 'fade',\n enterActiveClass: '',\n enterFromClass: 'showing',\n enterToClass: '',\n leaveActiveClass: '',\n leaveFromClass: '',\n leaveToClass: 'showing',\n css: true,\n} as const satisfies TransitionProps\n\nexport const useShowHide = (\n {\n modelValue,\n element,\n props,\n emit,\n id,\n }: {\n modelValue: Ref<boolean | number>\n props: {\n visible?: boolean\n show?: boolean\n noAnimation?: boolean\n noFade?: boolean\n noCloseOnBackdrop?: boolean\n noCloseOnEsc?: boolean\n transitionProps?: TransitionProps\n lazy?: boolean\n initialAnimation?: boolean\n delay?:\n | number\n | {\n show: number\n hide: number\n }\n } & Record<string, unknown>\n emit: EmitFn\n element: Ref<HTMLElement | null>\n id: Ref<string>\n },\n options: {\n transitionProps?: TransitionProps\n showFn?: () => void\n hideFn?: () => void\n } = {\n transitionProps: {},\n showFn: () => {},\n hideFn: () => {},\n }\n) => {\n let noAction = false\n const initialShow = (!!modelValue.value && !props.initialAnimation) || props.visible || false\n const showRef = ref<boolean>(initialShow)\n const renderRef = ref<boolean>(initialShow)\n const renderBackdropRef = ref<boolean>(initialShow)\n\n let isCountdown = typeof modelValue.value !== 'boolean'\n\n watch(modelValue, () => {\n isCountdown = typeof modelValue.value !== 'boolean'\n if (noAction) {\n noAction = false\n return\n }\n if (modelValue.value) {\n show()\n } else {\n hide('modelValue', true)\n }\n })\n\n const localNoAnimation = ref(initialShow)\n const localTemporaryHide = ref(false)\n const computedNoAnimation = computed(\n () => props.noAnimation || props.noFade || localNoAnimation.value || false\n )\n let isMounted = false\n onMounted(() => {\n isMounted = true\n if (!props.show && initialShow) {\n // show without delay or animation\n const requestSignal = currentRequestSignal()\n const event = buildTriggerableEvent('show', {cancelable: true, signal: requestSignal})\n emit('show', event)\n\n if (event.defaultPrevented) {\n emit('show-prevented', buildTriggerableEvent('show-prevented', {signal: requestSignal}))\n return\n }\n endRequests()\n localNoAnimation.value = true\n if (!modelValue.value) {\n noAction = true\n modelValue.value = true\n }\n renderRef.value = true\n renderBackdropRef.value = true\n isVisible.value = true\n backdropVisible.value = true\n backdropReady.value = true\n showRef.value = true\n options.showFn?.()\n } else if (props.show || (!!modelValue.value && props.initialAnimation)) {\n show()\n }\n })\n\n watch(\n () => props.visible,\n (newVal) => {\n localNoAnimation.value = true\n\n nextTick(() => {\n if (newVal) isVisible.value = true\n if (newVal) {\n show()\n } else {\n hide('visible-prop', true)\n }\n })\n }\n )\n watch(\n () => props.show,\n (newVal) => {\n if (newVal) {\n show()\n } else {\n hide('show-prop', true)\n }\n }\n )\n // todo: remove\n useEventListener(\n element,\n 'bv-toggle',\n () => {\n modelValue.value = !modelValue.value\n },\n {passive: true}\n )\n\n const buildTriggerableEvent = (\n type: string,\n opts: Readonly<Partial<BvTriggerableEvent>> = {}\n ): BvTriggerableEvent =>\n new BvTriggerableEvent(type, {\n cancelable: false,\n target: element?.value || null,\n relatedTarget: null,\n trigger: null,\n ...opts,\n componentId: id?.value,\n })\n\n let showTimeout: ReturnType<typeof setTimeout> | undefined\n let hideTimeout: ReturnType<typeof setTimeout> | undefined\n let _Resolve: ((value: boolean | string) => void) | undefined\n let _Promise: Promise<boolean | string> | undefined\n let _resolveOnHide: boolean | undefined\n\n /**\n * The show or hide that was last committed. Committing the next one aborts it, which cancels its\n * pending frame and timer, so a superseded show can't reveal the component after a hide (or the\n * reverse). It stays 'hide' after the component is hidden, so repeated hides are ignored until\n * the next show\n */\n let transition: {type: 'show' | 'hide'; controller: AbortController} | undefined\n /**\n * Backs `event.signal` on show and hide request events. Requests share it until the component\n * commits to a show or hide (or unmounts), which aborts it. A prevented request leaves it running,\n * so async work started for it stops only once the component actually changes state\n */\n let requestScope: AbortController | undefined\n const currentRequestSignal = (): AbortSignal => (requestScope ??= new AbortController()).signal\n const endRequests = () => {\n requestScope?.abort()\n requestScope = undefined\n }\n const beginTransition = (type: 'show' | 'hide'): AbortSignal => {\n endRequests()\n transition?.controller.abort()\n const controller = new AbortController()\n transition = {type, controller}\n return controller.signal\n }\n\n const afterFrame = (signal: AbortSignal, fn: () => void) => {\n const frame = requestAnimationFrame(() => {\n if (!signal.aborted) fn()\n })\n signal.addEventListener('abort', () => cancelAnimationFrame(frame), {once: true})\n }\n\n const show = (resolveOnHide: boolean = false): Promise<boolean | string> => {\n if (showRef.value && !hideTimeout && !_Promise) return Promise.resolve(true)\n _resolveOnHide = resolveOnHide\n if (showRef.value && !hideTimeout && _Promise) return _Promise\n\n _Promise = new Promise<boolean | string>((resolve) => {\n _Resolve = resolve\n })\n\n const requestSignal = currentRequestSignal()\n const event = buildTriggerableEvent('show', {cancelable: true, signal: requestSignal})\n emit('show', event)\n\n if (event.defaultPrevented) {\n emit('show-prevented', buildTriggerableEvent('show-prevented', {signal: requestSignal}))\n if (isVisible.value) {\n isVisible.value = false\n }\n if (modelValue.value && !isCountdown) {\n noAction = true\n nextTick(() => {\n modelValue.value = false\n })\n }\n _Resolve?.('show-prevented')\n return _Promise\n }\n const signal = beginTransition('show')\n renderRef.value = true\n renderBackdropRef.value = true\n const reveal = () => {\n if (!isMounted) return\n showTimeout = undefined\n showRef.value = true\n options.showFn?.()\n if (!modelValue.value) {\n noAction = true\n nextTick(() => {\n modelValue.value = true\n })\n }\n }\n afterFrame(signal, () => {\n if (localNoAnimation.value || props.delay === undefined) {\n reveal()\n return\n }\n showTimeout = setTimeout(\n reveal,\n typeof props.delay === 'number' ? props.delay : props.delay?.show || 0\n )\n signal.addEventListener(\n 'abort',\n () => {\n clearTimeout(showTimeout)\n showTimeout = undefined\n },\n {once: true}\n )\n })\n return _Promise\n }\n\n let leaveTrigger: string | undefined\n const hide = (trigger?: string, noTriggerEmit?: boolean): Promise<string> => {\n // A hide is already committed: report on it rather than emitting the hide events again\n if (transition?.type === 'hide') {\n return (_Promise as Promise<string> | undefined) ?? Promise.resolve('')\n }\n if (!showRef.value && !showTimeout && !renderRef.value) return Promise.resolve('')\n // The promise may belong to a show (still entering, or show(true) waiting for the hide).\n // A prevented hide must leave that one alone\n const ownsPromise = !_Promise\n if (!_Promise)\n _Promise = new Promise<string>((resolve) => {\n ;(_Resolve as (value: string | PromiseLike<string>) => void) = resolve\n })\n // Captured because a hide started by a listener may settle and clear _Promise before we return\n const hidePromise = _Promise as Promise<string>\n if (typeof trigger !== 'string') trigger = undefined\n const transitionBefore = transition\n const requestSignal = currentRequestSignal()\n const prevented = (): Promise<string> => {\n emit(\n 'hide-prevented',\n buildTriggerableEvent('hide-prevented', {trigger, signal: requestSignal})\n )\n if (!ownsPromise) return Promise.resolve('hide-prevented')\n // Settle and drop this hide's promise, so the next hide gets its own\n const promise = _Promise as Promise<string>\n _Resolve?.('hide-prevented')\n _Promise = undefined\n _Resolve = undefined\n return promise\n }\n const event = buildTriggerableEvent('hide', {cancelable: true, trigger, signal: requestSignal})\n const event2 = buildTriggerableEvent(trigger || 'ignore', {\n cancelable: true,\n trigger,\n signal: requestSignal,\n })\n if (\n (trigger === 'backdrop' && props.noCloseOnBackdrop) ||\n (trigger === 'esc' && props.noCloseOnEsc)\n ) {\n return prevented()\n }\n // A listener hid the component itself (for example `@ok=\"modal.hide()\"`). That hide is the one\n // that counts\n // Any newer committed transition wins, including a show started from a listener of that hide\n const hiddenByListener = () => transition !== transitionBefore\n if (trigger && !noTriggerEmit) {\n emit(trigger, event2)\n if (hiddenByListener()) return hidePromise\n }\n emit('hide', event)\n if (hiddenByListener()) return hidePromise\n\n if (event.defaultPrevented || event2.defaultPrevented) {\n if (!modelValue.value) {\n nextTick(() => {\n noAction = true\n modelValue.value = true\n })\n }\n return prevented()\n }\n // The show is still waiting for its frame or delay, so nothing was revealed\n const showWasPending = transition?.type === 'show' && !showRef.value\n // That show began while the previous hide's leave transition was still running\n const leaveIsRunning = showWasPending && isLeaving.value\n trapActive.value = false\n const signal = beginTransition('hide')\n if (showWasPending && modelValue.value) {\n noAction = true\n modelValue.value = isCountdown ? 0 : false\n }\n if (leaveIsRunning) {\n // The running leave finishes this hide too: it emits hidden and settles the promise\n leaveTrigger = trigger\n return hidePromise\n }\n if (showWasPending) {\n // No leave transition will run to finish this hide, so finish it here. Leaving isLeaving\n // false matters: with backdropFirst the backdrop stays visible while it is true\n if (!localTemporaryHide.value) renderRef.value = false\n renderBackdropRef.value = false\n // Settle before emitting: a hidden listener may call show(), which replaces _Promise\n const resolve = _Resolve\n _Promise = undefined\n _Resolve = undefined\n emit('hidden', buildTriggerableEvent('hidden', {trigger, cancelable: false}))\n resolve?.(trigger || '')\n return hidePromise\n }\n leaveTrigger = trigger\n hideTimeout = setTimeout(\n () => {\n if (!isMounted) return\n hideTimeout = undefined\n isLeaving.value = true\n showRef.value = false\n options.hideFn?.()\n if (modelValue.value) {\n noAction = true\n modelValue.value = isCountdown ? 0 : false\n }\n },\n localNoAnimation.value\n ? 0\n : typeof props.delay === 'number'\n ? props.delay\n : props.delay?.hide || 0\n )\n signal.addEventListener(\n 'abort',\n () => {\n clearTimeout(hideTimeout)\n hideTimeout = undefined\n },\n {once: true}\n )\n return _Promise as Promise<string>\n }\n const throttleHide = useThrottleFn((a) => hide(a), 500)\n const throttleShow = useThrottleFn(() => show(), 500)\n\n const toggle = (resolveOnHide: boolean = false): Promise<boolean | string> => {\n const e = buildTriggerableEvent('toggle', {cancelable: true})\n emit('toggle', e)\n if (e.defaultPrevented) {\n emit('toggle-prevented', buildTriggerableEvent('toggle-prevented'))\n return Promise.resolve('toggle-prevented')\n }\n if (showRef.value) {\n return hide('toggle-function', true)\n }\n return show(resolveOnHide)\n }\n const triggerToggle = () => {\n const e = buildTriggerableEvent('toggle', {cancelable: true})\n emit('toggle', e)\n if (e.defaultPrevented) {\n emit('toggle-prevented', buildTriggerableEvent('toggle-prevented'))\n return\n }\n if (showRef.value) {\n hide('toggle-trigger', true)\n } else {\n show()\n }\n }\n const triggerRegistry: {trigger: string; el: Element}[] = []\n const registerTrigger = (trigger: string, el: Element) => {\n triggerRegistry.push({trigger, el})\n el.addEventListener(trigger, triggerToggle)\n checkVisibility(el)\n }\n const unregisterTrigger = (trigger: string, el: Element, clean = true) => {\n const idx = triggerRegistry.findIndex((t) => t?.trigger === trigger && t.el === el)\n if (idx > -1) {\n triggerRegistry.splice(idx, 1)\n el.removeEventListener(trigger, triggerToggle)\n if (clean) {\n el.removeAttribute('aria-expanded')\n el.classList.remove('collapsed')\n el.classList.remove('not-collapsed')\n }\n }\n }\n\n const appRegistry = inject(showHideRegistryKey, null)?.register({\n id: id.value,\n toggle,\n show,\n hide,\n value: readonly(showRef),\n registerTrigger,\n unregisterTrigger,\n component: getCurrentInstance() as ComponentInternalInstance,\n })\n const checkVisibility = (el: Element) => {\n el.setAttribute('aria-expanded', modelValue.value ? 'true' : 'false')\n el.classList.toggle('collapsed', !modelValue.value)\n el.classList.toggle('not-collapsed', !!modelValue.value)\n }\n\n watch(modelValue, () => {\n triggerRegistry.forEach((t) => {\n checkVisibility(t.el)\n })\n })\n\n watch(id, (newId, oldId) => {\n appRegistry?.updateId(newId, oldId)\n })\n\n onBeforeUnmount(() => {\n appRegistry?.unregister()\n triggerRegistry.forEach((t) => {\n t.el.removeEventListener(t.trigger, triggerToggle)\n })\n })\n onUnmounted(() => {\n isMounted = false\n // Cancels whichever frame or timer the last show or hide still has pending\n transition?.controller.abort()\n endRequests()\n })\n\n const lazyLoadCompleted = ref(false)\n const markLazyLoadCompleted = () => {\n if (props.lazy === true) lazyLoadCompleted.value = true\n }\n\n const isLeaving = ref(false)\n const isActive = ref(initialShow)\n const isVisible = ref(initialShow)\n\n const onBeforeEnter: TransitionProps['onBeforeEnter'] = [\n ...[\n options.transitionProps?.onBeforeEnter ?? noop,\n props.transitionProps?.onBeforeEnter ?? noop,\n ].flat(),\n () => {\n isActive.value = true\n },\n ]\n\n const onEnter: TransitionProps['onEnter'] = [\n () => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n // sometimes one just isn't enough (offcanvas on the first load after refresh)\n isVisible.value = true\n })\n })\n },\n ...[options.transitionProps?.onEnter ?? noop, props.transitionProps?.onEnter ?? noop].flat(),\n ]\n const onAfterEnter: TransitionProps['onAfterEnter'] = [\n markLazyLoadCompleted,\n ...[\n options.transitionProps?.onAfterEnter ?? noop,\n props.transitionProps?.onAfterEnter ?? noop,\n ].flat(),\n () => {\n if (localNoAnimation.value) {\n requestAnimationFrame(() => {\n localNoAnimation.value = false\n })\n }\n if (localTemporaryHide.value) {\n localTemporaryHide.value = false\n }\n requestAnimationFrame(() => {\n trapActive.value = true\n nextTick(() => {\n emit('shown', buildTriggerableEvent('shown', {cancelable: false}))\n })\n })\n if (!_resolveOnHide) {\n _Resolve?.(true)\n _Promise = undefined\n _Resolve = undefined\n }\n },\n ]\n\n const onBeforeLeave: TransitionProps['onBeforeLeave'] = [\n () => {\n if (!isLeaving.value) isLeaving.value = true\n },\n ...[\n options.transitionProps?.onBeforeLeave ?? noop,\n props.transitionProps?.onBeforeLeave ?? noop,\n ].flat(),\n () => {\n trapActive.value = false\n },\n ]\n\n const onLeave: TransitionProps['onLeave'] = [\n () => {\n isVisible.value = false\n },\n ...[options.transitionProps?.onLeave ?? noop, props.transitionProps?.onLeave ?? noop].flat(),\n ]\n\n const onAfterLeave: TransitionProps['onAfterLeave'] = [\n () => {\n emit('hidden', buildTriggerableEvent('hidden', {trigger: leaveTrigger, cancelable: false}))\n },\n ...[\n options.transitionProps?.onAfterLeave ?? noop,\n props.transitionProps?.onAfterLeave ?? noop,\n ].flat(),\n () => {\n isLeaving.value = false\n isActive.value = false\n if (localNoAnimation.value) {\n requestAnimationFrame(() => {\n localNoAnimation.value = false\n })\n }\n requestAnimationFrame(() => {\n if (!localTemporaryHide.value) renderRef.value = false\n })\n _Resolve?.(leaveTrigger || '')\n _Promise = undefined\n _Resolve = undefined\n leaveTrigger = undefined\n },\n ]\n\n const contentShowing = computed(\n () =>\n localTemporaryHide.value === true ||\n isActive.value === true ||\n props.lazy === false ||\n (props.lazy === true && lazyLoadCompleted.value === true && props.unmountLazy === false)\n )\n const trapActive = ref(false)\n const backdropVisible = ref(false)\n const backdropReady = ref(false)\n\n const transitionFunctions = {\n ...options.transitionProps,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n } satisfies TransitionProps\n return {\n showRef: readonly(showRef),\n renderRef: readonly(renderRef),\n renderBackdropRef: readonly(renderBackdropRef),\n isVisible: readonly(isVisible),\n isActive: readonly(isActive),\n trapActive: readonly(trapActive),\n show,\n hide,\n toggle,\n throttleHide,\n throttleShow,\n buildTriggerableEvent,\n computedNoAnimation,\n localNoAnimation: readonly(localNoAnimation),\n setLocalNoAnimation: (value: boolean) => {\n localNoAnimation.value = value\n },\n localTemporaryHide: readonly(localTemporaryHide),\n setLocalTemporaryHide: (value: boolean) => {\n localTemporaryHide.value = value\n },\n isLeaving: readonly(isLeaving),\n transitionProps: {\n ...fadeBaseTransitionProps,\n ...props.transitionProps,\n ...transitionFunctions,\n } satisfies TransitionProps,\n\n lazyLoadCompleted: readonly(lazyLoadCompleted),\n markLazyLoadCompleted,\n contentShowing,\n backdropReady: readonly(backdropReady),\n backdropVisible: readonly(backdropVisible),\n backdropTransitionProps: {\n ...fadeBaseTransitionProps,\n onBeforeEnter: () => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n backdropVisible.value = true\n })\n })\n backdropReady.value = false\n },\n onAfterEnter: () => {\n backdropReady.value = true\n },\n onBeforeLeave: () => {\n backdropVisible.value = false\n },\n onAfterLeave: () => {\n backdropReady.value = false\n requestAnimationFrame(() => {\n renderBackdropRef.value = false\n })\n },\n } satisfies TransitionProps,\n }\n}\n"],"mappings":";;;;;;;AAqBA,IAAa,0BAA0B;CACrC,MAAM;CACN,kBAAkB;CAClB,gBAAgB;CAChB,cAAc;CACd,kBAAkB;CAClB,gBAAgB;CAChB,cAAc;CACd,KAAK;AACP;AAEA,IAAa,eACX,EACE,YACA,SACA,OACA,MACA,MAwBF,UAII;CACF,iBAAiB,CAAC;CAClB,cAAc,CAAC;CACf,cAAc,CAAC;AACjB,MACG;CACH,IAAI,WAAW;CACf,MAAM,cAAe,CAAC,CAAC,WA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SAAS;EAC7B,iBAAiB;GACf,GAAG;GACH,GAAG,MAAM;GACT,GAAG;EACL;EAEA,mBAAmB,SAAS,iBAAiB;EAC7C;EACA;EACA,eAAe,SAAS,aAAa;EACrC,iBAAiB,SAAS,eAAe;EACzC,yBAAyB;GACvB,GAAG;GACH,qBAAqB;IACnB,4BAA4B;KAC1B,4BAA4B;MAC1B,gBAAgB,QAAQ;KAC1B,CAAC;IACH,CAAC;IACD,cAAc,QAAQ;GACxB;GACA,oBAAoB;IAClB,cAAc,QAAQ;GACxB;GACA,qBAAqB;IACnB,gBAAgB,QAAQ;GAC1B;GACA,oBAAoB;IAClB,cAAc,QAAQ;IACtB,4BAA4B;KAC1B,kBAAkB,QAAQ;IAC5B,CAAC;GACH;EACF;CACF;AACF"}
|
package/dist/utils/classes.d.mts
CHANGED
|
@@ -28,10 +28,20 @@ export declare class BvEvent {
|
|
|
28
28
|
export declare class BvTriggerableEvent extends BvEvent {
|
|
29
29
|
readonly trigger: string | null;
|
|
30
30
|
ok: boolean | null | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* On show and hide request events (`show`, `hide`, `ok`, `cancel`, `close`, and the `-prevented`
|
|
33
|
+
* events): aborted once the component commits to its next show or hide, or unmounts. Pass it to
|
|
34
|
+
* async work started from a listener that prevents the event (for example validating in `ok`), so
|
|
35
|
+
* that work stops if the component is closed or reopened another way in the meantime.
|
|
36
|
+
* If the listener does not prevent the event, the component commits right after it, and the signal
|
|
37
|
+
* is already aborted. `null` on other events
|
|
38
|
+
*/
|
|
39
|
+
readonly signal: AbortSignal | null;
|
|
31
40
|
constructor(eventType: string, eventInit?: Partial<Omit<BvTriggerableEvent, BvEventConstructorOmittables>>);
|
|
32
41
|
static get Defaults(): {
|
|
33
42
|
trigger: null;
|
|
34
43
|
ok: undefined;
|
|
44
|
+
signal: null;
|
|
35
45
|
cancelable: boolean;
|
|
36
46
|
componentId: null;
|
|
37
47
|
eventType: string;
|
package/dist/utils/classes.d.ts
CHANGED
|
@@ -28,10 +28,20 @@ export declare class BvEvent {
|
|
|
28
28
|
export declare class BvTriggerableEvent extends BvEvent {
|
|
29
29
|
readonly trigger: string | null;
|
|
30
30
|
ok: boolean | null | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* On show and hide request events (`show`, `hide`, `ok`, `cancel`, `close`, and the `-prevented`
|
|
33
|
+
* events): aborted once the component commits to its next show or hide, or unmounts. Pass it to
|
|
34
|
+
* async work started from a listener that prevents the event (for example validating in `ok`), so
|
|
35
|
+
* that work stops if the component is closed or reopened another way in the meantime.
|
|
36
|
+
* If the listener does not prevent the event, the component commits right after it, and the signal
|
|
37
|
+
* is already aborted. `null` on other events
|
|
38
|
+
*/
|
|
39
|
+
readonly signal: AbortSignal | null;
|
|
31
40
|
constructor(eventType: string, eventInit?: Partial<Omit<BvTriggerableEvent, BvEventConstructorOmittables>>);
|
|
32
41
|
static get Defaults(): {
|
|
33
42
|
trigger: null;
|
|
34
43
|
ok: undefined;
|
|
44
|
+
signal: null;
|
|
35
45
|
cancelable: boolean;
|
|
36
46
|
componentId: null;
|
|
37
47
|
eventType: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as defaultsKey } from "./keys-BgLwJbLV.js";
|
|
2
2
|
import { t as error } from "./console-DaUCJgpk.js";
|
|
3
|
-
import { c as unbind, i as resolveActiveStatus, l as updateBind, o as resolveContent, s as resolveDirectiveProps, t as bind } from "./floatingUi-
|
|
3
|
+
import { c as unbind, i as resolveActiveStatus, l as updateBind, o as resolveContent, s as resolveDirectiveProps, t as bind } from "./floatingUi-CSJCHfOw.js";
|
|
4
4
|
//#region src/directives/utils.ts
|
|
5
5
|
/**
|
|
6
6
|
* Gets the component instance UID from a directive binding
|
|
@@ -170,4 +170,4 @@ function createFloatingDirective(propertyName, componentDefaultsKey, buildProps)
|
|
|
170
170
|
//#endregion
|
|
171
171
|
export { findProvides as n, getDirectiveUid as r, createFloatingDirective as t };
|
|
172
172
|
|
|
173
|
-
//# sourceMappingURL=utils-
|
|
173
|
+
//# sourceMappingURL=utils-DYdkCKBf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-nRGGHA_i.js","names":[],"sources":["../src/directives/utils.ts"],"sourcesContent":["import type {ComponentInternalInstance, Directive, DirectiveBinding, Ref, VNode} from 'vue'\nimport type {BPopoverProps} from '../types/ComponentProps'\nimport {error} from '../utils/console'\nimport {\n bind,\n type ElementWithPopper,\n resolveActiveStatus,\n resolveContent,\n resolveDirectiveProps,\n unbind,\n updateBind,\n} from '../utils/floatingUi'\nimport {defaultsKey} from '../utils/keys'\n\ninterface _ComponentInternalInstance extends ComponentInternalInstance {\n provides?: Record<string, unknown>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setupState?: any\n}\n\ninterface _VNode extends VNode {\n ctx?: _ComponentInternalInstance | null\n ssContent?: VNode | null\n}\n\n/**\n * Represents per-instance state for directives using UID namespacing\n */\nexport interface DirectiveInstanceState {\n binding: string // JSON.stringify cache for change detection\n destroying: boolean // Flag to prevent race conditions during cleanup\n}\n\n/**\n * Gets the component instance UID from a directive binding\n * @throws Error if binding.instance is not available\n */\nexport function getDirectiveUid(binding: DirectiveBinding): number {\n if (!binding.instance) {\n throw new Error('[Bootstrap-Vue-Next] Directive binding.instance is not available')\n }\n return binding.instance.$.uid\n}\n\n/**\n * Initializes UID-namespaced storage on an element for a directive\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @param binding - The directive binding value to cache\n * @returns The initialized instance state\n */\nexport function initDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number,\n binding: DirectiveBinding\n): DirectiveInstanceState {\n // Initialize UID namespace for this directive\n const elWithProps = el as Record<string, unknown>\n elWithProps[propertyName] = elWithProps[propertyName] ?? Object.create(null)\n\n // Store per-instance state with JSON cache for change detection\n const state: DirectiveInstanceState = {\n binding: JSON.stringify([binding.modifiers, binding.value]),\n destroying: false,\n }\n\n ;(elWithProps[propertyName] as Record<string, unknown>)[uid] = state\n return state\n}\n\n/**\n * Gets the instance state for a directive, if it exists\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @returns The instance state or undefined if not found\n */\nexport function getDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): DirectiveInstanceState | undefined {\n const elWithProps = el as Record<string, unknown>\n return (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n}\n\n/**\n * Checks if the directive binding has changed for this instance\n * @param instance - The directive instance state\n * @param binding - The current directive binding\n * @returns true if the binding has changed, false otherwise\n */\nexport function hasBindingChanged(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): boolean {\n const newBinding = JSON.stringify([binding.modifiers, binding.value])\n return instance.binding !== newBinding\n}\n\n/**\n * Updates the cached binding value for a directive instance\n * @param instance - The directive instance state\n * @param binding - The new directive binding\n */\nexport function updateBindingCache(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): void {\n instance.binding = JSON.stringify([binding.modifiers, binding.value])\n}\n\n/**\n * Cleans up a directive instance\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n */\nexport function cleanupDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): void {\n const elWithProps = el as Record<string, unknown>\n const instance = (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n if (instance) {\n instance.destroying = true\n delete (elWithProps[propertyName] as Record<string, unknown>)[uid]\n }\n}\n\n// taken from vuetify https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/directiveComponent.ts\n\nexport function findProvides(\n binding: DirectiveBinding,\n vnode: _VNode,\n suppressParentNotFoundError = false\n): Record<string, unknown> {\n const provides =\n (vnode.ctx === binding.instance!.$\n ? findComponentParent(vnode, binding.instance!.$, suppressParentNotFoundError)?.provides\n : vnode.ctx?.provides) ?? binding.instance!.$.provides\n\n return provides\n}\n\nexport function findComponentParent(\n vnode: VNode,\n root: ComponentInternalInstance,\n suppressNotFoundError = false\n): _ComponentInternalInstance | null {\n // Walk the tree from root until we find the child vnode\n const stack = new Set<VNode>()\n const walk = (children: _VNode[]): boolean => {\n for (const child of children) {\n if (!child) continue\n\n if (child === vnode || (child.el && vnode.el && child.el === vnode.el)) {\n return true\n }\n\n stack.add(child)\n let result\n if (child.suspense) {\n result = walk([child.ssContent!])\n } else if (Array.isArray(child.children)) {\n result = walk(child.children as VNode[])\n } else if (child.component?.vnode) {\n result = walk([child.component?.subTree])\n }\n if (result) {\n return result\n }\n stack.delete(child)\n }\n\n return false\n }\n if (!walk([root.subTree])) {\n if (!suppressNotFoundError) {\n error('directive-utils', 'Could not find original vnode, will not inherit provides')\n }\n return root\n }\n\n // Return the first component parent\n const result = Array.from(stack).reverse()\n for (const child of result) {\n if (child.component) {\n return child.component\n }\n }\n return root\n}\n\n/**\n * Creates a floating UI directive (tooltip or popover) with UID-namespaced state management\n * @param propertyName - The property name for storing state (e.g., '$__tooltip', '$__popover')\n * @param componentDefaultsKey - The key for accessing component defaults (e.g., 'BTooltip', 'BPopover')\n * @param buildProps - Optional function to customize the props passed to bind()\n * @returns A Vue directive object\n */\nexport function createFloatingDirective(\n propertyName: string,\n componentDefaultsKey: string,\n buildProps?: (\n text: {title?: string; body?: string},\n defaults: unknown,\n binding: Readonly<DirectiveBinding>,\n el: Readonly<HTMLElement>\n ) => BPopoverProps\n): Directive<ElementWithPopper> {\n return {\n mounted(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n const isActive = resolveActiveStatus(binding.value)\n if (!isActive) return\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) return\n\n // Initialize per-instance state with UID namespacing\n initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n },\n\n updated(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n let instance = getDirectiveInstance(el, propertyName, uid)\n\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n\n const isActive = resolveActiveStatus(binding.value)\n\n // If inactive, clean up existing instance if present\n if (!isActive) {\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) {\n // Clean up if no content\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n // If instance doesn't exist, this is a transition from inactive/no-content to active\n // Initialize the instance now (similar to mounted)\n if (!instance) {\n instance = initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n return\n }\n\n // Check if binding changed for THIS instance\n if (!hasBindingChanged(instance, binding)) return\n\n // Prevent race conditions during update\n if (instance.destroying) return\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n // Update props in-place so the tooltip stays visible if it was open\n updateBind(el, binding, props)\n\n // Update THIS instance's cache\n updateBindingCache(instance, binding)\n },\n\n beforeUnmount(el, binding) {\n const uid = getDirectiveUid(binding)\n const instance = getDirectiveInstance(el, property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GAEf,OAAO,EAAE;GACT,yBAAyB,IAAI,cAAc,GAAG;EAChD;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"utils-DYdkCKBf.js","names":[],"sources":["../src/directives/utils.ts"],"sourcesContent":["import type {ComponentInternalInstance, Directive, DirectiveBinding, Ref, VNode} from 'vue'\nimport type {BPopoverProps} from '../types/ComponentProps'\nimport {error} from '../utils/console'\nimport {\n bind,\n type ElementWithPopper,\n resolveActiveStatus,\n resolveContent,\n resolveDirectiveProps,\n unbind,\n updateBind,\n} from '../utils/floatingUi'\nimport {defaultsKey} from '../utils/keys'\n\ninterface _ComponentInternalInstance extends ComponentInternalInstance {\n provides?: Record<string, unknown>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setupState?: any\n}\n\ninterface _VNode extends VNode {\n ctx?: _ComponentInternalInstance | null\n ssContent?: VNode | null\n}\n\n/**\n * Represents per-instance state for directives using UID namespacing\n */\nexport interface DirectiveInstanceState {\n binding: string // JSON.stringify cache for change detection\n destroying: boolean // Flag to prevent race conditions during cleanup\n}\n\n/**\n * Gets the component instance UID from a directive binding\n * @throws Error if binding.instance is not available\n */\nexport function getDirectiveUid(binding: DirectiveBinding): number {\n if (!binding.instance) {\n throw new Error('[Bootstrap-Vue-Next] Directive binding.instance is not available')\n }\n return binding.instance.$.uid\n}\n\n/**\n * Initializes UID-namespaced storage on an element for a directive\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @param binding - The directive binding value to cache\n * @returns The initialized instance state\n */\nexport function initDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number,\n binding: DirectiveBinding\n): DirectiveInstanceState {\n // Initialize UID namespace for this directive\n const elWithProps = el as Record<string, unknown>\n elWithProps[propertyName] = elWithProps[propertyName] ?? Object.create(null)\n\n // Store per-instance state with JSON cache for change detection\n const state: DirectiveInstanceState = {\n binding: JSON.stringify([binding.modifiers, binding.value]),\n destroying: false,\n }\n\n ;(elWithProps[propertyName] as Record<string, unknown>)[uid] = state\n return state\n}\n\n/**\n * Gets the instance state for a directive, if it exists\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @returns The instance state or undefined if not found\n */\nexport function getDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): DirectiveInstanceState | undefined {\n const elWithProps = el as Record<string, unknown>\n return (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n}\n\n/**\n * Checks if the directive binding has changed for this instance\n * @param instance - The directive instance state\n * @param binding - The current directive binding\n * @returns true if the binding has changed, false otherwise\n */\nexport function hasBindingChanged(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): boolean {\n const newBinding = JSON.stringify([binding.modifiers, binding.value])\n return instance.binding !== newBinding\n}\n\n/**\n * Updates the cached binding value for a directive instance\n * @param instance - The directive instance state\n * @param binding - The new directive binding\n */\nexport function updateBindingCache(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): void {\n instance.binding = JSON.stringify([binding.modifiers, binding.value])\n}\n\n/**\n * Cleans up a directive instance\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n */\nexport function cleanupDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): void {\n const elWithProps = el as Record<string, unknown>\n const instance = (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n if (instance) {\n instance.destroying = true\n delete (elWithProps[propertyName] as Record<string, unknown>)[uid]\n }\n}\n\n// taken from vuetify https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/directiveComponent.ts\n\nexport function findProvides(\n binding: DirectiveBinding,\n vnode: _VNode,\n suppressParentNotFoundError = false\n): Record<string, unknown> {\n const provides =\n (vnode.ctx === binding.instance!.$\n ? findComponentParent(vnode, binding.instance!.$, suppressParentNotFoundError)?.provides\n : vnode.ctx?.provides) ?? binding.instance!.$.provides\n\n return provides\n}\n\nexport function findComponentParent(\n vnode: VNode,\n root: ComponentInternalInstance,\n suppressNotFoundError = false\n): _ComponentInternalInstance | null {\n // Walk the tree from root until we find the child vnode\n const stack = new Set<VNode>()\n const walk = (children: _VNode[]): boolean => {\n for (const child of children) {\n if (!child) continue\n\n if (child === vnode || (child.el && vnode.el && child.el === vnode.el)) {\n return true\n }\n\n stack.add(child)\n let result\n if (child.suspense) {\n result = walk([child.ssContent!])\n } else if (Array.isArray(child.children)) {\n result = walk(child.children as VNode[])\n } else if (child.component?.vnode) {\n result = walk([child.component?.subTree])\n }\n if (result) {\n return result\n }\n stack.delete(child)\n }\n\n return false\n }\n if (!walk([root.subTree])) {\n if (!suppressNotFoundError) {\n error('directive-utils', 'Could not find original vnode, will not inherit provides')\n }\n return root\n }\n\n // Return the first component parent\n const result = Array.from(stack).reverse()\n for (const child of result) {\n if (child.component) {\n return child.component\n }\n }\n return root\n}\n\n/**\n * Creates a floating UI directive (tooltip or popover) with UID-namespaced state management\n * @param propertyName - The property name for storing state (e.g., '$__tooltip', '$__popover')\n * @param componentDefaultsKey - The key for accessing component defaults (e.g., 'BTooltip', 'BPopover')\n * @param buildProps - Optional function to customize the props passed to bind()\n * @returns A Vue directive object\n */\nexport function createFloatingDirective(\n propertyName: string,\n componentDefaultsKey: string,\n buildProps?: (\n text: {title?: string; body?: string},\n defaults: unknown,\n binding: Readonly<DirectiveBinding>,\n el: Readonly<HTMLElement>\n ) => BPopoverProps\n): Directive<ElementWithPopper> {\n return {\n mounted(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n const isActive = resolveActiveStatus(binding.value)\n if (!isActive) return\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) return\n\n // Initialize per-instance state with UID namespacing\n initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n },\n\n updated(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n let instance = getDirectiveInstance(el, propertyName, uid)\n\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n\n const isActive = resolveActiveStatus(binding.value)\n\n // If inactive, clean up existing instance if present\n if (!isActive) {\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) {\n // Clean up if no content\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n // If instance doesn't exist, this is a transition from inactive/no-content to active\n // Initialize the instance now (similar to mounted)\n if (!instance) {\n instance = initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n return\n }\n\n // Check if binding changed for THIS instance\n if (!hasBindingChanged(instance, binding)) return\n\n // Prevent race conditions during update\n if (instance.destroying) return\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n // Update props in-place so the tooltip stays visible if it was open\n updateBind(el, binding, props)\n\n // Update THIS instance's cache\n updateBindingCache(instance, binding)\n },\n\n beforeUnmount(el, binding) {\n const uid = getDirectiveUid(binding)\n const instance = getDirectiveInstance(el, propertyName, uid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,OAAO,EAAE;GACT,yBAAyB,IAAI,cAAc,GAAG;EAChD;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "bootstrap-vue-next",
|
|
3
3
|
"displayName": "BootstrapVueNext",
|
|
4
4
|
"description": "Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/bootstrap-vue-next.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BApp-Bg5xEz8H.js","names":["$attrs","$attrs"],"sources":["../src/utils/positionClasses.ts","../src/components/BApp/BOrchestrator.vue","../src/components/BApp/BOrchestrator.vue","../src/components/BApp/BApp.vue","../src/components/BApp/BApp.vue"],"sourcesContent":["import type {ContainerPosition} from '../types/Alignment'\n\nexport const positionClasses = {\n 'top-start': 'top-0 start-0',\n 'top-center': 'top-0 start-50 translate-middle-x',\n 'top-end': 'top-0 end-0',\n 'middle-start': 'top-50 start-0 translate-middle-y',\n 'middle-center': 'top-50 start-50 translate-middle',\n 'middle-end': 'top-50 end-0 translate-middle-y',\n 'bottom-start': 'bottom-0 start-0',\n 'bottom-center': 'bottom-0 start-50 translate-middle-x',\n 'bottom-end': 'bottom-0 end-0',\n} as const satisfies Record<ContainerPosition, string>\n","<template>\n <ConditionalTeleport :to=\"teleportTo\" :disabled=\"!teleportTo\">\n <div class=\"orchestrator-container\" v-bind=\"$attrs\">\n <div\n v-for=\"(value, key) in positionedItems\"\n :key=\"key\"\n :class=\"value.class\"\n :style=\"value.style\"\n >\n <TransitionGroup :name=\"value.transitionGroupName\">\n <span\n v-for=\"{\n component,\n fns: {setRef, resolve: resolvePromise},\n props: componentProps,\n id,\n slots,\n options,\n } in value.items\"\n :key=\"id\"\n >\n <component\n :is=\"component\"\n v-bind=\"componentProps\"\n :ref=\"setRef\"\n initial-animation\n :teleport-disabled=\"true\"\n @hide=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHide?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n @hidden=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHidden?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (!options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n >\n <template v-for=\"(comp, slot) in slots\" #[slot]=\"scope\" :key=\"slot\">\n <component :is=\"comp\" v-bind=\"scope\" />\n </template>\n </component>\n </span>\n </TransitionGroup>\n </div>\n </div>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, watch} from 'vue'\nimport {warn} from '../../utils/console'\nimport {orchestratorRegistryKey, type OrchestratorStoreObject} from '../../utils/keys'\nimport {positionClasses} from '../../utils/positionClasses'\nimport type {BvTriggerableEvent} from '../../utils'\nimport type {BOrchestratorProps, ContainerPosition} from '../../types'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport type {ValueInMapRecord} from '../../composables/orchestratorShared'\n\nconst setEventOk = (event: BvTriggerableEvent): void => {\n event.ok = event.trigger === 'ok' ? true : event.trigger === 'cancel' ? false : null\n}\n\nconst props = withDefaults(defineProps<BOrchestratorProps>(), {\n noPopovers: false,\n noToasts: false,\n noModals: false,\n appendToast: false,\n filter: undefined,\n})\n\nconst orchestratorRegistry = inject(orchestratorRegistryKey, null)\n\nif (orchestratorRegistry) {\n if (!orchestratorRegistry._isOrchestratorInstalled.value) {\n orchestratorRegistry._setOrchestratorInstalled(true)\n }\n} else {\n warn(\n 'BOrchestrator',\n 'The orchestrator registry not found. Please use BApp, useRegistry or provide the plugin.'\n )\n}\n\nwatch(\n () => props.appendToast,\n (value) => {\n orchestratorRegistry?._setToastAppend(value)\n },\n {immediate: true}\n)\n\nconst items = computed(() => {\n const store = orchestratorRegistry?.store.value\n let filteredStore = {\n tooltip:\n !props.noPopovers && store?.tooltip ? [...store.tooltip.values()].map((e) => e.value) : [],\n modal: !props.noModals && store?.modal ? [...store.modal.values()].map((e) => e.value) : [],\n popover:\n !props.noPopovers && store?.popover ? [...store.popover.values()].map((e) => e.value) : [],\n toast: !props.noToasts && store?.toast ? [...store.toast.values()].map((e) => e.value) : [],\n } satisfies Record<keyof OrchestratorStoreObject, unknown>\n\n if (props.filter) {\n filteredStore = {\n tooltip: filteredStore.tooltip.filter(props.filter),\n modal: filteredStore.modal.filter(props.filter),\n popover: filteredStore.popover.filter(props.filter),\n toast: filteredStore.toast.filter(props.filter),\n }\n }\n\n return filteredStore\n})\n\ntype ItemObject = {\n class?: string\n style?: string\n transitionGroupName?: string\n items: ValueInMapRecord<OrchestratorStoreObject[keyof OrchestratorStoreObject]>['value'][]\n}\nconst positionedItems = computed<\n Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n>(() => {\n const toastDefaultPosition: ContainerPosition = 'bottom-start'\n const toastDefaults = (cls: ContainerPosition) =>\n ({\n class: `${positionClasses[cls]} toast-container position-fixed p-3`,\n style: 'width: calc(var(--bs-toast-max-width, 350px) + var(--bs-toast-padding-x, 1rem) * 2)',\n transitionGroupName: 'b-list',\n }) satisfies Partial<ItemObject>\n const groupedToastItems = items.value.toast.reduce(\n (acc, item) => {\n const pos = item.props.position ?? toastDefaultPosition\n ;(acc[pos] ??= {\n ...toastDefaults(pos),\n items: [],\n }).items.push(item)\n\n return acc\n },\n {} as Record<ContainerPosition, ItemObject>\n )\n\n const allGroups = {\n ...groupedToastItems,\n modal: {items: items.value.modal},\n popover: {items: items.value.popover},\n tooltip: {items: items.value.tooltip},\n }\n\n // Skip rendering empty containers (e.g. popover/tooltip/modal groups with no active items)\n return Object.fromEntries(\n Object.entries(allGroups).filter(([, value]) => value.items.length > 0)\n ) as Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n})\n</script>\n","<template>\n <ConditionalTeleport :to=\"teleportTo\" :disabled=\"!teleportTo\">\n <div class=\"orchestrator-container\" v-bind=\"$attrs\">\n <div\n v-for=\"(value, key) in positionedItems\"\n :key=\"key\"\n :class=\"value.class\"\n :style=\"value.style\"\n >\n <TransitionGroup :name=\"value.transitionGroupName\">\n <span\n v-for=\"{\n component,\n fns: {setRef, resolve: resolvePromise},\n props: componentProps,\n id,\n slots,\n options,\n } in value.items\"\n :key=\"id\"\n >\n <component\n :is=\"component\"\n v-bind=\"componentProps\"\n :ref=\"setRef\"\n initial-animation\n :teleport-disabled=\"true\"\n @hide=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHide?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n @hidden=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHidden?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (!options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n >\n <template v-for=\"(comp, slot) in slots\" #[slot]=\"scope\" :key=\"slot\">\n <component :is=\"comp\" v-bind=\"scope\" />\n </template>\n </component>\n </span>\n </TransitionGroup>\n </div>\n </div>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, watch} from 'vue'\nimport {warn} from '../../utils/console'\nimport {orchestratorRegistryKey, type OrchestratorStoreObject} from '../../utils/keys'\nimport {positionClasses} from '../../utils/positionClasses'\nimport type {BvTriggerableEvent} from '../../utils'\nimport type {BOrchestratorProps, ContainerPosition} from '../../types'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport type {ValueInMapRecord} from '../../composables/orchestratorShared'\n\nconst setEventOk = (event: BvTriggerableEvent): void => {\n event.ok = event.trigger === 'ok' ? true : event.trigger === 'cancel' ? false : null\n}\n\nconst props = withDefaults(defineProps<BOrchestratorProps>(), {\n noPopovers: false,\n noToasts: false,\n noModals: false,\n appendToast: false,\n filter: undefined,\n})\n\nconst orchestratorRegistry = inject(orchestratorRegistryKey, null)\n\nif (orchestratorRegistry) {\n if (!orchestratorRegistry._isOrchestratorInstalled.value) {\n orchestratorRegistry._setOrchestratorInstalled(true)\n }\n} else {\n warn(\n 'BOrchestrator',\n 'The orchestrator registry not found. Please use BApp, useRegistry or provide the plugin.'\n )\n}\n\nwatch(\n () => props.appendToast,\n (value) => {\n orchestratorRegistry?._setToastAppend(value)\n },\n {immediate: true}\n)\n\nconst items = computed(() => {\n const store = orchestratorRegistry?.store.value\n let filteredStore = {\n tooltip:\n !props.noPopovers && store?.tooltip ? [...store.tooltip.values()].map((e) => e.value) : [],\n modal: !props.noModals && store?.modal ? [...store.modal.values()].map((e) => e.value) : [],\n popover:\n !props.noPopovers && store?.popover ? [...store.popover.values()].map((e) => e.value) : [],\n toast: !props.noToasts && store?.toast ? [...store.toast.values()].map((e) => e.value) : [],\n } satisfies Record<keyof OrchestratorStoreObject, unknown>\n\n if (props.filter) {\n filteredStore = {\n tooltip: filteredStore.tooltip.filter(props.filter),\n modal: filteredStore.modal.filter(props.filter),\n popover: filteredStore.popover.filter(props.filter),\n toast: filteredStore.toast.filter(props.filter),\n }\n }\n\n return filteredStore\n})\n\ntype ItemObject = {\n class?: string\n style?: string\n transitionGroupName?: string\n items: ValueInMapRecord<OrchestratorStoreObject[keyof OrchestratorStoreObject]>['value'][]\n}\nconst positionedItems = computed<\n Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n>(() => {\n const toastDefaultPosition: ContainerPosition = 'bottom-start'\n const toastDefaults = (cls: ContainerPosition) =>\n ({\n class: `${positionClasses[cls]} toast-container position-fixed p-3`,\n style: 'width: calc(var(--bs-toast-max-width, 350px) + var(--bs-toast-padding-x, 1rem) * 2)',\n transitionGroupName: 'b-list',\n }) satisfies Partial<ItemObject>\n const groupedToastItems = items.value.toast.reduce(\n (acc, item) => {\n const pos = item.props.position ?? toastDefaultPosition\n ;(acc[pos] ??= {\n ...toastDefaults(pos),\n items: [],\n }).items.push(item)\n\n return acc\n },\n {} as Record<ContainerPosition, ItemObject>\n )\n\n const allGroups = {\n ...groupedToastItems,\n modal: {items: items.value.modal},\n popover: {items: items.value.popover},\n tooltip: {items: items.value.tooltip},\n }\n\n // Skip rendering empty containers (e.g. popover/tooltip/modal groups with no active items)\n return Object.fromEntries(\n Object.entries(allGroups).filter(([, value]) => value.items.length > 0)\n ) as Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n})\n</script>\n","<template>\n <BOrchestrator v-if=\"!noOrchestrator\" :append-toast=\"appendToast\" :teleport-to=\"teleportTo\" />\n <slot v-bind=\"$attrs\" />\n</template>\n\n<script setup lang=\"ts\">\nimport type {BAppProps} from '../../types'\nimport BOrchestrator from './BOrchestrator.vue'\nimport {useProvideDefaults} from '../../composables/useProvideDefaults'\nimport {useRegistry} from '../../composables/useRegistry'\nimport {useOrchestratorRegistry} from '../../composables/orchestratorShared'\nimport {toRef} from 'vue'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<BAppProps>(), {\n appendToast: false,\n teleportTo: undefined,\n defaults: undefined,\n mergeDefaults: false,\n noOrchestrator: false,\n rtl: false,\n})\n\nuseProvideDefaults(\n toRef(() => props.defaults),\n props.mergeDefaults\n)\nuseRegistry(props.rtl)\nif (!props.noOrchestrator) {\n useOrchestratorRegistry()\n}\n</script>\n","<template>\n <BOrchestrator v-if=\"!noOrchestrator\" :append-toast=\"appendToast\" :teleport-to=\"teleportTo\" />\n <slot v-bind=\"$attrs\" />\n</template>\n\n<script setup lang=\"ts\">\nimport type {BAppProps} from '../../types'\nimport BOrchestrator from './BOrchestrator.vue'\nimport {useProvideDefaults} from '../../composables/useProvideDefaults'\nimport {useRegistry} from '../../composables/useRegistry'\nimport {useOrchestratorRegistry} from '../../composables/orchestratorShared'\nimport {toRef} from 'vue'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<BAppProps>(), {\n appendToast: false,\n teleportTo: undefined,\n defaults: undefined,\n mergeDefaults: false,\n noOrchestrator: false,\n rtl: false,\n})\n\nuseProvideDefaults(\n toRef(() => props.defaults),\n props.mergeDefaults\n)\nuseRegistry(props.rtl)\nif (!props.noOrchestrator) {\n useOrchestratorRegistry()\n}\n</script>\n"],"mappings":";;;;;;;;AAEA,IAAa,kBAAkB;CAC7B,aAAa;CACb,cAAc;CACd,WAAW;CACX,gBAAgB;CAChB,iBAAiB;CACjB,cAAc;CACd,gBAAgB;CAChB,iBAAiB;CACjB,cAAc;AAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EC6DA,MAAM,cAAc,UAAoC;GACtD,MAAM,KAAK,MAAM,YAAY,OAAO,OAAO,MAAM,YAAY,WAAW,QAAQ;EAClF;EAEA,MAAM,QAAQ;EAQd,MAAM,uBAAuB,OAAO,yBAAyB,IAAI;EAEjE,IAAI,sBACE;OAAA,CAAC,qBAAqB,yBAAyB,OACjD,qBAAqB,0BAA0B,IAAI;EAAA,OAGrD,KACE,iBACA,0FACF;EAGF,YACQ,MAAM,cACX,UAAU;GACT,sBAAsB,gBAAgB,KAAK;EAC7C,GACA,EAAC,WAAW,KAAI,CAClB;EAEA,MAAM,QAAQ,eAAe;GAC3B,MAAM,QAAQ,sBAAsB,MAAM;GAC1C,IAAI,gBAAgB;IAClB,SACE,CAAC,MAAM,cAAc,OAAO,UAAU,CAAC,GAAG,MAAM,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3F,OAAO,CAAC,MAAM,YAAY,OAAO,QAAQ,CAAC,GAAG,MAAM,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1F,SACE,CAAC,MAAM,cAAc,OAAO,UAAU,CAAC,GAAG,MAAM,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,KAAK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BF,OAAA,UAAA,GAAA,mBAAA,UAAA,MAAA,CAAA,CAAA,QAAA,kBAAtB,UAAA,GAAA,YAA8F,uBAAA;;IAAvD,gBAAc,QAAA;IAAc,eAAa,QAAA;GAChF,GAAA,MAAA,GAAA,CAAA,gBAAA,aAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAAA,WAAwB,KAAA,QAAA,WAAA,eAAA,mBAAVC,KAAAA,MAAM,CAAA,CAAA,CAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BTooltip-BxaUtV4m.js","names":[],"sources":["../src/components/BTooltip/BTooltip.vue","../src/components/BTooltip/BTooltip.vue"],"sourcesContent":["<template>\n <BPopover\n ref=\"_popover\"\n v-bind=\"computedProps\"\n v-model=\"modelValue\"\n tooltip\n @show=\"emit('show', $event)\"\n @shown=\"emit('shown', $event)\"\n @hide=\"emit('hide', $event)\"\n @hidden=\"emit('hidden', $event)\"\n @hide-prevented=\"emit('hide-prevented', $event)\"\n @show-prevented=\"emit('show-prevented', $event)\"\n @toggle-prevented=\"emit('toggle-prevented', $event)\"\n @toggle=\"emit('toggle', $event)\"\n @pointerleave=\"emit('pointerleave', $event)\"\n @blur=\"emit('blur', $event)\"\n @click-outside=\"emit('click-outside', $event)\"\n @close-on-hide=\"emit('close-on-hide', $event)\"\n >\n <template v-if=\"slots.default\" #default=\"scope\">\n <slot v-bind=\"scope\" />\n </template>\n <template v-if=\"slots.target\" #target=\"scope\">\n <slot name=\"target\" v-bind=\"scope\" />\n </template>\n <template v-if=\"slots.title\" #title=\"scope\">\n <slot name=\"title\" v-bind=\"scope\" />\n </template>\n </BPopover>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, useTemplateRef} from 'vue'\nimport BPopover from '../BPopover/BPopover.vue'\nimport type {BPopoverProps, BTooltipEmits, BTooltipProps, BTooltipSlots} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<Omit<BTooltipProps, 'modelValue'>>(), {\n click: undefined,\n focus: undefined,\n hover: undefined,\n teleportDisabled: undefined,\n teleportTo: undefined,\n bodyClass: undefined,\n delay: 0,\n floatingMiddleware: undefined,\n hideMargin: 0,\n id: undefined,\n initialAnimation: false,\n inline: undefined,\n interactive: undefined,\n lazy: undefined,\n manual: undefined,\n noAutoClose: undefined,\n noFade: undefined,\n noFlip: undefined,\n noHide: undefined,\n noShift: undefined,\n noninteractive: undefined,\n offset: undefined,\n placement: undefined,\n realtime: undefined,\n reference: undefined,\n show: undefined,\n strategy: undefined,\n target: undefined,\n unmountLazy: undefined,\n title: undefined,\n titleClass: undefined,\n variant: undefined,\n visible: undefined,\n})\nconst props = useDefaults(_props, 'BTooltip')\nconst emit = defineEmits<BTooltipEmits>()\nconst slots = defineSlots<BTooltipSlots>()\n\nconst modelValue = defineModel<Exclude<BTooltipProps['modelValue'], undefined>>({\n default: false,\n})\n\nconst computedProps = computed<BPopoverProps>(() => {\n const {interactive, noninteractive, ...rest} = props\n return {noninteractive: noninteractive !== undefined ? noninteractive : !interactive, ...rest}\n})\n\nconst popover = useTemplateRef('_popover')\n\ndefineExpose({\n hide: () => {\n popover.value?.hide()\n },\n show: () => {\n popover.value?.show()\n },\n toggle: () => {\n popover.value?.toggle()\n },\n})\n</script>\n","<template>\n <BPopover\n ref=\"_popover\"\n v-bind=\"computedProps\"\n v-model=\"modelValue\"\n tooltip\n @show=\"emit('show', $event)\"\n @shown=\"emit('shown', $event)\"\n @hide=\"emit('hide', $event)\"\n @hidden=\"emit('hidden', $event)\"\n @hide-prevented=\"emit('hide-prevented', $event)\"\n @show-prevented=\"emit('show-prevented', $event)\"\n @toggle-prevented=\"emit('toggle-prevented', $event)\"\n @toggle=\"emit('toggle', $event)\"\n @pointerleave=\"emit('pointerleave', $event)\"\n @blur=\"emit('blur', $event)\"\n @click-outside=\"emit('click-outside', $event)\"\n @close-on-hide=\"emit('close-on-hide', $event)\"\n >\n <template v-if=\"slots.default\" #default=\"scope\">\n <slot v-bind=\"scope\" />\n </template>\n <template v-if=\"slots.target\" #target=\"scope\">\n <slot name=\"target\" v-bind=\"scope\" />\n </template>\n <template v-if=\"slots.title\" #title=\"scope\">\n <slot name=\"title\" v-bind=\"scope\" />\n </template>\n </BPopover>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, useTemplateRef} from 'vue'\nimport BPopover from '../BPopover/BPopover.vue'\nimport type {BPopoverProps, BTooltipEmits, BTooltipProps, BTooltipSlots} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<Omit<BTooltipProps, 'modelValue'>>(), {\n click: undefined,\n focus: undefined,\n hover: undefined,\n teleportDisabled: undefined,\n teleportTo: undefined,\n bodyClass: undefined,\n delay: 0,\n floatingMiddleware: undefined,\n hideMargin: 0,\n id: undefined,\n initialAnimation: false,\n inline: undefined,\n interactive: undefined,\n lazy: undefined,\n manual: undefined,\n noAutoClose: undefined,\n noFade: undefined,\n noFlip: undefined,\n noHide: undefined,\n noShift: undefined,\n noninteractive: undefined,\n offset: undefined,\n placement: undefined,\n realtime: undefined,\n reference: undefined,\n show: undefined,\n strategy: undefined,\n target: undefined,\n unmountLazy: undefined,\n title: undefined,\n titleClass: undefined,\n variant: undefined,\n visible: undefined,\n})\nconst props = useDefaults(_props, 'BTooltip')\nconst emit = defineEmits<BTooltipEmits>()\nconst slots = defineSlots<BTooltipSlots>()\n\nconst modelValue = defineModel<Exclude<BTooltipProps['modelValue'], undefined>>({\n default: false,\n})\n\nconst computedProps = computed<BPopoverProps>(() => {\n const {interactive, noninteractive, ...rest} = props\n return {noninteractive: noninteractive !== undefined ? noninteractive : !interactive, ...rest}\n})\n\nconst popover = useTemplateRef('_popover')\n\ndefineExpose({\n hide: () => {\n popover.value?.hide()\n },\n show: () => {\n popover.value?.show()\n },\n toggle: () => {\n popover.value?.toggle()\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,KAAI,UAAW,MAAM;IAC7B,gBAAY,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,gBAAiB,MAAM;IACzC,QAAI,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,QAAS,MAAM;IACzB,gBAAa,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,iBAAkB,MAAM;IAC3C,eAAa,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,iBAAkB,MAAM;;IAE5B,MAAM,UAAA;KAAU,MAAA;KAC9B,IAAA,SADuC,UAAK,CAC5C,WAAuB,KAAA,QAAA,WAAA,eAAA,mBAAT,KAAK,CAAA,CAAA,CAAA,CAAA;;;IAEL,MAAM,SAAA;KAAS,MAAA;KAC7B,IAAA,SADqC,UAAK,CAC1C,WAAqC,KAAA,QAAA,UAAA,eAAA,mBAAT,KAAK,CAAA,CAAA,CAAA,CAAA;;;IAEnB,MAAM,QAAA;KAAQ,MAAA;KAC5B,IAAA,SADmC,UAAK,CACxC,WAAoC,KAAA,QAAA,SAAA,eAAA,mBAAT,KAAK,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classes-BEWWGbj5.js","names":[],"sources":["../src/utils/classes.ts"],"sourcesContent":["/**\n * Items that are omitted from the BvEventInit constructor arg\n */\nexport type BvEventConstructorOmittables = 'eventType' | 'defaultPrevented'\n\nexport class BvEvent {\n readonly cancelable: boolean = true\n readonly componentId: string | null = null\n private _defaultPrevented = false\n readonly eventType: string = ''\n readonly nativeEvent: string | null = null\n private _preventDefault: () => void\n readonly relatedTarget: EventTarget | null = null\n readonly target: EventTarget | null = null\n // Readable by everyone,\n // But only overwritten by inherrited constructors\n public get defaultPrevented() {\n return this._defaultPrevented\n }\n protected set defaultPrevented(prop) {\n this._defaultPrevented = prop\n }\n // I think this is right\n // We want to be able to have it callable to everyone,\n // But only overwritten by inherrited constructors\n public get preventDefault() {\n return this._preventDefault\n }\n // This may not be correct, because it doesn't get correct type inferences in children\n // Ex overwrite this.preventDefault = () => true is valid. Could be a TS issue\n protected set preventDefault(setter: () => void) {\n this._preventDefault = setter\n }\n\n constructor(\n eventType: string,\n eventInit: Partial<Omit<BvEvent, BvEventConstructorOmittables>> = {}\n ) {\n if (!eventType) {\n throw new TypeError(\n `Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`\n )\n }\n\n // Merge defaults first, the eventInit, and the type last\n // so, it can't be overwritten\n Object.assign(this, BvEvent.Defaults, eventInit, {eventType})\n\n this._preventDefault = function _preventDefault() {\n if (this.cancelable) {\n this.defaultPrevented = true\n }\n }\n }\n\n static get Defaults() {\n return {\n cancelable: true,\n componentId: null,\n eventType: '',\n nativeEvent: null,\n relatedTarget: null,\n target: null,\n }\n }\n}\n\nexport class BvTriggerableEvent extends BvEvent {\n readonly trigger: string | null = null\n ok: boolean | null | undefined = undefined\n\n constructor(\n eventType: string,\n eventInit: Partial<Omit<BvTriggerableEvent, BvEventConstructorOmittables>> = {}\n ) {\n super(eventType, eventInit)\n\n // Merge defaults first, the eventInit, and the type last\n // so, it can't be overwritten\n Object.assign(this, BvEvent.Defaults, eventInit, {eventType})\n }\n\n static get Defaults() {\n return {\n ...super.Defaults,\n trigger: null,\n ok: undefined,\n }\n }\n}\n\nexport class BvCarouselEvent extends BvEvent {\n readonly from: number\n readonly to: number\n readonly direction: 'left' | 'right'\n\n constructor(\n eventType: string,\n eventInit: Partial<Omit<BvEvent, BvEventConstructorOmittables>> & {\n from: number\n to: number\n direction: 'left' | 'right'\n }\n ) {\n super(eventType, eventInit)\n Object.assign(this, BvEvent.Defaults, eventInit, {eventType})\n const {from, direction, to} = eventInit\n this.from = from\n this.to = to\n this.direction = direction\n }\n\n static get Defaults() {\n return {\n ...super.Defaults,\n }\n }\n}\n"],"mappings":";AAKA,IAAa,UAAb,MAAa,QAAQ;CACnB,aAA+B;CAC/B,cAAsC;CACtC,oBAA4B;CAC5B,YAA6B;CAC7B,cAAsC;CACtC;CACA,gB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|
|
1
|
-
{"version":3,"file":"useShowHide-C95Y9EKL.js","names":[],"sources":["../src/composables/useShowHide.ts"],"sourcesContent":["import {\n type ComponentInternalInstance,\n computed,\n type EmitFn,\n getCurrentInstance,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n readonly,\n ref,\n type Ref,\n type TransitionProps,\n watch,\n} from 'vue'\nimport {showHideRegistryKey} from '../utils/keys'\nimport {BvTriggerableEvent} from '../utils'\nimport {useEventListener, useThrottleFn} from '@vueuse/core'\nimport {noop} from '../utils/functions'\n\nexport const fadeBaseTransitionProps = {\n name: 'fade',\n enterActiveClass: '',\n enterFromClass: 'showing',\n enterToClass: '',\n leaveActiveClass: '',\n leaveFromClass: '',\n leaveToClass: 'showing',\n css: true,\n} as const satisfies TransitionProps\n\nexport const useShowHide = (\n {\n modelValue,\n element,\n props,\n emit,\n id,\n }: {\n modelValue: Ref<boolean | number>\n props: {\n visible?: boolean\n show?: boolean\n noAnimation?: boolean\n noFade?: boolean\n noCloseOnBackdrop?: boolean\n noCloseOnEsc?: boolean\n transitionProps?: TransitionProps\n lazy?: boolean\n initialAnimation?: boolean\n delay?:\n | number\n | {\n show: number\n hide: number\n }\n } & Record<string, unknown>\n emit: EmitFn\n element: Ref<HTMLElement | null>\n id: Ref<string>\n },\n options: {\n transitionProps?: TransitionProps\n showFn?: () => void\n hideFn?: () => void\n } = {\n transitionProps: {},\n showFn: () => {},\n hideFn: () => {},\n }\n) => {\n let noAction = false\n const initialShow = (!!modelValue.value && !props.initialAnimation) || props.visible || false\n const showRef = ref<boolean>(initialShow)\n const renderRef = ref<boolean>(initialShow)\n const renderBackdropRef = ref<boolean>(initialShow)\n\n let isCountdown = typeof modelValue.value !== 'boolean'\n\n watch(modelValue, () => {\n isCountdown = typeof modelValue.value !== 'boolean'\n if (noAction) {\n noAction = false\n return\n }\n if (modelValue.value) {\n show()\n } else {\n hide('modelValue', true)\n }\n })\n\n const localNoAnimation = ref(initialShow)\n const localTemporaryHide = ref(false)\n const computedNoAnimation = computed(\n () => props.noAnimation || props.noFade || localNoAnimation.value || false\n )\n let isMounted = false\n onMounted(() => {\n isMounted = true\n if (!props.show && initialShow) {\n // show without delay or animation\n const event = buildTriggerableEvent('show', {cancelable: true})\n emit('show', event)\n\n if (event.defaultPrevented) {\n emit('show-prevented', buildTriggerableEvent('show-prevented'))\n return\n }\n localNoAnimation.value = true\n if (!modelValue.value) {\n noAction = true\n modelValue.value = true\n }\n renderRef.value = true\n renderBackdropRef.value = true\n isVisible.value = true\n backdropVisible.value = true\n backdropReady.value = true\n showRef.value = true\n options.showFn?.()\n } else if (props.show || (!!modelValue.value && props.initialAnimation)) {\n show()\n }\n })\n\n watch(\n () => props.visible,\n (newVal) => {\n localNoAnimation.value = true\n\n nextTick(() => {\n if (newVal) isVisible.value = true\n if (newVal) {\n show()\n } else {\n hide('visible-prop', true)\n }\n })\n }\n )\n watch(\n () => props.show,\n (newVal) => {\n if (newVal) {\n show()\n } else {\n hide('show-prop', true)\n }\n }\n )\n // todo: remove\n useEventListener(\n element,\n 'bv-toggle',\n () => {\n modelValue.value = !modelValue.value\n },\n {passive: true}\n )\n\n const buildTriggerableEvent = (\n type: string,\n opts: Readonly<Partial<BvTriggerableEvent>> = {}\n ): BvTriggerableEvent =>\n new BvTriggerableEvent(type, {\n cancelable: false,\n target: element?.value || null,\n relatedTarget: null,\n trigger: null,\n ...opts,\n componentId: id?.value,\n })\n\n let showTimeout: ReturnType<typeof setTimeout> | undefined\n let hideTimeout: ReturnType<typeof setTimeout> | undefined\n let _Resolve: ((value: boolean | string) => void) | undefined\n let _Promise: Promise<boolean | string> | undefined\n let _resolveOnHide: boolean | undefined\n const show = (resolveOnHide: boolean = false): Promise<boolean | string> => {\n if (showRef.value && !hideTimeout && !_Promise) return Promise.resolve(true)\n _resolveOnHide = resolveOnHide\n if (showRef.value && !hideTimeout && _Promise) return _Promise\n\n _Promise = new Promise<boolean | string>((resolve) => {\n _Resolve = resolve\n })\n\n const event = buildTriggerableEvent('show', {cancelable: true})\n emit('show', event)\n\n if (event.defaultPrevented) {\n emit('show-prevented', buildTriggerableEvent('show-prevented'))\n if (isVisible.value) {\n isVisible.value = false\n }\n if (modelValue.value && !isCountdown) {\n noAction = true\n nextTick(() => {\n modelValue.value = false\n })\n }\n _Resolve?.('show-prevented')\n return _Promise\n }\n if (hideTimeout) {\n clearTimeout(hideTimeout)\n hideTimeout = undefined\n }\n renderRef.value = true\n renderBackdropRef.value = true\n requestAnimationFrame(() => {\n if (localNoAnimation.value || props.delay === undefined) {\n if (!isMounted) return\n showTimeout = undefined\n showRef.value = true\n options.showFn?.()\n if (!modelValue.value) {\n noAction = true\n nextTick(() => {\n modelValue.value = true\n })\n }\n return\n }\n showTimeout = setTimeout(\n () => {\n if (!isMounted) return\n showTimeout = undefined\n showRef.value = true\n options.showFn?.()\n if (!modelValue.value) {\n noAction = true\n nextTick(() => {\n modelValue.value = true\n })\n }\n },\n typeof props.delay === 'number' ? props.delay : props.delay?.show || 0\n )\n })\n return _Promise\n }\n\n let leaveTrigger: string | undefined\n const hide = (trigger?: string, noTriggerEmit?: boolean): Promise<string> => {\n if (!showRef.value && !showTimeout && !renderRef.value) return Promise.resolve('')\n if (!_Promise)\n _Promise = new Promise<string>((resolve) => {\n ;(_Resolve as (value: string | PromiseLike<string>) => void) = resolve\n })\n if (typeof trigger !== 'string') trigger = undefined\n leaveTrigger = trigger\n const event = buildTriggerableEvent('hide', {cancelable: true, trigger})\n const event2 = buildTriggerableEvent(trigger || 'ignore', {cancelable: true, trigger})\n if (\n (trigger === 'backdrop' && props.noCloseOnBackdrop) ||\n (trigger === 'esc' && props.noCloseOnEsc)\n ) {\n emit('hide-prevented', buildTriggerableEvent('hide-prevented', {trigger}))\n _Resolve?.('hide-prevented')\n return _Promise as Promise<string>\n }\n if (showTimeout) {\n clearTimeout(showTimeout)\n showTimeout = undefined\n }\n if (trigger && !noTriggerEmit) {\n emit(trigger, event2)\n }\n emit('hide', event)\n\n if (event.defaultPrevented || event2.defaultPrevented) {\n emit('hide-prevented', buildTriggerableEvent('hide-prevented', {trigger}))\n if (!modelValue.value) {\n nextTick(() => {\n noAction = true\n modelValue.value = true\n })\n }\n _Resolve?.('hide-prevented')\n return _Promise as Promise<string>\n }\n trapActive.value = false\n if (showTimeout) {\n clearTimeout(showTimeout)\n showTimeout = undefined\n if (!localTemporaryHide.value) renderRef.value = false\n renderBackdropRef.value = false\n }\n hideTimeout = setTimeout(\n () => {\n if (!isMounted) return\n hideTimeout = undefined\n isLeaving.value = true\n showRef.value = false\n options.hideFn?.()\n if (modelValue.value) {\n noAction = true\n modelValue.value = isCountdown ? 0 : false\n }\n },\n localNoAnimation.value\n ? 0\n : typeof props.delay === 'number'\n ? props.delay\n : props.delay?.hide || 0\n )\n return _Promise as Promise<string>\n }\n const throttleHide = useThrottleFn((a) => hide(a), 500)\n const throttleShow = useThrottleFn(() => show(), 500)\n\n const toggle = (resolveOnHide: boolean = false): Promise<boolean | string> => {\n const e = buildTriggerableEvent('toggle', {cancelable: true})\n emit('toggle', e)\n if (e.defaultPrevented) {\n emit('toggle-prevented', buildTriggerableEvent('toggle-prevented'))\n return Promise.resolve('toggle-prevented')\n }\n if (showRef.value) {\n return hide('toggle-function', true)\n }\n return show(resolveOnHide)\n }\n const triggerToggle = () => {\n const e = buildTriggerableEvent('toggle', {cancelable: true})\n emit('toggle', e)\n if (e.defaultPrevented) {\n emit('toggle-prevented', buildTriggerableEvent('toggle-prevented'))\n return\n }\n if (showRef.value) {\n hide('toggle-trigger', true)\n } else {\n show()\n }\n }\n const triggerRegistry: {trigger: string; el: Element}[] = []\n const registerTrigger = (trigger: string, el: Element) => {\n triggerRegistry.push({trigger, el})\n el.addEventListener(trigger, triggerToggle)\n checkVisibility(el)\n }\n const unregisterTrigger = (trigger: string, el: Element, clean = true) => {\n const idx = triggerRegistry.findIndex((t) => t?.trigger === trigger && t.el === el)\n if (idx > -1) {\n triggerRegistry.splice(idx, 1)\n el.removeEventListener(trigger, triggerToggle)\n if (clean) {\n el.removeAttribute('aria-expanded')\n el.classList.remove('collapsed')\n el.classList.remove('not-collapsed')\n }\n }\n }\n\n const appRegistry = inject(showHideRegistryKey, null)?.register({\n id: id.value,\n toggle,\n show,\n hide,\n value: readonly(showRef),\n registerTrigger,\n unregisterTrigger,\n component: getCurrentInstance() as ComponentInternalInstance,\n })\n const checkVisibility = (el: Element) => {\n el.setAttribute('aria-expanded', modelValue.value ? 'true' : 'false')\n el.classList.toggle('collapsed', !modelValue.value)\n el.classList.toggle('not-collapsed', !!modelValue.value)\n }\n\n watch(modelValue, () => {\n triggerRegistry.forEach((t) => {\n checkVisibility(t.el)\n })\n })\n\n watch(id, (newId, oldId) => {\n appRegistry?.updateId(newId, oldId)\n })\n\n onBeforeUnmount(() => {\n appRegistry?.unregister()\n triggerRegistry.forEach((t) => {\n t.el.removeEventListener(t.trigger, triggerToggle)\n })\n })\n onUnmounted(() => {\n isMounted = false\n clearTimeout(showTimeout)\n clearTimeout(hideTimeout)\n showTimeout = undefined\n hideTimeout = undefined\n })\n\n const lazyLoadCompleted = ref(false)\n const markLazyLoadCompleted = () => {\n if (props.lazy === true) lazyLoadCompleted.value = true\n }\n\n const isLeaving = ref(false)\n const isActive = ref(initialShow)\n const isVisible = ref(initialShow)\n\n const onBeforeEnter: TransitionProps['onBeforeEnter'] = [\n ...[\n options.transitionProps?.onBeforeEnter ?? noop,\n props.transitionProps?.onBeforeEnter ?? noop,\n ].flat(),\n () => {\n isActive.value = true\n },\n ]\n\n const onEnter: TransitionProps['onEnter'] = [\n () => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n // sometimes one just isn't enough (offcanvas on the first load after refresh)\n isVisible.value = true\n })\n })\n },\n ...[options.transitionProps?.onEnter ?? noop, props.transitionProps?.onEnter ?? noop].flat(),\n ]\n const onAfterEnter: TransitionProps['onAfterEnter'] = [\n markLazyLoadCompleted,\n ...[\n options.transitionProps?.onAfterEnter ?? noop,\n props.transitionProps?.onAfterEnter ?? noop,\n ].flat(),\n () => {\n if (localNoAnimation.value) {\n requestAnimationFrame(() => {\n localNoAnimation.value = false\n })\n }\n if (localTemporaryHide.value) {\n localTemporaryHide.value = false\n }\n requestAnimationFrame(() => {\n trapActive.value = true\n nextTick(() => {\n emit('shown', buildTriggerableEvent('shown', {cancelable: false}))\n })\n })\n if (!_resolveOnHide) {\n _Resolve?.(true)\n _Promise = undefined\n _Resolve = undefined\n }\n },\n ]\n\n const onBeforeLeave: TransitionProps['onBeforeLeave'] = [\n () => {\n if (!isLeaving.value) isLeaving.value = true\n },\n ...[\n options.transitionProps?.onBeforeLeave ?? noop,\n props.transitionProps?.onBeforeLeave ?? noop,\n ].flat(),\n () => {\n trapActive.value = false\n },\n ]\n\n const onLeave: TransitionProps['onLeave'] = [\n () => {\n isVisible.value = false\n },\n ...[options.transitionProps?.onLeave ?? noop, props.transitionProps?.onLeave ?? noop].flat(),\n ]\n\n const onAfterLeave: TransitionProps['onAfterLeave'] = [\n () => {\n emit('hidden', buildTriggerableEvent('hidden', {trigger: leaveTrigger, cancelable: false}))\n },\n ...[\n options.transitionProps?.onAfterLeave ?? noop,\n props.transitionProps?.onAfterLeave ?? noop,\n ].flat(),\n () => {\n isLeaving.value = false\n isActive.value = false\n if (localNoAnimation.value) {\n requestAnimationFrame(() => {\n localNoAnimation.value = false\n })\n }\n requestAnimationFrame(() => {\n if (!localTemporaryHide.value) renderRef.value = false\n })\n _Resolve?.(leaveTrigger || '')\n _Promise = undefined\n _Resolve = undefined\n leaveTrigger = undefined\n },\n ]\n\n const contentShowing = computed(\n () =>\n localTemporaryHide.value === true ||\n isActive.value === true ||\n props.lazy === false ||\n (props.lazy === true && lazyLoadCompleted.value === true && props.unmountLazy === false)\n )\n const trapActive = ref(false)\n const backdropVisible = ref(false)\n const backdropReady = ref(false)\n\n const transitionFunctions = {\n ...options.transitionProps,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n } satisfies TransitionProps\n return {\n showRef: readonly(showRef),\n renderRef: readonly(renderRef),\n renderBackdropRef: readonly(renderBackdropRef),\n isVisible: readonly(isVisible),\n isActive: readonly(isActive),\n trapActive: readonly(trapActive),\n show,\n hide,\n toggle,\n throttleHide,\n throttleShow,\n buildTriggerableEvent,\n computedNoAnimation,\n localNoAnimation: readonly(localNoAnimation),\n setLocalNoAnimation: (value: boolean) => {\n localNoAnimation.value = value\n },\n localTemporaryHide: readonly(localTemporaryHide),\n setLocalTemporaryHide: (value: boolean) => {\n localTemporaryHide.value = value\n },\n isLeaving: readonly(isLeaving),\n transitionProps: {\n ...fadeBaseTransitionProps,\n ...props.transitionProps,\n ...transitionFunctions,\n } satisfies TransitionProps,\n\n lazyLoadCompleted: readonly(lazyLoadCompleted),\n markLazyLoadCompleted,\n contentShowing,\n backdropReady: readonly(backdropReady),\n backdropVisible: readonly(backdropVisible),\n backdropTransitionProps: {\n ...fadeBaseTransitionProps,\n onBeforeEnter: () => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n backdropVisible.value = true\n })\n })\n backdropReady.value = false\n },\n onAfterEnter: () => {\n backdropReady.value = true\n },\n onBeforeLeave: () => {\n backdropVisible.value = false\n },\n onAfterLeave: () => {\n backdropReady.value = false\n requestAnimationFrame(() => {\n renderBackdropRef.value = false\n })\n },\n } satisfies TransitionProps,\n }\n}\n"],"mappings":";;;;;;;AAqBA,IAAa,0BAA0B;CACrC,MAAM;CACN,kBAAkB;CAClB,gBAAgB;CAChB,cAAc;CACd,kBAAkB;CAClB,gBAAgB;CAChB,cAAc;CACd,KAAK;AACP;AAEA,IAAa,eACX,EACE,YACA,SACA,OACA,MACA,MAwBF,UAII;CACF,iBAAiB,CAAC;CAClB,cAAc,CAAC;CACf,cAAc,CAAC;AACjB,MACG;CACH,IAAI,WAAW;CACf,MAAM,cAAe,CAAC,CAAC,WAAW,SAAS,CAAC,MAAM,oBAAqB,MAAM,WAAW;CACxF,MAAM,UAAU,IAAa,W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