@weitutech/by-components 1.1.174 → 1.1.176

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.
@@ -13,63 +13,6 @@ module.exports = function (it) {
13
13
  };
14
14
 
15
15
 
16
- /***/ }),
17
-
18
- /***/ 38:
19
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
20
-
21
- "use strict";
22
-
23
- var fails = __webpack_require__(9039);
24
- var isCallable = __webpack_require__(4901);
25
- var isObject = __webpack_require__(34);
26
- var create = __webpack_require__(2360);
27
- var getPrototypeOf = __webpack_require__(2787);
28
- var defineBuiltIn = __webpack_require__(6840);
29
- var wellKnownSymbol = __webpack_require__(8227);
30
- var IS_PURE = __webpack_require__(6395);
31
-
32
- var ITERATOR = wellKnownSymbol('iterator');
33
- var BUGGY_SAFARI_ITERATORS = false;
34
-
35
- // `%IteratorPrototype%` object
36
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
37
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
38
-
39
- /* eslint-disable es/no-array-prototype-keys -- safe */
40
- if ([].keys) {
41
- arrayIterator = [].keys();
42
- // Safari 8 has buggy iterators w/o `next`
43
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
44
- else {
45
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
46
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
47
- }
48
- }
49
-
50
- var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
51
- var test = {};
52
- // FF44- legacy iterators case
53
- return IteratorPrototype[ITERATOR].call(test) !== test;
54
- });
55
-
56
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
57
- else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
58
-
59
- // `%IteratorPrototype%[@@iterator]()` method
60
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
61
- if (!isCallable(IteratorPrototype[ITERATOR])) {
62
- defineBuiltIn(IteratorPrototype, ITERATOR, function () {
63
- return this;
64
- });
65
- }
66
-
67
- module.exports = {
68
- IteratorPrototype: IteratorPrototype,
69
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
70
- };
71
-
72
-
73
16
  /***/ }),
74
17
 
75
18
  /***/ 54:
@@ -45264,6 +45207,63 @@ $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
45264
45207
  });
45265
45208
 
45266
45209
 
45210
+ /***/ }),
45211
+
45212
+ /***/ 7657:
45213
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
45214
+
45215
+ "use strict";
45216
+
45217
+ var fails = __webpack_require__(9039);
45218
+ var isCallable = __webpack_require__(4901);
45219
+ var isObject = __webpack_require__(34);
45220
+ var create = __webpack_require__(2360);
45221
+ var getPrototypeOf = __webpack_require__(2787);
45222
+ var defineBuiltIn = __webpack_require__(6840);
45223
+ var wellKnownSymbol = __webpack_require__(8227);
45224
+ var IS_PURE = __webpack_require__(6395);
45225
+
45226
+ var ITERATOR = wellKnownSymbol('iterator');
45227
+ var BUGGY_SAFARI_ITERATORS = false;
45228
+
45229
+ // `%IteratorPrototype%` object
45230
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
45231
+ var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
45232
+
45233
+ /* eslint-disable es/no-array-prototype-keys -- safe */
45234
+ if ([].keys) {
45235
+ arrayIterator = [].keys();
45236
+ // Safari 8 has buggy iterators w/o `next`
45237
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
45238
+ else {
45239
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
45240
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
45241
+ }
45242
+ }
45243
+
45244
+ var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
45245
+ var test = {};
45246
+ // FF44- legacy iterators case
45247
+ return IteratorPrototype[ITERATOR].call(test) !== test;
45248
+ });
45249
+
45250
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
45251
+ else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
45252
+
45253
+ // `%IteratorPrototype%[@@iterator]()` method
45254
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
45255
+ if (!isCallable(IteratorPrototype[ITERATOR])) {
45256
+ defineBuiltIn(IteratorPrototype, ITERATOR, function () {
45257
+ return this;
45258
+ });
45259
+ }
45260
+
45261
+ module.exports = {
45262
+ IteratorPrototype: IteratorPrototype,
45263
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
45264
+ };
45265
+
45266
+
45267
45267
  /***/ }),
45268
45268
 
45269
45269
  /***/ 7669:
