@fangzhongya/page 0.0.32 → 0.0.33
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/components/control/config.cjs +1 -1
- package/dist/components/control/config.js +1 -1
- package/dist/components/control/design.cjs +1 -1
- package/dist/components/control/design.js +1 -1
- package/dist/components/control/draggable.cjs +0 -5
- package/dist/components/control/draggable.js +0 -5
- package/dist/components/design/design-drag2.cjs +12 -6
- package/dist/components/design/design-drag2.js +10 -4
- package/dist/components/design/design-grids2.cjs +13 -15
- package/dist/components/design/design-grids2.js +14 -16
- package/dist/components/design/design-resizable2.cjs +26 -16
- package/dist/components/design/design-resizable2.js +25 -15
- package/dist/components/design/resizable/aligned.cjs +343 -0
- package/dist/components/design/resizable/aligned.d.ts +47 -0
- package/dist/components/design/resizable/aligned.js +343 -0
- package/dist/components/design/resizable/distance.cjs +414 -0
- package/dist/components/design/resizable/distance.d.ts +26 -0
- package/dist/components/design/resizable/distance.js +414 -0
- package/dist/components/design/resizable/resizable2.cjs +24 -13
- package/dist/components/design/resizable/resizable2.js +25 -14
- package/dist/components/design/resizable/util.cjs +18 -0
- package/dist/components/design/resizable/util.d.ts +1 -0
- package/dist/components/design/resizable/util.js +18 -0
- package/dist/components/index.css +85 -39
- package/dist/components/index2.cjs +15 -2
- package/dist/components/index2.js +15 -2
- package/dist/components/left/icons2.cjs +1 -1
- package/dist/components/left/icons2.js +1 -1
- package/dist/components/operate/util.cjs +3 -5
- package/dist/components/operate/util.js +3 -5
- package/dist/components/right/currency/general2.cjs +2 -1
- package/dist/components/right/currency/general2.js +2 -1
- package/dist/components/right/custom/compon2.cjs +1 -1
- package/dist/components/right/custom/compon2.js +1 -1
- package/dist/components/right/editdata/compon2.cjs +2 -1
- package/dist/components/right/editdata/compon2.js +2 -1
- package/dist/components/right/editdata/index2.cjs +0 -1
- package/dist/components/right/editdata/index2.js +0 -1
- package/dist/components/set/util.cjs +1 -0
- package/dist/components/set/util.js +1 -0
- package/dist/components/top/index2.cjs +28 -20
- package/dist/components/top/index2.js +29 -21
- package/dist/components/tree/level-label2.cjs +2 -2
- package/dist/components/tree/level-label2.js +2 -2
- package/dist/config/attrconfig.cjs +8 -1
- package/dist/config/attrconfig.js +8 -1
- package/dist/config/basics.cjs +14 -8
- package/dist/config/basics.js +14 -8
- package/dist/config/elements/basis.cjs +705 -0
- package/dist/config/elements/basis.d.ts +4 -0
- package/dist/config/elements/basis.js +705 -0
- package/dist/config/elements/data.cjs +1200 -0
- package/dist/config/elements/data.d.ts +4 -0
- package/dist/config/elements/data.js +1200 -0
- package/dist/config/elements/elements.d.ts +3 -0
- package/dist/config/elements/feedback.cjs +782 -0
- package/dist/config/elements/feedback.d.ts +4 -0
- package/dist/config/elements/feedback.js +782 -0
- package/dist/config/elements/form.cjs +1193 -0
- package/dist/config/elements/form.d.ts +4 -0
- package/dist/config/elements/form.js +1193 -0
- package/dist/config/elements/navigat.cjs +608 -0
- package/dist/config/elements/navigat.d.ts +4 -0
- package/dist/config/elements/navigat.js +608 -0
- package/dist/config/elements/other.cjs +336 -0
- package/dist/config/elements/other.d.ts +4 -0
- package/dist/config/elements/other.js +336 -0
- package/dist/config/elements.cjs +12 -1012
- package/dist/config/elements.js +12 -1012
- package/dist/config/fangs.cjs +2293 -3321
- package/dist/config/fangs.js +2293 -3321
- package/dist/css/style.css +2 -1358
- package/dist/css/style2.css +1404 -2
- package/dist/effect/design.cjs +3 -1
- package/dist/effect/design.js +3 -1
- package/dist/effect/draggable.cjs +9 -5
- package/dist/effect/draggable.js +4 -0
- package/dist/index.css +156 -110
- package/dist/render/common.cjs +1 -1
- package/dist/render/common.js +1 -1
- package/dist/render/util.cjs +4 -1
- package/dist/render/util.js +4 -1
- package/dist/viewer/design.cjs +3 -1
- package/dist/viewer/design.js +3 -1
- package/dist/viewer/draggable.cjs +6 -5
- package/dist/viewer/draggable.js +3 -2
- package/package.json +6 -6
|
@@ -46,11 +46,6 @@ function getResizableDiv(slots, assembly, params, callback, key) {
|
|
|
46
46
|
}
|
|
47
47
|
function getGridDiv(obj, config2, params, temps) {
|
|
48
48
|
config2.assembly = obj;
|
|
49
|
-
const layout = obj.attrs?.layout || [];
|
|
50
|
-
config2.modelValue = layout;
|
|
51
|
-
config2["onUpdate:modelValue"] = (value) => {
|
|
52
|
-
layout.splice(0, layout.length, ...value);
|
|
53
|
-
};
|
|
54
49
|
const items = common.getSlotsArray(obj) || [];
|
|
55
50
|
config2.items = items;
|
|
56
51
|
config2["onUpdate:items"] = (value) => {
|
|
@@ -44,11 +44,6 @@ function getResizableDiv(slots, assembly, params, callback, key) {
|
|
|
44
44
|
}
|
|
45
45
|
function getGridDiv(obj, config, params, temps) {
|
|
46
46
|
config.assembly = obj;
|
|
47
|
-
const layout = obj.attrs?.layout || [];
|
|
48
|
-
config.modelValue = layout;
|
|
49
|
-
config["onUpdate:modelValue"] = (value) => {
|
|
50
|
-
layout.splice(0, layout.length, ...value);
|
|
51
|
-
};
|
|
52
47
|
const items = getSlotsArray(obj) || [];
|
|
53
48
|
config.items = items;
|
|
54
49
|
config["onUpdate:items"] = (value) => {
|
|
@@ -4,11 +4,12 @@ const vue = require("vue");
|
|
|
4
4
|
const Draggable = require("vuedraggable");
|
|
5
5
|
require("./design-operate.cjs");
|
|
6
6
|
const index = require("../../utils/index.cjs");
|
|
7
|
-
const util = require("../../config/util.cjs");
|
|
7
|
+
const util$1 = require("../../config/util.cjs");
|
|
8
8
|
const render = require("../../utils/render.cjs");
|
|
9
9
|
const humpToLine = require("@fangzhongya/utils/name/humpToLine");
|
|
10
|
+
const util = require("./resizable/util.cjs");
|
|
10
11
|
const designOperate_vue_vue_type_script_setup_true_lang = require("./design-operate2.cjs");
|
|
11
|
-
const _hoisted_1 = ["onClick"];
|
|
12
|
+
const _hoisted_1 = ["id", "onClick"];
|
|
12
13
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
13
14
|
__name: "design-drag",
|
|
14
15
|
props: {
|
|
@@ -29,6 +30,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
29
30
|
},
|
|
30
31
|
emits: ["update:modelValue"],
|
|
31
32
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
33
|
+
const mouseenter = util.uesDistance();
|
|
32
34
|
const cs = index.getClass("design-drag");
|
|
33
35
|
const props = __props;
|
|
34
36
|
const emit = __emit;
|
|
@@ -70,26 +72,30 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
70
72
|
class: vue.normalizeClass([vue.unref(cs)("draggable")]),
|
|
71
73
|
"item-key": "id",
|
|
72
74
|
tag: "div",
|
|
75
|
+
animation: 100,
|
|
73
76
|
ghostClass: "design-sortable-ghost",
|
|
74
77
|
chosenClass: "design-sortable-chosen",
|
|
75
78
|
dragClass: "design-sortable-drag",
|
|
76
79
|
group: vue.unref(group),
|
|
77
80
|
filter: ".page-undraggable",
|
|
78
81
|
modelValue: vue.unref(value),
|
|
79
|
-
"onUpdate:modelValue": _cache[
|
|
82
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(value) ? value.value = $event : null)
|
|
80
83
|
}, vue.createSlots({
|
|
81
84
|
item: vue.withCtx(({ element, index: index2 }) => [
|
|
82
|
-
!element.
|
|
85
|
+
!element.hide ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
83
86
|
key: 0,
|
|
84
87
|
class: [
|
|
85
88
|
vue.unref(cs)("draggable-item"),
|
|
86
89
|
"page-" + vue.unref(humpToLine.humpToLine)(element.name),
|
|
87
|
-
vue.unref(util.getComponObj)(element).status?.inline ? "is-inline" : "",
|
|
90
|
+
vue.unref(util$1.getComponObj)(element).status?.inline ? "is-inline" : "",
|
|
88
91
|
element === vue.unref(right) ? "on" : "",
|
|
89
92
|
element.design?.islock ? "page-undraggable" : ""
|
|
90
93
|
]
|
|
91
94
|
}, vue.unref(binds), {
|
|
92
|
-
|
|
95
|
+
id: element.id,
|
|
96
|
+
onClick: vue.withModifiers(($event) => onClick(element), ["stop"]),
|
|
97
|
+
onMouseenter: _cache[0] || (_cache[0] = //@ts-ignore
|
|
98
|
+
(...args) => vue.unref(mouseenter) && vue.unref(mouseenter)(...args))
|
|
93
99
|
}), [
|
|
94
100
|
vue.createVNode(designOperate_vue_vue_type_script_setup_true_lang.default, {
|
|
95
101
|
"model-value": vue.unref(value),
|
|
@@ -5,8 +5,9 @@ import { getClass } from "../../utils/index.js";
|
|
|
5
5
|
import { getComponObj } from "../../config/util.js";
|
|
6
6
|
import { getClassId } from "../../utils/render.js";
|
|
7
7
|
import { humpToLine } from "@fangzhongya/utils/name/humpToLine";
|
|
8
|
+
import { uesDistance } from "./resizable/util.js";
|
|
8
9
|
import _sfc_main$1 from "./design-operate2.js";
|
|
9
|
-
const _hoisted_1 = ["onClick"];
|
|
10
|
+
const _hoisted_1 = ["id", "onClick"];
|
|
10
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
12
|
__name: "design-drag",
|
|
12
13
|
props: {
|
|
@@ -27,6 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
28
|
},
|
|
28
29
|
emits: ["update:modelValue"],
|
|
29
30
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
31
|
+
const mouseenter = uesDistance();
|
|
30
32
|
const cs = getClass("design-drag");
|
|
31
33
|
const props = __props;
|
|
32
34
|
const emit = __emit;
|
|
@@ -68,16 +70,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
70
|
class: normalizeClass([unref(cs)("draggable")]),
|
|
69
71
|
"item-key": "id",
|
|
70
72
|
tag: "div",
|
|
73
|
+
animation: 100,
|
|
71
74
|
ghostClass: "design-sortable-ghost",
|
|
72
75
|
chosenClass: "design-sortable-chosen",
|
|
73
76
|
dragClass: "design-sortable-drag",
|
|
74
77
|
group: unref(group),
|
|
75
78
|
filter: ".page-undraggable",
|
|
76
79
|
modelValue: unref(value),
|
|
77
|
-
"onUpdate:modelValue": _cache[
|
|
80
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(value) ? value.value = $event : null)
|
|
78
81
|
}, createSlots({
|
|
79
82
|
item: withCtx(({ element, index }) => [
|
|
80
|
-
!element.
|
|
83
|
+
!element.hide ? (openBlock(), createElementBlock("div", mergeProps({
|
|
81
84
|
key: 0,
|
|
82
85
|
class: [
|
|
83
86
|
unref(cs)("draggable-item"),
|
|
@@ -87,7 +90,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
87
90
|
element.design?.islock ? "page-undraggable" : ""
|
|
88
91
|
]
|
|
89
92
|
}, unref(binds), {
|
|
90
|
-
|
|
93
|
+
id: element.id,
|
|
94
|
+
onClick: withModifiers(($event) => onClick(element), ["stop"]),
|
|
95
|
+
onMouseenter: _cache[0] || (_cache[0] = //@ts-ignore
|
|
96
|
+
(...args) => unref(mouseenter) && unref(mouseenter)(...args))
|
|
91
97
|
}), [
|
|
92
98
|
createVNode(_sfc_main$1, {
|
|
93
99
|
"model-value": unref(value),
|
|
@@ -24,12 +24,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
24
24
|
type: Number,
|
|
25
25
|
default: 24
|
|
26
26
|
},
|
|
27
|
-
modelValue: {
|
|
28
|
-
type: Array,
|
|
29
|
-
default() {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
27
|
margin: {
|
|
34
28
|
default: () => [10, 10],
|
|
35
29
|
type: Object
|
|
@@ -55,7 +49,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
55
49
|
}
|
|
56
50
|
}
|
|
57
51
|
},
|
|
58
|
-
emits: ["update:
|
|
52
|
+
emits: ["update:items"],
|
|
59
53
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
60
54
|
const co = index.getClass("design-com");
|
|
61
55
|
const cs = index.getClass("design-grids");
|
|
@@ -83,10 +77,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
83
77
|
});
|
|
84
78
|
const value = vue.computed({
|
|
85
79
|
get() {
|
|
86
|
-
|
|
80
|
+
const layout = props.items.map((o) => o.attrs);
|
|
81
|
+
props.assembly.attrs = props.assembly.attrs || {};
|
|
82
|
+
props.assembly.attrs.layout = value;
|
|
83
|
+
return layout;
|
|
87
84
|
},
|
|
88
85
|
set(value2) {
|
|
89
|
-
|
|
86
|
+
if (props.assembly) {
|
|
87
|
+
props.assembly.attrs = props.assembly.attrs || {};
|
|
88
|
+
props.assembly.attrs.layout = value2;
|
|
89
|
+
}
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
const setKey = vue.computed(() => {
|
|
@@ -113,7 +113,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
113
113
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
114
114
|
key: item.id
|
|
115
115
|
}, [
|
|
116
|
-
!items.value[key].
|
|
116
|
+
!items.value[key].hide ? (vue.openBlock(), vue.createBlock(GridItem_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({
|
|
117
117
|
key: 0,
|
|
118
118
|
ref_for: true
|
|
119
119
|
}, gridItemProps, {
|
|
@@ -130,15 +130,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
130
130
|
onClick: vue.withModifiers(($event) => onClick(key), ["stop"])
|
|
131
131
|
}), {
|
|
132
132
|
default: vue.withCtx(() => [
|
|
133
|
-
|
|
134
|
-
key: 0,
|
|
133
|
+
vue.createElementVNode("div", {
|
|
135
134
|
class: vue.normalizeClass(vue.unref(cs)("allow"))
|
|
136
|
-
}, null, 2)
|
|
135
|
+
}, null, 2),
|
|
137
136
|
vue.createVNode(designOperate_vue_vue_type_script_setup_true_lang.default, {
|
|
138
137
|
modelValue: items.value,
|
|
139
138
|
assembly: items.value[key],
|
|
140
|
-
index: key
|
|
141
|
-
height: "100%"
|
|
139
|
+
index: key
|
|
142
140
|
}, {
|
|
143
141
|
default: vue.withCtx(() => [
|
|
144
142
|
vue.renderSlot(_ctx.$slots, "default", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, inject, computed, openBlock, createElementBlock, normalizeClass, unref, createBlock, withCtx, Fragment, renderList, mergeProps, withModifiers,
|
|
1
|
+
import { defineComponent, inject, computed, openBlock, createElementBlock, normalizeClass, unref, createBlock, withCtx, Fragment, renderList, mergeProps, withModifiers, createElementVNode, createVNode, renderSlot, createCommentVNode } from "vue";
|
|
2
2
|
import "./grids/components/GridLayout.js";
|
|
3
3
|
import "./grids/components/GridItem.js";
|
|
4
4
|
import "./design-operate.js";
|
|
@@ -22,12 +22,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
type: Number,
|
|
23
23
|
default: 24
|
|
24
24
|
},
|
|
25
|
-
modelValue: {
|
|
26
|
-
type: Array,
|
|
27
|
-
default() {
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
25
|
margin: {
|
|
32
26
|
default: () => [10, 10],
|
|
33
27
|
type: Object
|
|
@@ -53,7 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
53
47
|
}
|
|
54
48
|
}
|
|
55
49
|
},
|
|
56
|
-
emits: ["update:
|
|
50
|
+
emits: ["update:items"],
|
|
57
51
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
58
52
|
const co = getClass("design-com");
|
|
59
53
|
const cs = getClass("design-grids");
|
|
@@ -81,10 +75,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
81
75
|
});
|
|
82
76
|
const value = computed({
|
|
83
77
|
get() {
|
|
84
|
-
|
|
78
|
+
const layout = props.items.map((o) => o.attrs);
|
|
79
|
+
props.assembly.attrs = props.assembly.attrs || {};
|
|
80
|
+
props.assembly.attrs.layout = value;
|
|
81
|
+
return layout;
|
|
85
82
|
},
|
|
86
83
|
set(value2) {
|
|
87
|
-
|
|
84
|
+
if (props.assembly) {
|
|
85
|
+
props.assembly.attrs = props.assembly.attrs || {};
|
|
86
|
+
props.assembly.attrs.layout = value2;
|
|
87
|
+
}
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
const setKey = computed(() => {
|
|
@@ -111,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
111
|
return openBlock(), createElementBlock(Fragment, {
|
|
112
112
|
key: item.id
|
|
113
113
|
}, [
|
|
114
|
-
!items.value[key].
|
|
114
|
+
!items.value[key].hide ? (openBlock(), createBlock(_sfc_main$2, mergeProps({
|
|
115
115
|
key: 0,
|
|
116
116
|
ref_for: true
|
|
117
117
|
}, gridItemProps, {
|
|
@@ -128,15 +128,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
128
128
|
onClick: withModifiers(($event) => onClick(key), ["stop"])
|
|
129
129
|
}), {
|
|
130
130
|
default: withCtx(() => [
|
|
131
|
-
|
|
132
|
-
key: 0,
|
|
131
|
+
createElementVNode("div", {
|
|
133
132
|
class: normalizeClass(unref(cs)("allow"))
|
|
134
|
-
}, null, 2)
|
|
133
|
+
}, null, 2),
|
|
135
134
|
createVNode(_sfc_main$3, {
|
|
136
135
|
modelValue: items.value,
|
|
137
136
|
assembly: items.value[key],
|
|
138
|
-
index: key
|
|
139
|
-
height: "100%"
|
|
137
|
+
index: key
|
|
140
138
|
}, {
|
|
141
139
|
default: withCtx(() => [
|
|
142
140
|
renderSlot(_ctx.$slots, "default", {
|
|
@@ -4,11 +4,13 @@ const vue = require("vue");
|
|
|
4
4
|
const Draggable = require("vuedraggable");
|
|
5
5
|
require("./resizable/resizable.cjs");
|
|
6
6
|
require("./design-operate.cjs");
|
|
7
|
-
const util = require("../../config/util.cjs");
|
|
7
|
+
const util$1 = require("../../config/util.cjs");
|
|
8
8
|
const index = require("../../utils/index.cjs");
|
|
9
|
+
const aligned = require("./resizable/aligned.cjs");
|
|
10
|
+
const util = require("./resizable/util.cjs");
|
|
9
11
|
const resizable_vue_vue_type_script_setup_true_lang = require("./resizable/resizable2.cjs");
|
|
10
12
|
const designOperate_vue_vue_type_script_setup_true_lang = require("./design-operate2.cjs");
|
|
11
|
-
const defaultSize =
|
|
13
|
+
const defaultSize = 1;
|
|
12
14
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
13
15
|
__name: "design-resizable",
|
|
14
16
|
props: {
|
|
@@ -35,6 +37,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
35
37
|
},
|
|
36
38
|
emits: ["update:modelValue"],
|
|
37
39
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
40
|
+
const mouseenter = util.uesDistance();
|
|
38
41
|
const co = index.getClass("design-com");
|
|
39
42
|
const cs = index.getClass("design-resizable");
|
|
40
43
|
const props = __props;
|
|
@@ -67,8 +70,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
67
70
|
const y = originalEvent.clientY - rects.value.top;
|
|
68
71
|
if (add.value) {
|
|
69
72
|
add.value.positions = add.value.positions || {};
|
|
70
|
-
add.value.positions.x = x;
|
|
71
|
-
add.value.positions.y = y;
|
|
73
|
+
add.value.positions.x = x / scale.value;
|
|
74
|
+
add.value.positions.y = y / scale.value;
|
|
72
75
|
add.value.positions.w = "auto";
|
|
73
76
|
add.value.positions.h = "auto";
|
|
74
77
|
add.value = void 0;
|
|
@@ -84,6 +87,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
84
87
|
element.positions = element.positions || {};
|
|
85
88
|
element.positions.x = arr[0];
|
|
86
89
|
element.positions.y = arr[1];
|
|
90
|
+
aligned.clearAlignmentLines();
|
|
87
91
|
};
|
|
88
92
|
const onResizeStop = (arr, element) => {
|
|
89
93
|
element.positions = element.positions || {};
|
|
@@ -91,6 +95,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
91
95
|
element.positions.y = arr[1];
|
|
92
96
|
element.positions.w = arr[2];
|
|
93
97
|
element.positions.h = arr[3];
|
|
98
|
+
aligned.clearAlignmentLines();
|
|
99
|
+
};
|
|
100
|
+
const onDragging = (event) => {
|
|
101
|
+
const dom = event.target;
|
|
102
|
+
aligned.showAlignmentLines(dom, 1);
|
|
94
103
|
};
|
|
95
104
|
vue.onMounted(() => {
|
|
96
105
|
if (refResizable.value) {
|
|
@@ -137,17 +146,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
137
146
|
}, [
|
|
138
147
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(value), (element, index2) => {
|
|
139
148
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
140
|
-
!element.
|
|
149
|
+
!element.hide ? (vue.openBlock(), vue.createBlock(resizable_vue_vue_type_script_setup_true_lang.default, {
|
|
141
150
|
key: 0,
|
|
151
|
+
id: element.id,
|
|
142
152
|
class: vue.normalizeClass([
|
|
143
153
|
vue.unref(cs)("resizable-item"),
|
|
144
|
-
vue.unref(util.getComponObj)(element).status?.inline ? "is-inline" : "",
|
|
154
|
+
vue.unref(util$1.getComponObj)(element).status?.inline ? "is-inline" : "",
|
|
145
155
|
element === vue.unref(right) ? "on" : ""
|
|
146
156
|
]),
|
|
147
157
|
scale: vue.unref(scale),
|
|
148
158
|
draggable: !element.design?.islock,
|
|
149
159
|
resizable: !element.design?.islock,
|
|
150
|
-
parent:
|
|
160
|
+
parent: false,
|
|
151
161
|
"min-width": defaultSize,
|
|
152
162
|
"min-height": defaultSize,
|
|
153
163
|
grid: element.positions?.grid || [
|
|
@@ -160,20 +170,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
160
170
|
h: element.positions?.h || "auto",
|
|
161
171
|
z: element.positions?.z,
|
|
162
172
|
onClick: vue.withModifiers(($event) => onClick(element), ["stop"]),
|
|
163
|
-
onDragStop: (...arr) => onDragStop(arr, element),
|
|
164
|
-
|
|
165
|
-
|
|
173
|
+
onDragStop: (_e, ...arr) => onDragStop(arr, element),
|
|
174
|
+
onDragging,
|
|
175
|
+
onResizing: onDragging,
|
|
176
|
+
onMouseenter: vue.unref(mouseenter),
|
|
177
|
+
onResizeStop: (_e, ...arr) => onResizeStop(arr, element)
|
|
166
178
|
}, {
|
|
167
179
|
default: vue.withCtx(() => [
|
|
168
|
-
|
|
169
|
-
key: 0,
|
|
180
|
+
vue.createElementVNode("div", {
|
|
170
181
|
class: vue.normalizeClass([vue.unref(cs)("allow")])
|
|
171
|
-
}, null, 2)
|
|
182
|
+
}, null, 2),
|
|
172
183
|
vue.createVNode(designOperate_vue_vue_type_script_setup_true_lang.default, {
|
|
173
184
|
"model-value": vue.unref(value),
|
|
174
185
|
assembly: element,
|
|
175
|
-
index: index2
|
|
176
|
-
height: "100%"
|
|
186
|
+
index: index2
|
|
177
187
|
}, {
|
|
178
188
|
add: vue.withCtx(() => [
|
|
179
189
|
vue.renderSlot(_ctx.$slots, "operate", { value: element })
|
|
@@ -188,7 +198,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
188
198
|
}, 1032, ["model-value", "assembly", "index"])
|
|
189
199
|
]),
|
|
190
200
|
_: 2
|
|
191
|
-
}, 1032, ["class", "scale", "draggable", "resizable", "grid", "x", "y", "w", "h", "z", "onClick", "onDragStop", "
|
|
201
|
+
}, 1032, ["id", "class", "scale", "draggable", "resizable", "grid", "x", "y", "w", "h", "z", "onClick", "onDragStop", "onMouseenter", "onResizeStop"])) : vue.createCommentVNode("", true)
|
|
192
202
|
], 64);
|
|
193
203
|
}), 256))
|
|
194
204
|
], 2)
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { defineComponent, inject, computed, ref, onMounted, openBlock, createElementBlock, normalizeClass, unref, createVNode, isRef, withCtx, createElementVNode, Fragment, renderList, createBlock, withModifiers,
|
|
1
|
+
import { defineComponent, inject, computed, ref, onMounted, openBlock, createElementBlock, normalizeClass, unref, createVNode, isRef, withCtx, createElementVNode, Fragment, renderList, createBlock, withModifiers, renderSlot, createCommentVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import Draggable from "vuedraggable";
|
|
3
3
|
import "./resizable/resizable.js";
|
|
4
4
|
import "./design-operate.js";
|
|
5
5
|
import { getComponObj } from "../../config/util.js";
|
|
6
6
|
import { getClass } from "../../utils/index.js";
|
|
7
|
+
import { clearAlignmentLines, showAlignmentLines } from "./resizable/aligned.js";
|
|
8
|
+
import { uesDistance } from "./resizable/util.js";
|
|
7
9
|
import _sfc_main$1 from "./resizable/resizable2.js";
|
|
8
10
|
import _sfc_main$2 from "./design-operate2.js";
|
|
9
|
-
const defaultSize =
|
|
11
|
+
const defaultSize = 1;
|
|
10
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
13
|
__name: "design-resizable",
|
|
12
14
|
props: {
|
|
@@ -33,6 +35,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
33
35
|
},
|
|
34
36
|
emits: ["update:modelValue"],
|
|
35
37
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
38
|
+
const mouseenter = uesDistance();
|
|
36
39
|
const co = getClass("design-com");
|
|
37
40
|
const cs = getClass("design-resizable");
|
|
38
41
|
const props = __props;
|
|
@@ -65,8 +68,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
68
|
const y = originalEvent.clientY - rects.value.top;
|
|
66
69
|
if (add.value) {
|
|
67
70
|
add.value.positions = add.value.positions || {};
|
|
68
|
-
add.value.positions.x = x;
|
|
69
|
-
add.value.positions.y = y;
|
|
71
|
+
add.value.positions.x = x / scale.value;
|
|
72
|
+
add.value.positions.y = y / scale.value;
|
|
70
73
|
add.value.positions.w = "auto";
|
|
71
74
|
add.value.positions.h = "auto";
|
|
72
75
|
add.value = void 0;
|
|
@@ -82,6 +85,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
82
85
|
element.positions = element.positions || {};
|
|
83
86
|
element.positions.x = arr[0];
|
|
84
87
|
element.positions.y = arr[1];
|
|
88
|
+
clearAlignmentLines();
|
|
85
89
|
};
|
|
86
90
|
const onResizeStop = (arr, element) => {
|
|
87
91
|
element.positions = element.positions || {};
|
|
@@ -89,6 +93,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
93
|
element.positions.y = arr[1];
|
|
90
94
|
element.positions.w = arr[2];
|
|
91
95
|
element.positions.h = arr[3];
|
|
96
|
+
clearAlignmentLines();
|
|
97
|
+
};
|
|
98
|
+
const onDragging = (event) => {
|
|
99
|
+
const dom = event.target;
|
|
100
|
+
showAlignmentLines(dom, 1);
|
|
92
101
|
};
|
|
93
102
|
onMounted(() => {
|
|
94
103
|
if (refResizable.value) {
|
|
@@ -135,8 +144,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
135
144
|
}, [
|
|
136
145
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(value), (element, index) => {
|
|
137
146
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
138
|
-
!element.
|
|
147
|
+
!element.hide ? (openBlock(), createBlock(_sfc_main$1, {
|
|
139
148
|
key: 0,
|
|
149
|
+
id: element.id,
|
|
140
150
|
class: normalizeClass([
|
|
141
151
|
unref(cs)("resizable-item"),
|
|
142
152
|
unref(getComponObj)(element).status?.inline ? "is-inline" : "",
|
|
@@ -145,7 +155,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
145
155
|
scale: unref(scale),
|
|
146
156
|
draggable: !element.design?.islock,
|
|
147
157
|
resizable: !element.design?.islock,
|
|
148
|
-
parent:
|
|
158
|
+
parent: false,
|
|
149
159
|
"min-width": defaultSize,
|
|
150
160
|
"min-height": defaultSize,
|
|
151
161
|
grid: element.positions?.grid || [
|
|
@@ -158,20 +168,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
158
168
|
h: element.positions?.h || "auto",
|
|
159
169
|
z: element.positions?.z,
|
|
160
170
|
onClick: withModifiers(($event) => onClick(element), ["stop"]),
|
|
161
|
-
onDragStop: (...arr) => onDragStop(arr, element),
|
|
162
|
-
|
|
163
|
-
|
|
171
|
+
onDragStop: (_e, ...arr) => onDragStop(arr, element),
|
|
172
|
+
onDragging,
|
|
173
|
+
onResizing: onDragging,
|
|
174
|
+
onMouseenter: unref(mouseenter),
|
|
175
|
+
onResizeStop: (_e, ...arr) => onResizeStop(arr, element)
|
|
164
176
|
}, {
|
|
165
177
|
default: withCtx(() => [
|
|
166
|
-
|
|
167
|
-
key: 0,
|
|
178
|
+
createElementVNode("div", {
|
|
168
179
|
class: normalizeClass([unref(cs)("allow")])
|
|
169
|
-
}, null, 2)
|
|
180
|
+
}, null, 2),
|
|
170
181
|
createVNode(_sfc_main$2, {
|
|
171
182
|
"model-value": unref(value),
|
|
172
183
|
assembly: element,
|
|
173
|
-
index
|
|
174
|
-
height: "100%"
|
|
184
|
+
index
|
|
175
185
|
}, {
|
|
176
186
|
add: withCtx(() => [
|
|
177
187
|
renderSlot(_ctx.$slots, "operate", { value: element })
|
|
@@ -186,7 +196,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
186
196
|
}, 1032, ["model-value", "assembly", "index"])
|
|
187
197
|
]),
|
|
188
198
|
_: 2
|
|
189
|
-
}, 1032, ["class", "scale", "draggable", "resizable", "grid", "x", "y", "w", "h", "z", "onClick", "onDragStop", "
|
|
199
|
+
}, 1032, ["id", "class", "scale", "draggable", "resizable", "grid", "x", "y", "w", "h", "z", "onClick", "onDragStop", "onMouseenter", "onResizeStop"])) : createCommentVNode("", true)
|
|
190
200
|
], 64);
|
|
191
201
|
}), 256))
|
|
192
202
|
], 2)
|