@weitutech/by-components 1.1.214 → 1.1.216

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.
@@ -78756,8 +78756,8 @@ var pair_number_input_component = normalizeComponent(
78756
78756
  )
78757
78757
 
78758
78758
  /* harmony default export */ var pair_number_input = (pair_number_input_component.exports);
78759
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-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/form/comps/custom-date-picker.vue?vue&type=template&id=dd2e875c
78760
- var custom_date_pickervue_type_template_id_dd2e875c_render = function render() {
78759
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-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/form/comps/custom-date-picker.vue?vue&type=template&id=6ad43c6f
78760
+ var custom_date_pickervue_type_template_id_6ad43c6f_render = function render() {
78761
78761
  var _vm = this,
78762
78762
  _c = _vm._self._c;
78763
78763
  return _c('div', {
@@ -78790,8 +78790,18 @@ var custom_date_pickervue_type_template_id_dd2e875c_render = function render() {
78790
78790
  }
78791
78791
  }
78792
78792
  }, [_vm._v(" " + _vm._s(item.label) + " ")]);
78793
- }), 0)] : _c('el-date-picker', _vm._b({
78793
+ }), 0)] : _c('div', {
78794
+ ref: "panelInputWrap",
78795
+ staticClass: "b-picker__panel-input-wrap",
78796
+ class: {
78797
+ 'is-clearable': _vm.dateOptions.clearable !== false
78798
+ }
78799
+ }, [_c('el-date-picker', _vm._b({
78794
78800
  ref: "panelDatePicker",
78801
+ class: {
78802
+ 'has-shortcut-tag': !!_vm.activeShortcutLabel,
78803
+ 'has-shortcut-tag--vertical': !!_vm.activeShortcutLabel && _vm.shortcutTagVertical
78804
+ },
78795
78805
  attrs: {
78796
78806
  "value": _vm.value,
78797
78807
  "popper-class": _vm.panelPopperClass
@@ -78805,9 +78815,22 @@ var custom_date_pickervue_type_template_id_dd2e875c_render = function render() {
78805
78815
  return _vm.handlePanelOpen.apply(null, arguments);
78806
78816
  }
78807
78817
  }
78808
- }, 'el-date-picker', _vm.panelDateOptions, false))], 2);
78818
+ }, 'el-date-picker', _vm.panelDateOptions, false)), _vm.activeShortcutLabel ? _c('span', {
78819
+ staticClass: "b-picker__shortcut-tag",
78820
+ class: {
78821
+ 'is-vertical': _vm.shortcutTagVertical
78822
+ },
78823
+ attrs: {
78824
+ "title": _vm.activeShortcutLabel
78825
+ }
78826
+ }, [_vm.shortcutTagVertical ? _vm._l(_vm.activeShortcutChars, function (char, index) {
78827
+ return _c('i', {
78828
+ key: index,
78829
+ staticClass: "b-picker__shortcut-tag-char"
78830
+ }, [_vm._v(" " + _vm._s(char) + " ")]);
78831
+ }) : [_vm._v(_vm._s(_vm.activeShortcutLabel))]], 2) : _vm._e()], 1)], 2);
78809
78832
  };
78810
- var custom_date_pickervue_type_template_id_dd2e875c_staticRenderFns = [];
78833
+ var custom_date_pickervue_type_template_id_6ad43c6f_staticRenderFns = [];
78811
78834
 
78812
78835
  // EXTERNAL MODULE: ./node_modules/moment/moment.js
78813
78836
  var moment = __webpack_require__(9412);
@@ -78859,7 +78882,9 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
78859
78882
  data() {
78860
78883
  return {
78861
78884
  active: '',
78862
- panelHighlightTimer: null
78885
+ panelHighlightTimer: null,
78886
+ shortcutTagVertical: false,
78887
+ shortcutTagResizeObserver: null
78863
78888
  };
78864
78889
  },
78865
78890
  computed: {
@@ -78927,12 +78952,21 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
78927
78952
  },
78928
78953
  panelPopperClass() {
78929
78954
  return `by-custom-date-picker-panel by-custom-date-picker-panel--${this._uid}`;
78955
+ },
78956
+ activeShortcutLabel() {
78957
+ if (!this.active) return '';
78958
+ const item = this.shortcuts.find(shortcut => shortcut.key === this.active);
78959
+ return item ? item.label : '';
78960
+ },
78961
+ activeShortcutChars() {
78962
+ return this.activeShortcutLabel.split('');
78930
78963
  }
78931
78964
  },
78932
78965
  watch: {
78933
78966
  active() {
78934
78967
  if (this.shortcutLayout === 'panel') {
78935
78968
  this.schedulePanelShortcutHighlight();
78969
+ this.updateShortcutTagLayout();
78936
78970
  }
78937
78971
  },
78938
78972
  value: {
@@ -78942,8 +78976,14 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
78942
78976
  immediate: true
78943
78977
  }
78944
78978
  },
78979
+ mounted() {
78980
+ if (this.shortcutLayout === 'panel') {
78981
+ this.initShortcutTagLayout();
78982
+ }
78983
+ },
78945
78984
  beforeDestroy() {
78946
78985
  this.clearPanelHighlightTimer();
78986
+ this.destroyShortcutTagObserver();
78947
78987
  },
