@weitutech/by-components 1.2.19 → 1.2.20

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=275b5251
101530
- var ByTagvue_type_template_id_275b5251_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=021fe5fe
101530
+ var ByTagvue_type_template_id_021fe5fe_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,18 +101536,21 @@ var ByTagvue_type_template_id_275b5251_render = function render() {
101536
101536
  "type": _vm.elTagType,
101537
101537
  "color": _vm.elTagColor
101538
101538
  }
101539
- }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.icon || _vm.$scopedSlots.icon || _vm.$slots.icon ? _c('span', {
101539
+ }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.hasProvidedIconSlot ? _c('span', {
101540
101540
  staticClass: "by-tag__icon",
101541
101541
  attrs: {
101542
101542
  "aria-hidden": "true"
101543
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);
101544
+ }, [_vm._t("icon")], 2) : _vm.icon ? _c('span', {
101545
+ staticClass: "by-tag__icon",
101546
+ attrs: {
101547
+ "aria-hidden": "true"
101548
+ }
101549
+ }, [_c('i', {
101550
+ class: _vm.icon
101551
+ })]) : _vm._e(), _vm._t("default")], 2);
101549
101552
  };
101550
- var ByTagvue_type_template_id_275b5251_staticRenderFns = [];
101553
+ var ByTagvue_type_template_id_021fe5fe_staticRenderFns = [];
101551
101554
 
101552
101555
  ;// ./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
101556
 
@@ -101558,6 +101561,11 @@ var ByTagvue_type_template_id_275b5251_staticRenderFns = [];
101558
101561
  */
101559
101562
  const NATIVE_TYPES = ['primary', 'success', 'info', 'warning', 'danger'];
101560
101563
  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'];
101564
+ function slotHasContent(nodes) {
101565
+ if (!nodes) return false;
101566
+ if (Array.isArray(nodes)) return nodes.length > 0;
101567
+ return true;
101568
+ }
101561
101569
  /* harmony default export */ var ByTagvue_type_script_lang_js = ({
101562
101570
  name: 'ByTag',
101563
101571
  inheritAttrs: false,
@@ -101593,8 +101601,22 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101593
101601
  isExtendedType() {
101594
101602
  return this.type && EXTENDED_TYPES.includes(this.type);
101595
101603
  },
101604
+ /**
101605
+ * 是否真正传入了 #icon 插槽(需有内容)。
101606
+ * 不能只用 !!$scopedSlots.icon:lib 打包 + 嵌套 scopedSlot 场景下可能存在空函数。
101607
+ */
101608
+ hasProvidedIconSlot() {
101609
+ if (slotHasContent(this.$slots && this.$slots.icon)) {
101610
+ return true;
101611
+ }
101612
+ const scopedIcon = this.$scopedSlots && this.$scopedSlots.icon;
101613
+ if (typeof scopedIcon !== 'function') {
101614
+ return false;
101615
+ }
101616
+ return slotHasContent(scopedIcon({}));
101617
+ },
101596
101618
  hasIcon() {
101597
- return Boolean(this.icon || this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
101619
+ return Boolean(this.icon) || this.hasProvidedIconSlot;
101598
101620
  },
101599
101621
  elTagType() {
101600
101622
  if (this.isNativeType) return this.type;
@@ -101632,8 +101654,6 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101632
101654
  if (this.isExtendedType) {
101633
101655
  delete attrs.color;
101634
101656
  }
101635
- // 防御:避免 icon 被透传到 el-tag DOM(旧构建/异常透传时)
101636
- delete attrs.icon;
101637
101657
  return attrs;
101638
101658
  }
101639
101659
  }
@@ -101650,8 +101670,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101650
101670
  ;
101651
101671
  var ByTag_component = normalizeComponent(
101652
101672
  by_tag_ByTagvue_type_script_lang_js,
101653
- ByTagvue_type_template_id_275b5251_render,
101654
- ByTagvue_type_template_id_275b5251_staticRenderFns,
101673
+ ByTagvue_type_template_id_021fe5fe_render,
101674
+ ByTagvue_type_template_id_021fe5fe_staticRenderFns,
101655
101675
  false,
101656
101676
  null,
101657
101677
  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=275b5251
101540
- var ByTagvue_type_template_id_275b5251_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=021fe5fe
101540
+ var ByTagvue_type_template_id_021fe5fe_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,18 +101546,21 @@ var ByTagvue_type_template_id_275b5251_render = function render() {
101546
101546
  "type": _vm.elTagType,
101547
101547
  "color": _vm.elTagColor
101548
101548
  }
101549
- }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.icon || _vm.$scopedSlots.icon || _vm.$slots.icon ? _c('span', {
101549
+ }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.hasProvidedIconSlot ? _c('span', {
101550
101550
  staticClass: "by-tag__icon",
101551
101551
  attrs: {
101552
101552
  "aria-hidden": "true"
101553
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);
101554
+ }, [_vm._t("icon")], 2) : _vm.icon ? _c('span', {
101555
+ staticClass: "by-tag__icon",
101556
+ attrs: {
101557
+ "aria-hidden": "true"
101558
+ }
101559
+ }, [_c('i', {
101560
+ class: _vm.icon
101561
+ })]) : _vm._e(), _vm._t("default")], 2);
101559
101562
  };
