@bagelink/vue 1.9.88 → 1.9.90
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/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/index.cjs +33 -33
- package/dist/index.mjs +2045 -2039
- package/dist/style.css +1 -1
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Dropdown.vue +2 -2
- package/src/styles/toast-overrides.css +10 -3
- package/src/utils/index.ts +17 -0
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Attributes, BglFormSchemaT, Path } from '../types/BagelForm';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a singleton popover container that lives in the browser's top layer.
|
|
4
|
+
* Popovers rendered inside it will appear above showModal() dialogs.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getTopLayerContainer(): HTMLElement | string;
|
|
2
7
|
export declare function debounce(fn: () => void, wait?: number): void;
|
|
3
8
|
export declare function slugify(str: string): string;
|
|
4
9
|
export declare function keyToLabel(key?: string): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAE1E;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,GAAG,MAAM,CAW3D;AAID,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,MAAY,QAO1D;AAED,wBAAgB,OAAO,CAAC,GAA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AAE,MAAM,cAAc,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { IconType, ThemeType } from '@bagelink/vue'
|
|
3
3
|
import type { TriggerEvent } from 'floating-vue'
|
|
4
4
|
import type { ComponentExposed } from 'vue-component-type-helpers'
|
|
5
|
-
import { Btn, useDevice } from '@bagelink/vue'
|
|
5
|
+
import { Btn, useDevice, getTopLayerContainer } from '@bagelink/vue'
|
|
6
6
|
import { Dropdown as DDown } from 'floating-vue'
|
|
7
7
|
import { computed, ref } from 'vue'
|
|
8
8
|
|
|
@@ -191,7 +191,7 @@ const computedPopperHideTriggers = computed((): TriggerEvent[] => {
|
|
|
191
191
|
|
|
192
192
|
const computedAutoHide = computed(() => autoHide)
|
|
193
193
|
|
|
194
|
-
const container = computed(() =>
|
|
194
|
+
const container = computed(() => getTopLayerContainer())
|
|
195
195
|
|
|
196
196
|
const computedDelay = computed((): number | { show: number, hide: number } | undefined => {
|
|
197
197
|
if (delay !== undefined) { return delay }
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
/* Reset popover
|
|
2
|
-
#bgl-toast-container
|
|
1
|
+
/* Reset popover containers used to promote elements above showModal() dialogs */
|
|
2
|
+
#bgl-toast-container,
|
|
3
|
+
#bgl-toplayer-container {
|
|
3
4
|
all: unset;
|
|
5
|
+
position: fixed;
|
|
6
|
+
inset: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
4
9
|
pointer-events: none;
|
|
10
|
+
overflow: visible;
|
|
5
11
|
}
|
|
6
12
|
|
|
7
|
-
#bgl-toast-container >
|
|
13
|
+
#bgl-toast-container > *,
|
|
14
|
+
#bgl-toplayer-container > * {
|
|
8
15
|
pointer-events: auto;
|
|
9
16
|
}
|
|
10
17
|
|
package/src/utils/index.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import type { Attributes, BglFormSchemaT, Path } from '../types/BagelForm'
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Returns a singleton popover container that lives in the browser's top layer.
|
|
5
|
+
* Popovers rendered inside it will appear above showModal() dialogs.
|
|
6
|
+
*/
|
|
7
|
+
export function getTopLayerContainer(): HTMLElement | string {
|
|
8
|
+
if (typeof document === 'undefined') return 'body'
|
|
9
|
+
let el = document.getElementById('bgl-toplayer-container')
|
|
10
|
+
if (!el) {
|
|
11
|
+
el = document.createElement('div')
|
|
12
|
+
el.id = 'bgl-toplayer-container'
|
|
13
|
+
el.setAttribute('popover', 'manual')
|
|
14
|
+
document.body.appendChild(el);
|
|
15
|
+
(el as any).showPopover?.()
|
|
16
|
+
}
|
|
17
|
+
return el
|
|
18
|
+
}
|
|
19
|
+
|
|
3
20
|
const debouncers = new Map<() => void, ReturnType<typeof setTimeout>>()
|
|
4
21
|
|
|
5
22
|
export function debounce(fn: () => void, wait: number = 500) {
|