@fangzhongya/fang-ui 0.1.18 → 0.1.20
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/forms/src/data.cjs +3 -3
- package/dist/components/forms/src/data.d.ts +1 -1
- package/dist/components/forms/src/data.js +3 -3
- package/dist/components/forms/src/index2.cjs +5 -3
- package/dist/components/forms/src/index2.js +5 -3
- package/dist/components/forms/src/setup.cjs +0 -7
- package/dist/components/forms/src/setup.js +0 -7
- package/dist/components/forms-div/src/data.cjs +7 -1
- package/dist/components/forms-div/src/data.d.ts +6 -0
- package/dist/components/forms-div/src/data.js +7 -1
- package/dist/components/forms-div/src/index2.cjs +35 -10
- package/dist/components/forms-div/src/index2.js +36 -11
- package/dist/components/forms-item/src/data.cjs +1 -1
- package/dist/components/forms-item/src/data.js +1 -1
- package/dist/components/forms-item/src/index2.cjs +4 -2
- package/dist/components/forms-item/src/index2.js +4 -2
- package/dist/components/forms-items/src/data.cjs +1 -1
- package/dist/components/forms-items/src/data.js +1 -1
- package/dist/components/forms-items/src/index2.cjs +4 -2
- package/dist/components/forms-items/src/index2.js +4 -2
- package/dist/components/global-config/src/data.cjs +12 -0
- package/dist/components/global-config/src/data.d.ts +12 -0
- package/dist/components/global-config/src/data.js +12 -0
- package/dist/components/index.cjs +8 -6
- package/dist/{index.css → components/index.css} +39 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.scss +1 -0
- package/dist/components/index2.scss +2 -2
- package/dist/components/list/index.css +12 -0
- package/dist/components/list/index.scss +15 -0
- package/dist/components/list/src/data.cjs +21 -2
- package/dist/components/list/src/data.d.ts +22 -1
- package/dist/components/list/src/data.js +21 -2
- package/dist/components/list/src/index2.cjs +61 -10
- package/dist/components/list/src/index2.js +61 -10
- package/dist/components/list/style/index2.scss +1 -0
- package/dist/components/page/index.css +11 -0
- package/dist/components/tables/common/pagin.cjs +60 -16
- package/dist/components/tables/common/pagin.d.ts +8 -0
- package/dist/components/tables/common/pagin.js +60 -16
- package/dist/components/tables/common/tooltip.cjs +101 -0
- package/dist/components/tables/common/tooltip.d.ts +6 -0
- package/dist/components/tables/common/tooltip.js +101 -0
- package/dist/components/tables/common/util.cjs +3 -3
- package/dist/components/tables/common/util.js +3 -3
- package/dist/components/tables/src/column.cjs +19 -15
- package/dist/components/tables/src/column.d.ts +3 -2
- package/dist/components/tables/src/column.js +17 -13
- package/dist/components/tables/src/columns3.cjs +16 -32
- package/dist/components/tables/src/columns3.js +15 -31
- package/dist/components/tables/src/data.cjs +3 -2
- package/dist/components/tables/src/data.d.ts +1 -0
- package/dist/components/tables/src/data.js +3 -2
- package/dist/components/tablespd/index.cjs +9 -0
- package/dist/components/tablespd/index.css +88 -0
- package/dist/components/tablespd/index.d.ts +4 -0
- package/dist/components/tablespd/index.js +9 -0
- package/dist/components/tablespd/index.scss +40 -0
- package/dist/components/tablespd/src/data.cjs +13 -0
- package/dist/components/tablespd/src/data.d.ts +18 -0
- package/dist/components/tablespd/src/data.js +13 -0
- package/dist/components/tablespd/src/index.cjs +4 -0
- package/dist/components/tablespd/src/index.js +4 -0
- package/dist/components/tablespd/src/index2.cjs +111 -0
- package/dist/components/tablespd/src/index2.js +111 -0
- package/dist/components/tablespd/style/index2.scss +4 -0
- package/dist/components/tablesv/src/column.cjs +4 -4
- package/dist/components/tablesv/src/column.js +3 -3
- package/dist/css/index.css +39 -0
- package/dist/css/list.css +12 -0
- package/dist/css/page.css +11 -0
- package/dist/css/tablespd.css +88 -0
- package/dist/directives/index.cjs +6 -4
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/index.js +4 -2
- package/dist/directives/sortable/index.cjs +45 -0
- package/dist/directives/sortable/index.d.ts +6 -0
- package/dist/directives/sortable/index.js +45 -0
- package/dist/expand/{chunk-XY53LCPN.js → chunk-2BLP2ANQ.js} +3 -0
- package/dist/expand/{chunk-IEODUGVJ.cjs → chunk-OT6GISSR.cjs} +3 -0
- package/dist/expand/components.cjs +5 -5
- package/dist/expand/components.js +1 -1
- package/dist/expand/config.cjs +2 -2
- package/dist/expand/config.js +1 -1
- package/dist/hooks/cssname/index.d.ts +2 -2
- package/dist/hooks/index.cjs +0 -1
- package/dist/hooks/index.js +1 -2
- package/dist/hooks/inherit/index.cjs +0 -8
- package/dist/hooks/inherit/index.d.ts +0 -1
- package/dist/hooks/inherit/index.js +0 -8
- package/dist/icons/index.json +1 -1
- package/dist/index.cjs +30 -26
- package/dist/index.js +6 -2
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.cjs +2758 -0
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js +2758 -0
- package/dist/utils/vues/getAttrValue.cjs +11 -0
- package/dist/utils/vues/getAttrValue.d.ts +3 -0
- package/dist/utils/vues/getAttrValue.js +11 -0
- package/dist/utils/vues/index.cjs +2 -0
- package/dist/utils/vues/index.d.ts +1 -0
- package/dist/utils/vues/index.js +2 -0
- package/package.json +7 -5
- /package/dist/components/{forms-item → forms-items}/index.css +0 -0
- /package/dist/css/{forms-item.css → forms-items.css} +0 -0
package/dist/components/index.js
CHANGED
|
@@ -130,6 +130,7 @@ import { Listsp } from "./listsp/index.js";
|
|
|
130
130
|
import { Paging } from "./paging/index.js";
|
|
131
131
|
import { Tables } from "./tables/index.js";
|
|
132
132
|
import { Tablesp } from "./tablesp/index.js";
|
|
133
|
+
import { Tablespd } from "./tablespd/index.js";
|
|
133
134
|
import { Tabless } from "./tabless/index.js";
|
|
134
135
|
import { Tablesv } from "./tablesv/index.js";
|
|
135
136
|
import { Tablesvp } from "./tablesvp/index.js";
|
|
@@ -294,6 +295,7 @@ export {
|
|
|
294
295
|
TableColumn,
|
|
295
296
|
Tables,
|
|
296
297
|
Tablesp,
|
|
298
|
+
Tablespd,
|
|
297
299
|
Tabless,
|
|
298
300
|
Tablesv,
|
|
299
301
|
Tablesvp,
|
|
@@ -116,6 +116,6 @@
|
|
|
116
116
|
@use './paging/style/index2.scss' as *;
|
|
117
117
|
@use './tables/style/index2.scss' as *;
|
|
118
118
|
@use './tablesp/style/index2.scss' as *;
|
|
119
|
+
@use './tablespd/style/index2.scss' as *;
|
|
119
120
|
@use './tabless/style/index2.scss' as *;
|
|
120
|
-
@use './tablesv/style/index2.scss' as *;
|
|
121
|
-
@use './tablesvp/style/index2.scss' as *;
|
|
121
|
+
@use './tablesv/style/index2.scss' as *;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
1
2
|
:root {
|
|
2
3
|
--on: rgb(91, 189, 246);
|
|
3
4
|
--color-primary: #409eff;
|
|
@@ -85,6 +86,17 @@
|
|
|
85
86
|
.list-div .list-table .list-table-th {
|
|
86
87
|
text-align: left;
|
|
87
88
|
}
|
|
89
|
+
.list-div .list-table .list-table-value {
|
|
90
|
+
word-break: break-all;
|
|
91
|
+
white-space: normal;
|
|
92
|
+
display: block;
|
|
93
|
+
max-height: var(--list-row-max-height);
|
|
94
|
+
display: -webkit-box;
|
|
95
|
+
-webkit-line-clamp: var(--list-line-clamp); /* 显示的行数 */
|
|
96
|
+
-webkit-box-orient: vertical;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
text-overflow: ellipsis;
|
|
99
|
+
}
|
|
88
100
|
.list-div .list-table.right .list-table-th {
|
|
89
101
|
text-align: right;
|
|
90
102
|
}
|
|
@@ -88,6 +88,21 @@ $list: 'list';
|
|
|
88
88
|
.#{z($list, 'table-th')} {
|
|
89
89
|
text-align: left;
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
.#{z($list, 'table-value')} {
|
|
93
|
+
word-break: break-all;
|
|
94
|
+
white-space: normal;
|
|
95
|
+
display: block;
|
|
96
|
+
|
|
97
|
+
max-height: var(vdm('row-max-height', $list));
|
|
98
|
+
display: -webkit-box;
|
|
99
|
+
-webkit-line-clamp: var(
|
|
100
|
+
vdm('line-clamp', $list)
|
|
101
|
+
); /* 显示的行数 */
|
|
102
|
+
-webkit-box-orient: vertical;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
}
|
|
91
106
|
&.right {
|
|
92
107
|
.#{z($list, 'table-th')} {
|
|
93
108
|
text-align: right;
|
|
@@ -76,6 +76,9 @@ const dataProps = {
|
|
|
76
76
|
align: {
|
|
77
77
|
type: String
|
|
78
78
|
},
|
|
79
|
+
showOverflow: {
|
|
80
|
+
type: [Boolean, String]
|
|
81
|
+
},
|
|
79
82
|
/**
|
|
80
83
|
* @props { String } labelAlign ( )
|
|
81
84
|
* 标签展示左右位置
|
|
@@ -83,6 +86,13 @@ const dataProps = {
|
|
|
83
86
|
labelAlign: {
|
|
84
87
|
type: String
|
|
85
88
|
},
|
|
89
|
+
/**
|
|
90
|
+
* @props { String } items ( )
|
|
91
|
+
* 展示上下位置
|
|
92
|
+
*/
|
|
93
|
+
items: {
|
|
94
|
+
type: String
|
|
95
|
+
},
|
|
86
96
|
/**
|
|
87
97
|
* @props { String } labelItems=center ( )
|
|
88
98
|
* 标签展示上下位置
|
|
@@ -91,8 +101,17 @@ const dataProps = {
|
|
|
91
101
|
type: String,
|
|
92
102
|
default: "center"
|
|
93
103
|
},
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
/**
|
|
105
|
+
* @props { String } rowMaxHeight ( )
|
|
106
|
+
* 最大高度
|
|
107
|
+
*/
|
|
108
|
+
rowMaxHeight: { type: String },
|
|
109
|
+
/**
|
|
110
|
+
* @props { Number } lineClamp ( )
|
|
111
|
+
* 超出几行隐藏
|
|
112
|
+
*/
|
|
113
|
+
lineClamp: {
|
|
114
|
+
type: Number
|
|
96
115
|
},
|
|
97
116
|
/**
|
|
98
117
|
* @props { Boolean, String } border=true ( )
|
|
@@ -84,6 +84,9 @@ export declare const dataProps: {
|
|
|
84
84
|
align: {
|
|
85
85
|
type: StringConstructor;
|
|
86
86
|
};
|
|
87
|
+
showOverflow: {
|
|
88
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
89
|
+
};
|
|
87
90
|
/**
|
|
88
91
|
* @props { String } labelAlign ( )
|
|
89
92
|
* 标签展示左右位置
|
|
@@ -91,6 +94,13 @@ export declare const dataProps: {
|
|
|
91
94
|
labelAlign: {
|
|
92
95
|
type: StringConstructor;
|
|
93
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* @props { String } items ( )
|
|
99
|
+
* 展示上下位置
|
|
100
|
+
*/
|
|
101
|
+
items: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
};
|
|
94
104
|
/**
|
|
95
105
|
* @props { String } labelItems=center ( )
|
|
96
106
|
* 标签展示上下位置
|
|
@@ -99,9 +109,20 @@ export declare const dataProps: {
|
|
|
99
109
|
type: StringConstructor;
|
|
100
110
|
default: string;
|
|
101
111
|
};
|
|
102
|
-
|
|
112
|
+
/**
|
|
113
|
+
* @props { String } rowMaxHeight ( )
|
|
114
|
+
* 最大高度
|
|
115
|
+
*/
|
|
116
|
+
rowMaxHeight: {
|
|
103
117
|
type: StringConstructor;
|
|
104
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* @props { Number } lineClamp ( )
|
|
121
|
+
* 超出几行隐藏
|
|
122
|
+
*/
|
|
123
|
+
lineClamp: {
|
|
124
|
+
type: NumberConstructor;
|
|
125
|
+
};
|
|
105
126
|
/**
|
|
106
127
|
* @props { Boolean, String } border=true ( )
|
|
107
128
|
* 是否需要边框,边框颜色
|
|
@@ -74,6 +74,9 @@ const dataProps = {
|
|
|
74
74
|
align: {
|
|
75
75
|
type: String
|
|
76
76
|
},
|
|
77
|
+
showOverflow: {
|
|
78
|
+
type: [Boolean, String]
|
|
79
|
+
},
|
|
77
80
|
/**
|
|
78
81
|
* @props { String } labelAlign ( )
|
|
79
82
|
* 标签展示左右位置
|
|
@@ -81,6 +84,13 @@ const dataProps = {
|
|
|
81
84
|
labelAlign: {
|
|
82
85
|
type: String
|
|
83
86
|
},
|
|
87
|
+
/**
|
|
88
|
+
* @props { String } items ( )
|
|
89
|
+
* 展示上下位置
|
|
90
|
+
*/
|
|
91
|
+
items: {
|
|
92
|
+
type: String
|
|
93
|
+
},
|
|
84
94
|
/**
|
|
85
95
|
* @props { String } labelItems=center ( )
|
|
86
96
|
* 标签展示上下位置
|
|
@@ -89,8 +99,17 @@ const dataProps = {
|
|
|
89
99
|
type: String,
|
|
90
100
|
default: "center"
|
|
91
101
|
},
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
/**
|
|
103
|
+
* @props { String } rowMaxHeight ( )
|
|
104
|
+
* 最大高度
|
|
105
|
+
*/
|
|
106
|
+
rowMaxHeight: { type: String },
|
|
107
|
+
/**
|
|
108
|
+
* @props { Number } lineClamp ( )
|
|
109
|
+
* 超出几行隐藏
|
|
110
|
+
*/
|
|
111
|
+
lineClamp: {
|
|
112
|
+
type: Number
|
|
94
113
|
},
|
|
95
114
|
/**
|
|
96
115
|
* @props { Boolean, String } border=true ( )
|
|
@@ -6,6 +6,7 @@ const css = require("../../common/css.cjs");
|
|
|
6
6
|
const use = require("../../common/use.cjs");
|
|
7
7
|
const compons = require("../../common/compons.cjs");
|
|
8
8
|
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
9
|
+
const tooltip = require("../../tables/common/tooltip.cjs");
|
|
9
10
|
const index = require("../../../hooks/props-default/index.cjs");
|
|
10
11
|
const data = require("./data.cjs");
|
|
11
12
|
require("../../tables/common/img.cjs");
|
|
@@ -24,6 +25,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
24
25
|
index.viewProps(props, data.name);
|
|
25
26
|
const compons$1 = compons.getCompons(props.compons);
|
|
26
27
|
const cs = index$1.useCssName(data.name);
|
|
28
|
+
const refDom = vue.ref();
|
|
27
29
|
const isfocus = vue.ref(false);
|
|
28
30
|
const rowObj = vue.ref();
|
|
29
31
|
const borderColor = vue.computed(() => {
|
|
@@ -61,9 +63,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
61
63
|
lin = props.column;
|
|
62
64
|
is = true;
|
|
63
65
|
} else {
|
|
64
|
-
let k = (obj.
|
|
66
|
+
let k = (obj.colspan || 1) + lin;
|
|
65
67
|
if (k > props.column) {
|
|
66
|
-
lin = obj.
|
|
68
|
+
lin = obj.colspan || 1;
|
|
67
69
|
is = true;
|
|
68
70
|
} else {
|
|
69
71
|
lin = k;
|
|
@@ -99,9 +101,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
99
101
|
lin = props.column;
|
|
100
102
|
is = true;
|
|
101
103
|
} else {
|
|
102
|
-
let k = (obj.
|
|
104
|
+
let k = (obj.colspan || 1) + lin;
|
|
103
105
|
if (k > props.column) {
|
|
104
|
-
lin = obj.
|
|
106
|
+
lin = obj.colspan || 1;
|
|
105
107
|
is = true;
|
|
106
108
|
} else {
|
|
107
109
|
lin = k;
|
|
@@ -156,6 +158,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
156
158
|
obj.class ?? ""
|
|
157
159
|
].join(" "),
|
|
158
160
|
colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
|
|
161
|
+
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj),
|
|
159
162
|
onClick: (event) => {
|
|
160
163
|
isfocus.value = true;
|
|
161
164
|
rowObj.value = obj;
|
|
@@ -187,6 +190,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
187
190
|
]
|
|
188
191
|
);
|
|
189
192
|
};
|
|
193
|
+
const handleCellMouseLeave = ($event) => {
|
|
194
|
+
tooltip.hideTooltip($event);
|
|
195
|
+
};
|
|
196
|
+
const handleCellMouseEnter = ($event, obj) => {
|
|
197
|
+
const showOverflow = obj.showOverflow ?? props.showOverflow;
|
|
198
|
+
if (showOverflow) {
|
|
199
|
+
tooltip.showTooltip(
|
|
200
|
+
$event,
|
|
201
|
+
refDom.value,
|
|
202
|
+
showOverflow,
|
|
203
|
+
props.lineClamp
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
190
207
|
const getChildrenValue = (obj, index2) => {
|
|
191
208
|
if (obj.children) {
|
|
192
209
|
return [
|
|
@@ -208,7 +225,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
208
225
|
class: cs.z("table-value"),
|
|
209
226
|
style: {
|
|
210
227
|
textAlign: obj.align || props.align
|
|
211
|
-
}
|
|
228
|
+
},
|
|
229
|
+
title: obj.title,
|
|
230
|
+
onMouseenter: ($event) => handleCellMouseEnter($event, obj),
|
|
231
|
+
onMouseleave: handleCellMouseLeave
|
|
212
232
|
},
|
|
213
233
|
[
|
|
214
234
|
util.setSslot(
|
|
@@ -239,7 +259,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
239
259
|
obj.class ?? ""
|
|
240
260
|
].join(" "),
|
|
241
261
|
colspan: setColspan(obj),
|
|
242
|
-
rowspan: isRow
|
|
262
|
+
rowspan: setRowspan(obj, isRow),
|
|
243
263
|
onClick: (event) => {
|
|
244
264
|
isfocus.value = true;
|
|
245
265
|
rowObj.value = obj;
|
|
@@ -261,6 +281,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
261
281
|
"td",
|
|
262
282
|
{
|
|
263
283
|
colspan: setColspan(obj),
|
|
284
|
+
rowspan: setRowspan(obj),
|
|
264
285
|
class: cs.is("whole", obj.whole)
|
|
265
286
|
},
|
|
266
287
|
[
|
|
@@ -287,8 +308,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
287
308
|
if (["auto", "top"].includes(props.labelPosition)) {
|
|
288
309
|
if (obj.whole) {
|
|
289
310
|
return props.column;
|
|
290
|
-
} else if (obj.
|
|
291
|
-
return obj.
|
|
311
|
+
} else if (obj.colspan) {
|
|
312
|
+
return obj.colspan;
|
|
292
313
|
} else {
|
|
293
314
|
return "";
|
|
294
315
|
}
|
|
@@ -296,21 +317,51 @@ const _sfc_main = vue.defineComponent({
|
|
|
296
317
|
const j = !obj.isdiv ? 0 : 1;
|
|
297
318
|
if (obj.whole) {
|
|
298
319
|
return (props.column - 1) * 2 + 1 + j;
|
|
299
|
-
} else if (obj.
|
|
300
|
-
return (obj.
|
|
320
|
+
} else if (obj.colspan) {
|
|
321
|
+
return (obj.colspan - 1) * 2 + 1 + j;
|
|
301
322
|
} else {
|
|
302
323
|
return 1 + j;
|
|
303
324
|
}
|
|
304
325
|
}
|
|
305
326
|
};
|
|
327
|
+
const setRowspan = (obj, isRow) => {
|
|
328
|
+
if (props.labelPosition == "top") {
|
|
329
|
+
const j = !obj.isdiv ? 0 : 1;
|
|
330
|
+
if (obj.rowspan) {
|
|
331
|
+
return (obj.rowspan - 1) * 2 + 1 + j;
|
|
332
|
+
} else if (isRow) {
|
|
333
|
+
return 2;
|
|
334
|
+
}
|
|
335
|
+
} else if (props.labelPosition == "auto") {
|
|
336
|
+
if (obj.rowspan) {
|
|
337
|
+
return obj.rowspan;
|
|
338
|
+
} else if (isRow) {
|
|
339
|
+
return 2;
|
|
340
|
+
}
|
|
341
|
+
} else {
|
|
342
|
+
if (obj.rowspan) {
|
|
343
|
+
return obj.rowspan;
|
|
344
|
+
} else if (isRow) {
|
|
345
|
+
return 2;
|
|
346
|
+
} else {
|
|
347
|
+
return 1;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
351
|
+
};
|
|
306
352
|
const renderValue = () => {
|
|
307
353
|
if (props.list && props.list.length > 0) {
|
|
308
354
|
return vue.h(
|
|
309
355
|
"div",
|
|
310
356
|
{
|
|
357
|
+
ref: (el) => {
|
|
358
|
+
refDom.value = el;
|
|
359
|
+
},
|
|
311
360
|
class: cs.z("div"),
|
|
312
361
|
style: cs.vdo({
|
|
313
362
|
borderColor: borderColor.value,
|
|
363
|
+
rowMaxHeight: props.rowMaxHeight,
|
|
364
|
+
lineClamp: props.lineClamp,
|
|
314
365
|
interval: props.interval
|
|
315
366
|
})
|
|
316
367
|
// onClick(event: Event) {
|
|
@@ -4,6 +4,7 @@ import { setStyles } from "../../common/css.js";
|
|
|
4
4
|
import { useObjComponSelected, useHide } from "../../common/use.js";
|
|
5
5
|
import { getCompons } from "../../common/compons.js";
|
|
6
6
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
7
|
+
import { hideTooltip, showTooltip } from "../../tables/common/tooltip.js";
|
|
7
8
|
import { usePropsDefault, viewProps, getProps } from "../../../hooks/props-default/index.js";
|
|
8
9
|
import { name, dataProps, dataExpose, dataEmits } from "./data.js";
|
|
9
10
|
import "../../tables/common/img.js";
|
|
@@ -22,6 +23,7 @@ const _sfc_main = defineComponent({
|
|
|
22
23
|
viewProps(props, name);
|
|
23
24
|
const compons = getCompons(props.compons);
|
|
24
25
|
const cs = useCssName(name);
|
|
26
|
+
const refDom = ref();
|
|
25
27
|
const isfocus = ref(false);
|
|
26
28
|
const rowObj = ref();
|
|
27
29
|
const borderColor = computed(() => {
|
|
@@ -59,9 +61,9 @@ const _sfc_main = defineComponent({
|
|
|
59
61
|
lin = props.column;
|
|
60
62
|
is = true;
|
|
61
63
|
} else {
|
|
62
|
-
let k = (obj.
|
|
64
|
+
let k = (obj.colspan || 1) + lin;
|
|
63
65
|
if (k > props.column) {
|
|
64
|
-
lin = obj.
|
|
66
|
+
lin = obj.colspan || 1;
|
|
65
67
|
is = true;
|
|
66
68
|
} else {
|
|
67
69
|
lin = k;
|
|
@@ -97,9 +99,9 @@ const _sfc_main = defineComponent({
|
|
|
97
99
|
lin = props.column;
|
|
98
100
|
is = true;
|
|
99
101
|
} else {
|
|
100
|
-
let k = (obj.
|
|
102
|
+
let k = (obj.colspan || 1) + lin;
|
|
101
103
|
if (k > props.column) {
|
|
102
|
-
lin = obj.
|
|
104
|
+
lin = obj.colspan || 1;
|
|
103
105
|
is = true;
|
|
104
106
|
} else {
|
|
105
107
|
lin = k;
|
|
@@ -154,6 +156,7 @@ const _sfc_main = defineComponent({
|
|
|
154
156
|
obj.class ?? ""
|
|
155
157
|
].join(" "),
|
|
156
158
|
colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
|
|
159
|
+
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj),
|
|
157
160
|
onClick: (event) => {
|
|
158
161
|
isfocus.value = true;
|
|
159
162
|
rowObj.value = obj;
|
|
@@ -185,6 +188,20 @@ const _sfc_main = defineComponent({
|
|
|
185
188
|
]
|
|
186
189
|
);
|
|
187
190
|
};
|
|
191
|
+
const handleCellMouseLeave = ($event) => {
|
|
192
|
+
hideTooltip($event);
|
|
193
|
+
};
|
|
194
|
+
const handleCellMouseEnter = ($event, obj) => {
|
|
195
|
+
const showOverflow = obj.showOverflow ?? props.showOverflow;
|
|
196
|
+
if (showOverflow) {
|
|
197
|
+
showTooltip(
|
|
198
|
+
$event,
|
|
199
|
+
refDom.value,
|
|
200
|
+
showOverflow,
|
|
201
|
+
props.lineClamp
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
188
205
|
const getChildrenValue = (obj, index) => {
|
|
189
206
|
if (obj.children) {
|
|
190
207
|
return [
|
|
@@ -206,7 +223,10 @@ const _sfc_main = defineComponent({
|
|
|
206
223
|
class: cs.z("table-value"),
|
|
207
224
|
style: {
|
|
208
225
|
textAlign: obj.align || props.align
|
|
209
|
-
}
|
|
226
|
+
},
|
|
227
|
+
title: obj.title,
|
|
228
|
+
onMouseenter: ($event) => handleCellMouseEnter($event, obj),
|
|
229
|
+
onMouseleave: handleCellMouseLeave
|
|
210
230
|
},
|
|
211
231
|
[
|
|
212
232
|
setSslot(
|
|
@@ -237,7 +257,7 @@ const _sfc_main = defineComponent({
|
|
|
237
257
|
obj.class ?? ""
|
|
238
258
|
].join(" "),
|
|
239
259
|
colspan: setColspan(obj),
|
|
240
|
-
rowspan: isRow
|
|
260
|
+
rowspan: setRowspan(obj, isRow),
|
|
241
261
|
onClick: (event) => {
|
|
242
262
|
isfocus.value = true;
|
|
243
263
|
rowObj.value = obj;
|
|
@@ -259,6 +279,7 @@ const _sfc_main = defineComponent({
|
|
|
259
279
|
"td",
|
|
260
280
|
{
|
|
261
281
|
colspan: setColspan(obj),
|
|
282
|
+
rowspan: setRowspan(obj),
|
|
262
283
|
class: cs.is("whole", obj.whole)
|
|
263
284
|
},
|
|
264
285
|
[
|
|
@@ -285,8 +306,8 @@ const _sfc_main = defineComponent({
|
|
|
285
306
|
if (["auto", "top"].includes(props.labelPosition)) {
|
|
286
307
|
if (obj.whole) {
|
|
287
308
|
return props.column;
|
|
288
|
-
} else if (obj.
|
|
289
|
-
return obj.
|
|
309
|
+
} else if (obj.colspan) {
|
|
310
|
+
return obj.colspan;
|
|
290
311
|
} else {
|
|
291
312
|
return "";
|
|
292
313
|
}
|
|
@@ -294,21 +315,51 @@ const _sfc_main = defineComponent({
|
|
|
294
315
|
const j = !obj.isdiv ? 0 : 1;
|
|
295
316
|
if (obj.whole) {
|
|
296
317
|
return (props.column - 1) * 2 + 1 + j;
|
|
297
|
-
} else if (obj.
|
|
298
|
-
return (obj.
|
|
318
|
+
} else if (obj.colspan) {
|
|
319
|
+
return (obj.colspan - 1) * 2 + 1 + j;
|
|
299
320
|
} else {
|
|
300
321
|
return 1 + j;
|
|
301
322
|
}
|
|
302
323
|
}
|
|
303
324
|
};
|
|
325
|
+
const setRowspan = (obj, isRow) => {
|
|
326
|
+
if (props.labelPosition == "top") {
|
|
327
|
+
const j = !obj.isdiv ? 0 : 1;
|
|
328
|
+
if (obj.rowspan) {
|
|
329
|
+
return (obj.rowspan - 1) * 2 + 1 + j;
|
|
330
|
+
} else if (isRow) {
|
|
331
|
+
return 2;
|
|
332
|
+
}
|
|
333
|
+
} else if (props.labelPosition == "auto") {
|
|
334
|
+
if (obj.rowspan) {
|
|
335
|
+
return obj.rowspan;
|
|
336
|
+
} else if (isRow) {
|
|
337
|
+
return 2;
|
|
338
|
+
}
|
|
339
|
+
} else {
|
|
340
|
+
if (obj.rowspan) {
|
|
341
|
+
return obj.rowspan;
|
|
342
|
+
} else if (isRow) {
|
|
343
|
+
return 2;
|
|
344
|
+
} else {
|
|
345
|
+
return 1;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return;
|
|
349
|
+
};
|
|
304
350
|
const renderValue = () => {
|
|
305
351
|
if (props.list && props.list.length > 0) {
|
|
306
352
|
return h(
|
|
307
353
|
"div",
|
|
308
354
|
{
|
|
355
|
+
ref: (el) => {
|
|
356
|
+
refDom.value = el;
|
|
357
|
+
},
|
|
309
358
|
class: cs.z("div"),
|
|
310
359
|
style: cs.vdo({
|
|
311
360
|
borderColor: borderColor.value,
|
|
361
|
+
rowMaxHeight: props.rowMaxHeight,
|
|
362
|
+
lineClamp: props.lineClamp,
|
|
312
363
|
interval: props.interval
|
|
313
364
|
})
|
|
314
365
|
// onClick(event: Event) {
|
|
@@ -697,6 +697,17 @@
|
|
|
697
697
|
.list-div .list-table .list-table-th {
|
|
698
698
|
text-align: left;
|
|
699
699
|
}
|
|
700
|
+
.list-div .list-table .list-table-value {
|
|
701
|
+
word-break: break-all;
|
|
702
|
+
white-space: normal;
|
|
703
|
+
display: block;
|
|
704
|
+
max-height: var(--list-row-max-height);
|
|
705
|
+
display: -webkit-box;
|
|
706
|
+
-webkit-line-clamp: var(--list-line-clamp); /* 显示的行数 */
|
|
707
|
+
-webkit-box-orient: vertical;
|
|
708
|
+
overflow: hidden;
|
|
709
|
+
text-overflow: ellipsis;
|
|
710
|
+
}
|
|
700
711
|
.list-div .list-table.right .list-table-th {
|
|
701
712
|
text-align: right;
|
|
702
713
|
}
|