@voicenter-team/voicenter-ui-plus 3.0.2 → 3.0.3
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/README.md +3 -0
- package/library/assets/assets/sass/main.css +1 -1
- package/library/components/VcPluginOverlays/VcPluginOverlays.vue.mjs +21 -0
- package/library/components/VcPluginOverlays/VcPluginOverlays.vue2.mjs +4 -0
- package/library/index.mjs +106 -102
- package/library/index.mjs.br +0 -0
- package/library/index.mjs.gz +0 -0
- package/library/plugin.mjs +7 -0
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/style.css +1 -1
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/types/components/VcPluginOverlays/VcPluginOverlays.vue.d.ts +2 -0
- package/library/types/enum/icons.d.ts +5841 -0
- package/library/types/index.d.ts +2 -0
- package/library/types/types/Entry.types.d.ts +7 -0
- package/library/types/utils/mountPluginOverlays.d.ts +10 -0
- package/library/utils/mountPluginOverlays.mjs +24 -0
- package/package.json +1 -1
package/library/types/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export { default as VcProgress } from './components/VcProgress/VcProgress.vue';
|
|
|
59
59
|
export { default as VcProgressCircular } from './components/VcProgress/VcProgressCircular.vue';
|
|
60
60
|
export { default as VcSkeletonLoader } from './components/VcSkeletonLoader/VcSkeletonLoader.vue';
|
|
61
61
|
export { default as VcNotification } from './components/VcNotification/VcNotification.vue';
|
|
62
|
+
export { default as VcPluginOverlays } from './components/VcPluginOverlays/VcPluginOverlays.vue';
|
|
62
63
|
export { default as VcForm } from './components/VcForm/VcForm.vue';
|
|
63
64
|
export { default as VcFormItem } from './components/VcForm/VcFormItem.vue';
|
|
64
65
|
export { default as VcSplitButton } from './components/VcSplitButton/VcSplitButton.vue';
|
|
@@ -81,6 +82,7 @@ export { default as allCountries } from './enum/countries';
|
|
|
81
82
|
export type { CountryDataType } from './enum/countries';
|
|
82
83
|
export { VcIconList } from './enum/icons';
|
|
83
84
|
export { default as makeDataTestAttributeValue } from './utils/makeDataTestAttributeValue';
|
|
85
|
+
export { mountPluginOverlays } from './utils/mountPluginOverlays';
|
|
84
86
|
export { convertToUnit, resolveFieldData, getRefElement, getFileSize } from './utils/helpers';
|
|
85
87
|
export { default as UniqueComponentId } from './utils/UniqueComponentId';
|
|
86
88
|
export { default as useInputColor } from './composables/input/useInputColor';
|
|
@@ -10,4 +10,11 @@ export declare type UIConfig = {
|
|
|
10
10
|
* Defaults to `false`.
|
|
11
11
|
*/
|
|
12
12
|
injectIconFont?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* When `true` (default), plugin install mounts {@link VcPluginOverlays} into
|
|
15
|
+
* `document.body` so `useConfirmModal`, `useConfirmPopup`, and toast
|
|
16
|
+
* notifications work without adding overlay components to App.vue.
|
|
17
|
+
* Set to `false` if you mount `<VcPluginOverlays />` yourself.
|
|
18
|
+
*/
|
|
19
|
+
mountOverlays?: boolean;
|
|
13
20
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { App, Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts singleton overlay components (confirm modal/popover, notifications)
|
|
4
|
+
* into `document.body` with the consumer app's context so globally registered
|
|
5
|
+
* components, directives, i18n, and provide/inject all resolve correctly.
|
|
6
|
+
*
|
|
7
|
+
* Plugin mode calls this automatically. Tree-shake consumers can either mount
|
|
8
|
+
* `<VcPluginOverlays />` in App.vue or call this helper after `createApp`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function mountPluginOverlays(app: App, component: Component): () => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createVNode, render } from "vue";
|
|
2
|
+
const HOST_ATTR = "data-vc-plugin-overlays";
|
|
3
|
+
function mountPluginOverlays(app, component) {
|
|
4
|
+
if (typeof document === "undefined") {
|
|
5
|
+
return () => {
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
let container = document.querySelector(`[${HOST_ATTR}]`);
|
|
9
|
+
if (!container) {
|
|
10
|
+
container = document.createElement("div");
|
|
11
|
+
container.setAttribute(HOST_ATTR, "");
|
|
12
|
+
document.body.appendChild(container);
|
|
13
|
+
}
|
|
14
|
+
const vnode = createVNode(component);
|
|
15
|
+
vnode.appContext = app._context;
|
|
16
|
+
render(vnode, container);
|
|
17
|
+
return () => {
|
|
18
|
+
render(null, container);
|
|
19
|
+
container.remove();
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
mountPluginOverlays
|
|
24
|
+
};
|