@hoci/components 0.5.8 → 0.5.9

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.
package/dist/index.cjs CHANGED
@@ -17,14 +17,10 @@ const HiAffix = vue.defineComponent({
17
17
  },
18
18
  setup(props, context) {
19
19
  const { className, wrapperRef, isFixed, placeholderStyle, fixedStyle } = core.useAffix(props, context);
20
- return () => vue.h(
21
- props.as,
22
- { ref: wrapperRef },
23
- [
24
- isFixed.value && vue.h("div", { style: placeholderStyle.value }),
25
- vue.h("div", { class: className.value, style: fixedStyle.value }, vue.renderSlot(context.slots, "default"))
26
- ]
27
- );
20
+ return () => vue.h(props.as, { ref: wrapperRef }, [
21
+ isFixed.value && vue.h("div", { style: placeholderStyle.value }),
22
+ vue.h("div", { class: className.value, style: fixedStyle.value }, vue.renderSlot(context.slots, "default"))
23
+ ]);
28
24
  }
29
25
  });
30
26
 
@@ -57,9 +53,9 @@ const affixProps = shared.defineHookProps(
57
53
  type: [String, Object, Function]
58
54
  },
59
55
  /**
60
- * @zh z-index 值
61
- * @en Z index value
62
- */
56
+ * @zh z-index 值
57
+ * @en Z index value
58
+ */
63
59
  zIndex: {
64
60
  type: Number,
65
61
  default: 998
@@ -505,7 +501,7 @@ const HiTabs = vue.defineComponent({
505
501
  let component = selection.renderItem();
506
502
  if (props.keepAlive) {
507
503
  component = vue.h(vue.KeepAlive, {
508
- ...typeof props.keepAlive == "object" ? props.keepAlive : {}
504
+ ...typeof props.keepAlive === "object" ? props.keepAlive : {}
509
505
  }, component);
510
506
  }
511
507
  if (context.slots.content) {
@@ -541,9 +537,6 @@ const itemProps = shared.defineHookProps({
541
537
  type: Boolean,
542
538
  default: () => true
543
539
  },
544
- key: {
545
- type: [String, Number, Symbol]
546
- },
547
540
  activateEvent: {
548
541
  type: String
549
542
  },
@@ -568,7 +561,7 @@ const useSelectionItem = shared.defineHookComponent({
568
561
  };
569
562
  const label = vue.computed(() => {
570
563
  let label2 = props.label ?? context.label;
571
- if (label2 && typeof label2 == "function") {
564
+ if (label2 && typeof label2 === "function") {
572
565
  label2 = label2(props.value);
573
566
  }
574
567
  return Array.isArray(label2) ? label2 : [label2];
@@ -589,7 +582,7 @@ const useSelectionItem = shared.defineHookComponent({
589
582
  remove();
590
583
  remove = init({
591
584
  id: Math.random().toString(16).slice(2),
592
- label: typeof props.label == "string" ? props.label : void 0,
585
+ label: typeof props.label === "string" ? props.label : void 0,
593
586
  value,
594
587
  render
595
588
  });
@@ -630,15 +623,11 @@ const HiTabPane = vue.defineComponent({
630
623
  setup(props, context) {
631
624
  const { className, activateEvent, activate, isDisabled, label } = useSelectionItem(props, context);
632
625
  return () => {
633
- return vue.h(
634
- "div",
635
- {
636
- class: className.value,
637
- [`on${tslx.capitalize(activateEvent.value)}`]: activate,
638
- disabled: isDisabled.value
639
- },
640
- label.value
641
- );
626
+ return vue.h("div", {
627
+ class: className.value,
628
+ [`on${tslx.capitalize(activateEvent.value)}`]: activate,
629
+ disabled: isDisabled.value
630
+ }, label.value);
642
631
  };
643
632
  }
644
633
  });
@@ -699,11 +688,11 @@ const components = {
699
688
  HiTabs: HiTabs
700
689
  };
701
690
 
702
- const install = (app) => {
691
+ function install(app) {
703
692
  for (const key in components) {
704
693
  app.component(key, components[key]);
705
694
  }
706
- };
695
+ }
707
696
 
708
697
  exports.HiAffix = HiAffix;
709
698
  exports.HiAffixTarget = HiAffixTarget;
package/dist/index.d.cts CHANGED
@@ -186,9 +186,6 @@ declare const HiItem: vue.DefineComponent<{
186
186
  type: BooleanConstructor;
187
187
  default: () => true;
188
188
  };
189
- key: {
190
- type: vue.PropType<string | number | symbol>;
191
- };
192
189
  activateEvent: {
193
190
  type: vue.PropType<_hoci_core.ActivateEvent>;
194
191
  };
@@ -214,9 +211,6 @@ declare const HiItem: vue.DefineComponent<{
214
211
  type: BooleanConstructor;
215
212
  default: () => true;
216
213
  };
217
- key: {
218
- type: vue.PropType<string | number | symbol>;
219
- };
220
214
  activateEvent: {
221
215
  type: vue.PropType<_hoci_core.ActivateEvent>;
222
216
  };
@@ -540,9 +534,6 @@ declare const HiTabPane: vue.DefineComponent<{
540
534
  type: BooleanConstructor;
541
535
  default: () => true;
542
536
  };
543
- key: {
544
- type: vue.PropType<string | number | symbol>;
545
- };
546
537
  activateEvent: {
547
538
  type: vue.PropType<ActivateEvent>;
548
539
  };
@@ -564,9 +555,6 @@ declare const HiTabPane: vue.DefineComponent<{
564
555
  type: BooleanConstructor;
565
556
  default: () => true;
566
557
  };
567
- key: {
568
- type: vue.PropType<string | number | symbol>;
569
- };
570
558
  activateEvent: {
571
559
  type: vue.PropType<ActivateEvent>;
572
560
  };
@@ -670,6 +658,6 @@ declare const HiPopover: vue.DefineComponent<{
670
658
  as: string;
671
659
  }, {}>;
672
660
 
673
- declare const install: (app: App) => void;
661
+ declare function install(app: App): void;
674
662
 
675
663
  export { HiAffix, HiAffixTarget, HiConfigProvider, HiIcon, HiItem, HiPopover, HiSelection, HiSwitch, HiTabPane, HiTabs, install };
package/dist/index.d.mts CHANGED
@@ -186,9 +186,6 @@ declare const HiItem: vue.DefineComponent<{
186
186
  type: BooleanConstructor;
187
187
  default: () => true;
188
188
  };
189
- key: {
190
- type: vue.PropType<string | number | symbol>;
191
- };
192
189
  activateEvent: {
193
190
  type: vue.PropType<_hoci_core.ActivateEvent>;
194
191
  };
@@ -214,9 +211,6 @@ declare const HiItem: vue.DefineComponent<{
214
211
  type: BooleanConstructor;
215
212
  default: () => true;
216
213
  };
217
- key: {
218
- type: vue.PropType<string | number | symbol>;
219
- };
220
214
  activateEvent: {
221
215
  type: vue.PropType<_hoci_core.ActivateEvent>;
222
216
  };
@@ -540,9 +534,6 @@ declare const HiTabPane: vue.DefineComponent<{
540
534
  type: BooleanConstructor;
541
535
  default: () => true;
542
536
  };
543
- key: {
544
- type: vue.PropType<string | number | symbol>;
545
- };
546
537
  activateEvent: {
547
538
  type: vue.PropType<ActivateEvent>;
548
539
  };
@@ -564,9 +555,6 @@ declare const HiTabPane: vue.DefineComponent<{
564
555
  type: BooleanConstructor;
565
556
  default: () => true;
566
557
  };
567
- key: {
568
- type: vue.PropType<string | number | symbol>;
569
- };
570
558
  activateEvent: {
571
559
  type: vue.PropType<ActivateEvent>;
572
560
  };
@@ -670,6 +658,6 @@ declare const HiPopover: vue.DefineComponent<{
670
658
  as: string;
671
659
  }, {}>;
672
660
 
673
- declare const install: (app: App) => void;
661
+ declare function install(app: App): void;
674
662
 
675
663
  export { HiAffix, HiAffixTarget, HiConfigProvider, HiIcon, HiItem, HiPopover, HiSelection, HiSwitch, HiTabPane, HiTabs, install };
package/dist/index.d.ts CHANGED
@@ -186,9 +186,6 @@ declare const HiItem: vue.DefineComponent<{
186
186
  type: BooleanConstructor;
187
187
  default: () => true;
188
188
  };
189
- key: {
190
- type: vue.PropType<string | number | symbol>;
191
- };
192
189
  activateEvent: {
193
190
  type: vue.PropType<_hoci_core.ActivateEvent>;
194
191
  };
@@ -214,9 +211,6 @@ declare const HiItem: vue.DefineComponent<{
214
211
  type: BooleanConstructor;
215
212
  default: () => true;
216
213
  };
217
- key: {
218
- type: vue.PropType<string | number | symbol>;
219
- };
220
214
  activateEvent: {
221
215
  type: vue.PropType<_hoci_core.ActivateEvent>;
222
216
  };
@@ -540,9 +534,6 @@ declare const HiTabPane: vue.DefineComponent<{
540
534
  type: BooleanConstructor;
541
535
  default: () => true;
542
536
  };
543
- key: {
544
- type: vue.PropType<string | number | symbol>;
545
- };
546
537
  activateEvent: {
547
538
  type: vue.PropType<ActivateEvent>;
548
539
  };
@@ -564,9 +555,6 @@ declare const HiTabPane: vue.DefineComponent<{
564
555
  type: BooleanConstructor;
565
556
  default: () => true;
566
557
  };
567
- key: {
568
- type: vue.PropType<string | number | symbol>;
569
- };
570
558
  activateEvent: {
571
559
  type: vue.PropType<ActivateEvent>;
572
560
  };
@@ -670,6 +658,6 @@ declare const HiPopover: vue.DefineComponent<{
670
658
  as: string;
671
659
  }, {}>;
672
660
 
673
- declare const install: (app: App) => void;
661
+ declare function install(app: App): void;
674
662
 
675
663
  export { HiAffix, HiAffixTarget, HiConfigProvider, HiIcon, HiItem, HiPopover, HiSelection, HiSwitch, HiTabPane, HiTabs, install };
package/dist/index.mjs CHANGED
@@ -15,14 +15,10 @@ const HiAffix = defineComponent({
15
15
  },
16
16
  setup(props, context) {
17
17
  const { className, wrapperRef, isFixed, placeholderStyle, fixedStyle } = useAffix(props, context);
18
- return () => h(
19
- props.as,
20
- { ref: wrapperRef },
21
- [
22
- isFixed.value && h("div", { style: placeholderStyle.value }),
23
- h("div", { class: className.value, style: fixedStyle.value }, renderSlot(context.slots, "default"))
24
- ]
25
- );
18
+ return () => h(props.as, { ref: wrapperRef }, [
19
+ isFixed.value && h("div", { style: placeholderStyle.value }),
20
+ h("div", { class: className.value, style: fixedStyle.value }, renderSlot(context.slots, "default"))
21
+ ]);
26
22
  }
27
23
  });
28
24
 
@@ -55,9 +51,9 @@ const affixProps = defineHookProps(
55
51
  type: [String, Object, Function]
56
52
  },
57
53
  /**
58
- * @zh z-index 值
59
- * @en Z index value
60
- */
54
+ * @zh z-index 值
55
+ * @en Z index value
56
+ */
61
57
  zIndex: {
62
58
  type: Number,
63
59
  default: 998
@@ -503,7 +499,7 @@ const HiTabs = defineComponent({
503
499
  let component = selection.renderItem();
504
500
  if (props.keepAlive) {
505
501
  component = h(KeepAlive, {
506
- ...typeof props.keepAlive == "object" ? props.keepAlive : {}
502
+ ...typeof props.keepAlive === "object" ? props.keepAlive : {}
507
503
  }, component);
508
504
  }
509
505
  if (context.slots.content) {
@@ -539,9 +535,6 @@ const itemProps = defineHookProps({
539
535
  type: Boolean,
540
536
  default: () => true
541
537
  },
542
- key: {
543
- type: [String, Number, Symbol]
544
- },
545
538
  activateEvent: {
546
539
  type: String
547
540
  },
@@ -566,7 +559,7 @@ const useSelectionItem = defineHookComponent({
566
559
  };
567
560
  const label = computed(() => {
568
561
  let label2 = props.label ?? context.label;
569
- if (label2 && typeof label2 == "function") {
562
+ if (label2 && typeof label2 === "function") {
570
563
  label2 = label2(props.value);
571
564
  }
572
565
  return Array.isArray(label2) ? label2 : [label2];
@@ -587,7 +580,7 @@ const useSelectionItem = defineHookComponent({
587
580
  remove();
588
581
  remove = init({
589
582
  id: Math.random().toString(16).slice(2),
590
- label: typeof props.label == "string" ? props.label : void 0,
583
+ label: typeof props.label === "string" ? props.label : void 0,
591
584
  value,
592
585
  render
593
586
  });
@@ -628,15 +621,11 @@ const HiTabPane = defineComponent({
628
621
  setup(props, context) {
629
622
  const { className, activateEvent, activate, isDisabled, label } = useSelectionItem(props, context);
630
623
  return () => {
631
- return h(
632
- "div",
633
- {
634
- class: className.value,
635
- [`on${capitalize(activateEvent.value)}`]: activate,
636
- disabled: isDisabled.value
637
- },
638
- label.value
639
- );
624
+ return h("div", {
625
+ class: className.value,
626
+ [`on${capitalize(activateEvent.value)}`]: activate,
627
+ disabled: isDisabled.value
628
+ }, label.value);
640
629
  };
641
630
  }
642
631
  });
@@ -697,10 +686,10 @@ const components = {
697
686
  HiTabs: HiTabs
698
687
  };
699
688
 
700
- const install = (app) => {
689
+ function install(app) {
701
690
  for (const key in components) {
702
691
  app.component(key, components[key]);
703
692
  }
704
- };
693
+ }
705
694
 
706
695
  export { HiAffix, HiAffixTarget, HiConfigProvider, HiIcon, HiItem, HiPopover, HiSelection, HiSwitch, HiTabPane, HiTabs, install };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoci/components",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
4
4
  "description": "",
5
5
  "author": "Chizuki <chizukicn@outlook.com>",
6
6
  "license": "MIT",
@@ -13,8 +13,8 @@
13
13
  "exports": {
14
14
  ".": {
15
15
  "types": "./dist/index.d.ts",
16
- "require": "./dist/index.cjs",
17
- "import": "./dist/index.mjs"
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.cjs"
18
18
  },
19
19
  "./*": "./dist/*"
20
20
  },
@@ -31,8 +31,8 @@
31
31
  "dependencies": {
32
32
  "maybe-types": "^0.2.0",
33
33
  "tslx": "^0.1.1",
34
- "@hoci/core": "0.5.8",
35
- "@hoci/shared": "0.5.8"
34
+ "@hoci/core": "0.5.9",
35
+ "@hoci/shared": "0.5.9"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "unbuild",