78948
78988
  methods: {
78949
78989
  syncActiveFromValue(newValue) {
@@ -79046,6 +79086,37 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
79046
79086
  el.classList.toggle('is-active', isActive);
79047
79087
  });
79048
79088
  return true;
79089
+ },
79090
+ initShortcutTagLayout() {
79091
+ this.destroyShortcutTagObserver();
79092
+ this.$nextTick(() => {
79093
+ const wrap = this.$refs.panelInputWrap;
79094
+ if (!wrap) return;
79095
+ if (typeof ResizeObserver !== 'undefined') {
79096
+ this.shortcutTagResizeObserver = new ResizeObserver(() => {
79097
+ this.updateShortcutTagLayout();
79098
+ });
79099
+ this.shortcutTagResizeObserver.observe(wrap);
79100
+ }
79101
+ this.updateShortcutTagLayout();
79102
+ });
79103
+ },
79104
+ updateShortcutTagLayout() {
79105
+ const wrap = this.$refs.panelInputWrap;
79106
+ if (!wrap || !this.activeShortcutLabel) {
79107
+ this.shortcutTagVertical = false;
79108
+ return;
79109
+ }
79110
+
79111
+ // 有标签时优先纵排(更省横向空间);阈值越小越不易触发纵排
79112
+ const verticalThreshold = this.dateOptions.clearable !== false ? 280 : 250;
79113
+ this.shortcutTagVertical = wrap.clientWidth < verticalThreshold;
79114
+ },
79115
+ destroyShortcutTagObserver() {
79116
+ if (this.shortcutTagResizeObserver) {
79117
+ this.shortcutTagResizeObserver.disconnect();
79118
+ this.shortcutTagResizeObserver = null;
79119
+ }
79049
79120
  }
79050
79121
  }
79051
79122
  });
@@ -79061,8 +79132,8 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
79061
79132
  ;
79062
79133
  var custom_date_picker_component = normalizeComponent(
79063
79134
  comps_custom_date_pickervue_type_script_lang_js,
79064
- custom_date_pickervue_type_template_id_dd2e875c_render,
79065
- custom_date_pickervue_type_template_id_dd2e875c_staticRenderFns,
79135
+ custom_date_pickervue_type_template_id_6ad43c6f_render,
79136
+ custom_date_pickervue_type_template_id_6ad43c6f_staticRenderFns,
79066
79137
  false,
79067
79138
  null,
79068
79139
  null,
@@ -78766,8 +78766,8 @@ var pair_number_input_component = normalizeComponent(
78766
78766
  )
78767
78767
 
78768
78768
  /* harmony default export */ var pair_number_input = (pair_number_input_component.exports);
78769
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-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/form/comps/custom-date-picker.vue?vue&type=template&id=dd2e875c
78770
- var custom_date_pickervue_type_template_id_dd2e875c_render = function render() {
78769
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-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/form/comps/custom-date-picker.vue?vue&type=template&id=6ad43c6f
78770
+ var custom_date_pickervue_type_template_id_6ad43c6f_render = function render() {
78771
78771
  var _vm = this,
78772
78772
  _c = _vm._self._c;
78773
78773
  return _c('div', {
@@ -78800,8 +78800,18 @@ var custom_date_pickervue_type_template_id_dd2e875c_render = function render() {
78800
78800
  }
78801
78801
  }
78802
78802
  }, [_vm._v(" " + _vm._s(item.label) + " ")]);
78803
- }), 0)] : _c('el-date-picker', _vm._b({
78803
+ }), 0)] : _c('div', {
78804
+ ref: "panelInputWrap",
78805
+ staticClass: "b-picker__panel-input-wrap",
78806
+ class: {
78807
+ 'is-clearable': _vm.dateOptions.clearable !== false
78808
+ }
78809
+ }, [_c('el-date-picker', _vm._b({
78804
78810
  ref: "panelDatePicker",
78811
+ class: {
78812
+ 'has-shortcut-tag': !!_vm.activeShortcutLabel,
78813
+ 'has-shortcut-tag--vertical': !!_vm.activeShortcutLabel && _vm.shortcutTagVertical
78814
+ },
78805
78815
  attrs: {
78806
78816
  "value": _vm.value,
78807
78817
  "popper-class": _vm.panelPopperClass
@@ -78815,9 +78825,22 @@ var custom_date_pickervue_type_template_id_dd2e875c_render = function render() {
78815
78825
  return _vm.handlePanelOpen.apply(null, arguments);
78816
78826
  }
78817
78827
  }
78818
- }, 'el-date-picker', _vm.panelDateOptions, false))], 2);
78828
+ }, 'el-date-picker', _vm.panelDateOptions, false)), _vm.activeShortcutLabel ? _c('span', {
78829
+ staticClass: "b-picker__shortcut-tag",
78830
+ class: {
78831
+ 'is-vertical': _vm.shortcutTagVertical
78832
+ },
78833
+ attrs: {
78834
+ "title": _vm.activeShortcutLabel
78835
+ }
78836
+ }, [_vm.shortcutTagVertical ? _vm._l(_vm.activeShortcutChars, function (char, index) {
78837
+ return _c('i', {
78838
+ key: index,
78839
+ staticClass: "b-picker__shortcut-tag-char"
78840
+ }, [_vm._v(" " + _vm._s(char) + " ")]);
78841
+ }) : [_vm._v(_vm._s(_vm.activeShortcutLabel))]], 2) : _vm._e()], 1)], 2);
78819
78842
  };
