@fangzhongya/fang-ui 0.0.54 → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/common/use.cjs +2 -0
- package/dist/components/common/use.js +2 -0
- package/dist/components/index.cjs +84 -80
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +5 -1
- package/dist/components/index.scss +2 -2
- package/dist/components/index2.scss +2 -2
- package/dist/components/list/index.cjs +9 -0
- package/dist/components/list/index.css +96 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +9 -0
- package/dist/components/list/src/data.cjs +97 -0
- package/dist/components/list/src/data.d.ts +100 -0
- package/dist/components/list/src/data.js +97 -0
- package/dist/components/list/src/index.cjs +4 -0
- package/dist/components/list/src/index.js +4 -0
- package/dist/components/list/src/index2.cjs +337 -0
- package/dist/components/list/src/index2.js +337 -0
- package/dist/components/lists/index.cjs +2 -2
- package/dist/components/lists/index.css +27 -72
- package/dist/components/lists/src/data.cjs +80 -49
- package/dist/components/lists/src/data.d.ts +103 -48
- package/dist/components/lists/src/data.js +81 -50
- package/dist/components/lists/src/index.cjs +2 -2
- package/dist/components/lists/src/index2.cjs +237 -303
- package/dist/components/lists/src/index2.js +237 -303
- package/dist/components/listsp/index.cjs +9 -0
- package/dist/components/listsp/index.css +86 -0
- package/dist/components/listsp/index.d.ts +2 -0
- package/dist/components/listsp/index.js +9 -0
- package/dist/components/listsp/src/data.d.ts +14 -0
- package/dist/components/listsp/src/index.cjs +4 -0
- package/dist/components/listsp/src/index.js +4 -0
- package/dist/components/listsp/src/index2.cjs +98 -0
- package/dist/components/listsp/src/index2.js +98 -0
- package/dist/components/page/index.css +35 -38
- package/dist/components/page/index.scss +1 -1
- package/dist/components/page/src/index2.cjs +2 -2
- package/dist/components/page/src/index2.js +2 -2
- package/dist/components/page/style/index2.scss +1 -1
- package/dist/components/tables/common/pagin.cjs +33 -15
- package/dist/components/tables/common/pagin.d.ts +14 -3
- package/dist/components/tables/common/pagin.js +33 -15
- package/dist/components/tables/index.css +1 -4
- package/dist/components/tablesp/index.css +1 -4
- package/dist/css/index.css +122 -46
- package/dist/css/list.css +96 -0
- package/dist/css/lists.css +27 -72
- package/dist/css/listsp.css +86 -0
- package/dist/css/page.css +35 -38
- package/dist/css/tables.css +1 -4
- package/dist/css/tablesp.css +1 -4
- package/dist/directives/scroll/index.cjs +36 -11
- package/dist/directives/scroll/index.js +36 -11
- package/dist/icons/index.css +36 -36
- package/dist/icons/index.json +15 -15
- package/dist/index.cjs +102 -98
- package/dist/index.css +122 -46
- package/dist/index.js +5 -1
- package/dist/type.d.ts +11 -2
- package/package.json +5 -5
- /package/dist/components/{forms-item → forms-items}/index.css +0 -0
- /package/dist/components/{cascader-panel → keep-com}/index.css +0 -0
- /package/dist/components/{lists → list}/src/setup.d.ts +0 -0
- /package/dist/components/{lists → list}/src/util.cjs +0 -0
- /package/dist/components/{lists → list}/src/util.d.ts +0 -0
- /package/dist/components/{lists → list}/src/util.js +0 -0
- /package/dist/components/{lists → tables}/common/img.cjs +0 -0
- /package/dist/components/{lists → tables}/common/img.js +0 -0
- /package/dist/components/{lists → tables}/common/img2.cjs +0 -0
- /package/dist/components/{lists → tables}/common/img2.js +0 -0
- /package/dist/css/{forms-item.css → forms-items.css} +0 -0
- /package/dist/css/{cascader-panel.css → keep-com.css} +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const dataProps = {
|
|
2
|
+
/**
|
|
3
|
+
* @props { Object } options={}
|
|
4
|
+
* 选择数据集合
|
|
5
|
+
*/
|
|
6
|
+
options: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default() {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* @props { Object } compons={}
|
|
14
|
+
* 外部组件集合
|
|
15
|
+
*/
|
|
16
|
+
compons: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default() {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* @props { Object } labelPosition='auto' ('left' | 'top' | 'right' | 'center' | 'auto')
|
|
24
|
+
* 标签位置
|
|
25
|
+
*/
|
|
26
|
+
labelPosition: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "auto"
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* @props { Array<ListObj> } list=[]
|
|
32
|
+
* 列数据
|
|
33
|
+
*/
|
|
34
|
+
list: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default: () => {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
value: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* @props { Number } column=2
|
|
48
|
+
* 一行展示多少列
|
|
49
|
+
*/
|
|
50
|
+
column: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default() {
|
|
53
|
+
return 2;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* @props { Boolean, String } colon
|
|
58
|
+
* 标签后面是否加内容 true 是 :
|
|
59
|
+
*/
|
|
60
|
+
colon: [Boolean, String],
|
|
61
|
+
/**
|
|
62
|
+
* @props {Number, String } labelWidth=[]
|
|
63
|
+
* 标签宽度
|
|
64
|
+
*/
|
|
65
|
+
labelWidth: {
|
|
66
|
+
type: [Number, String]
|
|
67
|
+
// default: '60px',
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* @props { Boolean, String } border=true ( )
|
|
71
|
+
* 是否需要边框,边框颜色
|
|
72
|
+
*/
|
|
73
|
+
border: {
|
|
74
|
+
type: [Boolean, String]
|
|
75
|
+
// default: true
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* @props { Boolean } aliquots=true ( )
|
|
79
|
+
* 是否等分
|
|
80
|
+
*/
|
|
81
|
+
aliquots: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: true
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* @props { Boolean } componSelected
|
|
87
|
+
* 是否在选中时显示 compon 组件
|
|
88
|
+
*/
|
|
89
|
+
componSelected: Boolean
|
|
90
|
+
};
|
|
91
|
+
const dataEmits = ["list-events"];
|
|
92
|
+
const dataExpose = [];
|
|
93
|
+
export {
|
|
94
|
+
dataEmits,
|
|
95
|
+
dataExpose,
|
|
96
|
+
dataProps
|
|
97
|
+
};
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const util = require("./util.cjs");
|
|
5
|
+
const css = require("../../common/css.cjs");
|
|
6
|
+
const use = require("../../common/use.cjs");
|
|
7
|
+
const compons = require("../../common/compons.cjs");
|
|
8
|
+
const index = require("../../../hooks/cssname/index.cjs");
|
|
9
|
+
const data = require("./data.cjs");
|
|
10
|
+
require("../../tables/common/img.cjs");
|
|
11
|
+
const img_vue_vue_type_script_setup_true_lang = require("../../tables/common/img2.cjs");
|
|
12
|
+
const Components = {
|
|
13
|
+
Img: img_vue_vue_type_script_setup_true_lang.default
|
|
14
|
+
};
|
|
15
|
+
const _sfc_main = vue.defineComponent({
|
|
16
|
+
emits: data.dataEmits,
|
|
17
|
+
components: Components,
|
|
18
|
+
expose: data.dataExpose,
|
|
19
|
+
props: data.dataProps,
|
|
20
|
+
setup(props, { emit, slots }) {
|
|
21
|
+
const compons$1 = compons.getCompons(props.compons);
|
|
22
|
+
const cs = index.useCssName("list");
|
|
23
|
+
const isfocus = vue.ref(false);
|
|
24
|
+
const rowObj = vue.ref();
|
|
25
|
+
const borderColor = vue.computed(() => {
|
|
26
|
+
const d = "#ccc";
|
|
27
|
+
if (typeof props.border === "boolean") {
|
|
28
|
+
return d;
|
|
29
|
+
} else {
|
|
30
|
+
return props.border ?? d;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
function isComponSelected(obj) {
|
|
34
|
+
if (use.uesObjComponSelected(obj, props)) {
|
|
35
|
+
if (rowObj.value == obj) {
|
|
36
|
+
if (isfocus.value) {
|
|
37
|
+
return true;
|
|
38
|
+
} else {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const getLists = (arrs, listobj) => {
|
|
49
|
+
let arr = [], trs = [], lin = 0;
|
|
50
|
+
arrs.forEach((obj, index2) => {
|
|
51
|
+
if (listobj) {
|
|
52
|
+
obj.father = obj.father ?? listobj;
|
|
53
|
+
}
|
|
54
|
+
if (!use.useHide(obj, props.value)) {
|
|
55
|
+
let is = false;
|
|
56
|
+
if (obj.whole) {
|
|
57
|
+
lin = props.column;
|
|
58
|
+
is = true;
|
|
59
|
+
} else {
|
|
60
|
+
let k = (obj.column || 1) + lin;
|
|
61
|
+
if (k > props.column) {
|
|
62
|
+
lin = obj.column || 1;
|
|
63
|
+
is = true;
|
|
64
|
+
} else {
|
|
65
|
+
lin = k;
|
|
66
|
+
is = false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (is) {
|
|
70
|
+
arr.push(vue.h("tr", {}, trs));
|
|
71
|
+
trs = [];
|
|
72
|
+
}
|
|
73
|
+
trs.push(...getTd(obj, index2));
|
|
74
|
+
if (lin >= props.column) {
|
|
75
|
+
arr.push(vue.h("tr", {}, trs));
|
|
76
|
+
trs = [];
|
|
77
|
+
lin = 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
if (trs.length > 0) {
|
|
82
|
+
arr.push(vue.h("tr", {}, trs));
|
|
83
|
+
}
|
|
84
|
+
return arr;
|
|
85
|
+
};
|
|
86
|
+
const getListTops = (arrs, listobj) => {
|
|
87
|
+
let arr = [], trvs = [], trls = [], lin = 0;
|
|
88
|
+
arrs.forEach((obj, index2) => {
|
|
89
|
+
if (listobj) {
|
|
90
|
+
obj.father = obj.father ?? listobj;
|
|
91
|
+
}
|
|
92
|
+
if (!use.useHide(obj, props.value)) {
|
|
93
|
+
let is = false;
|
|
94
|
+
if (obj.whole) {
|
|
95
|
+
lin = props.column;
|
|
96
|
+
is = true;
|
|
97
|
+
} else {
|
|
98
|
+
let k = (obj.column || 1) + lin;
|
|
99
|
+
if (k > props.column) {
|
|
100
|
+
lin = obj.column || 1;
|
|
101
|
+
is = true;
|
|
102
|
+
} else {
|
|
103
|
+
lin = k;
|
|
104
|
+
is = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (is) {
|
|
108
|
+
arr.push(vue.h("tr", {}, trls));
|
|
109
|
+
trls = [];
|
|
110
|
+
arr.push(vue.h("tr", {}, trvs));
|
|
111
|
+
trvs = [];
|
|
112
|
+
}
|
|
113
|
+
if (obj.isdiv) {
|
|
114
|
+
trls.push(getValue(obj, index2, true));
|
|
115
|
+
} else {
|
|
116
|
+
trls.push(getlabel(obj, index2));
|
|
117
|
+
trvs.push(getValue(obj, index2));
|
|
118
|
+
}
|
|
119
|
+
if (lin >= props.column) {
|
|
120
|
+
arr.push(vue.h("tr", {}, trls));
|
|
121
|
+
arr.push(vue.h("tr", {}, trvs));
|
|
122
|
+
trls = [];
|
|
123
|
+
trvs = [];
|
|
124
|
+
lin = 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
if (trls.length > 0) {
|
|
129
|
+
arr.push(vue.h("tr", {}, trls));
|
|
130
|
+
arr.push(vue.h("tr", {}, trvs));
|
|
131
|
+
}
|
|
132
|
+
return arr;
|
|
133
|
+
};
|
|
134
|
+
const getlabel = (obj, index2) => {
|
|
135
|
+
return vue.h(
|
|
136
|
+
"th",
|
|
137
|
+
{
|
|
138
|
+
style: {
|
|
139
|
+
width: obj.labelWidth ?? props.labelWidth
|
|
140
|
+
},
|
|
141
|
+
class: [
|
|
142
|
+
cs.z("table-th"),
|
|
143
|
+
cs.is("whole", obj.whole),
|
|
144
|
+
obj.class ?? ""
|
|
145
|
+
].join(" "),
|
|
146
|
+
colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
|
|
147
|
+
onClick: (event) => {
|
|
148
|
+
isfocus.value = true;
|
|
149
|
+
rowObj.value = obj;
|
|
150
|
+
event.stopPropagation();
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
[
|
|
155
|
+
vue.h(
|
|
156
|
+
"span",
|
|
157
|
+
{
|
|
158
|
+
class: cs.z("table-label")
|
|
159
|
+
},
|
|
160
|
+
[
|
|
161
|
+
util.setLabel(
|
|
162
|
+
obj,
|
|
163
|
+
props,
|
|
164
|
+
compons$1,
|
|
165
|
+
emit,
|
|
166
|
+
slots,
|
|
167
|
+
isComponSelected,
|
|
168
|
+
index2
|
|
169
|
+
)
|
|
170
|
+
]
|
|
171
|
+
)
|
|
172
|
+
]
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
const getChildrenValue = (obj, index2) => {
|
|
176
|
+
if (obj.children) {
|
|
177
|
+
return [
|
|
178
|
+
vue.h(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
class: cs.z("table-children")
|
|
182
|
+
},
|
|
183
|
+
[
|
|
184
|
+
props.labelPosition == "top" ? getListTops(obj.children, obj) : getLists(obj.children, obj)
|
|
185
|
+
]
|
|
186
|
+
)
|
|
187
|
+
];
|
|
188
|
+
} else {
|
|
189
|
+
return [
|
|
190
|
+
vue.h(
|
|
191
|
+
"span",
|
|
192
|
+
{
|
|
193
|
+
class: cs.z("table-value")
|
|
194
|
+
},
|
|
195
|
+
[
|
|
196
|
+
util.setSslot(
|
|
197
|
+
obj,
|
|
198
|
+
props.value,
|
|
199
|
+
props,
|
|
200
|
+
compons$1,
|
|
201
|
+
emit,
|
|
202
|
+
slots,
|
|
203
|
+
isComponSelected,
|
|
204
|
+
index2
|
|
205
|
+
)
|
|
206
|
+
]
|
|
207
|
+
)
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const getValue = (obj, index2, isRow) => {
|
|
212
|
+
return vue.h(
|
|
213
|
+
"td",
|
|
214
|
+
{
|
|
215
|
+
style: css.setStyles(obj, props.value, props),
|
|
216
|
+
class: [
|
|
217
|
+
cs.z("table-td"),
|
|
218
|
+
cs.is("whole", obj.whole),
|
|
219
|
+
obj.class ?? ""
|
|
220
|
+
].join(" "),
|
|
221
|
+
colspan: setColspan(obj),
|
|
222
|
+
rowspan: isRow ? 2 : void 0,
|
|
223
|
+
onClick: (event) => {
|
|
224
|
+
isfocus.value = true;
|
|
225
|
+
rowObj.value = obj;
|
|
226
|
+
event.stopPropagation();
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
[...getChildrenValue(obj, index2)]
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
const getTd = (obj, index2) => {
|
|
234
|
+
const arr = [getValue(obj, index2)];
|
|
235
|
+
if (!obj.isdiv) {
|
|
236
|
+
arr.unshift(getlabel(obj, index2));
|
|
237
|
+
}
|
|
238
|
+
if (props.labelPosition == "auto") {
|
|
239
|
+
return [
|
|
240
|
+
vue.h(
|
|
241
|
+
"td",
|
|
242
|
+
{
|
|
243
|
+
colspan: setColspan(obj),
|
|
244
|
+
class: cs.is("whole", obj.whole)
|
|
245
|
+
},
|
|
246
|
+
[
|
|
247
|
+
vue.h(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
class: cs.z("table-auto")
|
|
251
|
+
},
|
|
252
|
+
arr
|
|
253
|
+
)
|
|
254
|
+
]
|
|
255
|
+
)
|
|
256
|
+
];
|
|
257
|
+
} else {
|
|
258
|
+
return arr;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const setColspan = (obj) => {
|
|
262
|
+
if (["auto", "top"].includes(props.labelPosition)) {
|
|
263
|
+
if (obj.whole) {
|
|
264
|
+
return props.column;
|
|
265
|
+
} else if (obj.column) {
|
|
266
|
+
return obj.column;
|
|
267
|
+
} else {
|
|
268
|
+
return "";
|
|
269
|
+
}
|
|
270
|
+
} else {
|
|
271
|
+
const j = !obj.isdiv ? 0 : 1;
|
|
272
|
+
if (obj.whole) {
|
|
273
|
+
return (props.column - 1) * 2 + 1 + j;
|
|
274
|
+
} else if (obj.column) {
|
|
275
|
+
return (obj.column - 1) * 2 + 1 + j;
|
|
276
|
+
} else {
|
|
277
|
+
return 1 + j;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
const renderValue = () => {
|
|
282
|
+
if (props.list && props.list.length > 0) {
|
|
283
|
+
return vue.h(
|
|
284
|
+
"div",
|
|
285
|
+
{
|
|
286
|
+
class: cs.z("div"),
|
|
287
|
+
style: cs.vdo({
|
|
288
|
+
borderColor: borderColor.value
|
|
289
|
+
})
|
|
290
|
+
// onClick(event: Event) {
|
|
291
|
+
// isfocus.value = true;
|
|
292
|
+
// event.stopPropagation();
|
|
293
|
+
// return false;
|
|
294
|
+
// },
|
|
295
|
+
},
|
|
296
|
+
[
|
|
297
|
+
vue.h(
|
|
298
|
+
"table",
|
|
299
|
+
{
|
|
300
|
+
class: [
|
|
301
|
+
cs.z("table"),
|
|
302
|
+
props.labelPosition ?? "",
|
|
303
|
+
cs.is(
|
|
304
|
+
"border",
|
|
305
|
+
props.border ? true : false
|
|
306
|
+
),
|
|
307
|
+
cs.is("aliquots", props.aliquots)
|
|
308
|
+
].join(" "),
|
|
309
|
+
cellspacing: "0",
|
|
310
|
+
cellpadding: "0",
|
|
311
|
+
border: "0"
|
|
312
|
+
},
|
|
313
|
+
props.labelPosition == "top" ? getListTops(props.list) : getLists(props.list)
|
|
314
|
+
)
|
|
315
|
+
]
|
|
316
|
+
);
|
|
317
|
+
} else {
|
|
318
|
+
return "";
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
vue.onMounted(() => {
|
|
322
|
+
if (window) {
|
|
323
|
+
window.addEventListener("click", () => {
|
|
324
|
+
isfocus.value = false;
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
return {
|
|
329
|
+
renderValue,
|
|
330
|
+
borderColor
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
render(props) {
|
|
334
|
+
return props.renderValue();
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
exports.default = _sfc_main;
|