@weitutech/by-components 1.2.17 → 1.2.19

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.
@@ -101526,8 +101526,8 @@ var ByGridLayout_component = normalizeComponent(
101526
101526
  )
101527
101527
 
101528
101528
  /* harmony default export */ var ByGridLayout = (ByGridLayout_component.exports);
101529
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-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/by-tag/ByTag.vue?vue&type=template&id=197fb365
101530
- var ByTagvue_type_template_id_197fb365_render = function render() {
101529
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-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/by-tag/ByTag.vue?vue&type=template&id=275b5251
101530
+ var ByTagvue_type_template_id_275b5251_render = function render() {
101531
101531
  var _vm = this,
101532
101532
  _c = _vm._self._c;
101533
101533
  return _c('el-tag', _vm._g(_vm._b({
@@ -101536,14 +101536,25 @@ var ByTagvue_type_template_id_197fb365_render = function render() {
101536
101536
  "type": _vm.elTagType,
101537
101537
  "color": _vm.elTagColor
101538
101538
  }
101539
- }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm._t("default")], 2);
101539
+ }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.icon || _vm.$scopedSlots.icon || _vm.$slots.icon ? _c('span', {
101540
+ staticClass: "by-tag__icon",
101541
+ attrs: {
101542
+ "aria-hidden": "true"
101543
+ }
101544
+ }, [_vm._t("icon", function () {
101545
+ return [_vm.icon ? _c('i', {
101546
+ class: ['by-tag__icon-inner', _vm.icon]
101547
+ }) : _vm._e()];
101548
+ })], 2) : _vm._e(), _vm._t("default")], 2);
101540
101549
  };
101541
- var ByTagvue_type_template_id_197fb365_staticRenderFns = [];
101550
+ var ByTagvue_type_template_id_275b5251_staticRenderFns = [];
101542
101551
 
101543
101552
  ;// ./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/by-tag/ByTag.vue?vue&type=script&lang=js
101553
+
101544
101554
  /**
101545
101555
  * 原生 el-tag 的 type 仅支持:primary / success / info / warning / danger
101546
- * 本组件扩展 type,扩展类型的背景、边框、文字由 style/by-tag.scss 统一配色
101556
+ * 本组件扩展 type,扩展类型的背景、边框、文字由 style/by-tag.scss 统一配色;
101557
+ * 另支持前缀图标(icon / #icon)与胶囊圆角(round)。
101547
101558
  */
101548
101559
  const NATIVE_TYPES = ['primary', 'success', 'info', 'warning', 'danger'];
101549
101560
  const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', 'purple', 'violet', 'lavender', 'indigo', 'cyan', 'teal', 'aqua', 'ink', 'mint', 'lime', 'forest', 'olive', 'sage', 'crimson', 'rose', 'pink', 'blossom', 'magenta', 'scarlet', 'orange', 'coral', 'brick', 'amber', 'gold', 'lemon', 'brown', 'sand', 'beige', 'wine', 'silver', 'copper'];
@@ -101560,6 +101571,19 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101560
101571
  type: {
101561
101572
  type: String,
101562
101573
  default: ''
101574
+ },
101575
+ /**
101576
+ * 前缀图标类名(如 el-icon-check);也可通过 #icon 插槽完全自定义。
101577
+ * 同时存在时优先渲染 #icon 插槽内容。
101578
+ */
101579
+ icon: {
101580
+ type: String,
101581
+ default: ''
101582
+ },
101583
+ /** 是否使用胶囊圆角(border-radius: 999px) */
101584
+ round: {
101585
+ type: Boolean,
101586
+ default: false
101563
101587
  }
101564
101588
  },
