@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.
@@ -140080,8 +140080,8 @@ var component = (0,componentNormalizer/* default */.Z)(
140080
140080
  /* harmony default export */ var tf_filter = (component.exports);
140081
140081
  // EXTERNAL MODULE: ./src/utils/index.js
140082
140082
  var utils = __webpack_require__(42325);
140083
- // EXTERNAL MODULE: ./src/directives/index.js + 31 modules
140084
- var directives = __webpack_require__(7183);
140083
+ // EXTERNAL MODULE: ./src/directives/index.js + 33 modules
140084
+ var directives = __webpack_require__(65146);
140085
140085
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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&
140086
140086
  //
140087
140087
  //
@@ -140831,21 +140831,20 @@ function getVoucherIds(data) {
140831
140831
 
140832
140832
  /***/ }),
140833
140833
 
140834
- /***/ 7183:
140834
+ /***/ 65146:
140835
140835
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
140836
140836
 
140837
140837
  "use strict";
140838
140838
 
140839
140839
  // EXPORTS
140840
140840
  __webpack_require__.d(__webpack_exports__, {
140841
+ "Lh": function() { return /* reexport */ ElDialogDrag; },
140841
140842
  "Ds": function() { return /* reexport */ debounce; },
140842
140843
  "Cq": function() { return /* reexport */ tableAutoHeight; },
140843
140844
  "AB": function() { return /* reexport */ umyColumnWidth; },
140844
140845
  "b$": function() { return /* reexport */ umyTableSetting; }
140845
140846
  });
140846
140847
 
140847
- // UNUSED EXPORTS: ElDialogDrag
140848
-
140849
140848
  ;// CONCATENATED MODULE: ./src/directives/modules/debounce.js
