@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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { useNamespace } from '@gct-paas/core';
|
|
3
|
+
import './view-container.css';/* empty css */
|
|
4
|
+
|
|
5
|
+
const ViewContainer = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: 'ViewContainer',
|
|
7
|
+
props: {
|
|
8
|
+
context: {
|
|
9
|
+
type: Object
|
|
10
|
+
},
|
|
11
|
+
params: {
|
|
12
|
+
type: Object
|
|
13
|
+
},
|
|
14
|
+
modal: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup() {
|
|
20
|
+
const ns = useNamespace('view-container');
|
|
21
|
+
return {
|
|
22
|
+
ns
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
render() {
|
|
26
|
+
return createVNode("div", {
|
|
27
|
+
"class": this.ns.b()
|
|
28
|
+
}, [this.$slots.header ? createVNode("div", {
|
|
29
|
+
"class": this.ns.b('header')
|
|
30
|
+
}, [this.$slots.header()]) : null, createVNode("div", {
|
|
31
|
+
"class": this.ns.b('content')
|
|
32
|
+
}, [this.$slots.default?.()]), this.$slots.footer ? createVNode("div", {
|
|
33
|
+
"class": this.ns.b('footer')
|
|
34
|
+
}, [this.$slots.footer()]) : null]);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { ViewContainer };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/* stylelint-disable scss/no-global-function-names */
|
|
3
|
+
/* bem('block', 'element', 'modifier') => 'ibiz-block__element--modifier' */
|
|
4
|
+
/**
|
|
5
|
+
* 定义 Block 块
|
|
6
|
+
* @param {String} $block - Block 块名称
|
|
7
|
+
* @example
|
|
8
|
+
* @include b('button') {
|
|
9
|
+
* padding: 10px;
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 定义 Element 元素
|
|
14
|
+
* @param {String|List} $element - Element 元素名称,支持单个或多个
|
|
15
|
+
* @example
|
|
16
|
+
* @include b('button') {
|
|
17
|
+
* @include e('text') {
|
|
18
|
+
* color: #000;
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* // 或传入多个元素
|
|
22
|
+
* @include b('button') {
|
|
23
|
+
* @include e(('text', 'icon')) {
|
|
24
|
+
* margin: 5px;
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* 定义 Modifier 修饰符
|
|
30
|
+
* @param {String|List} $modifier - Modifier 修饰符名称,支持单个或多个
|
|
31
|
+
* @example
|
|
32
|
+
* @include b('button') {
|
|
33
|
+
* @include m('primary') {
|
|
34
|
+
* background: blue;
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* // 或传入多个修饰符
|
|
38
|
+
* @include b('button') {
|
|
39
|
+
* @include m(('primary', 'large')) {
|
|
40
|
+
* background: blue;
|
|
41
|
+
* font-size: 16px;
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* 定义状态选择器
|
|
47
|
+
* @param {String} $state - 状态名称
|
|
48
|
+
* @example
|
|
49
|
+
* @include b('button') {
|
|
50
|
+
* @include when('disabled') {
|
|
51
|
+
* opacity: 0.5;
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* 深色主题样式
|
|
57
|
+
* @param {String} $block - Block 块名称
|
|
58
|
+
* @example
|
|
59
|
+
* @include dark('button') {
|
|
60
|
+
* background: #333;
|
|
61
|
+
* color: #fff;
|
|
62
|
+
* }
|
|
63
|
+
*/
|
|
64
|
+
/* stylelint-disable scss/no-global-function-names */
|
|
65
|
+
.gct-svg-icon {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
fill: currentcolor;
|
|
69
|
+
vertical-align: -0.15em;
|
|
70
|
+
}
|
|
71
|
+
.gct-svg-icon--spin {
|
|
72
|
+
animation: loadingCircle 1s infinite linear;
|
|
73
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
prefix: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
name: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
size: {
|
|
11
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
12
|
+
default: number;
|
|
13
|
+
};
|
|
14
|
+
spin: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
19
|
+
prefix: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
name: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
size: {
|
|
28
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
spin: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {
|
|
36
|
+
size: string | number;
|
|
37
|
+
spin: boolean;
|
|
38
|
+
prefix: string;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, normalizeClass, unref, createElementVNode } from 'vue';
|
|
2
|
+
import { useNamespace } from '@gct-paas/core';
|
|
3
|
+
|
|
4
|
+
const _hoisted_1 = ["xlink:href"];
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "svg-icon",
|
|
7
|
+
props: {
|
|
8
|
+
prefix: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "icon"
|
|
11
|
+
},
|
|
12
|
+
name: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
default: 16
|
|
19
|
+
},
|
|
20
|
+
spin: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(__props) {
|
|
26
|
+
const ns = useNamespace("svg-icon");
|
|
27
|
+
const props = __props;
|
|
28
|
+
const symbolId = computed(() => `#${props.prefix}-${props.name}`);
|
|
29
|
+
const getStyle = computed(() => {
|
|
30
|
+
const { size } = props;
|
|
31
|
+
let s = `${size}`;
|
|
32
|
+
s = `${s.replace("px", "")}px`;
|
|
33
|
+
return {
|
|
34
|
+
width: s,
|
|
35
|
+
height: s
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return (_ctx, _cache) => {
|
|
39
|
+
return openBlock(), createElementBlock("svg", {
|
|
40
|
+
class: normalizeClass([_ctx.$attrs.class, unref(ns).b(), __props.spin && unref(ns).m("spin")]),
|
|
41
|
+
style: normalizeStyle(getStyle.value),
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
}, [
|
|
44
|
+
createElementVNode("use", { "xlink:href": symbolId.value }, null, 8, _hoisted_1)
|
|
45
|
+
], 6);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OverlayScrollbarsComponent } from 'overlayscrollbars-vue';
|
|
2
|
+
import Comps from './components/index.mjs';
|
|
3
|
+
import * as Icons from '@ant-design/icons-vue';
|
|
4
|
+
import { setupDirectives } from './directives/index.mjs';
|
|
5
|
+
import ColorPicker from './modules/color-picker/src/ColorPicker.vue.mjs';
|
|
6
|
+
|
|
7
|
+
async function coreWebCreateAppVue(app) {
|
|
8
|
+
setupDirectives(app);
|
|
9
|
+
app.use(Comps);
|
|
10
|
+
Object.entries(Icons).forEach(([key, component]) => {
|
|
11
|
+
app.component(key, component);
|
|
12
|
+
});
|
|
13
|
+
app.component(ColorPicker.name, ColorPicker);
|
|
14
|
+
app.component(OverlayScrollbarsComponent.__name, OverlayScrollbarsComponent);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { coreWebCreateAppVue };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const dragResizeDirective = {
|
|
2
|
+
mounted(el, binding) {
|
|
3
|
+
if (!binding.value) return false;
|
|
4
|
+
binding.instance?.$nextTick(() => {
|
|
5
|
+
const minWidth = binding.value;
|
|
6
|
+
const dragDom = el;
|
|
7
|
+
const resizeElL = document.createElement("div");
|
|
8
|
+
dragDom.appendChild(resizeElL);
|
|
9
|
+
resizeElL.style.cursor = "col-resize";
|
|
10
|
+
resizeElL.style.position = "absolute";
|
|
11
|
+
resizeElL.style.height = "100%";
|
|
12
|
+
resizeElL.style.width = "5px";
|
|
13
|
+
resizeElL.style.right = "0px";
|
|
14
|
+
resizeElL.style.top = "0px";
|
|
15
|
+
resizeElL.style.background = "rgba(255, 0, 0, 0);";
|
|
16
|
+
resizeElL.onmousedown = (e) => {
|
|
17
|
+
const elW = dragDom.clientWidth;
|
|
18
|
+
const clientX = e.clientX;
|
|
19
|
+
document.onmousemove = function(e2) {
|
|
20
|
+
e2.preventDefault();
|
|
21
|
+
const l = e2.clientX - clientX;
|
|
22
|
+
let nw = elW + l;
|
|
23
|
+
nw = nw < minWidth ? minWidth : nw;
|
|
24
|
+
dragDom.setAttribute("style", `width:${nw}px !important;`);
|
|
25
|
+
const resizeEvent = new CustomEvent("drag-resize-width", {
|
|
26
|
+
detail: { width: nw, resizing: true }
|
|
27
|
+
});
|
|
28
|
+
el.dispatchEvent(resizeEvent);
|
|
29
|
+
};
|
|
30
|
+
document.onmouseup = function() {
|
|
31
|
+
document.onmousemove = null;
|
|
32
|
+
document.onmouseup = null;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function setupDragResizeDirective(app) {
|
|
39
|
+
app.directive("dragResize", dragResizeDirective);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { setupDragResizeDirective };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import '../modules/target-loading/src/target-loading.vue.mjs';
|
|
2
|
+
import '../modules/target-loading/src/target-loading.css';/* empty css */
|
|
3
|
+
import 'vue';
|
|
4
|
+
import { createLoading } from '../modules/target-loading/src/createLoading.mjs';
|
|
5
|
+
|
|
6
|
+
const loadingDirective = {
|
|
7
|
+
mounted(el, binding) {
|
|
8
|
+
const tip = el.getAttribute("loading-tip");
|
|
9
|
+
const background = el.getAttribute("loading-background");
|
|
10
|
+
const size = el.getAttribute("loading-size");
|
|
11
|
+
const fullscreen = !!binding.modifiers.fullscreen;
|
|
12
|
+
const instance = createLoading(
|
|
13
|
+
{
|
|
14
|
+
tip,
|
|
15
|
+
background,
|
|
16
|
+
size: size || "large",
|
|
17
|
+
loading: !!binding.value,
|
|
18
|
+
absolute: !fullscreen
|
|
19
|
+
},
|
|
20
|
+
fullscreen ? document.body : el
|
|
21
|
+
);
|
|
22
|
+
el.instance = instance;
|
|
23
|
+
},
|
|
24
|
+
updated(el, binding) {
|
|
25
|
+
const instance = el.instance;
|
|
26
|
+
if (!instance) return;
|
|
27
|
+
instance.setTip(el.getAttribute("loading-tip"));
|
|
28
|
+
if (binding.oldValue !== binding.value) {
|
|
29
|
+
instance.setLoading?.(binding.value && !instance.loading);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
unmounted(el) {
|
|
33
|
+
el?.instance?.close();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function setupLoadingDirective(app) {
|
|
37
|
+
app.directive("target-loading", loadingDirective);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { setupLoadingDirective };
|
package/es/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { COLUMNS_TYPE } from '@gct-paas/core';
|
|
2
|
+
export declare function UseDragByLine(startValue: number, rowType: COLUMNS_TYPE, config?: IObject): {
|
|
3
|
+
moveDomDown: (event: MouseEvent, el: HTMLElement, onMouseUp?: () => void) => void;
|
|
4
|
+
moveMobileDomDown: (event: TouchEvent, el: HTMLElement, onTouchEnd?: () => void) => void;
|
|
5
|
+
start: import('vue').WritableComputedRef<any, any>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ref, reactive, computed } from 'vue';
|
|
2
|
+
import '@gct-paas/core';
|
|
3
|
+
|
|
4
|
+
function UseDragByLine(startValue, rowType, config = {}) {
|
|
5
|
+
const minValue = config.minValue ?? 10;
|
|
6
|
+
const startMove = ref(startValue);
|
|
7
|
+
const dragData = reactive({
|
|
8
|
+
offset: "offsetWidth",
|
|
9
|
+
client: "clientX",
|
|
10
|
+
clientMove: 0,
|
|
11
|
+
rowType,
|
|
12
|
+
offsetWidth: 2e3
|
|
13
|
+
});
|
|
14
|
+
function moveDomDown(event, el, onMouseUp) {
|
|
15
|
+
const elRecord = el;
|
|
16
|
+
const eventRecord = event;
|
|
17
|
+
dragData.offsetWidth = elRecord[dragData.offset] ?? 0;
|
|
18
|
+
dragData.clientMove = eventRecord[dragData.client] ?? 0;
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
document.onmousemove = (e) => {
|
|
21
|
+
moveHandle(
|
|
22
|
+
e[dragData.client] ?? 0
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
document.onmouseup = () => {
|
|
26
|
+
document.onmouseup = null;
|
|
27
|
+
document.onmousemove = null;
|
|
28
|
+
onMouseUp?.();
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function moveMobileDomDown(event, el, onTouchEnd) {
|
|
32
|
+
const elRecord = el;
|
|
33
|
+
const touch = event.touches[0];
|
|
34
|
+
if (!touch) return;
|
|
35
|
+
dragData.offsetWidth = elRecord[dragData.offset] ?? 0;
|
|
36
|
+
dragData.clientMove = touch[dragData.client] ?? 0;
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
document.ontouchmove = (e) => {
|
|
39
|
+
moveHandle(
|
|
40
|
+
e.touches[0][dragData.client] ?? 0
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
document.ontouchend = () => {
|
|
44
|
+
document.ontouchend = null;
|
|
45
|
+
document.ontouchmove = null;
|
|
46
|
+
onTouchEnd?.();
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function moveHandle(clientX) {
|
|
50
|
+
const computedX = clientX - dragData.clientMove;
|
|
51
|
+
const changeWidth = transformWidth(startMove.value) + computedX;
|
|
52
|
+
startMove.value = transformWidth(changeWidth);
|
|
53
|
+
dragData.clientMove = clientX;
|
|
54
|
+
}
|
|
55
|
+
function transformWidth(width) {
|
|
56
|
+
if (dragData.rowType === "right" || dragData.rowType === "bottom") {
|
|
57
|
+
return dragData.offsetWidth - width;
|
|
58
|
+
} else {
|
|
59
|
+
return width;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const start = computed({
|
|
63
|
+
get() {
|
|
64
|
+
if (startMove.value < minValue) {
|
|
65
|
+
return minValue;
|
|
66
|
+
}
|
|
67
|
+
if (startMove.value > dragData.offsetWidth - minValue) {
|
|
68
|
+
return dragData.offsetWidth - minValue;
|
|
69
|
+
}
|
|
70
|
+
return startMove.value;
|
|
71
|
+
},
|
|
72
|
+
set(v) {
|
|
73
|
+
startMove.value = v;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return { moveDomDown, moveMobileDomDown, start };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { UseDragByLine };
|
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
|
-
import { AssetsSvgIcon, CodeEditor } from './components';
|
|
3
|
-
export declare function install(app: App): void;
|
|
4
1
|
export * from './hooks';
|
|
5
2
|
export * from './utils';
|
|
6
|
-
export
|
|
3
|
+
export * from './modules/code-editor';
|
|
7
4
|
export * from './modules/gct-dnd';
|
|
5
|
+
export * from './modules/global-modal';
|
|
6
|
+
export * from './components';
|
|
7
|
+
export { coreWebCreateAppVue } from './create-app-vue';
|
|
8
|
+
export { coreWebSetupApp } from './setup-app';
|
package/es/index.mjs
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/* empty css */
|
|
7
|
-
import * as Icons from '@ant-design/icons-vue';
|
|
1
|
+
import { MessageUtil } from './utils/message-util/message-util.mjs';
|
|
2
|
+
import './components/svg-icon/svg-icon.css';export { monacoLoader } from './utils/monaco-loader/monaco-loader.mjs';
|
|
3
|
+
import { overlay } from './utils/overlay-controller/overlay-controller.mjs';
|
|
4
|
+
export { OverlayController } from './utils/overlay-controller/overlay-controller.mjs';
|
|
5
|
+
export { withInstall } from './utils/with-install.mjs';
|
|
8
6
|
export { useLocale } from './hooks/useLocale.mjs';
|
|
9
7
|
export { useTheme } from './hooks/useTheme.mjs';
|
|
10
|
-
export {
|
|
8
|
+
export { UseDragByLine } from './hooks/useDragLine.mjs';
|
|
9
|
+
export { MonacoEditor } from './modules/code-editor/index.mjs';
|
|
11
10
|
export { GctDndContainer } from './modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.mjs';
|
|
12
11
|
export { GctDndDropLine } from './modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.mjs';
|
|
13
12
|
export { GctDndItem } from './modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.mjs';
|
|
14
13
|
export { GCT_DND_INSERT_POS } from './modules/gct-dnd/constants/index.mjs';
|
|
14
|
+
export { BasicModal } from './modules/global-modal/index.mjs';
|
|
15
|
+
export { default as SvgIcon } from './components/svg-icon/svg-icon.vue.mjs';
|
|
16
|
+
/* empty css */
|
|
17
|
+
export { AssetsSvgIcon } from './components/assets-svg-icon/assets-svg-icon.mjs';
|
|
18
|
+
export { default as BaseButton } from './components/base-button/base-button.vue.mjs';
|
|
19
|
+
export { default as BasicButton } from './components/basic-button/basic-button.vue.mjs';
|
|
20
|
+
export { CodeEditor } from './components/code-editor/code-editor.mjs';
|
|
21
|
+
export { FlexContainer } from './components/layout/flex-container/flex-container.mjs';
|
|
22
|
+
export { FlexItem } from './components/layout/flex-item/flex-item.mjs';
|
|
23
|
+
export { GridContainer } from './components/layout/grid-container/grid-container.mjs';
|
|
24
|
+
export { ViewContainer } from './components/layout/view-container/view-container.mjs';
|
|
25
|
+
export { coreWebCreateAppVue } from './create-app-vue.mjs';
|
|
26
|
+
export { coreWebSetupApp } from './setup-app.mjs';
|
|
27
|
+
export { Lang, Prop, Theme } from './modules/code-editor/useMonacoEditor.mjs';
|
|
28
|
+
export { useEditorConsole, useEditorConsoleInner } from './modules/code-editor/useEditorConsole.mjs';
|
|
29
|
+
export { useModal, useModalInner } from './modules/global-modal/src/hooks/useModal.mjs';
|
|
30
|
+
export { useModalContext } from './modules/global-modal/src/hooks/useModalContext.mjs';
|
|
15
31
|
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
32
|
+
function onInit() {
|
|
33
|
+
_gct.message = new MessageUtil();
|
|
34
|
+
_gct.openUtil = overlay;
|
|
20
35
|
}
|
|
36
|
+
onInit();
|
|
21
37
|
|
|
22
|
-
export {
|
|
38
|
+
export { MessageUtil, overlay };
|