101560
- var ByTagvue_type_template_id_275b5251_staticRenderFns = [];
101563
+ var ByTagvue_type_template_id_021fe5fe_staticRenderFns = [];
101561
101564
 
101562
101565
  ;// ./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
101566
 
@@ -101568,6 +101571,11 @@ var ByTagvue_type_template_id_275b5251_staticRenderFns = [];
101568
101571
  */
101569
101572
  const NATIVE_TYPES = ['primary', 'success', 'info', 'warning', 'danger'];
101570
101573
  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'];
101574
+ function slotHasContent(nodes) {
101575
+ if (!nodes) return false;
101576
+ if (Array.isArray(nodes)) return nodes.length > 0;
101577
+ return true;
101578
+ }
101571
101579
  /* harmony default export */ var ByTagvue_type_script_lang_js = ({
101572
101580
  name: 'ByTag',
101573
101581
  inheritAttrs: false,
@@ -101603,8 +101611,22 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101603
101611
  isExtendedType() {
101604
101612
  return this.type && EXTENDED_TYPES.includes(this.type);
101605
101613
  },
101614
+ /**
101615
+ * 是否真正传入了 #icon 插槽(需有内容)。
101616
+ * 不能只用 !!$scopedSlots.icon:lib 打包 + 嵌套 scopedSlot 场景下可能存在空函数。
101617
+ */
101618
+ hasProvidedIconSlot() {
101619
+ if (slotHasContent(this.$slots && this.$slots.icon)) {
101620
+ return true;
101621
+ }
101622
+ const scopedIcon = this.$scopedSlots && this.$scopedSlots.icon;
101623
+ if (typeof scopedIcon !== 'function') {
101624
+ return false;
101625
+ }
101626
+ return slotHasContent(scopedIcon({}));
101627
+ },
101606
101628
  hasIcon() {
101607
- return Boolean(this.icon || this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
101629
+ return Boolean(this.icon) || this.hasProvidedIconSlot;
101608
101630
  },
101609
101631
  elTagType() {
101610
101632
  if (this.isNativeType) return this.type;
@@ -101642,8 +101664,6 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101642
101664
  if (this.isExtendedType) {
101643
101665
  delete attrs.color;
101644
101666
  }
101645
- // 防御:避免 icon 被透传到 el-tag DOM(旧构建/异常透传时)
101646
- delete attrs.icon;
101647
101667
  return attrs;
101648
101668
  }
101649
101669
  }
@@ -101660,8 +101680,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101660
101680
  ;
101661
101681
  var ByTag_component = normalizeComponent(
101662
101682
  by_tag_ByTagvue_type_script_lang_js,
101663
- ByTagvue_type_template_id_275b5251_render,
101664
- ByTagvue_type_template_id_275b5251_staticRenderFns,
101683
+ ByTagvue_type_template_id_021fe5fe_render,
101684
+ ByTagvue_type_template_id_021fe5fe_staticRenderFns,
101665
101685
  false,
101666
101686
  null,
101667
101687
  null,