@tongfun/tf-widget 0.1.152 → 0.1.154

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.
@@ -140090,8 +140090,8 @@ var component = (0,componentNormalizer/* default */.Z)(
140090
140090
  /* harmony default export */ var tf_filter = (component.exports);
140091
140091
  // EXTERNAL MODULE: ./src/utils/index.js
140092
140092
  var utils = __webpack_require__(68023);
140093
- // EXTERNAL MODULE: ./src/directives/index.js + 31 modules
140094
- var directives = __webpack_require__(84962);
140093
+ // EXTERNAL MODULE: ./src/directives/index.js + 33 modules
140094
+ var directives = __webpack_require__(2445);
140095
140095
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-81.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/tf-table/src/index.vue?vue&type=script&lang=js&
140096
140096
  //
140097
140097
  //
@@ -140841,21 +140841,20 @@ function getVoucherIds(data) {
140841
140841
 
140842
140842
  /***/ }),
140843
140843
 
140844
- /***/ 84962:
140844
+ /***/ 2445:
140845
140845
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
140846
140846
 
140847
140847
  "use strict";
140848
140848
 
140849
140849
  // EXPORTS
140850
140850
  __webpack_require__.d(__webpack_exports__, {
140851
+ "Lh": function() { return /* reexport */ ElDialogDrag; },
140851
140852
  "Ds": function() { return /* reexport */ debounce; },
140852
140853
  "Cq": function() { return /* reexport */ tableAutoHeight; },
140853
140854
  "AB": function() { return /* reexport */ umyColumnWidth; },
140854
140855
  "b$": function() { return /* reexport */ umyTableSetting; }
140855
140856
  });
140856
140857
 
140857
- // UNUSED EXPORTS: ElDialogDrag
140858
-
140859
140858
  ;// CONCATENATED MODULE: ./src/directives/modules/debounce.js
