sun-card-design 1.2.2 → 1.2.4

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 (64) hide show
  1. package/dist/mobile/sun-card-design-mobile.es10.js +13 -7
  2. package/dist/mobile/sun-card-design-mobile.es11.js +19 -12
  3. package/dist/mobile/sun-card-design-mobile.es12.js +11 -9
  4. package/dist/mobile/sun-card-design-mobile.es13.js +28 -22
  5. package/dist/mobile/sun-card-design-mobile.es14.js +13 -7
  6. package/dist/mobile/sun-card-design-mobile.es15.js +43 -23
  7. package/dist/mobile/sun-card-design-mobile.es16.js +13 -7
  8. package/dist/mobile/sun-card-design-mobile.es17.js +14 -8
  9. package/dist/mobile/sun-card-design-mobile.es18.js +14 -8
  10. package/dist/mobile/sun-card-design-mobile.es19.js +21 -11
  11. package/dist/mobile/sun-card-design-mobile.es20.js +45 -17
  12. package/dist/mobile/sun-card-design-mobile.es21.js +16 -9
  13. package/dist/mobile/sun-card-design-mobile.es22.js +19 -12
  14. package/dist/mobile/sun-card-design-mobile.es23.js +16 -9
  15. package/dist/mobile/sun-card-design-mobile.es24.js +80 -21
  16. package/dist/mobile/sun-card-design-mobile.es3.js +41 -28
  17. package/dist/mobile/sun-card-design-mobile.es37.js +19 -18
  18. package/dist/mobile/sun-card-design-mobile.es4.js +54 -32
  19. package/dist/mobile/sun-card-design-mobile.es5.js +27 -18
  20. package/dist/mobile/sun-card-design-mobile.es55.js +26 -29
  21. package/dist/mobile/sun-card-design-mobile.es56.js +21 -20
  22. package/dist/mobile/sun-card-design-mobile.es57.js +44 -25
  23. package/dist/mobile/sun-card-design-mobile.es58.js +43 -23
  24. package/dist/mobile/sun-card-design-mobile.es59.js +38 -21
  25. package/dist/mobile/sun-card-design-mobile.es6.js +32 -18
  26. package/dist/mobile/sun-card-design-mobile.es60.js +38 -21
  27. package/dist/mobile/sun-card-design-mobile.es65.js +33 -0
  28. package/dist/mobile/sun-card-design-mobile.es7.js +41 -35
  29. package/dist/mobile/sun-card-design-mobile.es8.js +28 -22
  30. package/dist/mobile/sun-card-design-mobile.es9.js +21 -12
  31. package/dist/pc/sun-card-design-pc.es10.js +13 -7
  32. package/dist/pc/sun-card-design-pc.es11.js +19 -12
  33. package/dist/pc/sun-card-design-pc.es12.js +11 -9
  34. package/dist/pc/sun-card-design-pc.es13.js +28 -22
  35. package/dist/pc/sun-card-design-pc.es14.js +13 -7
  36. package/dist/pc/sun-card-design-pc.es15.js +43 -23
  37. package/dist/pc/sun-card-design-pc.es16.js +13 -7
  38. package/dist/pc/sun-card-design-pc.es17.js +14 -8
  39. package/dist/pc/sun-card-design-pc.es18.js +14 -8
  40. package/dist/pc/sun-card-design-pc.es19.js +21 -11
  41. package/dist/pc/sun-card-design-pc.es2.js +11 -2
  42. package/dist/pc/sun-card-design-pc.es20.js +45 -17
  43. package/dist/pc/sun-card-design-pc.es21.js +16 -9
  44. package/dist/pc/sun-card-design-pc.es22.js +19 -12
  45. package/dist/pc/sun-card-design-pc.es23.js +16 -9
  46. package/dist/pc/sun-card-design-pc.es24.js +80 -21
  47. package/dist/pc/sun-card-design-pc.es3.js +41 -28
  48. package/dist/pc/sun-card-design-pc.es37.js +19 -18
  49. package/dist/pc/sun-card-design-pc.es4.js +54 -32
  50. package/dist/pc/sun-card-design-pc.es5.js +27 -18
  51. package/dist/pc/sun-card-design-pc.es55.js +26 -29
  52. package/dist/pc/sun-card-design-pc.es56.js +21 -20
  53. package/dist/pc/sun-card-design-pc.es57.js +44 -25
  54. package/dist/pc/sun-card-design-pc.es58.js +43 -23
  55. package/dist/pc/sun-card-design-pc.es59.js +38 -21
  56. package/dist/pc/sun-card-design-pc.es6.js +32 -18
  57. package/dist/pc/sun-card-design-pc.es60.js +38 -21
  58. package/dist/pc/sun-card-design-pc.es65.js +33 -0
  59. package/dist/pc/sun-card-design-pc.es7.js +41 -35
  60. package/dist/pc/sun-card-design-pc.es8.js +28 -22
  61. package/dist/pc/sun-card-design-pc.es9.js +21 -12
  62. package/dist/public/sun-card-design.css +1 -1
  63. package/package.json +1 -1
  64. package/dist/mobile/sun-card-design-mobile.es61.js +0 -162
