@deot/vc-components 1.0.61 → 1.0.63
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/index.cjs +70 -37
- package/dist/index.d.ts +24 -6
- package/dist/index.iife.js +70 -37
- package/dist/index.js +70 -37
- package/dist/index.style.css +2 -2
- package/dist/index.umd.cjs +70 -37
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -10891,6 +10891,7 @@
|
|
|
10891
10891
|
const minute = vue.ref('');
|
|
10892
10892
|
const second = vue.ref('');
|
|
10893
10893
|
const millisecond = vue.ref('');
|
|
10894
|
+
const isComplete = vue.ref(false);
|
|
10894
10895
|
const showResult = vue.computed(() => {
|
|
10895
10896
|
return !props.render && !slots.default;
|
|
10896
10897
|
});
|
|
@@ -10963,15 +10964,18 @@
|
|
|
10963
10964
|
|
|
10964
10965
|
if (timestamp <= 0) {
|
|
10965
10966
|
stop();
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10967
|
+
if (!isComplete.value) {
|
|
10968
|
+
isComplete.value = true;
|
|
10969
|
+
emit('change', {
|
|
10970
|
+
timestamp: 0,
|
|
10971
|
+
day: '00',
|
|
10972
|
+
hour: '00',
|
|
10973
|
+
minute: '00',
|
|
10974
|
+
second: '00',
|
|
10975
|
+
millisecond: '00'
|
|
10976
|
+
});
|
|
10977
|
+
emit('complete');
|
|
10978
|
+
}
|
|
10975
10979
|
} else {
|
|
10976
10980
|
emit('change', {
|
|
10977
10981
|
timestamp,
|
|
@@ -10986,6 +10990,8 @@
|
|
|
10986
10990
|
const start = () => {
|
|
10987
10991
|
if (targetTimestamp.value) {
|
|
10988
10992
|
timer && clearInterval(timer);
|
|
10993
|
+
isComplete.value = false;
|
|
10994
|
+
run(); // 立即执行一次,界面马上展示当前数值
|
|
10989
10995
|
timer = setInterval(run, T.value);
|
|
10990
10996
|
}
|
|
10991
10997
|
};
|
|
@@ -15204,10 +15210,11 @@
|
|
|
15204
15210
|
"vc-scroller__wrapper"
|
|
15205
15211
|
];
|
|
15206
15212
|
});
|
|
15207
|
-
const refreshSize = () => {
|
|
15213
|
+
const refreshSize = async () => {
|
|
15208
15214
|
if (!wrapper.value) return;
|
|
15209
15215
|
wrapperW.value = wrapper.value.clientWidth;
|
|
15210
15216
|
wrapperH.value = wrapper.value.clientHeight;
|
|
15217
|
+
await vue.nextTick();
|
|
15211
15218
|
contentH.value = wrapper.value.scrollHeight;
|
|
15212
15219
|
contentW.value = wrapper.value.scrollWidth;
|
|
15213
15220
|
};
|
|
@@ -23469,11 +23476,10 @@
|
|
|
23469
23476
|
} = owner.exposed;
|
|
23470
23477
|
return !multiple.value ? true : current.value.slice(-1)[0] === props.value;
|
|
23471
23478
|
});
|
|
23472
|
-
const searchRegex = vue.computed(() => {
|
|
23473
|
-
const v = owner.exposed.searchValue.value.trim().replace(/\s+/g, ' ').split(/\s|,/);
|
|
23474
|
-
return new RegExp(`(${v.join('|')})`, 'i');
|
|
23475
|
-
});
|
|
23476
23479
|
const isActive = vue.computed(() => {
|
|
23480
|
+
const {
|
|
23481
|
+
searchRegex
|
|
23482
|
+
} = owner.exposed;
|
|
23477
23483
|
return !!(searchRegex.value.test(formatterLabel.value) || !props.filterable);
|
|
23478
23484
|
});
|
|
23479
23485
|
const customOptions = vue.computed(() => {
|
|
@@ -23699,6 +23705,10 @@
|
|
|
23699
23705
|
const v = currentValue.value.length - props.maxTags;
|
|
23700
23706
|
return v < 0 ? 0 : v;
|
|
23701
23707
|
});
|
|
23708
|
+
const searchRegex = vue.computed(() => {
|
|
23709
|
+
const v = searchValue.value.trim().replace(/\s+/g, ' ').split(/\s|,/);
|
|
23710
|
+
return new RegExp(escapeString(`(${v.join('|')})`), 'i');
|
|
23711
|
+
});
|
|
23702
23712
|
const optionMap = vue.ref({});
|
|
23703
23713
|
const options = vue.computed(() => {
|
|
23704
23714
|
return Object.values(optionMap.value);
|
|
@@ -23795,7 +23805,7 @@
|
|
|
23795
23805
|
add,
|
|
23796
23806
|
remove,
|
|
23797
23807
|
close,
|
|
23798
|
-
|
|
23808
|
+
searchRegex,
|
|
23799
23809
|
multiple,
|
|
23800
23810
|
isActive,
|
|
23801
23811
|
current: currentValue,
|
|
@@ -28184,6 +28194,10 @@
|
|
|
28184
28194
|
sort: {
|
|
28185
28195
|
type: Object,
|
|
28186
28196
|
default: () => ({})
|
|
28197
|
+
},
|
|
28198
|
+
resizable: {
|
|
28199
|
+
type: Boolean,
|
|
28200
|
+
default: void 0
|
|
28187
28201
|
}
|
|
28188
28202
|
},
|
|
28189
28203
|
setup(props) {
|
|
@@ -28192,6 +28206,13 @@
|
|
|
28192
28206
|
const draggingColumn = vue.ref(null);
|
|
28193
28207
|
const dragging = vue.ref(false);
|
|
28194
28208
|
const dragState = vue.ref({});
|
|
28209
|
+
const allowDrag = vue.computed(() => {
|
|
28210
|
+
return typeof props.resizable === 'boolean' ? props.resizable : props.border;
|
|
28211
|
+
});
|
|
28212
|
+
const dragLineClass = vue.computed(() => {
|
|
28213
|
+
if (props.border || !props.resizable) return;
|
|
28214
|
+
return 'has-drag-line';
|
|
28215
|
+
});
|
|
28195
28216
|
const states = useStates({
|
|
28196
28217
|
columns: 'columns',
|
|
28197
28218
|
isAllSelected: 'isAllSelected',
|
|
@@ -28295,10 +28316,10 @@
|
|
|
28295
28316
|
if (IS_SERVER$1) return;
|
|
28296
28317
|
if (column.children && column.children.length > 0) return;
|
|
28297
28318
|
/* istanbul ignore if */
|
|
28298
|
-
if (draggingColumn.value &&
|
|
28319
|
+
if (draggingColumn.value && allowDrag.value) {
|
|
28299
28320
|
dragging.value = true;
|
|
28300
28321
|
table.resizeProxyVisible.value = true;
|
|
28301
|
-
const tableEl = table.
|
|
28322
|
+
const tableEl = table.tableWrapper.value;
|
|
28302
28323
|
const tableLeft = tableEl.getBoundingClientRect().left;
|
|
28303
28324
|
const columnEl = instance.vnode.el.querySelector(`.vc-table__th.${column.id}`);
|
|
28304
28325
|
const columnRect = columnEl.getBoundingClientRect();
|
|
@@ -28327,15 +28348,14 @@
|
|
|
28327
28348
|
} = dragState.value;
|
|
28328
28349
|
const finalLeft = parseInt(resizeProxy.style.left, 10);
|
|
28329
28350
|
const columnWidth = finalLeft - startColumnLeft;
|
|
28330
|
-
column.width = columnWidth;
|
|
28331
|
-
column.
|
|
28332
|
-
table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
|
|
28351
|
+
column.width = column.minWidth = column.realWidth = columnWidth;
|
|
28352
|
+
table.emit('header-dragend', column.width, startLeft - startColumnLeft, column);
|
|
28333
28353
|
table.store.scheduleLayout();
|
|
28334
28354
|
document.body.style.cursor = '';
|
|
28335
28355
|
dragging.value = false;
|
|
28336
28356
|
draggingColumn.value = null;
|
|
28337
28357
|
dragState.value = {};
|
|
28338
|
-
table.resizeProxyVisible = false;
|
|
28358
|
+
table.resizeProxyVisible.value = false;
|
|
28339
28359
|
}
|
|
28340
28360
|
document.removeEventListener('mousemove', handleMouseMove);
|
|
28341
28361
|
document.removeEventListener('mouseup', handleMouseUp);
|
|
@@ -28356,7 +28376,7 @@
|
|
|
28356
28376
|
target = target.parentNode;
|
|
28357
28377
|
}
|
|
28358
28378
|
if (!column || !column.resizable) return;
|
|
28359
|
-
if (!dragging.value &&
|
|
28379
|
+
if (!dragging.value && allowDrag.value) {
|
|
28360
28380
|
const rect = target.getBoundingClientRect();
|
|
28361
28381
|
const bodyStyle = document.body.style;
|
|
28362
28382
|
if (rect.width > 12 && rect.right - event.pageX < 8) {
|
|
@@ -28426,7 +28446,7 @@
|
|
|
28426
28446
|
"style": [getHeaderCellStyle(rowIndex, columnIndex, columns, column), {
|
|
28427
28447
|
width: `${column.realWidth}px`
|
|
28428
28448
|
}],
|
|
28429
|
-
"class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), 'vc-table__th'],
|
|
28449
|
+
"class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), column.resizable && dragLineClass.value, 'vc-table__th'],
|
|
28430
28450
|
"key": column.id
|
|
28431
28451
|
}, [vue.createVNode("div", {
|
|
28432
28452
|
"class": ['vc-table__cell',
|
|
@@ -28663,7 +28683,11 @@
|
|
|
28663
28683
|
default: () => ({})
|
|
28664
28684
|
},
|
|
28665
28685
|
// 用于延迟渲染,用于计算高度
|
|
28666
|
-
delay: Number
|
|
28686
|
+
delay: Number,
|
|
28687
|
+
resizable: {
|
|
28688
|
+
type: Boolean,
|
|
28689
|
+
default: void 0
|
|
28690
|
+
}
|
|
28667
28691
|
};
|
|
28668
28692
|
|
|
28669
28693
|
/** @jsxImportSource vue */
|
|
@@ -28672,7 +28696,7 @@
|
|
|
28672
28696
|
const Table$1 = /* @__PURE__ */ vue.defineComponent({
|
|
28673
28697
|
name: COMPONENT_NAME$j,
|
|
28674
28698
|
props: props$d,
|
|
28675
|
-
emits: ['select', 'select-all', 'selection-change', 'cell-mouse-enter', 'cell-mouse-leave', 'cell-click', 'cell-dblclick', 'row-click', 'row-contextmenu', 'row-dblclick', 'header-click', 'header-contextmenu', 'current-change', 'header-dragend
|
|
28699
|
+
emits: ['select', 'select-all', 'selection-change', 'cell-mouse-enter', 'cell-mouse-leave', 'cell-click', 'cell-dblclick', 'row-click', 'row-contextmenu', 'row-dblclick', 'header-click', 'header-contextmenu', 'current-change', 'header-dragend', 'expand-change', 'sort-change', 'update:sort'],
|
|
28676
28700
|
setup(props, {
|
|
28677
28701
|
slots,
|
|
28678
28702
|
expose,
|
|
@@ -28693,7 +28717,7 @@
|
|
|
28693
28717
|
width: null,
|
|
28694
28718
|
height: null
|
|
28695
28719
|
});
|
|
28696
|
-
|
|
28720
|
+
const tableWrapper = vue.ref(null);
|
|
28697
28721
|
// refs
|
|
28698
28722
|
const hiddenColumns = vue.ref(null);
|
|
28699
28723
|
const headerWrapper = vue.ref(null);
|
|
@@ -29051,6 +29075,7 @@
|
|
|
29051
29075
|
toggleRowExpansion,
|
|
29052
29076
|
clearSelection,
|
|
29053
29077
|
scroller,
|
|
29078
|
+
tableWrapper,
|
|
29054
29079
|
headerWrapper,
|
|
29055
29080
|
appendWrapper,
|
|
29056
29081
|
footerWrapper,
|
|
@@ -29061,12 +29086,15 @@
|
|
|
29061
29086
|
renderExpanded,
|
|
29062
29087
|
hiddenColumns,
|
|
29063
29088
|
props,
|
|
29064
|
-
emit
|
|
29089
|
+
emit,
|
|
29090
|
+
resizeProxy,
|
|
29091
|
+
resizeProxyVisible
|
|
29065
29092
|
};
|
|
29066
29093
|
expose(exposed);
|
|
29067
29094
|
vue.provide('vc-table', exposed);
|
|
29068
29095
|
return () => {
|
|
29069
29096
|
return vue.createVNode("div", {
|
|
29097
|
+
"ref": tableWrapper,
|
|
29070
29098
|
"class": [classes.value, tableId, 'vc-table'],
|
|
29071
29099
|
"onMouseleave": handleMouseLeave
|
|
29072
29100
|
}, [vue.createVNode("div", {
|
|
@@ -29078,6 +29106,7 @@
|
|
|
29078
29106
|
}, [vue.createVNode(TableHeader, {
|
|
29079
29107
|
"ref": tableHeader,
|
|
29080
29108
|
"border": props.border,
|
|
29109
|
+
"resizable": props.resizable,
|
|
29081
29110
|
"sort": props.sort,
|
|
29082
29111
|
"style": bodyWidthStyle.value
|
|
29083
29112
|
}, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
|
|
@@ -29095,15 +29124,10 @@
|
|
|
29095
29124
|
"style": [bodyWidthStyle.value],
|
|
29096
29125
|
"height-style": [bodyHeightStyle.value],
|
|
29097
29126
|
"onScroll": handleScollY
|
|
29098
|
-
}, null), props.data.length === 0 && vue.createVNode("div", {
|
|
29099
|
-
"
|
|
29100
|
-
"style": bodyWidthStyle.value
|
|
29101
|
-
|
|
29102
|
-
'is-absolute': !!props.height
|
|
29103
|
-
}, 'vc-table__empty-wrapper']
|
|
29104
|
-
}, [vue.createVNode("span", {
|
|
29105
|
-
"class": "vc-table__empty-text"
|
|
29106
|
-
}, [slots.empty ? slots.empty() : props.emptyText || '暂无数据'])]), slots.append && vue.createVNode("div", {
|
|
29127
|
+
}, null), props.data.length === 0 && !props.height && vue.createVNode("div", {
|
|
29128
|
+
"class": "vc-table__empty-placeholder",
|
|
29129
|
+
"style": [bodyWidthStyle.value]
|
|
29130
|
+
}, null), slots.append && vue.createVNode("div", {
|
|
29107
29131
|
"ref": appendWrapper,
|
|
29108
29132
|
"class": "vc-table__append-wrapper"
|
|
29109
29133
|
}, [slots.append()])]
|
|
@@ -29127,6 +29151,7 @@
|
|
|
29127
29151
|
}, [vue.createVNode(TableHeader, {
|
|
29128
29152
|
"ref": leftFixedTableHeader,
|
|
29129
29153
|
"border": props.border,
|
|
29154
|
+
"resizable": props.resizable,
|
|
29130
29155
|
"sort": props.sort,
|
|
29131
29156
|
"style": bodyWidthStyle.value,
|
|
29132
29157
|
"fixed": "left"
|
|
@@ -29166,6 +29191,7 @@
|
|
|
29166
29191
|
}, [vue.createVNode(TableHeader, {
|
|
29167
29192
|
"ref": rightFixedTableHeader,
|
|
29168
29193
|
"border": props.border,
|
|
29194
|
+
"resizable": props.resizable,
|
|
29169
29195
|
"sort": props.sort,
|
|
29170
29196
|
"style": bodyWidthStyle.value,
|
|
29171
29197
|
"fixed": "right"
|
|
@@ -29193,7 +29219,14 @@
|
|
|
29193
29219
|
"get-summary": props.getSummary,
|
|
29194
29220
|
"style": bodyWidthStyle.value,
|
|
29195
29221
|
"fixed": "right"
|
|
29196
|
-
}, null)]), [[vue.vShow, props.data && props.data.length > 0]])]),
|
|
29222
|
+
}, null)]), [[vue.vShow, props.data && props.data.length > 0]])]), props.data.length === 0 && vue.createVNode("div", {
|
|
29223
|
+
"ref": emptyBlock,
|
|
29224
|
+
"class": [{
|
|
29225
|
+
'has-height': !!props.height
|
|
29226
|
+
}, 'vc-table__empty-wrapper']
|
|
29227
|
+
}, [slots.empty ? slots.empty() : vue.createVNode("span", {
|
|
29228
|
+
"class": "vc-table__empty-text"
|
|
29229
|
+
}, [props.emptyText || '暂无数据'])]), vue.withDirectives(vue.createVNode("div", {
|
|
29197
29230
|
"ref": resizeProxy,
|
|
29198
29231
|
"class": "vc-table__column-resize-proxy"
|
|
29199
29232
|
}, null), [[vue.vShow, resizeProxyVisible.value]])]);
|