101565
101589
  computed: {
@@ -101569,6 +101593,9 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101569
101593
  isExtendedType() {
101570
101594
  return this.type && EXTENDED_TYPES.includes(this.type);
101571
101595
  },
101596
+ hasIcon() {
101597
+ return Boolean(this.icon || this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
101598
+ },
101572
101599
  elTagType() {
101573
101600
  if (this.isNativeType) return this.type;
101574
101601
  if (this.isExtendedType) return ''; // 扩展类型完全由 by-tag.scss 配色
@@ -101579,8 +101606,21 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101579
101606
  return this.$attrs && this.$attrs.color !== undefined ? this.$attrs.color : undefined;
101580
101607
  },
101581
101608
  tagClass() {
101582
- if (!this.isExtendedType) return '';
101583
- return ['by-tag', `by-tag--${this.type}`];
101609
+ const classes = [];
101610
+ // 扩展色、圆角、图标样式均挂在 .by-tag 下;原生 type 在需要时也挂上基类
101611
+ if (this.isExtendedType || this.round || this.hasIcon) {
101612
+ classes.push('by-tag');
101613
+ }
101614
+ if (this.isExtendedType) {
101615
+ classes.push(`by-tag--${this.type}`);
101616
+ }
101617
+ if (this.round) {
101618
+ classes.push('by-tag--round');
101619
+ }
101620
+ if (this.hasIcon) {
101621
+ classes.push('by-tag--with-icon');
101622
+ }
101623
+ return classes;
101584
101624
  },
101585
101625
  tagAttrs() {
101586
101626
  const attrs = {
@@ -101592,6 +101632,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101592
101632
  if (this.isExtendedType) {
101593
101633
  delete attrs.color;
101594
101634
  }
101635
+ // 防御:避免 icon 被透传到 el-tag DOM(旧构建/异常透传时)
101636
+ delete attrs.icon;
101595
101637
  return attrs;
101596
101638
  }
101597
101639
  }
@@ -101608,8 +101650,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101608
101650
  ;
101609
101651
  var ByTag_component = normalizeComponent(
101610
101652
  by_tag_ByTagvue_type_script_lang_js,
101611
- ByTagvue_type_template_id_197fb365_render,
101612
- ByTagvue_type_template_id_197fb365_staticRenderFns,
101653
+ ByTagvue_type_template_id_275b5251_render,
101654
+ ByTagvue_type_template_id_275b5251_staticRenderFns,
101613
101655
  false,
101614
101656
  null,
101615
101657
  null,
@@ -101536,8 +101536,8 @@ var ByGridLayout_component = normalizeComponent(
101536
101536
  )
101537
101537
 
101538
101538
  /* harmony default export */ var ByGridLayout = (ByGridLayout_component.exports);
101539
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-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-tag/ByTag.vue?vue&type=template&id=197fb365
101540
- var ByTagvue_type_template_id_197fb365_render = function render() {
101539
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-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-tag/ByTag.vue?vue&type=template&id=275b5251
101540
+ var ByTagvue_type_template_id_275b5251_render = function render() {
101541
101541
  var _vm = this,
101542
101542
  _c = _vm._self._c;
101543
101543
  return _c('el-tag', _vm._g(_vm._b({
@@ -101546,14 +101546,25 @@ var ByTagvue_type_template_id_197fb365_render = function render() {
101546
101546
  "type": _vm.elTagType,
101547
101547
  "color": _vm.elTagColor
101548
101548
  }
101549
- }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm._t("default")], 2);
101549
+ }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.icon || _vm.$scopedSlots.icon || _vm.$slots.icon ? _c('span', {
101550
+ staticClass: "by-tag__icon",
101551
+ attrs: {
101552
+ "aria-hidden": "true"
101553
+ }
101554
+ }, [_vm._t("icon", function () {
101555
+ return [_vm.icon ? _c('i', {
101556
+ class: ['by-tag__icon-inner', _vm.icon]
101557
+ }) : _vm._e()];
101558
+ })], 2) : _vm._e(), _vm._t("default")], 2);
101550
101559
  };
101551
- var ByTagvue_type_template_id_197fb365_staticRenderFns = [];
101560
+ var ByTagvue_type_template_id_275b5251_staticRenderFns = [];
101552
101561
 
101553
101562
  ;// ./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-tag/ByTag.vue?vue&type=script&lang=js
101563
+
101554
101564
  /**
101555
101565
  * 原生 el-tag 的 type 仅支持:primary / success / info / warning / danger
101556
- * 本组件扩展 type,扩展类型的背景、边框、文字由 style/by-tag.scss 统一配色
101566
+ * 本组件扩展 type,扩展类型的背景、边框、文字由 style/by-tag.scss 统一配色;
101567
+ * 另支持前缀图标(icon / #icon)与胶囊圆角(round)。
101557
101568
  */
101558
101569
  const NATIVE_TYPES = ['primary', 'success', 'info', 'warning', 'danger'];
101559
101570
  const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', 'purple', 'violet', 'lavender', 'indigo', 'cyan', 'teal', 'aqua', 'ink', 'mint', 'lime', 'forest', 'olive', 'sage', 'crimson', 'rose', 'pink', 'blossom', 'magenta', 'scarlet', 'orange', 'coral', 'brick', 'amber', 'gold', 'lemon', 'brown', 'sand', 'beige', 'wine', 'silver', 'copper'];
@@ -101570,6 +101581,19 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101570
101581
  type: {
101571
101582
  type: String,
101572
101583
  default: ''
101584
+ },
101585
+ /**
101586
+ * 前缀图标类名(如 el-icon-check);也可通过 #icon 插槽完全自定义。
101587
+ * 同时存在时优先渲染 #icon 插槽内容。
101588
+ */
101589
+ icon: {
101590
+ type: String,
101591
+ default: ''
101592
+ },
101593
+ /** 是否使用胶囊圆角(border-radius: 999px) */
101594
+ round: {
101595
+ type: Boolean,
101596
+ default: false
101573
101597
  }
101574
101598
  },
101575
101599
  computed: {
@@ -101579,6 +101603,9 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101579
101603
  isExtendedType() {
101580
101604
  return this.type && EXTENDED_TYPES.includes(this.type);
101581
101605
  },
101606
+ hasIcon() {
101607
+ return Boolean(this.icon || this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
101608
+ },
101582
101609
  elTagType() {
101583
101610
  if (this.isNativeType) return this.type;
101584
101611
  if (this.isExtendedType) return ''; // 扩展类型完全由 by-tag.scss 配色
@@ -101589,8 +101616,21 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101589
101616
  return this.$attrs && this.$attrs.color !== undefined ? this.$attrs.color : undefined;
101590
101617
  },
101591
101618
  tagClass() {
101592
- if (!this.isExtendedType) return '';
101593
- return ['by-tag', `by-tag--${this.type}`];
101619
+ const classes = [];
101620
+ // 扩展色、圆角、图标样式均挂在 .by-tag 下;原生 type 在需要时也挂上基类
101621
+ if (this.isExtendedType || this.round || this.hasIcon) {
101622
+ classes.push('by-tag');
101623
+ }
101624
+ if (this.isExtendedType) {
101625
+ classes.push(`by-tag--${this.type}`);
101626
+ }
101627
+ if (this.round) {
101628
+ classes.push('by-tag--round');
101629
+ }
101630
+ if (this.hasIcon) {
101631
+ classes.push('by-tag--with-icon');
101632
+ }
101633
+ return classes;
101594
101634
  },
101595
101635
  tagAttrs() {
101596
101636
  const attrs = {
@@ -101602,6 +101642,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101602
101642
  if (this.isExtendedType) {
101603
101643
  delete attrs.color;
101604
101644
  }
101645
+ // 防御:避免 icon 被透传到 el-tag DOM(旧构建/异常透传时)
101646
+ delete attrs.icon;
101605
101647
  return attrs;
101606
101648
  }
101607
101649
  }
@@ -101618,8 +101660,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101618
101660
  ;
101619
101661
  var ByTag_component = normalizeComponent(
101620
101662
  by_tag_ByTagvue_type_script_lang_js,
101621
- ByTagvue_type_template_id_197fb365_render,
101622
- ByTagvue_type_template_id_197fb365_staticRenderFns,
101663
+ ByTagvue_type_template_id_275b5251_render,
101664
+ ByTagvue_type_template_id_275b5251_staticRenderFns,
101623
101665
  false,
101624
101666
  null,
101625
101667
  null,