@deot/vc 1.0.12 → 1.0.13

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.
@@ -24841,7 +24841,7 @@ var Vc = (function (exports, vue) {
24841
24841
  });
24842
24842
  const COMPONENT_NAME$1T = "vc-alert";
24843
24843
  const THEME_MAP = {
24844
- info: ["#5495f6", "#91d5ff", "#e6f7ff"],
24844
+ info: ["#2B72FD", "#91d5ff", "#e6f7ff"],
24845
24845
  success: ["#52c41a", "#b7eb8f", "#f6ffed"],
24846
24846
  error: ["#ed4014", "#ffb08f", "#fbe9e9"],
24847
24847
  warning: ["#ffbf00", "#ffe58f", "#fffbe6"]
@@ -35558,7 +35558,7 @@ var Vc = (function (exports, vue) {
35558
35558
  color: {
35559
35559
  type: [Object, String],
35560
35560
  default: () => ({
35561
- normal: "#5495f6",
35561
+ normal: "#2B72FD",
35562
35562
  success: "#52c41a",
35563
35563
  error: "#f5222d"
35564
35564
  })
@@ -36705,6 +36705,8 @@ var Vc = (function (exports, vue) {
36705
36705
  });
36706
36706
  if (!originalData.length) {
36707
36707
  rebuildData.value = [];
36708
+ } else {
36709
+ rebuildData.value = originalData.slice();
36708
36710
  }
36709
36711
  offsetPageSize.value = 0;
36710
36712
  await refreshLayout(0, originalData.length);
@@ -37811,17 +37813,24 @@ var Vc = (function (exports, vue) {
37811
37813
  const dataInstanceChanged = this.states._data !== data;
37812
37814
  this.states._data = data;
37813
37815
  this.states.data = data;
37816
+ const caches = /* @__PURE__ */ new Map();
37817
+ this.states.list.forEach((item) => {
37818
+ item.rows.forEach((row) => {
37819
+ caches.set(row.data, row);
37820
+ });
37821
+ });
37814
37822
  this.states.list = data.reduce((pre, row, index) => {
37823
+ const cache = caches.get(row) || { heightMap: {} };
37815
37824
  pre.push({
37816
37825
  rows: [
37817
37826
  {
37818
37827
  index,
37819
37828
  data: row,
37820
- height: "",
37829
+ height: cache.height || "",
37821
37830
  heightMap: {
37822
- left: "",
37823
- main: "",
37824
- right: ""
37831
+ left: cache.heightMap.left || "",
37832
+ main: cache.heightMap.main || "",
37833
+ right: cache.heightMap.right || ""
37825
37834
  }
37826
37835
  }
37827
37836
  ],
@@ -37829,6 +37838,7 @@ var Vc = (function (exports, vue) {
37829
37838
  });
37830
37839
  return pre;
37831
37840
  }, []);
37841
+ caches.clear();
37832
37842
  this.current.update();
37833
37843
  this.expand.update();
37834
37844
  if (!this.states.reserveSelection) {
@@ -37962,12 +37972,12 @@ var Vc = (function (exports, vue) {
37962
37972
  */
37963
37973
  cleanSelection() {
37964
37974
  const { primaryKey } = this.table.props;
37965
- const { selection = [] } = this.states;
37975
+ const { selection = [], data } = this.states;
37966
37976
  let deleted;
37967
37977
  if (primaryKey) {
37968
37978
  deleted = [];
37969
37979
  const selectedMap = getValuesMap(selection, primaryKey);
37970
- const dataMap = getValuesMap(selection, primaryKey);
37980
+ const dataMap = getValuesMap(data, primaryKey);
37971
37981
  for (const key in selectedMap) {
37972
37982
  if (hasOwn$1(selectedMap, key) && !dataMap[key]) {
37973
37983
  deleted.push(selectedMap[key].row);
@@ -38138,8 +38148,10 @@ var Vc = (function (exports, vue) {
38138
38148
  const NormalList = /* @__PURE__ */ vue.defineComponent({
38139
38149
  name: COMPONENT_NAME$h,
38140
38150
  props: {
38141
- data: Array,
38142
- default: () => []
38151
+ data: {
38152
+ type: Array,
38153
+ default: () => []
38154
+ }
38143
38155
  },
38144
38156
  emits: ["row-resize"],
38145
38157
  setup(props2, {
@@ -38180,7 +38192,7 @@ var Vc = (function (exports, vue) {
38180
38192
  expose
38181
38193
  }) {
38182
38194
  const instance = vue.getCurrentInstance();
38183
- const table = getInstance$1("table", "tableId");
38195
+ const table = vue.inject("vc-table");
38184
38196
  const states = useStates({
38185
38197
  data: "data",
38186
38198
  list: "list",
@@ -38304,7 +38316,7 @@ var Vc = (function (exports, vue) {
38304
38316
  column,
38305
38317
  row
38306
38318
  };
38307
- table.exposed.hoverState.value = hoverState;
38319
+ table.hoverState.value = hoverState;
38308
38320
  table.emit("cell-mouse-enter", hoverState.row, hoverState.column, hoverState.cell, e);
38309
38321
  }
38310
38322
  const cellChild = e.target.querySelector(".vc-table__cell");
@@ -38333,7 +38345,7 @@ var Vc = (function (exports, vue) {
38333
38345
  const handleCellMouseLeave = (e) => {
38334
38346
  const cell = getCell(e);
38335
38347
  if (!cell) return;
38336
- const oldHoverState = table.exposed.hoverState.value || {};
38348
+ const oldHoverState = table.hoverState.value || {};
38337
38349
  table.emit("cell-mouse-leave", oldHoverState.row, oldHoverState.column, oldHoverState.cell, e);
38338
38350
  };
38339
38351
  const handleMouseEnter = debounce$1((index) => {
@@ -38371,6 +38383,7 @@ var Vc = (function (exports, vue) {
38371
38383
  columns
38372
38384
  } = states;
38373
38385
  const key = getValueOfRow(row, rowIndex);
38386
+ const selected = props2.store.isSelected(row);
38374
38387
  return vue.createVNode("div", {
38375
38388
  "key": key,
38376
38389
  "class": [getRowClass(row, rowIndex), "vc-table__tr"],
@@ -38391,10 +38404,12 @@ var Vc = (function (exports, vue) {
38391
38404
  };
38392
38405
  if (columnsHidden.value[columnIndex]) {
38393
38406
  return vue.createVNode("div", {
38407
+ "key": column.id,
38394
38408
  "style": [sizeStyle]
38395
38409
  }, null);
38396
38410
  }
38397
38411
  return vue.createVNode("div", {
38412
+ "key": column.id,
38398
38413
  "style": [getCellStyle(rowIndex, columnIndex, row, column), sizeStyle],
38399
38414
  "class": [getCellClass(rowIndex, columnIndex, row, column), "vc-table__td"],
38400
38415
  "onMouseenter": (e) => handleCellMouseEnter(e, row),
@@ -38404,7 +38419,8 @@ var Vc = (function (exports, vue) {
38404
38419
  column,
38405
38420
  rowIndex,
38406
38421
  columnIndex,
38407
- store: props2.store
38422
+ store: props2.store,
38423
+ selected
38408
38424
  })]);
38409
38425
  })]);
38410
38426
  };
@@ -38438,7 +38454,7 @@ var Vc = (function (exports, vue) {
38438
38454
  wrapper,
38439
38455
  getRootElement: () => instance.vnode.el
38440
38456
  });
38441
- const layout = table.exposed.layout;
38457
+ const layout = table.layout;
38442
38458
  return () => {
38443
38459
  return vue.createVNode("div", {
38444
38460
  "class": "vc-table__body"
@@ -38448,7 +38464,7 @@ var Vc = (function (exports, vue) {
38448
38464
  "disabled": true,
38449
38465
  "class": "vc-table__tbody",
38450
38466
  "scrollerOptions": {
38451
- barTo: `.${table.exposed.tableId}`,
38467
+ barTo: `.${table.tableId}`,
38452
38468
  native: false,
38453
38469
  always: false,
38454
38470
  showBar: !props2.fixed,
@@ -38500,7 +38516,7 @@ var Vc = (function (exports, vue) {
38500
38516
  }
38501
38517
  },
38502
38518
  setup(props2) {
38503
- const table = getInstance$1("table", "tableId");
38519
+ const table = vue.inject("vc-table");
38504
38520
  const instance = vue.getCurrentInstance();
38505
38521
  const draggingColumn = vue.ref(null);
38506
38522
  const dragging = vue.ref(false);
@@ -38606,7 +38622,7 @@ var Vc = (function (exports, vue) {
38606
38622
  if (column.children && column.children.length > 0) return;
38607
38623
  if (draggingColumn.value && props2.border) {
38608
38624
  dragging.value = true;
38609
- table.exposed.resizeProxyVisible.value = true;
38625
+ table.resizeProxyVisible.value = true;
38610
38626
  const tableEl = table.vnode.el;
38611
38627
  const tableLeft = tableEl.getBoundingClientRect().left;
38612
38628
  const columnEl = instance.vnode.el.querySelector(`.vc-table__th.${column.id}`);
@@ -38619,7 +38635,7 @@ var Vc = (function (exports, vue) {
38619
38635
  startColumnLeft: columnRect.left - tableLeft,
38620
38636
  tableLeft
38621
38637
  };
38622
- const resizeProxy = table.exposed.resizeProxy.value;
38638
+ const resizeProxy = table.resizeProxy.value;
38623
38639
  resizeProxy.style.left = dragState.value.startLeft + "px";
38624
38640
  document.onselectstart = () => false;
38625
38641
  document.ondragstart = () => false;
@@ -38976,7 +38992,8 @@ var Vc = (function (exports, vue) {
38976
38992
  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"],
38977
38993
  setup(props2, {
38978
38994
  slots,
38979
- expose
38995
+ expose,
38996
+ emit
38980
38997
  }) {
38981
38998
  const instance = vue.getCurrentInstance();
38982
38999
  const store = new Store({
@@ -39275,8 +39292,8 @@ var Vc = (function (exports, vue) {
39275
39292
  }, {
39276
39293
  immediate: true
39277
39294
  });
39278
- vue.watch(() => props2.data, (v) => {
39279
- store.setData(v);
39295
+ vue.watch(() => [props2.data, props2.data.length], () => {
39296
+ store.setData(props2.data);
39280
39297
  isReady.value && vue.nextTick(refreshLayout);
39281
39298
  }, {
39282
39299
  immediate: true
@@ -39312,7 +39329,7 @@ var Vc = (function (exports, vue) {
39312
39329
  isUnMount = true;
39313
39330
  unbindEvents();
39314
39331
  });
39315
- expose({
39332
+ const exposed = {
39316
39333
  bodyXWrapper,
39317
39334
  bodyYWrapper,
39318
39335
  tableId,
@@ -39334,8 +39351,12 @@ var Vc = (function (exports, vue) {
39334
39351
  isReady,
39335
39352
  hoverState,
39336
39353
  renderExpanded,
39337
- hiddenColumns
39338
- });
39354
+ hiddenColumns,
39355
+ props: props2,
39356
+ emit
39357
+ };
39358
+ expose(exposed);
39359
+ vue.provide("vc-table", exposed);
39339
39360
  return () => {
39340
39361
  return vue.createVNode("div", {
39341
39362
  "class": [classes.value, tableId, "vc-table"],
@@ -39519,10 +39540,11 @@ var Vc = (function (exports, vue) {
39519
39540
  column,
39520
39541
  store,
39521
39542
  rowIndex,
39522
- level
39543
+ level,
39544
+ selected
39523
39545
  }) {
39524
39546
  return vue.withDirectives(vue.createVNode(Checkbox, {
39525
- "modelValue": store.isSelected(row),
39547
+ "modelValue": selected,
39526
39548
  "disabled": column.selectable ? !column.selectable.call(null, row, rowIndex) : false,
39527
39549
  "onChange": () => store.rowSelectedChanged(row),
39528
39550
  "onClick": (e) => e.stopPropagation()
@@ -39690,14 +39712,13 @@ var Vc = (function (exports, vue) {
39690
39712
  tooltip: [String, Function]
39691
39713
  },
39692
39714
  setup(props2, {
39693
- slots,
39694
- expose
39715
+ slots
39695
39716
  }) {
39696
39717
  const instance = vue.getCurrentInstance();
39697
- const table = getInstance$1("table", "tableId");
39698
- const parent = getInstance$1("table-column", "columnId") || table;
39718
+ const table = vue.inject("vc-table");
39719
+ const parent = vue.inject("vc-table-column", table);
39699
39720
  const isSubColumn = table !== parent;
39700
- const columnId = vue.ref((parent.exposed.tableId || parent.exposed.columnId) + getUid("column"));
39721
+ const columnId = vue.ref((parent.tableId || parent.columnId) + getUid("column"));
39701
39722
  const realWidth = vue.computed(() => {
39702
39723
  return parseWidth(props2.width);
39703
39724
  });
@@ -39761,7 +39782,7 @@ var Vc = (function (exports, vue) {
39761
39782
  column.renderCell = (data) => vue.createVNode("div", {
39762
39783
  "class": "vc-table__cell"
39763
39784
  }, [originRenderCell(data)]);
39764
- table.exposed.renderExpanded.value = (data) => {
39785
+ table.renderExpanded.value = (data) => {
39765
39786
  return slots.default ? slots.default(data) : slots.default;
39766
39787
  };
39767
39788
  } else {
@@ -39778,7 +39799,7 @@ var Vc = (function (exports, vue) {
39778
39799
  class: "vc-table__cell",
39779
39800
  style: {}
39780
39801
  };
39781
- if (!isEmpty$1(table.exposed.store.states.treeData) && !prefix2 && data.isExpandColumn) {
39802
+ if (!isEmpty$1(table.store.states.treeData) && !prefix2 && data.isExpandColumn) {
39782
39803
  prefix2 = vue.createVNode("span", {
39783
39804
  "class": "vc-table-un-expand__indent"
39784
39805
  }, null);
@@ -39816,15 +39837,15 @@ var Vc = (function (exports, vue) {
39816
39837
  const registerWatchers = () => {
39817
39838
  Object.keys(props2).forEach((k) => vue.watch(() => props2[k], (v) => columnConfig[k] = v));
39818
39839
  vue.watch(() => props2.fixed, () => {
39819
- table.exposed.store.scheduleLayout(true);
39840
+ table.store.scheduleLayout(true);
39820
39841
  });
39821
39842
  vue.watch(() => realWidth.value, (v) => {
39822
39843
  columnConfig["width"] = v;
39823
39844
  columnConfig["realWidth"] = v;
39824
- table.exposed.store.scheduleLayout(false);
39845
+ table.store.scheduleLayout(false);
39825
39846
  });
39826
39847
  vue.watch(() => realMinWidth.value, () => {
39827
- table.exposed.store.scheduleLayout(false);
39848
+ table.store.scheduleLayout(false);
39828
39849
  });
39829
39850
  };
39830
39851
  vue.onBeforeMount(() => {
@@ -39832,15 +39853,15 @@ var Vc = (function (exports, vue) {
39832
39853
  registerWatchers();
39833
39854
  });
39834
39855
  vue.onMounted(() => {
39835
- const children = isSubColumn ? parent.vnode.el.children : parent.exposed.hiddenColumns.value.children;
39856
+ const children = isSubColumn ? parent.vnode.el.children : parent.hiddenColumns.value.children;
39836
39857
  const columnIndex = [...children].indexOf(instance.vnode.el);
39837
- table.exposed.store.insertColumn(columnConfig, columnIndex, isSubColumn && parent.exposed.columnConfig);
39858
+ table.store.insertColumn(columnConfig, columnIndex, isSubColumn && parent.columnConfig);
39838
39859
  });
39839
39860
  vue.onUnmounted(() => {
39840
39861
  if (!instance.parent) return;
39841
- table.exposed.store.removeColumn(columnConfig, isSubColumn && parent.exposed.columnConfig);
39862
+ table.store.removeColumn(columnConfig, isSubColumn && parent.columnConfig);
39842
39863
  });
39843
- expose({
39864
+ vue.provide("vc-table-column", {
39844
39865
  columnId,
39845
39866
  columnConfig
39846
39867
  });
@@ -24844,7 +24844,7 @@
24844
24844
  });
24845
24845
  const COMPONENT_NAME$1T = "vc-alert";
24846
24846
  const THEME_MAP = {
24847
- info: ["#5495f6", "#91d5ff", "#e6f7ff"],
24847
+ info: ["#2B72FD", "#91d5ff", "#e6f7ff"],
24848
24848
  success: ["#52c41a", "#b7eb8f", "#f6ffed"],
24849
24849
  error: ["#ed4014", "#ffb08f", "#fbe9e9"],
24850
24850
  warning: ["#ffbf00", "#ffe58f", "#fffbe6"]
@@ -35561,7 +35561,7 @@
35561
35561
  color: {
35562
35562
  type: [Object, String],
35563
35563
  default: () => ({
35564
- normal: "#5495f6",
35564
+ normal: "#2B72FD",
35565
35565
  success: "#52c41a",
35566
35566
  error: "#f5222d"
35567
35567
  })
@@ -36708,6 +36708,8 @@
36708
36708
  });
36709
36709
  if (!originalData.length) {
36710
36710
  rebuildData.value = [];
36711
+ } else {
36712
+ rebuildData.value = originalData.slice();
36711
36713
  }
36712
36714
  offsetPageSize.value = 0;
36713
36715
  await refreshLayout(0, originalData.length);
@@ -37814,17 +37816,24 @@
37814
37816
  const dataInstanceChanged = this.states._data !== data;
37815
37817
  this.states._data = data;
37816
37818
  this.states.data = data;
37819
+ const caches = /* @__PURE__ */ new Map();
37820
+ this.states.list.forEach((item) => {
37821
+ item.rows.forEach((row) => {
37822
+ caches.set(row.data, row);
37823
+ });
37824
+ });
37817
37825
  this.states.list = data.reduce((pre, row, index) => {
37826
+ const cache = caches.get(row) || { heightMap: {} };
37818
37827
  pre.push({
37819
37828
  rows: [
37820
37829
  {
37821
37830
  index,
37822
37831
  data: row,
37823
- height: "",
37832
+ height: cache.height || "",
37824
37833
  heightMap: {
37825
- left: "",
37826
- main: "",
37827
- right: ""
37834
+ left: cache.heightMap.left || "",
37835
+ main: cache.heightMap.main || "",
37836
+ right: cache.heightMap.right || ""
37828
37837
  }
37829
37838
  }
37830
37839
  ],
@@ -37832,6 +37841,7 @@
37832
37841
  });
37833
37842
  return pre;
37834
37843
  }, []);
37844
+ caches.clear();
37835
37845
  this.current.update();
37836
37846
  this.expand.update();
37837
37847
  if (!this.states.reserveSelection) {
@@ -37965,12 +37975,12 @@
37965
37975
  */
37966
37976
  cleanSelection() {
37967
37977
  const { primaryKey } = this.table.props;
37968
- const { selection = [] } = this.states;
37978
+ const { selection = [], data } = this.states;
37969
37979
  let deleted;
37970
37980
  if (primaryKey) {
37971
37981
  deleted = [];
37972
37982
  const selectedMap = getValuesMap(selection, primaryKey);
37973
- const dataMap = getValuesMap(selection, primaryKey);
37983
+ const dataMap = getValuesMap(data, primaryKey);
37974
37984
  for (const key in selectedMap) {
37975
37985
  if (hasOwn$1(selectedMap, key) && !dataMap[key]) {
37976
37986
  deleted.push(selectedMap[key].row);
@@ -38141,8 +38151,10 @@
38141
38151
  const NormalList = /* @__PURE__ */ vue.defineComponent({
38142
38152
  name: COMPONENT_NAME$h,
38143
38153
  props: {
38144
- data: Array,
38145
- default: () => []
38154
+ data: {
38155
+ type: Array,
38156
+ default: () => []
38157
+ }
38146
38158
  },
38147
38159
  emits: ["row-resize"],
38148
38160
  setup(props2, {
@@ -38183,7 +38195,7 @@
38183
38195
  expose
38184
38196
  }) {
38185
38197
  const instance = vue.getCurrentInstance();
38186
- const table = getInstance$1("table", "tableId");
38198
+ const table = vue.inject("vc-table");
38187
38199
  const states = useStates({
38188
38200
  data: "data",
38189
38201
  list: "list",
@@ -38307,7 +38319,7 @@
38307
38319
  column,
38308
38320
  row
38309
38321
  };
38310
- table.exposed.hoverState.value = hoverState;
38322
+ table.hoverState.value = hoverState;
38311
38323
  table.emit("cell-mouse-enter", hoverState.row, hoverState.column, hoverState.cell, e);
38312
38324
  }
38313
38325
  const cellChild = e.target.querySelector(".vc-table__cell");
@@ -38336,7 +38348,7 @@
38336
38348
  const handleCellMouseLeave = (e) => {
38337
38349
  const cell = getCell(e);
38338
38350
  if (!cell) return;
38339
- const oldHoverState = table.exposed.hoverState.value || {};
38351
+ const oldHoverState = table.hoverState.value || {};
38340
38352
  table.emit("cell-mouse-leave", oldHoverState.row, oldHoverState.column, oldHoverState.cell, e);
38341
38353
  };
38342
38354
  const handleMouseEnter = debounce$1((index) => {
@@ -38374,6 +38386,7 @@
38374
38386
  columns
38375
38387
  } = states;
38376
38388
  const key = getValueOfRow(row, rowIndex);
38389
+ const selected = props2.store.isSelected(row);
38377
38390
  return vue.createVNode("div", {
38378
38391
  "key": key,
38379
38392
  "class": [getRowClass(row, rowIndex), "vc-table__tr"],
@@ -38394,10 +38407,12 @@
38394
38407
  };
38395
38408
  if (columnsHidden.value[columnIndex]) {
38396
38409
  return vue.createVNode("div", {
38410
+ "key": column.id,
38397
38411
  "style": [sizeStyle]
38398
38412
  }, null);
38399
38413
  }
38400
38414
  return vue.createVNode("div", {
38415
+ "key": column.id,
38401
38416
  "style": [getCellStyle(rowIndex, columnIndex, row, column), sizeStyle],
38402
38417
  "class": [getCellClass(rowIndex, columnIndex, row, column), "vc-table__td"],
38403
38418
  "onMouseenter": (e) => handleCellMouseEnter(e, row),
@@ -38407,7 +38422,8 @@
38407
38422
  column,
38408
38423
  rowIndex,
38409
38424
  columnIndex,
38410
- store: props2.store
38425
+ store: props2.store,
38426
+ selected
38411
38427
  })]);
38412
38428
  })]);
38413
38429
  };
@@ -38441,7 +38457,7 @@
38441
38457
  wrapper,
38442
38458
  getRootElement: () => instance.vnode.el
38443
38459
  });
38444
- const layout = table.exposed.layout;
38460
+ const layout = table.layout;
38445
38461
  return () => {
38446
38462
  return vue.createVNode("div", {
38447
38463
  "class": "vc-table__body"
@@ -38451,7 +38467,7 @@
38451
38467
  "disabled": true,
38452
38468
  "class": "vc-table__tbody",
38453
38469
  "scrollerOptions": {
38454
- barTo: `.${table.exposed.tableId}`,
38470
+ barTo: `.${table.tableId}`,
38455
38471
  native: false,
38456
38472
  always: false,
38457
38473
  showBar: !props2.fixed,
@@ -38503,7 +38519,7 @@
38503
38519
  }
38504
38520
  },
38505
38521
  setup(props2) {
38506
- const table = getInstance$1("table", "tableId");
38522
+ const table = vue.inject("vc-table");
38507
38523
  const instance = vue.getCurrentInstance();
38508
38524
  const draggingColumn = vue.ref(null);
38509
38525
  const dragging = vue.ref(false);
@@ -38609,7 +38625,7 @@
38609
38625
  if (column.children && column.children.length > 0) return;
38610
38626
  if (draggingColumn.value && props2.border) {
38611
38627
  dragging.value = true;
38612
- table.exposed.resizeProxyVisible.value = true;
38628
+ table.resizeProxyVisible.value = true;
38613
38629
  const tableEl = table.vnode.el;
38614
38630
  const tableLeft = tableEl.getBoundingClientRect().left;
38615
38631
  const columnEl = instance.vnode.el.querySelector(`.vc-table__th.${column.id}`);
@@ -38622,7 +38638,7 @@
38622
38638
  startColumnLeft: columnRect.left - tableLeft,
38623
38639
  tableLeft
38624
38640
  };
38625
- const resizeProxy = table.exposed.resizeProxy.value;
38641
+ const resizeProxy = table.resizeProxy.value;
38626
38642
  resizeProxy.style.left = dragState.value.startLeft + "px";
38627
38643
  document.onselectstart = () => false;
38628
38644
  document.ondragstart = () => false;
@@ -38979,7 +38995,8 @@
38979
38995
  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"],
38980
38996
  setup(props2, {
38981
38997
  slots,
38982
- expose
38998
+ expose,
38999
+ emit
38983
39000
  }) {
38984
39001
  const instance = vue.getCurrentInstance();
38985
39002
  const store = new Store({
@@ -39278,8 +39295,8 @@
39278
39295
  }, {
39279
39296
  immediate: true
39280
39297
  });
39281
- vue.watch(() => props2.data, (v) => {
39282
- store.setData(v);
39298
+ vue.watch(() => [props2.data, props2.data.length], () => {
39299
+ store.setData(props2.data);
39283
39300
  isReady.value && vue.nextTick(refreshLayout);
39284
39301
  }, {
39285
39302
  immediate: true
@@ -39315,7 +39332,7 @@
39315
39332
  isUnMount = true;
39316
39333
  unbindEvents();
39317
39334
  });
39318
- expose({
39335
+ const exposed = {
39319
39336
  bodyXWrapper,
39320
39337
  bodyYWrapper,
39321
39338
  tableId,
@@ -39337,8 +39354,12 @@
39337
39354
  isReady,
39338
39355
  hoverState,
39339
39356
  renderExpanded,
39340
- hiddenColumns
39341
- });
39357
+ hiddenColumns,
39358
+ props: props2,
39359
+ emit
39360
+ };
39361
+ expose(exposed);
39362
+ vue.provide("vc-table", exposed);
39342
39363
  return () => {
39343
39364
  return vue.createVNode("div", {
39344
39365
  "class": [classes.value, tableId, "vc-table"],
@@ -39522,10 +39543,11 @@
39522
39543
  column,
39523
39544
  store,
39524
39545
  rowIndex,
39525
- level
39546
+ level,
39547
+ selected
39526
39548
  }) {
39527
39549
  return vue.withDirectives(vue.createVNode(Checkbox, {
39528
- "modelValue": store.isSelected(row),
39550
+ "modelValue": selected,
39529
39551
  "disabled": column.selectable ? !column.selectable.call(null, row, rowIndex) : false,
39530
39552
  "onChange": () => store.rowSelectedChanged(row),
39531
39553
  "onClick": (e) => e.stopPropagation()
@@ -39693,14 +39715,13 @@
39693
39715
  tooltip: [String, Function]
39694
39716
  },
39695
39717
  setup(props2, {
39696
- slots,
39697
- expose
39718
+ slots
39698
39719
  }) {
39699
39720
  const instance = vue.getCurrentInstance();
39700
- const table = getInstance$1("table", "tableId");
39701
- const parent = getInstance$1("table-column", "columnId") || table;
39721
+ const table = vue.inject("vc-table");
39722
+ const parent = vue.inject("vc-table-column", table);
39702
39723
  const isSubColumn = table !== parent;
39703
- const columnId = vue.ref((parent.exposed.tableId || parent.exposed.columnId) + getUid("column"));
39724
+ const columnId = vue.ref((parent.tableId || parent.columnId) + getUid("column"));
39704
39725
  const realWidth = vue.computed(() => {
39705
39726
  return parseWidth(props2.width);
39706
39727
  });
@@ -39764,7 +39785,7 @@
39764
39785
  column.renderCell = (data) => vue.createVNode("div", {
39765
39786
  "class": "vc-table__cell"
39766
39787
  }, [originRenderCell(data)]);
39767
- table.exposed.renderExpanded.value = (data) => {
39788
+ table.renderExpanded.value = (data) => {
39768
39789
  return slots.default ? slots.default(data) : slots.default;
39769
39790
  };
39770
39791
  } else {
@@ -39781,7 +39802,7 @@
39781
39802
  class: "vc-table__cell",
39782
39803
  style: {}
39783
39804
  };
39784
- if (!isEmpty$1(table.exposed.store.states.treeData) && !prefix2 && data.isExpandColumn) {
39805
+ if (!isEmpty$1(table.store.states.treeData) && !prefix2 && data.isExpandColumn) {
39785
39806
  prefix2 = vue.createVNode("span", {
39786
39807
  "class": "vc-table-un-expand__indent"
39787
39808
  }, null);
@@ -39819,15 +39840,15 @@
39819
39840
  const registerWatchers = () => {
39820
39841
  Object.keys(props2).forEach((k) => vue.watch(() => props2[k], (v) => columnConfig[k] = v));
39821
39842
  vue.watch(() => props2.fixed, () => {
39822
- table.exposed.store.scheduleLayout(true);
39843
+ table.store.scheduleLayout(true);
39823
39844
  });
39824
39845
  vue.watch(() => realWidth.value, (v) => {
39825
39846
  columnConfig["width"] = v;
39826
39847
  columnConfig["realWidth"] = v;
39827
- table.exposed.store.scheduleLayout(false);
39848
+ table.store.scheduleLayout(false);
39828
39849
  });
39829
39850
  vue.watch(() => realMinWidth.value, () => {
39830
- table.exposed.store.scheduleLayout(false);
39851
+ table.store.scheduleLayout(false);
39831
39852
  });
39832
39853
  };
39833
39854
  vue.onBeforeMount(() => {
@@ -39835,15 +39856,15 @@
39835
39856
  registerWatchers();
39836
39857
  });
39837
39858
  vue.onMounted(() => {
39838
- const children = isSubColumn ? parent.vnode.el.children : parent.exposed.hiddenColumns.value.children;
39859
+ const children = isSubColumn ? parent.vnode.el.children : parent.hiddenColumns.value.children;
39839
39860
  const columnIndex = [...children].indexOf(instance.vnode.el);
39840
- table.exposed.store.insertColumn(columnConfig, columnIndex, isSubColumn && parent.exposed.columnConfig);
39861
+ table.store.insertColumn(columnConfig, columnIndex, isSubColumn && parent.columnConfig);
39841
39862
  });
39842
39863
  vue.onUnmounted(() => {
39843
39864
  if (!instance.parent) return;
39844
- table.exposed.store.removeColumn(columnConfig, isSubColumn && parent.exposed.columnConfig);
39865
+ table.store.removeColumn(columnConfig, isSubColumn && parent.columnConfig);
39845
39866
  });
39846
- expose({
39867
+ vue.provide("vc-table-column", {
39847
39868
  columnId,
39848
39869
  columnConfig
39849
39870
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,9 +19,9 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@deot/vc-components": "^1.0.12",
23
- "@deot/vc-hooks": "^1.0.12",
24
- "@deot/vc-shared": "^1.0.12"
22
+ "@deot/vc-components": "^1.0.13",
23
+ "@deot/vc-hooks": "^1.0.13",
24
+ "@deot/vc-shared": "^1.0.13"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vue": "*"