@@ -1,162 +0,0 @@
1
- import { ref, computed, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, createElementVNode, createVNode, withCtx, TransitionGroup, Fragment, renderList, createBlock, Transition, createCommentVNode } from "vue";
2
- import FormItem from "./sun-card-design-mobile.es25.js";
3
- /* empty css */
4
- import _export_sfc from "./sun-card-design-mobile.es28.js";
5
- const _hoisted_1 = { class: "expand-list-container" };
6
- const _hoisted_2 = ["onClick"];
7
- const _sfc_main = {
8
- __name: "gridList",
9
- props: ["record", "recordData", "columnsIndex"],
10
- emits: ["clickEvent", "clickColumnsEvent", "fileUpdateEvent"],
11
- setup(__props, { emit: __emit }) {
12
- const props = __props;
13
- const emit = __emit;
14
- const currentDisplayRows = ref(0);
15
- const collapse = computed(() => props.record.options?.style?.collapse ?? false);
16
- const collapseLine = computed(() => props.record.options?.style?.collapseLine ?? 2);
17
- const expandType = computed(() => props.record.options?.style?.expandType || "noRepeat");
18
- const expandLine = computed(() => props.record.options?.style?.expandLine ?? 2);
19
- const totalColumns = computed(() => props.record.columns?.length || 0);
20
- const autoNumber = computed(() => props.record.options?.autoNumber || 2);
21
- const totalRows = computed(() => Math.ceil(totalColumns.value / autoNumber.value));
22
- watch([collapse, collapseLine, totalRows], () => {
23
- if (collapse.value) {
24
- currentDisplayRows.value = Math.min(collapseLine.value, totalRows.value);
25
- } else {
26
- currentDisplayRows.value = totalRows.value;
27
- }
28
- }, { immediate: true });
29
- const displayedColumns = computed(() => {
30
- if (!collapse.value) {
31
- return props.record.columns || [];
32
- }
33
- const displayCount = currentDisplayRows.value * autoNumber.value;
34
- return (props.record.columns || []).slice(0, displayCount);
35
- });
36
- const showExpandMore = computed(() => {
37
- if (!collapse.value) return false;
38
- return currentDisplayRows.value < totalRows.value;
39
- });
40
- const handleExpandMore = () => {
41
- if (expandType.value === "noRepeat") {
42
- currentDisplayRows.value = totalRows.value;
43
- } else if (expandType.value === "repeat") {
44
- currentDisplayRows.value = Math.min(
45
- currentDisplayRows.value + expandLine.value,
46
- totalRows.value
47
- );
48
- }
49
- };
50
- const getIndex = (index) => {
51
- if (index !== void 0) {
52
- return index;
53
- }
54
- return props.columnsIndex;
55
- };
56
- const onClick = (record) => {
57
- emit("clickEvent", record);
58
- };
59
- const onUpdate = (record) => {
60
- emit("fileUpdateEvent", record);
61
- };
62
- const onClickColumns = (record) => {
63
- if (!record.options.clickEvent) return;
64
- emit("clickColumnsEvent", record);
65
- };
66
- function isGradientColor(color) {
67
- return /^(linear|radial)-gradient\(.*\)$/.test(color);
68
- }
69
- const getBackground = computed(() => {
70
- if (!props.recordData?.config?.background) {
71
- return "transparent";
72
- }
73
- if (isGradientColor(props.recordData.config.background)) {
74
- return "none";
75
- }
76
- return props.recordData.config.background;
77
- });
78
- return (_ctx, _cache) => {
79
- const _component_a_col = resolveComponent("a-col");
80
- const _component_a_row = resolveComponent("a-row");
81
- return openBlock(), createElementBlock("div", {
82
- class: "main-grid",
83
- style: normalizeStyle({ background: getBackground.value })
84
- }, [
85
- createElementVNode("div", _hoisted_1, [
86
- createVNode(_component_a_row, {
87
- gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
88
- }, {
89
- default: withCtx(() => [
90
- createVNode(TransitionGroup, {
91
- name: "expand-list",
92
- tag: "div",
93
- class: "expand-list-group"
94
- }, {
95
- default: withCtx(() => [
96
- (openBlock(true), createElementBlock(Fragment, null, renderList(displayedColumns.value, (item, index) => {
97
- return openBlock(), createBlock(_component_a_col, {
98
- key: item.uuid || `col-${index}`,
99
- flex: item.flex,
100
- span: 24 / props.record.options.autoNumber,
101
- style: normalizeStyle({
102
- flex: _ctx.none
103
- }),
104
- class: "expand-col-item"
105
- }, {
106
- default: withCtx(() => [
107
- createElementVNode("div", {
108
- class: "box",
109
- style: normalizeStyle({
110
- background: props.record.options.style?.background,
111
- border: props.record.options.style?.borderColor === "none" ? "none" : "1px solid " + (props.record.options.style?.borderColor || "transparent"),
112
- borderRadius: props.record.options.style?.borderRadius + "px",
113
- padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
114
- justifyContent: props.record.options.style?.alignItems || "start",
115
- minHeight: props.record.options.style?.minHeight + "px" || "48px",
116
- boxShadow: props.record.options.style?.boxShadow || null
117
- }),
118
- onClick: ($event) => onClickColumns(item)
119
- }, [
120
- (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (element, index2) => {
121
- return openBlock(), createBlock(FormItem, {
122
- record: element,
123
- key: index2,
124
- recordData: props.recordData,
125
- columnsIndex: getIndex(item.index),
126
- onClickEvent: onClick,
127
- onFileUpdateEvent: onUpdate,
128
- onClickColumnsEvent: onClickColumns
129
- }, null, 8, ["record", "recordData", "columnsIndex"]);
130
- }), 128))
131
- ], 12, _hoisted_2)
132
- ]),
133
- _: 2
134
- }, 1032, ["flex", "span", "style"]);
135
- }), 128))
136
- ]),
137
- _: 1
138
- })
139
- ]),
140
- _: 1
141
- }, 8, ["gutter"])
142
- ]),
143
- createVNode(Transition, { name: "fade" }, {
144
- default: withCtx(() => [
145
- showExpandMore.value ? (openBlock(), createElementBlock("div", {
146
- key: 0,
147
- class: "expand-more",
148
- onClick: handleExpandMore
149
- }, [..._cache[0] || (_cache[0] = [
150
- createElementVNode("span", null, "展开更多", -1)
151
- ])])) : createCommentVNode("", true)
152
- ]),
153
- _: 1
154
- })
155
- ], 4);
156
- };
157
- }
158
- };
159
- const GridList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-159c873b"]]);
160
- export {
161
- GridList as default
162
- };