sun-card-design 1.1.37 → 1.1.38

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.
Files changed (152) hide show
  1. package/package.json +1 -1
  2. package/dist/mobile/sun-card-design-mobile.es61.js +0 -98
  3. package/dist/mobile/sun-card-design-mobile.es62.js +0 -98
  4. package/dist/public/sun-card-designer.css +0 -1
  5. package/dist/sun-card-designer.es.js +0 -25
  6. package/dist/sun-card-designer.es10.js +0 -167
  7. package/dist/sun-card-designer.es11.js +0 -197
  8. package/dist/sun-card-designer.es12.js +0 -203
  9. package/dist/sun-card-designer.es13.js +0 -130
  10. package/dist/sun-card-designer.es14.js +0 -120
  11. package/dist/sun-card-designer.es151.js +0 -4
  12. package/dist/sun-card-designer.es152.js +0 -4
  13. package/dist/sun-card-designer.es153.js +0 -4
  14. package/dist/sun-card-designer.es154.js +0 -4
  15. package/dist/sun-card-designer.es155.js +0 -82
  16. package/dist/sun-card-designer.es156.js +0 -91
  17. package/dist/sun-card-designer.es157.js +0 -92
  18. package/dist/sun-card-designer.es158.js +0 -191
  19. package/dist/sun-card-designer.es159.js +0 -86
  20. package/dist/sun-card-designer.es16.js +0 -10
  21. package/dist/sun-card-designer.es160.js +0 -238
  22. package/dist/sun-card-designer.es161.js +0 -113
  23. package/dist/sun-card-designer.es162.js +0 -49
  24. package/dist/sun-card-designer.es163.js +0 -43
  25. package/dist/sun-card-designer.es164.js +0 -39
  26. package/dist/sun-card-designer.es165.js +0 -46
  27. package/dist/sun-card-designer.es166.js +0 -58
  28. package/dist/sun-card-designer.es167.js +0 -56
  29. package/dist/sun-card-designer.es168.js +0 -58
  30. package/dist/sun-card-designer.es169.js +0 -73
  31. package/dist/sun-card-designer.es17.js +0 -333
  32. package/dist/sun-card-designer.es170.js +0 -59
  33. package/dist/sun-card-designer.es171.js +0 -69
  34. package/dist/sun-card-designer.es172.js +0 -182
  35. package/dist/sun-card-designer.es173.js +0 -176
  36. package/dist/sun-card-designer.es174.js +0 -184
  37. package/dist/sun-card-designer.es175.js +0 -409
  38. package/dist/sun-card-designer.es176.js +0 -365
  39. package/dist/sun-card-designer.es177.js +0 -70
  40. package/dist/sun-card-designer.es178.js +0 -68
  41. package/dist/sun-card-designer.es179.js +0 -184
  42. package/dist/sun-card-designer.es18.js +0 -68
  43. package/dist/sun-card-designer.es180.js +0 -193
  44. package/dist/sun-card-designer.es181.js +0 -193
  45. package/dist/sun-card-designer.es182.js +0 -193
  46. package/dist/sun-card-designer.es184.js +0 -228
  47. package/dist/sun-card-designer.es185.js +0 -71
  48. package/dist/sun-card-designer.es19.js +0 -611
  49. package/dist/sun-card-designer.es196.js +0 -4
  50. package/dist/sun-card-designer.es20.js +0 -225
  51. package/dist/sun-card-designer.es201.js +0 -125
  52. package/dist/sun-card-designer.es21.js +0 -69
  53. package/dist/sun-card-designer.es22.js +0 -719
  54. package/dist/sun-card-designer.es220.js +0 -63
  55. package/dist/sun-card-designer.es221.js +0 -80
  56. package/dist/sun-card-designer.es222.js +0 -82
  57. package/dist/sun-card-designer.es223.js +0 -94
  58. package/dist/sun-card-designer.es224.js +0 -87
  59. package/dist/sun-card-designer.es225.js +0 -226
  60. package/dist/sun-card-designer.es226.js +0 -105
  61. package/dist/sun-card-designer.es227.js +0 -45
  62. package/dist/sun-card-designer.es228.js +0 -31
  63. package/dist/sun-card-designer.es229.js +0 -29
  64. package/dist/sun-card-designer.es23.js +0 -211
  65. package/dist/sun-card-designer.es230.js +0 -32
  66. package/dist/sun-card-designer.es231.js +0 -46
  67. package/dist/sun-card-designer.es232.js +0 -42
  68. package/dist/sun-card-designer.es233.js +0 -44
  69. package/dist/sun-card-designer.es234.js +0 -61
  70. package/dist/sun-card-designer.es235.js +0 -46
  71. package/dist/sun-card-designer.es236.js +0 -54
  72. package/dist/sun-card-designer.es237.js +0 -130
  73. package/dist/sun-card-designer.es238.js +0 -127
  74. package/dist/sun-card-designer.es239.js +0 -132
  75. package/dist/sun-card-designer.es24.js +0 -265
  76. package/dist/sun-card-designer.es240.js +0 -375
  77. package/dist/sun-card-designer.es241.js +0 -348
  78. package/dist/sun-card-designer.es242.js +0 -69
  79. package/dist/sun-card-designer.es243.js +0 -65
  80. package/dist/sun-card-designer.es244.js +0 -87
  81. package/dist/sun-card-designer.es245.js +0 -98
  82. package/dist/sun-card-designer.es246.js +0 -98
  83. package/dist/sun-card-designer.es247.js +0 -98
  84. package/dist/sun-card-designer.es25.js +0 -857
  85. package/dist/sun-card-designer.es26.js +0 -768
  86. package/dist/sun-card-designer.es260.js +0 -125
  87. package/dist/sun-card-designer.es27.js +0 -264
  88. package/dist/sun-card-designer.es273.js +0 -192
  89. package/dist/sun-card-designer.es28.js +0 -809
  90. package/dist/sun-card-designer.es29.js +0 -220
  91. package/dist/sun-card-designer.es3.js +0 -506
  92. package/dist/sun-card-designer.es30.js +0 -809
  93. package/dist/sun-card-designer.es31.js +0 -220
  94. package/dist/sun-card-designer.es32.js +0 -820
  95. package/dist/sun-card-designer.es33.js +0 -225
  96. package/dist/sun-card-designer.es34.js +0 -69
  97. package/dist/sun-card-designer.es35.js +0 -375
  98. package/dist/sun-card-designer.es36.js +0 -186
  99. package/dist/sun-card-designer.es37.js +0 -119
  100. package/dist/sun-card-designer.es38.js +0 -354
  101. package/dist/sun-card-designer.es39.js +0 -127
  102. package/dist/sun-card-designer.es4.js +0 -365
  103. package/dist/sun-card-designer.es40.js +0 -100
  104. package/dist/sun-card-designer.es41.js +0 -214
  105. package/dist/sun-card-designer.es42.js +0 -119
  106. package/dist/sun-card-designer.es43.js +0 -250
  107. package/dist/sun-card-designer.es44.js +0 -118
  108. package/dist/sun-card-designer.es45.js +0 -64
  109. package/dist/sun-card-designer.es46.js +0 -223
  110. package/dist/sun-card-designer.es47.js +0 -196
  111. package/dist/sun-card-designer.es48.js +0 -77
  112. package/dist/sun-card-designer.es49.js +0 -85
  113. package/dist/sun-card-designer.es5.js +0 -317
  114. package/dist/sun-card-designer.es50.js +0 -85
  115. package/dist/sun-card-designer.es51.js +0 -64
  116. package/dist/sun-card-designer.es52.js +0 -283
  117. package/dist/sun-card-designer.es53.js +0 -64
  118. package/dist/sun-card-designer.es54.js +0 -142
  119. package/dist/sun-card-designer.es55.js +0 -52
  120. package/dist/sun-card-designer.es56.js +0 -85
  121. package/dist/sun-card-designer.es57.js +0 -258
  122. package/dist/sun-card-designer.es58.js +0 -226
  123. package/dist/sun-card-designer.es59.js +0 -169
  124. package/dist/sun-card-designer.es6.js +0 -190
  125. package/dist/sun-card-designer.es60.js +0 -280
  126. package/dist/sun-card-designer.es61.js +0 -168
  127. package/dist/sun-card-designer.es62.js +0 -219
  128. package/dist/sun-card-designer.es63.js +0 -168
  129. package/dist/sun-card-designer.es64.js +0 -275
  130. package/dist/sun-card-designer.es65.js +0 -760
  131. package/dist/sun-card-designer.es66.js +0 -272
  132. package/dist/sun-card-designer.es67.js +0 -559
  133. package/dist/sun-card-designer.es68.js +0 -124
  134. package/dist/sun-card-designer.es69.js +0 -528
  135. package/dist/sun-card-designer.es7.js +0 -65
  136. package/dist/sun-card-designer.es70.js +0 -185
  137. package/dist/sun-card-designer.es71.js +0 -107
  138. package/dist/sun-card-designer.es72.js +0 -153
  139. package/dist/sun-card-designer.es73.js +0 -315
  140. package/dist/sun-card-designer.es74.js +0 -114
  141. package/dist/sun-card-designer.es76.js +0 -4211
  142. package/dist/sun-card-designer.es79.js +0 -4
  143. package/dist/sun-card-designer.es8.js +0 -171
  144. package/dist/sun-card-designer.es80.js +0 -4
  145. package/dist/sun-card-designer.es81.js +0 -4
  146. package/dist/sun-card-designer.es84.js +0 -228
  147. package/dist/sun-card-designer.es87.js +0 -52
  148. package/dist/sun-card-designer.es88.js +0 -52
  149. package/dist/sun-card-designer.es9.js +0 -207
  150. package/dist/sun-card-designer.es91.js +0 -344
  151. package/dist/sun-card-designer.es92.js +0 -199
  152. package/dist/sun-card-designer.es95.js +0 -180
