@weitutech/by-components 1.2.18 → 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=91c49304
101530
- var ByTagvue_type_template_id_91c49304_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_91c49304_render = function render() {
101536
101536
  "type": _vm.elTagType,
101537
101537
  "color": _vm.elTagColor
101538
101538
  }
101539
- }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.hasIcon ? _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: _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_91c49304_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_91c49304_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,11 +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
  },
101596
- hasIconSlot() {
101597
- return Boolean(this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
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({}));
101598
101617
  },
101599
101618
  hasIcon() {
101600
- return Boolean(this.icon) || this.hasIconSlot;
101619
+ return Boolean(this.icon) || this.hasProvidedIconSlot;
101601
101620
  },
101602
101621
  elTagType() {
101603
101622
  if (this.isNativeType) return this.type;
@@ -101651,8 +101670,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101651
101670
  ;
101652
101671
  var ByTag_component = normalizeComponent(
101653
101672
  by_tag_ByTagvue_type_script_lang_js,
101654
- ByTagvue_type_template_id_91c49304_render,
101655
- ByTagvue_type_template_id_91c49304_staticRenderFns,
101673
+ ByTagvue_type_template_id_021fe5fe_render,
101674
+ ByTagvue_type_template_id_021fe5fe_staticRenderFns,
101656
101675
  false,
101657
101676
  null,
101658
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=91c49304
101540
- var ByTagvue_type_template_id_91c49304_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_91c49304_render = function render() {
101546
101546
  "type": _vm.elTagType,
101547
101547
  "color": _vm.elTagColor
101548
101548
  }
101549
- }, 'el-tag', _vm.tagAttrs, false), _vm.$listeners), [_vm.hasIcon ? _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: _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_91c49304_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_91c49304_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,11 +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
  },
101606
- hasIconSlot() {
101607
- return Boolean(this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
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({}));
101608
101627
  },
101609
101628
  hasIcon() {
101610
- return Boolean(this.icon) || this.hasIconSlot;
101629
+ return Boolean(this.icon) || this.hasProvidedIconSlot;
101611
101630
  },
101612
101631
  elTagType() {
101613
101632
  if (this.isNativeType) return this.type;
@@ -101661,8 +101680,8 @@ const EXTENDED_TYPES = ['blue', 'navy', 'sky', 'default', 'slate', 'charcoal', '
101661
101680
  ;
101662
101681
  var ByTag_component = normalizeComponent(
101663
101682
  by_tag_ByTagvue_type_script_lang_js,
101664
- ByTagvue_type_template_id_91c49304_render,
101665
- ByTagvue_type_template_id_91c49304_staticRenderFns,
101683
+ ByTagvue_type_template_id_021fe5fe_render,
101684
+ ByTagvue_type_template_id_021fe5fe_staticRenderFns,
101666
101685
  false,
101667
101686
  null,
101668
101687
  null,