@sellmate/design-system-vue 1.0.56 → 1.0.57
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/sdModal.d.ts +3 -3
- package/dist/sdModal.js +7 -6
- package/lib/sdModal.ts +11 -8
- package/package.json +2 -2
package/dist/sdModal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type App, type Component } from 'vue';
|
|
2
|
-
import { type ConfirmModalOptions, type
|
|
2
|
+
import { type ConfirmModalOptions, type ModalDialogRef, type SdModalCreateOption as CoreSdModalCreateOption, type SdModalGlobalOptions } from '@sellmate/design-system/utils';
|
|
3
3
|
/**
|
|
4
4
|
* Vue 플러그인. `app.use(SdModalVuePlugin)` 로 설치하면
|
|
5
5
|
* 이후 `sdModal.create({ component: MyModal, componentProps: { ... } })` 호출 시
|
|
@@ -35,8 +35,8 @@ export interface SdModalCreateOption extends Omit<CoreSdModalCreateOption, 'comp
|
|
|
35
35
|
* `compilerOptions.isCustomElement` 가 전부 자동 상속됩니다.
|
|
36
36
|
*/
|
|
37
37
|
export declare const sdModal: {
|
|
38
|
-
confirm(options: ConfirmModalOptions):
|
|
38
|
+
confirm(options: ConfirmModalOptions): ModalDialogRef;
|
|
39
39
|
configure(options: SdModalGlobalOptions): void;
|
|
40
|
-
create(input: SdModalCreateOption):
|
|
40
|
+
create(input: SdModalCreateOption): ModalDialogRef;
|
|
41
41
|
};
|
|
42
42
|
export default sdModal;
|
package/dist/sdModal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createVNode, render, } from 'vue';
|
|
2
|
-
import { sdModal as coreSdModal, } from '@sellmate/design-system/utils';
|
|
2
|
+
import { sdModal as coreSdModal, _createSdModalRef, _attachSdModalWithRef, } from '@sellmate/design-system/utils';
|
|
3
3
|
/**
|
|
4
4
|
* Vue 플러그인. `app.use(SdModalVuePlugin)` 로 설치하면
|
|
5
5
|
* 이후 `sdModal.create({ component: MyModal, componentProps: { ... } })` 호출 시
|
|
@@ -56,13 +56,14 @@ export const sdModal = {
|
|
|
56
56
|
if (isHTMLElement(component)) {
|
|
57
57
|
return coreSdModal.create({ component, persist });
|
|
58
58
|
}
|
|
59
|
-
// Vue 컴포넌트 오버로드
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
59
|
+
// Vue 컴포넌트 오버로드 — modalRef 를 먼저 만들어 props 에 주입한 뒤 mount
|
|
60
|
+
const modalRef = _createSdModalRef();
|
|
61
|
+
const { el, host } = mountVueComponent(component, { ...componentProps, modalRef });
|
|
62
|
+
_attachSdModalWithRef(modalRef, { component: el, persist });
|
|
63
|
+
modalRef.onDismissed(() => {
|
|
63
64
|
render(null, host);
|
|
64
65
|
});
|
|
65
|
-
return
|
|
66
|
+
return modalRef;
|
|
66
67
|
},
|
|
67
68
|
};
|
|
68
69
|
export default sdModal;
|
package/lib/sdModal.ts
CHANGED
|
@@ -7,8 +7,10 @@ import {
|
|
|
7
7
|
} from 'vue';
|
|
8
8
|
import {
|
|
9
9
|
sdModal as coreSdModal,
|
|
10
|
+
_createSdModalRef,
|
|
11
|
+
_attachSdModalWithRef,
|
|
10
12
|
type ConfirmModalOptions,
|
|
11
|
-
type
|
|
13
|
+
type ModalDialogRef,
|
|
12
14
|
type SdModalCreateOption as CoreSdModalCreateOption,
|
|
13
15
|
type SdModalGlobalOptions,
|
|
14
16
|
} from '@sellmate/design-system/utils';
|
|
@@ -86,7 +88,7 @@ function mountVueComponent(
|
|
|
86
88
|
* `compilerOptions.isCustomElement` 가 전부 자동 상속됩니다.
|
|
87
89
|
*/
|
|
88
90
|
export const sdModal = {
|
|
89
|
-
confirm(options: ConfirmModalOptions):
|
|
91
|
+
confirm(options: ConfirmModalOptions): ModalDialogRef {
|
|
90
92
|
return coreSdModal.confirm(options);
|
|
91
93
|
},
|
|
92
94
|
|
|
@@ -94,7 +96,7 @@ export const sdModal = {
|
|
|
94
96
|
coreSdModal.configure(options);
|
|
95
97
|
},
|
|
96
98
|
|
|
97
|
-
create(input: SdModalCreateOption):
|
|
99
|
+
create(input: SdModalCreateOption): ModalDialogRef {
|
|
98
100
|
const { component, componentProps = {}, persist } = input;
|
|
99
101
|
|
|
100
102
|
// HTMLElement 오버로드: core 로 바로 위임
|
|
@@ -102,14 +104,15 @@ export const sdModal = {
|
|
|
102
104
|
return coreSdModal.create({ component, persist });
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
// Vue 컴포넌트 오버로드
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
// Vue 컴포넌트 오버로드 — modalRef 를 먼저 만들어 props 에 주입한 뒤 mount
|
|
108
|
+
const modalRef = _createSdModalRef();
|
|
109
|
+
const { el, host } = mountVueComponent(component, { ...componentProps, modalRef });
|
|
110
|
+
_attachSdModalWithRef(modalRef, { component: el, persist });
|
|
111
|
+
modalRef.onDismissed(() => {
|
|
109
112
|
render(null, host);
|
|
110
113
|
});
|
|
111
114
|
|
|
112
|
-
return
|
|
115
|
+
return modalRef;
|
|
113
116
|
},
|
|
114
117
|
};
|
|
115
118
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellmate/design-system-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.57",
|
|
4
4
|
"description": "Design System - Vue Component Wrappers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vue": "^3.4.38"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@sellmate/design-system": "^1.0.
|
|
48
|
+
"@sellmate/design-system": "^1.0.57",
|
|
49
49
|
"@stencil/vue-output-target": "^0.11.8"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|