@@ -46676,7 +46676,7 @@ var createProperty = __webpack_require__(4659);
46676
46676
  var fails = __webpack_require__(9039);
46677
46677
  var hasOwn = __webpack_require__(9297);
46678
46678
  var wellKnownSymbol = __webpack_require__(8227);
46679
- var IteratorPrototype = (__webpack_require__(38).IteratorPrototype);
46679
+ var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
46680
46680
  var DESCRIPTORS = __webpack_require__(3724);
46681
46681
  var IS_PURE = __webpack_require__(6395);
46682
46682
 
@@ -71515,7 +71515,7 @@ var defineBuiltIns = __webpack_require__(6279);
71515
71515
  var wellKnownSymbol = __webpack_require__(8227);
71516
71516
  var InternalStateModule = __webpack_require__(1181);
71517
71517
  var getMethod = __webpack_require__(5966);
71518
- var IteratorPrototype = (__webpack_require__(38).IteratorPrototype);
71518
+ var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
71519
71519
  var createIterResultObject = __webpack_require__(2529);
71520
71520
  var iteratorClose = __webpack_require__(9539);
71521
71521
  var iteratorCloseAll = __webpack_require__(1385);
@@ -74524,8 +74524,8 @@ var component = normalizeComponent(
74524
74524
  )
74525
74525
 
74526
74526
  /* harmony default export */ var pager = (component.exports);
74527
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=6b5adccc
74528
- var tablevue_type_template_id_6b5adccc_render = function render() {
74527
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=35ba1298
74528
+ var tablevue_type_template_id_35ba1298_render = function render() {
74529
74529
  var _vm = this,
74530
74530
  _c = _vm._self._c;
74531
74531
  return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
@@ -74609,7 +74609,7 @@ var tablevue_type_template_id_6b5adccc_render = function render() {
74609
74609
  }
74610
74610
  }) : _vm._e()], 1);
74611
74611
  };
74612
- var tablevue_type_template_id_6b5adccc_staticRenderFns = [];
74612
+ var tablevue_type_template_id_35ba1298_staticRenderFns = [];
74613
74613
 
74614
74614
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
74615
74615
  var es_array_push = __webpack_require__(4114);
@@ -76773,6 +76773,9 @@ var custom_column_component = normalizeComponent(
76773
76773
  // 为表头补充tooltips展示能力
76774
76774
  newColumns = this.applyColumnTooltips(newColumns);
76775
76775
 
76776
+ // 为列应用默认的对齐方式(如果列本身没有配置)
76777
+ newColumns = this.applyDefaultAlign(newColumns);
76778
+
76776
76779
  // 处理前端分页和虚拟滚动
76777
76780
  let data = others.data || [];
76778
76781
  if ((_others$pagerConfig = others.pagerConfig) !== null && _others$pagerConfig !== void 0 && _others$pagerConfig.frontendPagination || (_others$sortConfig = others.sortConfig) !== null && _others$sortConfig !== void 0 && _others$sortConfig.frontendSort) {
@@ -76816,8 +76819,9 @@ var custom_column_component = normalizeComponent(
76816
76819
  } : {
76817
76820
  height: 720
76818
76821
  }),
76819
- // 表格级别的默认对齐:headerAlign 默认居中,align 默认居左(如果外部有配置,以外部配置为准)
76820
- align: 'center',
76822
+ // 表格级别的默认对齐:如果外部有配置,以外部配置为准,否则使用默认值
76823
+ align: this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center',
76824
+ headerAlign: this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center',
76821
76825
  copyFields: this.gridOptions.copyFields || [],
76822
76826
  emptyText: this.gridOptions.emptyText || '暂无数据',
76823
76827
  loading: this.loading,
@@ -76967,6 +76971,34 @@ var custom_column_component = normalizeComponent(
76967
76971
  return newColumn;
76968
76972
  });
76969
76973
  },
