@weitutech/by-components 1.1.206 → 1.1.207

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.
@@ -97710,8 +97710,8 @@ var ByCardView_component = normalizeComponent(
97710
97710
  )
97711
97711
 
97712
97712
  /* harmony default export */ var ByCardView = (ByCardView_component.exports);
97713
- ;// ./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/card-selector/ByCardSelector.vue?vue&type=template&id=0a667b47
97714
- var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
97713
+ ;// ./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/card-selector/ByCardSelector.vue?vue&type=template&id=43f85144
97714
+ var ByCardSelectorvue_type_template_id_43f85144_render = function render() {
97715
97715
  var _vm = this,
97716
97716
  _c = _vm._self._c;
97717
97717
  return _c('div', {
@@ -97720,12 +97720,12 @@ var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
97720
97720
  'is-disabled': _vm.disabled,
97721
97721
  'by-card-selector--no-check': !_vm.showCheckmark
97722
97722
  }],
97723
- style: _vm.directionStyle,
97723
+ style: _vm.rootStyle,
97724
97724
  attrs: {
97725
97725
  "role": "listbox",
97726
97726
  "aria-multiselectable": _vm.multiple ? 'true' : 'false'
97727
97727
  }
97728
- }, _vm._l(_vm.options, function (item, index) {
97728
+ }, [_vm._l(_vm.options, function (item, index) {
97729
97729
  return _c('div', {
97730
97730
  key: _vm.optionKey(item, index),
97731
97731
  staticClass: "by-card-selector__card",
@@ -97825,9 +97825,29 @@ var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
97825
97825
  }, [_vm.isSelected(item) ? _c('i', {
97826
97826
  staticClass: "el-icon-check by-card-selector__check-icon"
97827
97827
  }) : _vm._e()]) : _vm._e()])], 2);
97828
- }), 0);
97828
+ }), _vm.hasGroupTooltip ? _c('div', {
97829
+ staticClass: "by-card-selector__suffix",
97830
+ attrs: {
97831
+ "role": "note"
97832
+ }
97833
+ }, [_c('el-tooltip', {
97834
+ attrs: {
97835
+ "content": _vm.groupTooltipText,
97836
+ "placement": "top",
97837
+ "open-delay": 300
97838
+ }
97839
+ }, [_c('span', {
97840
+ staticClass: "by-card-selector__suffix-trigger",
97841
+ on: {
97842
+ "click": function ($event) {
97843
+ $event.stopPropagation();
97844
+ }
97845
+ }
97846
+ }, [_c('i', {
97847
+ staticClass: "el-icon-question"
97848
+ })])])], 1) : _vm._e()], 2);
97829
97849
  };
97830
- var ByCardSelectorvue_type_template_id_0a667b47_staticRenderFns = [];
97850
+ var ByCardSelectorvue_type_template_id_43f85144_staticRenderFns = [];
97831
97851
 
97832
97852
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/card-selector/ByCardSelector.vue?vue&type=script&lang=js
97833
97853
 
