@voicenter-team/voicenter-ui-plus 3.0.1 → 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.
@@ -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
  };
@@ -2,7 +2,7 @@ import type { StyleValue } from 'vue';
2
2
  import { COMPONENT_COLOR_TYPE } from '../enum/constants';
3
3
  import { NestedKeys, PathValue } from '.';
4
4
  import type { TIcon } from './icons.types';
5
- export type OptionObjectValueType = Record<string, unknown>;
5
+ export type OptionObjectValueType = object;
6
6
  export type OptionNonObjectValueType = string | number | boolean;
7
7
  export type OptionValueType = OptionObjectValueType | OptionNonObjectValueType;
8
8
  export type ConfigOptionType<Option extends OptionValueType> = Option extends OptionObjectValueType ? {
@@ -2,7 +2,7 @@ import { OptionObjectValueType } from '.';
2
2
  import { TIcon } from './icons.types';
3
3
  export declare type Alignment = 'left' | 'center' | 'right';
4
4
  export declare type SortFunction<Option extends OptionObjectValueType> = (a: Option, b: Option) => number;
5
- export declare type FormatFunction<Option extends OptionObjectValueType = OptionObjectValueType> = (row: Option) => string | number | unknown;
5
+ export declare type FormatFunction<Option extends OptionObjectValueType = Record<string, unknown>> = (row: Option) => string | number | unknown;
6
6
  /** @description Configuration for column filtering functionality */
7
7
  export declare type FilterableConfig = {
8
8
  /** @description Whether filtering is enabled for this column */
@@ -16,7 +16,7 @@ export declare type ColumnFilterState = {
16
16
  };
17
17
  /** @description Default filter options per column (always shown in filter popover) */
18
18
  export declare type FilterOptionsMap = Record<string, Array<string | number>>;
19
- export declare type ColumnTypeItem<Option extends OptionObjectValueType = OptionObjectValueType> = {
19
+ export declare type ColumnTypeItem<Option extends OptionObjectValueType = Record<string, unknown>> = {
20
20
  columnItemLabel: string;
21
21
  columnItemKey: string;
22
22
  /**
@@ -1,4 +1,4 @@
1
- import type { ConfigOptionType, OptionObjectValueType } from './OptionAndConfig.types';
1
+ import type { ConfigOptionType } from './OptionAndConfig.types';
2
2
  import type { TIcon } from './icons.types';
3
3
  export declare type VcTreeNodeType<T extends string = string> = {
4
4
  id?: string | number;
@@ -15,7 +15,7 @@ export declare type VcTreeNodeType<T extends string = string> = {
15
15
  checked?: boolean;
16
16
  _keyPath?: string;
17
17
  type?: T;
18
- } & OptionObjectValueType;
18
+ } & Record<string, unknown>;
19
19
  export declare type VcTreeConfig<NodeType extends VcTreeNodeType> = ConfigOptionType<NodeType> & {
20
20
  childrenKey: keyof NodeType;
21
21
  valueKey: keyof NodeType;
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicenter-team/voicenter-ui-plus",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",