140860
140859
  const debounce = {
140861
140860
  bind: function (el, {
@@ -141120,6 +141119,18 @@ async function initColumnDrag(el, binding, vNode) {
141120
141119
  el.tfSettingInstance?.forceInit(el.umyTableSetting.tableConfigList);
141121
141120
  };
141122
141121
  }
141122
+ ;// CONCATENATED MODULE: ./src/directives/modules/umy-table-setting/js/util.js
141123
+ function getFieldIndex(obj) {
141124
+ let fieldIndex,
141125
+ current = obj;
141126
+
141127
+ while (!fieldIndex && current) {
141128
+ fieldIndex = current.fieldIndex;
141129
+ current = obj.children ? obj.children[0] : null;
141130
+ }
141131
+
141132
+ return fieldIndex;
141133
+ }
141123
141134
  // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
141124
141135
  var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(77203);
141125
141136
  var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
@@ -141829,6 +141840,7 @@ var tf_setting_component = (0,componentNormalizer/* default */.Z)(
141829
141840
 
141830
141841
 
141831
141842
 
141843
+
141832
141844
  external_commonjs_vue_commonjs2_vue_root_Vue_default().component('DirectiveColumnHeader', column_header);
141833
141845
  /** 初始化表格配置信息 */
141834
141846
 
@@ -142017,11 +142029,12 @@ const reloadColumns = async (el, binding, vNode) => {
142017
142029
  const {
142018
142030
  collectColumn
142019
142031
  } = tableInstance.getTableColumn();
142020
- collectColumn.sort((a, b) => a.fieldIndex - b.fieldIndex);
142032
+ collectColumn.sort((a, b) => getFieldIndex(a) - getFieldIndex(b));
142021
142033
  tableInstance.reloadColumn(collectColumn);
142022
142034
  };
142023
142035
  ;// CONCATENATED MODULE: ./src/directives/modules/umy-table-setting/js/watch.js
142024
142036
 
142037
+
142025
142038
  /** 表格列宽变化事件 */
142026
142039
 
142027
142040
  function watch_watchTableHeaderNode(el, binding, vNode) {
@@ -142112,19 +142125,6 @@ const addSettingColumn = (el, binding, vNode) => {
142112
142125
  const newColumns = settingColumn ? [...columns, { ...settingColumn,
142113
142126
  ...mixinObj
142114
142127
  }] : [...columns, mixinObj];
142115
-
142116
- const getFieldIndex = obj => {
142117
- let fieldIndex,
142118
- current = obj;
142119
-
142120
- while (!fieldIndex && current) {
142121
- fieldIndex = current.fieldIndex;
142122
- current = obj.children ? obj.children[0] : null;
142123
- }
142124
-
142125
- return fieldIndex;
142126
- };
142127
-
142128
142128
  newColumns.sort((a, b) => getFieldIndex(a) - getFieldIndex(b));
142129
142129
  tableInstance.loadColumn(newColumns);
142130
142130
  };
@@ -142289,14 +142289,55 @@ const tableAutoHeight = {
142289
142289
  }
142290
142290
 
142291
142291
  };
142292
+ ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/init.js
142293
+ /** 弹框初始化 */
142294
+ function init(el, binding, vNode) {
142295
+ //初始化弹框属性
142296
+ initAttrs(el, binding, vNode); // 初始化弹框位置
142297
+
142298
+ initPostion(el, binding, vNode);
142299
+ }
142300
+ /** 初始化弹框属性 */
142301
+
142302
+ function initAttrs(el, binding, vNode) {
142303
+ const dialogInstance = vNode.componentInstance; // 禁止用户点击外侧关闭弹框
142304
+ // dialogInstance.closeOnClickModal = false
142305
+ }
142306
+ /** 第一次打开弹框时初始化弹框位置 */
142307
+
142308
+ function initPostion(el, binding, vNode) {
142309
+ let hasInit = false;
142310
+
142311
+ const initFn = el => {
142312
+ const dragDom = el.querySelector('.el-dialog');
142313
+ const offsetLeft = dragDom.offsetLeft;
142314
+ const dargDomWidth = dragDom.clientWidth;
142315
+ const dargDomHeight = dragDom.clientHeight;
142316
+ dragDom.style.width = dargDomWidth + 'px';
142317
+ dragDom.style.height = dargDomHeight + 'px';
142318
+ dragDom.style.marginLeft = offsetLeft + 'px';
142319
+ };
142320
+
142321
+ const vm = vNode.context;
142322
+ const dialogInstance = vNode.componentInstance;
142323
+ vm.$watch(() => {
142324
+ return dialogInstance.visible;
142325
+ }, newVal => {
142326
+ if (!hasInit && newVal) {
142327
+ initFn(el);
142328
+ hasInit = true;
142329
+ }
142330
+ }, {
142331
+ immediate: true
142332
+ });
142333
+ }
142292
142334
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/drag.js
142293
142335
  /** 弹框支持拖拽 */
142294
- function drag(el, binding, vnode) {
142336
+ function drag(el, binding, vNode) {
142295
142337
  const dragDom = el.querySelector('.el-dialog');
142296
142338
  const dialogHeaderEl = el.querySelector('.el-dialog__header');
142297
142339
  dragDom.style.overflow = 'auto';
142298
- dialogHeaderEl.style.cursor = 'move'; // dragDom.style.cssText += ';top:0px;'
142299
-
142340
+ dialogHeaderEl.style.cursor = 'move';
142300
142341
  /**
142301
142342
  * 获取原有属性
142302
142343
  * IE dom元素.currentStyle
@@ -142320,12 +142361,12 @@ function drag(el, binding, vnode) {
142320
142361
 
142321
142362
  let styL, styT; // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
142322
142363
 
142323
- if (!sty.left.includes('%')) {
142324
- styL = +sty.left.replace(/\px/g, '');
142325
- styT = +sty.top.replace(/\px/g, '');
142364
+ if (!sty.marginLeft.includes('%')) {
142365
+ styL = +sty.marginLeft.replace(/\px/g, '');
142366
+ styT = +sty.marginTop.replace(/\px/g, '');
142326
142367
  } else {
142327
- styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
142328
- styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
142368
+ styL = +document.body.clientWidth * (+sty.marginLeft.replace(/\%/g, '') / 100);
142369
+ styT = +document.body.clientHeight * (+sty.marginTop.replace(/\%/g, '') / 100);
142329
142370
  }
142330
142371
 
142331
142372
  document.onmousemove = function (e) {
@@ -142344,15 +142385,16 @@ function drag(el, binding, vnode) {
142344
142385
  } else if (top > maxDragDomTop) {
142345
142386
  top = maxDragDomTop;
142346
142387
  } // 移动当前元素
142347
- // dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
142348
142388
 
142349
142389
 
142350
- dragDom.style.top = `${top + styT}px`;
142351
- dragDom.style.left = `${left + styL}px`;
142352
- vnode.child.$emit('dragDialog');
142390
+ dragDom.style.marginTop = `${top + styT}px`;
142391
+ dragDom.style.marginLeft = `${left + styL}px`;
142392
+ dragDom.style.userSelect = 'none';
142393
+ vNode.child.$emit('dragDialog');
142353
142394
  };
142354
142395
 
142355
142396
  document.onmouseup = function () {
142397
+ dragDom.style.userSelect = 'auto';
142356
142398
  document.onmousemove = null;
142357
142399
  document.onmouseup = null;
142358
142400
  };
@@ -142362,21 +142404,39 @@ function drag(el, binding, vnode) {
142362
142404
  }
142363
142405
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/resize.js
142364
142406
  /** 弹框拖拽改变大小 */
142365
- function resize(el, binding, value) {
142407
+ function resize(el, binding, vNode) {
142366
142408
  const minWidth = 400;
142367
- const minHeight = 400;
142409
+ const minHeight = 250;
142368
142410
  const dragDom = el.querySelector('.el-dialog');
142411
+ const dialogHeaderEl = el.querySelector('.el-dialog__header');
142412
+
142413
+ const setDragDomWidth = (marginLeft, newWidth) => {
142414
+ if (marginLeft > 0 && newWidth > minWidth && marginLeft + newWidth <= document.body.clientWidth) {
142415
+ dragDom.style.marginLeft = marginLeft + 'px';
142416
+ dragDom.style.width = newWidth + 'px';
142417
+ }
142418
+ };
142419
+
142420
+ const setDragDomHeight = newHeight => {
142421
+ if (newHeight + dragDom.offsetTop <= document.body.clientHeight && newHeight >= minHeight) {
142422
+ dragDom.style.height = newHeight + 'px';
142423
+ }
142424
+ };
142369
142425
 
142370
142426
  dragDom.onmousemove = function (e) {
142371
142427
  // 图标变换
142372
- if (dragDom.offsetLeft + 10 > e.clientX) {
142373
- dragDom.style.cursor = 'w-resize';
142374
- } else if (e.clientX > dragDom.offsetLeft + dragDom.clientWidth - 10) {
142375
- dragDom.style.cursor = 'e-resize';
142376
- } else if (el.scrollTop + e.clientY > dragDom.offsetTop + dragDom.clientHeight - 10) {
142428
+ const isLeft = dragDom.offsetLeft + 10 > e.clientX;
142429
+ const isRight = e.clientX > dragDom.offsetLeft + dragDom.clientWidth - 10;
142430
+ const isBottom = el.scrollTop + e.clientY > dragDom.offsetTop + dragDom.clientHeight - 10;
142431
+
142432
+ if (isLeft) {
142433
+ dragDom.style.cursor = isBottom ? 'nesw-resize' : 'w-resize';
142434
+ } else if (isRight) {
142435
+ dragDom.style.cursor = isBottom ? 'nwse-resize' : 'e-resize';
142436
+ } else if (isBottom) {
142377
142437
  dragDom.style.cursor = 's-resize';
142378
142438
  } else {
142379
- dragDom.style.cursor = 'default';
142439
+ dragDom.style.cursor = 'auto';
142380
142440
  dragDom.onmousedown = null;
142381
142441
  } // 改变大小
142382
142442
 
@@ -142384,72 +142444,68 @@ function resize(el, binding, value) {
142384
142444
  dragDom.onmousedown = e => {
142385
142445
  const clientX = e.clientX;
142386
142446
  const clientY = e.clientY;
142387
- let elW = dragDom.clientWidth;
142388
- let elH = dragDom.clientHeight;
142389
- let EloffsetLeft = dragDom.offsetLeft;
142390
- let EloffsetTop = dragDom.offsetTop;
142391
- dragDom.style.userSelect = 'none';
142392
- let ELscrollTop = el.scrollTop; // 判断点击的位置是不是为头部
142447
+ const elW = dragDom.clientWidth;
142448
+ const elH = dragDom.clientHeight;
142449
+ const ELscrollTop = el.scrollTop;
142450
+ const EloffsetTop = dragDom.offsetTop;
142451
+ const EloffsetLeft = dragDom.offsetLeft; // 判断点击的位置是不是为头部
142393
142452
 
142394
- if (clientX > EloffsetLeft && clientX < EloffsetLeft + elW && clientY > EloffsetTop && clientY < EloffsetTop + 100) {// 如果是头部在此就不做任何动作,以上有绑定dialogHeaderEl.onmousedown = moveDown;
142453
+ if (clientX > EloffsetLeft && clientX < EloffsetLeft + elW && clientY > EloffsetTop && clientY < EloffsetTop + dialogHeaderEl.clientHeight) {// 如果是头部在此就不做任何动作,以上有绑定dialogHeaderEl.onmousedown = moveDown;
142395
142454
  } else {
142396
142455
  document.onmousemove = function (e) {
142397
- e.preventDefault(); // 移动时禁用默认事件
142456
+ // e.preventDefault()
142398
142457
  // 左侧鼠标拖拽位置
142399
-
142400
142458
  if (clientX > EloffsetLeft && clientX < EloffsetLeft + 10) {
142401
- // 往左拖拽
142459
+ dragDom.style.userSelect = 'none'; // 往左拖拽
142460
+
142402
142461
  if (clientX > e.clientX) {
142403
- dragDom.style.width = elW + (clientX - e.clientX) * 2 + 'px';
142462
+ const moveLen = clientX - e.clientX;
142463
+ setDragDomWidth(EloffsetLeft - moveLen, elW + moveLen);
142404
142464
  } // 往右拖拽
142405
142465
 
142406
142466
 
142407
142467
  if (clientX < e.clientX) {
142408
- if (dragDom.clientWidth < minWidth) {
142409
- console.log();
142410
- } else {
142411
- dragDom.style.width = elW - (e.clientX - clientX) * 2 + 'px';
142412
- }
142468
+ const moveLen = e.clientX - clientX;
142469
+ setDragDomWidth(EloffsetLeft + moveLen, elW - moveLen);
142413
142470
  }
142414
142471
  } // 右侧鼠标拖拽位置
142415
142472
 
142416
142473
 
142417
142474
  if (clientX > EloffsetLeft + elW - 10 && clientX < EloffsetLeft + elW) {
142418
- // 往左拖拽
142475
+ dragDom.style.userSelect = 'none'; // 往左拖拽
142476
+
142419
142477
  if (clientX > e.clientX) {
142420
- if (dragDom.clientWidth < minWidth) {
142421
- console.log();
142422
- } else {
142423
- dragDom.style.width = elW - (clientX - e.clientX) * 2 + 'px';
142424
- }
142478
+ const moveLen = clientX - e.clientX;
142479
+ setDragDomWidth(EloffsetLeft, elW - moveLen);
142425
142480
  } // 往右拖拽
142426
142481
 
142427
142482
 
142428
142483
  if (clientX < e.clientX) {
142429
- dragDom.style.width = elW + (e.clientX - clientX) * 2 + 'px';
142484
+ const moveLen = e.clientX - clientX;
142485
+ setDragDomWidth(EloffsetLeft, elW + moveLen);
142430
142486
  }
142431
142487
  } // 底部鼠标拖拽位置
142432
142488
 
142433
142489
 
142434
142490
  if (ELscrollTop + clientY > EloffsetTop + elH - 20 && ELscrollTop + clientY < EloffsetTop + elH) {
142435
- // 往上拖拽
142491
+ dragDom.style.userSelect = 'none'; // 往上拖拽
142492
+
142436
142493
  if (clientY > e.clientY) {
142437
- if (dragDom.clientHeight < minHeight) {
142438
- console.log();
142439
- } else {
142440
- dragDom.style.height = elH - (clientY - e.clientY) * 2 + 'px';
142441
- }
142494
+ const moveLen = clientY - e.clientY;
142495
+ setDragDomHeight(elH - moveLen);
142442
142496
  } // 往下拖拽
142443
142497
 
142444
142498
 
142445
142499
  if (clientY < e.clientY) {
142446
- dragDom.style.height = elH + (e.clientY - clientY) * 2 + 'px';
142500
+ const moveLen = e.clientY - clientY;
142501
+ setDragDomHeight(elH + moveLen);
142447
142502
  }
142448
142503
  }
142449
142504
  }; // 拉伸结束
142450
142505
 
142451
142506
 
142452
142507
  document.onmouseup = function (e) {
142508
+ dragDom.style.userSelect = 'auto';
142453
142509
  document.onmousemove = null;
142454
142510
  document.onmouseup = null;
142455
142511
  };
@@ -142459,15 +142515,15 @@ function resize(el, binding, value) {
142459
142515
  }
142460
142516
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/full.js
142461
142517
  /** 弹框支持全屏 */
142462
- function fullScreen(el, binding, vnode) {
142463
- //当前宽高
142518
+ function fullScreen(el, binding, vNode) {
142519
+ const timeout = 0.3;
142464
142520
  let nowWidth = 0;
142465
- let nowHight = 0; //当前顶部高度
142466
-
142521
+ let nowHight = 0;
142467
142522
  let nowMarginTop = 0;
142523
+ let nowMarginLeft = 0;
142468
142524
  let isFullScreen = false;
142469
- const dialogHeaderEl = el.querySelector('.el-dialog__header');
142470
142525
  const dragDom = el.querySelector('.el-dialog');
142526
+ const dialogHeaderEl = el.querySelector('.el-dialog__header');
142471
142527
 
142472
142528
  dialogHeaderEl.ondblclick = e => {
142473
142529
  if (isFullScreen == false) {
@@ -142475,19 +142531,27 @@ function fullScreen(el, binding, vnode) {
142475
142531
  nowHight = dragDom.clientHeight;
142476
142532
  nowWidth = dragDom.clientWidth;
142477
142533
  nowMarginTop = dragDom.style.marginTop;
142534
+ nowMarginLeft = dragDom.style.marginLeft;
142478
142535
  dragDom.style.left = 0;
142479
142536
  dragDom.style.top = 0;
142480
142537
  dragDom.style.height = '100vh';
142481
142538
  dragDom.style.width = '100vw';
142482
142539
  dragDom.style.marginTop = 0;
142483
- dialogHeaderEl.style.cursor = 'initial'; // TODO: dialogHeaderEl.onmousedown = null
142540
+ dragDom.style.marginLeft = 0;
142541
+ dialogHeaderEl.style.cursor = 'initial';
142484
142542
  } else {
142485
142543
  isFullScreen = false;
142486
- dragDom.style.height = 'auto';
142487
142544
  dragDom.style.width = nowWidth + 'px';
142545
+ dragDom.style.height = nowHight + 'px';
142488
142546
  dragDom.style.marginTop = nowMarginTop;
142489
- dialogHeaderEl.style.cursor = 'move'; // TODO: dialogHeaderEl.onmousedown = moveDown
142547
+ dragDom.style.marginLeft = nowMarginLeft;
142548
+ dialogHeaderEl.style.cursor = 'move';
142490
142549
  }
142550
+
142551
+ dragDom.style.transition = `all ${timeout}s linear`;
142552
+ setTimeout(() => {
142553
+ dragDom.style.transition = 'none';
142554
+ }, timeout * 1000);
142491
142555
  };
142492
142556
  }
142493
142557
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/index.js
@@ -142498,14 +142562,17 @@ function fullScreen(el, binding, vnode) {
142498
142562
 
142499
142563
 
142500
142564
 
142565
+
142501
142566
  const ElDialogDrag = {
142502
- bind(el, binding, vnode) {
142503
- // 弹框可拖拽
142504
- drag(el, binding, vnode); // 弹框可拖拽大小
142567
+ bind(el, binding, vNode) {
142568
+ // 弹框初始化
142569
+ init(el, binding, vNode); // 弹框可拖拽
142505
142570
 
142506
- resize(el, binding, vnode); // 弹框可全屏
142571
+ drag(el, binding, vNode); // 弹框可拖拽大小
142507
142572
 
142508
- fullScreen(el, binding, vnode);
142573
+ resize(el, binding, vNode); // 弹框可全屏
142574
+
142575
+ fullScreen(el, binding, vNode);
142509
142576
  }
142510
142577
 
142511
142578
  };
@@ -244342,8 +244409,8 @@ var push_down_component = (0,componentNormalizer/* default */.Z)(
244342
244409
 
244343
244410
  }
244344
244411
  });
244345
- // EXTERNAL MODULE: ./src/directives/index.js + 31 modules
244346
- var directives = __webpack_require__(84962);
244412
+ // EXTERNAL MODULE: ./src/directives/index.js + 33 modules
244413
+ var directives = __webpack_require__(2445);
244347
244414
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-81.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/t-data-list/main.vue?vue&type=script&lang=js&
244348
244415
  //
244349
244416
  //
@@ -249382,8 +249449,8 @@ const components = [package_t_input, svg_icon, package_tf_widget, package_tf_lay
249382
249449
  const install = function (Vue) {
249383
249450
  components.forEach(component => {
249384
249451
  Vue.component(component.name, component);
249385
- }); // Vue.directive('elDialogDrag', ElDialogDrag)
249386
-
249452
+ });
249453
+ Vue.directive('elDialogDrag', directives/* ElDialogDrag */.Lh);
249387
249454
  Vue.directive('umyColumnWidth', directives/* umyColumnWidth */.AB);
249388
249455
  Vue.directive('umyTableSetting', directives/* umyTableSetting */.b$);
249389
249456
  Vue.directive('tableAutoHeight', directives/* tableAutoHeight */.Cq);