@weitutech/by-components 1.1.106 → 1.1.107

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.
@@ -2330,7 +2330,7 @@ module.exports = !fails(function () {
2330
2330
 
2331
2331
  "use strict";
2332
2332
 
2333
- var isPrototypeOf = __webpack_require__(1625);
2333
+ var isPrototypeOf = __webpack_require__(4006);
2334
2334
 
2335
2335
  var $TypeError = TypeError;
2336
2336
 
@@ -2532,7 +2532,7 @@ module.exports = Math.trunc || function trunc(x) {
2532
2532
 
2533
2533
  var getBuiltIn = __webpack_require__(7751);
2534
2534
  var isCallable = __webpack_require__(4901);
2535
- var isPrototypeOf = __webpack_require__(1625);
2535
+ var isPrototypeOf = __webpack_require__(4006);
2536
2536
  var USE_SYMBOL_AS_UID = __webpack_require__(7040);
2537
2537
 
2538
2538
  var $Object = Object;
@@ -9021,18 +9021,6 @@ module.exports = /******/function (modules) {
9021
9021
  /******/
9022
9022
  });
9023
9023
 
9024
- /***/ }),
9025
-
9026
- /***/ 1625:
9027
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
9028
-
9029
- "use strict";
9030
-
9031
- var uncurryThis = __webpack_require__(9504);
9032
-
9033
- module.exports = uncurryThis({}.isPrototypeOf);
9034
-
9035
-
9036
9024
  /***/ }),
9037
9025
 
9038
9026
  /***/ 1631:
@@ -13004,7 +12992,7 @@ var anObject = __webpack_require__(8551);
13004
12992
  var tryToString = __webpack_require__(6823);
13005
12993
  var isArrayIteratorMethod = __webpack_require__(4209);
13006
12994
  var lengthOfArrayLike = __webpack_require__(6198);
13007
- var isPrototypeOf = __webpack_require__(1625);
12995
+ var isPrototypeOf = __webpack_require__(4006);
13008
12996
  var getIterator = __webpack_require__(81);
13009
12997
  var getIteratorMethod = __webpack_require__(851);
13010
12998
  var iteratorClose = __webpack_require__(9539);
@@ -27341,6 +27329,18 @@ module.exports = deepmerge_1;
27341
27329
  return ky;
27342
27330
  });
27343
27331
 
27332
+ /***/ }),
27333
+
27334
+ /***/ 4006:
27335
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
27336
+
27337
+ "use strict";
27338
+
27339
+ var uncurryThis = __webpack_require__(9504);
27340
+
27341
+ module.exports = uncurryThis({}.isPrototypeOf);
27342
+
27343
+
27344
27344
  /***/ }),
27345
27345
 
27346
27346
  /***/ 4054:
@@ -76944,8 +76944,8 @@ var ByTreeSearch_component = normalizeComponent(
76944
76944
  )
76945
76945
 
76946
76946
  /* harmony default export */ var ByTreeSearch = (ByTreeSearch_component.exports);
76947
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-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/by-dialog/ByDialog.vue?vue&type=template&id=571b0f54
76948
- var ByDialogvue_type_template_id_571b0f54_render = function render() {
76947
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-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/by-dialog/ByDialog.vue?vue&type=template&id=bc06eb78
76948
+ var ByDialogvue_type_template_id_bc06eb78_render = function render() {
76949
76949
  var _vm = this,
76950
76950
  _c = _vm._self._c;
76951
76951
  return _c('el-dialog', _vm._g(_vm._b({
@@ -76967,7 +76967,8 @@ var ByDialogvue_type_template_id_571b0f54_render = function render() {
76967
76967
  }, [_vm._t("header")], 2) : _vm._e(), _c('div', {
76968
76968
  class: ['by-dialog__body', {
76969
76969
  'by-dialog__body--with-header': !!_vm.$slots.header
76970
- }]
76970
+ }],
76971
+ style: _vm.bodyStyle
76971
76972
  }, [_vm.content ? _c('div', {
76972
76973
  staticClass: "by-dialog__content"
76973
76974
  }, [_vm._v(_vm._s(_vm.content))]) : _vm._e(), _vm._t("default")], 2), _vm.showFooter ? _c('div', {
@@ -77016,7 +77017,7 @@ var ByDialogvue_type_template_id_571b0f54_render = function render() {
77016
77017
  }, [_vm._v(" " + _vm._s(button.text) + " ")])];
77017
77018
  })], 2) : _vm._e()]), _vm._t("footer")], 2) : _vm._e()]);
