@juzhenfe/page-model 3.12.3 → 3.12.4

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.es.js CHANGED
@@ -7870,8 +7870,9 @@ const _sfc_main$l = {
7870
7870
  }
7871
7871
  };
7872
7872
  const useColumnDrag = () => {
7873
+ let sortable;
7873
7874
  const initTableDrag = (opt) => {
7874
- new Sortable(opt.element, {
7875
+ sortable = new Sortable(opt.element, {
7875
7876
  group: "name",
7876
7877
  sort: true,
7877
7878
  delay: 0,
@@ -7911,6 +7912,8 @@ const useColumnDrag = () => {
7911
7912
  return {
7912
7913
  initTableDrag,
7913
7914
  destroyTableDrag() {
7915
+ sortable && sortable.destroy();
7916
+ sortable = null;
7914
7917
  }
7915
7918
  };
7916
7919
  };
@@ -8078,6 +8081,17 @@ const _sfc_main$k = defineComponent({
8078
8081
  doTableLayout();
8079
8082
  }, 2e3);
8080
8083
  });
8084
+ const handleTableHeaderDragEnd = (newWidth, oldWidth, column, event) => {
8085
+ const newList = jsonClone(renderedTableEls.value);
8086
+ console.log("newList", column);
8087
+ const _column = newList.find(
8088
+ (item) => item.label === column.label && item.prop === column.property
8089
+ );
8090
+ if (_column) {
8091
+ _column.width = newWidth;
8092
+ onSaveColumns(newList);
8093
+ }
8094
+ };
8081
8095
  onUnmounted(() => {
8082
8096
  tableManager.onUnmounted();
8083
8097
  scrollLifecycle.onUnmounted();
@@ -8115,6 +8129,7 @@ const _sfc_main$k = defineComponent({
8115
8129
  data: usedTableData.value,
8116
8130
  size: tableManager.size
8117
8131
  }, tableManager.tableProps, toHandlers(tableManager.tableEvents), {
8132
+ onHeaderDragend: handleTableHeaderDragEnd,
8118
8133
  height: "100%",
8119
8134
  "max-height": "100%",
8120
8135
  "table-layout": "auto"
@@ -12179,7 +12194,7 @@ const defineEditableTable = function(config) {
12179
12194
  };
12180
12195
  var iconfont = "";
12181
12196
  const name = "@juzhenfe/page-model";
12182
- const version = "3.12.3";
12197
+ const version = "3.12.4";
12183
12198
  const types = "dist/main.d.ts";
12184
12199
  const main = "dist/index.umd.js";
12185
12200
  const keywords = [