@@ -97850,6 +97870,9 @@ const DEFAULT_OPTION_PROPS = () => ({
97850
97870
  * @example
97851
97871
  * <by-card-selector v-model="id" :options="list" />
97852
97872
  * <by-card-selector v-model="ids" :options="list" multiple />
97873
+ * <by-card-selector v-model="id" :options="list" :card-width="280" />
97874
+ * <by-card-selector v-model="id" :options="list" :show-checkmark="true" />
97875
+ * <by-card-selector v-model="id" :options="list" tooltips="整组说明文案" />
97853
97876
  */
97854
97877
  /* harmony default export */ var ByCardSelectorvue_type_script_lang_js = ({
97855
97878
  name: 'ByCardSelector',
@@ -97879,12 +97902,20 @@ const DEFAULT_OPTION_PROPS = () => ({
97879
97902
  type: String,
97880
97903
  default: '320px'
97881
97904
  },
97882
- /** 卡片尺寸 */
97905
+ /** 卡片尺寸(内边距、图标与字号等);卡片列宽默认由 size 与样式表决定 */
97883
97906
  size: {
97884
97907
  type: String,
97885
97908
  default: 'default',
97886
97909
  validator: v => ['large', 'default', 'small'].includes(v)
97887
97910
  },
97911
+ /**
97912
+ * 每张卡片宽度(像素,组件级统一)。未设置时列宽由 size 对应样式决定。
97913
+ * 合法范围 100–600,小于 100 按 100、大于 600 按 600;可传数字或字符串(如 240、"320px")。
97914
+ */
97915
+ cardWidth: {
97916
+ type: [Number, String],
97917
+ default: null
97918
+ },
97888
97919
  /** 整组禁用 */
97889
97920
  disabled: {
97890
97921
  type: Boolean,
@@ -97910,10 +97941,18 @@ const DEFAULT_OPTION_PROPS = () => ({
97910
97941
  type: Number,
97911
97942
  default: 3
97912
97943
  },
97913
- /** 是否在卡片右侧展示圆形打钩选中指示,默认展示 */
97944
+ /**
97945
+ * 组件级说明:有内容时在所有选项之后展示问号,悬停显示提示(与单项内的 tooltip 字段无关)。
97946
+ * 支持字符串或数字;仅空白则整组不展示该问号。
97947
+ */
97948
+ tooltips: {
97949
+ type: [String, Number],
97950
+ default: ''
97951
+ },
97952
+ /** 是否在卡片右侧展示圆形打钩选中指示,默认不展示 */
97914
97953
  showCheckmark: {
97915
97954
  type: Boolean,
97916
- default: true
97955
+ default: false
97917
97956
  }
97918
97957
  },
97919
97958
  data() {
@@ -97931,17 +97970,51 @@ const DEFAULT_OPTION_PROPS = () => ({
97931
97970
  keyField() {
97932
97971
  return this.optionKeyField || this.mergedOptionProps.value;
97933
97972
  },
97934
- directionStyle() {
97935
- if (this.direction !== 'vertical') return {};
97936
- return {
97937
- maxHeight: this.verticalMaxHeight
97938
- };
97973
+ /** 解析后的卡片宽度(px),无效或未传时为 null */
97974
+ resolvedCardWidthPx() {
97975
+ const raw = this.cardWidth;
97976
+ if (raw == null || raw === '') return null;
97977
+ let n;
97978
+ if (typeof raw === 'number' && Number.isFinite(raw)) {
97979
+ n = raw;
97980
+ } else if (typeof raw === 'string') {
97981
+ const s = String(raw).trim().replace(/px$/i, '');
97982
+ n = parseFloat(s);
97983
+ } else {
97984
+ return null;
97985
+ }
97986
+ if (!Number.isFinite(n)) return null;
97987
+ const MIN = 100;
97988
+ const MAX = 600;
97989
+ return Math.min(MAX, Math.max(MIN, Math.round(n)));
97990
+ },
97991
+ /** 根节点样式:纵向高度 + 可选自定义卡片宽度(CSS 变量) */
97992
+ rootStyle() {
97993
+ const style = {};
97994
+ if (this.direction === 'vertical') {
97995
+ style.maxHeight = this.verticalMaxHeight;
97996
+ }
97997
+ if (this.resolvedCardWidthPx != null) {
97998
+ style['--by-card-selector-min'] = `${this.resolvedCardWidthPx}px`;
97999
+ }
98000
+ return style;
97939
98001
  },
97940
98002
  hasCardSlot() {
97941
98003
  return Boolean(this.$scopedSlots && this.$scopedSlots.card || this.$slots && this.$slots.card);
97942
98004
  },
97943
98005
  hasIconSlot() {
97944
98006
  return Boolean(this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
98007
+ },
98008
+ /** 是否展示组件级尾部问号 */
98009
+ hasGroupTooltip() {
98010
+ const t = this.tooltips;
98011
+ if (t == null || t === '') return false;
98012
+ return String(t).trim().length > 0;
98013
+ },
98014
+ /** 传给 el-tooltip 的纯文本 */
98015
+ groupTooltipText() {
98016
+ if (!this.hasGroupTooltip) return '';
98017
+ return String(this.tooltips).trim();
97945
98018
  }
97946
98019
  },
97947
98020
  watch: {
@@ -98130,8 +98203,8 @@ const DEFAULT_OPTION_PROPS = () => ({
98130
98203
  ;
98131
98204
  var ByCardSelector_component = normalizeComponent(
98132
98205
  card_selector_ByCardSelectorvue_type_script_lang_js,
98133
- ByCardSelectorvue_type_template_id_0a667b47_render,
98134
- ByCardSelectorvue_type_template_id_0a667b47_staticRenderFns,
98206
+ ByCardSelectorvue_type_template_id_43f85144_render,
98207
+ ByCardSelectorvue_type_template_id_43f85144_staticRenderFns,
98135
98208
  false,
98136
98209
  null,
98137
98210
  null,
@@ -97720,8 +97720,8 @@ var ByCardView_component = normalizeComponent(
97720
97720
  )
97721
97721
 
97722
97722
  /* harmony default export */ var ByCardView = (ByCardView_component.exports);
97723
- ;// ./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/card-selector/ByCardSelector.vue?vue&type=template&id=0a667b47
97724
- var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
97723
+ ;// ./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/card-selector/ByCardSelector.vue?vue&type=template&id=43f85144
97724
+ var ByCardSelectorvue_type_template_id_43f85144_render = function render() {
97725
97725
  var _vm = this,
97726
97726
  _c = _vm._self._c;
97727
97727
  return _c('div', {
@@ -97730,12 +97730,12 @@ var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
97730
97730
  'is-disabled': _vm.disabled,
97731
97731
  'by-card-selector--no-check': !_vm.showCheckmark
97732
97732
  }],
97733
- style: _vm.directionStyle,
97733
+ style: _vm.rootStyle,
97734
97734
  attrs: {
97735
97735
  "role": "listbox",
97736
97736
  "aria-multiselectable": _vm.multiple ? 'true' : 'false'
97737
97737
  }
97738
- }, _vm._l(_vm.options, function (item, index) {
97738
+ }, [_vm._l(_vm.options, function (item, index) {
97739
97739
  return _c('div', {
97740
97740
  key: _vm.optionKey(item, index),
97741
97741
  staticClass: "by-card-selector__card",
@@ -97835,9 +97835,29 @@ var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
97835
97835
  }, [_vm.isSelected(item) ? _c('i', {
97836
97836
  staticClass: "el-icon-check by-card-selector__check-icon"
97837
97837
  }) : _vm._e()]) : _vm._e()])], 2);
97838
- }), 0);
97838
+ }), _vm.hasGroupTooltip ? _c('div', {
97839
+ staticClass: "by-card-selector__suffix",
97840
+ attrs: {
97841
+ "role": "note"
97842
+ }
97843
+ }, [_c('el-tooltip', {
97844
+ attrs: {
97845
+ "content": _vm.groupTooltipText,
97846
+ "placement": "top",
97847
+ "open-delay": 300
97848
+ }
97849
+ }, [_c('span', {
97850
+ staticClass: "by-card-selector__suffix-trigger",
97851
+ on: {
97852
+ "click": function ($event) {
97853
+ $event.stopPropagation();
97854
+ }
97855
+ }
97856
+ }, [_c('i', {
97857
+ staticClass: "el-icon-question"
97858
+ })])])], 1) : _vm._e()], 2);
97839
97859
  };
97840
- var ByCardSelectorvue_type_template_id_0a667b47_staticRenderFns = [];
97860
+ var ByCardSelectorvue_type_template_id_43f85144_staticRenderFns = [];
97841
97861
 
97842
97862
  ;// ./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/card-selector/ByCardSelector.vue?vue&type=script&lang=js
97843
97863
 
@@ -97860,6 +97880,9 @@ const DEFAULT_OPTION_PROPS = () => ({
97860
97880
  * @example
97861
97881
  * <by-card-selector v-model="id" :options="list" />
97862
97882
  * <by-card-selector v-model="ids" :options="list" multiple />
97883
+ * <by-card-selector v-model="id" :options="list" :card-width="280" />
97884
+ * <by-card-selector v-model="id" :options="list" :show-checkmark="true" />
97885
+ * <by-card-selector v-model="id" :options="list" tooltips="整组说明文案" />
97863
97886
  */
97864
97887
  /* harmony default export */ var ByCardSelectorvue_type_script_lang_js = ({
97865
97888
  name: 'ByCardSelector',
@@ -97889,12 +97912,20 @@ const DEFAULT_OPTION_PROPS = () => ({
97889
97912
  type: String,
97890
97913
  default: '320px'
97891
97914
  },
97892
- /** 卡片尺寸 */
97915
+ /** 卡片尺寸(内边距、图标与字号等);卡片列宽默认由 size 与样式表决定 */
97893
97916
  size: {
97894
97917
  type: String,
97895
97918
  default: 'default',
97896
97919
  validator: v => ['large', 'default', 'small'].includes(v)
97897
97920
  },
97921
+ /**
97922
+ * 每张卡片宽度(像素,组件级统一)。未设置时列宽由 size 对应样式决定。
97923
+ * 合法范围 100–600,小于 100 按 100、大于 600 按 600;可传数字或字符串(如 240、"320px")。
97924
+ */
97925
+ cardWidth: {
97926
+ type: [Number, String],
97927
+ default: null
97928
+ },
97898
97929
  /** 整组禁用 */
97899
97930
  disabled: {
97900
97931
  type: Boolean,
@@ -97920,10 +97951,18 @@ const DEFAULT_OPTION_PROPS = () => ({
97920
97951
  type: Number,
97921
97952
  default: 3
97922
97953
  },
97923
- /** 是否在卡片右侧展示圆形打钩选中指示,默认展示 */
97954
+ /**
97955
+ * 组件级说明:有内容时在所有选项之后展示问号,悬停显示提示(与单项内的 tooltip 字段无关)。
97956
+ * 支持字符串或数字;仅空白则整组不展示该问号。
97957
+ */
97958
+ tooltips: {
97959
+ type: [String, Number],
97960
+ default: ''
97961
+ },
97962
+ /** 是否在卡片右侧展示圆形打钩选中指示,默认不展示 */
97924
97963
  showCheckmark: {
97925
97964
  type: Boolean,
97926
- default: true
97965
+ default: false
97927
97966
  }
97928
97967
  },
97929
97968
  data() {
@@ -97941,17 +97980,51 @@ const DEFAULT_OPTION_PROPS = () => ({
97941
97980
  keyField() {
97942
97981
  return this.optionKeyField || this.mergedOptionProps.value;
97943
97982
  },
97944
- directionStyle() {
97945
- if (this.direction !== 'vertical') return {};
97946
- return {
97947
- maxHeight: this.verticalMaxHeight
97948
- };
97983
+ /** 解析后的卡片宽度(px),无效或未传时为 null */
97984
+ resolvedCardWidthPx() {
97985
+ const raw = this.cardWidth;
97986
+ if (raw == null || raw === '') return null;
97987
+ let n;
97988
+ if (typeof raw === 'number' && Number.isFinite(raw)) {
97989
+ n = raw;
97990
+ } else if (typeof raw === 'string') {
97991
+ const s = String(raw).trim().replace(/px$/i, '');
97992
+ n = parseFloat(s);
97993
+ } else {
97994
+ return null;
97995
+ }
97996
+ if (!Number.isFinite(n)) return null;
97997
+ const MIN = 100;
97998
+ const MAX = 600;
97999
+ return Math.min(MAX, Math.max(MIN, Math.round(n)));
98000
+ },
98001
+ /** 根节点样式:纵向高度 + 可选自定义卡片宽度(CSS 变量) */
98002
+ rootStyle() {
98003
+ const style = {};
98004
+ if (this.direction === 'vertical') {
98005
+ style.maxHeight = this.verticalMaxHeight;
98006
+ }
98007
+ if (this.resolvedCardWidthPx != null) {
98008
+ style['--by-card-selector-min'] = `${this.resolvedCardWidthPx}px`;
98009
+ }
98010
+ return style;
97949
98011
  },
97950
98012
  hasCardSlot() {
97951
98013
  return Boolean(this.$scopedSlots && this.$scopedSlots.card || this.$slots && this.$slots.card);
97952
98014
  },
97953
98015
  hasIconSlot() {
97954
98016
  return Boolean(this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
98017
+ },
98018
+ /** 是否展示组件级尾部问号 */
98019
+ hasGroupTooltip() {
98020
+ const t = this.tooltips;
98021
+ if (t == null || t === '') return false;
98022
+ return String(t).trim().length > 0;
98023
+ },
98024
+ /** 传给 el-tooltip 的纯文本 */
98025
+ groupTooltipText() {
98026
+ if (!this.hasGroupTooltip) return '';
98027
+ return String(this.tooltips).trim();
97955
98028
  }
97956
98029
  },
97957
98030
  watch: {
@@ -98140,8 +98213,8 @@ const DEFAULT_OPTION_PROPS = () => ({
98140
98213
  ;
98141
98214
  var ByCardSelector_component = normalizeComponent(
98142
98215
  card_selector_ByCardSelectorvue_type_script_lang_js,
98143
- ByCardSelectorvue_type_template_id_0a667b47_render,
98144
- ByCardSelectorvue_type_template_id_0a667b47_staticRenderFns,
98216
+ ByCardSelectorvue_type_template_id_43f85144_render,
98217
+ ByCardSelectorvue_type_template_id_43f85144_staticRenderFns,
98145
98218
  false,
98146
98219
  null,
98147
98220
  null,