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,82 +0,0 @@
|
|
|
1
|
-
import { ref, watch, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, unref } from "vue";
|
|
2
|
-
import { renderTextByVariables } from "./sun-card-designer.es14.js";
|
|
3
|
-
import { useCardManageStore } from "./sun-card-designer.es13.js";
|
|
4
|
-
/* empty css */
|
|
5
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
6
|
-
const _sfc_main = {
|
|
7
|
-
__name: "titleComp",
|
|
8
|
-
props: ["record", "columnsIndex"],
|
|
9
|
-
setup(__props) {
|
|
10
|
-
const props = __props;
|
|
11
|
-
const cardManageStore = useCardManageStore();
|
|
12
|
-
const currentUuid = ref(null);
|
|
13
|
-
const formatPx = (value, fallback) => {
|
|
14
|
-
const fallbackValue = typeof fallback === "number" ? `${fallback}px` : fallback;
|
|
15
|
-
if (value === void 0 || value === null || value === "") return fallbackValue;
|
|
16
|
-
if (typeof value === "number") return `${value}px`;
|
|
17
|
-
if (typeof value === "string") {
|
|
18
|
-
const trimmed = value.trim();
|
|
19
|
-
if (!trimmed) return fallbackValue;
|
|
20
|
-
if (/^-?\d+(\.\d+)?$/.test(trimmed)) return `${trimmed}px`;
|
|
21
|
-
return trimmed;
|
|
22
|
-
}
|
|
23
|
-
return fallbackValue;
|
|
24
|
-
};
|
|
25
|
-
const getAlign = () => {
|
|
26
|
-
const obj = {
|
|
27
|
-
"left": "flex-start",
|
|
28
|
-
"center": "center",
|
|
29
|
-
"right": "flex-end"
|
|
30
|
-
};
|
|
31
|
-
return obj[props.record.options.style.align];
|
|
32
|
-
};
|
|
33
|
-
watch(
|
|
34
|
-
() => cardManageStore.currentSelectUuid,
|
|
35
|
-
(val) => {
|
|
36
|
-
currentUuid.value = val;
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
return (_ctx, _cache) => {
|
|
40
|
-
return openBlock(), createElementBlock("div", {
|
|
41
|
-
class: normalizeClass(["main-title", { active: currentUuid.value === props.record.uuid }]),
|
|
42
|
-
style: normalizeStyle({
|
|
43
|
-
justifyContent: getAlign()
|
|
44
|
-
})
|
|
45
|
-
}, [
|
|
46
|
-
createElementVNode("div", {
|
|
47
|
-
style: normalizeStyle({
|
|
48
|
-
display: "flex",
|
|
49
|
-
alignItems: "center",
|
|
50
|
-
padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px`
|
|
51
|
-
})
|
|
52
|
-
}, [
|
|
53
|
-
props.record.options.hasLine ? (openBlock(), createElementBlock("div", {
|
|
54
|
-
key: 0,
|
|
55
|
-
class: "line",
|
|
56
|
-
style: normalizeStyle({
|
|
57
|
-
background: props.record.options.hasLineStyle.background,
|
|
58
|
-
width: formatPx(props.record.options.hasLineStyle?.width, 5),
|
|
59
|
-
height: formatPx(
|
|
60
|
-
props.record.options.hasLineStyle?.height,
|
|
61
|
-
props.record.options.style.size ?? 16
|
|
62
|
-
),
|
|
63
|
-
borderRadius: formatPx(props.record.options.hasLineStyle?.borderRadius, 1),
|
|
64
|
-
marginRight: formatPx(props.record.options.hasLineStyle?.marginRight, 6)
|
|
65
|
-
})
|
|
66
|
-
}, null, 4)) : createCommentVNode("", true),
|
|
67
|
-
createElementVNode("div", {
|
|
68
|
-
style: normalizeStyle({
|
|
69
|
-
fontWeight: "500",
|
|
70
|
-
fontSize: props.record.options.style.size + "px",
|
|
71
|
-
color: props.record.options.style.color
|
|
72
|
-
})
|
|
73
|
-
}, toDisplayString(unref(renderTextByVariables)(props.record.options.defaultValue, props.columnsIndex)), 5)
|
|
74
|
-
], 4)
|
|
75
|
-
], 6);
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
const Title = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-56af263c"]]);
|
|
80
|
-
export {
|
|
81
|
-
Title as default
|
|
82
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { ref, watch, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createCommentVNode, createTextVNode, toDisplayString, unref } from "vue";
|
|
2
|
-
import { renderTextByVariables } from "./sun-card-designer.es14.js";
|
|
3
|
-
import { useCardManageStore } from "./sun-card-designer.es13.js";
|
|
4
|
-
/* empty css */
|
|
5
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
6
|
-
const _hoisted_1 = {
|
|
7
|
-
key: 0,
|
|
8
|
-
style: { "font-weight": "600" }
|
|
9
|
-
};
|
|
10
|
-
const _sfc_main = {
|
|
11
|
-
__name: "textComp",
|
|
12
|
-
props: ["record", "columnsIndex"],
|
|
13
|
-
setup(__props) {
|
|
14
|
-
const props = __props;
|
|
15
|
-
const cardManageStore = useCardManageStore();
|
|
16
|
-
const currentUuid = ref(null);
|
|
17
|
-
const formatPx = (value, fallback) => {
|
|
18
|
-
const fallbackValue = typeof fallback === "number" ? `${fallback}px` : fallback;
|
|
19
|
-
if (value === void 0 || value === null || value === "") return fallbackValue;
|
|
20
|
-
if (typeof value === "number") return `${value}px`;
|
|
21
|
-
if (typeof value === "string") {
|
|
22
|
-
const trimmed = value.trim();
|
|
23
|
-
if (!trimmed) return fallbackValue;
|
|
24
|
-
if (/^-?\d+(\.\d+)?$/.test(trimmed)) return `${trimmed}px`;
|
|
25
|
-
return trimmed;
|
|
26
|
-
}
|
|
27
|
-
return fallbackValue;
|
|
28
|
-
};
|
|
29
|
-
watch(
|
|
30
|
-
() => cardManageStore.currentSelectUuid,
|
|
31
|
-
(val) => {
|
|
32
|
-
currentUuid.value = val;
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
const getAlign = () => {
|
|
36
|
-
const obj = {
|
|
37
|
-
"left": "flex-start",
|
|
38
|
-
"center": "center",
|
|
39
|
-
"right": "flex-end"
|
|
40
|
-
};
|
|
41
|
-
return obj[props.record.options.style.textAlign];
|
|
42
|
-
};
|
|
43
|
-
return (_ctx, _cache) => {
|
|
44
|
-
return openBlock(), createElementBlock("div", {
|
|
45
|
-
class: normalizeClass(["main-text", { active: currentUuid.value === props.record.uuid }]),
|
|
46
|
-
style: normalizeStyle({
|
|
47
|
-
justifyContent: getAlign(),
|
|
48
|
-
textIndent: props.record.options.style.textIndent + "em"
|
|
49
|
-
})
|
|
50
|
-
}, [
|
|
51
|
-
createElementVNode("div", {
|
|
52
|
-
style: normalizeStyle({
|
|
53
|
-
display: "flex",
|
|
54
|
-
alignItems: "center",
|
|
55
|
-
padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px`
|
|
56
|
-
})
|
|
57
|
-
}, [
|
|
58
|
-
props.record.options.hasLine ? (openBlock(), createElementBlock("div", {
|
|
59
|
-
key: 0,
|
|
60
|
-
class: "line",
|
|
61
|
-
style: normalizeStyle({
|
|
62
|
-
background: props.record.options.hasLineStyle.background,
|
|
63
|
-
width: formatPx(props.record.options.hasLineStyle?.width, 4),
|
|
64
|
-
height: formatPx(
|
|
65
|
-
props.record.options.hasLineStyle?.height,
|
|
66
|
-
props.record.options.style.textSize || "14px"
|
|
67
|
-
),
|
|
68
|
-
borderRadius: formatPx(props.record.options.hasLineStyle?.borderRadius, 1),
|
|
69
|
-
marginRight: formatPx(props.record.options.hasLineStyle?.marginRight, 6)
|
|
70
|
-
})
|
|
71
|
-
}, null, 4)) : createCommentVNode("", true),
|
|
72
|
-
createElementVNode("div", {
|
|
73
|
-
style: normalizeStyle({
|
|
74
|
-
color: props.record.options.style.textColor,
|
|
75
|
-
fontSize: props.record.options.style.textSize,
|
|
76
|
-
textAlign: props.record.options.style.textAlign,
|
|
77
|
-
textDecoration: props.record.options.style.underline
|
|
78
|
-
})
|
|
79
|
-
}, [
|
|
80
|
-
props.record.options.hasTitle ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(props.record.options.titleValue), 1)) : createCommentVNode("", true),
|
|
81
|
-
createTextVNode(" " + toDisplayString(unref(renderTextByVariables)(props.record.options.defaultValue, props.columnsIndex)), 1)
|
|
82
|
-
], 4)
|
|
83
|
-
], 4)
|
|
84
|
-
], 6);
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
const Text = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-70c513ac"]]);
|
|
89
|
-
export {
|
|
90
|
-
Text as default
|
|
91
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createVNode, createSlots, withCtx, createTextVNode, toDisplayString, unref, createBlock, resolveDynamicComponent } from "vue";
|
|
2
|
-
import { renderTextByVariables } from "./sun-card-designer.es14.js";
|
|
3
|
-
import { useCardManageStore } from "./sun-card-designer.es13.js";
|
|
4
|
-
import { EditOutlined, DeleteOutlined, CloseOutlined, CheckOutlined, ClearOutlined, DownloadOutlined, SearchOutlined } from "@ant-design/icons-vue";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
7
|
-
const _sfc_main = {
|
|
8
|
-
__name: "buttonComp",
|
|
9
|
-
props: ["record", "columnsIndex"],
|
|
10
|
-
setup(__props) {
|
|
11
|
-
const props = __props;
|
|
12
|
-
const iconMap = {
|
|
13
|
-
SearchOutlined,
|
|
14
|
-
DownloadOutlined,
|
|
15
|
-
ClearOutlined,
|
|
16
|
-
CheckOutlined,
|
|
17
|
-
CloseOutlined,
|
|
18
|
-
DeleteOutlined,
|
|
19
|
-
EditOutlined
|
|
20
|
-
};
|
|
21
|
-
const cardManageStore = useCardManageStore();
|
|
22
|
-
const currentUuid = ref(null);
|
|
23
|
-
watch(
|
|
24
|
-
() => cardManageStore.currentSelectUuid,
|
|
25
|
-
(val) => {
|
|
26
|
-
currentUuid.value = val;
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
const getWidth = () => {
|
|
30
|
-
const obj = {
|
|
31
|
-
auto: "auto",
|
|
32
|
-
all: "100%",
|
|
33
|
-
fixed: props.record.options.style.widthValue + "px"
|
|
34
|
-
};
|
|
35
|
-
return obj[props.record.options.style.widthType];
|
|
36
|
-
};
|
|
37
|
-
const getAlign = () => {
|
|
38
|
-
const obj = {
|
|
39
|
-
left: "flex-start",
|
|
40
|
-
center: "center",
|
|
41
|
-
right: "flex-end"
|
|
42
|
-
};
|
|
43
|
-
return obj[props.record.options.style.align];
|
|
44
|
-
};
|
|
45
|
-
return (_ctx, _cache) => {
|
|
46
|
-
const _component_a_button = resolveComponent("a-button");
|
|
47
|
-
return openBlock(), createElementBlock("div", {
|
|
48
|
-
class: normalizeClass(["main-button", { active: currentUuid.value === props.record.uuid }]),
|
|
49
|
-
style: normalizeStyle({
|
|
50
|
-
justifyContent: getAlign()
|
|
51
|
-
})
|
|
52
|
-
}, [
|
|
53
|
-
createElementVNode("div", {
|
|
54
|
-
style: normalizeStyle({
|
|
55
|
-
padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px`,
|
|
56
|
-
width: "100%",
|
|
57
|
-
height: "100%"
|
|
58
|
-
})
|
|
59
|
-
}, [
|
|
60
|
-
createVNode(_component_a_button, {
|
|
61
|
-
type: "primary",
|
|
62
|
-
size: props.record.options.style.size,
|
|
63
|
-
style: normalizeStyle({
|
|
64
|
-
background: props.record.options.style.background,
|
|
65
|
-
color: props.record.options.style.color,
|
|
66
|
-
borderRadius: props.record.options.style.borderRadius + "px",
|
|
67
|
-
width: getWidth(),
|
|
68
|
-
float: props.record.options.style.align
|
|
69
|
-
})
|
|
70
|
-
}, createSlots({
|
|
71
|
-
default: withCtx(() => [
|
|
72
|
-
createTextVNode(" " + toDisplayString(unref(renderTextByVariables)(props.record.options.defaultValue, props.columnsIndex)), 1)
|
|
73
|
-
]),
|
|
74
|
-
_: 2
|
|
75
|
-
}, [
|
|
76
|
-
props.record.options.style?.iconName ? {
|
|
77
|
-
name: "icon",
|
|
78
|
-
fn: withCtx(() => [
|
|
79
|
-
(openBlock(), createBlock(resolveDynamicComponent(iconMap[props.record.options.style?.iconName])))
|
|
80
|
-
]),
|
|
81
|
-
key: "0"
|
|
82
|
-
} : void 0
|
|
83
|
-
]), 1032, ["size", "style"])
|
|
84
|
-
], 4)
|
|
85
|
-
], 6);
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-22dd3bba"]]);
|
|
90
|
-
export {
|
|
91
|
-
Button as default
|
|
92
|
-
};
|
|
@@ -1,191 +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: "gridComp",
|
|
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: props.record.options.mode === "auto" ? 24 / props.record.options.autoNumber : 24,
|
|
132
|
-
style: normalizeStyle({ flex: props.record.options.mode === "vertical" ? props.record.columns[index].flex : _ctx.none })
|
|
133
|
-
}, {
|
|
134
|
-
default: withCtx(() => [
|
|
135
|
-
createElementVNode("div", {
|
|
136
|
-
class: normalizeClass(["box", { active: currentUuid.value === item.uuid }]),
|
|
137
|
-
style: normalizeStyle({
|
|
138
|
-
background: props.record.options.style.background,
|
|
139
|
-
borderColor: props.record.options.style.borderColor,
|
|
140
|
-
borderRadius: props.record.options.style.borderRadius + "px",
|
|
141
|
-
padding: props.record.options.style.tbPadding + "px " + props.record.options.style.lrPadding + "px",
|
|
142
|
-
justifyContent: props.record.options.style?.alignItems || "start",
|
|
143
|
-
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
144
|
-
boxShadow: props.record.options.style?.boxShadow || null
|
|
145
|
-
}),
|
|
146
|
-
onClick: withModifiers(($event) => onConfig(item.uuid), ["stop"])
|
|
147
|
-
}, [
|
|
148
|
-
createVNode(unref(draggable), {
|
|
149
|
-
list: item.list,
|
|
150
|
-
group: "people",
|
|
151
|
-
animation: 150,
|
|
152
|
-
ghostClass: _ctx.moving,
|
|
153
|
-
emptyInsertThreshold: 30,
|
|
154
|
-
move: onGridMove,
|
|
155
|
-
onStart: ($event) => onGridStart($event, item),
|
|
156
|
-
onEnd: ($event) => onGridEnd($event, item),
|
|
157
|
-
"item-key": "uuid"
|
|
158
|
-
}, {
|
|
159
|
-
item: withCtx(({ element, index: index2 }) => [
|
|
160
|
-
createElementVNode("div", {
|
|
161
|
-
onClick: withModifiers(($event) => onConfig(element.uuid), ["stop"]),
|
|
162
|
-
class: normalizeClass({
|
|
163
|
-
"swap-highlight": index2 === hoverToIndexGrid.value,
|
|
164
|
-
"swap-highlight-bottom": hoverToIndexGrid.value === (activeListRef.value?.length || 0) && index2 === (activeListRef.value?.length || 1) - 1
|
|
165
|
-
})
|
|
166
|
-
}, [
|
|
167
|
-
createVNode(FormItem, {
|
|
168
|
-
record: element,
|
|
169
|
-
recordData: props.recordData,
|
|
170
|
-
columnsIndex: getIndex(item.index)
|
|
171
|
-
}, null, 8, ["record", "recordData", "columnsIndex"])
|
|
172
|
-
], 10, _hoisted_2)
|
|
173
|
-
]),
|
|
174
|
-
_: 2
|
|
175
|
-
}, 1032, ["list", "ghostClass", "onStart", "onEnd"])
|
|
176
|
-
], 14, _hoisted_1)
|
|
177
|
-
]),
|
|
178
|
-
_: 2
|
|
179
|
-
}, 1032, ["flex", "span", "style"]);
|
|
180
|
-
}), 128))
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
}, 8, ["gutter"])
|
|
184
|
-
], 6);
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const Grid = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-db40e7c8"]]);
|
|
189
|
-
export {
|
|
190
|
-
Grid as default
|
|
191
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createCommentVNode, unref, toDisplayString, createVNode, withCtx, createTextVNode } from "vue";
|
|
2
|
-
import { fileIconSvg } from "./sun-card-designer.es6.js";
|
|
3
|
-
import { renderTextByVariables } from "./sun-card-designer.es14.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 = { class: "file-box" };
|
|
8
|
-
const _hoisted_2 = ["innerHTML"];
|
|
9
|
-
const _hoisted_3 = {
|
|
10
|
-
key: 0,
|
|
11
|
-
style: { "margin-top": "8px" }
|
|
12
|
-
};
|
|
13
|
-
const _sfc_main = {
|
|
14
|
-
__name: "fileComp",
|
|
15
|
-
props: ["record", "columnsIndex"],
|
|
16
|
-
setup(__props) {
|
|
17
|
-
const props = __props;
|
|
18
|
-
const cardManageStore = useCardManageStore();
|
|
19
|
-
const currentUuid = ref(null);
|
|
20
|
-
watch(
|
|
21
|
-
() => cardManageStore.currentSelectUuid,
|
|
22
|
-
(val) => {
|
|
23
|
-
currentUuid.value = val;
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
const toPx = (v) => typeof v === "number" ? `${v}px` : v || void 0;
|
|
27
|
-
const colorSafe = (v) => v && typeof v === "string" ? v : "#000000";
|
|
28
|
-
return (_ctx, _cache) => {
|
|
29
|
-
const _component_a_button = resolveComponent("a-button");
|
|
30
|
-
return openBlock(), createElementBlock("div", {
|
|
31
|
-
class: normalizeClass(["main-title", { active: currentUuid.value === props.record.uuid }]),
|
|
32
|
-
style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 2}px ${props.record.options?.style?.lrPadding || 2}px` })
|
|
33
|
-
}, [
|
|
34
|
-
createElementVNode("div", null, [
|
|
35
|
-
createElementVNode("div", _hoisted_1, [
|
|
36
|
-
createElementVNode("div", {
|
|
37
|
-
class: normalizeClass(["file-icon", { "align-center": !props.record.options.subtitle }]),
|
|
38
|
-
style: normalizeStyle({ color: colorSafe(props.record.options.style.iconColor) }),
|
|
39
|
-
innerHTML: unref(fileIconSvg)()
|
|
40
|
-
}, null, 14, _hoisted_2),
|
|
41
|
-
createElementVNode("div", {
|
|
42
|
-
class: normalizeClass(["name", { "align-center": !props.record.options.subtitle }]),
|
|
43
|
-
style: normalizeStyle({
|
|
44
|
-
fontSize: toPx(props.record.options.style.nameSize),
|
|
45
|
-
fontWeight: props.record.options.style.nameWeight,
|
|
46
|
-
color: colorSafe(props.record.options.style.nameColor)
|
|
47
|
-
})
|
|
48
|
-
}, toDisplayString(unref(renderTextByVariables)(props.record.options.defaultValue, props.columnsIndex)), 7),
|
|
49
|
-
props.record.options.subtitle ? (openBlock(), createElementBlock("div", {
|
|
50
|
-
key: 0,
|
|
51
|
-
class: "subtitle",
|
|
52
|
-
style: normalizeStyle({
|
|
53
|
-
fontSize: toPx(props.record.options.style.subtitleSize),
|
|
54
|
-
color: colorSafe(props.record.options.style.subtitleColor)
|
|
55
|
-
})
|
|
56
|
-
}, toDisplayString(unref(renderTextByVariables)(props.record.options.subtitle, props.columnsIndex)), 5)) : createCommentVNode("", true)
|
|
57
|
-
]),
|
|
58
|
-
createElementVNode("div", {
|
|
59
|
-
class: "content",
|
|
60
|
-
style: normalizeStyle({
|
|
61
|
-
fontSize: toPx(props.record.options.style.contentSize),
|
|
62
|
-
marginTop: "6px",
|
|
63
|
-
marginLeft: "6px",
|
|
64
|
-
color: colorSafe(props.record.options.style.contentColor)
|
|
65
|
-
})
|
|
66
|
-
}, toDisplayString(unref(renderTextByVariables)(props.record.options.content, props.columnsIndex)), 5),
|
|
67
|
-
props.record.options?.isUpdate ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
68
|
-
createVNode(_component_a_button, {
|
|
69
|
-
type: "primary",
|
|
70
|
-
size: "small"
|
|
71
|
-
}, {
|
|
72
|
-
default: withCtx(() => [
|
|
73
|
-
createTextVNode(toDisplayString(props.record.options.updateText), 1)
|
|
74
|
-
]),
|
|
75
|
-
_: 1
|
|
76
|
-
})
|
|
77
|
-
])) : createCommentVNode("", true)
|
|
78
|
-
])
|
|
79
|
-
], 6);
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const File = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4c901e52"]]);
|
|
84
|
-
export {
|
|
85
|
-
File as default
|
|
86
|
-
};
|