78820
- var custom_date_pickervue_type_template_id_dd2e875c_staticRenderFns = [];
78843
+ var custom_date_pickervue_type_template_id_6ad43c6f_staticRenderFns = [];
78821
78844
 
78822
78845
  // EXTERNAL MODULE: ./node_modules/moment/moment.js
78823
78846
  var moment = __webpack_require__(9618);
@@ -78869,7 +78892,9 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
78869
78892
  data() {
78870
78893
  return {
78871
78894
  active: '',
78872
- panelHighlightTimer: null
78895
+ panelHighlightTimer: null,
78896
+ shortcutTagVertical: false,
78897
+ shortcutTagResizeObserver: null
78873
78898
  };
78874
78899
  },
78875
78900
  computed: {
@@ -78937,12 +78962,21 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
78937
78962
  },
78938
78963
  panelPopperClass() {
78939
78964
  return `by-custom-date-picker-panel by-custom-date-picker-panel--${this._uid}`;
78965
+ },
78966
+ activeShortcutLabel() {
78967
+ if (!this.active) return '';
78968
+ const item = this.shortcuts.find(shortcut => shortcut.key === this.active);
78969
+ return item ? item.label : '';
78970
+ },
78971
+ activeShortcutChars() {
78972
+ return this.activeShortcutLabel.split('');
78940
78973
  }
78941
78974
  },
78942
78975
  watch: {
78943
78976
  active() {
78944
78977
  if (this.shortcutLayout === 'panel') {
78945
78978
  this.schedulePanelShortcutHighlight();
78979
+ this.updateShortcutTagLayout();
78946
78980
  }
78947
78981
  },
78948
78982
  value: {
@@ -78952,8 +78986,14 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
78952
78986
  immediate: true
78953
78987
  }
78954
78988
  },
78989
+ mounted() {
78990
+ if (this.shortcutLayout === 'panel') {
78991
+ this.initShortcutTagLayout();
78992
+ }
78993
+ },
78955
78994
  beforeDestroy() {
78956
78995
  this.clearPanelHighlightTimer();
78996
+ this.destroyShortcutTagObserver();
78957
78997
  },
78958
78998
  methods: {
78959
78999
  syncActiveFromValue(newValue) {
@@ -79056,6 +79096,37 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
79056
79096
  el.classList.toggle('is-active', isActive);
79057
79097
  });
79058
79098
  return true;
79099
+ },
79100
+ initShortcutTagLayout() {
79101
+ this.destroyShortcutTagObserver();
79102
+ this.$nextTick(() => {
79103
+ const wrap = this.$refs.panelInputWrap;
79104
+ if (!wrap) return;
79105
+ if (typeof ResizeObserver !== 'undefined') {
79106
+ this.shortcutTagResizeObserver = new ResizeObserver(() => {
79107
+ this.updateShortcutTagLayout();
79108
+ });
79109
+ this.shortcutTagResizeObserver.observe(wrap);
79110
+ }
79111
+ this.updateShortcutTagLayout();
79112
+ });
79113
+ },
79114
+ updateShortcutTagLayout() {
79115
+ const wrap = this.$refs.panelInputWrap;
79116
+ if (!wrap || !this.activeShortcutLabel) {
79117
+ this.shortcutTagVertical = false;
79118
+ return;
79119
+ }
79120
+
79121
+ // 有标签时优先纵排(更省横向空间);阈值越小越不易触发纵排
79122
+ const verticalThreshold = this.dateOptions.clearable !== false ? 280 : 250;
79123
+ this.shortcutTagVertical = wrap.clientWidth < verticalThreshold;
79124
+ },
79125
+ destroyShortcutTagObserver() {
79126
+ if (this.shortcutTagResizeObserver) {
79127
+ this.shortcutTagResizeObserver.disconnect();
79128
+ this.shortcutTagResizeObserver = null;
79129
+ }
79059
79130
  }
79060
79131
  }
79061
79132
  });
@@ -79071,8 +79142,8 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
79071
79142
  ;
79072
79143
  var custom_date_picker_component = normalizeComponent(
79073
79144
  comps_custom_date_pickervue_type_script_lang_js,
79074
- custom_date_pickervue_type_template_id_dd2e875c_render,
79075
- custom_date_pickervue_type_template_id_dd2e875c_staticRenderFns,
79145
+ custom_date_pickervue_type_template_id_6ad43c6f_render,
79146
+ custom_date_pickervue_type_template_id_6ad43c6f_staticRenderFns,
79076
79147
  false,
79077
79148
  null,
79078
79149
  null,