vxe-table 3.23.4 → 3.23.6
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/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +1 -1
- package/es/table/module/filter/mixin.js +71 -56
- package/es/table/module/keyboard/mixin.js +3 -5
- package/es/table/src/body.js +3 -3
- package/es/table/src/footer.js +3 -3
- package/es/table/src/header.js +6 -6
- package/es/table/src/methods.js +128 -68
- package/es/table/src/table.js +10 -2
- package/es/table/src/util.js +6 -5
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +162 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +321 -134
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +1 -1
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +69 -58
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +3 -6
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +5 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +5 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +10 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +46 -44
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +10 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -5
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +167 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/custom/mixin.ts +1 -2
- package/packages/table/module/filter/mixin.ts +72 -53
- package/packages/table/module/keyboard/mixin.ts +3 -5
- package/packages/table/src/body.ts +3 -3
- package/packages/table/src/footer.ts +3 -3
- package/packages/table/src/header.ts +6 -6
- package/packages/table/src/methods.ts +166 -80
- package/packages/table/src/table.ts +10 -2
- package/packages/table/src/util.ts +9 -6
- package/packages/ui/src/dom.ts +176 -0
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/theme/base.scss +2 -0
- package/styles/theme/dark.scss +4 -4
- package/styles/theme/light.scss +4 -4
- package/styles/variable.scss +4 -4
- /package/es/{iconfont.1788399048088.ttf → iconfont.1788695175944.ttf} +0 -0
- /package/es/{iconfont.1788399048088.woff → iconfont.1788695175944.woff} +0 -0
- /package/es/{iconfont.1788399048088.woff2 → iconfont.1788695175944.woff2} +0 -0
- /package/lib/{iconfont.1788399048088.ttf → iconfont.1788695175944.ttf} +0 -0
- /package/lib/{iconfont.1788399048088.woff → iconfont.1788695175944.woff} +0 -0
- /package/lib/{iconfont.1788399048088.woff2 → iconfont.1788695175944.woff2} +0 -0
package/es/ui/index.js
CHANGED
package/es/ui/src/dom.js
CHANGED
|
@@ -174,6 +174,18 @@ export function hasEventInputTarget(target) {
|
|
|
174
174
|
const tagName = target ? target.tagName : '';
|
|
175
175
|
return tagName && ['input', 'textarea'].includes((tagName.toLowerCase()));
|
|
176
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* 判断是否由内部可复用控件触发,输入框带有 vxe-reusekeep-contro
|
|
179
|
+
*/
|
|
180
|
+
function hasReusekeepControl(elem) {
|
|
181
|
+
if (elem) {
|
|
182
|
+
return hasClass(elem, 'vxe-reusekeep-contro');
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
export function hasAxternalInputTarget(target) {
|
|
187
|
+
return hasEventInputTarget(target) ? !hasReusekeepControl(target) : false;
|
|
188
|
+
}
|
|
177
189
|
const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
|
|
178
190
|
const scrollIntoView = 'scrollIntoView';
|
|
179
191
|
export function scrollToView(elem) {
|
|
@@ -215,6 +227,156 @@ export function wheelScrollTopTo(diffNum, cb) {
|
|
|
215
227
|
wtaFrame = null;
|
|
216
228
|
});
|
|
217
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* 通用定位计算
|
|
232
|
+
*/
|
|
233
|
+
export function updatePanelPlacement(targetElem, panelElem, options) {
|
|
234
|
+
const { defaultTop, defaultLeft, placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({
|
|
235
|
+
teleportTo: false,
|
|
236
|
+
marginSize: 18,
|
|
237
|
+
isMinWidth: true
|
|
238
|
+
}, options);
|
|
239
|
+
let panelPlacement = 'bottom';
|
|
240
|
+
let top = '';
|
|
241
|
+
let bottom = '';
|
|
242
|
+
let left = 0;
|
|
243
|
+
let minWidth = '';
|
|
244
|
+
let arrowLeft = '';
|
|
245
|
+
const stys = {};
|
|
246
|
+
if (panelElem && targetElem) {
|
|
247
|
+
const bodyEl = document.body;
|
|
248
|
+
const parentWrapperEl = getPopupWrapperElement(panelElem);
|
|
249
|
+
if (parentWrapperEl) {
|
|
250
|
+
const targetWidth = targetElem.offsetWidth;
|
|
251
|
+
const targetHeight = targetElem.offsetHeight;
|
|
252
|
+
const panelWidth = panelElem.offsetWidth;
|
|
253
|
+
const panelHeight = panelElem.offsetHeight;
|
|
254
|
+
const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
|
|
255
|
+
const panelRect = panelElem.getBoundingClientRect();
|
|
256
|
+
const targetRect = targetElem.getBoundingClientRect();
|
|
257
|
+
const visibleHeight = bodyEl.clientHeight;
|
|
258
|
+
const visibleWidth = bodyEl.clientWidth;
|
|
259
|
+
const offsetLeft = parentWrapperRect.left;
|
|
260
|
+
const offsetTop = parentWrapperRect.top;
|
|
261
|
+
const targetLeft = targetRect.left;
|
|
262
|
+
const targetTop = targetRect.top;
|
|
263
|
+
minWidth = targetElem.offsetWidth;
|
|
264
|
+
if (teleportTo) {
|
|
265
|
+
left = defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2);
|
|
266
|
+
top = defaultTop || (targetTop + targetHeight);
|
|
267
|
+
if (placement === 'top') {
|
|
268
|
+
panelPlacement = 'top';
|
|
269
|
+
top = targetTop - panelHeight;
|
|
270
|
+
}
|
|
271
|
+
else if (!placement) {
|
|
272
|
+
if (defaultPlacement === 'top') {
|
|
273
|
+
panelPlacement = 'top';
|
|
274
|
+
if (!defaultTop) {
|
|
275
|
+
top = targetTop - panelHeight;
|
|
276
|
+
}
|
|
277
|
+
// 如果上面不够放,则向下
|
|
278
|
+
if (top < marginSize) {
|
|
279
|
+
panelPlacement = 'bottom';
|
|
280
|
+
top = targetTop + targetHeight;
|
|
281
|
+
}
|
|
282
|
+
// 如果下面不够放,则向上(优先)
|
|
283
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
284
|
+
panelPlacement = 'top';
|
|
285
|
+
top = targetTop - panelHeight;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
// 如果下面不够放,则向上
|
|
290
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
291
|
+
panelPlacement = 'top';
|
|
292
|
+
top = targetTop - panelHeight;
|
|
293
|
+
}
|
|
294
|
+
// 如果上面不够放,则向下(优先)
|
|
295
|
+
if (top < marginSize) {
|
|
296
|
+
panelPlacement = 'bottom';
|
|
297
|
+
top = targetTop + targetHeight;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
// 如果溢出右边
|
|
302
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
303
|
+
left -= left + panelWidth + marginSize - visibleWidth;
|
|
304
|
+
}
|
|
305
|
+
// 如果溢出左边
|
|
306
|
+
if (left < marginSize) {
|
|
307
|
+
left = marginSize;
|
|
308
|
+
}
|
|
309
|
+
// 偏移
|
|
310
|
+
top -= offsetTop;
|
|
311
|
+
left -= offsetLeft;
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
if (placement === 'top') {
|
|
315
|
+
panelPlacement = 'top';
|
|
316
|
+
bottom = targetHeight;
|
|
317
|
+
}
|
|
318
|
+
else if (!placement) {
|
|
319
|
+
// 如果下面不够放,则向上
|
|
320
|
+
top = targetHeight;
|
|
321
|
+
if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
|
|
322
|
+
// 如果上面不够放,则向下(优先)
|
|
323
|
+
if (targetTop - targetHeight - panelHeight > marginSize) {
|
|
324
|
+
panelPlacement = 'top';
|
|
325
|
+
top = '';
|
|
326
|
+
bottom = targetHeight;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// 是否超出右侧
|
|
331
|
+
if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
|
|
332
|
+
left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (XEUtils.isNumber(top)) {
|
|
336
|
+
stys.top = toCssUnit(top);
|
|
337
|
+
}
|
|
338
|
+
if (XEUtils.isNumber(bottom)) {
|
|
339
|
+
stys.bottom = toCssUnit(bottom);
|
|
340
|
+
}
|
|
341
|
+
if (XEUtils.isNumber(left)) {
|
|
342
|
+
stys.left = toCssUnit(left);
|
|
343
|
+
}
|
|
344
|
+
if (isMinWidth && XEUtils.isNumber(minWidth)) {
|
|
345
|
+
stys.minWidth = toCssUnit(minWidth);
|
|
346
|
+
}
|
|
347
|
+
// 箭头
|
|
348
|
+
if (left === targetLeft) {
|
|
349
|
+
if (targetWidth <= panelWidth) {
|
|
350
|
+
arrowLeft = targetWidth / 2;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
else if (left < targetLeft) {
|
|
354
|
+
if (left + panelWidth > targetLeft + targetWidth) {
|
|
355
|
+
arrowLeft = (targetLeft - left) + targetWidth / 2;
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
arrowLeft = (targetLeft - left) + (panelWidth - (targetLeft - left)) / 2;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return {
|
|
364
|
+
top: top || 0,
|
|
365
|
+
bottom: bottom || 0,
|
|
366
|
+
left: left || 0,
|
|
367
|
+
arrowLeft: arrowLeft || 0,
|
|
368
|
+
style: stys,
|
|
369
|
+
placement: panelPlacement
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
export function getPopupWrapperElement(panelElem) {
|
|
373
|
+
if (!panelElem) {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
const bodyEl = document.body;
|
|
377
|
+
const parentEl = panelElem.parentElement;
|
|
378
|
+
return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
|
|
379
|
+
}
|
|
218
380
|
export function getPopupContainer(appendTo) {
|
|
219
381
|
const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo;
|
|
220
382
|
return selectElem || 'body';
|
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const tableVersion = `table v${"3.23.
|
|
3
|
+
const tableVersion = `table v${"3.23.6"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
package/es/vxe-table/style.css
CHANGED
|
@@ -1644,7 +1644,7 @@
|
|
|
1644
1644
|
padding-top: 0.2em;
|
|
1645
1645
|
}
|
|
1646
1646
|
.vxe-table--filter-wrapper .vxe-table--filter-body {
|
|
1647
|
-
max-height:
|
|
1647
|
+
max-height: var(--vxe-ui-vxe-table-filter-default-max-height);
|
|
1648
1648
|
padding-bottom: 0.2em;
|
|
1649
1649
|
}
|
|
1650
1650
|
.vxe-table--filter-wrapper > ul {
|