@voicenter-team/voicenter-ui-plus 3.0.3 → 3.0.5
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 +50 -3
- package/library/components/VcPluginOverlays/VcPluginOverlays.vue.mjs +29 -4
- package/library/components/VcPopover/VcConfirmPopover.vue.mjs +4 -2
- package/library/plugin.mjs +177 -168
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/types/components/VcAutocomplete/VcAutocomplete.vue.d.ts +6 -6
- package/library/types/components/VcButton/VcButton.vue.d.ts +1 -1
- package/library/types/components/VcButton/VcButtonIcon.vue.d.ts +2 -2
- package/library/types/components/VcButton/VcToggleButton.vue.d.ts +1 -1
- package/library/types/components/VcCheckbox/VcCheckbox.vue.d.ts +3 -3
- package/library/types/components/VcColorPicker/VcColorPicker.vue.d.ts +1 -1
- package/library/types/components/VcDatePicker/VcDatePicker.vue.d.ts +6 -6
- package/library/types/components/VcDatePickerPanel/VcDatePickerPanel.vue.d.ts +3 -3
- package/library/types/components/VcDropdown/VcDropdown.vue.d.ts +1 -1
- package/library/types/components/VcExtendedDatetimeRangePicker/ExtendedDatetimeRangePickerPart.vue.d.ts +1 -1
- package/library/types/components/VcExtendedDatetimeRangePicker/ExtendedDatetimeRangePickerRelative.vue.d.ts +1 -1
- package/library/types/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.vue.d.ts +2 -2
- package/library/types/components/VcFileUploader/VcFileUploader.vue.d.ts +1 -1
- package/library/types/components/VcForm/VcForm.vue.d.ts +1 -1
- package/library/types/components/VcHyperLink/VcHyperLink.vue.d.ts +1 -1
- package/library/types/components/VcImageUploader/VcImageUploader.vue.d.ts +1 -1
- package/library/types/components/VcInput/VcInput.vue.d.ts +1 -1
- package/library/types/components/VcOtpInput/VcOtpInput.vue.d.ts +1 -1
- package/library/types/components/VcPagination/VcPaginationButton.vue.d.ts +2 -2
- package/library/types/components/VcPhoneInput/VcPhoneInput.vue.d.ts +1 -1
- package/library/types/components/VcPluginOverlays/VcPluginOverlays.vue.d.ts +32 -1
- package/library/types/components/VcPopover/VcConfirmPopover.vue.d.ts +9 -1
- package/library/types/components/VcRadio/VcRadio.vue.d.ts +3 -3
- package/library/types/components/VcRadioButtons/VcRadioButtonsGroup.vue.d.ts +6 -6
- package/library/types/components/VcRadioGroup/VcRadioGroup.vue.d.ts +3 -3
- package/library/types/components/VcSegmented/VcSegmented.vue.d.ts +6 -6
- package/library/types/components/VcSelect/VcInfiniteScrollSelect.vue.d.ts +6 -6
- package/library/types/components/VcSelect/VcSelect.vue.d.ts +6 -6
- package/library/types/components/VcSelect/VcSelectGrouped.vue.d.ts +6 -6
- package/library/types/components/VcSplitButton/VcSplitButton.vue.d.ts +2 -2
- package/library/types/components/VcSwitch/VcSwitch.vue.d.ts +3 -3
- package/library/types/components/VcTag/VcTag.vue.d.ts +1 -1
- package/library/types/components/VcTagInput/VcTagInput.vue.d.ts +3 -3
- package/library/types/components/VcTimeInput/VcTimeInput.vue.d.ts +1 -1
- package/library/types/components/VcTree/VcTree.vue.d.ts +6 -6
- package/library/types/components/VcTree/VcTreeSelect.vue.d.ts +6 -6
- package/library/types/types/Entry.types.d.ts +23 -0
- package/library/types/types/Overlay.types.d.ts +22 -0
- package/library/types/types/index.d.ts +1 -0
- package/library/types/utils/mountPluginOverlays.d.ts +9 -3
- package/library/utils/mountPluginOverlays.mjs +12 -10
- package/package.json +1 -1
|
@@ -5,8 +5,8 @@ export type OptionObjectGroupedValueType<Option extends OptionObjectValueType> =
|
|
|
5
5
|
};
|
|
6
6
|
declare const _default: <Option extends object, Config extends ConfigOptionType<Option>, Model extends ExtractValueType<Option, Config>, Multiple extends boolean = false>(__VLS_props: {
|
|
7
7
|
id?: string | undefined;
|
|
8
|
-
size?: "" | "
|
|
9
|
-
color?: "" | "
|
|
8
|
+
size?: "" | "default" | "small" | "large" | undefined;
|
|
9
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
10
10
|
readonly onFocus?: ((evt: Event) => any) | undefined;
|
|
11
11
|
readonly onBlur?: ((evt: Event) => any) | undefined;
|
|
12
12
|
readonly onChange?: ((option: (Multiple extends true ? Option[] : Option) | undefined) => any) | undefined;
|
|
@@ -63,8 +63,8 @@ declare const _default: <Option extends object, Config extends ConfigOptionType<
|
|
|
63
63
|
} | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
64
64
|
props: {
|
|
65
65
|
id?: string | undefined;
|
|
66
|
-
size?: "" | "
|
|
67
|
-
color?: "" | "
|
|
66
|
+
size?: "" | "default" | "small" | "large" | undefined;
|
|
67
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
68
68
|
readonly onFocus?: ((evt: Event) => any) | undefined;
|
|
69
69
|
readonly onBlur?: ((evt: Event) => any) | undefined;
|
|
70
70
|
readonly onChange?: ((option: (Multiple extends true ? Option[] : Option) | undefined) => any) | undefined;
|
|
@@ -125,8 +125,8 @@ declare const _default: <Option extends object, Config extends ConfigOptionType<
|
|
|
125
125
|
__ctx?: {
|
|
126
126
|
props: {
|
|
127
127
|
id?: string | undefined;
|
|
128
|
-
size?: "" | "
|
|
129
|
-
color?: "" | "
|
|
128
|
+
size?: "" | "default" | "small" | "large" | undefined;
|
|
129
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
130
130
|
readonly onFocus?: ((evt: Event) => any) | undefined;
|
|
131
131
|
readonly onBlur?: ((evt: Event) => any) | undefined;
|
|
132
132
|
readonly onChange?: ((option: (Multiple extends true ? Option[] : Option) | undefined) => any) | undefined;
|
|
@@ -64,8 +64,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
64
64
|
onChange?: ((option: VcSplitButtonOption) => any) | undefined;
|
|
65
65
|
onClick?: ((option: VcSplitButtonOption | undefined) => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
|
-
size: "" | "
|
|
68
|
-
color: "" | "
|
|
67
|
+
size: "" | "default" | "small" | "large";
|
|
68
|
+
color: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative";
|
|
69
69
|
loading: boolean;
|
|
70
70
|
disabled: boolean;
|
|
71
71
|
popoverMaxWidth: string | number;
|
|
@@ -5,7 +5,7 @@ declare const _default: <Model extends string | number | boolean | undefined>(__
|
|
|
5
5
|
size?: VcSwitchSizeType | undefined;
|
|
6
6
|
values?: Model[] | undefined;
|
|
7
7
|
ariaLabel?: string | undefined;
|
|
8
|
-
color?: "" | "
|
|
8
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
9
9
|
readonly onChange?: ((model: Model) => any) | undefined;
|
|
10
10
|
readonly onInput?: ((model: Model) => any) | undefined;
|
|
11
11
|
width?: string | number | undefined;
|
|
@@ -52,7 +52,7 @@ declare const _default: <Model extends string | number | boolean | undefined>(__
|
|
|
52
52
|
size?: VcSwitchSizeType | undefined;
|
|
53
53
|
values?: Model[] | undefined;
|
|
54
54
|
ariaLabel?: string | undefined;
|
|
55
|
-
color?: "" | "
|
|
55
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
56
56
|
readonly onChange?: ((model: Model) => any) | undefined;
|
|
57
57
|
readonly onInput?: ((model: Model) => any) | undefined;
|
|
58
58
|
width?: string | number | undefined;
|
|
@@ -103,7 +103,7 @@ declare const _default: <Model extends string | number | boolean | undefined>(__
|
|
|
103
103
|
size?: VcSwitchSizeType | undefined;
|
|
104
104
|
values?: Model[] | undefined;
|
|
105
105
|
ariaLabel?: string | undefined;
|
|
106
|
-
color?: "" | "
|
|
106
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
107
107
|
readonly onChange?: ((model: Model) => any) | undefined;
|
|
108
108
|
readonly onInput?: ((model: Model) => any) | undefined;
|
|
109
109
|
width?: string | number | undefined;
|
|
@@ -55,7 +55,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
55
55
|
}>, {
|
|
56
56
|
borderless: boolean;
|
|
57
57
|
icon: TIcon;
|
|
58
|
-
color: "" | "
|
|
58
|
+
color: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative";
|
|
59
59
|
label: string;
|
|
60
60
|
disabled: boolean;
|
|
61
61
|
square: boolean;
|
|
@@ -49,7 +49,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
49
49
|
removeItem: typeof removeItem;
|
|
50
50
|
disabled: import("vue").ComputedRef<boolean>;
|
|
51
51
|
isError: import("vue").ComputedRef<boolean>;
|
|
52
|
-
color: import("vue").ComputedRef<"" | "
|
|
52
|
+
color: import("vue").ComputedRef<"" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative">;
|
|
53
53
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
54
|
"update:modelValue": (value: (string | number)[]) => void;
|
|
55
55
|
add: (value: {
|
|
@@ -97,7 +97,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
97
97
|
}>, {
|
|
98
98
|
id: string;
|
|
99
99
|
class: string;
|
|
100
|
-
color: "" | "
|
|
100
|
+
color: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative";
|
|
101
101
|
style: string | false | import("vue").CSSProperties | StyleValue[] | null;
|
|
102
102
|
disabled: boolean;
|
|
103
103
|
max: number;
|
|
@@ -115,7 +115,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
115
115
|
allowDuplicate: boolean;
|
|
116
116
|
tagBorderless: boolean;
|
|
117
117
|
tagSquare: boolean;
|
|
118
|
-
tagColor: "" | "
|
|
118
|
+
tagColor: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative";
|
|
119
119
|
tagMaxContent: string | number;
|
|
120
120
|
valueType: "string" | "number";
|
|
121
121
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -59,7 +59,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
59
59
|
}) => any) | undefined;
|
|
60
60
|
}>, {
|
|
61
61
|
id: string;
|
|
62
|
-
color: "" | "
|
|
62
|
+
color: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative";
|
|
63
63
|
disabled: boolean;
|
|
64
64
|
name: string;
|
|
65
65
|
placeholder: string;
|
|
@@ -4,7 +4,7 @@ import type Node from 'element-plus/es/components/tree/src/model/node';
|
|
|
4
4
|
declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config extends VcTreeConfig<VcTreeNodeGenericType>>(__VLS_props: {
|
|
5
5
|
scrollHeight?: string | number | undefined;
|
|
6
6
|
lazy?: boolean | undefined;
|
|
7
|
-
color?: "" | "
|
|
7
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
8
8
|
loading?: boolean | undefined;
|
|
9
9
|
options?: VcTreeNodeGenericType[] | undefined;
|
|
10
10
|
config: Config;
|
|
@@ -19,7 +19,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
19
19
|
expandedKeys?: (string | number)[] | undefined;
|
|
20
20
|
defaultCheckedKeys?: (string | number)[] | undefined;
|
|
21
21
|
filterPrefixIcon?: TIcon | undefined;
|
|
22
|
-
filterPrefixIconColor?: "" | "
|
|
22
|
+
filterPrefixIconColor?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
23
23
|
useTypes?: VcTreeNodeGenericType["type"][] | undefined;
|
|
24
24
|
clearFilterOnOptionsChange?: boolean | undefined;
|
|
25
25
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
|
|
@@ -50,7 +50,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
50
50
|
props: {
|
|
51
51
|
scrollHeight?: string | number | undefined;
|
|
52
52
|
lazy?: boolean | undefined;
|
|
53
|
-
color?: "" | "
|
|
53
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
54
54
|
loading?: boolean | undefined;
|
|
55
55
|
options?: VcTreeNodeGenericType[] | undefined;
|
|
56
56
|
config: Config;
|
|
@@ -65,7 +65,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
65
65
|
expandedKeys?: (string | number)[] | undefined;
|
|
66
66
|
defaultCheckedKeys?: (string | number)[] | undefined;
|
|
67
67
|
filterPrefixIcon?: TIcon | undefined;
|
|
68
|
-
filterPrefixIconColor?: "" | "
|
|
68
|
+
filterPrefixIconColor?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
69
69
|
useTypes?: VcTreeNodeGenericType["type"][] | undefined;
|
|
70
70
|
clearFilterOnOptionsChange?: boolean | undefined;
|
|
71
71
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
@@ -100,7 +100,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
100
100
|
props: {
|
|
101
101
|
scrollHeight?: string | number | undefined;
|
|
102
102
|
lazy?: boolean | undefined;
|
|
103
|
-
color?: "" | "
|
|
103
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
104
104
|
loading?: boolean | undefined;
|
|
105
105
|
options?: VcTreeNodeGenericType[] | undefined;
|
|
106
106
|
config: Config;
|
|
@@ -115,7 +115,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
115
115
|
expandedKeys?: (string | number)[] | undefined;
|
|
116
116
|
defaultCheckedKeys?: (string | number)[] | undefined;
|
|
117
117
|
filterPrefixIcon?: TIcon | undefined;
|
|
118
|
-
filterPrefixIconColor?: "" | "
|
|
118
|
+
filterPrefixIconColor?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
119
119
|
useTypes?: VcTreeNodeGenericType["type"][] | undefined;
|
|
120
120
|
clearFilterOnOptionsChange?: boolean | undefined;
|
|
121
121
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
@@ -3,7 +3,7 @@ import { VcTreeConfig, VcTreeNodeType } from '../../types';
|
|
|
3
3
|
declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config extends VcTreeConfig<VcTreeNodeGenericType>, Model extends ExtractValueType<VcTreeNodeGenericType, Config>>(__VLS_props: {
|
|
4
4
|
id?: string | undefined;
|
|
5
5
|
scrollHeight?: string | number | undefined;
|
|
6
|
-
color?: "" | "
|
|
6
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
7
7
|
loading?: boolean | undefined;
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
name?: string | undefined;
|
|
@@ -21,7 +21,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
21
21
|
config: Config;
|
|
22
22
|
emptyText?: string | undefined;
|
|
23
23
|
tagBorderless?: boolean | undefined;
|
|
24
|
-
tagColor?: "" | "
|
|
24
|
+
tagColor?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
25
25
|
nodeKey?: keyof VcTreeNodeGenericType | undefined;
|
|
26
26
|
useTypes?: VcTreeNodeGenericType["type"][] | undefined;
|
|
27
27
|
clearFilterOnOptionsChange?: boolean | undefined;
|
|
@@ -456,7 +456,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
456
456
|
props: {
|
|
457
457
|
id?: string | undefined;
|
|
458
458
|
scrollHeight?: string | number | undefined;
|
|
459
|
-
color?: "" | "
|
|
459
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
460
460
|
loading?: boolean | undefined;
|
|
461
461
|
disabled?: boolean | undefined;
|
|
462
462
|
name?: string | undefined;
|
|
@@ -474,7 +474,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
474
474
|
config: Config;
|
|
475
475
|
emptyText?: string | undefined;
|
|
476
476
|
tagBorderless?: boolean | undefined;
|
|
477
|
-
tagColor?: "" | "
|
|
477
|
+
tagColor?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
478
478
|
nodeKey?: keyof VcTreeNodeGenericType | undefined;
|
|
479
479
|
useTypes?: VcTreeNodeGenericType["type"][] | undefined;
|
|
480
480
|
clearFilterOnOptionsChange?: boolean | undefined;
|
|
@@ -913,7 +913,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
913
913
|
props: {
|
|
914
914
|
id?: string | undefined;
|
|
915
915
|
scrollHeight?: string | number | undefined;
|
|
916
|
-
color?: "" | "
|
|
916
|
+
color?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
917
917
|
loading?: boolean | undefined;
|
|
918
918
|
disabled?: boolean | undefined;
|
|
919
919
|
name?: string | undefined;
|
|
@@ -931,7 +931,7 @@ declare const _default: <VcTreeNodeGenericType extends VcTreeNodeType, Config ex
|
|
|
931
931
|
config: Config;
|
|
932
932
|
emptyText?: string | undefined;
|
|
933
933
|
tagBorderless?: boolean | undefined;
|
|
934
|
-
tagColor?: "" | "
|
|
934
|
+
tagColor?: "" | "success" | "warning" | "primary" | "secondary" | "destructive" | "active" | "primary-alternative" | undefined;
|
|
935
935
|
nodeKey?: keyof VcTreeNodeGenericType | undefined;
|
|
936
936
|
useTypes?: VcTreeNodeGenericType["type"][] | undefined;
|
|
937
937
|
clearFilterOnOptionsChange?: boolean | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LanguageType } from '../localization/Localization.types';
|
|
2
2
|
import { UIThemeConfig } from '../theme/theme.types';
|
|
3
|
+
import type { OverlayNotificationsConfig } from './Overlay.types';
|
|
3
4
|
export declare type UIConfig = {
|
|
4
5
|
lang?: LanguageType;
|
|
5
6
|
themeConfig?: UIThemeConfig;
|
|
@@ -17,4 +18,26 @@ export declare type UIConfig = {
|
|
|
17
18
|
* Set to `false` if you mount `<VcPluginOverlays />` yourself.
|
|
18
19
|
*/
|
|
19
20
|
mountOverlays?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Notification hosts inside auto-mounted `VcPluginOverlays`.
|
|
23
|
+
* - `'default'` — one top-right container (default)
|
|
24
|
+
* - `'none'` — no notification host; add your own `<VcNotification />` in App.vue
|
|
25
|
+
* - array — multiple `{ group, position }` hosts (pass matching `group` in `$notify.add`)
|
|
26
|
+
*/
|
|
27
|
+
overlayNotifications?: OverlayNotificationsConfig;
|
|
28
|
+
/**
|
|
29
|
+
* Teleport target for the auto-mounted overlays (confirm modal, confirm
|
|
30
|
+
* popover, notifications). Defaults to `'body'`. Pass an element inside a
|
|
31
|
+
* shadow root (custom-element / web-component hosts) so the overlays render
|
|
32
|
+
* INSIDE the shadow DOM and pick up its scoped styles, instead of escaping
|
|
33
|
+
* to `document.body`.
|
|
34
|
+
*/
|
|
35
|
+
overlayAppendTo?: string | HTMLElement;
|
|
36
|
+
/**
|
|
37
|
+
* Where to append the overlay host element that `VcPluginOverlays` mounts
|
|
38
|
+
* into. Defaults to `document.body`. For shadow-DOM hosts pass the shadow
|
|
39
|
+
* root (or an element inside it) so the overlay host itself lives within
|
|
40
|
+
* the shadow tree.
|
|
41
|
+
*/
|
|
42
|
+
overlayContainer?: Element | DocumentFragment;
|
|
20
43
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ToastPositionType } from './VcNotification.types';
|
|
2
|
+
export type OverlayNotificationHost = {
|
|
3
|
+
group?: string;
|
|
4
|
+
position?: ToastPositionType;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Controls which `VcNotification` hosts are rendered inside `VcPluginOverlays`.
|
|
8
|
+
* - `'default'` — single container (top-right, ungrouped messages)
|
|
9
|
+
* - `'none'` — skip notifications; mount your own `<VcNotification />` in App.vue
|
|
10
|
+
* - `OverlayNotificationHost[]` — multiple positioned/grouped containers
|
|
11
|
+
*/
|
|
12
|
+
export type OverlayNotificationsConfig = 'default' | 'none' | OverlayNotificationHost[];
|
|
13
|
+
export type VcPluginOverlaysProps = {
|
|
14
|
+
notifications?: OverlayNotificationsConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Teleport target for the overlay hosts (confirm modal, confirm popover,
|
|
17
|
+
* notifications). Defaults to `'body'`. Pass an element inside a shadow
|
|
18
|
+
* root so the overlays render INSIDE the shadow DOM (custom-element hosts)
|
|
19
|
+
* and inherit its scoped styles.
|
|
20
|
+
*/
|
|
21
|
+
appendTo?: string | HTMLElement;
|
|
22
|
+
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { App, Component } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* Mounts singleton overlay components (confirm modal/popover, notifications)
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* with the consumer app's context so globally registered components,
|
|
5
|
+
* directives, i18n, and provide/inject all resolve correctly.
|
|
6
|
+
*
|
|
7
|
+
* The host element is appended to `container` (defaults to `document.body`).
|
|
8
|
+
* For shadow-DOM / custom-element hosts pass the shadow root (or an element
|
|
9
|
+
* inside it) so the overlays live within the shadow tree and inherit its
|
|
10
|
+
* scoped styles — pair it with the `appendTo` prop so the teleported content
|
|
11
|
+
* stays inside the same root.
|
|
6
12
|
*
|
|
7
13
|
* Plugin mode calls this automatically. Tree-shake consumers can either mount
|
|
8
14
|
* `<VcPluginOverlays />` in App.vue or call this helper after `createApp`.
|
|
9
15
|
*/
|
|
10
|
-
export declare function mountPluginOverlays(app: App, component: Component): () => void;
|
|
16
|
+
export declare function mountPluginOverlays(app: App, component: Component, props?: Record<string, unknown>, container?: Element | DocumentFragment): () => void;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { createVNode, render } from "vue";
|
|
2
2
|
const HOST_ATTR = "data-vc-plugin-overlays";
|
|
3
|
-
function mountPluginOverlays(app, component) {
|
|
3
|
+
function mountPluginOverlays(app, component, props, container) {
|
|
4
4
|
if (typeof document === "undefined") {
|
|
5
5
|
return () => {
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const mountRoot = container ?? document.body;
|
|
9
|
+
let existingHost = mountRoot.querySelector(`[${HOST_ATTR}]`);
|
|
10
|
+
if (!existingHost) {
|
|
11
|
+
existingHost = document.createElement("div");
|
|
12
|
+
existingHost.setAttribute(HOST_ATTR, "");
|
|
13
|
+
mountRoot.appendChild(existingHost);
|
|
13
14
|
}
|
|
14
|
-
const
|
|
15
|
+
const host = existingHost;
|
|
16
|
+
const vnode = createVNode(component, props);
|
|
15
17
|
vnode.appContext = app._context;
|
|
16
|
-
render(vnode,
|
|
18
|
+
render(vnode, host);
|
|
17
19
|
return () => {
|
|
18
|
-
render(null,
|
|
19
|
-
|
|
20
|
+
render(null, host);
|
|
21
|
+
host.remove();
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
export {
|