77018
77019
  };
77019
- var ByDialogvue_type_template_id_571b0f54_staticRenderFns = [];
77020
+ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77020
77021
 
77021
77022
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./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/by-dialog/ByDialog.vue?vue&type=script&lang=js
77022
77023
 
@@ -77034,6 +77035,21 @@ var ByDialogvue_type_template_id_571b0f54_staticRenderFns = [];
77034
77035
  type: String,
77035
77036
  default: '600px'
77036
77037
  },
77038
+ // 大高度时自动收紧与顶部的距离(不影响默认行为)
77039
+ autoAdjustTop: {
77040
+ type: Boolean,
77041
+ default: false
77042
+ },
77043
+ // 内容区固定高度(可选,优先级高于 maxHeight),支持 px/vh/%
77044
+ bodyHeight: {
77045
+ type: [String, Number],
77046
+ default: undefined
77047
+ },
77048
+ // 内容区最大高度(可选),支持 px/vh/%
77049
+ bodyMaxHeight: {
77050
+ type: [String, Number],
77051
+ default: undefined
77052
+ },
77037
77053
  // 标题
77038
77054
  title: {
77039
77055
  type: String,
@@ -77103,11 +77119,43 @@ var ByDialogvue_type_template_id_571b0f54_staticRenderFns = [];
77103
77119
  } = this.$attrs;
77104
77120
  return {
77105
77121
  width: this.width,
77106
- top: '15vh',
77122
+ top: this.computedTop,
77107
77123
  closeOnClickModal: this.closeOnClickModal,
77108
77124
  ...attrs
77109
77125
  };
77110
77126
  },
77127
+ computedTop() {
77128
+ if (!this.autoAdjustTop) return '15vh';
77129
+ const toNumber = val => {
77130
+ if (typeof val === 'number') return val;
77131
+ if (typeof val === 'string') {
77132
+ if (val.endsWith('px')) return parseFloat(val);
77133
+ // 对于百分比和其他单位不做换算,返回 NaN 以忽略
77134
+ return parseFloat(val);
77135
+ }
77136
+ return NaN;
77137
+ };
77138
+ const isLargeByPx = px => !isNaN(px) && px >= 600;
77139
+ const isLargeByVh = val => typeof val === 'string' && val.includes('vh') && parseFloat(val) >= 70;
77140
+ const heightPx = toNumber(this.bodyHeight);
77141
+ const maxHeightVal = this.bodyMaxHeight;
77142
+ const largeHeight = isLargeByPx(heightPx) || isLargeByVh(this.bodyHeight);
77143
+ const largeMaxHeight = isLargeByVh(maxHeightVal) || isLargeByPx(toNumber(maxHeightVal));
77144
+ if (largeHeight || largeMaxHeight) {
77145
+ return '8vh';
77146
+ }
77147
+ return '15vh';
77148
+ },
77149
+ bodyStyle() {
77150
+ const style = {};
77151
+ if (this.bodyHeight !== undefined && this.bodyHeight !== '') {
77152
+ style.height = typeof this.bodyHeight === 'number' ? `${this.bodyHeight}px` : this.bodyHeight;
77153
+ }
77154
+ if (this.bodyMaxHeight !== undefined && this.bodyMaxHeight !== '') {
77155
+ style.maxHeight = typeof this.bodyMaxHeight === 'number' ? `${this.bodyMaxHeight}px` : this.bodyMaxHeight;
77156
+ }
77157
+ return style;
77158
+ },
77111
77159
  // 左侧按钮
77112
77160
  leftButtons() {
77113
77161
  return this.buttons.filter(button => button.position === 'left');
@@ -77165,8 +77213,8 @@ var ByDialogvue_type_template_id_571b0f54_staticRenderFns = [];
77165
77213
  ;
77166
77214
  var ByDialog_component = normalizeComponent(
77167
77215
  by_dialog_ByDialogvue_type_script_lang_js,
77168
- ByDialogvue_type_template_id_571b0f54_render,
77169
- ByDialogvue_type_template_id_571b0f54_staticRenderFns,
77216
+ ByDialogvue_type_template_id_bc06eb78_render,
77217
+ ByDialogvue_type_template_id_bc06eb78_staticRenderFns,
77170
77218
  false,
77171
77219
  null,
77172
77220
  null,