@gct-paas/core-web 0.1.4-dev.8 → 0.1.4-dev.9
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/index-BghCpvxN.js +76 -0
- package/dist/index-PLrMc0gl.cjs +76 -0
- package/dist/index-oVPMi6Ep.js +29160 -0
- package/dist/index.esm.min.mjs +34 -24962
- package/dist/index.min.cjs +1 -67
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -67
- package/dist/monaco-editor-B8X-ou0h.js +20245 -0
- package/dist/monaco-editor-Bdgpd_KL.cjs +19 -0
- package/dist/monaco-editor-NIWDtQNB.js +19 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/app-modal/app-modal-component.css +149 -0
- package/es/components/app-modal/app-modal-component.d.ts +26 -0
- package/es/components/app-modal/app-modal-component.mjs +140 -0
- package/es/components/base-button/base-button.css +74 -0
- package/es/components/base-button/base-button.vue.d.ts +173 -0
- package/es/components/base-button/base-button.vue.mjs +7 -0
- package/es/components/base-button/base-button.vue3.mjs +179 -0
- package/es/components/basic-button/basic-button.css +25 -0
- package/es/components/basic-button/basic-button.vue.d.ts +100 -0
- package/es/components/basic-button/basic-button.vue.mjs +7 -0
- package/es/components/basic-button/basic-button.vue3.mjs +130 -0
- package/es/components/code-editor/code-editor.d.ts +1 -1
- package/es/components/index.d.ts +10 -1
- package/es/components/index.mjs +22 -0
- package/es/components/layout/flex-container/flex-container.mjs +94 -0
- package/es/components/layout/flex-item/flex-item.mjs +55 -0
- package/es/components/layout/grid-container/grid-container.mjs +51 -0
- package/es/components/layout/view-container/view-container.mjs +38 -0
- package/es/components/svg-icon/svg-icon.css +73 -0
- package/es/components/svg-icon/svg-icon.vue.d.ts +40 -0
- package/es/components/svg-icon/svg-icon.vue.mjs +50 -0
- package/es/components/svg-icon/svg-icon.vue3.mjs +6 -0
- package/es/create-app-vue.d.ts +9 -0
- package/es/create-app-vue.mjs +17 -0
- package/es/directives/drag-resize.d.ts +4 -0
- package/es/directives/drag-resize.mjs +42 -0
- package/es/directives/index.d.ts +8 -0
- package/es/directives/index.mjs +9 -0
- package/es/directives/target-loading.d.ts +4 -0
- package/es/directives/target-loading.mjs +40 -0
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/useDragLine.d.ts +6 -0
- package/es/hooks/useDragLine.mjs +79 -0
- package/es/index.d.ts +5 -4
- package/es/index.mjs +29 -13
- package/es/modules/code-editor/index.d.ts +163 -0
- package/es/modules/code-editor/index.mjs +8 -0
- package/es/modules/code-editor/monaco-editor.css +49 -0
- package/es/modules/code-editor/monaco-editor.vue.d.ts +143 -0
- package/es/modules/code-editor/monaco-editor.vue.mjs +7 -0
- package/es/modules/code-editor/monaco-editor.vue2.mjs +440 -0
- package/es/modules/code-editor/useEditorConsole.d.ts +54 -0
- package/es/modules/code-editor/useEditorConsole.mjs +194 -0
- package/es/modules/code-editor/useMonacoEditor.d.ts +26 -0
- package/es/modules/code-editor/useMonacoEditor.mjs +26 -0
- package/es/modules/color-picker/index.d.ts +2 -0
- package/es/modules/color-picker/src/ColorPicker.css +16 -0
- package/es/modules/color-picker/src/ColorPicker.vue.d.ts +49 -0
- package/es/modules/color-picker/src/ColorPicker.vue.mjs +8 -0
- package/es/modules/color-picker/src/ColorPicker.vue2.mjs +545 -0
- package/es/modules/color-picker/src/ColorPicker2.css +156 -0
- package/es/modules/gct-dnd/constants/index.d.ts +7 -9
- package/es/modules/gct-dnd/constants/index.mjs +18 -7
- package/es/modules/global-modal/index.d.ts +5 -0
- package/es/modules/global-modal/index.mjs +16 -0
- package/es/modules/global-modal/src/BasicModal.vue.d.ts +518 -0
- package/es/modules/global-modal/src/BasicModal.vue.mjs +221 -0
- package/es/modules/global-modal/src/BasicModal.vue2.mjs +5 -0
- package/es/modules/global-modal/src/components/GlboalModal.d.ts +251 -0
- package/es/modules/global-modal/src/components/GlboalModal.mjs +40 -0
- package/es/modules/global-modal/src/components/ModalClose.css +95 -0
- package/es/modules/global-modal/src/components/ModalClose.vue.d.ts +27 -0
- package/es/modules/global-modal/src/components/ModalClose.vue.mjs +79 -0
- package/es/modules/global-modal/src/components/ModalClose.vue3.mjs +6 -0
- package/es/modules/global-modal/src/components/ModalFooter.vue.d.ts +270 -0
- package/es/modules/global-modal/src/components/ModalFooter.vue.mjs +44 -0
- package/es/modules/global-modal/src/components/ModalFooter.vue2.mjs +5 -0
- package/es/modules/global-modal/src/components/ModalHeader.vue.d.ts +17 -0
- package/es/modules/global-modal/src/components/ModalHeader.vue.mjs +11 -0
- package/es/modules/global-modal/src/components/ModalHeader.vue2.mjs +13 -0
- package/es/modules/global-modal/src/components/ModalWrapper.vue.d.ts +95 -0
- package/es/modules/global-modal/src/components/ModalWrapper.vue.mjs +26 -0
- package/es/modules/global-modal/src/components/ModalWrapper.vue2.mjs +136 -0
- package/es/modules/global-modal/src/hooks/useModal.d.ts +6 -0
- package/es/modules/global-modal/src/hooks/useModal.mjs +120 -0
- package/es/modules/global-modal/src/hooks/useModalContext.d.ts +5 -0
- package/es/modules/global-modal/src/hooks/useModalContext.mjs +11 -0
- package/es/modules/global-modal/src/hooks/useModalDrag.d.ts +7 -0
- package/es/modules/global-modal/src/hooks/useModalDrag.mjs +82 -0
- package/es/modules/global-modal/src/hooks/useModalFullScreen.d.ts +11 -0
- package/es/modules/global-modal/src/hooks/useModalFullScreen.mjs +16 -0
- package/es/modules/global-modal/src/index.css +153 -0
- package/es/modules/global-modal/src/props.d.ts +156 -0
- package/es/modules/global-modal/src/props.mjs +57 -0
- package/es/modules/global-modal/src/typing.d.ts +174 -0
- package/es/modules/target-loading/index.d.ts +4 -0
- package/es/modules/target-loading/src/createLoading.d.ts +13 -0
- package/es/modules/target-loading/src/createLoading.mjs +57 -0
- package/es/modules/target-loading/src/target-loading.css +18 -0
- package/es/modules/target-loading/src/target-loading.vue.d.ts +57 -0
- package/es/modules/target-loading/src/target-loading.vue.mjs +52 -0
- package/es/modules/target-loading/src/target-loading.vue3.mjs +7 -0
- package/es/modules/target-loading/src/typing.d.ts +9 -0
- package/es/modules/target-loading/src/useLoading.d.ts +9 -0
- package/es/setup-app.d.ts +1 -0
- package/es/setup-app.mjs +4 -0
- package/es/types/index.d.ts +190 -0
- package/es/utils/index.d.ts +4 -1
- package/es/utils/message-util/message-util.d.ts +7 -0
- package/es/utils/message-util/message-util.mjs +26 -0
- package/es/utils/monaco-loader/monaco-loader.d.ts +59 -0
- package/es/utils/monaco-loader/monaco-loader.mjs +88 -0
- package/es/utils/overlay-controller/overlay-controller.d.ts +18 -0
- package/es/utils/overlay-controller/overlay-controller.mjs +23 -0
- package/es/widgets/gct-edit-form/gct-edit-form.d.ts +1 -1
- package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.d.ts +1 -1
- package/package.json +14 -6
package/es/types/index.d.ts
CHANGED
|
@@ -1 +1,191 @@
|
|
|
1
1
|
import '@gct-paas/core/types';
|
|
2
|
+
import type { CSSProperties, VNode } from 'vue';
|
|
3
|
+
import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
|
|
4
|
+
import type { ModalWrapperProps } from '@/modules/global-modal';
|
|
5
|
+
|
|
6
|
+
declare module '@gct-paas/core' {
|
|
7
|
+
interface IModalOptions {
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @default true
|
|
12
|
+
* @author zhanghanrui
|
|
13
|
+
* @date 2024-03-20 10:03:05
|
|
14
|
+
* @type {boolean}
|
|
15
|
+
*/
|
|
16
|
+
scrollTop?: boolean;
|
|
17
|
+
height?: number | string;
|
|
18
|
+
minHeight?: number;
|
|
19
|
+
/**
|
|
20
|
+
* open drag
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
* @author zhanghanrui
|
|
24
|
+
* @date 2024-03-20 10:03:18
|
|
25
|
+
* @type {boolean}
|
|
26
|
+
*/
|
|
27
|
+
draggable?: boolean;
|
|
28
|
+
centered?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @default sys.cancelText
|
|
32
|
+
* @author zhanghanrui
|
|
33
|
+
* @date 2024-03-20 10:03:39
|
|
34
|
+
* @type {string}
|
|
35
|
+
*/
|
|
36
|
+
cancelText?: string;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @default sys.okText
|
|
40
|
+
* @author zhanghanrui
|
|
41
|
+
* @date 2024-03-20 10:03:23
|
|
42
|
+
* @type {string}
|
|
43
|
+
*/
|
|
44
|
+
okText?: string;
|
|
45
|
+
|
|
46
|
+
closeFunc?: () => Promise<boolean>;
|
|
47
|
+
defaultFullscreen?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Can it be full screen
|
|
50
|
+
*
|
|
51
|
+
* @default true
|
|
52
|
+
* @author zhanghanrui
|
|
53
|
+
* @date 2024-03-20 10:03:48
|
|
54
|
+
* @type {boolean}
|
|
55
|
+
*/
|
|
56
|
+
canFullscreen?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* After enabling the wrapper, the bottom can be increased in height
|
|
59
|
+
*
|
|
60
|
+
* @default 0
|
|
61
|
+
* @author zhanghanrui
|
|
62
|
+
* @date 2024-03-20 10:03:06
|
|
63
|
+
* @type number
|
|
64
|
+
*/
|
|
65
|
+
wrapperFooterOffset?: number;
|
|
66
|
+
// Warm reminder message
|
|
67
|
+
helpMessage?: string | string[];
|
|
68
|
+
/**
|
|
69
|
+
* Whether to setting wrapper
|
|
70
|
+
*
|
|
71
|
+
* @default true
|
|
72
|
+
* @author zhanghanrui
|
|
73
|
+
* @date 2024-03-20 10:03:35
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
*/
|
|
76
|
+
useWrapper?: boolean;
|
|
77
|
+
loading?: boolean;
|
|
78
|
+
loadingTip?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Show close button
|
|
81
|
+
*
|
|
82
|
+
* @default true
|
|
83
|
+
* @author zhanghanrui
|
|
84
|
+
* @date 2024-03-20 10:03:55
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
*/
|
|
87
|
+
showCancelBtn?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* 显示关闭按钮
|
|
90
|
+
*
|
|
91
|
+
* @default true
|
|
92
|
+
* @author zhanghanrui
|
|
93
|
+
* @date 2024-06-04 09:06:11
|
|
94
|
+
* @type {boolean}
|
|
95
|
+
*/
|
|
96
|
+
showCloseBtn?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Show confirmation button
|
|
99
|
+
*
|
|
100
|
+
* @default true
|
|
101
|
+
* @author zhanghanrui
|
|
102
|
+
* @date 2024-03-20 10:03:06
|
|
103
|
+
* @type {boolean}
|
|
104
|
+
*/
|
|
105
|
+
showOkBtn?: boolean;
|
|
106
|
+
|
|
107
|
+
wrapperProps?: Partial<ModalWrapperProps>;
|
|
108
|
+
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
110
|
+
afterClose?: Function;
|
|
111
|
+
|
|
112
|
+
bodyStyle?: CSSProperties;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* @default true
|
|
117
|
+
* @author zhanghanrui
|
|
118
|
+
* @date 2024-03-20 10:03:21
|
|
119
|
+
* @type {boolean}
|
|
120
|
+
*/
|
|
121
|
+
closable?: boolean;
|
|
122
|
+
|
|
123
|
+
closeIcon?: VNode;
|
|
124
|
+
|
|
125
|
+
confirmLoading?: boolean;
|
|
126
|
+
|
|
127
|
+
destroyOnClose?: boolean;
|
|
128
|
+
|
|
129
|
+
footer?: VNode;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @default true
|
|
134
|
+
* @author zhanghanrui
|
|
135
|
+
* @date 2024-03-20 10:03:34
|
|
136
|
+
* @type {boolean}
|
|
137
|
+
*/
|
|
138
|
+
mask?: boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @default false
|
|
143
|
+
* @author zhanghanrui
|
|
144
|
+
* @date 2024-03-20 10:03:51
|
|
145
|
+
* @type {boolean}
|
|
146
|
+
*/
|
|
147
|
+
maskClosable?: boolean;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
*
|
|
151
|
+
* @default true
|
|
152
|
+
* @author zhanghanrui
|
|
153
|
+
* @date 2024-03-20 10:03:56
|
|
154
|
+
* @type {boolean}
|
|
155
|
+
*/
|
|
156
|
+
keyboard?: boolean;
|
|
157
|
+
|
|
158
|
+
maskStyle?: CSSProperties;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
*
|
|
162
|
+
* @default 'primary'
|
|
163
|
+
* @author zhanghanrui
|
|
164
|
+
* @date 2024-03-20 10:03:48
|
|
165
|
+
* @type string
|
|
166
|
+
*/
|
|
167
|
+
okType?: string;
|
|
168
|
+
|
|
169
|
+
okButtonProps?: ButtonProps;
|
|
170
|
+
|
|
171
|
+
cancelButtonProps?: ButtonProps;
|
|
172
|
+
|
|
173
|
+
title?: string;
|
|
174
|
+
|
|
175
|
+
width?: string | number;
|
|
176
|
+
|
|
177
|
+
wrapClassName?: string;
|
|
178
|
+
|
|
179
|
+
zIndex?: number;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 是否显示底部
|
|
183
|
+
*
|
|
184
|
+
* @default true
|
|
185
|
+
* @author zhanghanrui
|
|
186
|
+
* @date 2024-04-07 18:04:17
|
|
187
|
+
* @type {boolean}
|
|
188
|
+
*/
|
|
189
|
+
showFooter?: boolean;
|
|
190
|
+
}
|
|
191
|
+
}
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { MessageUtil } from './message-util/message-util';
|
|
2
|
+
export * from './monaco-loader/monaco-loader';
|
|
3
|
+
export { OverlayController, overlay, } from './overlay-controller/overlay-controller';
|
|
4
|
+
export { withInstall, type CustomComponent, type WithInstall, } from './with-install';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IMessageParams, IMessageUtil } from '@gct-paas/core';
|
|
2
|
+
export declare class MessageUtil implements IMessageUtil {
|
|
3
|
+
info(msg: string, params?: IMessageParams): Promise<void>;
|
|
4
|
+
success(msg: string, params?: IMessageParams): Promise<void>;
|
|
5
|
+
warning(msg: string, params?: IMessageParams): Promise<void>;
|
|
6
|
+
error(msg: string, params?: IMessageParams): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { message } from 'ant-design-vue';
|
|
2
|
+
|
|
3
|
+
class MessageUtil {
|
|
4
|
+
info(msg, params) {
|
|
5
|
+
return new Promise((resolve) => {
|
|
6
|
+
message.info(msg, params?.duration, resolve);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
success(msg, params) {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
message.success(msg, params?.duration, resolve);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
warning(msg, params) {
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
message.warning(msg, params?.duration, resolve);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
error(msg, params) {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
message.error(msg, params?.duration, resolve);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { MessageUtil };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monaco Editor 懒加载工具
|
|
3
|
+
* 统一管理 Monaco Editor 的加载和配置
|
|
4
|
+
* 使用 @monaco-editor/loader 实现按需加载
|
|
5
|
+
*/
|
|
6
|
+
import type * as Monaco from 'monaco-editor';
|
|
7
|
+
/**
|
|
8
|
+
* Monaco Editor 加载器类
|
|
9
|
+
* 单例模式,统一管理 Monaco Editor 的加载和配置
|
|
10
|
+
*/
|
|
11
|
+
declare class MonacoLoader {
|
|
12
|
+
private _monacoInstance;
|
|
13
|
+
private _loadingPromise;
|
|
14
|
+
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* 配置 Monaco Editor 加载器
|
|
17
|
+
*/
|
|
18
|
+
private _configureLoader;
|
|
19
|
+
/**
|
|
20
|
+
* 加载 Monaco Editor
|
|
21
|
+
* 返回 Monaco Editor 的实例
|
|
22
|
+
* 该函数会缓存加载结果,多次调用只会加载一次
|
|
23
|
+
*/
|
|
24
|
+
loadMonaco(): Promise<typeof Monaco>;
|
|
25
|
+
/**
|
|
26
|
+
* 获取已加载的 Monaco 实例
|
|
27
|
+
* 如果尚未加载,返回 null
|
|
28
|
+
*/
|
|
29
|
+
getMonaco(): typeof Monaco | null;
|
|
30
|
+
/**
|
|
31
|
+
* 判断 Monaco 是否已加载
|
|
32
|
+
*/
|
|
33
|
+
isMonacoLoaded(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 创建 Monaco Editor 实例的辅助函数
|
|
36
|
+
* @param container DOM 容器
|
|
37
|
+
* @param options 编辑器配置选项
|
|
38
|
+
*/
|
|
39
|
+
createMonacoEditor(container: HTMLElement, options?: Monaco.editor.IStandaloneEditorConstructionOptions): Promise<Monaco.editor.IStandaloneCodeEditor>;
|
|
40
|
+
/**
|
|
41
|
+
* 创建 Monaco Diff Editor 实例的辅助函数
|
|
42
|
+
* @param container DOM 容器
|
|
43
|
+
* @param options 编辑器配置选项
|
|
44
|
+
*/
|
|
45
|
+
createMonacoDiffEditor(container: HTMLElement, options?: Monaco.editor.IStandaloneDiffEditorConstructionOptions): Promise<Monaco.editor.IStandaloneDiffEditor>;
|
|
46
|
+
/**
|
|
47
|
+
* 创建 Monaco Model 的辅助函数
|
|
48
|
+
* @param value 文本内容
|
|
49
|
+
* @param language 语言类型
|
|
50
|
+
* @param uri 资源标识符
|
|
51
|
+
*/
|
|
52
|
+
createMonacoModel(value: string, language?: string, uri?: Monaco.Uri): Promise<Monaco.editor.ITextModel>;
|
|
53
|
+
}
|
|
54
|
+
export declare const monacoLoader: MonacoLoader;
|
|
55
|
+
export type { Monaco };
|
|
56
|
+
export type IMonacoLoader = MonacoLoader;
|
|
57
|
+
export type IMonacoEditor = Monaco.editor.IStandaloneCodeEditor;
|
|
58
|
+
export type IMonacoDiffEditor = Monaco.editor.IStandaloneDiffEditor;
|
|
59
|
+
export type IMonacoITextModel = Monaco.editor.ITextModel;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import loader from '@monaco-editor/loader';
|
|
2
|
+
|
|
3
|
+
class MonacoLoader {
|
|
4
|
+
// Monaco Editor 实例缓存
|
|
5
|
+
_monacoInstance = null;
|
|
6
|
+
// 加载状态
|
|
7
|
+
_loadingPromise = null;
|
|
8
|
+
constructor() {
|
|
9
|
+
this._configureLoader();
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 配置 Monaco Editor 加载器
|
|
13
|
+
*/
|
|
14
|
+
_configureLoader() {
|
|
15
|
+
loader.config({
|
|
16
|
+
paths: {
|
|
17
|
+
vs: location.origin + "/extras/monaco-editor/0.55.1/min/vs"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 加载 Monaco Editor
|
|
23
|
+
* 返回 Monaco Editor 的实例
|
|
24
|
+
* 该函数会缓存加载结果,多次调用只会加载一次
|
|
25
|
+
*/
|
|
26
|
+
async loadMonaco() {
|
|
27
|
+
if (this._monacoInstance) {
|
|
28
|
+
return this._monacoInstance;
|
|
29
|
+
}
|
|
30
|
+
if (this._loadingPromise) {
|
|
31
|
+
return this._loadingPromise;
|
|
32
|
+
}
|
|
33
|
+
this._loadingPromise = loader.init();
|
|
34
|
+
try {
|
|
35
|
+
this._monacoInstance = await this._loadingPromise;
|
|
36
|
+
console.info("✓ Monaco Editor loaded successfully");
|
|
37
|
+
return this._monacoInstance;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error("✗ Failed to load Monaco Editor:", error);
|
|
40
|
+
this._loadingPromise = null;
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 获取已加载的 Monaco 实例
|
|
46
|
+
* 如果尚未加载,返回 null
|
|
47
|
+
*/
|
|
48
|
+
getMonaco() {
|
|
49
|
+
return this._monacoInstance;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 判断 Monaco 是否已加载
|
|
53
|
+
*/
|
|
54
|
+
isMonacoLoaded() {
|
|
55
|
+
return this._monacoInstance !== null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 创建 Monaco Editor 实例的辅助函数
|
|
59
|
+
* @param container DOM 容器
|
|
60
|
+
* @param options 编辑器配置选项
|
|
61
|
+
*/
|
|
62
|
+
async createMonacoEditor(container, options) {
|
|
63
|
+
const monaco = await this.loadMonaco();
|
|
64
|
+
return monaco.editor.create(container, options);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 创建 Monaco Diff Editor 实例的辅助函数
|
|
68
|
+
* @param container DOM 容器
|
|
69
|
+
* @param options 编辑器配置选项
|
|
70
|
+
*/
|
|
71
|
+
async createMonacoDiffEditor(container, options) {
|
|
72
|
+
const monaco = await this.loadMonaco();
|
|
73
|
+
return monaco.editor.createDiffEditor(container, options);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 创建 Monaco Model 的辅助函数
|
|
77
|
+
* @param value 文本内容
|
|
78
|
+
* @param language 语言类型
|
|
79
|
+
* @param uri 资源标识符
|
|
80
|
+
*/
|
|
81
|
+
async createMonacoModel(value, language, uri) {
|
|
82
|
+
const monaco = await this.loadMonaco();
|
|
83
|
+
return monaco.editor.createModel(value, language, uri);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const monacoLoader = new MonacoLoader();
|
|
87
|
+
|
|
88
|
+
export { monacoLoader };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IModalData, IModalOptions, IOverlayContainer, IOverlayController } from '@gct-paas/core';
|
|
2
|
+
/**
|
|
3
|
+
* 用不同呈现方式绘制组件的通用工具类
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-03-19 19:03:34
|
|
7
|
+
* @export
|
|
8
|
+
* @class OverlayController
|
|
9
|
+
* @implements {IOverlayController}
|
|
10
|
+
*/
|
|
11
|
+
export declare class OverlayController implements IOverlayController {
|
|
12
|
+
modal<T = IModalData>(component: unknown, props?: IParams, opts?: IModalOptions): Promise<T>;
|
|
13
|
+
createModal(component: unknown, props?: IParams, opts?: IModalOptions): IOverlayContainer;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 唯一界面绘制控制器
|
|
17
|
+
*/
|
|
18
|
+
export declare const overlay: OverlayController;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isFunction, isString } from 'lodash-es';
|
|
2
|
+
import { h, resolveComponent } from 'vue';
|
|
3
|
+
import { createModal } from '../../components/app-modal/app-modal-component.mjs';
|
|
4
|
+
|
|
5
|
+
function resolveComponentOrStr(component) {
|
|
6
|
+
return isString(component) ? resolveComponent(component) : component;
|
|
7
|
+
}
|
|
8
|
+
class OverlayController {
|
|
9
|
+
async modal(component, props, opts) {
|
|
10
|
+
const modal = this.createModal(component, props, opts);
|
|
11
|
+
modal.present();
|
|
12
|
+
return modal.onWillDismiss();
|
|
13
|
+
}
|
|
14
|
+
createModal(component, props, opts) {
|
|
15
|
+
return createModal(
|
|
16
|
+
isFunction(component) ? component : () => h(resolveComponentOrStr(component), { ...props }),
|
|
17
|
+
opts
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const overlay = new OverlayController();
|
|
22
|
+
|
|
23
|
+
export { OverlayController, overlay };
|
|
@@ -56,7 +56,7 @@ export declare const GctEditForm: import('vue').DefineComponent<import('vue').Ex
|
|
|
56
56
|
}>> & Readonly<{
|
|
57
57
|
"onUpdate:data"?: ((...args: any[]) => any) | undefined;
|
|
58
58
|
}>, {
|
|
59
|
-
embed: boolean;
|
|
60
59
|
context: IParams;
|
|
60
|
+
embed: boolean;
|
|
61
61
|
params: IParams;
|
|
62
62
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -17,7 +17,7 @@ export declare const GctFormCollapse: import('vue').DefineComponent<import('vue'
|
|
|
17
17
|
keys: import('vue').Ref<number[], number[]>;
|
|
18
18
|
style: IParams;
|
|
19
19
|
activeKeys: import('vue').Ref<string[], string[]>;
|
|
20
|
-
expandIconPosition: import('vue').ComputedRef<"
|
|
20
|
+
expandIconPosition: import('vue').ComputedRef<"right" | "left">;
|
|
21
21
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
22
22
|
c: {
|
|
23
23
|
type: PropType<IFormCollapseController>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core-web",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台网页端核心包",
|
|
6
6
|
"main": "dist/index.min.cjs",
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
"types": "./es/index.d.ts",
|
|
13
13
|
"import": "./es/index.mjs",
|
|
14
14
|
"require": "./dist/index.min.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./types": {
|
|
17
|
+
"types": "./es/types/index.d.ts"
|
|
15
18
|
}
|
|
16
19
|
},
|
|
17
20
|
"files": [
|
|
@@ -46,21 +49,26 @@
|
|
|
46
49
|
},
|
|
47
50
|
"dependencies": {
|
|
48
51
|
"@ant-design/icons-vue": "^7.0.1",
|
|
49
|
-
"@gct-paas/core": "0.1.4-dev.
|
|
50
|
-
"@gct-paas/scss": "0.1.4-dev.
|
|
52
|
+
"@gct-paas/core": "0.1.4-dev.9",
|
|
53
|
+
"@gct-paas/scss": "0.1.4-dev.9",
|
|
51
54
|
"@monaco-editor/loader": "^1.7.0",
|
|
55
|
+
"@vueuse/core": "^14.1.0",
|
|
52
56
|
"ant-design-vue": "3.2.20",
|
|
53
57
|
"lodash-es": "^4.17.23",
|
|
54
58
|
"monaco-editor": "^0.55.1",
|
|
59
|
+
"overlayscrollbars": "^2.14.0",
|
|
60
|
+
"overlayscrollbars-vue": "^0.5.9",
|
|
61
|
+
"react-dnd-html5-backend": "^16.0.1",
|
|
62
|
+
"sql-formatter": "^15.7.2",
|
|
55
63
|
"vue": "3.5.27",
|
|
56
|
-
"vue3-colorpicker": "^2.3.0",
|
|
57
64
|
"vue3-dnd": "^2.1.0"
|
|
58
65
|
},
|
|
59
66
|
"devDependencies": {
|
|
60
|
-
"@gct-paas/build": "^0.1.5-dev.
|
|
67
|
+
"@gct-paas/build": "^0.1.5-dev.8",
|
|
68
|
+
"vue-tsc": "^3.2.5"
|
|
61
69
|
},
|
|
62
70
|
"peerDependencies": {
|
|
63
71
|
"vue": "^3.x"
|
|
64
72
|
},
|
|
65
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "c51d9883f7d287433d2def4d7338a06773804fbf"
|
|
66
74
|
}
|