sun-card-design 1.1.37 → 1.1.39
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/README.md +114 -112
- package/dist/mobile/sun-card-design-mobile.es11.js +3 -3
- package/dist/mobile/sun-card-design-mobile.es3.js +4 -4
- package/dist/mobile/sun-card-design-mobile.es4.js +5 -5
- package/dist/mobile/sun-card-design-mobile.es56.js +3 -4
- package/dist/mobile/sun-card-design-mobile.es6.js +2 -10
- package/dist/pc/sun-card-design-pc.es11.js +3 -3
- package/dist/pc/sun-card-design-pc.es3.js +4 -4
- package/dist/pc/sun-card-design-pc.es4.js +5 -5
- package/dist/pc/sun-card-design-pc.es56.js +3 -4
- package/dist/pc/sun-card-design-pc.es6.js +2 -10
- package/dist/public/sun-card-design.css +1 -1
- package/package.json +98 -96
- package/dist/public/sun-card-designer.css +0 -1
- package/dist/sun-card-designer.es.js +0 -25
- package/dist/sun-card-designer.es10.js +0 -167
- package/dist/sun-card-designer.es11.js +0 -197
- package/dist/sun-card-designer.es12.js +0 -203
- package/dist/sun-card-designer.es13.js +0 -130
- package/dist/sun-card-designer.es14.js +0 -120
- package/dist/sun-card-designer.es151.js +0 -4
- package/dist/sun-card-designer.es152.js +0 -4
- package/dist/sun-card-designer.es153.js +0 -4
- package/dist/sun-card-designer.es154.js +0 -4
- package/dist/sun-card-designer.es155.js +0 -82
- package/dist/sun-card-designer.es156.js +0 -91
- package/dist/sun-card-designer.es157.js +0 -92
- package/dist/sun-card-designer.es158.js +0 -191
- package/dist/sun-card-designer.es159.js +0 -86
- package/dist/sun-card-designer.es16.js +0 -10
- package/dist/sun-card-designer.es160.js +0 -238
- package/dist/sun-card-designer.es161.js +0 -113
- package/dist/sun-card-designer.es162.js +0 -49
- package/dist/sun-card-designer.es163.js +0 -43
- package/dist/sun-card-designer.es164.js +0 -39
- package/dist/sun-card-designer.es165.js +0 -46
- package/dist/sun-card-designer.es166.js +0 -58
- package/dist/sun-card-designer.es167.js +0 -56
- package/dist/sun-card-designer.es168.js +0 -58
- package/dist/sun-card-designer.es169.js +0 -73
- package/dist/sun-card-designer.es17.js +0 -333
- package/dist/sun-card-designer.es170.js +0 -59
- package/dist/sun-card-designer.es171.js +0 -69
- package/dist/sun-card-designer.es172.js +0 -182
- package/dist/sun-card-designer.es173.js +0 -176
- package/dist/sun-card-designer.es174.js +0 -184
- package/dist/sun-card-designer.es175.js +0 -409
- package/dist/sun-card-designer.es176.js +0 -365
- package/dist/sun-card-designer.es177.js +0 -70
- package/dist/sun-card-designer.es178.js +0 -68
- package/dist/sun-card-designer.es179.js +0 -184
- package/dist/sun-card-designer.es18.js +0 -68
- package/dist/sun-card-designer.es180.js +0 -193
- package/dist/sun-card-designer.es181.js +0 -193
- package/dist/sun-card-designer.es182.js +0 -193
- package/dist/sun-card-designer.es184.js +0 -228
- package/dist/sun-card-designer.es185.js +0 -71
- package/dist/sun-card-designer.es19.js +0 -611
- package/dist/sun-card-designer.es196.js +0 -4
- package/dist/sun-card-designer.es20.js +0 -225
- package/dist/sun-card-designer.es201.js +0 -125
- package/dist/sun-card-designer.es21.js +0 -69
- package/dist/sun-card-designer.es22.js +0 -719
- package/dist/sun-card-designer.es220.js +0 -63
- package/dist/sun-card-designer.es221.js +0 -80
- package/dist/sun-card-designer.es222.js +0 -82
- package/dist/sun-card-designer.es223.js +0 -94
- package/dist/sun-card-designer.es224.js +0 -87
- package/dist/sun-card-designer.es225.js +0 -226
- package/dist/sun-card-designer.es226.js +0 -105
- package/dist/sun-card-designer.es227.js +0 -45
- package/dist/sun-card-designer.es228.js +0 -31
- package/dist/sun-card-designer.es229.js +0 -29
- package/dist/sun-card-designer.es23.js +0 -211
- package/dist/sun-card-designer.es230.js +0 -32
- package/dist/sun-card-designer.es231.js +0 -46
- package/dist/sun-card-designer.es232.js +0 -42
- package/dist/sun-card-designer.es233.js +0 -44
- package/dist/sun-card-designer.es234.js +0 -61
- package/dist/sun-card-designer.es235.js +0 -46
- package/dist/sun-card-designer.es236.js +0 -54
- package/dist/sun-card-designer.es237.js +0 -130
- package/dist/sun-card-designer.es238.js +0 -127
- package/dist/sun-card-designer.es239.js +0 -132
- package/dist/sun-card-designer.es24.js +0 -265
- package/dist/sun-card-designer.es240.js +0 -375
- package/dist/sun-card-designer.es241.js +0 -348
- package/dist/sun-card-designer.es242.js +0 -69
- package/dist/sun-card-designer.es243.js +0 -65
- package/dist/sun-card-designer.es244.js +0 -87
- package/dist/sun-card-designer.es245.js +0 -98
- package/dist/sun-card-designer.es246.js +0 -98
- package/dist/sun-card-designer.es247.js +0 -98
- package/dist/sun-card-designer.es25.js +0 -857
- package/dist/sun-card-designer.es26.js +0 -768
- package/dist/sun-card-designer.es260.js +0 -125
- package/dist/sun-card-designer.es27.js +0 -264
- package/dist/sun-card-designer.es273.js +0 -192
- package/dist/sun-card-designer.es28.js +0 -809
- package/dist/sun-card-designer.es29.js +0 -220
- package/dist/sun-card-designer.es3.js +0 -506
- package/dist/sun-card-designer.es30.js +0 -809
- package/dist/sun-card-designer.es31.js +0 -220
- package/dist/sun-card-designer.es32.js +0 -820
- package/dist/sun-card-designer.es33.js +0 -225
- package/dist/sun-card-designer.es34.js +0 -69
- package/dist/sun-card-designer.es35.js +0 -375
- package/dist/sun-card-designer.es36.js +0 -186
- package/dist/sun-card-designer.es37.js +0 -119
- package/dist/sun-card-designer.es38.js +0 -354
- package/dist/sun-card-designer.es39.js +0 -127
- package/dist/sun-card-designer.es4.js +0 -365
- package/dist/sun-card-designer.es40.js +0 -100
- package/dist/sun-card-designer.es41.js +0 -214
- package/dist/sun-card-designer.es42.js +0 -119
- package/dist/sun-card-designer.es43.js +0 -250
- package/dist/sun-card-designer.es44.js +0 -118
- package/dist/sun-card-designer.es45.js +0 -64
- package/dist/sun-card-designer.es46.js +0 -223
- package/dist/sun-card-designer.es47.js +0 -196
- package/dist/sun-card-designer.es48.js +0 -77
- package/dist/sun-card-designer.es49.js +0 -85
- package/dist/sun-card-designer.es5.js +0 -317
- package/dist/sun-card-designer.es50.js +0 -85
- package/dist/sun-card-designer.es51.js +0 -64
- package/dist/sun-card-designer.es52.js +0 -283
- package/dist/sun-card-designer.es53.js +0 -64
- package/dist/sun-card-designer.es54.js +0 -142
- package/dist/sun-card-designer.es55.js +0 -52
- package/dist/sun-card-designer.es56.js +0 -85
- package/dist/sun-card-designer.es57.js +0 -258
- package/dist/sun-card-designer.es58.js +0 -226
- package/dist/sun-card-designer.es59.js +0 -169
- package/dist/sun-card-designer.es6.js +0 -190
- package/dist/sun-card-designer.es60.js +0 -280
- package/dist/sun-card-designer.es61.js +0 -168
- package/dist/sun-card-designer.es62.js +0 -219
- package/dist/sun-card-designer.es63.js +0 -168
- package/dist/sun-card-designer.es64.js +0 -275
- package/dist/sun-card-designer.es65.js +0 -760
- package/dist/sun-card-designer.es66.js +0 -272
- package/dist/sun-card-designer.es67.js +0 -559
- package/dist/sun-card-designer.es68.js +0 -124
- package/dist/sun-card-designer.es69.js +0 -528
- package/dist/sun-card-designer.es7.js +0 -65
- package/dist/sun-card-designer.es70.js +0 -185
- package/dist/sun-card-designer.es71.js +0 -107
- package/dist/sun-card-designer.es72.js +0 -153
- package/dist/sun-card-designer.es73.js +0 -315
- package/dist/sun-card-designer.es74.js +0 -114
- package/dist/sun-card-designer.es76.js +0 -4211
- package/dist/sun-card-designer.es79.js +0 -4
- package/dist/sun-card-designer.es8.js +0 -171
- package/dist/sun-card-designer.es80.js +0 -4
- package/dist/sun-card-designer.es81.js +0 -4
- package/dist/sun-card-designer.es84.js +0 -228
- package/dist/sun-card-designer.es87.js +0 -52
- package/dist/sun-card-designer.es88.js +0 -52
- package/dist/sun-card-designer.es9.js +0 -207
- package/dist/sun-card-designer.es91.js +0 -344
- package/dist/sun-card-designer.es92.js +0 -199
- package/dist/sun-card-designer.es95.js +0 -180
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { ref, computed, resolveComponent, createElementBlock, openBlock, createElementVNode, createVNode, withCtx } from "vue";
|
|
2
|
-
import OpenVariable from "./sun-card-designer.es91.js";
|
|
3
|
-
import EditInput from "./sun-card-designer.es92.js";
|
|
4
|
-
import "./sun-card-designer.es13.js";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
7
|
-
const _hoisted_1 = { class: "title-pes" };
|
|
8
|
-
const _sfc_main = {
|
|
9
|
-
__name: "titleBasePes",
|
|
10
|
-
props: ["record", "sourceData"],
|
|
11
|
-
setup(__props) {
|
|
12
|
-
const props = __props;
|
|
13
|
-
const editInputRef = ref();
|
|
14
|
-
const selectTreeChange = (params) => {
|
|
15
|
-
const { item, node } = params;
|
|
16
|
-
editInputRef.value.insertToken(`{${item.name}#${node}}`);
|
|
17
|
-
};
|
|
18
|
-
const selectChange = (record) => {
|
|
19
|
-
editInputRef.value.insertToken(`{${record.name}}`);
|
|
20
|
-
};
|
|
21
|
-
const inGridWithVariableName = computed(() => {
|
|
22
|
-
return true;
|
|
23
|
-
});
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
const _component_a_form_item = resolveComponent("a-form-item");
|
|
26
|
-
const _component_a_col = resolveComponent("a-col");
|
|
27
|
-
const _component_a_row = resolveComponent("a-row");
|
|
28
|
-
const _component_a_form = resolveComponent("a-form");
|
|
29
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
30
|
-
_cache[0] || (_cache[0] = createElementVNode("div", { class: "title" }, "数据", -1)),
|
|
31
|
-
createVNode(_component_a_form, { layout: "vertical" }, {
|
|
32
|
-
default: withCtx(() => [
|
|
33
|
-
createVNode(_component_a_row, { gutter: [16, 16] }, {
|
|
34
|
-
default: withCtx(() => [
|
|
35
|
-
createVNode(_component_a_col, { span: 24 }, {
|
|
36
|
-
default: withCtx(() => [
|
|
37
|
-
createVNode(_component_a_form_item, { label: "内容" }, {
|
|
38
|
-
default: withCtx(() => [
|
|
39
|
-
createVNode(OpenVariable, {
|
|
40
|
-
disabled: inGridWithVariableName.value,
|
|
41
|
-
onOnSelect: selectChange,
|
|
42
|
-
onOnSelectTree: selectTreeChange
|
|
43
|
-
}, null, 8, ["disabled"]),
|
|
44
|
-
createVNode(EditInput, {
|
|
45
|
-
ref_key: "editInputRef",
|
|
46
|
-
ref: editInputRef,
|
|
47
|
-
record: props.record.options
|
|
48
|
-
}, null, 8, ["record"])
|
|
49
|
-
]),
|
|
50
|
-
_: 1
|
|
51
|
-
})
|
|
52
|
-
]),
|
|
53
|
-
_: 1
|
|
54
|
-
})
|
|
55
|
-
]),
|
|
56
|
-
_: 1
|
|
57
|
-
})
|
|
58
|
-
]),
|
|
59
|
-
_: 1
|
|
60
|
-
})
|
|
61
|
-
]);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const TitlePes = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-aef34c62"]]);
|
|
66
|
-
export {
|
|
67
|
-
TitlePes as default
|
|
68
|
-
};
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createVNode, withCtx, Fragment, renderList, createBlock, createElementVNode, withModifiers, unref } from "vue";
|
|
2
|
-
import draggable from "vuedraggable";
|
|
3
|
-
import FormItem from "./sun-card-designer.es84.js";
|
|
4
|
-
import { useCardManageStore } from "./sun-card-designer.es13.js";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
7
|
-
const _hoisted_1 = ["onClick"];
|
|
8
|
-
const _hoisted_2 = ["onClick"];
|
|
9
|
-
const _sfc_main = {
|
|
10
|
-
__name: "multipleColumn",
|
|
11
|
-
props: ["record", "recordData", "columnsIndex"],
|
|
12
|
-
setup(__props) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const cardManageStore = useCardManageStore();
|
|
15
|
-
const onConfig = (uuid) => {
|
|
16
|
-
cardManageStore.setCurrentSelectUuid(uuid);
|
|
17
|
-
};
|
|
18
|
-
const currentUuid = ref(null);
|
|
19
|
-
watch(
|
|
20
|
-
() => cardManageStore.currentSelectUuid,
|
|
21
|
-
(val) => {
|
|
22
|
-
currentUuid.value = val;
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
const getIndex = (index) => {
|
|
26
|
-
if (index !== void 0) {
|
|
27
|
-
return index;
|
|
28
|
-
}
|
|
29
|
-
return props.columnsIndex;
|
|
30
|
-
};
|
|
31
|
-
const dragFromIndexGrid = ref(-1);
|
|
32
|
-
const hoverToIndexGrid = ref(-1);
|
|
33
|
-
const activeListRef = ref(null);
|
|
34
|
-
const externalTargetList = ref(null);
|
|
35
|
-
const externalTargetIndex = ref(-1);
|
|
36
|
-
const isTargetExternal = ref(false);
|
|
37
|
-
function onGridStart(evt, column) {
|
|
38
|
-
dragFromIndexGrid.value = evt.oldIndex;
|
|
39
|
-
hoverToIndexGrid.value = -1;
|
|
40
|
-
activeListRef.value = column.list;
|
|
41
|
-
isTargetExternal.value = false;
|
|
42
|
-
externalTargetList.value = null;
|
|
43
|
-
externalTargetIndex.value = -1;
|
|
44
|
-
}
|
|
45
|
-
function onGridMove(evt) {
|
|
46
|
-
try {
|
|
47
|
-
const { relatedContext, draggedContext, to, from } = evt;
|
|
48
|
-
const sameContainer = relatedContext && draggedContext && relatedContext.component === draggedContext.component;
|
|
49
|
-
if (sameContainer || to === from) {
|
|
50
|
-
isTargetExternal.value = false;
|
|
51
|
-
externalTargetList.value = null;
|
|
52
|
-
externalTargetIndex.value = -1;
|
|
53
|
-
if (relatedContext && typeof relatedContext.index === "number") {
|
|
54
|
-
hoverToIndexGrid.value = relatedContext.index;
|
|
55
|
-
}
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
isTargetExternal.value = true;
|
|
59
|
-
hoverToIndexGrid.value = -1;
|
|
60
|
-
if (relatedContext) {
|
|
61
|
-
const idx = typeof relatedContext.index === "number" ? relatedContext.index : Array.isArray(relatedContext.list) ? relatedContext.list.length : -1;
|
|
62
|
-
externalTargetIndex.value = idx;
|
|
63
|
-
externalTargetList.value = relatedContext.list || null;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function onGridEnd(evt, column) {
|
|
71
|
-
const from = dragFromIndexGrid.value;
|
|
72
|
-
const list = activeListRef.value || column.list;
|
|
73
|
-
if (!Array.isArray(list)) {
|
|
74
|
-
resetGridState();
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (isTargetExternal.value && externalTargetList.value && Array.isArray(externalTargetList.value)) {
|
|
78
|
-
if (from >= 0 && from < list.length) {
|
|
79
|
-
const item = list.splice(from, 1)[0];
|
|
80
|
-
const insertAt = Math.min(
|
|
81
|
-
Math.max(externalTargetIndex.value, 0),
|
|
82
|
-
externalTargetList.value.length
|
|
83
|
-
);
|
|
84
|
-
externalTargetList.value.splice(insertAt, 0, item);
|
|
85
|
-
}
|
|
86
|
-
resetGridState();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const rawTo = hoverToIndexGrid.value;
|
|
90
|
-
resetGridState();
|
|
91
|
-
if (from === -1 || rawTo === -1 || from === rawTo) return;
|
|
92
|
-
if (from < 0 || from >= list.length) return;
|
|
93
|
-
const moved = list.splice(from, 1)[0];
|
|
94
|
-
let to = rawTo;
|
|
95
|
-
if (from < rawTo) to = rawTo - 1;
|
|
96
|
-
const safeTo = Math.min(Math.max(to, 0), list.length);
|
|
97
|
-
list.splice(safeTo, 0, moved);
|
|
98
|
-
}
|
|
99
|
-
function resetGridState() {
|
|
100
|
-
dragFromIndexGrid.value = -1;
|
|
101
|
-
hoverToIndexGrid.value = -1;
|
|
102
|
-
activeListRef.value = null;
|
|
103
|
-
isTargetExternal.value = false;
|
|
104
|
-
externalTargetList.value = null;
|
|
105
|
-
externalTargetIndex.value = -1;
|
|
106
|
-
}
|
|
107
|
-
const getBackground = () => {
|
|
108
|
-
if (isGradientColor(props.recordData.config.background)) {
|
|
109
|
-
return "none";
|
|
110
|
-
}
|
|
111
|
-
return props.recordData.config.background;
|
|
112
|
-
};
|
|
113
|
-
function isGradientColor(color) {
|
|
114
|
-
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
115
|
-
}
|
|
116
|
-
return (_ctx, _cache) => {
|
|
117
|
-
const _component_a_col = resolveComponent("a-col");
|
|
118
|
-
const _component_a_row = resolveComponent("a-row");
|
|
119
|
-
return openBlock(), createElementBlock("div", {
|
|
120
|
-
class: normalizeClass(["main-grid", { active: currentUuid.value === props.record.uuid }]),
|
|
121
|
-
style: normalizeStyle({ backgroundColor: getBackground() })
|
|
122
|
-
}, [
|
|
123
|
-
createVNode(_component_a_row, {
|
|
124
|
-
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
125
|
-
}, {
|
|
126
|
-
default: withCtx(() => [
|
|
127
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.columns, (item, index) => {
|
|
128
|
-
return openBlock(), createBlock(_component_a_col, {
|
|
129
|
-
key: index.toString(),
|
|
130
|
-
flex: props.record.columns[index]?.flex,
|
|
131
|
-
span: 24,
|
|
132
|
-
style: normalizeStyle({
|
|
133
|
-
flex: props.record.columns[index]?.flex
|
|
134
|
-
})
|
|
135
|
-
}, {
|
|
136
|
-
default: withCtx(() => [
|
|
137
|
-
createElementVNode("div", {
|
|
138
|
-
class: normalizeClass(["box", { active: currentUuid.value === item.uuid }]),
|
|
139
|
-
style: normalizeStyle({
|
|
140
|
-
background: props.record.options.style?.background,
|
|
141
|
-
borderColor: props.record.options.style?.borderColor,
|
|
142
|
-
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
143
|
-
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
144
|
-
justifyContent: props.record.options.style?.alignItems || "start",
|
|
145
|
-
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
146
|
-
boxShadow: props.record.options.style?.boxShadow || null
|
|
147
|
-
}),
|
|
148
|
-
onClick: withModifiers(($event) => onConfig(item.uuid), ["stop"])
|
|
149
|
-
}, [
|
|
150
|
-
createVNode(unref(draggable), {
|
|
151
|
-
list: item.list,
|
|
152
|
-
group: "people",
|
|
153
|
-
animation: 150,
|
|
154
|
-
ghostClass: _ctx.moving,
|
|
155
|
-
emptyInsertThreshold: 30,
|
|
156
|
-
move: onGridMove,
|
|
157
|
-
onStart: ($event) => onGridStart($event, item),
|
|
158
|
-
onEnd: ($event) => onGridEnd($event, item),
|
|
159
|
-
"item-key": "uuid"
|
|
160
|
-
}, {
|
|
161
|
-
item: withCtx(({ element, index: index2 }) => [
|
|
162
|
-
createElementVNode("div", {
|
|
163
|
-
onClick: withModifiers(($event) => onConfig(element.uuid), ["stop"]),
|
|
164
|
-
class: normalizeClass({
|
|
165
|
-
"swap-highlight": index2 === hoverToIndexGrid.value,
|
|
166
|
-
"swap-highlight-bottom": hoverToIndexGrid.value === (activeListRef.value?.length || 0) && index2 === (activeListRef.value?.length || 1) - 1
|
|
167
|
-
})
|
|
168
|
-
}, [
|
|
169
|
-
createVNode(FormItem, {
|
|
170
|
-
record: element,
|
|
171
|
-
recordData: props.recordData,
|
|
172
|
-
columnsIndex: getIndex(item.index)
|
|
173
|
-
}, null, 8, ["record", "recordData", "columnsIndex"])
|
|
174
|
-
], 10, _hoisted_2)
|
|
175
|
-
]),
|
|
176
|
-
_: 2
|
|
177
|
-
}, 1032, ["list", "ghostClass", "onStart", "onEnd"])
|
|
178
|
-
], 14, _hoisted_1)
|
|
179
|
-
]),
|
|
180
|
-
_: 2
|
|
181
|
-
}, 1032, ["flex", "style"]);
|
|
182
|
-
}), 128))
|
|
183
|
-
]),
|
|
184
|
-
_: 1
|
|
185
|
-
}, 8, ["gutter"])
|
|
186
|
-
], 6);
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
const MultipleColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2fe85b44"]]);
|
|
191
|
-
export {
|
|
192
|
-
MultipleColumn as default
|
|
193
|
-
};
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createVNode, withCtx, Fragment, renderList, createBlock, createElementVNode, withModifiers, unref } from "vue";
|
|
2
|
-
import draggable from "vuedraggable";
|
|
3
|
-
import FormItem from "./sun-card-designer.es84.js";
|
|
4
|
-
import { useCardManageStore } from "./sun-card-designer.es13.js";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
7
|
-
const _hoisted_1 = ["onClick"];
|
|
8
|
-
const _hoisted_2 = ["onClick"];
|
|
9
|
-
const _sfc_main = {
|
|
10
|
-
__name: "multipleLine",
|
|
11
|
-
props: ["record", "recordData", "columnsIndex"],
|
|
12
|
-
setup(__props) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const cardManageStore = useCardManageStore();
|
|
15
|
-
const onConfig = (uuid) => {
|
|
16
|
-
cardManageStore.setCurrentSelectUuid(uuid);
|
|
17
|
-
};
|
|
18
|
-
const currentUuid = ref(null);
|
|
19
|
-
watch(
|
|
20
|
-
() => cardManageStore.currentSelectUuid,
|
|
21
|
-
(val) => {
|
|
22
|
-
currentUuid.value = val;
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
const getIndex = (index) => {
|
|
26
|
-
if (index !== void 0) {
|
|
27
|
-
return index;
|
|
28
|
-
}
|
|
29
|
-
return props.columnsIndex;
|
|
30
|
-
};
|
|
31
|
-
const dragFromIndexGrid = ref(-1);
|
|
32
|
-
const hoverToIndexGrid = ref(-1);
|
|
33
|
-
const activeListRef = ref(null);
|
|
34
|
-
const externalTargetList = ref(null);
|
|
35
|
-
const externalTargetIndex = ref(-1);
|
|
36
|
-
const isTargetExternal = ref(false);
|
|
37
|
-
function onGridStart(evt, column) {
|
|
38
|
-
dragFromIndexGrid.value = evt.oldIndex;
|
|
39
|
-
hoverToIndexGrid.value = -1;
|
|
40
|
-
activeListRef.value = column.list;
|
|
41
|
-
isTargetExternal.value = false;
|
|
42
|
-
externalTargetList.value = null;
|
|
43
|
-
externalTargetIndex.value = -1;
|
|
44
|
-
}
|
|
45
|
-
function onGridMove(evt) {
|
|
46
|
-
try {
|
|
47
|
-
const { relatedContext, draggedContext, to, from } = evt;
|
|
48
|
-
const sameContainer = relatedContext && draggedContext && relatedContext.component === draggedContext.component;
|
|
49
|
-
if (sameContainer || to === from) {
|
|
50
|
-
isTargetExternal.value = false;
|
|
51
|
-
externalTargetList.value = null;
|
|
52
|
-
externalTargetIndex.value = -1;
|
|
53
|
-
if (relatedContext && typeof relatedContext.index === "number") {
|
|
54
|
-
hoverToIndexGrid.value = relatedContext.index;
|
|
55
|
-
}
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
isTargetExternal.value = true;
|
|
59
|
-
hoverToIndexGrid.value = -1;
|
|
60
|
-
if (relatedContext) {
|
|
61
|
-
const idx = typeof relatedContext.index === "number" ? relatedContext.index : Array.isArray(relatedContext.list) ? relatedContext.list.length : -1;
|
|
62
|
-
externalTargetIndex.value = idx;
|
|
63
|
-
externalTargetList.value = relatedContext.list || null;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function onGridEnd(evt, column) {
|
|
71
|
-
const from = dragFromIndexGrid.value;
|
|
72
|
-
const list = activeListRef.value || column.list;
|
|
73
|
-
if (!Array.isArray(list)) {
|
|
74
|
-
resetGridState();
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (isTargetExternal.value && externalTargetList.value && Array.isArray(externalTargetList.value)) {
|
|
78
|
-
if (from >= 0 && from < list.length) {
|
|
79
|
-
const item = list.splice(from, 1)[0];
|
|
80
|
-
const insertAt = Math.min(
|
|
81
|
-
Math.max(externalTargetIndex.value, 0),
|
|
82
|
-
externalTargetList.value.length
|
|
83
|
-
);
|
|
84
|
-
externalTargetList.value.splice(insertAt, 0, item);
|
|
85
|
-
}
|
|
86
|
-
resetGridState();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const rawTo = hoverToIndexGrid.value;
|
|
90
|
-
resetGridState();
|
|
91
|
-
if (from === -1 || rawTo === -1 || from === rawTo) return;
|
|
92
|
-
if (from < 0 || from >= list.length) return;
|
|
93
|
-
const moved = list.splice(from, 1)[0];
|
|
94
|
-
let to = rawTo;
|
|
95
|
-
if (from < rawTo) to = rawTo - 1;
|
|
96
|
-
const safeTo = Math.min(Math.max(to, 0), list.length);
|
|
97
|
-
list.splice(safeTo, 0, moved);
|
|
98
|
-
}
|
|
99
|
-
function resetGridState() {
|
|
100
|
-
dragFromIndexGrid.value = -1;
|
|
101
|
-
hoverToIndexGrid.value = -1;
|
|
102
|
-
activeListRef.value = null;
|
|
103
|
-
isTargetExternal.value = false;
|
|
104
|
-
externalTargetList.value = null;
|
|
105
|
-
externalTargetIndex.value = -1;
|
|
106
|
-
}
|
|
107
|
-
const getBackground = () => {
|
|
108
|
-
if (isGradientColor(props.recordData.config.background)) {
|
|
109
|
-
return "none";
|
|
110
|
-
}
|
|
111
|
-
return props.recordData.config.background;
|
|
112
|
-
};
|
|
113
|
-
function isGradientColor(color) {
|
|
114
|
-
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
115
|
-
}
|
|
116
|
-
return (_ctx, _cache) => {
|
|
117
|
-
const _component_a_col = resolveComponent("a-col");
|
|
118
|
-
const _component_a_row = resolveComponent("a-row");
|
|
119
|
-
return openBlock(), createElementBlock("div", {
|
|
120
|
-
class: normalizeClass(["main-grid", { active: currentUuid.value === props.record.uuid }]),
|
|
121
|
-
style: normalizeStyle({ backgroundColor: getBackground() })
|
|
122
|
-
}, [
|
|
123
|
-
createVNode(_component_a_row, {
|
|
124
|
-
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
125
|
-
}, {
|
|
126
|
-
default: withCtx(() => [
|
|
127
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.columns, (item, index) => {
|
|
128
|
-
return openBlock(), createBlock(_component_a_col, {
|
|
129
|
-
key: index.toString(),
|
|
130
|
-
flex: props.record.columns[index]?.flex,
|
|
131
|
-
span: 24,
|
|
132
|
-
style: normalizeStyle({
|
|
133
|
-
flex: _ctx.none
|
|
134
|
-
})
|
|
135
|
-
}, {
|
|
136
|
-
default: withCtx(() => [
|
|
137
|
-
createElementVNode("div", {
|
|
138
|
-
class: normalizeClass(["box", { active: currentUuid.value === item.uuid }]),
|
|
139
|
-
style: normalizeStyle({
|
|
140
|
-
background: props.record.options.style?.background,
|
|
141
|
-
borderColor: props.record.options.style?.borderColor,
|
|
142
|
-
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
143
|
-
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
144
|
-
justifyContent: props.record.options.style?.alignItems || "start",
|
|
145
|
-
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
146
|
-
boxShadow: props.record.options.style?.boxShadow || null
|
|
147
|
-
}),
|
|
148
|
-
onClick: withModifiers(($event) => onConfig(item.uuid), ["stop"])
|
|
149
|
-
}, [
|
|
150
|
-
createVNode(unref(draggable), {
|
|
151
|
-
list: item.list,
|
|
152
|
-
group: "people",
|
|
153
|
-
animation: 150,
|
|
154
|
-
ghostClass: _ctx.moving,
|
|
155
|
-
emptyInsertThreshold: 30,
|
|
156
|
-
move: onGridMove,
|
|
157
|
-
onStart: ($event) => onGridStart($event, item),
|
|
158
|
-
onEnd: ($event) => onGridEnd($event, item),
|
|
159
|
-
"item-key": "uuid"
|
|
160
|
-
}, {
|
|
161
|
-
item: withCtx(({ element, index: index2 }) => [
|
|
162
|
-
createElementVNode("div", {
|
|
163
|
-
onClick: withModifiers(($event) => onConfig(element.uuid), ["stop"]),
|
|
164
|
-
class: normalizeClass({
|
|
165
|
-
"swap-highlight": index2 === hoverToIndexGrid.value,
|
|
166
|
-
"swap-highlight-bottom": hoverToIndexGrid.value === (activeListRef.value?.length || 0) && index2 === (activeListRef.value?.length || 1) - 1
|
|
167
|
-
})
|
|
168
|
-
}, [
|
|
169
|
-
createVNode(FormItem, {
|
|
170
|
-
record: element,
|
|
171
|
-
recordData: props.recordData,
|
|
172
|
-
columnsIndex: getIndex(item.index)
|
|
173
|
-
}, null, 8, ["record", "recordData", "columnsIndex"])
|
|
174
|
-
], 10, _hoisted_2)
|
|
175
|
-
]),
|
|
176
|
-
_: 2
|
|
177
|
-
}, 1032, ["list", "ghostClass", "onStart", "onEnd"])
|
|
178
|
-
], 14, _hoisted_1)
|
|
179
|
-
]),
|
|
180
|
-
_: 2
|
|
181
|
-
}, 1032, ["flex", "style"]);
|
|
182
|
-
}), 128))
|
|
183
|
-
]),
|
|
184
|
-
_: 1
|
|
185
|
-
}, 8, ["gutter"])
|
|
186
|
-
], 6);
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
const MultipleLine = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d4741734"]]);
|
|
191
|
-
export {
|
|
192
|
-
MultipleLine as default
|
|
193
|
-
};
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createVNode, withCtx, Fragment, renderList, createBlock, createElementVNode, withModifiers, unref } from "vue";
|
|
2
|
-
import draggable from "vuedraggable";
|
|
3
|
-
import FormItem from "./sun-card-designer.es84.js";
|
|
4
|
-
import { useCardManageStore } from "./sun-card-designer.es13.js";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
7
|
-
const _hoisted_1 = ["onClick"];
|
|
8
|
-
const _hoisted_2 = ["onClick"];
|
|
9
|
-
const _sfc_main = {
|
|
10
|
-
__name: "gridList",
|
|
11
|
-
props: ["record", "recordData", "columnsIndex"],
|
|
12
|
-
setup(__props) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const cardManageStore = useCardManageStore();
|
|
15
|
-
const onConfig = (uuid) => {
|
|
16
|
-
cardManageStore.setCurrentSelectUuid(uuid);
|
|
17
|
-
};
|
|
18
|
-
const currentUuid = ref(null);
|
|
19
|
-
watch(
|
|
20
|
-
() => cardManageStore.currentSelectUuid,
|
|
21
|
-
(val) => {
|
|
22
|
-
currentUuid.value = val;
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
const getIndex = (index) => {
|
|
26
|
-
if (index !== void 0) {
|
|
27
|
-
return index;
|
|
28
|
-
}
|
|
29
|
-
return props.columnsIndex;
|
|
30
|
-
};
|
|
31
|
-
const dragFromIndexGrid = ref(-1);
|
|
32
|
-
const hoverToIndexGrid = ref(-1);
|
|
33
|
-
const activeListRef = ref(null);
|
|
34
|
-
const externalTargetList = ref(null);
|
|
35
|
-
const externalTargetIndex = ref(-1);
|
|
36
|
-
const isTargetExternal = ref(false);
|
|
37
|
-
function onGridStart(evt, column) {
|
|
38
|
-
dragFromIndexGrid.value = evt.oldIndex;
|
|
39
|
-
hoverToIndexGrid.value = -1;
|
|
40
|
-
activeListRef.value = column.list;
|
|
41
|
-
isTargetExternal.value = false;
|
|
42
|
-
externalTargetList.value = null;
|
|
43
|
-
externalTargetIndex.value = -1;
|
|
44
|
-
}
|
|
45
|
-
function onGridMove(evt) {
|
|
46
|
-
try {
|
|
47
|
-
const { relatedContext, draggedContext, to, from } = evt;
|
|
48
|
-
const sameContainer = relatedContext && draggedContext && relatedContext.component === draggedContext.component;
|
|
49
|
-
if (sameContainer || to === from) {
|
|
50
|
-
isTargetExternal.value = false;
|
|
51
|
-
externalTargetList.value = null;
|
|
52
|
-
externalTargetIndex.value = -1;
|
|
53
|
-
if (relatedContext && typeof relatedContext.index === "number") {
|
|
54
|
-
hoverToIndexGrid.value = relatedContext.index;
|
|
55
|
-
}
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
isTargetExternal.value = true;
|
|
59
|
-
hoverToIndexGrid.value = -1;
|
|
60
|
-
if (relatedContext) {
|
|
61
|
-
const idx = typeof relatedContext.index === "number" ? relatedContext.index : Array.isArray(relatedContext.list) ? relatedContext.list.length : -1;
|
|
62
|
-
externalTargetIndex.value = idx;
|
|
63
|
-
externalTargetList.value = relatedContext.list || null;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function onGridEnd(evt, column) {
|
|
71
|
-
const from = dragFromIndexGrid.value;
|
|
72
|
-
const list = activeListRef.value || column.list;
|
|
73
|
-
if (!Array.isArray(list)) {
|
|
74
|
-
resetGridState();
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (isTargetExternal.value && externalTargetList.value && Array.isArray(externalTargetList.value)) {
|
|
78
|
-
if (from >= 0 && from < list.length) {
|
|
79
|
-
const item = list.splice(from, 1)[0];
|
|
80
|
-
const insertAt = Math.min(
|
|
81
|
-
Math.max(externalTargetIndex.value, 0),
|
|
82
|
-
externalTargetList.value.length
|
|
83
|
-
);
|
|
84
|
-
externalTargetList.value.splice(insertAt, 0, item);
|
|
85
|
-
}
|
|
86
|
-
resetGridState();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const rawTo = hoverToIndexGrid.value;
|
|
90
|
-
resetGridState();
|
|
91
|
-
if (from === -1 || rawTo === -1 || from === rawTo) return;
|
|
92
|
-
if (from < 0 || from >= list.length) return;
|
|
93
|
-
const moved = list.splice(from, 1)[0];
|
|
94
|
-
let to = rawTo;
|
|
95
|
-
if (from < rawTo) to = rawTo - 1;
|
|
96
|
-
const safeTo = Math.min(Math.max(to, 0), list.length);
|
|
97
|
-
list.splice(safeTo, 0, moved);
|
|
98
|
-
}
|
|
99
|
-
function resetGridState() {
|
|
100
|
-
dragFromIndexGrid.value = -1;
|
|
101
|
-
hoverToIndexGrid.value = -1;
|
|
102
|
-
activeListRef.value = null;
|
|
103
|
-
isTargetExternal.value = false;
|
|
104
|
-
externalTargetList.value = null;
|
|
105
|
-
externalTargetIndex.value = -1;
|
|
106
|
-
}
|
|
107
|
-
const getBackground = () => {
|
|
108
|
-
if (isGradientColor(props.recordData.config.background)) {
|
|
109
|
-
return "none";
|
|
110
|
-
}
|
|
111
|
-
return props.recordData.config.background;
|
|
112
|
-
};
|
|
113
|
-
function isGradientColor(color) {
|
|
114
|
-
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
115
|
-
}
|
|
116
|
-
return (_ctx, _cache) => {
|
|
117
|
-
const _component_a_col = resolveComponent("a-col");
|
|
118
|
-
const _component_a_row = resolveComponent("a-row");
|
|
119
|
-
return openBlock(), createElementBlock("div", {
|
|
120
|
-
class: normalizeClass(["main-grid", { active: currentUuid.value === props.record.uuid }]),
|
|
121
|
-
style: normalizeStyle({ backgroundColor: getBackground() })
|
|
122
|
-
}, [
|
|
123
|
-
createVNode(_component_a_row, {
|
|
124
|
-
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
125
|
-
}, {
|
|
126
|
-
default: withCtx(() => [
|
|
127
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.columns, (item, index) => {
|
|
128
|
-
return openBlock(), createBlock(_component_a_col, {
|
|
129
|
-
key: index.toString(),
|
|
130
|
-
flex: props.record.columns[index]?.flex,
|
|
131
|
-
span: 24 / props.record.options.autoNumber,
|
|
132
|
-
style: normalizeStyle({
|
|
133
|
-
flex: _ctx.none
|
|
134
|
-
})
|
|
135
|
-
}, {
|
|
136
|
-
default: withCtx(() => [
|
|
137
|
-
createElementVNode("div", {
|
|
138
|
-
class: normalizeClass(["box", { active: currentUuid.value === item.uuid }]),
|
|
139
|
-
style: normalizeStyle({
|
|
140
|
-
background: props.record.options.style?.background,
|
|
141
|
-
borderColor: props.record.options.style?.borderColor,
|
|
142
|
-
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
143
|
-
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
144
|
-
justifyContent: props.record.options.style?.alignItems || "start",
|
|
145
|
-
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
146
|
-
boxShadow: props.record.options.style?.boxShadow || null
|
|
147
|
-
}),
|
|
148
|
-
onClick: withModifiers(($event) => onConfig(item.uuid), ["stop"])
|
|
149
|
-
}, [
|
|
150
|
-
createVNode(unref(draggable), {
|
|
151
|
-
list: item.list,
|
|
152
|
-
group: "people",
|
|
153
|
-
animation: 150,
|
|
154
|
-
ghostClass: _ctx.moving,
|
|
155
|
-
emptyInsertThreshold: 30,
|
|
156
|
-
move: onGridMove,
|
|
157
|
-
onStart: ($event) => onGridStart($event, item),
|
|
158
|
-
onEnd: ($event) => onGridEnd($event, item),
|
|
159
|
-
"item-key": "uuid"
|
|
160
|
-
}, {
|
|
161
|
-
item: withCtx(({ element, index: index2 }) => [
|
|
162
|
-
createElementVNode("div", {
|
|
163
|
-
onClick: withModifiers(($event) => onConfig(element.uuid), ["stop"]),
|
|
164
|
-
class: normalizeClass({
|
|
165
|
-
"swap-highlight": index2 === hoverToIndexGrid.value,
|
|
166
|
-
"swap-highlight-bottom": hoverToIndexGrid.value === (activeListRef.value?.length || 0) && index2 === (activeListRef.value?.length || 1) - 1
|
|
167
|
-
})
|
|
168
|
-
}, [
|
|
169
|
-
createVNode(FormItem, {
|
|
170
|
-
record: element,
|
|
171
|
-
recordData: props.recordData,
|
|
172
|
-
columnsIndex: getIndex(item.index)
|
|
173
|
-
}, null, 8, ["record", "recordData", "columnsIndex"])
|
|
174
|
-
], 10, _hoisted_2)
|
|
175
|
-
]),
|
|
176
|
-
_: 2
|
|
177
|
-
}, 1032, ["list", "ghostClass", "onStart", "onEnd"])
|
|
178
|
-
], 14, _hoisted_1)
|
|
179
|
-
]),
|
|
180
|
-
_: 2
|
|
181
|
-
}, 1032, ["flex", "span", "style"]);
|
|
182
|
-
}), 128))
|
|
183
|
-
]),
|
|
184
|
-
_: 1
|
|
185
|
-
}, 8, ["gutter"])
|
|
186
|
-
], 6);
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
const GridList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-39dc02c9"]]);
|
|
191
|
-
export {
|
|
192
|
-
GridList as default
|
|
193
|
-
};
|