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/es/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/es/Form/style/index.d.ts
CHANGED
package/es/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;
|
|
@@ -54,7 +54,7 @@ import { PlusCircleOutlined } from '@ant-design/icons';
|
|
|
54
54
|
import moment from 'moment';
|
|
55
55
|
import { arrayMove } from '@dnd-kit/sortable';
|
|
56
56
|
import { Button, Checkbox, IconFont, Input, InputNumber, Radio, Select, Table, Switch, DatePicker, Form } from 'linkmore-design';
|
|
57
|
-
import { get, set, isFunction } from 'lodash';
|
|
57
|
+
import { get, set, isFunction, omit } from 'lodash';
|
|
58
58
|
import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState, memo, useCallback } from 'react';
|
|
59
59
|
import { produce } from 'immer';
|
|
60
60
|
import DndContainer from './DndContainer';
|
|
@@ -64,6 +64,8 @@ import SortableItem from './sortableItem';
|
|
|
64
64
|
import ColSortableItem from './sortableItemCol';
|
|
65
65
|
import DragHandle from './DragHandle';
|
|
66
66
|
import UploadOss from '../UploadOss';
|
|
67
|
+
import { isObjEmpty } from './util';
|
|
68
|
+
import cls from "classnames";
|
|
67
69
|
var UploadBtn = UploadOss.UploadBtn;
|
|
68
70
|
var EditableContext = /*#__PURE__*/React.createContext(null); // 表格行
|
|
69
71
|
|
|
@@ -182,7 +184,9 @@ var Opetate = function Opetate(_ref) {
|
|
|
182
184
|
handleAdd = _ref.handleAdd,
|
|
183
185
|
handleDelete = _ref.handleDelete,
|
|
184
186
|
_ref$options = _ref.options,
|
|
185
|
-
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options
|
|
187
|
+
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
188
|
+
getLength = _ref.getLength,
|
|
189
|
+
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
186
190
|
return /*#__PURE__*/React.createElement("div", {
|
|
187
191
|
style: {
|
|
188
192
|
display: 'flex',
|
|
@@ -192,6 +196,7 @@ var Opetate = function Opetate(_ref) {
|
|
|
192
196
|
}, options.includes('delete') && /*#__PURE__*/React.createElement(Button, {
|
|
193
197
|
type: "link",
|
|
194
198
|
size: "small",
|
|
199
|
+
disabled: !quickOpetateClearAll && getLength < 2,
|
|
195
200
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
196
201
|
type: "lmweb-minus-circle",
|
|
197
202
|
style: {
|
|
@@ -236,8 +241,11 @@ var EditableCell = function EditableCell(props) {
|
|
|
236
241
|
isEdit = props.isEdit,
|
|
237
242
|
_props$col = props.col,
|
|
238
243
|
col = _props$col === void 0 ? {} : _props$col,
|
|
244
|
+
rowIndex = props.rowIndex,
|
|
245
|
+
colIndex = props.colIndex,
|
|
239
246
|
handleTableRowDelete = props.handleTableRowDelete,
|
|
240
247
|
handleTableRowAdd = props.handleTableRowAdd,
|
|
248
|
+
quickOpetateClearAll = props.quickOpetateClearAll,
|
|
241
249
|
getLength = props.getLength,
|
|
242
250
|
isHoverEdit = props.isHoverEdit,
|
|
243
251
|
editEnum = props.editEnum,
|
|
@@ -250,7 +258,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
250
258
|
itemProps = props.itemProps,
|
|
251
259
|
setValid = props.setValid,
|
|
252
260
|
reWriteOriginSource = props.reWriteOriginSource,
|
|
253
|
-
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
261
|
+
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
254
262
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
255
263
|
|
|
256
264
|
|
|
@@ -295,20 +303,24 @@ var EditableCell = function EditableCell(props) {
|
|
|
295
303
|
switch (_context.prev = _context.next) {
|
|
296
304
|
case 0:
|
|
297
305
|
_context.prev = 0;
|
|
298
|
-
_context.t0 = row;
|
|
299
306
|
|
|
300
|
-
if (
|
|
301
|
-
_context.next =
|
|
307
|
+
if (!row) {
|
|
308
|
+
_context.next = 5;
|
|
302
309
|
break;
|
|
303
310
|
}
|
|
304
311
|
|
|
305
|
-
_context.
|
|
306
|
-
|
|
312
|
+
_context.t0 = omit(row, 'onChange');
|
|
313
|
+
_context.next = 8;
|
|
314
|
+
break;
|
|
307
315
|
|
|
308
316
|
case 5:
|
|
317
|
+
_context.next = 7;
|
|
318
|
+
return form.getFieldsValue();
|
|
319
|
+
|
|
320
|
+
case 7:
|
|
309
321
|
_context.t0 = _context.sent;
|
|
310
322
|
|
|
311
|
-
case
|
|
323
|
+
case 8:
|
|
312
324
|
values = _context.t0;
|
|
313
325
|
resultComponentProps = isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps; // console.time('testForEach');
|
|
314
326
|
|
|
@@ -326,10 +338,10 @@ var EditableCell = function EditableCell(props) {
|
|
|
326
338
|
} // console.timeEnd('testForEach');
|
|
327
339
|
|
|
328
340
|
|
|
329
|
-
_context.next =
|
|
341
|
+
_context.next = 13;
|
|
330
342
|
return form.validateFields();
|
|
331
343
|
|
|
332
|
-
case
|
|
344
|
+
case 13:
|
|
333
345
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
334
346
|
toggleEdit();
|
|
335
347
|
} // // 清空异常校验
|
|
@@ -340,31 +352,25 @@ var EditableCell = function EditableCell(props) {
|
|
|
340
352
|
// })
|
|
341
353
|
|
|
342
354
|
|
|
343
|
-
_context.next =
|
|
355
|
+
_context.next = 18;
|
|
344
356
|
break;
|
|
345
357
|
|
|
346
|
-
case
|
|
347
|
-
_context.prev =
|
|
358
|
+
case 16:
|
|
359
|
+
_context.prev = 16;
|
|
348
360
|
_context.t1 = _context["catch"](0);
|
|
349
361
|
|
|
350
|
-
case
|
|
362
|
+
case 18:
|
|
351
363
|
case "end":
|
|
352
364
|
return _context.stop();
|
|
353
365
|
}
|
|
354
366
|
}
|
|
355
|
-
}, _callee, null, [[0,
|
|
367
|
+
}, _callee, null, [[0, 16]]);
|
|
356
368
|
}));
|
|
357
369
|
}; // 触发保存
|
|
358
370
|
|
|
359
371
|
|
|
360
372
|
var handleFormItemChange = function handleFormItemChange(e) {
|
|
361
|
-
save === null || save === void 0 ? void 0 : save();
|
|
362
|
-
// if (componentProps.isOnlyValue !== undefined) {
|
|
363
|
-
// console.log(777)
|
|
364
|
-
// handleCopy?.(dataIndex, componentProps.isOnlyValue)
|
|
365
|
-
// } else {
|
|
366
|
-
// save?.()
|
|
367
|
-
// }
|
|
373
|
+
save === null || save === void 0 ? void 0 : save();
|
|
368
374
|
};
|
|
369
375
|
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
370
376
|
|
|
@@ -474,10 +480,11 @@ var EditableCell = function EditableCell(props) {
|
|
|
474
480
|
}, resultComponentProps));
|
|
475
481
|
|
|
476
482
|
case 'switch':
|
|
477
|
-
return /*#__PURE__*/React.createElement(Switch, {
|
|
478
|
-
size: 'small'
|
|
483
|
+
return /*#__PURE__*/React.createElement(Switch, Object.assign({
|
|
484
|
+
size: 'small'
|
|
485
|
+
}, resultComponentProps, {
|
|
479
486
|
onChange: handleFormItemChange
|
|
480
|
-
});
|
|
487
|
+
}));
|
|
481
488
|
|
|
482
489
|
case 'upload':
|
|
483
490
|
return /*#__PURE__*/React.createElement(UploadSingle, {
|
|
@@ -494,13 +501,15 @@ var EditableCell = function EditableCell(props) {
|
|
|
494
501
|
ref: inputRef,
|
|
495
502
|
handleAdd: handleTableRowAdd,
|
|
496
503
|
handleDelete: handleTableRowDelete,
|
|
497
|
-
getLength: getLength
|
|
504
|
+
getLength: getLength,
|
|
505
|
+
quickOpetateClearAll: quickOpetateClearAll
|
|
498
506
|
}, resultComponentProps));
|
|
499
507
|
|
|
500
508
|
case 'render':
|
|
501
509
|
{
|
|
502
510
|
var render = resultComponentProps.render;
|
|
503
|
-
|
|
511
|
+
var fromData = form.getFieldsValue();
|
|
512
|
+
return render === null || render === void 0 ? void 0 : render(Object.assign(Object.assign({}, !isObjEmpty(fromData) ? fromData : record), {
|
|
504
513
|
onChange: save
|
|
505
514
|
}));
|
|
506
515
|
}
|
|
@@ -555,7 +564,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
555
564
|
}
|
|
556
565
|
|
|
557
566
|
return childNode;
|
|
558
|
-
}, [col, isEdit, editing]); // const [childNode, setChildNode] = useState(getMemoChildNode);
|
|
567
|
+
}, [col, isEdit, editing, getLength]); // const [childNode, setChildNode] = useState(getMemoChildNode);
|
|
559
568
|
// 出现死循环找我
|
|
560
569
|
|
|
561
570
|
useEffect(function () {
|
|
@@ -573,38 +582,11 @@ var EditableCell = function EditableCell(props) {
|
|
|
573
582
|
// })
|
|
574
583
|
// }
|
|
575
584
|
|
|
576
|
-
}, [record]);
|
|
577
|
-
// const classNames = cx({
|
|
578
|
-
// 'lm_base_editTable_cell': true,
|
|
579
|
-
// 'lm_base_editTable_cell_edit': isOpenEdit || (isHoverEdit && !curValueIsValid),
|
|
580
|
-
// });
|
|
581
|
-
// const extensionConfig = {};
|
|
582
|
-
// const mouseEnterCell = () => {
|
|
583
|
-
// focusCapturedRef.current = true;
|
|
584
|
-
// const newChildNode = getMemoChildNode;
|
|
585
|
-
// setChildNode(newChildNode);
|
|
586
|
-
// };
|
|
587
|
-
// const mouseLeaveCell = () => {
|
|
588
|
-
// focusCapturedRef.current = false;
|
|
589
|
-
// const nextValue = form.getFieldValue(dataIndex);
|
|
590
|
-
// const prevValue = get(record, dataIndex);
|
|
591
|
-
// if (!eq(prevValue, nextValue)) {
|
|
592
|
-
// const rowValue = get(record, rowKey);
|
|
593
|
-
// reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue);
|
|
594
|
-
// } else {
|
|
595
|
-
// const newChildNode = getDefaultChildNode(false);
|
|
596
|
-
// setChildNode(newChildNode);
|
|
597
|
-
// }
|
|
598
|
-
// };
|
|
599
|
-
// if (isHoverEdit && record?.editable) {
|
|
600
|
-
// console.log('ssssbbb')
|
|
601
|
-
// set(extensionConfig, 'onMouseEnter', mouseEnterCell);
|
|
602
|
-
// set(extensionConfig, 'onMouseLeave', mouseLeaveCell);
|
|
603
|
-
// }
|
|
604
|
-
|
|
585
|
+
}, [record]);
|
|
605
586
|
return /*#__PURE__*/React.createElement("td", Object.assign({}, clearProps, {
|
|
606
|
-
|
|
607
|
-
|
|
587
|
+
className: cls(clearProps === null || clearProps === void 0 ? void 0 : clearProps.className, 'lm_custom_cell_td'),
|
|
588
|
+
key: "r".concat(rowIndex, "_c").concat(colIndex)
|
|
589
|
+
}), getMemoChildNode);
|
|
608
590
|
};
|
|
609
591
|
|
|
610
592
|
var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -629,7 +611,8 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
629
611
|
filterChange = props.filterChange,
|
|
630
612
|
_props$size = props.size,
|
|
631
613
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
632
|
-
|
|
614
|
+
recordCreatorProps = props.recordCreatorProps,
|
|
615
|
+
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps"]);
|
|
633
616
|
|
|
634
617
|
var _useState3 = useState([]),
|
|
635
618
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -673,14 +656,12 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
673
656
|
};
|
|
674
657
|
|
|
675
658
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
676
|
-
console.log(active, over, 2223);
|
|
677
659
|
var oldIndex = columns.findIndex(function (item) {
|
|
678
660
|
return item.dataIndex === active;
|
|
679
661
|
});
|
|
680
662
|
var newIndex = columns.findIndex(function (item) {
|
|
681
663
|
return item.dataIndex === over;
|
|
682
664
|
});
|
|
683
|
-
console.log(arrayMove(columns, oldIndex, newIndex), 222);
|
|
684
665
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange(arrayMove(columns, oldIndex, newIndex).map(function (item, index) {
|
|
685
666
|
return Object.assign(Object.assign({}, item), {
|
|
686
667
|
order: index
|
|
@@ -699,8 +680,11 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
699
680
|
|
|
700
681
|
|
|
701
682
|
var handleAdd = function handleAdd(row) {
|
|
683
|
+
var _a;
|
|
684
|
+
|
|
685
|
+
var addDataInfo = 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;
|
|
702
686
|
var res = produce(dataSourceRef.current, function (draft) {
|
|
703
|
-
draft.push(_defineProperty({}, _rowKey, "".concat(Date.now())));
|
|
687
|
+
draft.push(Object.assign(_defineProperty({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
704
688
|
});
|
|
705
689
|
setDataSource(res);
|
|
706
690
|
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
@@ -896,7 +880,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
896
880
|
});
|
|
897
881
|
var newOptions = options.map(function (o) {
|
|
898
882
|
return Object.assign(Object.assign({}, o), {
|
|
899
|
-
disabled: dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
|
|
883
|
+
disabled: !!dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
|
|
900
884
|
});
|
|
901
885
|
});
|
|
902
886
|
return Object.assign(Object.assign({}, item), {
|
|
@@ -913,15 +897,8 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
913
897
|
var memoOptions = useMemo(function () {
|
|
914
898
|
return hasDisableOptions ? [DisableOptions] : [];
|
|
915
899
|
}, [hasDisableOptions, DisableOptions]);
|
|
916
|
-
|
|
917
|
-
var getDataSourceLen = function getDataSourceLen() {
|
|
918
|
-
var _a;
|
|
919
|
-
|
|
920
|
-
return (_a = dataSourceRef.current) === null || _a === void 0 ? void 0 : _a.length;
|
|
921
|
-
};
|
|
922
900
|
/** 组装之后的最终columns */
|
|
923
901
|
|
|
924
|
-
|
|
925
902
|
var resultColumns = useMemo(function () {
|
|
926
903
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
927
904
|
var localColumns = [sortOpen ? {
|
|
@@ -967,7 +944,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
967
944
|
}
|
|
968
945
|
});
|
|
969
946
|
localColumns = [].concat(leftColumns, mainColumns, rightColumns);
|
|
970
|
-
var res = localColumns.map(function (col) {
|
|
947
|
+
var res = localColumns.map(function (col, index) {
|
|
971
948
|
if (!col.editable) {
|
|
972
949
|
return col;
|
|
973
950
|
}
|
|
@@ -976,20 +953,25 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
976
953
|
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
977
954
|
var _a;
|
|
978
955
|
|
|
979
|
-
var dataIndex = col.dataIndex
|
|
956
|
+
var dataIndex = col.dataIndex,
|
|
957
|
+
editable = col.editable,
|
|
958
|
+
relevanceCols = col.relevanceCols;
|
|
980
959
|
|
|
981
|
-
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)) {
|
|
960
|
+
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) {
|
|
982
961
|
return true;
|
|
983
962
|
}
|
|
984
963
|
|
|
985
|
-
return record[dataIndex]
|
|
964
|
+
return record[dataIndex] !== prevRecord[dataIndex];
|
|
986
965
|
},
|
|
987
|
-
onCell: function onCell(record) {
|
|
966
|
+
onCell: function onCell(record, rowIndex) {
|
|
988
967
|
return {
|
|
989
|
-
getLength:
|
|
968
|
+
getLength: dataSource.length,
|
|
990
969
|
rowKey: _rowKey,
|
|
991
970
|
record: record,
|
|
992
971
|
col: col,
|
|
972
|
+
rowIndex: rowIndex,
|
|
973
|
+
colIndex: index,
|
|
974
|
+
quickOpetateClearAll: quickOpetateClearAll,
|
|
993
975
|
handleTableRowDelete: handleTableRowDelete,
|
|
994
976
|
handleTableRowAdd: handleTableRowAdd,
|
|
995
977
|
editable: col.editable,
|
|
@@ -1150,11 +1132,11 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1150
1132
|
className: "lm_editTable_add_bar",
|
|
1151
1133
|
type: "dashed",
|
|
1152
1134
|
onClick: handleAdd,
|
|
1153
|
-
style: {
|
|
1135
|
+
style: Object.assign({
|
|
1154
1136
|
marginTop: 8
|
|
1155
|
-
}
|
|
1137
|
+
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
1156
1138
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
1157
1139
|
type: "lmweb-plus"
|
|
1158
|
-
}),
|
|
1140
|
+
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增'));
|
|
1159
1141
|
});
|
|
1160
1142
|
export default /*#__PURE__*/memo(EditTable);
|