@gct-paas/design 0.1.5-dev.6 → 0.1.5-dev.8
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/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 +23 -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/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/index.d.ts +1 -0
- package/es/utils/index.mjs +1 -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
package/es/components/design/design-item-highlighter-container/design-item-highlighter-container.mjs
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { useDesignViewController } from "../../../hooks/use-design-view-controller/use-design-view-controller.mjs";
|
|
2
|
+
import "../../../hooks/index.mjs";
|
|
3
|
+
import './design-item-highlighter-container.css';/* empty css */
|
|
4
|
+
import { maxBy, minBy } from "lodash-es";
|
|
5
|
+
import { useNamespace } from "@gct-paas/core";
|
|
6
|
+
import { computed, createVNode, defineComponent, onUnmounted, ref, watch } from "vue";
|
|
7
|
+
import { toRefs as toRefs$1, useElementBounding, useMutationObserver, useResizeObserver } from "@vueuse/core";
|
|
8
|
+
//#region src/components/design/design-item-highlighter-container/design-item-highlighter-container.tsx
|
|
9
|
+
function getAllScrollParents(element) {
|
|
10
|
+
const scrollParents = [];
|
|
11
|
+
let parent = element;
|
|
12
|
+
while (parent = parent.parentElement) if (parent instanceof HTMLElement && (parent.offsetWidth < parent.scrollWidth || parent.offsetHeight < parent.scrollHeight)) scrollParents.push(parent);
|
|
13
|
+
return scrollParents;
|
|
14
|
+
}
|
|
15
|
+
var DesignItemHighlighterContainer = /* @__PURE__ */ defineComponent({
|
|
16
|
+
name: "DesignItemHighlighterContainer",
|
|
17
|
+
props: {
|
|
18
|
+
mode: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "hover"
|
|
21
|
+
},
|
|
22
|
+
posEl: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: null
|
|
25
|
+
},
|
|
26
|
+
changeHalfRect: { type: Function },
|
|
27
|
+
changePosRect: { type: Function }
|
|
28
|
+
},
|
|
29
|
+
setup(props) {
|
|
30
|
+
const ns = useNamespace("design-item-highlighter-container");
|
|
31
|
+
const c = useDesignViewController();
|
|
32
|
+
const { posEl } = toRefs$1(props);
|
|
33
|
+
const elRect = useElementBounding(posEl);
|
|
34
|
+
useMutationObserver(posEl, () => {
|
|
35
|
+
changeSorts();
|
|
36
|
+
}, { attributes: true });
|
|
37
|
+
useResizeObserver(posEl, () => {
|
|
38
|
+
changeSorts();
|
|
39
|
+
});
|
|
40
|
+
const store = c.store;
|
|
41
|
+
const scrollEls = ref([]);
|
|
42
|
+
const defRect = -2;
|
|
43
|
+
const halfRect = ref({
|
|
44
|
+
top: defRect,
|
|
45
|
+
right: defRect,
|
|
46
|
+
bottom: defRect,
|
|
47
|
+
left: defRect
|
|
48
|
+
});
|
|
49
|
+
const styleConfig = computed(() => {
|
|
50
|
+
if (posEl.value) {
|
|
51
|
+
if (props.changePosRect) props.changePosRect({
|
|
52
|
+
width: elRect.width.value,
|
|
53
|
+
height: elRect.height.value,
|
|
54
|
+
top: elRect.top.value,
|
|
55
|
+
left: elRect.left.value,
|
|
56
|
+
right: elRect.right.value,
|
|
57
|
+
bottom: elRect.bottom.value
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
display: store.isDragging ? "none" : "block",
|
|
61
|
+
width: elRect.width.value + "px",
|
|
62
|
+
height: elRect.height.value + "px",
|
|
63
|
+
top: elRect.top.value + "px",
|
|
64
|
+
left: elRect.left.value + "px"
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (props.changePosRect) props.changePosRect({
|
|
68
|
+
width: 0,
|
|
69
|
+
height: 0,
|
|
70
|
+
top: 0,
|
|
71
|
+
left: 0,
|
|
72
|
+
right: 0,
|
|
73
|
+
bottom: 0
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
display: "none",
|
|
77
|
+
width: "0",
|
|
78
|
+
height: "0",
|
|
79
|
+
top: "0",
|
|
80
|
+
left: "0"
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const changeSorts = () => {
|
|
84
|
+
if (posEl.value) {
|
|
85
|
+
const oldSorts = [...scrollEls.value];
|
|
86
|
+
scrollEls.value = getAllScrollParents(posEl.value);
|
|
87
|
+
const removeSorts = oldSorts.filter((el) => !scrollEls.value.includes(el));
|
|
88
|
+
const addSorts = scrollEls.value.filter((el) => !oldSorts.includes(el));
|
|
89
|
+
removeSorts.forEach((el) => {
|
|
90
|
+
el.removeEventListener("scroll", onScroll);
|
|
91
|
+
});
|
|
92
|
+
addSorts.forEach((el) => {
|
|
93
|
+
el.addEventListener("scroll", onScroll);
|
|
94
|
+
});
|
|
95
|
+
calcHalfRect();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const calcHalfRect = () => {
|
|
99
|
+
if (scrollEls.value.length > 0 && posEl.value) {
|
|
100
|
+
const rect = posEl.value.getBoundingClientRect();
|
|
101
|
+
const topScrollRect = maxBy(scrollEls.value, (el) => el.getBoundingClientRect().top).getBoundingClientRect();
|
|
102
|
+
const top = rect.top - topScrollRect.top + 4;
|
|
103
|
+
const right = minBy(scrollEls.value, (el) => el.getBoundingClientRect().right).getBoundingClientRect().right - rect.right + 4;
|
|
104
|
+
const bottom = minBy(scrollEls.value, (el) => el.getBoundingClientRect().bottom).getBoundingClientRect().bottom - rect.bottom + 4;
|
|
105
|
+
const leftScrollRect = maxBy(scrollEls.value, (el) => el.getBoundingClientRect().left).getBoundingClientRect();
|
|
106
|
+
const left = rect.left - leftScrollRect.left + 4;
|
|
107
|
+
halfRect.value = {
|
|
108
|
+
top: top >= 0 ? defRect : Math.abs(top),
|
|
109
|
+
right: right >= 0 ? defRect : Math.abs(right),
|
|
110
|
+
bottom: bottom >= 0 ? defRect : Math.abs(bottom),
|
|
111
|
+
left: left >= 0 ? defRect : Math.abs(left)
|
|
112
|
+
};
|
|
113
|
+
} else halfRect.value = {
|
|
114
|
+
top: defRect,
|
|
115
|
+
right: defRect,
|
|
116
|
+
bottom: defRect,
|
|
117
|
+
left: defRect
|
|
118
|
+
};
|
|
119
|
+
if (props.changeHalfRect) props.changeHalfRect(halfRect.value);
|
|
120
|
+
return halfRect.value;
|
|
121
|
+
};
|
|
122
|
+
function onScroll() {
|
|
123
|
+
calcHalfRect();
|
|
124
|
+
}
|
|
125
|
+
let t = -1;
|
|
126
|
+
let an = -1;
|
|
127
|
+
watch(posEl, () => {
|
|
128
|
+
changeSorts();
|
|
129
|
+
if (t !== -1) {
|
|
130
|
+
clearTimeout(t);
|
|
131
|
+
t = -1;
|
|
132
|
+
}
|
|
133
|
+
if (an !== -1) {
|
|
134
|
+
cancelAnimationFrame(an);
|
|
135
|
+
an = -1;
|
|
136
|
+
}
|
|
137
|
+
if (posEl.value) {
|
|
138
|
+
t = setInterval(() => {
|
|
139
|
+
elRect.update();
|
|
140
|
+
}, 50);
|
|
141
|
+
an = requestAnimationFrame(() => {
|
|
142
|
+
elRect.update();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
onUnmounted(() => {
|
|
147
|
+
clearInterval(t);
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
ns,
|
|
151
|
+
styleObj: computed(() => {
|
|
152
|
+
return {
|
|
153
|
+
...styleConfig.value,
|
|
154
|
+
"background-color": store.isDragging || props.mode === "select" ? "transparent" : "",
|
|
155
|
+
"clip-path": `inset(${halfRect.value.top}px ${halfRect.value.right}px ${halfRect.value.bottom}px ${halfRect.value.left}px)`
|
|
156
|
+
};
|
|
157
|
+
}),
|
|
158
|
+
calcHalfRect
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
render() {
|
|
162
|
+
return createVNode("div", {
|
|
163
|
+
"style": this.styleObj,
|
|
164
|
+
"class": [this.ns.b(), this.ns.m(this.mode)]
|
|
165
|
+
}, [createVNode("div", { "class": [this.ns.e("mask")] }, null)]);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
//#endregion
|
|
169
|
+
export { DesignItemHighlighterContainer };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const DesignItemHoverTitle: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
top: {
|
|
3
|
+
type: NumberConstructor;
|
|
4
|
+
default: number;
|
|
5
|
+
};
|
|
6
|
+
left: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
default: number;
|
|
9
|
+
};
|
|
10
|
+
content: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
halfRect: {
|
|
15
|
+
type: ObjectConstructor;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
hoverEl: {
|
|
19
|
+
type: {
|
|
20
|
+
new (): HTMLDivElement;
|
|
21
|
+
prototype: HTMLDivElement;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}>, {
|
|
25
|
+
ns: import('@gct-paas/core').Namespace;
|
|
26
|
+
elRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
27
|
+
style: import('vue').ComputedRef<{
|
|
28
|
+
opacity: number;
|
|
29
|
+
top: string;
|
|
30
|
+
left: string;
|
|
31
|
+
}>;
|
|
32
|
+
isShow: import('vue').ComputedRef<boolean>;
|
|
33
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
34
|
+
top: {
|
|
35
|
+
type: NumberConstructor;
|
|
36
|
+
default: number;
|
|
37
|
+
};
|
|
38
|
+
left: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
content: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
halfRect: {
|
|
47
|
+
type: ObjectConstructor;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
hoverEl: {
|
|
51
|
+
type: {
|
|
52
|
+
new (): HTMLDivElement;
|
|
53
|
+
prototype: HTMLDivElement;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}>> & Readonly<{}>, {
|
|
57
|
+
top: number;
|
|
58
|
+
left: number;
|
|
59
|
+
content: string;
|
|
60
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import './design-item-hover-title.css';/* empty css */
|
|
2
|
+
import { useNamespace } from "@gct-paas/core";
|
|
3
|
+
import { computed, createVNode, defineComponent, ref, toRefs } from "vue";
|
|
4
|
+
import { useElementBounding } from "@vueuse/core";
|
|
5
|
+
//#region src/components/design/design-item-hover-title/design-item-hover-title.tsx
|
|
6
|
+
var DesignItemHoverTitle = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "DesignItemHoverTitle",
|
|
8
|
+
props: {
|
|
9
|
+
top: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 0
|
|
12
|
+
},
|
|
13
|
+
left: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 0
|
|
16
|
+
},
|
|
17
|
+
content: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
halfRect: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
hoverEl: { type: HTMLDivElement }
|
|
26
|
+
},
|
|
27
|
+
setup(props) {
|
|
28
|
+
const ns = useNamespace("design-item-hover-title");
|
|
29
|
+
const elRef = ref(null);
|
|
30
|
+
const { hoverEl } = toRefs(props);
|
|
31
|
+
const { width, height } = useElementBounding(elRef);
|
|
32
|
+
const style = computed(() => {
|
|
33
|
+
return {
|
|
34
|
+
opacity: isShow.value ? 1 : 0,
|
|
35
|
+
top: `${props.top - height.value}px`,
|
|
36
|
+
left: `${props.left - width.value}px`
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const isShow = computed(() => {
|
|
40
|
+
if (!hoverEl.value) return true;
|
|
41
|
+
const { top, right, bottom, left } = props.halfRect;
|
|
42
|
+
return !(top > 0 || right > 0 || bottom - hoverEl.value.clientHeight > 0 || left - hoverEl.value.clientWidth > 0);
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
ns,
|
|
46
|
+
elRef,
|
|
47
|
+
style,
|
|
48
|
+
isShow
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
render() {
|
|
52
|
+
return createVNode("div", {
|
|
53
|
+
"ref": "elRef",
|
|
54
|
+
"class": this.ns.b(),
|
|
55
|
+
"style": this.style
|
|
56
|
+
}, [this.content]);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { DesignItemHoverTitle };
|
|
@@ -0,0 +1,91 @@
|
|
|
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-item-preview {
|
|
66
|
+
position: fixed;
|
|
67
|
+
top: 0;
|
|
68
|
+
left: 0;
|
|
69
|
+
z-index: 100000;
|
|
70
|
+
display: none;
|
|
71
|
+
align-items: center;
|
|
72
|
+
height: 18px;
|
|
73
|
+
color: black;
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
background-color: #B8B8B8;
|
|
76
|
+
border-radius: 1px;
|
|
77
|
+
box-shadow: 0 0 8px 0 rgba(33, 37, 40, 0.12);
|
|
78
|
+
}
|
|
79
|
+
.gct-design-item-preview__icon {
|
|
80
|
+
margin-top: 2px;
|
|
81
|
+
margin-left: 6px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.gct-design-item-preview__label {
|
|
85
|
+
padding: 0 6px;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.gct-design-item-preview.is-dragging {
|
|
90
|
+
display: flex;
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DesignItemPreview: import('vue').DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import './design-item-preview.css';/* empty css */
|
|
2
|
+
import { t, useNamespace } from "@gct-paas/core";
|
|
3
|
+
import { computed, createVNode, defineComponent } from "vue";
|
|
4
|
+
import { toRefs as toRefs$1 } from "@vueuse/core";
|
|
5
|
+
import { useDragLayer } from "vue3-dnd";
|
|
6
|
+
//#region src/components/design/design-item-preview/design-item-preview.tsx
|
|
7
|
+
var DesignItemPreview = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "DesignItemPreview",
|
|
9
|
+
setup() {
|
|
10
|
+
const ns = useNamespace("design-item-preview");
|
|
11
|
+
const { isDragging, item, offset } = toRefs$1(useDragLayer((monitor) => {
|
|
12
|
+
return {
|
|
13
|
+
isDragging: !!monitor.isDragging(),
|
|
14
|
+
item: monitor.getItem(),
|
|
15
|
+
offset: monitor.getClientOffset()
|
|
16
|
+
};
|
|
17
|
+
}));
|
|
18
|
+
const pos = computed(() => {
|
|
19
|
+
if (!offset.value) return "";
|
|
20
|
+
const { x, y } = offset.value;
|
|
21
|
+
return `transform: translate(${x}px, ${y}px)`;
|
|
22
|
+
});
|
|
23
|
+
return () => {
|
|
24
|
+
return createVNode("div", {
|
|
25
|
+
"class": [ns.b(), ns.is("dragging", item.value?.data && isDragging.value)],
|
|
26
|
+
"style": pos.value
|
|
27
|
+
}, [createVNode("span", { "class": ns.e("icon") }, [createVNode("i", { "class": "iconfont icon-yidong" }, null)]), createVNode("span", { "class": ns.e("label") }, [t(item.value?.data?.label || "sys.pageDesigner.unknownComponent")])]);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DesignItemPreview };
|
|
@@ -0,0 +1,67 @@
|
|
|
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-not-drag-item {
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IDesignNode } from '@gct-paas/schema';
|
|
3
|
+
import { INodeProvider } from '../../../interface';
|
|
4
|
+
export declare const DesignNotDragItem: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
group: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
parent: {
|
|
10
|
+
type: PropType<IDesignNode>;
|
|
11
|
+
};
|
|
12
|
+
direction: {
|
|
13
|
+
type: PropType<"vertical" | "horizontal">;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
index: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
data: {
|
|
21
|
+
type: PropType<IDesignNode>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>, {
|
|
25
|
+
ns: import('@gct-paas/core').Namespace;
|
|
26
|
+
c: import('../../..').IDesignViewController;
|
|
27
|
+
style: import('vue').ComputedRef<IObject>;
|
|
28
|
+
provider: INodeProvider<IDesignNode<import('@gct-paas/schema').IDesignNodeData>>;
|
|
29
|
+
onActive: (e: MouseEvent) => void;
|
|
30
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
31
|
+
group: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
parent: {
|
|
36
|
+
type: PropType<IDesignNode>;
|
|
37
|
+
};
|
|
38
|
+
direction: {
|
|
39
|
+
type: PropType<"vertical" | "horizontal">;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
index: {
|
|
43
|
+
type: NumberConstructor;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
data: {
|
|
47
|
+
type: PropType<IDesignNode>;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { DesignItemAttribute } from "../../../constant/index.mjs";
|
|
2
|
+
import { NodeRegister } from "../../../register/node/node.register.mjs";
|
|
3
|
+
import "../../../register/index.mjs";
|
|
4
|
+
import { useDesignViewController } from "../../../hooks/use-design-view-controller/use-design-view-controller.mjs";
|
|
5
|
+
import "../../../hooks/index.mjs";
|
|
6
|
+
import './design-not-drag-item.css';/* empty css */
|
|
7
|
+
import { calcStyle, useNamespace } from "@gct-paas/core";
|
|
8
|
+
import { computed, createVNode, defineComponent, mergeProps, toRefs } from "vue";
|
|
9
|
+
//#region src/components/design/design-not-drag-item/design-not-drag-item.tsx
|
|
10
|
+
var DesignNotDragItem = /* @__PURE__ */ defineComponent({
|
|
11
|
+
name: "DesignNotDragItem",
|
|
12
|
+
props: {
|
|
13
|
+
group: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
parent: { type: Object },
|
|
18
|
+
direction: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
index: {
|
|
23
|
+
type: Number,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
data: {
|
|
27
|
+
type: Object,
|
|
28
|
+
required: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(props) {
|
|
32
|
+
const ns = useNamespace("design-not-drag-item");
|
|
33
|
+
const c = useDesignViewController();
|
|
34
|
+
const provider = NodeRegister.get(props.data.type, c.store.prefix);
|
|
35
|
+
const { data } = toRefs(props.data);
|
|
36
|
+
const style = computed(() => {
|
|
37
|
+
return calcStyle(data.value);
|
|
38
|
+
});
|
|
39
|
+
const onActive = (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
c.store.setActive(props.data);
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
ns,
|
|
45
|
+
c,
|
|
46
|
+
style,
|
|
47
|
+
provider,
|
|
48
|
+
onActive
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
render() {
|
|
52
|
+
return createVNode("div", mergeProps({ "id": this.data.id }, {
|
|
53
|
+
[DesignItemAttribute.NODE_ID_TAG]: this.data.id,
|
|
54
|
+
[DesignItemAttribute.ACTIVE_TAG]: true,
|
|
55
|
+
[DesignItemAttribute.DESIGN_NAME]: this.data.label,
|
|
56
|
+
[DesignItemAttribute.DRAG_GROUP_TYPE]: this.provider.type,
|
|
57
|
+
[DesignItemAttribute.GROUP_TAG]: this.group,
|
|
58
|
+
[DesignItemAttribute.INDEX_TAG]: this.index,
|
|
59
|
+
[DesignItemAttribute.SELECTOR_INDEX]: this.provider.selectorIndex ?? 0
|
|
60
|
+
}, {
|
|
61
|
+
"class": this.ns.b(),
|
|
62
|
+
"style": this.style,
|
|
63
|
+
"onClick": this.onActive
|
|
64
|
+
}), [this.$slots.default?.()]);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { DesignNotDragItem };
|
|
@@ -0,0 +1,68 @@
|
|
|
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-not-found {
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
color: #C3C3C3;
|
|
68
|
+
}
|