@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 CHANGED
@@ -5361,6 +5361,7 @@ const Countdown = /* @__PURE__ */ vue.defineComponent({
5361
5361
  const minute = vue.ref('');
5362
5362
  const second = vue.ref('');
5363
5363
  const millisecond = vue.ref('');
5364
+ const isComplete = vue.ref(false);
5364
5365
  const showResult = vue.computed(() => {
5365
5366
  return !props.render && !slots.default;
5366
5367
  });
@@ -5433,15 +5434,18 @@ const Countdown = /* @__PURE__ */ vue.defineComponent({
5433
5434
 
5434
5435
  if (timestamp <= 0) {
5435
5436
  stop();
5436
- emit('change', {
5437
- timestamp: 0,
5438
- day: '00',
5439
- hour: '00',
5440
- minute: '00',
5441
- second: '00',
5442
- millisecond: '00'
5443
- });
5444
- emit('complete');
5437
+ if (!isComplete.value) {
5438
+ isComplete.value = true;
5439
+ emit('change', {
5440
+ timestamp: 0,
5441
+ day: '00',
5442
+ hour: '00',
5443
+ minute: '00',
5444
+ second: '00',
5445
+ millisecond: '00'
5446
+ });
5447
+ emit('complete');
5448
+ }
5445
5449
  } else {
5446
5450
  emit('change', {
5447
5451
  timestamp,
@@ -5456,6 +5460,8 @@ const Countdown = /* @__PURE__ */ vue.defineComponent({
5456
5460
  const start = () => {
5457
5461
  if (targetTimestamp.value) {
5458
5462
  timer && clearInterval(timer);
5463
+ isComplete.value = false;
5464
+ run(); // 立即执行一次,界面马上展示当前数值
5459
5465
  timer = setInterval(run, T.value);
5460
5466
  }
5461
5467
  };
@@ -9674,10 +9680,11 @@ const useScroller = (expose) => {
9674
9680
  "vc-scroller__wrapper"
9675
9681
  ];
9676
9682
  });
9677
- const refreshSize = () => {
9683
+ const refreshSize = async () => {
9678
9684
  if (!wrapper.value) return;
9679
9685
  wrapperW.value = wrapper.value.clientWidth;
9680
9686
  wrapperH.value = wrapper.value.clientHeight;
9687
+ await vue.nextTick();
9681
9688
  contentH.value = wrapper.value.scrollHeight;
9682
9689
  contentW.value = wrapper.value.scrollWidth;
9683
9690
  };
@@ -14550,11 +14557,10 @@ const Option = /* @__PURE__ */ vue.defineComponent({
14550
14557
  } = owner.exposed;
14551
14558
  return !multiple.value ? true : current.value.slice(-1)[0] === props.value;
14552
14559
  });
14553
- const searchRegex = vue.computed(() => {
14554
- const v = owner.exposed.searchValue.value.trim().replace(/\s+/g, ' ').split(/\s|,/);
14555
- return new RegExp(`(${v.join('|')})`, 'i');
14556
- });
14557
14560
  const isActive = vue.computed(() => {
14561
+ const {
14562
+ searchRegex
14563
+ } = owner.exposed;
14558
14564
  return !!(searchRegex.value.test(formatterLabel.value) || !props.filterable);
14559
14565
  });
14560
14566
  const customOptions = vue.computed(() => {
@@ -14780,6 +14786,10 @@ const Select = /* @__PURE__ */ vue.defineComponent({
14780
14786
  const v = currentValue.value.length - props.maxTags;
14781
14787
  return v < 0 ? 0 : v;
14782
14788
  });
14789
+ const searchRegex = vue.computed(() => {
14790
+ const v = searchValue.value.trim().replace(/\s+/g, ' ').split(/\s|,/);
14791
+ return new RegExp(escapeString(`(${v.join('|')})`), 'i');
14792
+ });
14783
14793
  const optionMap = vue.ref({});
14784
14794
  const options = vue.computed(() => {
14785
14795
  return Object.values(optionMap.value);
@@ -14876,7 +14886,7 @@ const Select = /* @__PURE__ */ vue.defineComponent({
14876
14886
  add,
14877
14887
  remove,
14878
14888
  close,
14879
- searchValue,
14889
+ searchRegex,
14880
14890
  multiple,
14881
14891
  isActive,
14882
14892
  current: currentValue,
@@ -19151,6 +19161,10 @@ const TableHeader = /* @__PURE__ */ vue.defineComponent({
19151
19161
  sort: {
19152
19162
  type: Object,
19153
19163
  default: () => ({})
19164
+ },
19165
+ resizable: {
19166
+ type: Boolean,
19167
+ default: void 0
19154
19168
  }
19155
19169
  },
19156
19170
  setup(props) {
@@ -19159,6 +19173,13 @@ const TableHeader = /* @__PURE__ */ vue.defineComponent({
19159
19173
  const draggingColumn = vue.ref(null);
19160
19174
  const dragging = vue.ref(false);
19161
19175
  const dragState = vue.ref({});
19176
+ const allowDrag = vue.computed(() => {
19177
+ return typeof props.resizable === 'boolean' ? props.resizable : props.border;
19178
+ });
19179
+ const dragLineClass = vue.computed(() => {
19180
+ if (props.border || !props.resizable) return;
19181
+ return 'has-drag-line';
19182
+ });
19162
19183
  const states = useStates({
19163
19184
  columns: 'columns',
19164
19185
  isAllSelected: 'isAllSelected',
@@ -19262,10 +19283,10 @@ const TableHeader = /* @__PURE__ */ vue.defineComponent({
19262
19283
  if (vcShared.IS_SERVER) return;
19263
19284
  if (column.children && column.children.length > 0) return;
19264
19285
  /* istanbul ignore if */
19265
- if (draggingColumn.value && props.border) {
19286
+ if (draggingColumn.value && allowDrag.value) {
19266
19287
  dragging.value = true;
19267
19288
  table.resizeProxyVisible.value = true;
19268
- const tableEl = table.vnode.el;
19289
+ const tableEl = table.tableWrapper.value;
19269
19290
  const tableLeft = tableEl.getBoundingClientRect().left;
19270
19291
  const columnEl = instance.vnode.el.querySelector(`.vc-table__th.${column.id}`);
19271
19292
  const columnRect = columnEl.getBoundingClientRect();
@@ -19294,15 +19315,14 @@ const TableHeader = /* @__PURE__ */ vue.defineComponent({
19294
19315
  } = dragState.value;
19295
19316
  const finalLeft = parseInt(resizeProxy.style.left, 10);
19296
19317
  const columnWidth = finalLeft - startColumnLeft;
19297
- column.width = columnWidth;
19298
- column.realWidth = column.width;
19299
- table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
19318
+ column.width = column.minWidth = column.realWidth = columnWidth;
19319
+ table.emit('header-dragend', column.width, startLeft - startColumnLeft, column);
19300
19320
  table.store.scheduleLayout();
19301
19321
  document.body.style.cursor = '';
19302
19322
  dragging.value = false;
19303
19323
  draggingColumn.value = null;
19304
19324
  dragState.value = {};
19305
- table.resizeProxyVisible = false;
19325
+ table.resizeProxyVisible.value = false;
19306
19326
  }
19307
19327
  document.removeEventListener('mousemove', handleMouseMove);
19308
19328
  document.removeEventListener('mouseup', handleMouseUp);
@@ -19323,7 +19343,7 @@ const TableHeader = /* @__PURE__ */ vue.defineComponent({
19323
19343
  target = target.parentNode;
19324
19344
  }
19325
19345
  if (!column || !column.resizable) return;
19326
- if (!dragging.value && props.border) {
19346
+ if (!dragging.value && allowDrag.value) {
19327
19347
  const rect = target.getBoundingClientRect();
19328
19348
  const bodyStyle = document.body.style;
19329
19349
  if (rect.width > 12 && rect.right - event.pageX < 8) {
@@ -19393,7 +19413,7 @@ const TableHeader = /* @__PURE__ */ vue.defineComponent({
19393
19413
  "style": [getHeaderCellStyle(rowIndex, columnIndex, columns, column), {
19394
19414
  width: `${column.realWidth}px`
19395
19415
  }],
19396
- "class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), 'vc-table__th'],
19416
+ "class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), column.resizable && dragLineClass.value, 'vc-table__th'],
19397
19417
  "key": column.id
19398
19418
  }, [vue.createVNode("div", {
19399
19419
  "class": ['vc-table__cell',
@@ -19630,7 +19650,11 @@ const props$d = {
19630
19650
  default: () => ({})
19631
19651
  },
19632
19652
  // 用于延迟渲染,用于计算高度
19633
- delay: Number
19653
+ delay: Number,
19654
+ resizable: {
19655
+ type: Boolean,
19656
+ default: void 0
19657
+ }
19634
19658
  };
19635
19659
 
19636
19660
  /** @jsxImportSource vue */
@@ -19639,7 +19663,7 @@ const COMPONENT_NAME$j = 'vc-table';
19639
19663
  const Table = /* @__PURE__ */ vue.defineComponent({
19640
19664
  name: COMPONENT_NAME$j,
19641
19665
  props: props$d,
19642
- 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'],
19666
+ 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'],
19643
19667
  setup(props, {
19644
19668
  slots,
19645
19669
  expose,
@@ -19660,7 +19684,7 @@ const Table = /* @__PURE__ */ vue.defineComponent({
19660
19684
  width: null,
19661
19685
  height: null
19662
19686
  });
19663
-
19687
+ const tableWrapper = vue.ref(null);
19664
19688
  // refs
19665
19689
  const hiddenColumns = vue.ref(null);
19666
19690
  const headerWrapper = vue.ref(null);
@@ -20018,6 +20042,7 @@ const Table = /* @__PURE__ */ vue.defineComponent({
20018
20042
  toggleRowExpansion,
20019
20043
  clearSelection,
20020
20044
  scroller,
20045
+ tableWrapper,
20021
20046
  headerWrapper,
20022
20047
  appendWrapper,
20023
20048
  footerWrapper,
@@ -20028,12 +20053,15 @@ const Table = /* @__PURE__ */ vue.defineComponent({
20028
20053
  renderExpanded,
20029
20054
  hiddenColumns,
20030
20055
  props,
20031
- emit
20056
+ emit,
20057
+ resizeProxy,
20058
+ resizeProxyVisible
20032
20059
  };
20033
20060
  expose(exposed);
20034
20061
  vue.provide('vc-table', exposed);
20035
20062
  return () => {
20036
20063
  return vue.createVNode("div", {
20064
+ "ref": tableWrapper,
20037
20065
  "class": [classes.value, tableId, 'vc-table'],
20038
20066
  "onMouseleave": handleMouseLeave
20039
20067
  }, [vue.createVNode("div", {
@@ -20045,6 +20073,7 @@ const Table = /* @__PURE__ */ vue.defineComponent({
20045
20073
  }, [vue.createVNode(TableHeader, {
20046
20074
  "ref": tableHeader,
20047
20075
  "border": props.border,
20076
+ "resizable": props.resizable,
20048
20077
  "sort": props.sort,
20049
20078
  "style": bodyWidthStyle.value
20050
20079
  }, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
@@ -20062,15 +20091,10 @@ const Table = /* @__PURE__ */ vue.defineComponent({
20062
20091
  "style": [bodyWidthStyle.value],
20063
20092
  "height-style": [bodyHeightStyle.value],
20064
20093
  "onScroll": handleScollY
20065
- }, null), props.data.length === 0 && vue.createVNode("div", {
20066
- "ref": emptyBlock,
20067
- "style": bodyWidthStyle.value,
20068
- "class": [{
20069
- 'is-absolute': !!props.height
20070
- }, 'vc-table__empty-wrapper']
20071
- }, [vue.createVNode("span", {
20072
- "class": "vc-table__empty-text"
20073
- }, [slots.empty ? slots.empty() : props.emptyText || '暂无数据'])]), slots.append && vue.createVNode("div", {
20094
+ }, null), props.data.length === 0 && !props.height && vue.createVNode("div", {
20095
+ "class": "vc-table__empty-placeholder",
20096
+ "style": [bodyWidthStyle.value]
20097
+ }, null), slots.append && vue.createVNode("div", {
20074
20098
  "ref": appendWrapper,
20075
20099
  "class": "vc-table__append-wrapper"
20076
20100
  }, [slots.append()])]
@@ -20094,6 +20118,7 @@ const Table = /* @__PURE__ */ vue.defineComponent({
20094
20118
  }, [vue.createVNode(TableHeader, {
20095
20119
  "ref": leftFixedTableHeader,
20096
20120
  "border": props.border,
20121
+ "resizable": props.resizable,
20097
20122
  "sort": props.sort,
20098
20123
  "style": bodyWidthStyle.value,
20099
20124
  "fixed": "left"
@@ -20133,6 +20158,7 @@ const Table = /* @__PURE__ */ vue.defineComponent({
20133
20158
  }, [vue.createVNode(TableHeader, {
20134
20159
  "ref": rightFixedTableHeader,
20135
20160
  "border": props.border,
20161
+ "resizable": props.resizable,
20136
20162
  "sort": props.sort,
20137
20163
  "style": bodyWidthStyle.value,
20138
20164
  "fixed": "right"
@@ -20160,7 +20186,14 @@ const Table = /* @__PURE__ */ vue.defineComponent({
20160
20186
  "get-summary": props.getSummary,
20161
20187
  "style": bodyWidthStyle.value,
20162
20188
  "fixed": "right"
20163
- }, null)]), [[vue.vShow, props.data && props.data.length > 0]])]), vue.withDirectives(vue.createVNode("div", {
20189
+ }, null)]), [[vue.vShow, props.data && props.data.length > 0]])]), props.data.length === 0 && vue.createVNode("div", {
20190
+ "ref": emptyBlock,
20191
+ "class": [{
20192
+ 'has-height': !!props.height
20193
+ }, 'vc-table__empty-wrapper']
20194
+ }, [slots.empty ? slots.empty() : vue.createVNode("span", {
20195
+ "class": "vc-table__empty-text"
20196
+ }, [props.emptyText || '暂无数据'])]), vue.withDirectives(vue.createVNode("div", {
20164
20197
  "ref": resizeProxy,
20165
20198
  "class": "vc-table__column-resize-proxy"
20166
20199
  }, null), [[vue.vShow, resizeProxyVisible.value]])]);
package/dist/index.d.ts CHANGED
@@ -8946,7 +8946,11 @@ type: ObjectConstructor;
8946
8946
  default: () => {};
8947
8947
  };
8948
8948
  delay: NumberConstructor;
8949
- }>, () => JSX_2.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-dragend ")[], "select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-dragend ", PublicProps, Readonly<ExtractPropTypes< {
8949
+ resizable: {
8950
+ type: BooleanConstructor;
8951
+ default: undefined;
8952
+ };
8953
+ }>, () => JSX_2.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick")[], "select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick", PublicProps, Readonly<ExtractPropTypes< {
8950
8954
  data: {
8951
8955
  type: ArrayConstructor;
8952
8956
  default: () => never[];
@@ -9018,6 +9022,10 @@ type: ObjectConstructor;
9018
9022
  default: () => {};
9019
9023
  };
9020
9024
  delay: NumberConstructor;
9025
+ resizable: {
9026
+ type: BooleanConstructor;
9027
+ default: undefined;
9028
+ };
9021
9029
  }>> & Readonly<{
9022
9030
  onSelect?: ((...args: any[]) => any) | undefined;
9023
9031
  "onSelect-all"?: ((...args: any[]) => any) | undefined;
@@ -9030,12 +9038,12 @@ onSelect?: ((...args: any[]) => any) | undefined;
9030
9038
  "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
9031
9039
  "onUpdate:sort"?: ((...args: any[]) => any) | undefined;
9032
9040
  "onSort-change"?: ((...args: any[]) => any) | undefined;
9041
+ "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
9033
9042
  "onCell-click"?: ((...args: any[]) => any) | undefined;
9034
9043
  "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
9035
9044
  "onRow-click"?: ((...args: any[]) => any) | undefined;
9036
9045
  "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
9037
9046
  "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
9038
- "onHeader-dragend "?: ((...args: any[]) => any) | undefined;
9039
9047
  }>, {
9040
9048
  sort: Record<string, any>;
9041
9049
  data: unknown[];
@@ -9049,6 +9057,7 @@ defaultExpandAll: boolean;
9049
9057
  expandSelectable: boolean;
9050
9058
  showHeader: boolean;
9051
9059
  rows: number;
9060
+ resizable: boolean;
9052
9061
  stripe: boolean;
9053
9062
  divider: boolean;
9054
9063
  showSummary: boolean;
@@ -9131,8 +9140,8 @@ tooltip: (StringConstructor | FunctionConstructor)[];
9131
9140
  }>> & Readonly<{}>, {
9132
9141
  type: string;
9133
9142
  reserveSelection: boolean;
9134
- sortable: boolean;
9135
9143
  resizable: boolean;
9144
+ sortable: boolean;
9136
9145
  filterMultiple: boolean;
9137
9146
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
9138
9147
 
@@ -13847,7 +13856,11 @@ type: ObjectConstructor;
13847
13856
  default: () => {};
13848
13857
  };
13849
13858
  delay: NumberConstructor;
13850
- }>, () => JSX_2.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-dragend ")[], "select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-dragend ", PublicProps, Readonly<ExtractPropTypes< {
13859
+ resizable: {
13860
+ type: BooleanConstructor;
13861
+ default: undefined;
13862
+ };
13863
+ }>, () => JSX_2.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick")[], "select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick", PublicProps, Readonly<ExtractPropTypes< {
13851
13864
  data: {
13852
13865
  type: ArrayConstructor;
13853
13866
  default: () => never[];
@@ -13919,6 +13932,10 @@ type: ObjectConstructor;
13919
13932
  default: () => {};
13920
13933
  };
13921
13934
  delay: NumberConstructor;
13935
+ resizable: {
13936
+ type: BooleanConstructor;
13937
+ default: undefined;
13938
+ };
13922
13939
  }>> & Readonly<{
13923
13940
  onSelect?: ((...args: any[]) => any) | undefined;
13924
13941
  "onSelect-all"?: ((...args: any[]) => any) | undefined;
@@ -13931,12 +13948,12 @@ onSelect?: ((...args: any[]) => any) | undefined;
13931
13948
  "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
13932
13949
  "onUpdate:sort"?: ((...args: any[]) => any) | undefined;
13933
13950
  "onSort-change"?: ((...args: any[]) => any) | undefined;
13951
+ "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
13934
13952
  "onCell-click"?: ((...args: any[]) => any) | undefined;
13935
13953
  "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
13936
13954
  "onRow-click"?: ((...args: any[]) => any) | undefined;
13937
13955
  "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
13938
13956
  "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
13939
- "onHeader-dragend "?: ((...args: any[]) => any) | undefined;
13940
13957
  }>, {
13941
13958
  sort: Record<string, any>;
13942
13959
  data: unknown[];
@@ -13950,6 +13967,7 @@ defaultExpandAll: boolean;
13950
13967
  expandSelectable: boolean;
13951
13968
  showHeader: boolean;
13952
13969
  rows: number;
13970
+ resizable: boolean;
13953
13971
  stripe: boolean;
13954
13972
  divider: boolean;
13955
13973
  showSummary: boolean;
@@ -14032,8 +14050,8 @@ tooltip: (StringConstructor | FunctionConstructor)[];
14032
14050
  }>> & Readonly<{}>, {
14033
14051
  type: string;
14034
14052
  reserveSelection: boolean;
14035
- sortable: boolean;
14036
14053
  resizable: boolean;
14054
+ sortable: boolean;
14037
14055
  filterMultiple: boolean;
14038
14056
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
14039
14057
 
@@ -10888,6 +10888,7 @@ var VcComponents = (function (exports, vue) {
10888
10888
  const minute = vue.ref('');
10889
10889
  const second = vue.ref('');
10890
10890
  const millisecond = vue.ref('');
10891
+ const isComplete = vue.ref(false);
10891
10892
  const showResult = vue.computed(() => {
10892
10893
  return !props.render && !slots.default;
10893
10894
  });
@@ -10960,15 +10961,18 @@ var VcComponents = (function (exports, vue) {
10960
10961
 
10961
10962
  if (timestamp <= 0) {
10962
10963
  stop();
10963
- emit('change', {
10964
- timestamp: 0,
10965
- day: '00',
10966
- hour: '00',
10967
- minute: '00',
10968
- second: '00',
10969
- millisecond: '00'
10970
- });
10971
- emit('complete');
10964
+ if (!isComplete.value) {
10965
+ isComplete.value = true;
10966
+ emit('change', {
10967
+ timestamp: 0,
10968
+ day: '00',
10969
+ hour: '00',
10970
+ minute: '00',
10971
+ second: '00',
10972
+ millisecond: '00'
10973
+ });
10974
+ emit('complete');
10975
+ }
10972
10976
  } else {
10973
10977
  emit('change', {
10974
10978
  timestamp,
@@ -10983,6 +10987,8 @@ var VcComponents = (function (exports, vue) {
10983
10987
  const start = () => {
10984
10988
  if (targetTimestamp.value) {
10985
10989
  timer && clearInterval(timer);
10990
+ isComplete.value = false;
10991
+ run(); // 立即执行一次,界面马上展示当前数值
10986
10992
  timer = setInterval(run, T.value);
10987
10993
  }
10988
10994
  };
@@ -15201,10 +15207,11 @@ var VcComponents = (function (exports, vue) {
15201
15207
  "vc-scroller__wrapper"
15202
15208
  ];
15203
15209
  });
15204
- const refreshSize = () => {
15210
+ const refreshSize = async () => {
15205
15211
  if (!wrapper.value) return;
15206
15212
  wrapperW.value = wrapper.value.clientWidth;
15207
15213
  wrapperH.value = wrapper.value.clientHeight;
15214
+ await vue.nextTick();
15208
15215
  contentH.value = wrapper.value.scrollHeight;
15209
15216
  contentW.value = wrapper.value.scrollWidth;
15210
15217
  };
@@ -23466,11 +23473,10 @@ var VcComponents = (function (exports, vue) {
23466
23473
  } = owner.exposed;
23467
23474
  return !multiple.value ? true : current.value.slice(-1)[0] === props.value;
23468
23475
  });
23469
- const searchRegex = vue.computed(() => {
23470
- const v = owner.exposed.searchValue.value.trim().replace(/\s+/g, ' ').split(/\s|,/);
23471
- return new RegExp(`(${v.join('|')})`, 'i');
23472
- });
23473
23476
  const isActive = vue.computed(() => {
23477
+ const {
23478
+ searchRegex
23479
+ } = owner.exposed;
23474
23480
  return !!(searchRegex.value.test(formatterLabel.value) || !props.filterable);
23475
23481
  });
23476
23482
  const customOptions = vue.computed(() => {
@@ -23696,6 +23702,10 @@ var VcComponents = (function (exports, vue) {
23696
23702
  const v = currentValue.value.length - props.maxTags;
23697
23703
  return v < 0 ? 0 : v;
23698
23704
  });
23705
+ const searchRegex = vue.computed(() => {
23706
+ const v = searchValue.value.trim().replace(/\s+/g, ' ').split(/\s|,/);
23707
+ return new RegExp(escapeString(`(${v.join('|')})`), 'i');
23708
+ });
23699
23709
  const optionMap = vue.ref({});
23700
23710
  const options = vue.computed(() => {
23701
23711
  return Object.values(optionMap.value);
@@ -23792,7 +23802,7 @@ var VcComponents = (function (exports, vue) {
23792
23802
  add,
23793
23803
  remove,
23794
23804
  close,
23795
- searchValue,
23805
+ searchRegex,
23796
23806
  multiple,
23797
23807
  isActive,
23798
23808
  current: currentValue,
@@ -28181,6 +28191,10 @@ var VcComponents = (function (exports, vue) {
28181
28191
  sort: {
28182
28192
  type: Object,
28183
28193
  default: () => ({})
28194
+ },
28195
+ resizable: {
28196
+ type: Boolean,
28197
+ default: void 0
28184
28198
  }
28185
28199
  },
28186
28200
  setup(props) {
@@ -28189,6 +28203,13 @@ var VcComponents = (function (exports, vue) {
28189
28203
  const draggingColumn = vue.ref(null);
28190
28204
  const dragging = vue.ref(false);
28191
28205
  const dragState = vue.ref({});
28206
+ const allowDrag = vue.computed(() => {
28207
+ return typeof props.resizable === 'boolean' ? props.resizable : props.border;
28208
+ });
28209
+ const dragLineClass = vue.computed(() => {
28210
+ if (props.border || !props.resizable) return;
28211
+ return 'has-drag-line';
28212
+ });
28192
28213
  const states = useStates({
28193
28214
  columns: 'columns',
28194
28215
  isAllSelected: 'isAllSelected',
@@ -28292,10 +28313,10 @@ var VcComponents = (function (exports, vue) {
28292
28313
  if (IS_SERVER$1) return;
28293
28314
  if (column.children && column.children.length > 0) return;
28294
28315
  /* istanbul ignore if */
28295
- if (draggingColumn.value && props.border) {
28316
+ if (draggingColumn.value && allowDrag.value) {
28296
28317
  dragging.value = true;
28297
28318
  table.resizeProxyVisible.value = true;
28298
- const tableEl = table.vnode.el;
28319
+ const tableEl = table.tableWrapper.value;
28299
28320
  const tableLeft = tableEl.getBoundingClientRect().left;
28300
28321
  const columnEl = instance.vnode.el.querySelector(`.vc-table__th.${column.id}`);
28301
28322
  const columnRect = columnEl.getBoundingClientRect();
@@ -28324,15 +28345,14 @@ var VcComponents = (function (exports, vue) {
28324
28345
  } = dragState.value;
28325
28346
  const finalLeft = parseInt(resizeProxy.style.left, 10);
28326
28347
  const columnWidth = finalLeft - startColumnLeft;
28327
- column.width = columnWidth;
28328
- column.realWidth = column.width;
28329
- table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
28348
+ column.width = column.minWidth = column.realWidth = columnWidth;
28349
+ table.emit('header-dragend', column.width, startLeft - startColumnLeft, column);
28330
28350
  table.store.scheduleLayout();
28331
28351
  document.body.style.cursor = '';
28332
28352
  dragging.value = false;
28333
28353
  draggingColumn.value = null;
28334
28354
  dragState.value = {};
28335
- table.resizeProxyVisible = false;
28355
+ table.resizeProxyVisible.value = false;
28336
28356
  }
28337
28357
  document.removeEventListener('mousemove', handleMouseMove);
28338
28358
  document.removeEventListener('mouseup', handleMouseUp);
@@ -28353,7 +28373,7 @@ var VcComponents = (function (exports, vue) {
28353
28373
  target = target.parentNode;
28354
28374
  }
28355
28375
  if (!column || !column.resizable) return;
28356
- if (!dragging.value && props.border) {
28376
+ if (!dragging.value && allowDrag.value) {
28357
28377
  const rect = target.getBoundingClientRect();
28358
28378
  const bodyStyle = document.body.style;
28359
28379
  if (rect.width > 12 && rect.right - event.pageX < 8) {
@@ -28423,7 +28443,7 @@ var VcComponents = (function (exports, vue) {
28423
28443
  "style": [getHeaderCellStyle(rowIndex, columnIndex, columns, column), {
28424
28444
  width: `${column.realWidth}px`
28425
28445
  }],
28426
- "class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), 'vc-table__th'],
28446
+ "class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), column.resizable && dragLineClass.value, 'vc-table__th'],
28427
28447
  "key": column.id
28428
28448
  }, [vue.createVNode("div", {
28429
28449
  "class": ['vc-table__cell',
@@ -28660,7 +28680,11 @@ var VcComponents = (function (exports, vue) {
28660
28680
  default: () => ({})
28661
28681
  },
28662
28682
  // 用于延迟渲染,用于计算高度
28663
- delay: Number
28683
+ delay: Number,
28684
+ resizable: {
28685
+ type: Boolean,
28686
+ default: void 0
28687
+ }
28664
28688
  };
28665
28689
 
28666
28690
  /** @jsxImportSource vue */
@@ -28669,7 +28693,7 @@ var VcComponents = (function (exports, vue) {
28669
28693
  const Table$1 = /* @__PURE__ */ vue.defineComponent({
28670
28694
  name: COMPONENT_NAME$j,
28671
28695
  props: props$d,
28672
- 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'],
28696
+ 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'],
28673
28697
  setup(props, {
28674
28698
  slots,
28675
28699
  expose,
@@ -28690,7 +28714,7 @@ var VcComponents = (function (exports, vue) {
28690
28714
  width: null,
28691
28715
  height: null
28692
28716
  });
28693
-
28717
+ const tableWrapper = vue.ref(null);
28694
28718
  // refs
28695
28719
  const hiddenColumns = vue.ref(null);
28696
28720
  const headerWrapper = vue.ref(null);
@@ -29048,6 +29072,7 @@ var VcComponents = (function (exports, vue) {
29048
29072
  toggleRowExpansion,
29049
29073
  clearSelection,
29050
29074
  scroller,
29075
+ tableWrapper,
29051
29076
  headerWrapper,
29052
29077
  appendWrapper,
29053
29078
  footerWrapper,
@@ -29058,12 +29083,15 @@ var VcComponents = (function (exports, vue) {
29058
29083
  renderExpanded,
29059
29084
  hiddenColumns,
29060
29085
  props,
29061
- emit
29086
+ emit,
29087
+ resizeProxy,
29088
+ resizeProxyVisible
29062
29089
  };
29063
29090
  expose(exposed);
29064
29091
  vue.provide('vc-table', exposed);
29065
29092
  return () => {
29066
29093
  return vue.createVNode("div", {
29094
+ "ref": tableWrapper,
29067
29095
  "class": [classes.value, tableId, 'vc-table'],
29068
29096
  "onMouseleave": handleMouseLeave
29069
29097
  }, [vue.createVNode("div", {
@@ -29075,6 +29103,7 @@ var VcComponents = (function (exports, vue) {
29075
29103
  }, [vue.createVNode(TableHeader, {
29076
29104
  "ref": tableHeader,
29077
29105
  "border": props.border,
29106
+ "resizable": props.resizable,
29078
29107
  "sort": props.sort,
29079
29108
  "style": bodyWidthStyle.value
29080
29109
  }, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
@@ -29092,15 +29121,10 @@ var VcComponents = (function (exports, vue) {
29092
29121
  "style": [bodyWidthStyle.value],
29093
29122
  "height-style": [bodyHeightStyle.value],
29094
29123
  "onScroll": handleScollY
29095
- }, null), props.data.length === 0 && vue.createVNode("div", {
29096
- "ref": emptyBlock,
29097
- "style": bodyWidthStyle.value,
29098
- "class": [{
29099
- 'is-absolute': !!props.height
29100
- }, 'vc-table__empty-wrapper']
29101
- }, [vue.createVNode("span", {
29102
- "class": "vc-table__empty-text"
29103
- }, [slots.empty ? slots.empty() : props.emptyText || '暂无数据'])]), slots.append && vue.createVNode("div", {
29124
+ }, null), props.data.length === 0 && !props.height && vue.createVNode("div", {
29125
+ "class": "vc-table__empty-placeholder",
29126
+ "style": [bodyWidthStyle.value]
29127
+ }, null), slots.append && vue.createVNode("div", {
29104
29128
  "ref": appendWrapper,
29105
29129
  "class": "vc-table__append-wrapper"
29106
29130
  }, [slots.append()])]
@@ -29124,6 +29148,7 @@ var VcComponents = (function (exports, vue) {
29124
29148
  }, [vue.createVNode(TableHeader, {
29125
29149
  "ref": leftFixedTableHeader,
29126
29150
  "border": props.border,
29151
+ "resizable": props.resizable,
29127
29152
  "sort": props.sort,
29128
29153
  "style": bodyWidthStyle.value,
29129
29154
  "fixed": "left"
@@ -29163,6 +29188,7 @@ var VcComponents = (function (exports, vue) {
29163
29188
  }, [vue.createVNode(TableHeader, {
29164
29189
  "ref": rightFixedTableHeader,
29165
29190
  "border": props.border,
29191
+ "resizable": props.resizable,
29166
29192
  "sort": props.sort,
29167
29193
  "style": bodyWidthStyle.value,
29168
29194
  "fixed": "right"
@@ -29190,7 +29216,14 @@ var VcComponents = (function (exports, vue) {
29190
29216
  "get-summary": props.getSummary,
29191
29217
  "style": bodyWidthStyle.value,
29192
29218
  "fixed": "right"
29193
- }, null)]), [[vue.vShow, props.data && props.data.length > 0]])]), vue.withDirectives(vue.createVNode("div", {
29219
+ }, null)]), [[vue.vShow, props.data && props.data.length > 0]])]), props.data.length === 0 && vue.createVNode("div", {
29220
+ "ref": emptyBlock,
29221
+ "class": [{
29222
+ 'has-height': !!props.height
29223
+ }, 'vc-table__empty-wrapper']
29224
+ }, [slots.empty ? slots.empty() : vue.createVNode("span", {
29225
+ "class": "vc-table__empty-text"
29226
+ }, [props.emptyText || '暂无数据'])]), vue.withDirectives(vue.createVNode("div", {
29194
29227
  "ref": resizeProxy,
29195
29228
  "class": "vc-table__column-resize-proxy"
29196
29229
  }, null), [[vue.vShow, resizeProxyVisible.value]])]);