76974
+ /**
76975
+ * 为列应用默认的对齐方式(如果列本身没有配置)
76976
+ * @param {Array} columns
76977
+ */
76978
+ applyDefaultAlign(columns) {
76979
+ if (!Array.isArray(columns)) return columns;
76980
+ const defaultAlign = this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center';
76981
+ const defaultHeaderAlign = this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center';
76982
+ return columns.map(column => {
76983
+ const newColumn = {
76984
+ ...column
76985
+ };
76986
+ if (Array.isArray(newColumn.children) && newColumn.children.length) {
76987
+ newColumn.children = this.applyDefaultAlign(newColumn.children);
76988
+ }
76989
+
76990
+ // 如果列没有配置 align,应用默认值
76991
+ if (newColumn.align === undefined || newColumn.align === null) {
76992
+ newColumn.align = defaultAlign;
76993
+ }
76994
+
76995
+ // 如果列没有配置 headerAlign,应用默认值(只有有 field 的列才需要 headerAlign)
76996
+ if (newColumn.field && (newColumn.headerAlign === undefined || newColumn.headerAlign === null)) {
76997
+ newColumn.headerAlign = defaultHeaderAlign;
76998
+ }
76999
+ return newColumn;
77000
+ });
77001
+ },
76970
77002
  /**
76971
77003
  * 规范化列配置上的tooltips字段
76972
77004
  * @param {string|Object} tooltips
@@ -77187,8 +77219,8 @@ var custom_column_component = normalizeComponent(
77187
77219
  if (item.align !== undefined && item.align !== null) {
77188
77220
  return item.align;
77189
77221
  }
77190
- if (item.headerAlign !== undefined && item.headerAlign !== null) {
77191
- return item.headerAlign;
77222
+ if (this.gridOptions.align !== undefined && this.gridOptions.align !== null) {
77223
+ return this.gridOptions.align;
77192
77224
  }
77193
77225
  return 'center';
77194
77226
  },
@@ -77196,8 +77228,8 @@ var custom_column_component = normalizeComponent(
77196
77228
  if (item.headerAlign !== undefined && item.headerAlign !== null) {
77197
77229
  return item.headerAlign;
77198
77230
  }
77199
- if (item.align !== undefined && item.align !== null) {
77200
- return item.align;
77231
+ if (this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null) {
77232
+ return this.gridOptions.headerAlign;
77201
77233
  }
77202
77234
  return 'center';
77203
77235
  },
@@ -77495,8 +77527,8 @@ var custom_column_component = normalizeComponent(
77495
77527
  ;
77496
77528
  var table_component = normalizeComponent(
77497
77529
  components_tablevue_type_script_lang_js,
77498
- tablevue_type_template_id_6b5adccc_render,
77499
- tablevue_type_template_id_6b5adccc_staticRenderFns,
77530
+ tablevue_type_template_id_35ba1298_render,
77531
+ tablevue_type_template_id_35ba1298_staticRenderFns,
77500
77532
  false,
77501
77533
  null,
77502
77534
  null,
@@ -74534,8 +74534,8 @@ var component = normalizeComponent(
74534
74534
  )
74535
74535
 
74536
74536
  /* harmony default export */ var pager = (component.exports);
74537
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=6b5adccc
74538
- var tablevue_type_template_id_6b5adccc_render = function render() {
74537
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=35ba1298
74538
+ var tablevue_type_template_id_35ba1298_render = function render() {
74539
74539
  var _vm = this,
74540
74540
  _c = _vm._self._c;
74541
74541
  return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
@@ -74619,7 +74619,7 @@ var tablevue_type_template_id_6b5adccc_render = function render() {
74619
74619
  }
74620
74620
  }) : _vm._e()], 1);
74621
74621
  };
74622
- var tablevue_type_template_id_6b5adccc_staticRenderFns = [];
74622
+ var tablevue_type_template_id_35ba1298_staticRenderFns = [];
74623
74623
 
74624
74624
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
74625
74625
  var es_array_push = __webpack_require__(4114);