@@ -1,58 +0,0 @@
1
- import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, withCtx, 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: "inputComp",
8
- props: ["record"],
9
- setup(__props) {
10
- const props = __props;
11
- const cardManageStore = useCardManageStore();
12
- const currentUuid = ref(null);
13
- watch(
14
- () => cardManageStore.currentSelectUuid,
15
- (val) => {
16
- currentUuid.value = val;
17
- }
18
- );
19
- return (_ctx, _cache) => {
20
- const _component_a_input = resolveComponent("a-input");
21
- const _component_a_form_item = resolveComponent("a-form-item");
22
- const _component_a_form = resolveComponent("a-form");
23
- return openBlock(), createElementBlock("div", {
24
- class: normalizeClass(["main-input", { active: currentUuid.value === props.record.uuid }]),
25
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onActive && _ctx.onActive(...args))
26
- }, [
27
- createElementVNode("div", {
28
- class: normalizeClass({ active: currentUuid.value === props.record.uuid }),
29
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
30
- }, [
31
- createVNode(_component_a_form, {
32
- layout: props.record.options.flex
33
- }, {
34
- default: withCtx(() => [
35
- createVNode(_component_a_form_item, {
36
- label: unref(renderTextByVariables)(props.record.options.label)
37
- }, {
38
- default: withCtx(() => [
39
- createVNode(_component_a_input, {
40
- value: props.record.options.defaultValue,
41
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => props.record.options.defaultValue = $event),
42
- placeholder: props.record.options.placeholder
43
- }, null, 8, ["value", "placeholder"])
44
- ]),
45
- _: 1
46
- }, 8, ["label"])
47
- ]),
48
- _: 1
49
- }, 8, ["layout"])
50
- ], 6)
51
- ], 2);
52
- };
53
- }
54
- };
55
- const Input = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c76717c1"]]);
56
- export {
57
- Input as default
58
- };
@@ -1,73 +0,0 @@
1
- import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, withCtx, createTextVNode, toDisplayString, unref } from "vue";
2
- import html2canvas from "html2canvas";
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 _sfc_main = {
8
- __name: "generateImgComp",
9
- props: ["record"],
10
- setup(__props) {
11
- const props = __props;
12
- const cardManageStore = useCardManageStore();
13
- const currentUuid = ref(null);
14
- watch(
15
- () => cardManageStore.currentSelectUuid,
16
- (val) => {
17
- currentUuid.value = val;
18
- }
19
- );
20
- const queryCanvasEl = () => {
21
- const elTo = document.querySelector(".canvasTo");
22
- if (elTo) return elTo;
23
- const el = document.querySelector(".canvas");
24
- return el;
25
- };
26
- const onGenerate = async () => {
27
- try {
28
- const target = queryCanvasEl();
29
- if (!target) return;
30
- const canvas = await html2canvas(target, {
31
- useCORS: true,
32
- backgroundColor: null,
33
- scale: window.devicePixelRatio || 2
34
- });
35
- const dataURL = canvas.toDataURL("image/png");
36
- const link = document.createElement("a");
37
- const ts = /* @__PURE__ */ new Date();
38
- const pad = (n) => n < 10 ? "0" + n : "" + n;
39
- const name = `card-${ts.getFullYear()}${pad(ts.getMonth() + 1)}${pad(ts.getDate())}-${pad(ts.getHours())}${pad(ts.getMinutes())}${pad(ts.getSeconds())}.png`;
40
- link.download = name;
41
- link.href = dataURL;
42
- document.body.appendChild(link);
43
- link.click();
44
- document.body.removeChild(link);
45
- } catch (e) {
46
- }
47
- };
48
- return (_ctx, _cache) => {
49
- const _component_a_button = resolveComponent("a-button");
50
- return openBlock(), createElementBlock("div", {
51
- class: normalizeClass(["main-button", { active: currentUuid.value === props.record.uuid }])
52
- }, [
53
- createElementVNode("div", {
54
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
55
- }, [
56
- createVNode(_component_a_button, {
57
- type: "primary",
58
- onClick: onGenerate
59
- }, {
60
- default: withCtx(() => [
61
- createTextVNode(toDisplayString(unref(renderTextByVariables)(props.record.options.defaultValue)), 1)
62
- ]),
63
- _: 1
64
- })
65
- ], 4)
66
- ], 2);
67
- };
68
- }
69
- };
70
- const GenerateImg = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b3127833"]]);
71
- export {
72
- GenerateImg as default
73
- };
@@ -1,333 +0,0 @@
1
- import { ref, computed, onMounted, onBeforeUnmount, watch, resolveComponent, createElementBlock, openBlock, createElementVNode, createVNode, withCtx, createBlock, withModifiers, createCommentVNode, normalizeStyle, toDisplayString, unref, Fragment, renderList } from "vue";
2
- import { DownOutlined } from "@ant-design/icons-vue";
3
- import { ColorList, ColorNameMap } from "./sun-card-designer.es76.js";
4
- /* empty css */
5
- import _export_sfc from "./sun-card-designer.es16.js";
6
- const _hoisted_1 = { class: "card-pes" };
7
- const _hoisted_2 = { class: "label" };
8
- const _hoisted_3 = { class: "arrow" };
9
- const _hoisted_4 = {
10
- key: 0,
11
- class: "color-picker"
12
- };
13
- const _hoisted_5 = { class: "color-grid" };
14
- const _hoisted_6 = ["onClick"];
15
- const _hoisted_7 = { class: "label" };
16
- const _hoisted_8 = { class: "arrow" };
17
- const _hoisted_9 = {
18
- key: 0,
19
- class: "color-picker"
20
- };
21
- const _hoisted_10 = { class: "color-grid" };
22
- const _hoisted_11 = ["onClick"];
23
- const _hoisted_12 = { class: "label" };
24
- const _hoisted_13 = { class: "arrow" };
25
- const _hoisted_14 = {
26
- key: 0,
27
- class: "color-picker"
28
- };
29
- const _hoisted_15 = { class: "color-grid" };
30
- const _hoisted_16 = ["onClick"];
31
- const _hoisted_17 = { class: "slider-row" };
32
- const _hoisted_18 = { class: "slider-row" };
33
- const _hoisted_19 = { class: "slider-row" };
34
- const _sfc_main = {
35
- __name: "cardStylePes",
36
- props: ["record"],
37
- setup(__props) {
38
- const props = __props;
39
- const bgMode = ref("纯色");
40
- const activePicker = ref(null);
41
- const color = ref("#ffffff");
42
- const startColor = ref("#ffffff");
43
- const endColor = ref("#f5f5f5");
44
- const angle = ref(90);
45
- const colorList = ref(ColorList);
46
- const nameMap = ColorNameMap;
47
- const colorName = computed(() => nameMap[color.value] || "自定义");
48
- const gradientCss = computed(() => `linear-gradient(${angle.value}deg, ${startColor.value}, ${endColor.value})`);
49
- onMounted(() => {
50
- const cfg = props.record.config || {};
51
- const bg = cfg.background || "#ffffff";
52
- if (typeof bg === "string" && bg.includes("gradient")) {
53
- bgMode.value = "渐变";
54
- try {
55
- const match = bg.match(/linear-gradient\(([^)]+)\)/);
56
- if (match && match[1]) {
57
- const parts = match[1].split(",").map((s) => s.trim());
58
- const degPart = parts[0];
59
- const ang = parseInt(degPart);
60
- if (!Number.isNaN(ang)) angle.value = ang;
61
- if (parts[1]) startColor.value = parts[1];
62
- if (parts[2]) endColor.value = parts[2];
63
- }
64
- } catch (e) {
65
- }
66
- } else {
67
- bgMode.value = "纯色";
68
- color.value = bg;
69
- }
70
- });
71
- const togglePicker = (type) => {
72
- activePicker.value = activePicker.value === type ? null : type;
73
- };
74
- const pickSolid = (hex) => {
75
- color.value = hex;
76
- activePicker.value = null;
77
- };
78
- const pickStart = (hex) => {
79
- startColor.value = hex;
80
- activePicker.value = null;
81
- };
82
- const pickEnd = (hex) => {
83
- endColor.value = hex;
84
- activePicker.value = null;
85
- };
86
- const onClickOutside = () => {
87
- activePicker.value = null;
88
- };
89
- onMounted(() => {
90
- document.addEventListener("click", onClickOutside);
91
- });
92
- onBeforeUnmount(() => {
93
- document.removeEventListener("click", onClickOutside);
94
- });
95
- watch(bgMode, (val) => {
96
- if (val === "纯色") {
97
- props.record.config.background = color.value;
98
- } else {
99
- props.record.config.background = gradientCss.value;
100
- }
101
- });
102
- watch(color, (newVal) => {
103
- if (bgMode.value === "纯色") props.record.config.background = newVal;
104
- });
105
- watch([startColor, endColor, angle], () => {
106
- if (bgMode.value === "渐变") props.record.config.background = gradientCss.value;
107
- });
108
- return (_ctx, _cache) => {
109
- const _component_a_segmented = resolveComponent("a-segmented");
110
- const _component_a_form_item = resolveComponent("a-form-item");
111
- const _component_a_col = resolveComponent("a-col");
112
- const _component_a_row = resolveComponent("a-row");
113
- const _component_a_slider = resolveComponent("a-slider");
114
- const _component_a_input_number = resolveComponent("a-input-number");
115
- const _component_a_form = resolveComponent("a-form");
116
- return openBlock(), createElementBlock("div", _hoisted_1, [
117
- _cache[10] || (_cache[10] = createElementVNode("div", { class: "title" }, "样式", -1)),
118
- createVNode(_component_a_form, { layout: "vertical" }, {
119
- default: withCtx(() => [
120
- createVNode(_component_a_row, { gutter: [16, 16] }, {
121
- default: withCtx(() => [
122
- createVNode(_component_a_col, { span: 24 }, {
123
- default: withCtx(() => [
124
- createVNode(_component_a_form_item, { label: "背景模式" }, {
125
- default: withCtx(() => [
126
- createVNode(_component_a_segmented, {
127
- value: bgMode.value,
128
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => bgMode.value = $event),
129
- options: ["纯色", "渐变"]
130
- }, null, 8, ["value"])
131
- ]),
132
- _: 1
133
- })
134
- ]),
135
- _: 1
136
- }),
137
- createVNode(_component_a_col, { span: 24 }, {
138
- default: withCtx(() => [
139
- bgMode.value === "纯色" ? (openBlock(), createBlock(_component_a_form_item, {
140
- key: 0,
141
- label: "背景颜色"
142
- }, {
143
- default: withCtx(() => [
144
- createElementVNode("div", {
145
- class: "color-select",
146
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => togglePicker("solid"), ["stop"]))
147
- }, [
148
- createElementVNode("span", {
149
- class: "swatch",
150
- style: normalizeStyle({ background: color.value })
151
- }, null, 4),
152
- createElementVNode("span", _hoisted_2, toDisplayString(colorName.value), 1),
153
- createElementVNode("span", _hoisted_3, [
154
- createVNode(unref(DownOutlined))
155
- ]),
156
- activePicker.value === "solid" ? (openBlock(), createElementBlock("div", _hoisted_4, [
157
- createElementVNode("div", _hoisted_5, [
158
- (openBlock(true), createElementBlock(Fragment, null, renderList(colorList.value, (c) => {
159
- return openBlock(), createElementBlock("span", {
160
- class: "chip",
161
- key: c,
162
- style: normalizeStyle({ backgroundColor: c }),
163
- onClick: withModifiers(($event) => pickSolid(c), ["stop"])
164
- }, null, 12, _hoisted_6);
165
- }), 128))
166
- ])
167
- ])) : createCommentVNode("", true)
168
- ])
169
- ]),
170
- _: 1
171
- })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
172
- createVNode(_component_a_form_item, { label: "渐变预览" }, {
173
- default: withCtx(() => [
174
- createElementVNode("div", {
175
- class: "gradient-preview",
176
- style: normalizeStyle({ background: gradientCss.value })
177
- }, null, 4)
178
- ]),
179
- _: 1
180
- }),
181
- createVNode(_component_a_row, { gutter: [8, 8] }, {
182
- default: withCtx(() => [
183
- createVNode(_component_a_col, { span: 24 }, {
184
- default: withCtx(() => [
185
- createVNode(_component_a_form_item, { label: "起始颜色" }, {
186
- default: withCtx(() => [
187
- createElementVNode("div", {
188
- class: "color-select",
189
- onClick: _cache[2] || (_cache[2] = withModifiers(($event) => togglePicker("start"), ["stop"]))
190
- }, [
191
- createElementVNode("span", {
192
- class: "swatch",
193
- style: normalizeStyle({ background: startColor.value })
194
- }, null, 4),
195
- createElementVNode("span", _hoisted_7, toDisplayString(unref(nameMap)[startColor.value] || "自定义"), 1),
196
- createElementVNode("span", _hoisted_8, [
197
- createVNode(unref(DownOutlined))
198
- ]),
199
- activePicker.value === "start" ? (openBlock(), createElementBlock("div", _hoisted_9, [
200
- createElementVNode("div", _hoisted_10, [
201
- (openBlock(true), createElementBlock(Fragment, null, renderList(colorList.value, (c) => {
202
- return openBlock(), createElementBlock("span", {
203
- class: "chip",
204
- key: c + "-s",
205
- style: normalizeStyle({ backgroundColor: c }),
206
- onClick: withModifiers(($event) => pickStart(c), ["stop"])
207
- }, null, 12, _hoisted_11);
208
- }), 128))
209
- ])
210
- ])) : createCommentVNode("", true)
211
- ])
212
- ]),
213
- _: 1
214
- })
215
- ]),
216
- _: 1
217
- }),
218
- createVNode(_component_a_col, { span: 24 }, {
219
- default: withCtx(() => [
220
- createVNode(_component_a_form_item, { label: "结束颜色" }, {
221
- default: withCtx(() => [
222
- createElementVNode("div", {
223
- class: "color-select",
224
- onClick: _cache[3] || (_cache[3] = withModifiers(($event) => togglePicker("end"), ["stop"]))
225
- }, [
226
- createElementVNode("span", {
227
- class: "swatch",
228
- style: normalizeStyle({ background: endColor.value })
229
- }, null, 4),
230
- createElementVNode("span", _hoisted_12, toDisplayString(unref(nameMap)[endColor.value] || "自定义"), 1),
231
- createElementVNode("span", _hoisted_13, [
232
- createVNode(unref(DownOutlined))
233
- ]),
234
- activePicker.value === "end" ? (openBlock(), createElementBlock("div", _hoisted_14, [
235
- createElementVNode("div", _hoisted_15, [
236
- (openBlock(true), createElementBlock(Fragment, null, renderList(colorList.value, (c) => {
237
- return openBlock(), createElementBlock("span", {
238
- class: "chip",
239
- key: c + "-e",
240
- style: normalizeStyle({ backgroundColor: c }),
241
- onClick: withModifiers(($event) => pickEnd(c), ["stop"])
242
- }, null, 12, _hoisted_16);
243
- }), 128))
244
- ])
245
- ])) : createCommentVNode("", true)
246
- ])
247
- ]),
248
- _: 1
249
- })
250
- ]),
251
- _: 1
252
- })
253
- ]),
254
- _: 1
255
- }),
256
- createVNode(_component_a_form_item, { label: "角度" }, {
257
- default: withCtx(() => [
258
- createElementVNode("div", _hoisted_17, [
259
- createVNode(_component_a_slider, {
260
- min: 0,
261
- max: 360,
262
- value: angle.value,
263
- "onUpdate:value": _cache[4] || (_cache[4] = ($event) => angle.value = $event),
264
- style: { "flex": "1", "margin-right": "12px" }
265
- }, null, 8, ["value"]),
266
- createVNode(_component_a_input_number, {
267
- min: 0,
268
- max: 360,
269
- value: angle.value,
270
- "onUpdate:value": _cache[5] || (_cache[5] = ($event) => angle.value = $event)
271
- }, null, 8, ["value"])
272
- ])
273
- ]),
274
- _: 1
275
- })
276
- ], 64)),
277
- createVNode(_component_a_form_item, { label: "内边距" }, {
278
- default: withCtx(() => [
279
- createElementVNode("div", _hoisted_18, [
280
- createVNode(_component_a_slider, {
281
- min: 2,
282
- max: 24,
283
- value: props.record.config.padding,
284
- "onUpdate:value": _cache[6] || (_cache[6] = ($event) => props.record.config.padding = $event),
285
- style: { "flex": "1", "margin-right": "12px" }
286
- }, null, 8, ["value"]),
287
- createVNode(_component_a_input_number, {
288
- min: 2,
289
- max: 24,
290
- value: props.record.config.padding,
291
- "onUpdate:value": _cache[7] || (_cache[7] = ($event) => props.record.config.padding = $event)
292
- }, null, 8, ["value"])
293
- ])
294
- ]),
295
- _: 1
296
- }),
297
- createVNode(_component_a_form_item, { label: "圆角" }, {
298
- default: withCtx(() => [
299
- createElementVNode("div", _hoisted_19, [
300
- createVNode(_component_a_slider, {
301
- min: 2,
302
- max: 16,
303
- value: props.record.config.borderRadius,
304
- "onUpdate:value": _cache[8] || (_cache[8] = ($event) => props.record.config.borderRadius = $event),
305
- style: { "flex": "1", "margin-right": "12px" }
306
- }, null, 8, ["value"]),
307
- createVNode(_component_a_input_number, {
308
- min: 2,
309
- max: 16,
310
- value: props.record.config.borderRadius,
311
- "onUpdate:value": _cache[9] || (_cache[9] = ($event) => props.record.config.borderRadius = $event)
312
- }, null, 8, ["value"])
313
- ])
314
- ]),
315
- _: 1
316
- })
317
- ]),
318
- _: 1
319
- })
320
- ]),
321
- _: 1
322
- })
323
- ]),
324
- _: 1
325
- })
326
- ]);
327
- };
328
- }
329
- };
330
- const CardPes = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5ab6c7b8"]]);
331
- export {
332
- CardPes as default
333
- };
@@ -1,59 +0,0 @@
1
- import { ref, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, withCtx, 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: "enterpriseSearch",
8
- props: ["record"],
9
- setup(__props) {
10
- const props = __props;
11
- const cardManageStore = useCardManageStore();
12
- const currentUuid = ref(null);
13
- watch(
14
- () => cardManageStore.currentSelectUuid,
15
- (val) => {
16
- currentUuid.value = val;
17
- }
18
- );
19
- return (_ctx, _cache) => {
20
- const _component_a_select = resolveComponent("a-select");
21
- const _component_a_form_item = resolveComponent("a-form-item");
22
- const _component_a_form = resolveComponent("a-form");
23
- return openBlock(), createElementBlock("div", {
24
- class: normalizeClass(["main-enterpriseSearch", { active: currentUuid.value === props.record.uuid }]),
25
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onActive && _ctx.onActive(...args))
26
- }, [
27
- createElementVNode("div", {
28
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
29
- }, [
30
- createVNode(_component_a_form, {
31
- layout: props.record.options.flex
32
- }, {
33
- default: withCtx(() => [
34
- createVNode(_component_a_form_item, {
35
- label: unref(renderTextByVariables)(props.record.options.label)
36
- }, {
37
- default: withCtx(() => [
38
- createVNode(_component_a_select, {
39
- value: _ctx.value,
40
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.value = $event),
41
- options: [],
42
- style: { "width": "100%" },
43
- placeholder: props.record.options.placeholder
44
- }, null, 8, ["value", "placeholder"])
45
- ]),
46
- _: 1
47
- }, 8, ["label"])
48
- ]),
49
- _: 1
50
- }, 8, ["layout"])
51
- ], 4)
52
- ], 2);
53
- };
54
- }
55
- };
56
- const EnterpriseSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-05f1191a"]]);
57
- export {
58
- EnterpriseSearch as default
59
- };
@@ -1,69 +0,0 @@
1
- import { ref, computed, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createVNode, withCtx } from "vue";
2
- import { useCardManageStore } from "./sun-card-designer.es13.js";
3
- /* empty css */
4
- import _export_sfc from "./sun-card-designer.es16.js";
5
- const _sfc_main = {
6
- __name: "tableComp",
7
- props: ["record"],
8
- setup(__props) {
9
- const props = __props;
10
- const cardManageStore = useCardManageStore();
11
- const currentUuid = ref(null);
12
- const parseJsonSafe = (str) => {
13
- try {
14
- return JSON.parse(str);
15
- } catch {
16
- return null;
17
- }
18
- };
19
- const resolveArrayFromVariable = (name) => {
20
- if (!name) return [];
21
- const v = (cardManageStore.variableList || []).find((e) => e.name === name);
22
- if (!v || !v.defaultValue) return [];
23
- const data = typeof v.defaultValue === "string" ? parseJsonSafe(v.defaultValue) : v.defaultValue;
24
- return Array.isArray(data) ? data : [];
25
- };
26
- const dataSource = computed(() => {
27
- const val = props.record.options.defaultValue;
28
- if (typeof val === "string") {
29
- return resolveArrayFromVariable(val);
30
- }
31
- return Array.isArray(val) ? val : [];
32
- });
33
- watch(
34
- () => cardManageStore.currentSelectUuid,
35
- (val) => {
36
- currentUuid.value = val;
37
- }
38
- );
39
- return (_ctx, _cache) => {
40
- const _component_a_table = resolveComponent("a-table");
41
- return openBlock(), createElementBlock("div", {
42
- class: normalizeClass(["main-table", { active: currentUuid.value === props.record.uuid }]),
43
- style: normalizeStyle({
44
- "--tbl-font-size": (props.record.options.style.fontSize || 14) + "px",
45
- "--tbl-cell-padding": (props.record.options.style.padding || 6) + "px"
46
- })
47
- }, [
48
- createElementVNode("div", {
49
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
50
- }, [
51
- createVNode(_component_a_table, {
52
- columns: props.record.options.columns,
53
- "data-source": dataSource.value,
54
- bordered: props.record.options.style.bordered,
55
- size: "small",
56
- pagination: false
57
- }, {
58
- bodyCell: withCtx(({}) => [..._cache[0] || (_cache[0] = [])]),
59
- _: 1
60
- }, 8, ["columns", "data-source", "bordered"])
61
- ], 4)
62
- ], 6);
63
- };
64
- }
65
- };
66
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-285e6545"]]);
67
- export {
68
- Table as default
69
- };