@gct-paas/design 0.1.5-test.2 → 0.1.6-dev.0
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.min.css +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/es/components/design/design-content/design-content.css +76 -0
- package/es/components/design/design-content/design-content.d.ts +190 -0
- package/es/components/design/design-content/design-content.mjs +274 -0
- package/es/components/design/design-drag-item/design-drag-item.css +179 -0
- package/es/components/design/design-drag-item/design-drag-item.d.ts +56 -0
- package/es/components/design/design-drag-item/design-drag-item.mjs +237 -0
- package/es/components/design/design-drop-container/design-drop-container.css +103 -0
- package/es/components/design/design-drop-container/design-drop-container.d.ts +92 -0
- package/es/components/design/design-drop-container/design-drop-container.mjs +182 -0
- package/es/components/design/design-drop-line/design-drop-line.css +165 -0
- package/es/components/design/design-drop-line/design-drop-line.d.ts +73 -0
- package/es/components/design/design-drop-line/design-drop-line.mjs +136 -0
- package/es/components/design/design-item-actions/design-item-actions.css +97 -0
- package/es/components/design/design-item-actions/design-item-actions.d.ts +42 -0
- package/es/components/design/design-item-actions/design-item-actions.mjs +147 -0
- package/es/components/design/design-item-highlighter/design-item-highlighter.css +70 -0
- package/es/components/design/design-item-highlighter/design-item-highlighter.d.ts +168 -0
- package/es/components/design/design-item-highlighter/design-item-highlighter.mjs +155 -0
- package/es/components/design/design-item-highlighter-container/design-item-highlighter-container.css +85 -0
- package/es/components/design/design-item-highlighter-container/design-item-highlighter-container.d.ts +53 -0
- package/es/components/design/design-item-highlighter-container/design-item-highlighter-container.mjs +169 -0
- package/es/components/design/design-item-hover-title/design-item-hover-title.css +12 -0
- package/es/components/design/design-item-hover-title/design-item-hover-title.d.ts +60 -0
- package/es/components/design/design-item-hover-title/design-item-hover-title.mjs +60 -0
- package/es/components/design/design-item-preview/design-item-preview.css +91 -0
- package/es/components/design/design-item-preview/design-item-preview.d.ts +1 -0
- package/es/components/design/design-item-preview/design-item-preview.mjs +32 -0
- package/es/components/design/design-not-drag-item/design-not-drag-item.css +67 -0
- package/es/components/design/design-not-drag-item/design-not-drag-item.d.ts +50 -0
- package/es/components/design/design-not-drag-item/design-not-drag-item.mjs +68 -0
- package/es/components/design/design-not-found/design-not-found.css +68 -0
- package/es/components/design/design-not-found/design-not-found.d.ts +14 -0
- package/es/components/design/design-not-found/design-not-found.mjs +19 -0
- package/es/components/design/index.d.ts +2 -0
- package/es/components/design/index.mjs +2 -0
- package/es/components/design-save-tip/design-save-tip.mjs +1 -1
- package/es/components/editor/index.mjs +2 -0
- package/es/components/editor/length-unit-editor/length-unit-editor.vue.d.ts +13 -0
- package/es/components/editor/length-unit-editor/length-unit-editor.vue.mjs +5 -0
- package/es/components/editor/length-unit-editor/length-unit-editor.vue_vue_type_script_setup_true_name_length-unit-editor_lang.mjs +47 -0
- package/es/components/field-transfer/components/field-transfer-modal.vue.d.ts +5 -1
- package/es/components/field-transfer/components/field-transfer-modal.vue.mjs +2 -2
- package/es/components/field-transfer/components/field-transfer-modal.vue_vue_type_script_setup_true_name_field-transfer-modal_lang.mjs +2 -1
- package/es/components/field-transfer/components/field-transfer-modal.vue_vue_type_style_index_0_scoped_711e6992_lang.css +8 -0
- package/es/components/field-transfer/index.d.ts +2 -0
- package/es/components/field-transfer/index.mjs +1 -0
- package/es/components/index.d.ts +5 -2
- package/es/components/index.mjs +10 -2
- package/es/components/material/index.d.ts +1 -0
- package/es/components/material/index.mjs +1 -0
- package/es/components/material/material-content/material-content.css +86 -0
- package/es/components/material/material-content/material-content.d.ts +1 -0
- package/es/components/material/material-content/material-content.mjs +49 -0
- package/es/components/material/material-module/material-module.css +104 -0
- package/es/components/material/material-module/material-module.d.ts +60 -0
- package/es/components/material/material-module/material-module.mjs +67 -0
- package/es/components/material/material-module-drag-container/material-module-drag-container.css +69 -0
- package/es/components/material/material-module-drag-container/material-module-drag-container.d.ts +56 -0
- package/es/components/material/material-module-drag-container/material-module-drag-container.mjs +21 -0
- package/es/components/material/material-module-drag-item/material-module-drag-item.css +83 -0
- package/es/components/material/material-module-drag-item/material-module-drag-item.d.ts +13 -0
- package/es/components/material/material-module-drag-item/material-module-drag-item.mjs +66 -0
- package/es/components/material/material-outline-tree/material-outline-tree.css +81 -0
- package/es/components/material/material-outline-tree/material-outline-tree.d.ts +13 -0
- package/es/components/material/material-outline-tree/material-outline-tree.mjs +67 -0
- package/es/components/material/material-tab-pane/material-tab-pane.css +68 -0
- package/es/components/material/material-tab-pane/material-tab-pane.d.ts +13 -0
- package/es/components/material/material-tab-pane/material-tab-pane.mjs +19 -0
- package/es/components/material/material-tabs/material-tabs.css +105 -0
- package/es/components/material/material-tabs/material-tabs.d.ts +103 -0
- package/es/components/material/material-tabs/material-tabs.mjs +44 -0
- package/es/components/modal-name-editor/modal-name-editor.d.ts +1 -11
- package/es/components/modal-name-editor/modal-name-editor.mjs +27 -38
- package/es/components/multi-field/index.d.ts +2 -0
- package/es/components/multi-field/index.mjs +1 -0
- package/es/components/multi-field/multi-field-display.vue.d.ts +8 -0
- package/es/components/multi-field/multi-field-display.vue.mjs +7 -0
- package/es/components/multi-field/multi-field-display.vue_vue_type_script_setup_true_lang.mjs +32 -0
- package/es/components/multi-field/multi-field-display.vue_vue_type_style_index_0_scoped_802ade7b_lang.css +4 -0
- package/es/components/multi-field/multi-field-item.vue.d.ts +6 -0
- package/es/components/multi-field/multi-field-item.vue.mjs +7 -0
- package/es/components/multi-field/multi-field-item.vue_vue_type_script_setup_true_lang.mjs +47 -0
- package/es/components/multi-field/multi-field-item.vue_vue_type_style_index_0_scoped_881cb08e_lang.css +31 -0
- package/es/components/panel/index.d.ts +1 -0
- package/es/components/panel/index.mjs +1 -0
- package/es/components/panel/panel-content/panel-content.css +189 -0
- package/es/components/panel/panel-content/panel-content.d.ts +19 -0
- package/es/components/panel/panel-content/panel-content.mjs +48 -0
- package/es/components/panel/panel-form/panel-form.css +67 -0
- package/es/components/panel/panel-form/panel-form.d.ts +62 -0
- package/es/components/panel/panel-form/panel-form.mjs +59 -0
- package/es/components/panel/panel-path/panel-path.css +89 -0
- package/es/components/panel/panel-path/panel-path.d.ts +35 -0
- package/es/components/panel/panel-path/panel-path.mjs +52 -0
- package/es/components/user-occupy/user-occupy.vue.mjs +2 -2
- package/es/components/user-occupy/user-occupy.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/user-occupy/{user-occupy.vue_vue_type_style_index_0_scoped_24cb9749_lang.css → user-occupy.vue_vue_type_style_index_0_scoped_9b136922_lang.css} +6 -6
- package/es/controller/index.d.ts +1 -0
- package/es/controller/index.mjs +1 -0
- package/es/controller/view/design-view.controller.d.ts +48 -0
- package/es/controller/view/design-view.controller.mjs +150 -0
- package/es/create-app-vue.mjs +2 -0
- package/es/editor/content-tag-style/content-tag-style.css +164 -0
- package/es/editor/content-tag-style/content-tag-style.d.ts +112 -0
- package/es/editor/content-tag-style/content-tag-style.mjs +80 -0
- package/es/editor/content-tag-style/index.d.ts +8 -0
- package/es/editor/content-tag-style/index.mjs +11 -0
- package/es/editor/field-info-editor/field-info-editor.css +125 -0
- package/es/editor/field-info-editor/field-info-editor.d.ts +111 -0
- package/es/editor/field-info-editor/field-info-editor.mjs +38 -0
- package/es/editor/field-info-editor/index.d.ts +8 -0
- package/es/editor/field-info-editor/index.mjs +9 -0
- package/es/editor/index.d.ts +5 -0
- package/es/editor/index.mjs +19 -0
- package/es/editor/model-field-select/index.d.ts +8 -0
- package/es/editor/model-field-select/index.mjs +9 -0
- package/es/editor/model-field-select/model-field-select.css +148 -0
- package/es/editor/model-field-select/model-field-select.d.ts +42 -0
- package/es/editor/model-field-select/model-field-select.mjs +217 -0
- package/es/editor/style-border/index.d.ts +4 -0
- package/es/editor/style-border/index.mjs +11 -0
- package/es/editor/style-border/style-border.d.ts +35 -0
- package/es/editor/style-border/style-border.mjs +38 -0
- package/es/editor/style-font/index.d.ts +4 -0
- package/es/editor/style-font/index.mjs +11 -0
- package/es/editor/style-font/style-font.css +86 -0
- package/es/editor/style-font/style-font.d.ts +35 -0
- package/es/editor/style-font/style-font.mjs +36 -0
- package/es/editor/style-position/index.d.ts +4 -0
- package/es/editor/style-position/index.mjs +11 -0
- package/es/editor/style-position/style-position.d.ts +35 -0
- package/es/editor/style-position/style-position.mjs +35 -0
- package/es/editor/style-spacing/index.d.ts +4 -0
- package/es/editor/style-spacing/index.mjs +11 -0
- package/es/editor/style-spacing/style-spacing.d.ts +34 -0
- package/es/editor/style-spacing/style-spacing.mjs +60 -0
- package/es/hooks/design-view/designer/useDesignSave.mjs +3 -1
- package/es/hooks/design-view/layout/useToolkit.mjs +3 -3
- package/es/hooks/index.d.ts +2 -1
- package/es/hooks/index.mjs +3 -2
- package/es/hooks/use-design-view-controller/use-design-view-controller.d.ts +11 -0
- package/es/hooks/use-design-view-controller/use-design-view-controller.mjs +31 -0
- package/es/index.d.ts +5 -2
- package/es/index.mjs +24 -8
- package/es/interface/controller/i-design-view.controller.d.ts +3 -5
- package/es/interface/form-editor/child-list-editor/child-list-editor.d.ts +114 -0
- package/es/interface/form-editor/index.d.ts +9 -0
- package/es/interface/form-editor/style-border/i-style-border.controller.d.ts +11 -0
- package/es/interface/form-editor/style-border/i-style-border.d.ts +22 -0
- package/es/interface/form-editor/style-font/i-style-font.controller.d.ts +11 -0
- package/es/interface/form-editor/style-font/i-style-font.d.ts +13 -0
- package/es/interface/form-editor/style-position/i-style-position.controller.d.ts +11 -0
- package/es/interface/form-editor/style-position/i-style-position.d.ts +13 -0
- package/es/interface/form-editor/style-spacing/i-style-spacing.controller.d.ts +11 -0
- package/es/interface/form-editor/style-spacing/i-style-spacing.d.ts +22 -0
- package/es/interface/index.d.ts +2 -0
- package/es/interface/provider/i-node-provider.d.ts +140 -0
- package/es/locale/sys/app.d.ts +4 -0
- package/es/locale/sys/appDesigner.d.ts +5 -0
- package/es/locale/sys/cardDesign.d.ts +13 -0
- package/es/locale/sys/component.d.ts +19 -0
- package/es/locale/sys/model.d.ts +6 -0
- package/es/locale/sys/pageDesigner.d.ts +28 -0
- package/es/locale/sys/platform.d.ts +7 -0
- package/es/locale/sys.d.ts +22 -0
- package/es/provider/design-editor-node/design-editor-node.provider.d.ts +41 -0
- package/es/provider/design-editor-node/design-editor-node.provider.mjs +57 -0
- package/es/provider/index.d.ts +2 -0
- package/es/provider/index.mjs +2 -0
- package/es/provider/node-base/node-base.provider.d.ts +25 -0
- package/es/provider/node-base/node-base.provider.mjs +34 -0
- package/es/register/index.d.ts +1 -0
- package/es/register/index.mjs +1 -0
- package/es/register/node/node.register.d.ts +113 -0
- package/es/register/node/node.register.mjs +141 -0
- package/es/store/index.d.ts +1 -0
- package/es/store/index.mjs +1 -0
- package/es/store/view/design-view.store.d.ts +12 -0
- package/es/store/view/design-view.store.mjs +327 -0
- package/es/utils/can-drop/can-drop.d.ts +12 -0
- package/es/utils/can-drop/can-drop.mjs +48 -0
- package/es/utils/design-plugin-pkg-util/design-plugin-pkg-util.d.ts +1 -1
- package/es/utils/design-plugin-pkg-util/design-plugin-pkg-util.mjs +29 -1
- package/es/utils/expression/index.d.ts +1 -0
- package/es/utils/expression/index.mjs +43 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.mjs +2 -0
- package/package.json +12 -11
- package/es/components/field-cascader/index.d.ts +0 -2
- package/es/components/field-cascader/index.mjs +0 -1
- package/es/components/field-cascader/src/FieldCascader.vue.d.ts +0 -87
- package/es/components/field-cascader/src/FieldCascader.vue.mjs +0 -6
- package/es/components/field-cascader/src/FieldCascader.vue_vue_type_script_setup_true_lang.mjs +0 -115
- package/es/components/field-cascader/src/FieldCascader.vue_vue_type_style_index_0_lang.css +0 -69
- package/es/components/field-cascader/src/SearchInput.vue.d.ts +0 -11
- package/es/components/field-cascader/src/SearchInput.vue.mjs +0 -7
- package/es/components/field-cascader/src/SearchInput.vue_vue_type_script_setup_true_lang.mjs +0 -38
- package/es/components/field-cascader/src/SearchInput.vue_vue_type_style_index_0_scoped_512c4b38_lang.css +0 -9
- package/es/components/field-cascader/src/hooks.d.ts +0 -129
- package/es/components/field-cascader/src/hooks.mjs +0 -163
- package/es/components/field-transfer/components/field-transfer-modal.vue_vue_type_style_index_0_scoped_0c9dd8a1_lang.css +0 -5
|
@@ -0,0 +1,76 @@
|
|
|
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-design-content {
|
|
66
|
+
height: 100%;
|
|
67
|
+
overflow: hidden auto;
|
|
68
|
+
--design-drop-line-width: 4px;
|
|
69
|
+
}
|
|
70
|
+
.gct-design-content__container {
|
|
71
|
+
position: relative;
|
|
72
|
+
overflow: hidden auto;
|
|
73
|
+
}
|
|
74
|
+
.gct-design-content__container::-webkit-scrollbar {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { VNode, PropType, Component } from 'vue';
|
|
2
|
+
import { DesignItemHighlighterBinding } from '../design-item-highlighter/design-item-highlighter';
|
|
3
|
+
import { IDesignViewOptions } from '../../../interface';
|
|
4
|
+
import { IDesignNode } from '@gct-paas/schema';
|
|
5
|
+
export declare const DesignContent: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
opts: {
|
|
7
|
+
type: PropType<IDesignViewOptions>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, {
|
|
11
|
+
ns: import('@gct-paas/core').Namespace;
|
|
12
|
+
rootRef: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
13
|
+
highlighter: import('vue').Ref<{
|
|
14
|
+
ns: {
|
|
15
|
+
readonly namespace: string;
|
|
16
|
+
b: (blockSuffix?: string) => string;
|
|
17
|
+
e: (element?: string) => string;
|
|
18
|
+
m: (modifier?: string) => string;
|
|
19
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
20
|
+
em: (element?: string, modifier?: string) => string;
|
|
21
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
|
22
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
23
|
+
is: (name: string, state?: boolean) => string;
|
|
24
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
25
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
26
|
+
cssVarName: (name: string) => string;
|
|
27
|
+
cssVarBlockName: (name: string) => string;
|
|
28
|
+
};
|
|
29
|
+
isHover: boolean;
|
|
30
|
+
isSelect: boolean;
|
|
31
|
+
setHover: (el?: HTMLElement) => void;
|
|
32
|
+
setSelect: (el?: HTMLElement) => void;
|
|
33
|
+
} | null, DesignItemHighlighterBinding | {
|
|
34
|
+
ns: {
|
|
35
|
+
readonly namespace: string;
|
|
36
|
+
b: (blockSuffix?: string) => string;
|
|
37
|
+
e: (element?: string) => string;
|
|
38
|
+
m: (modifier?: string) => string;
|
|
39
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
40
|
+
em: (element?: string, modifier?: string) => string;
|
|
41
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
|
42
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
43
|
+
is: (name: string, state?: boolean) => string;
|
|
44
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
45
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
46
|
+
cssVarName: (name: string) => string;
|
|
47
|
+
cssVarBlockName: (name: string) => string;
|
|
48
|
+
};
|
|
49
|
+
isHover: boolean;
|
|
50
|
+
isSelect: boolean;
|
|
51
|
+
setHover: (el?: HTMLElement) => void;
|
|
52
|
+
setSelect: (el?: HTMLElement) => void;
|
|
53
|
+
} | null>;
|
|
54
|
+
style: import('vue').ComputedRef<IObject>;
|
|
55
|
+
rootCom: import('vue').ComputedRef<string | Component>;
|
|
56
|
+
c: import('../../../interface').IDesignViewController;
|
|
57
|
+
onClick: (e: MouseEvent) => void;
|
|
58
|
+
renderContainer: (node: IDesignNode, children?: IDesignNode[], parent?: IDesignNode) => VNode;
|
|
59
|
+
renderItem: (item: IDesignNode, parent?: IDesignNode) => import("vue/jsx-runtime").JSX.Element;
|
|
60
|
+
renderPage: () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}>;
|
|
63
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
64
|
+
opts: {
|
|
65
|
+
type: PropType<IDesignViewOptions>;
|
|
66
|
+
required: true;
|
|
67
|
+
};
|
|
68
|
+
}>> & Readonly<{}>, {}, {}, {
|
|
69
|
+
DesignItemHighlighter: import('vue').DefineComponent<{}, {
|
|
70
|
+
ns: import('@gct-paas/core').Namespace;
|
|
71
|
+
store: import('pinia').Store<string, import('../../../interface').IDesignViewState, IObject, import('../../../interface').IDesignViewActions>;
|
|
72
|
+
rootRef: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
73
|
+
isHover: import('vue').Ref<boolean, boolean>;
|
|
74
|
+
isSelect: import('vue').Ref<boolean, boolean>;
|
|
75
|
+
hoverEl: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
76
|
+
selectEl: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
77
|
+
hoverRect: import('vue').Ref<{
|
|
78
|
+
top: number;
|
|
79
|
+
right: number;
|
|
80
|
+
bottom: number;
|
|
81
|
+
left: number;
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
}, import('../../../interface').IPosRect | {
|
|
85
|
+
top: number;
|
|
86
|
+
right: number;
|
|
87
|
+
bottom: number;
|
|
88
|
+
left: number;
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
}>;
|
|
92
|
+
selectRect: import('vue').Ref<{
|
|
93
|
+
top: number;
|
|
94
|
+
right: number;
|
|
95
|
+
bottom: number;
|
|
96
|
+
left: number;
|
|
97
|
+
width: number;
|
|
98
|
+
height: number;
|
|
99
|
+
}, import('../../../interface').IPosRect | {
|
|
100
|
+
top: number;
|
|
101
|
+
right: number;
|
|
102
|
+
bottom: number;
|
|
103
|
+
left: number;
|
|
104
|
+
width: number;
|
|
105
|
+
height: number;
|
|
106
|
+
}>;
|
|
107
|
+
setHover: (el?: HTMLElement) => void;
|
|
108
|
+
setSelect: (el?: HTMLElement) => void;
|
|
109
|
+
hoverWidgetName: import('vue').ComputedRef<string>;
|
|
110
|
+
hoverHalfRect: import('vue').Ref<{
|
|
111
|
+
top: number;
|
|
112
|
+
right: number;
|
|
113
|
+
bottom: number;
|
|
114
|
+
left: number;
|
|
115
|
+
}, import('../../../interface').IHalfRect | {
|
|
116
|
+
top: number;
|
|
117
|
+
right: number;
|
|
118
|
+
bottom: number;
|
|
119
|
+
left: number;
|
|
120
|
+
}>;
|
|
121
|
+
actionHalfRect: import('vue').Ref<{
|
|
122
|
+
top: number;
|
|
123
|
+
right: number;
|
|
124
|
+
bottom: number;
|
|
125
|
+
left: number;
|
|
126
|
+
}, import('../../../interface').IHalfRect | {
|
|
127
|
+
top: number;
|
|
128
|
+
right: number;
|
|
129
|
+
bottom: number;
|
|
130
|
+
left: number;
|
|
131
|
+
}>;
|
|
132
|
+
onChangeHoverHalfRect: (rect: import('../../../interface').IHalfRect) => void;
|
|
133
|
+
onChangeActionHalfRect: (rect: import('../../../interface').IHalfRect) => void;
|
|
134
|
+
onChangeHoverPosRect: (rect: import('../../../interface').IPosRect) => void;
|
|
135
|
+
onChangeSelectPosRect: (rect: import('../../../interface').IPosRect) => void;
|
|
136
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {
|
|
137
|
+
DesignItemHighlighterContainer: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
138
|
+
mode: {
|
|
139
|
+
type: PropType<"hover" | "select">;
|
|
140
|
+
default: string;
|
|
141
|
+
};
|
|
142
|
+
posEl: {
|
|
143
|
+
type: PropType<HTMLDivElement | null>;
|
|
144
|
+
default: null;
|
|
145
|
+
};
|
|
146
|
+
changeHalfRect: {
|
|
147
|
+
type: PropType<(opt: import('../../../interface').IHalfRect) => void>;
|
|
148
|
+
};
|
|
149
|
+
changePosRect: {
|
|
150
|
+
type: PropType<(opt: import('../../../interface').IPosRect) => void>;
|
|
151
|
+
};
|
|
152
|
+
}>, {
|
|
153
|
+
ns: import('@gct-paas/core').Namespace;
|
|
154
|
+
styleObj: import('vue').ComputedRef<{
|
|
155
|
+
display: string;
|
|
156
|
+
width: string;
|
|
157
|
+
height: string;
|
|
158
|
+
top: string;
|
|
159
|
+
left: string;
|
|
160
|
+
'background-color': string;
|
|
161
|
+
'clip-path': string;
|
|
162
|
+
}>;
|
|
163
|
+
calcHalfRect: () => {
|
|
164
|
+
top: number;
|
|
165
|
+
right: number;
|
|
166
|
+
bottom: number;
|
|
167
|
+
left: number;
|
|
168
|
+
};
|
|
169
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
170
|
+
mode: {
|
|
171
|
+
type: PropType<"hover" | "select">;
|
|
172
|
+
default: string;
|
|
173
|
+
};
|
|
174
|
+
posEl: {
|
|
175
|
+
type: PropType<HTMLDivElement | null>;
|
|
176
|
+
default: null;
|
|
177
|
+
};
|
|
178
|
+
changeHalfRect: {
|
|
179
|
+
type: PropType<(opt: import('../../../interface').IHalfRect) => void>;
|
|
180
|
+
};
|
|
181
|
+
changePosRect: {
|
|
182
|
+
type: PropType<(opt: import('../../../interface').IPosRect) => void>;
|
|
183
|
+
};
|
|
184
|
+
}>> & Readonly<{}>, {
|
|
185
|
+
mode: "hover" | "select";
|
|
186
|
+
posEl: HTMLDivElement | null;
|
|
187
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
188
|
+
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
189
|
+
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
190
|
+
export default DesignContent;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { DesignItemAttribute, DesignNodeType } from "../../../constant/index.mjs";
|
|
2
|
+
import { NodeRegister } from "../../../register/node/node.register.mjs";
|
|
3
|
+
import "../../../register/index.mjs";
|
|
4
|
+
import { MobileContainer } from "../../mobile-container/mobile-container.mjs";
|
|
5
|
+
import { useDesignViewController } from "../../../hooks/use-design-view-controller/use-design-view-controller.mjs";
|
|
6
|
+
import "../../../hooks/index.mjs";
|
|
7
|
+
import { DesignItemHighlighter } from "../design-item-highlighter/design-item-highlighter.mjs";
|
|
8
|
+
import { DesignDragItem } from "../design-drag-item/design-drag-item.mjs";
|
|
9
|
+
import { DesignDropLine } from "../design-drop-line/design-drop-line.mjs";
|
|
10
|
+
import { DesignNotDragItem } from "../design-not-drag-item/design-not-drag-item.mjs";
|
|
11
|
+
import { DesignDropContainer } from "../design-drop-container/design-drop-container.mjs";
|
|
12
|
+
import DesignNotFound from "../design-not-found/design-not-found.mjs";
|
|
13
|
+
import './design-content.css';/* empty css */
|
|
14
|
+
import { calcStyle, useNamespace } from "@gct-paas/core";
|
|
15
|
+
import { computed, createVNode, defineComponent, h, isVNode, nextTick, onBeforeUnmount, onMounted, ref, resolveComponent, watch } from "vue";
|
|
16
|
+
import { DesignNodeMode } from "@gct-paas/schema";
|
|
17
|
+
//#region src/components/design/design-content/design-content.tsx
|
|
18
|
+
function _isSlot(s) {
|
|
19
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
20
|
+
}
|
|
21
|
+
var DesignContent = /* @__PURE__ */ defineComponent({
|
|
22
|
+
name: "DesignContent",
|
|
23
|
+
components: { DesignItemHighlighter },
|
|
24
|
+
props: { opts: {
|
|
25
|
+
type: Object,
|
|
26
|
+
required: true
|
|
27
|
+
} },
|
|
28
|
+
setup() {
|
|
29
|
+
const ns = useNamespace("design-content");
|
|
30
|
+
const rootRef = ref(null);
|
|
31
|
+
const highlighter = ref(null);
|
|
32
|
+
const c = useDesignViewController();
|
|
33
|
+
/**
|
|
34
|
+
* 根据配置计算界面样式
|
|
35
|
+
*/
|
|
36
|
+
const style = computed(() => {
|
|
37
|
+
if (c.store.pageNode) return calcStyle(c.store.pageNode.data);
|
|
38
|
+
return {};
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* 界面级跟组件,指定后会在绘制第一层之上包一层
|
|
42
|
+
*/
|
|
43
|
+
const rootCom = computed(() => {
|
|
44
|
+
if (c.store.pageNode) {
|
|
45
|
+
const p = NodeRegister.get(c.store.pageNode.type, c.store.prefix);
|
|
46
|
+
if (p) return p.component;
|
|
47
|
+
}
|
|
48
|
+
return "";
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* 获取子节点
|
|
52
|
+
*
|
|
53
|
+
* @param {IDesignNode} item
|
|
54
|
+
* @returns {*} {IDesignNode[]}
|
|
55
|
+
*/
|
|
56
|
+
function getChildren(item) {
|
|
57
|
+
return item.type === DesignNodeType.PAGE ? c.store.getChildren() : c.store.getChildren(item.id);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 绘制可拖拽项
|
|
61
|
+
*
|
|
62
|
+
* @param index
|
|
63
|
+
* @param node
|
|
64
|
+
* @param parent
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
const renderDragItem = (index, node, parent) => {
|
|
68
|
+
let _slot2;
|
|
69
|
+
const provider = NodeRegister.get(node.type, c.store.prefix);
|
|
70
|
+
if (!provider) return createVNode(DesignNotFound, { "message": `未找到节点类型:${node.type}` }, null);
|
|
71
|
+
if (provider.isDrag === false) {
|
|
72
|
+
let _slot;
|
|
73
|
+
return createVNode(DesignNotDragItem, {
|
|
74
|
+
"key": node.id,
|
|
75
|
+
"direction": "horizontal",
|
|
76
|
+
"group": parent.id,
|
|
77
|
+
"parent": parent,
|
|
78
|
+
"index": index,
|
|
79
|
+
"data": node
|
|
80
|
+
}, _isSlot(_slot = renderItem(node, parent)) ? _slot : { default: () => [_slot] });
|
|
81
|
+
}
|
|
82
|
+
return createVNode(DesignDragItem, {
|
|
83
|
+
"key": node.id,
|
|
84
|
+
"direction": "horizontal",
|
|
85
|
+
"group": parent.id,
|
|
86
|
+
"parent": parent,
|
|
87
|
+
"index": index,
|
|
88
|
+
"data": node
|
|
89
|
+
}, _isSlot(_slot2 = renderItem(node, parent)) ? _slot2 : { default: () => [_slot2] });
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* 绘制拖拽项
|
|
93
|
+
*
|
|
94
|
+
* @param provider
|
|
95
|
+
* @param node
|
|
96
|
+
* @param children
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
const renderItems = (provider, node, children) => {
|
|
100
|
+
const content = [];
|
|
101
|
+
children.forEach((item, i) => {
|
|
102
|
+
if (provider) {
|
|
103
|
+
if (provider.isDrop) content.push(createVNode(DesignDropLine, {
|
|
104
|
+
"key": `after_drop_line_${item.id}`,
|
|
105
|
+
"group": item.id,
|
|
106
|
+
"index": i,
|
|
107
|
+
"item": item,
|
|
108
|
+
"parent": node,
|
|
109
|
+
"beforeItem": children[i - 1],
|
|
110
|
+
"direction": provider.direction ?? "horizontal"
|
|
111
|
+
}, null));
|
|
112
|
+
content.push(renderDragItem(i, item, node));
|
|
113
|
+
if (provider.isDrop && children.length === i + 1) content.push(createVNode(DesignDropLine, {
|
|
114
|
+
"key": `after_drop_line_${item.id}`,
|
|
115
|
+
"group": item.id,
|
|
116
|
+
"index": i,
|
|
117
|
+
"item": item,
|
|
118
|
+
"parent": node,
|
|
119
|
+
"beforeItem": children[i - 1],
|
|
120
|
+
"direction": provider.direction ?? "horizontal",
|
|
121
|
+
"isBefore": false
|
|
122
|
+
}, null));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return content;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* 绘制拖拽容器
|
|
129
|
+
*
|
|
130
|
+
* @param node
|
|
131
|
+
* @param children
|
|
132
|
+
* @param parent
|
|
133
|
+
* @returns
|
|
134
|
+
*/
|
|
135
|
+
const renderContainer = (node, children = getChildren(node), parent) => {
|
|
136
|
+
let _slot3;
|
|
137
|
+
const provider = NodeRegister.get(node.type, c.store.prefix);
|
|
138
|
+
if (!provider) return createVNode(DesignNotFound, { "message": `未找到节点类型:${node.type}` }, null);
|
|
139
|
+
return createVNode(DesignDropContainer, {
|
|
140
|
+
"key": node.id,
|
|
141
|
+
"node": node,
|
|
142
|
+
"items": children,
|
|
143
|
+
"parent": parent,
|
|
144
|
+
"direction": provider.direction ?? "horizontal"
|
|
145
|
+
}, _isSlot(_slot3 = renderItems(provider, node, children)) ? _slot3 : { default: () => [_slot3] });
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* 绘制组件项
|
|
149
|
+
*
|
|
150
|
+
* @param item 当前项数据
|
|
151
|
+
* @param parent 父级项数据
|
|
152
|
+
* @returns
|
|
153
|
+
*/
|
|
154
|
+
const renderItem = (item, parent) => {
|
|
155
|
+
const provider = NodeRegister.get(item.type, c.store.prefix);
|
|
156
|
+
if (!provider) return createVNode(DesignNotFound, { "message": `未找到节点类型:${item.type}` }, null);
|
|
157
|
+
if (provider.mode === DesignNodeMode.CONTAINER) {
|
|
158
|
+
const items = getChildren(item);
|
|
159
|
+
return h(typeof provider.component === "string" ? resolveComponent(provider.component) : provider.component, {
|
|
160
|
+
key: item.id,
|
|
161
|
+
count: c.store.count,
|
|
162
|
+
data: item,
|
|
163
|
+
parent,
|
|
164
|
+
children: items
|
|
165
|
+
}, {
|
|
166
|
+
default: (data) => {
|
|
167
|
+
if (data && data.node) return renderContainer(data.node, data.children ?? items, data.parent ?? item);
|
|
168
|
+
return renderContainer(item, items, parent);
|
|
169
|
+
},
|
|
170
|
+
item: (data) => {
|
|
171
|
+
return renderDragItem(data.index, data.node, data.parent ?? item);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return h(typeof provider.component === "string" ? resolveComponent(provider.component) : provider.component, {
|
|
176
|
+
key: item.id,
|
|
177
|
+
count: c.store.count,
|
|
178
|
+
data: item,
|
|
179
|
+
parent
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
const renderPage = () => {
|
|
183
|
+
const item = c.store.pageNode;
|
|
184
|
+
const items = getChildren(item);
|
|
185
|
+
return h(typeof rootCom.value === "string" ? resolveComponent(rootCom.value) : rootCom.value, {
|
|
186
|
+
count: c.store.count,
|
|
187
|
+
node: c.store.pageNode
|
|
188
|
+
}, {
|
|
189
|
+
default: (data) => {
|
|
190
|
+
if (data && data.node) return renderContainer(data.node, data.children ?? items, data.parent ?? item);
|
|
191
|
+
return renderContainer(item, items);
|
|
192
|
+
},
|
|
193
|
+
item: (data) => {
|
|
194
|
+
return renderDragItem(data.index, data.node, data.parent ?? item);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const onMouseHover = (e) => {
|
|
199
|
+
if (!highlighter.value) return;
|
|
200
|
+
const pathList = e.composedPath().filter((_) => {
|
|
201
|
+
if (_ instanceof HTMLElement) return _.getAttribute(DesignItemAttribute.ACTIVE_TAG) == "true";
|
|
202
|
+
return false;
|
|
203
|
+
});
|
|
204
|
+
if (pathList.length && pathList.length > 0) {
|
|
205
|
+
const el = pathList[0];
|
|
206
|
+
highlighter.value.setHover(el);
|
|
207
|
+
} else if (highlighter.value.isHover) highlighter.value.setHover();
|
|
208
|
+
};
|
|
209
|
+
const onMouseenter = (e) => {
|
|
210
|
+
onMouseHover(e);
|
|
211
|
+
};
|
|
212
|
+
const onMouseleave = (e) => {
|
|
213
|
+
onMouseHover(e);
|
|
214
|
+
};
|
|
215
|
+
onMounted(() => {
|
|
216
|
+
rootRef.value.addEventListener("mouseenter", onMouseenter, { capture: true });
|
|
217
|
+
rootRef.value.addEventListener("mouseleave", onMouseleave, { capture: true });
|
|
218
|
+
rootRef.value.addEventListener("mouseover", onMouseenter, { capture: true });
|
|
219
|
+
rootRef.value.addEventListener("mouseout", onMouseleave, { capture: true });
|
|
220
|
+
});
|
|
221
|
+
onBeforeUnmount(() => {
|
|
222
|
+
rootRef.value.removeEventListener("mouseenter", onMouseenter, { capture: true });
|
|
223
|
+
rootRef.value.removeEventListener("mouseleave", onMouseleave, { capture: true });
|
|
224
|
+
rootRef.value.removeEventListener("mouseover", onMouseenter, { capture: true });
|
|
225
|
+
rootRef.value.removeEventListener("mouseout", onMouseleave, { capture: true });
|
|
226
|
+
});
|
|
227
|
+
const calcHighlighter = () => {
|
|
228
|
+
if (highlighter.value) if (c.store.selected) {
|
|
229
|
+
const el = rootRef.value.querySelector(`[${DesignItemAttribute.NODE_ID_TAG}="${c.store.selected.id}"]`);
|
|
230
|
+
highlighter.value.setSelect(el);
|
|
231
|
+
} else highlighter.value.setSelect();
|
|
232
|
+
};
|
|
233
|
+
watch(() => [c.store.selected, c.store.map.size], () => {
|
|
234
|
+
calcHighlighter();
|
|
235
|
+
});
|
|
236
|
+
watch(() => c.store.count, () => {
|
|
237
|
+
nextTick(() => {
|
|
238
|
+
calcHighlighter();
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
const onClick = (e) => {
|
|
242
|
+
e.stopPropagation();
|
|
243
|
+
c.store.activePage();
|
|
244
|
+
};
|
|
245
|
+
return {
|
|
246
|
+
ns,
|
|
247
|
+
rootRef,
|
|
248
|
+
highlighter,
|
|
249
|
+
style,
|
|
250
|
+
rootCom,
|
|
251
|
+
c,
|
|
252
|
+
onClick,
|
|
253
|
+
renderContainer,
|
|
254
|
+
renderItem,
|
|
255
|
+
renderPage
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
render() {
|
|
259
|
+
const content = this.renderContainer(this.c.store.pageNode);
|
|
260
|
+
content.props.style = this.style;
|
|
261
|
+
const container = this.$slots.container;
|
|
262
|
+
const child = this.rootCom ? this.renderPage() : content;
|
|
263
|
+
return createVNode("div", {
|
|
264
|
+
"ref": "rootRef",
|
|
265
|
+
"class": [this.ns.b()],
|
|
266
|
+
"onClick": this.onClick
|
|
267
|
+
}, [createVNode(DesignItemHighlighter, { "ref": "highlighter" }, null), !container ? createVNode(MobileContainer, {
|
|
268
|
+
"headerBgColor": this.c.store.pageNode?.data.headerBgColor,
|
|
269
|
+
"showTitleBar": this.opts.showMobileTitleBar
|
|
270
|
+
}, _isSlot(child) ? child : { default: () => [child] }) : container(child)]);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
//#endregion
|
|
274
|
+
export { DesignContent as default };
|