140850
140849
  const debounce = {
140851
140850
  bind: function (el, {
@@ -141110,6 +141109,18 @@ async function initColumnDrag(el, binding, vNode) {
141110
141109
  el.tfSettingInstance?.forceInit(el.umyTableSetting.tableConfigList);
141111
141110
  };
141112
141111
  }
141112
+ ;// CONCATENATED MODULE: ./src/directives/modules/umy-table-setting/js/util.js
141113
+ function getFieldIndex(obj) {
141114
+ let fieldIndex,
141115
+ current = obj;
141116
+
141117
+ while (!fieldIndex && current) {
141118
+ fieldIndex = current.fieldIndex;
141119
+ current = obj.children ? obj.children[0] : null;
141120
+ }
141121
+
141122
+ return fieldIndex;
141123
+ }
141113
141124
  // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
141114
141125
  var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(13797);
141115
141126
  var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
@@ -141819,6 +141830,7 @@ var tf_setting_component = (0,componentNormalizer/* default */.Z)(
141819
141830
 
141820
141831
 
141821
141832
 
141833
+
141822
141834
  external_commonjs_vue_commonjs2_vue_root_Vue_default().component('DirectiveColumnHeader', column_header);
141823
141835
  /** 初始化表格配置信息 */
141824
141836
 
@@ -142007,11 +142019,12 @@ const reloadColumns = async (el, binding, vNode) => {
142007
142019
  const {
142008
142020
  collectColumn
142009
142021
  } = tableInstance.getTableColumn();
142010
- collectColumn.sort((a, b) => a.fieldIndex - b.fieldIndex);
142022
+ collectColumn.sort((a, b) => getFieldIndex(a) - getFieldIndex(b));
142011
142023
  tableInstance.reloadColumn(collectColumn);
142012
142024
  };
142013
142025
  ;// CONCATENATED MODULE: ./src/directives/modules/umy-table-setting/js/watch.js
142014
142026
 
142027
+
142015
142028
  /** 表格列宽变化事件 */
142016
142029
 
142017
142030
  function watch_watchTableHeaderNode(el, binding, vNode) {
@@ -142102,19 +142115,6 @@ const addSettingColumn = (el, binding, vNode) => {
142102
142115
  const newColumns = settingColumn ? [...columns, { ...settingColumn,
142103
142116
  ...mixinObj
142104
142117
  }] : [...columns, mixinObj];
142105
-
142106
- const getFieldIndex = obj => {
142107
- let fieldIndex,
142108
- current = obj;
142109
-
142110
- while (!fieldIndex && current) {
142111
- fieldIndex = current.fieldIndex;
142112
- current = obj.children ? obj.children[0] : null;
142113
- }
142114
-
142115
- return fieldIndex;
142116
- };
142117
-
142118
142118
  newColumns.sort((a, b) => getFieldIndex(a) - getFieldIndex(b));
142119
142119
  tableInstance.loadColumn(newColumns);
142120
142120
  };
@@ -142279,14 +142279,55 @@ const tableAutoHeight = {
142279
142279
  }
142280
142280
 
142281
142281
  };
142282
+ ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/init.js
142283
+ /** 弹框初始化 */
142284
+ function init(el, binding, vNode) {
142285
+ //初始化弹框属性
142286
+ initAttrs(el, binding, vNode); // 初始化弹框位置
142287
+
142288
+ initPostion(el, binding, vNode);
142289
+ }
142290
+ /** 初始化弹框属性 */
142291
+
142292
+ function initAttrs(el, binding, vNode) {
142293
+ const dialogInstance = vNode.componentInstance; // 禁止用户点击外侧关闭弹框
142294
+ // dialogInstance.closeOnClickModal = false
142295
+ }
142296
+ /** 第一次打开弹框时初始化弹框位置 */
142297
+
142298
+ function initPostion(el, binding, vNode) {
142299
+ let hasInit = false;
142300
+
142301
+ const initFn = el => {
142302
+ const dragDom = el.querySelector('.el-dialog');
142303
+ const offsetLeft = dragDom.offsetLeft;
142304
+ const dargDomWidth = dragDom.clientWidth;
142305
+ const dargDomHeight = dragDom.clientHeight;
142306
+ dragDom.style.width = dargDomWidth + 'px';
142307
+ dragDom.style.height = dargDomHeight + 'px';
142308
+ dragDom.style.marginLeft = offsetLeft + 'px';
142309
+ };
142310
+
142311
+ const vm = vNode.context;
142312
+ const dialogInstance = vNode.componentInstance;
142313
+ vm.$watch(() => {
142314
+ return dialogInstance.visible;
142315
+ }, newVal => {
142316
+ if (!hasInit && newVal) {
142317
+ initFn(el);
142318
+ hasInit = true;
142319
+ }
142320
+ }, {
142321
+ immediate: true
142322
+ });
142323
+ }
142282
142324
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/drag.js
142283
142325
  /** 弹框支持拖拽 */
142284
- function drag(el, binding, vnode) {
142326
+ function drag(el, binding, vNode) {
142285
142327
  const dragDom = el.querySelector('.el-dialog');
142286
142328
  const dialogHeaderEl = el.querySelector('.el-dialog__header');
142287
142329
  dragDom.style.overflow = 'auto';
142288
- dialogHeaderEl.style.cursor = 'move'; // dragDom.style.cssText += ';top:0px;'
142289
-
142330
+ dialogHeaderEl.style.cursor = 'move';
142290
142331
  /**
142291
142332
  * 获取原有属性
142292
142333
  * IE dom元素.currentStyle
@@ -142310,12 +142351,12 @@ function drag(el, binding, vnode) {
142310
142351
 
142311
142352
  let styL, styT; // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
142312
142353
 
142313
- if (!sty.left.includes('%')) {
142314
- styL = +sty.left.replace(/\px/g, '');
142315
- styT = +sty.top.replace(/\px/g, '');
142354
+ if (!sty.marginLeft.includes('%')) {
142355
+ styL = +sty.marginLeft.replace(/\px/g, '');
142356
+ styT = +sty.marginTop.replace(/\px/g, '');
142316
142357
  } else {
142317
- styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
142318
- styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
142358
+ styL = +document.body.clientWidth * (+sty.marginLeft.replace(/\%/g, '') / 100);
142359
+ styT = +document.body.clientHeight * (+sty.marginTop.replace(/\%/g, '') / 100);
142319
142360
  }
142320
142361
 
142321
142362
  document.onmousemove = function (e) {
@@ -142334,15 +142375,16 @@ function drag(el, binding, vnode) {
142334
142375
  } else if (top > maxDragDomTop) {
142335
142376
  top = maxDragDomTop;
142336
142377
  } // 移动当前元素
142337
- // dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
142338
142378
 
142339
142379
 
142340
- dragDom.style.top = `${top + styT}px`;
142341
- dragDom.style.left = `${left + styL}px`;
142342
- vnode.child.$emit('dragDialog');
142380
+ dragDom.style.marginTop = `${top + styT}px`;
142381
+ dragDom.style.marginLeft = `${left + styL}px`;
142382
+ dragDom.style.userSelect = 'none';
142383
+ vNode.child.$emit('dragDialog');
142343
142384
  };
142344
142385
 
142345
142386
  document.onmouseup = function () {
142387
+ dragDom.style.userSelect = 'auto';
142346
142388
  document.onmousemove = null;
142347
142389
  document.onmouseup = null;
142348
142390
  };
@@ -142352,21 +142394,39 @@ function drag(el, binding, vnode) {
142352
142394
  }
142353
142395
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/resize.js
142354
142396
  /** 弹框拖拽改变大小 */
142355
- function resize(el, binding, value) {
142397
+ function resize(el, binding, vNode) {
142356
142398
  const minWidth = 400;
142357
- const minHeight = 400;
142399
+ const minHeight = 250;
142358
142400
  const dragDom = el.querySelector('.el-dialog');
142401
+ const dialogHeaderEl = el.querySelector('.el-dialog__header');
142402
+
142403
+ const setDragDomWidth = (marginLeft, newWidth) => {
142404
+ if (marginLeft > 0 && newWidth > minWidth && marginLeft + newWidth <= document.body.clientWidth) {
142405
+ dragDom.style.marginLeft = marginLeft + 'px';
142406
+ dragDom.style.width = newWidth + 'px';
142407
+ }
142408
+ };
142409
+
142410
+ const setDragDomHeight = newHeight => {
142411
+ if (newHeight + dragDom.offsetTop <= document.body.clientHeight && newHeight >= minHeight) {
142412
+ dragDom.style.height = newHeight + 'px';
142413
+ }
142414
+ };
142359
142415
 
142360
142416
  dragDom.onmousemove = function (e) {
142361
142417
  // 图标变换
142362
- if (dragDom.offsetLeft + 10 > e.clientX) {
142363
- dragDom.style.cursor = 'w-resize';
142364
- } else if (e.clientX > dragDom.offsetLeft + dragDom.clientWidth - 10) {
142365
- dragDom.style.cursor = 'e-resize';
142366
- } else if (el.scrollTop + e.clientY > dragDom.offsetTop + dragDom.clientHeight - 10) {
142418
+ const isLeft = dragDom.offsetLeft + 10 > e.clientX;
142419
+ const isRight = e.clientX > dragDom.offsetLeft + dragDom.clientWidth - 10;
142420
+ const isBottom = el.scrollTop + e.clientY > dragDom.offsetTop + dragDom.clientHeight - 10;
142421
+
142422
+ if (isLeft) {
142423
+ dragDom.style.cursor = isBottom ? 'nesw-resize' : 'w-resize';
142424
+ } else if (isRight) {
142425
+ dragDom.style.cursor = isBottom ? 'nwse-resize' : 'e-resize';
142426
+ } else if (isBottom) {
142367
142427
  dragDom.style.cursor = 's-resize';
142368
142428
  } else {
142369
- dragDom.style.cursor = 'default';
142429
+ dragDom.style.cursor = 'auto';
142370
142430
  dragDom.onmousedown = null;
142371
142431
  } // 改变大小
142372
142432
 
@@ -142374,72 +142434,68 @@ function resize(el, binding, value) {
142374
142434
  dragDom.onmousedown = e => {
142375
142435
  const clientX = e.clientX;
142376
142436
  const clientY = e.clientY;
142377
- let elW = dragDom.clientWidth;
142378
- let elH = dragDom.clientHeight;
142379
- let EloffsetLeft = dragDom.offsetLeft;
142380
- let EloffsetTop = dragDom.offsetTop;
142381
- dragDom.style.userSelect = 'none';
142382
- let ELscrollTop = el.scrollTop; // 判断点击的位置是不是为头部
142437
+ const elW = dragDom.clientWidth;
142438
+ const elH = dragDom.clientHeight;
142439
+ const ELscrollTop = el.scrollTop;
142440
+ const EloffsetTop = dragDom.offsetTop;
142441
+ const EloffsetLeft = dragDom.offsetLeft; // 判断点击的位置是不是为头部
142383
142442
 
142384
- if (clientX > EloffsetLeft && clientX < EloffsetLeft + elW && clientY > EloffsetTop && clientY < EloffsetTop + 100) {// 如果是头部在此就不做任何动作,以上有绑定dialogHeaderEl.onmousedown = moveDown;
142443
+ if (clientX > EloffsetLeft && clientX < EloffsetLeft + elW && clientY > EloffsetTop && clientY < EloffsetTop + dialogHeaderEl.clientHeight) {// 如果是头部在此就不做任何动作,以上有绑定dialogHeaderEl.onmousedown = moveDown;
142385
142444
  } else {
142386
142445
  document.onmousemove = function (e) {
142387
- e.preventDefault(); // 移动时禁用默认事件
142446
+ // e.preventDefault()
142388
142447
  // 左侧鼠标拖拽位置
142389
-
142390
142448
  if (clientX > EloffsetLeft && clientX < EloffsetLeft + 10) {
142391
- // 往左拖拽
142449
+ dragDom.style.userSelect = 'none'; // 往左拖拽
142450
+
142392
142451
  if (clientX > e.clientX) {
142393
- dragDom.style.width = elW + (clientX - e.clientX) * 2 + 'px';
142452
+ const moveLen = clientX - e.clientX;
142453
+ setDragDomWidth(EloffsetLeft - moveLen, elW + moveLen);
142394
142454
  } // 往右拖拽
142395
142455
 
142396
142456
 
142397
142457
  if (clientX < e.clientX) {
142398
- if (dragDom.clientWidth < minWidth) {
142399
- console.log();
142400
- } else {
142401
- dragDom.style.width = elW - (e.clientX - clientX) * 2 + 'px';
142402
- }
142458
+ const moveLen = e.clientX - clientX;
142459
+ setDragDomWidth(EloffsetLeft + moveLen, elW - moveLen);
142403
142460
  }
142404
142461
  } // 右侧鼠标拖拽位置
142405
142462
 
142406
142463
 
142407
142464
  if (clientX > EloffsetLeft + elW - 10 && clientX < EloffsetLeft + elW) {
142408
- // 往左拖拽
142465
+ dragDom.style.userSelect = 'none'; // 往左拖拽
142466
+
142409
142467
  if (clientX > e.clientX) {
142410
- if (dragDom.clientWidth < minWidth) {
142411
- console.log();
142412
- } else {
142413
- dragDom.style.width = elW - (clientX - e.clientX) * 2 + 'px';
142414
- }
142468
+ const moveLen = clientX - e.clientX;
142469
+ setDragDomWidth(EloffsetLeft, elW - moveLen);
142415
142470
  } // 往右拖拽
142416
142471
 
142417
142472
 
142418
142473
  if (clientX < e.clientX) {
142419
- dragDom.style.width = elW + (e.clientX - clientX) * 2 + 'px';
142474
+ const moveLen = e.clientX - clientX;
142475
+ setDragDomWidth(EloffsetLeft, elW + moveLen);
142420
142476
  }
142421
142477
  } // 底部鼠标拖拽位置
142422
142478
 
142423
142479
 
142424
142480
  if (ELscrollTop + clientY > EloffsetTop + elH - 20 && ELscrollTop + clientY < EloffsetTop + elH) {
142425
- // 往上拖拽
142481
+ dragDom.style.userSelect = 'none'; // 往上拖拽
142482
+
142426
142483
  if (clientY > e.clientY) {
142427
- if (dragDom.clientHeight < minHeight) {
142428
- console.log();
142429
- } else {
142430
- dragDom.style.height = elH - (clientY - e.clientY) * 2 + 'px';
142431
- }
142484
+ const moveLen = clientY - e.clientY;
142485
+ setDragDomHeight(elH - moveLen);
142432
142486
  } // 往下拖拽
142433
142487
 
142434
142488
 
142435
142489
  if (clientY < e.clientY) {
142436
- dragDom.style.height = elH + (e.clientY - clientY) * 2 + 'px';
142490
+ const moveLen = e.clientY - clientY;
142491
+ setDragDomHeight(elH + moveLen);
142437
142492
  }
142438
142493
  }
142439
142494
  }; // 拉伸结束
142440
142495
 
142441
142496
 
142442
142497
  document.onmouseup = function (e) {
142498
+ dragDom.style.userSelect = 'auto';
142443
142499
  document.onmousemove = null;
142444
142500
  document.onmouseup = null;
142445
142501
  };
@@ -142449,15 +142505,15 @@ function resize(el, binding, value) {
142449
142505
  }
142450
142506
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/js/full.js
142451
142507
  /** 弹框支持全屏 */
142452
- function fullScreen(el, binding, vnode) {
142453
- //当前宽高
142508
+ function fullScreen(el, binding, vNode) {
142509
+ const timeout = 0.3;
142454
142510
  let nowWidth = 0;
142455
- let nowHight = 0; //当前顶部高度
142456
-
142511
+ let nowHight = 0;
142457
142512
  let nowMarginTop = 0;
142513
+ let nowMarginLeft = 0;
142458
142514
  let isFullScreen = false;
142459
- const dialogHeaderEl = el.querySelector('.el-dialog__header');
142460
142515
  const dragDom = el.querySelector('.el-dialog');
142516
+ const dialogHeaderEl = el.querySelector('.el-dialog__header');
142461
142517
 
142462
142518
  dialogHeaderEl.ondblclick = e => {
142463
142519
  if (isFullScreen == false) {
@@ -142465,19 +142521,27 @@ function fullScreen(el, binding, vnode) {
142465
142521
  nowHight = dragDom.clientHeight;
142466
142522
  nowWidth = dragDom.clientWidth;
142467
142523
  nowMarginTop = dragDom.style.marginTop;
142524
+ nowMarginLeft = dragDom.style.marginLeft;
142468
142525
  dragDom.style.left = 0;
142469
142526
  dragDom.style.top = 0;
142470
142527
  dragDom.style.height = '100vh';
142471
142528
  dragDom.style.width = '100vw';
142472
142529
  dragDom.style.marginTop = 0;
142473
- dialogHeaderEl.style.cursor = 'initial'; // TODO: dialogHeaderEl.onmousedown = null
142530
+ dragDom.style.marginLeft = 0;
142531
+ dialogHeaderEl.style.cursor = 'initial';
142474
142532
  } else {
142475
142533
  isFullScreen = false;
142476
- dragDom.style.height = 'auto';
142477
142534
  dragDom.style.width = nowWidth + 'px';
142535
+ dragDom.style.height = nowHight + 'px';
142478
142536
  dragDom.style.marginTop = nowMarginTop;
142479
- dialogHeaderEl.style.cursor = 'move'; // TODO: dialogHeaderEl.onmousedown = moveDown
142537
+ dragDom.style.marginLeft = nowMarginLeft;
142538
+ dialogHeaderEl.style.cursor = 'move';
142480
142539
  }
142540
+
142541
+ dragDom.style.transition = `all ${timeout}s linear`;
142542
+ setTimeout(() => {
142543
+ dragDom.style.transition = 'none';
142544
+ }, timeout * 1000);
142481
142545
  };
142482
142546
  }
142483
142547
  ;// CONCATENATED MODULE: ./src/directives/modules/el-dialog-drag/index.js
@@ -142488,14 +142552,17 @@ function fullScreen(el, binding, vnode) {
142488
142552
 
142489
142553
 
142490
142554
 
142555
+
142491
142556
  const ElDialogDrag = {
142492
- bind(el, binding, vnode) {
142493
- // 弹框可拖拽
142494
- drag(el, binding, vnode); // 弹框可拖拽大小
142557
+ bind(el, binding, vNode) {
142558
+ // 弹框初始化
142559
+ init(el, binding, vNode); // 弹框可拖拽
142495
142560
 
142496
- resize(el, binding, vnode); // 弹框可全屏
142561
+ drag(el, binding, vNode); // 弹框可拖拽大小
142497
142562
 
142498
- fullScreen(el, binding, vnode);
142563
+ resize(el, binding, vNode); // 弹框可全屏
142564
+
142565
+ fullScreen(el, binding, vNode);
142499
142566
  }
142500
142567
 
142501
142568
  };
@@ -244332,8 +244399,8 @@ var push_down_component = (0,componentNormalizer/* default */.Z)(
244332
244399
 
244333
244400
  }
244334
244401
  });
244335
- // EXTERNAL MODULE: ./src/directives/index.js + 31 modules
244336
- var directives = __webpack_require__(7183);
244402
+ // EXTERNAL MODULE: ./src/directives/index.js + 33 modules
244403
+ var directives = __webpack_require__(65146);
244337
244404
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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&
244338
244405
  //
244339
244406
  //
@@ -249372,8 +249439,8 @@ const components = [package_t_input, svg_icon, package_tf_widget, package_tf_lay
249372
249439
  const install = function (Vue) {
249373
249440
  components.forEach(component => {
249374
249441
  Vue.component(component.name, component);
249375
- }); // Vue.directive('elDialogDrag', ElDialogDrag)
249376
-
249442
+ });
249443
+ Vue.directive('elDialogDrag', directives/* ElDialogDrag */.Lh);
249377
249444
  Vue.directive('umyColumnWidth', directives/* umyColumnWidth */.AB);
249378
249445
  Vue.directive('umyTableSetting', directives/* umyTableSetting */.b$);
249379
249446
  Vue.directive('tableAutoHeight', directives/* tableAutoHeight */.Cq);