linkmore-design 1.0.82 → 1.0.83
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/Form/style/index.d.ts +0 -3
- package/dist/LmEditTable/EditTable.d.ts +6 -0
- package/dist/LmEditTable/util.d.ts +1 -0
- package/dist/LmTable/components/customRenderEmpty.d.ts +2 -0
- package/dist/LmTable/demos/virtual.d.ts +2 -0
- package/dist/LmTable/util.d.ts +16 -0
- package/dist/LmTable/virTual/VirtualRow.d.ts +6 -0
- package/dist/LmTable/virTual/VirtualTable.d.ts +3 -0
- package/dist/LmTable/virTual/VirtualWrapper.d.ts +3 -0
- package/dist/LmTable/virTual/context.d.ts +13 -0
- package/dist/LmTable/virTual/index.d.ts +4 -0
- package/dist/TestTable/LmBox.d.ts +12 -0
- package/dist/TestTable/demos/basic.d.ts +6 -0
- package/dist/TestTable/index.d.ts +2 -0
- package/dist/TestTable/style/index.d.ts +1 -0
- package/dist/index.umd.js +764 -369
- package/dist/index.umd.min.js +3 -3
- package/es/Form/style/form.css +603 -0
- package/es/Form/style/grid.css +5185 -0
- package/es/Form/style/index.css +6 -1
- package/es/Form/style/index.d.ts +0 -3
- package/es/Form/style/index.js +0 -4
- package/es/Form/style/tooltip.css +275 -0
- package/es/LmEditTable/EditTable.d.ts +6 -0
- package/es/LmEditTable/EditTable.js +63 -81
- package/es/LmEditTable/sortableItemCol.js +6 -3
- package/es/LmEditTable/style/index.css +7 -0
- package/es/LmEditTable/util.d.ts +1 -0
- package/es/LmEditTable/util.js +5 -0
- package/es/LmTable/Table.js +308 -173
- package/es/LmTable/components/customRenderEmpty.d.ts +2 -0
- package/es/LmTable/components/customRenderEmpty.js +15 -0
- package/es/LmTable/components/sheelTableCell.js +14 -8
- package/es/LmTable/style/index.css +177 -152
- package/es/LmTable/util.js +105 -0
- package/es/LmTable/virTual/VirtualRow.d.ts +6 -0
- package/es/LmTable/virTual/VirtualRow.js +102 -0
- package/es/LmTable/virTual/VirtualTable.d.ts +3 -0
- package/es/LmTable/virTual/VirtualTable.js +52 -0
- package/es/LmTable/virTual/VirtualWrapper.d.ts +3 -0
- package/es/LmTable/virTual/VirtualWrapper.js +61 -0
- package/es/LmTable/virTual/context.d.ts +13 -0
- package/es/LmTable/virTual/context.js +54 -0
- package/es/LmTable/virTual/index.d.ts +4 -0
- package/es/LmTable/virTual/index.js +4 -0
- package/es/TestTable/LmBox.d.ts +12 -0
- package/es/TestTable/LmBox.js +6 -0
- package/es/TestTable/index.d.ts +2 -0
- package/es/TestTable/index.js +2 -0
- package/es/TestTable/style/index.css +10 -0
- package/es/TestTable/style/index.js +3 -0
- package/es/hooks/useFullscreen/index.js +23 -2
- package/lib/Form/style/form.css +603 -0
- package/lib/Form/style/grid.css +5185 -0
- package/lib/Form/style/index.css +6 -1
- package/lib/Form/style/index.d.ts +0 -3
- package/lib/Form/style/index.js +0 -6
- package/lib/Form/style/tooltip.css +275 -0
- package/lib/LmEditTable/EditTable.d.ts +6 -0
- package/lib/LmEditTable/EditTable.js +64 -80
- package/lib/LmEditTable/sortableItemCol.js +6 -3
- package/lib/LmEditTable/style/index.css +7 -0
- package/lib/LmEditTable/util.d.ts +1 -0
- package/lib/LmEditTable/util.js +12 -0
- package/lib/LmTable/Table.js +308 -173
- package/lib/LmTable/components/customRenderEmpty.d.ts +2 -0
- package/lib/LmTable/components/customRenderEmpty.js +25 -0
- package/lib/LmTable/components/sheelTableCell.js +14 -8
- package/lib/LmTable/style/index.css +177 -152
- package/lib/LmTable/util.js +105 -0
- package/lib/LmTable/virTual/VirtualRow.d.ts +6 -0
- package/lib/LmTable/virTual/VirtualRow.js +115 -0
- package/lib/LmTable/virTual/VirtualTable.d.ts +3 -0
- package/lib/LmTable/virTual/VirtualTable.js +69 -0
- package/lib/LmTable/virTual/VirtualWrapper.d.ts +3 -0
- package/lib/LmTable/virTual/VirtualWrapper.js +74 -0
- package/lib/LmTable/virTual/context.d.ts +13 -0
- package/lib/LmTable/virTual/context.js +64 -0
- package/lib/LmTable/virTual/index.d.ts +4 -0
- package/lib/LmTable/virTual/index.js +31 -0
- package/lib/TestTable/LmBox.d.ts +12 -0
- package/lib/TestTable/LmBox.js +17 -0
- package/lib/TestTable/index.d.ts +2 -0
- package/lib/TestTable/index.js +13 -0
- package/lib/TestTable/style/index.css +10 -0
- package/lib/TestTable/style/index.js +3 -0
- package/lib/hooks/useFullscreen/index.js +23 -2
- package/package.json +1 -1
package/lib/Form/style/index.css
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@import url(./form.css);
|
|
2
|
+
@import url(./grid.css);
|
|
3
|
+
@import url(./tooltip.css);
|
|
1
4
|
.ant-layout-sider {
|
|
2
5
|
min-height: 100vh;
|
|
3
6
|
background-color: #022766;
|
|
@@ -515,6 +518,9 @@ p {
|
|
|
515
518
|
.lm_form.ant-form .ant-form-item .ant-form-item-explain {
|
|
516
519
|
line-height: 24px;
|
|
517
520
|
}
|
|
521
|
+
.lm_form.ant-form.ant-form-horizontal .ant-form-item-label {
|
|
522
|
+
margin-top: 8px;
|
|
523
|
+
}
|
|
518
524
|
.lm_form.ant-form .ant-form-item-label {
|
|
519
525
|
display: flex;
|
|
520
526
|
align-items: center;
|
|
@@ -522,7 +528,6 @@ p {
|
|
|
522
528
|
line-height: 18px;
|
|
523
529
|
padding: 0;
|
|
524
530
|
margin-bottom: 8px;
|
|
525
|
-
margin-top: 8px;
|
|
526
531
|
}
|
|
527
532
|
.lm_form.ant-form .ant-form-item-label > label {
|
|
528
533
|
width: 132px;
|
package/lib/Form/style/index.js
CHANGED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.ant-tooltip {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
color: rgba(0, 0, 0, 0.85);
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
font-variant: tabular-nums;
|
|
12
|
+
line-height: 1.5715;
|
|
13
|
+
list-style: none;
|
|
14
|
+
font-feature-settings: 'tnum';
|
|
15
|
+
position: absolute;
|
|
16
|
+
z-index: 1070;
|
|
17
|
+
display: block;
|
|
18
|
+
width: -webkit-max-content;
|
|
19
|
+
width: -moz-max-content;
|
|
20
|
+
width: max-content;
|
|
21
|
+
width: intrinsic;
|
|
22
|
+
max-width: 250px;
|
|
23
|
+
visibility: visible;
|
|
24
|
+
}
|
|
25
|
+
.ant-tooltip-content {
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
.ant-tooltip-hidden {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
.ant-tooltip-placement-top,
|
|
32
|
+
.ant-tooltip-placement-topLeft,
|
|
33
|
+
.ant-tooltip-placement-topRight {
|
|
34
|
+
padding-bottom: 14.3137085px;
|
|
35
|
+
}
|
|
36
|
+
.ant-tooltip-placement-right,
|
|
37
|
+
.ant-tooltip-placement-rightTop,
|
|
38
|
+
.ant-tooltip-placement-rightBottom {
|
|
39
|
+
padding-left: 14.3137085px;
|
|
40
|
+
}
|
|
41
|
+
.ant-tooltip-placement-bottom,
|
|
42
|
+
.ant-tooltip-placement-bottomLeft,
|
|
43
|
+
.ant-tooltip-placement-bottomRight {
|
|
44
|
+
padding-top: 14.3137085px;
|
|
45
|
+
}
|
|
46
|
+
.ant-tooltip-placement-left,
|
|
47
|
+
.ant-tooltip-placement-leftTop,
|
|
48
|
+
.ant-tooltip-placement-leftBottom {
|
|
49
|
+
padding-right: 14.3137085px;
|
|
50
|
+
}
|
|
51
|
+
.ant-tooltip-inner {
|
|
52
|
+
min-width: 30px;
|
|
53
|
+
min-height: 32px;
|
|
54
|
+
padding: 6px 8px;
|
|
55
|
+
color: #fff;
|
|
56
|
+
text-align: left;
|
|
57
|
+
text-decoration: none;
|
|
58
|
+
word-wrap: break-word;
|
|
59
|
+
background-color: rgba(0, 0, 0, 0.75);
|
|
60
|
+
border-radius: 2px;
|
|
61
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
62
|
+
}
|
|
63
|
+
.ant-tooltip-arrow {
|
|
64
|
+
position: absolute;
|
|
65
|
+
z-index: 2;
|
|
66
|
+
display: block;
|
|
67
|
+
width: 22px;
|
|
68
|
+
height: 22px;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
background: transparent;
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
}
|
|
73
|
+
.ant-tooltip-arrow-content {
|
|
74
|
+
--antd-arrow-background-color: linear-gradient(to right bottom, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.75));
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 0;
|
|
77
|
+
right: 0;
|
|
78
|
+
bottom: 0;
|
|
79
|
+
left: 0;
|
|
80
|
+
display: block;
|
|
81
|
+
width: 11.3137085px;
|
|
82
|
+
height: 11.3137085px;
|
|
83
|
+
margin: auto;
|
|
84
|
+
content: '';
|
|
85
|
+
pointer-events: auto;
|
|
86
|
+
border-radius: 0 0 2px;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
.ant-tooltip-arrow-content::before {
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: -11.3137085px;
|
|
92
|
+
left: -11.3137085px;
|
|
93
|
+
width: 33.9411255px;
|
|
94
|
+
height: 33.9411255px;
|
|
95
|
+
background: var(--antd-arrow-background-color);
|
|
96
|
+
background-repeat: no-repeat;
|
|
97
|
+
background-position: -10px -10px;
|
|
98
|
+
content: '';
|
|
99
|
+
-webkit-clip-path: inset(33% 33%);
|
|
100
|
+
clip-path: inset(33% 33%);
|
|
101
|
+
-webkit-clip-path: path('M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z');
|
|
102
|
+
clip-path: path('M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z');
|
|
103
|
+
}
|
|
104
|
+
.ant-tooltip-placement-top .ant-tooltip-arrow,
|
|
105
|
+
.ant-tooltip-placement-topLeft .ant-tooltip-arrow,
|
|
106
|
+
.ant-tooltip-placement-topRight .ant-tooltip-arrow {
|
|
107
|
+
bottom: 0;
|
|
108
|
+
transform: translateY(100%);
|
|
109
|
+
}
|
|
110
|
+
.ant-tooltip-placement-top .ant-tooltip-arrow-content,
|
|
111
|
+
.ant-tooltip-placement-topLeft .ant-tooltip-arrow-content,
|
|
112
|
+
.ant-tooltip-placement-topRight .ant-tooltip-arrow-content {
|
|
113
|
+
box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);
|
|
114
|
+
transform: translateY(-11px) rotate(45deg);
|
|
115
|
+
}
|
|
116
|
+
.ant-tooltip-placement-top .ant-tooltip-arrow {
|
|
117
|
+
left: 50%;
|
|
118
|
+
transform: translateY(100%) translateX(-50%);
|
|
119
|
+
}
|
|
120
|
+
.ant-tooltip-placement-topLeft .ant-tooltip-arrow {
|
|
121
|
+
left: 13px;
|
|
122
|
+
}
|
|
123
|
+
.ant-tooltip-placement-topRight .ant-tooltip-arrow {
|
|
124
|
+
right: 13px;
|
|
125
|
+
}
|
|
126
|
+
.ant-tooltip-placement-right .ant-tooltip-arrow,
|
|
127
|
+
.ant-tooltip-placement-rightTop .ant-tooltip-arrow,
|
|
128
|
+
.ant-tooltip-placement-rightBottom .ant-tooltip-arrow {
|
|
129
|
+
left: 0;
|
|
130
|
+
transform: translateX(-100%);
|
|
131
|
+
}
|
|
132
|
+
.ant-tooltip-placement-right .ant-tooltip-arrow-content,
|
|
133
|
+
.ant-tooltip-placement-rightTop .ant-tooltip-arrow-content,
|
|
134
|
+
.ant-tooltip-placement-rightBottom .ant-tooltip-arrow-content {
|
|
135
|
+
box-shadow: -3px 3px 7px rgba(0, 0, 0, 0.07);
|
|
136
|
+
transform: translateX(11px) rotate(135deg);
|
|
137
|
+
}
|
|
138
|
+
.ant-tooltip-placement-right .ant-tooltip-arrow {
|
|
139
|
+
top: 50%;
|
|
140
|
+
transform: translateX(-100%) translateY(-50%);
|
|
141
|
+
}
|
|
142
|
+
.ant-tooltip-placement-rightTop .ant-tooltip-arrow {
|
|
143
|
+
top: 5px;
|
|
144
|
+
}
|
|
145
|
+
.ant-tooltip-placement-rightBottom .ant-tooltip-arrow {
|
|
146
|
+
bottom: 5px;
|
|
147
|
+
}
|
|
148
|
+
.ant-tooltip-placement-left .ant-tooltip-arrow,
|
|
149
|
+
.ant-tooltip-placement-leftTop .ant-tooltip-arrow,
|
|
150
|
+
.ant-tooltip-placement-leftBottom .ant-tooltip-arrow {
|
|
151
|
+
right: 0;
|
|
152
|
+
transform: translateX(100%);
|
|
153
|
+
}
|
|
154
|
+
.ant-tooltip-placement-left .ant-tooltip-arrow-content,
|
|
155
|
+
.ant-tooltip-placement-leftTop .ant-tooltip-arrow-content,
|
|
156
|
+
.ant-tooltip-placement-leftBottom .ant-tooltip-arrow-content {
|
|
157
|
+
box-shadow: 3px -3px 7px rgba(0, 0, 0, 0.07);
|
|
158
|
+
transform: translateX(-11px) rotate(315deg);
|
|
159
|
+
}
|
|
160
|
+
.ant-tooltip-placement-left .ant-tooltip-arrow {
|
|
161
|
+
top: 50%;
|
|
162
|
+
transform: translateX(100%) translateY(-50%);
|
|
163
|
+
}
|
|
164
|
+
.ant-tooltip-placement-leftTop .ant-tooltip-arrow {
|
|
165
|
+
top: 5px;
|
|
166
|
+
}
|
|
167
|
+
.ant-tooltip-placement-leftBottom .ant-tooltip-arrow {
|
|
168
|
+
bottom: 5px;
|
|
169
|
+
}
|
|
170
|
+
.ant-tooltip-placement-bottom .ant-tooltip-arrow,
|
|
171
|
+
.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,
|
|
172
|
+
.ant-tooltip-placement-bottomRight .ant-tooltip-arrow {
|
|
173
|
+
top: 0;
|
|
174
|
+
transform: translateY(-100%);
|
|
175
|
+
}
|
|
176
|
+
.ant-tooltip-placement-bottom .ant-tooltip-arrow-content,
|
|
177
|
+
.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow-content,
|
|
178
|
+
.ant-tooltip-placement-bottomRight .ant-tooltip-arrow-content {
|
|
179
|
+
box-shadow: -3px -3px 7px rgba(0, 0, 0, 0.07);
|
|
180
|
+
transform: translateY(11px) rotate(225deg);
|
|
181
|
+
}
|
|
182
|
+
.ant-tooltip-placement-bottom .ant-tooltip-arrow {
|
|
183
|
+
left: 50%;
|
|
184
|
+
transform: translateY(-100%) translateX(-50%);
|
|
185
|
+
}
|
|
186
|
+
.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow {
|
|
187
|
+
left: 13px;
|
|
188
|
+
}
|
|
189
|
+
.ant-tooltip-placement-bottomRight .ant-tooltip-arrow {
|
|
190
|
+
right: 13px;
|
|
191
|
+
}
|
|
192
|
+
.ant-tooltip-pink .ant-tooltip-inner {
|
|
193
|
+
background-color: #eb2f96;
|
|
194
|
+
}
|
|
195
|
+
.ant-tooltip-pink .ant-tooltip-arrow-content::before {
|
|
196
|
+
background: #eb2f96;
|
|
197
|
+
}
|
|
198
|
+
.ant-tooltip-magenta .ant-tooltip-inner {
|
|
199
|
+
background-color: #eb2f96;
|
|
200
|
+
}
|
|
201
|
+
.ant-tooltip-magenta .ant-tooltip-arrow-content::before {
|
|
202
|
+
background: #eb2f96;
|
|
203
|
+
}
|
|
204
|
+
.ant-tooltip-red .ant-tooltip-inner {
|
|
205
|
+
background-color: #f5222d;
|
|
206
|
+
}
|
|
207
|
+
.ant-tooltip-red .ant-tooltip-arrow-content::before {
|
|
208
|
+
background: #f5222d;
|
|
209
|
+
}
|
|
210
|
+
.ant-tooltip-volcano .ant-tooltip-inner {
|
|
211
|
+
background-color: #fa541c;
|
|
212
|
+
}
|
|
213
|
+
.ant-tooltip-volcano .ant-tooltip-arrow-content::before {
|
|
214
|
+
background: #fa541c;
|
|
215
|
+
}
|
|
216
|
+
.ant-tooltip-orange .ant-tooltip-inner {
|
|
217
|
+
background-color: #fa8c16;
|
|
218
|
+
}
|
|
219
|
+
.ant-tooltip-orange .ant-tooltip-arrow-content::before {
|
|
220
|
+
background: #fa8c16;
|
|
221
|
+
}
|
|
222
|
+
.ant-tooltip-yellow .ant-tooltip-inner {
|
|
223
|
+
background-color: #fadb14;
|
|
224
|
+
}
|
|
225
|
+
.ant-tooltip-yellow .ant-tooltip-arrow-content::before {
|
|
226
|
+
background: #fadb14;
|
|
227
|
+
}
|
|
228
|
+
.ant-tooltip-gold .ant-tooltip-inner {
|
|
229
|
+
background-color: #faad14;
|
|
230
|
+
}
|
|
231
|
+
.ant-tooltip-gold .ant-tooltip-arrow-content::before {
|
|
232
|
+
background: #faad14;
|
|
233
|
+
}
|
|
234
|
+
.ant-tooltip-cyan .ant-tooltip-inner {
|
|
235
|
+
background-color: #13c2c2;
|
|
236
|
+
}
|
|
237
|
+
.ant-tooltip-cyan .ant-tooltip-arrow-content::before {
|
|
238
|
+
background: #13c2c2;
|
|
239
|
+
}
|
|
240
|
+
.ant-tooltip-lime .ant-tooltip-inner {
|
|
241
|
+
background-color: #a0d911;
|
|
242
|
+
}
|
|
243
|
+
.ant-tooltip-lime .ant-tooltip-arrow-content::before {
|
|
244
|
+
background: #a0d911;
|
|
245
|
+
}
|
|
246
|
+
.ant-tooltip-green .ant-tooltip-inner {
|
|
247
|
+
background-color: #52c41a;
|
|
248
|
+
}
|
|
249
|
+
.ant-tooltip-green .ant-tooltip-arrow-content::before {
|
|
250
|
+
background: #52c41a;
|
|
251
|
+
}
|
|
252
|
+
.ant-tooltip-blue .ant-tooltip-inner {
|
|
253
|
+
background-color: #1890ff;
|
|
254
|
+
}
|
|
255
|
+
.ant-tooltip-blue .ant-tooltip-arrow-content::before {
|
|
256
|
+
background: #1890ff;
|
|
257
|
+
}
|
|
258
|
+
.ant-tooltip-geekblue .ant-tooltip-inner {
|
|
259
|
+
background-color: #2f54eb;
|
|
260
|
+
}
|
|
261
|
+
.ant-tooltip-geekblue .ant-tooltip-arrow-content::before {
|
|
262
|
+
background: #2f54eb;
|
|
263
|
+
}
|
|
264
|
+
.ant-tooltip-purple .ant-tooltip-inner {
|
|
265
|
+
background-color: #722ed1;
|
|
266
|
+
}
|
|
267
|
+
.ant-tooltip-purple .ant-tooltip-arrow-content::before {
|
|
268
|
+
background: #722ed1;
|
|
269
|
+
}
|
|
270
|
+
.ant-tooltip-rtl {
|
|
271
|
+
direction: rtl;
|
|
272
|
+
}
|
|
273
|
+
.ant-tooltip-rtl .ant-tooltip-inner {
|
|
274
|
+
text-align: right;
|
|
275
|
+
}
|
|
@@ -14,6 +14,11 @@ interface ILmEditTable extends TableProps<any> {
|
|
|
14
14
|
size?: TableProps<any>['size'];
|
|
15
15
|
colSortOpen?: boolean;
|
|
16
16
|
filterChange?: (data: TableProps<any>['columns']) => void;
|
|
17
|
+
recordCreatorProps?: {
|
|
18
|
+
creatorButtonText?: string;
|
|
19
|
+
style?: Record<string, any>;
|
|
20
|
+
initData?: Record<string, any> | (() => Record<string, any>);
|
|
21
|
+
};
|
|
17
22
|
}
|
|
18
23
|
interface ILmColumns extends TableColumnType<any> {
|
|
19
24
|
editable?: 'input' | 'number' | 'inputRange' | 'date' | 'select' | 'multiple' | 'checkbox' | 'radio' | 'switch' | 'upload' | 'operate' | 'lm_edit_opetate' | 'render';
|
|
@@ -23,6 +28,7 @@ interface ILmColumns extends TableColumnType<any> {
|
|
|
23
28
|
valueType?: any;
|
|
24
29
|
order?: number;
|
|
25
30
|
componentProps?: Record<string, any>;
|
|
31
|
+
relevanceCols?: boolean;
|
|
26
32
|
}
|
|
27
33
|
export declare type TLmEditTable = {
|
|
28
34
|
onChange?: (data: any[]) => void;
|
|
@@ -45,6 +45,10 @@ var _DragHandle = _interopRequireDefault(require("./DragHandle"));
|
|
|
45
45
|
|
|
46
46
|
var _UploadOss = _interopRequireDefault(require("../UploadOss"));
|
|
47
47
|
|
|
48
|
+
var _util = require("./util");
|
|
49
|
+
|
|
50
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
51
|
+
|
|
48
52
|
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
49
53
|
function adopt(value) {
|
|
50
54
|
return value instanceof P ? value : new P(function (resolve) {
|
|
@@ -211,7 +215,9 @@ var Opetate = function Opetate(_ref) {
|
|
|
211
215
|
handleAdd = _ref.handleAdd,
|
|
212
216
|
handleDelete = _ref.handleDelete,
|
|
213
217
|
_ref$options = _ref.options,
|
|
214
|
-
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options
|
|
218
|
+
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
219
|
+
getLength = _ref.getLength,
|
|
220
|
+
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
215
221
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
216
222
|
style: {
|
|
217
223
|
display: 'flex',
|
|
@@ -221,6 +227,7 @@ var Opetate = function Opetate(_ref) {
|
|
|
221
227
|
}, options.includes('delete') && /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
222
228
|
type: "link",
|
|
223
229
|
size: "small",
|
|
230
|
+
disabled: !quickOpetateClearAll && getLength < 2,
|
|
224
231
|
icon: /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
225
232
|
type: "lmweb-minus-circle",
|
|
226
233
|
style: {
|
|
@@ -265,8 +272,11 @@ var EditableCell = function EditableCell(props) {
|
|
|
265
272
|
isEdit = props.isEdit,
|
|
266
273
|
_props$col = props.col,
|
|
267
274
|
col = _props$col === void 0 ? {} : _props$col,
|
|
275
|
+
rowIndex = props.rowIndex,
|
|
276
|
+
colIndex = props.colIndex,
|
|
268
277
|
handleTableRowDelete = props.handleTableRowDelete,
|
|
269
278
|
handleTableRowAdd = props.handleTableRowAdd,
|
|
279
|
+
quickOpetateClearAll = props.quickOpetateClearAll,
|
|
270
280
|
getLength = props.getLength,
|
|
271
281
|
isHoverEdit = props.isHoverEdit,
|
|
272
282
|
editEnum = props.editEnum,
|
|
@@ -279,7 +289,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
279
289
|
itemProps = props.itemProps,
|
|
280
290
|
setValid = props.setValid,
|
|
281
291
|
reWriteOriginSource = props.reWriteOriginSource,
|
|
282
|
-
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
292
|
+
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
283
293
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
284
294
|
|
|
285
295
|
|
|
@@ -324,20 +334,24 @@ var EditableCell = function EditableCell(props) {
|
|
|
324
334
|
switch (_context.prev = _context.next) {
|
|
325
335
|
case 0:
|
|
326
336
|
_context.prev = 0;
|
|
327
|
-
_context.t0 = row;
|
|
328
337
|
|
|
329
|
-
if (
|
|
330
|
-
_context.next =
|
|
338
|
+
if (!row) {
|
|
339
|
+
_context.next = 5;
|
|
331
340
|
break;
|
|
332
341
|
}
|
|
333
342
|
|
|
334
|
-
_context.
|
|
335
|
-
|
|
343
|
+
_context.t0 = (0, _lodash.omit)(row, 'onChange');
|
|
344
|
+
_context.next = 8;
|
|
345
|
+
break;
|
|
336
346
|
|
|
337
347
|
case 5:
|
|
348
|
+
_context.next = 7;
|
|
349
|
+
return form.getFieldsValue();
|
|
350
|
+
|
|
351
|
+
case 7:
|
|
338
352
|
_context.t0 = _context.sent;
|
|
339
353
|
|
|
340
|
-
case
|
|
354
|
+
case 8:
|
|
341
355
|
values = _context.t0;
|
|
342
356
|
resultComponentProps = (0, _lodash.isFunction)(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps; // console.time('testForEach');
|
|
343
357
|
|
|
@@ -355,10 +369,10 @@ var EditableCell = function EditableCell(props) {
|
|
|
355
369
|
} // console.timeEnd('testForEach');
|
|
356
370
|
|
|
357
371
|
|
|
358
|
-
_context.next =
|
|
372
|
+
_context.next = 13;
|
|
359
373
|
return form.validateFields();
|
|
360
374
|
|
|
361
|
-
case
|
|
375
|
+
case 13:
|
|
362
376
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
363
377
|
toggleEdit();
|
|
364
378
|
} // // 清空异常校验
|
|
@@ -369,31 +383,25 @@ var EditableCell = function EditableCell(props) {
|
|
|
369
383
|
// })
|
|
370
384
|
|
|
371
385
|
|
|
372
|
-
_context.next =
|
|
386
|
+
_context.next = 18;
|
|
373
387
|
break;
|
|
374
388
|
|
|
375
|
-
case
|
|
376
|
-
_context.prev =
|
|
389
|
+
case 16:
|
|
390
|
+
_context.prev = 16;
|
|
377
391
|
_context.t1 = _context["catch"](0);
|
|
378
392
|
|
|
379
|
-
case
|
|
393
|
+
case 18:
|
|
380
394
|
case "end":
|
|
381
395
|
return _context.stop();
|
|
382
396
|
}
|
|
383
397
|
}
|
|
384
|
-
}, _callee, null, [[0,
|
|
398
|
+
}, _callee, null, [[0, 16]]);
|
|
385
399
|
}));
|
|
386
400
|
}; // 触发保存
|
|
387
401
|
|
|
388
402
|
|
|
389
403
|
var handleFormItemChange = function handleFormItemChange(e) {
|
|
390
|
-
save === null || save === void 0 ? void 0 : save();
|
|
391
|
-
// if (componentProps.isOnlyValue !== undefined) {
|
|
392
|
-
// console.log(777)
|
|
393
|
-
// handleCopy?.(dataIndex, componentProps.isOnlyValue)
|
|
394
|
-
// } else {
|
|
395
|
-
// save?.()
|
|
396
|
-
// }
|
|
404
|
+
save === null || save === void 0 ? void 0 : save();
|
|
397
405
|
};
|
|
398
406
|
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
399
407
|
|
|
@@ -503,10 +511,11 @@ var EditableCell = function EditableCell(props) {
|
|
|
503
511
|
}, resultComponentProps));
|
|
504
512
|
|
|
505
513
|
case 'switch':
|
|
506
|
-
return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Switch, {
|
|
507
|
-
size: 'small'
|
|
514
|
+
return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Switch, Object.assign({
|
|
515
|
+
size: 'small'
|
|
516
|
+
}, resultComponentProps, {
|
|
508
517
|
onChange: handleFormItemChange
|
|
509
|
-
});
|
|
518
|
+
}));
|
|
510
519
|
|
|
511
520
|
case 'upload':
|
|
512
521
|
return /*#__PURE__*/_react.default.createElement(UploadSingle, {
|
|
@@ -523,13 +532,15 @@ var EditableCell = function EditableCell(props) {
|
|
|
523
532
|
ref: inputRef,
|
|
524
533
|
handleAdd: handleTableRowAdd,
|
|
525
534
|
handleDelete: handleTableRowDelete,
|
|
526
|
-
getLength: getLength
|
|
535
|
+
getLength: getLength,
|
|
536
|
+
quickOpetateClearAll: quickOpetateClearAll
|
|
527
537
|
}, resultComponentProps));
|
|
528
538
|
|
|
529
539
|
case 'render':
|
|
530
540
|
{
|
|
531
541
|
var render = resultComponentProps.render;
|
|
532
|
-
|
|
542
|
+
var fromData = form.getFieldsValue();
|
|
543
|
+
return render === null || render === void 0 ? void 0 : render(Object.assign(Object.assign({}, !(0, _util.isObjEmpty)(fromData) ? fromData : record), {
|
|
533
544
|
onChange: save
|
|
534
545
|
}));
|
|
535
546
|
}
|
|
@@ -584,7 +595,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
584
595
|
}
|
|
585
596
|
|
|
586
597
|
return childNode;
|
|
587
|
-
}, [col, isEdit, editing]); // const [childNode, setChildNode] = useState(getMemoChildNode);
|
|
598
|
+
}, [col, isEdit, editing, getLength]); // const [childNode, setChildNode] = useState(getMemoChildNode);
|
|
588
599
|
// 出现死循环找我
|
|
589
600
|
|
|
590
601
|
(0, _react.useEffect)(function () {
|
|
@@ -602,38 +613,11 @@ var EditableCell = function EditableCell(props) {
|
|
|
602
613
|
// })
|
|
603
614
|
// }
|
|
604
615
|
|
|
605
|
-
}, [record]);
|
|
606
|
-
// const classNames = cx({
|
|
607
|
-
// 'lm_base_editTable_cell': true,
|
|
608
|
-
// 'lm_base_editTable_cell_edit': isOpenEdit || (isHoverEdit && !curValueIsValid),
|
|
609
|
-
// });
|
|
610
|
-
// const extensionConfig = {};
|
|
611
|
-
// const mouseEnterCell = () => {
|
|
612
|
-
// focusCapturedRef.current = true;
|
|
613
|
-
// const newChildNode = getMemoChildNode;
|
|
614
|
-
// setChildNode(newChildNode);
|
|
615
|
-
// };
|
|
616
|
-
// const mouseLeaveCell = () => {
|
|
617
|
-
// focusCapturedRef.current = false;
|
|
618
|
-
// const nextValue = form.getFieldValue(dataIndex);
|
|
619
|
-
// const prevValue = get(record, dataIndex);
|
|
620
|
-
// if (!eq(prevValue, nextValue)) {
|
|
621
|
-
// const rowValue = get(record, rowKey);
|
|
622
|
-
// reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue);
|
|
623
|
-
// } else {
|
|
624
|
-
// const newChildNode = getDefaultChildNode(false);
|
|
625
|
-
// setChildNode(newChildNode);
|
|
626
|
-
// }
|
|
627
|
-
// };
|
|
628
|
-
// if (isHoverEdit && record?.editable) {
|
|
629
|
-
// console.log('ssssbbb')
|
|
630
|
-
// set(extensionConfig, 'onMouseEnter', mouseEnterCell);
|
|
631
|
-
// set(extensionConfig, 'onMouseLeave', mouseLeaveCell);
|
|
632
|
-
// }
|
|
633
|
-
|
|
616
|
+
}, [record]);
|
|
634
617
|
return /*#__PURE__*/_react.default.createElement("td", Object.assign({}, clearProps, {
|
|
635
|
-
|
|
636
|
-
|
|
618
|
+
className: (0, _classnames.default)(clearProps === null || clearProps === void 0 ? void 0 : clearProps.className, 'lm_custom_cell_td'),
|
|
619
|
+
key: "r".concat(rowIndex, "_c").concat(colIndex)
|
|
620
|
+
}), getMemoChildNode);
|
|
637
621
|
};
|
|
638
622
|
|
|
639
623
|
var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
@@ -658,7 +642,8 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
658
642
|
filterChange = props.filterChange,
|
|
659
643
|
_props$size = props.size,
|
|
660
644
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
661
|
-
|
|
645
|
+
recordCreatorProps = props.recordCreatorProps,
|
|
646
|
+
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps"]);
|
|
662
647
|
|
|
663
648
|
var _useState3 = (0, _react.useState)([]),
|
|
664
649
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
@@ -701,14 +686,12 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
701
686
|
};
|
|
702
687
|
|
|
703
688
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
704
|
-
console.log(active, over, 2223);
|
|
705
689
|
var oldIndex = columns.findIndex(function (item) {
|
|
706
690
|
return item.dataIndex === active;
|
|
707
691
|
});
|
|
708
692
|
var newIndex = columns.findIndex(function (item) {
|
|
709
693
|
return item.dataIndex === over;
|
|
710
694
|
});
|
|
711
|
-
console.log((0, _sortable.arrayMove)(columns, oldIndex, newIndex), 222);
|
|
712
695
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange((0, _sortable.arrayMove)(columns, oldIndex, newIndex).map(function (item, index) {
|
|
713
696
|
return Object.assign(Object.assign({}, item), {
|
|
714
697
|
order: index
|
|
@@ -727,8 +710,11 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
727
710
|
|
|
728
711
|
|
|
729
712
|
var handleAdd = function handleAdd(row) {
|
|
713
|
+
var _a;
|
|
714
|
+
|
|
715
|
+
var addDataInfo = (0, _lodash.isFunction)(recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData) ? (_a = recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData) === null || _a === void 0 ? void 0 : _a.call(recordCreatorProps) : recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData;
|
|
730
716
|
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
731
|
-
draft.push((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
|
|
717
|
+
draft.push(Object.assign((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
732
718
|
});
|
|
733
719
|
setDataSource(res);
|
|
734
720
|
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
@@ -924,7 +910,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
924
910
|
});
|
|
925
911
|
var newOptions = options.map(function (o) {
|
|
926
912
|
return Object.assign(Object.assign({}, o), {
|
|
927
|
-
disabled: dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
|
|
913
|
+
disabled: !!dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
|
|
928
914
|
});
|
|
929
915
|
});
|
|
930
916
|
return Object.assign(Object.assign({}, item), {
|
|
@@ -941,15 +927,8 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
941
927
|
var memoOptions = (0, _react.useMemo)(function () {
|
|
942
928
|
return hasDisableOptions ? [DisableOptions] : [];
|
|
943
929
|
}, [hasDisableOptions, DisableOptions]);
|
|
944
|
-
|
|
945
|
-
var getDataSourceLen = function getDataSourceLen() {
|
|
946
|
-
var _a;
|
|
947
|
-
|
|
948
|
-
return (_a = dataSourceRef.current) === null || _a === void 0 ? void 0 : _a.length;
|
|
949
|
-
};
|
|
950
930
|
/** 组装之后的最终columns */
|
|
951
931
|
|
|
952
|
-
|
|
953
932
|
var resultColumns = (0, _react.useMemo)(function () {
|
|
954
933
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
955
934
|
var localColumns = [sortOpen ? {
|
|
@@ -995,7 +974,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
995
974
|
}
|
|
996
975
|
});
|
|
997
976
|
localColumns = [].concat(leftColumns, mainColumns, rightColumns);
|
|
998
|
-
var res = localColumns.map(function (col) {
|
|
977
|
+
var res = localColumns.map(function (col, index) {
|
|
999
978
|
if (!col.editable) {
|
|
1000
979
|
return col;
|
|
1001
980
|
}
|
|
@@ -1004,20 +983,25 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1004
983
|
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
1005
984
|
var _a;
|
|
1006
985
|
|
|
1007
|
-
var dataIndex = col.dataIndex
|
|
986
|
+
var dataIndex = col.dataIndex,
|
|
987
|
+
editable = col.editable,
|
|
988
|
+
relevanceCols = col.relevanceCols;
|
|
1008
989
|
|
|
1009
|
-
if ((col === null || col === void 0 ? void 0 : col.fixed) || hasDisableOptions && hasDisableOptions.includes(dataIndex) || ((_a = col.componentProps) === null || _a === void 0 ? void 0 : _a.options)) {
|
|
990
|
+
if ((col === null || col === void 0 ? void 0 : col.fixed) || hasDisableOptions && hasDisableOptions.includes(dataIndex) || ((_a = col.componentProps) === null || _a === void 0 ? void 0 : _a.options) || editable === 'render' || !!relevanceCols) {
|
|
1010
991
|
return true;
|
|
1011
992
|
}
|
|
1012
993
|
|
|
1013
|
-
return record[dataIndex]
|
|
994
|
+
return record[dataIndex] !== prevRecord[dataIndex];
|
|
1014
995
|
},
|
|
1015
|
-
onCell: function onCell(record) {
|
|
996
|
+
onCell: function onCell(record, rowIndex) {
|
|
1016
997
|
return {
|
|
1017
|
-
getLength:
|
|
998
|
+
getLength: dataSource.length,
|
|
1018
999
|
rowKey: _rowKey,
|
|
1019
1000
|
record: record,
|
|
1020
1001
|
col: col,
|
|
1002
|
+
rowIndex: rowIndex,
|
|
1003
|
+
colIndex: index,
|
|
1004
|
+
quickOpetateClearAll: quickOpetateClearAll,
|
|
1021
1005
|
handleTableRowDelete: handleTableRowDelete,
|
|
1022
1006
|
handleTableRowAdd: handleTableRowAdd,
|
|
1023
1007
|
editable: col.editable,
|
|
@@ -1178,12 +1162,12 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1178
1162
|
className: "lm_editTable_add_bar",
|
|
1179
1163
|
type: "dashed",
|
|
1180
1164
|
onClick: handleAdd,
|
|
1181
|
-
style: {
|
|
1165
|
+
style: Object.assign({
|
|
1182
1166
|
marginTop: 8
|
|
1183
|
-
}
|
|
1167
|
+
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
1184
1168
|
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
1185
1169
|
type: "lmweb-plus"
|
|
1186
|
-
}),
|
|
1170
|
+
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增'));
|
|
1187
1171
|
});
|
|
1188
1172
|
|
|
1189
1173
|
var _default = /*#__PURE__*/(0, _react.memo)(EditTable);
|