@@ -76783,6 +76783,9 @@ var custom_column_component = normalizeComponent(
76783
76783
  // 为表头补充tooltips展示能力
76784
76784
  newColumns = this.applyColumnTooltips(newColumns);
76785
76785
 
76786
+ // 为列应用默认的对齐方式(如果列本身没有配置)
76787
+ newColumns = this.applyDefaultAlign(newColumns);
76788
+
76786
76789
  // 处理前端分页和虚拟滚动
76787
76790
  let data = others.data || [];
76788
76791
  if ((_others$pagerConfig = others.pagerConfig) !== null && _others$pagerConfig !== void 0 && _others$pagerConfig.frontendPagination || (_others$sortConfig = others.sortConfig) !== null && _others$sortConfig !== void 0 && _others$sortConfig.frontendSort) {
@@ -76826,8 +76829,9 @@ var custom_column_component = normalizeComponent(
76826
76829
  } : {
76827
76830
  height: 720
76828
76831
  }),
76829
- // 表格级别的默认对齐:headerAlign 默认居中,align 默认居左(如果外部有配置,以外部配置为准)
76830
- align: 'center',
76832
+ // 表格级别的默认对齐:如果外部有配置,以外部配置为准,否则使用默认值
76833
+ align: this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center',
76834
+ headerAlign: this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center',
76831
76835
  copyFields: this.gridOptions.copyFields || [],
76832
76836
  emptyText: this.gridOptions.emptyText || '暂无数据',
76833
76837
  loading: this.loading,
@@ -76977,6 +76981,34 @@ var custom_column_component = normalizeComponent(
76977
76981
  return newColumn;
76978
76982
  });
76979
76983
  },
76984
+ /**
76985
+ * 为列应用默认的对齐方式(如果列本身没有配置)
76986
+ * @param {Array} columns
76987
+ */
76988
+ applyDefaultAlign(columns) {
76989
+ if (!Array.isArray(columns)) return columns;
76990
+ const defaultAlign = this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center';
76991
+ const defaultHeaderAlign = this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center';
76992
+ return columns.map(column => {
76993
+ const newColumn = {
76994
+ ...column
76995
+ };
76996
+ if (Array.isArray(newColumn.children) && newColumn.children.length) {
76997
+ newColumn.children = this.applyDefaultAlign(newColumn.children);
76998
+ }
76999
+
77000
+ // 如果列没有配置 align,应用默认值
77001
+ if (newColumn.align === undefined || newColumn.align === null) {
77002
+ newColumn.align = defaultAlign;
77003
+ }
77004
+
77005
+ // 如果列没有配置 headerAlign,应用默认值(只有有 field 的列才需要 headerAlign)
77006
+ if (newColumn.field && (newColumn.headerAlign === undefined || newColumn.headerAlign === null)) {
77007
+ newColumn.headerAlign = defaultHeaderAlign;
77008
+ }
77009
+ return newColumn;
77010
+ });
77011
+ },
76980
77012
  /**
76981
77013
  * 规范化列配置上的tooltips字段
76982
77014
  * @param {string|Object} tooltips
@@ -77197,8 +77229,8 @@ var custom_column_component = normalizeComponent(
77197
77229
  if (item.align !== undefined && item.align !== null) {
77198
77230
  return item.align;
77199
77231
  }
77200
- if (item.headerAlign !== undefined && item.headerAlign !== null) {
77201
- return item.headerAlign;
77232
+ if (this.gridOptions.align !== undefined && this.gridOptions.align !== null) {
77233
+ return this.gridOptions.align;
77202
77234
  }
77203
77235
  return 'center';
77204
77236
  },
@@ -77206,8 +77238,8 @@ var custom_column_component = normalizeComponent(
77206
77238
  if (item.headerAlign !== undefined && item.headerAlign !== null) {
77207
77239
  return item.headerAlign;
77208
77240
  }
77209
- if (item.align !== undefined && item.align !== null) {
77210
- return item.align;
77241
+ if (this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null) {
77242
+ return this.gridOptions.headerAlign;
77211
77243
  }
77212
77244
  return 'center';
77213
77245
  },
@@ -77505,8 +77537,8 @@ var custom_column_component = normalizeComponent(
77505
77537
  ;
77506
77538
  var table_component = normalizeComponent(
77507
77539
  components_tablevue_type_script_lang_js,
77508
- tablevue_type_template_id_6b5adccc_render,
77509
- tablevue_type_template_id_6b5adccc_staticRenderFns,
77540
+ tablevue_type_template_id_35ba1298_render,
77541
+ tablevue_type_template_id_35ba1298_staticRenderFns,
77510
77542
  false,
77511
77543
  null,
77512
77544
  null,