@hoci/components 0.2.1 → 0.4.0

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
@@ -4,77 +4,37 @@ const vue = require('vue');
4
4
  const core = require('@hoci/core');
5
5
  const tslx = require('tslx');
6
6
 
7
- var __defProp$4 = Object.defineProperty;
8
- var __defProps$4 = Object.defineProperties;
9
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
10
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
11
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
12
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
13
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues$4 = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp$4.call(b, prop))
17
- __defNormalProp$4(a, prop, b[prop]);
18
- if (__getOwnPropSymbols$4)
19
- for (var prop of __getOwnPropSymbols$4(b)) {
20
- if (__propIsEnum$4.call(b, prop))
21
- __defNormalProp$4(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
26
7
  const HiAffix = vue.defineComponent({
27
8
  name: "HiAffix",
28
- props: __spreadProps$4(__spreadValues$4({}, core.affixProps), {
9
+ props: {
10
+ ...core.affixProps,
29
11
  as: {
30
12
  type: String,
31
13
  default: "div"
32
- },
33
- wrapperAs: {
34
- type: String,
35
- default: "div"
36
14
  }
37
- }),
15
+ },
38
16
  setup(props, context) {
39
- const { classNames, wrapperRef, isFixed, placeholderStyle, fixedStyle } = core.useAffix(props, context);
17
+ const { className, wrapperRef, isFixed, placeholderStyle, fixedStyle } = core.useAffix(props, context);
40
18
  return () => vue.h(
41
19
  props.as,
42
20
  { ref: wrapperRef },
43
21
  [
44
22
  isFixed.value && vue.h("div", { style: placeholderStyle.value }),
45
- vue.h("div", { class: classNames.value, style: fixedStyle.value }, vue.renderSlot(context.slots, "default"))
23
+ vue.h("div", { class: className.value, style: fixedStyle.value }, vue.renderSlot(context.slots, "default"))
46
24
  ]
47
25
  );
48
26
  }
49
27
  });
50
28
 
51
- var __defProp$3 = Object.defineProperty;
52
- var __defProps$3 = Object.defineProperties;
53
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
54
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
55
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
56
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
57
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
58
- var __spreadValues$3 = (a, b) => {
59
- for (var prop in b || (b = {}))
60
- if (__hasOwnProp$3.call(b, prop))
61
- __defNormalProp$3(a, prop, b[prop]);
62
- if (__getOwnPropSymbols$3)
63
- for (var prop of __getOwnPropSymbols$3(b)) {
64
- if (__propIsEnum$3.call(b, prop))
65
- __defNormalProp$3(a, prop, b[prop]);
66
- }
67
- return a;
68
- };
69
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
70
29
  const HiSelection = vue.defineComponent({
71
30
  name: "HiSelection",
72
- props: __spreadProps$3(__spreadValues$3({}, core.selectionProps), {
31
+ props: {
32
+ ...core.selectionProps,
73
33
  as: {
74
34
  type: String,
75
35
  default: "div"
76
36
  }
77
- }),
37
+ },
78
38
  emits: core.selectionEmits,
79
39
  setup(props, context) {
80
40
  const { isActive, changeActive, renderItem } = core.useSelectionList(props, context);
@@ -88,33 +48,15 @@ const HiSelection = vue.defineComponent({
88
48
  }
89
49
  });
90
50
 
91
- var __defProp$2 = Object.defineProperty;
92
- var __defProps$2 = Object.defineProperties;
93
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
94
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
95
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
96
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
97
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
98
- var __spreadValues$2 = (a, b) => {
99
- for (var prop in b || (b = {}))
100
- if (__hasOwnProp$2.call(b, prop))
101
- __defNormalProp$2(a, prop, b[prop]);
102
- if (__getOwnPropSymbols$2)
103
- for (var prop of __getOwnPropSymbols$2(b)) {
104
- if (__propIsEnum$2.call(b, prop))
105
- __defNormalProp$2(a, prop, b[prop]);
106
- }
107
- return a;
108
- };
109
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
110
51
  const HiItem = vue.defineComponent({
111
52
  name: "HiItem",
112
- props: __spreadProps$2(__spreadValues$2({}, core.itemProps), {
53
+ props: {
54
+ ...core.itemProps,
113
55
  as: {
114
56
  type: String,
115
57
  default: "div"
116
58
  }
117
- }),
59
+ },
118
60
  setup(props, context) {
119
61
  const { render, activate, className, isDisabled, activateEvent } = core.useSelectionItem(
120
62
  props,
@@ -132,32 +74,14 @@ const HiItem = vue.defineComponent({
132
74
  }
133
75
  });
134
76
 
135
- var __defProp$1 = Object.defineProperty;
136
- var __defProps$1 = Object.defineProperties;
137
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
138
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
139
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
140
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
141
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
142
- var __spreadValues$1 = (a, b) => {
143
- for (var prop in b || (b = {}))
144
- if (__hasOwnProp$1.call(b, prop))
145
- __defNormalProp$1(a, prop, b[prop]);
146
- if (__getOwnPropSymbols$1)
147
- for (var prop of __getOwnPropSymbols$1(b)) {
148
- if (__propIsEnum$1.call(b, prop))
149
- __defNormalProp$1(a, prop, b[prop]);
150
- }
151
- return a;
152
- };
153
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
154
77
  const HiIcon = vue.defineComponent({
155
- props: __spreadProps$1(__spreadValues$1({}, core.iconProps), {
78
+ props: {
79
+ ...core.iconProps,
156
80
  as: {
157
81
  type: String,
158
- default: "i"
82
+ default: "div"
159
83
  }
160
- }),
84
+ },
161
85
  setup(props, context) {
162
86
  const { style } = core.useIcon(props, context);
163
87
  return () => {
@@ -168,43 +92,25 @@ const HiIcon = vue.defineComponent({
168
92
  }
169
93
  });
170
94
 
171
- var __defProp = Object.defineProperty;
172
- var __defProps = Object.defineProperties;
173
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
174
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
175
- var __hasOwnProp = Object.prototype.hasOwnProperty;
176
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
177
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
178
- var __spreadValues = (a, b) => {
179
- for (var prop in b || (b = {}))
180
- if (__hasOwnProp.call(b, prop))
181
- __defNormalProp(a, prop, b[prop]);
182
- if (__getOwnPropSymbols)
183
- for (var prop of __getOwnPropSymbols(b)) {
184
- if (__propIsEnum.call(b, prop))
185
- __defNormalProp(a, prop, b[prop]);
186
- }
187
- return a;
188
- };
189
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
190
95
  const HiSwitch = vue.defineComponent({
191
96
  name: "HiSwitch",
192
- props: __spreadProps(__spreadValues({}, core.switchProps), {
97
+ props: {
98
+ ...core.switchProps,
193
99
  as: {
194
100
  type: String,
195
101
  default: "div"
196
102
  }
197
- }),
103
+ },
198
104
  emits: core.switchEmits,
199
105
  setup(props, context) {
200
106
  const { slots } = context;
201
- const { className, toggle, modelValue, isDisabled } = core.useSwitch(props, context);
107
+ const { className, toggle, modelValue, isDisabled, activateEvent } = core.useSwitch(props, context);
202
108
  return () => {
203
109
  return vue.h(
204
110
  props.as,
205
111
  {
206
112
  class: className.value,
207
- [`on${tslx.capitalize(props.activateEvent)}`]: toggle
113
+ [`on${tslx.capitalize(activateEvent.value)}`]: toggle
208
114
  },
209
115
  vue.renderSlot(slots, "default", {
210
116
  active: modelValue.value,
package/dist/index.d.cts CHANGED
@@ -6,10 +6,6 @@ declare const HiAffix: vue.DefineComponent<{
6
6
  type: StringConstructor;
7
7
  default: string;
8
8
  };
9
- wrapperAs: {
10
- type: StringConstructor;
11
- default: string;
12
- };
13
9
  fixedClass: {
14
10
  type: StringConstructor;
15
11
  default: string;
@@ -23,7 +19,7 @@ declare const HiAffix: vue.DefineComponent<{
23
19
  default: string;
24
20
  };
25
21
  target: {
26
- type: vue.PropType<string | Window | HTMLElement>;
22
+ type: vue.PropType<string | HTMLElement>;
27
23
  };
28
24
  zIndex: {
29
25
  type: NumberConstructor;
@@ -36,10 +32,6 @@ declare const HiAffix: vue.DefineComponent<{
36
32
  type: StringConstructor;
37
33
  default: string;
38
34
  };
39
- wrapperAs: {
40
- type: StringConstructor;
41
- default: string;
42
- };
43
35
  fixedClass: {
44
36
  type: StringConstructor;
45
37
  default: string;
@@ -53,7 +45,7 @@ declare const HiAffix: vue.DefineComponent<{
53
45
  default: string;
54
46
  };
55
47
  target: {
56
- type: vue.PropType<string | Window | HTMLElement>;
48
+ type: vue.PropType<string | HTMLElement>;
57
49
  };
58
50
  zIndex: {
59
51
  type: NumberConstructor;
@@ -65,7 +57,6 @@ declare const HiAffix: vue.DefineComponent<{
65
57
  offsetType: "top" | "bottom";
66
58
  zIndex: number;
67
59
  as: string;
68
- wrapperAs: string;
69
60
  }, {}>;
70
61
 
71
62
  declare const HiSelection: vue.DefineComponent<{
@@ -109,7 +100,6 @@ declare const HiSelection: vue.DefineComponent<{
109
100
  };
110
101
  activateEvent: {
111
102
  type: vue.PropType<_hoci_core.ActivateEvent>;
112
- default: () => "click";
113
103
  };
114
104
  }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
115
105
  [key: string]: any;
@@ -154,7 +144,6 @@ declare const HiSelection: vue.DefineComponent<{
154
144
  };
155
145
  activateEvent: {
156
146
  type: vue.PropType<_hoci_core.ActivateEvent>;
157
- default: () => "click";
158
147
  };
159
148
  }>> & {
160
149
  onChange?: ((...args: any[]) => any) | undefined;
@@ -170,7 +159,6 @@ declare const HiSelection: vue.DefineComponent<{
170
159
  unactiveClass: string | string[] | Record<string, boolean>;
171
160
  clearable: boolean;
172
161
  defaultValue: any;
173
- activateEvent: _hoci_core.ActivateEvent;
174
162
  as: string;
175
163
  }, {}>;
176
164
 
@@ -246,7 +234,6 @@ declare const HiIcon: vue.DefineComponent<{
246
234
  };
247
235
  size: {
248
236
  type: (StringConstructor | NumberConstructor)[];
249
- default: string;
250
237
  };
251
238
  width: {
252
239
  type: (StringConstructor | NumberConstructor)[];
@@ -256,6 +243,7 @@ declare const HiIcon: vue.DefineComponent<{
256
243
  };
257
244
  color: {
258
245
  type: StringConstructor;
246
+ default: string;
259
247
  };
260
248
  mask: {
261
249
  type: vue.PropType<boolean | "auto">;
@@ -274,7 +262,6 @@ declare const HiIcon: vue.DefineComponent<{
274
262
  };
275
263
  size: {
276
264
  type: (StringConstructor | NumberConstructor)[];
277
- default: string;
278
265
  };
279
266
  width: {
280
267
  type: (StringConstructor | NumberConstructor)[];
@@ -284,6 +271,7 @@ declare const HiIcon: vue.DefineComponent<{
284
271
  };
285
272
  color: {
286
273
  type: StringConstructor;
274
+ default: string;
287
275
  };
288
276
  mask: {
289
277
  type: vue.PropType<boolean | "auto">;
@@ -291,7 +279,7 @@ declare const HiIcon: vue.DefineComponent<{
291
279
  };
292
280
  }>>, {
293
281
  mask: boolean | "auto";
294
- size: string | number;
282
+ color: string;
295
283
  as: string;
296
284
  }, {}>;
297
285
 
@@ -318,7 +306,6 @@ declare const HiSwitch: vue.DefineComponent<{
318
306
  };
319
307
  activateEvent: {
320
308
  type: vue.PropType<_hoci_core.ActivateEvent>;
321
- default: string;
322
309
  };
323
310
  disabled: {
324
311
  type: BooleanConstructor;
@@ -353,7 +340,6 @@ declare const HiSwitch: vue.DefineComponent<{
353
340
  };
354
341
  activateEvent: {
355
342
  type: vue.PropType<_hoci_core.ActivateEvent>;
356
- default: string;
357
343
  };
358
344
  disabled: {
359
345
  type: BooleanConstructor;
@@ -372,7 +358,6 @@ declare const HiSwitch: vue.DefineComponent<{
372
358
  activeClass: string | string[] | Record<string, boolean>;
373
359
  disabledClass: string | string[] | Record<string, boolean>;
374
360
  unactiveClass: string | string[] | Record<string, boolean>;
375
- activateEvent: _hoci_core.ActivateEvent;
376
361
  as: string;
377
362
  }, {}>;
378
363
 
package/dist/index.d.mts CHANGED
@@ -6,10 +6,6 @@ declare const HiAffix: vue.DefineComponent<{
6
6
  type: StringConstructor;
7
7
  default: string;
8
8
  };
9
- wrapperAs: {
10
- type: StringConstructor;
11
- default: string;
12
- };
13
9
  fixedClass: {
14
10
  type: StringConstructor;
15
11
  default: string;
@@ -23,7 +19,7 @@ declare const HiAffix: vue.DefineComponent<{
23
19
  default: string;
24
20
  };
25
21
  target: {
26
- type: vue.PropType<string | Window | HTMLElement>;
22
+ type: vue.PropType<string | HTMLElement>;
27
23
  };
28
24
  zIndex: {
29
25
  type: NumberConstructor;
@@ -36,10 +32,6 @@ declare const HiAffix: vue.DefineComponent<{
36
32
  type: StringConstructor;
37
33
  default: string;
38
34
  };
39
- wrapperAs: {
40
- type: StringConstructor;
41
- default: string;
42
- };
43
35
  fixedClass: {
44
36
  type: StringConstructor;
45
37
  default: string;
@@ -53,7 +45,7 @@ declare const HiAffix: vue.DefineComponent<{
53
45
  default: string;
54
46
  };
55
47
  target: {
56
- type: vue.PropType<string | Window | HTMLElement>;
48
+ type: vue.PropType<string | HTMLElement>;
57
49
  };
58
50
  zIndex: {
59
51
  type: NumberConstructor;
@@ -65,7 +57,6 @@ declare const HiAffix: vue.DefineComponent<{
65
57
  offsetType: "top" | "bottom";
66
58
  zIndex: number;
67
59
  as: string;
68
- wrapperAs: string;
69
60
  }, {}>;
70
61
 
71
62
  declare const HiSelection: vue.DefineComponent<{
@@ -109,7 +100,6 @@ declare const HiSelection: vue.DefineComponent<{
109
100
  };
110
101
  activateEvent: {
111
102
  type: vue.PropType<_hoci_core.ActivateEvent>;
112
- default: () => "click";
113
103
  };
114
104
  }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
115
105
  [key: string]: any;
@@ -154,7 +144,6 @@ declare const HiSelection: vue.DefineComponent<{
154
144
  };
155
145
  activateEvent: {
156
146
  type: vue.PropType<_hoci_core.ActivateEvent>;
157
- default: () => "click";
158
147
  };
159
148
  }>> & {
160
149
  onChange?: ((...args: any[]) => any) | undefined;
@@ -170,7 +159,6 @@ declare const HiSelection: vue.DefineComponent<{
170
159
  unactiveClass: string | string[] | Record<string, boolean>;
171
160
  clearable: boolean;
172
161
  defaultValue: any;
173
- activateEvent: _hoci_core.ActivateEvent;
174
162
  as: string;
175
163
  }, {}>;
176
164
 
@@ -246,7 +234,6 @@ declare const HiIcon: vue.DefineComponent<{
246
234
  };
247
235
  size: {
248
236
  type: (StringConstructor | NumberConstructor)[];
249
- default: string;
250
237
  };
251
238
  width: {
252
239
  type: (StringConstructor | NumberConstructor)[];
@@ -256,6 +243,7 @@ declare const HiIcon: vue.DefineComponent<{
256
243
  };
257
244
  color: {
258
245
  type: StringConstructor;
246
+ default: string;
259
247
  };
260
248
  mask: {
261
249
  type: vue.PropType<boolean | "auto">;
@@ -274,7 +262,6 @@ declare const HiIcon: vue.DefineComponent<{
274
262
  };
275
263
  size: {
276
264
  type: (StringConstructor | NumberConstructor)[];
277
- default: string;
278
265
  };
279
266
  width: {
280
267
  type: (StringConstructor | NumberConstructor)[];
@@ -284,6 +271,7 @@ declare const HiIcon: vue.DefineComponent<{
284
271
  };
285
272
  color: {
286
273
  type: StringConstructor;
274
+ default: string;
287
275
  };
288
276
  mask: {
289
277
  type: vue.PropType<boolean | "auto">;
@@ -291,7 +279,7 @@ declare const HiIcon: vue.DefineComponent<{
291
279
  };
292
280
  }>>, {
293
281
  mask: boolean | "auto";
294
- size: string | number;
282
+ color: string;
295
283
  as: string;
296
284
  }, {}>;
297
285
 
@@ -318,7 +306,6 @@ declare const HiSwitch: vue.DefineComponent<{
318
306
  };
319
307
  activateEvent: {
320
308
  type: vue.PropType<_hoci_core.ActivateEvent>;
321
- default: string;
322
309
  };
323
310
  disabled: {
324
311
  type: BooleanConstructor;
@@ -353,7 +340,6 @@ declare const HiSwitch: vue.DefineComponent<{
353
340
  };
354
341
  activateEvent: {
355
342
  type: vue.PropType<_hoci_core.ActivateEvent>;
356
- default: string;
357
343
  };
358
344
  disabled: {
359
345
  type: BooleanConstructor;
@@ -372,7 +358,6 @@ declare const HiSwitch: vue.DefineComponent<{
372
358
  activeClass: string | string[] | Record<string, boolean>;
373
359
  disabledClass: string | string[] | Record<string, boolean>;
374
360
  unactiveClass: string | string[] | Record<string, boolean>;
375
- activateEvent: _hoci_core.ActivateEvent;
376
361
  as: string;
377
362
  }, {}>;
378
363
 
package/dist/index.d.ts CHANGED
@@ -6,10 +6,6 @@ declare const HiAffix: vue.DefineComponent<{
6
6
  type: StringConstructor;
7
7
  default: string;
8
8
  };
9
- wrapperAs: {
10
- type: StringConstructor;
11
- default: string;
12
- };
13
9
  fixedClass: {
14
10
  type: StringConstructor;
15
11
  default: string;
@@ -23,7 +19,7 @@ declare const HiAffix: vue.DefineComponent<{
23
19
  default: string;
24
20
  };
25
21
  target: {
26
- type: vue.PropType<string | Window | HTMLElement>;
22
+ type: vue.PropType<string | HTMLElement>;
27
23
  };
28
24
  zIndex: {
29
25
  type: NumberConstructor;
@@ -36,10 +32,6 @@ declare const HiAffix: vue.DefineComponent<{
36
32
  type: StringConstructor;
37
33
  default: string;
38
34
  };
39
- wrapperAs: {
40
- type: StringConstructor;
41
- default: string;
42
- };
43
35
  fixedClass: {
44
36
  type: StringConstructor;
45
37
  default: string;
@@ -53,7 +45,7 @@ declare const HiAffix: vue.DefineComponent<{
53
45
  default: string;
54
46
  };
55
47
  target: {
56
- type: vue.PropType<string | Window | HTMLElement>;
48
+ type: vue.PropType<string | HTMLElement>;
57
49
  };
58
50
  zIndex: {
59
51
  type: NumberConstructor;
@@ -65,7 +57,6 @@ declare const HiAffix: vue.DefineComponent<{
65
57
  offsetType: "top" | "bottom";
66
58
  zIndex: number;
67
59
  as: string;
68
- wrapperAs: string;
69
60
  }, {}>;
70
61
 
71
62
  declare const HiSelection: vue.DefineComponent<{
@@ -109,7 +100,6 @@ declare const HiSelection: vue.DefineComponent<{
109
100
  };
110
101
  activateEvent: {
111
102
  type: vue.PropType<_hoci_core.ActivateEvent>;
112
- default: () => "click";
113
103
  };
114
104
  }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
115
105
  [key: string]: any;
@@ -154,7 +144,6 @@ declare const HiSelection: vue.DefineComponent<{
154
144
  };
155
145
  activateEvent: {
156
146
  type: vue.PropType<_hoci_core.ActivateEvent>;
157
- default: () => "click";
158
147
  };
159
148
  }>> & {
160
149
  onChange?: ((...args: any[]) => any) | undefined;
@@ -170,7 +159,6 @@ declare const HiSelection: vue.DefineComponent<{
170
159
  unactiveClass: string | string[] | Record<string, boolean>;
171
160
  clearable: boolean;
172
161
  defaultValue: any;
173
- activateEvent: _hoci_core.ActivateEvent;
174
162
  as: string;
175
163
  }, {}>;
176
164
 
@@ -246,7 +234,6 @@ declare const HiIcon: vue.DefineComponent<{
246
234
  };
247
235
  size: {
248
236
  type: (StringConstructor | NumberConstructor)[];
249
- default: string;
250
237
  };
251
238
  width: {
252
239
  type: (StringConstructor | NumberConstructor)[];
@@ -256,6 +243,7 @@ declare const HiIcon: vue.DefineComponent<{
256
243
  };
257
244
  color: {
258
245
  type: StringConstructor;
246
+ default: string;
259
247
  };
260
248
  mask: {
261
249
  type: vue.PropType<boolean | "auto">;
@@ -274,7 +262,6 @@ declare const HiIcon: vue.DefineComponent<{
274
262
  };
275
263
  size: {
276
264
  type: (StringConstructor | NumberConstructor)[];
277
- default: string;
278
265
  };
279
266
  width: {
280
267
  type: (StringConstructor | NumberConstructor)[];
@@ -284,6 +271,7 @@ declare const HiIcon: vue.DefineComponent<{
284
271
  };
285
272
  color: {
286
273
  type: StringConstructor;
274
+ default: string;
287
275
  };
288
276
  mask: {
289
277
  type: vue.PropType<boolean | "auto">;
@@ -291,7 +279,7 @@ declare const HiIcon: vue.DefineComponent<{
291
279
  };
292
280
  }>>, {
293
281
  mask: boolean | "auto";
294
- size: string | number;
282
+ color: string;
295
283
  as: string;
296
284
  }, {}>;
297
285
 
@@ -318,7 +306,6 @@ declare const HiSwitch: vue.DefineComponent<{
318
306
  };
319
307
  activateEvent: {
320
308
  type: vue.PropType<_hoci_core.ActivateEvent>;
321
- default: string;
322
309
  };
323
310
  disabled: {
324
311
  type: BooleanConstructor;
@@ -353,7 +340,6 @@ declare const HiSwitch: vue.DefineComponent<{
353
340
  };
354
341
  activateEvent: {
355
342
  type: vue.PropType<_hoci_core.ActivateEvent>;
356
- default: string;
357
343
  };
358
344
  disabled: {
359
345
  type: BooleanConstructor;
@@ -372,7 +358,6 @@ declare const HiSwitch: vue.DefineComponent<{
372
358
  activeClass: string | string[] | Record<string, boolean>;
373
359
  disabledClass: string | string[] | Record<string, boolean>;
374
360
  unactiveClass: string | string[] | Record<string, boolean>;
375
- activateEvent: _hoci_core.ActivateEvent;
376
361
  as: string;
377
362
  }, {}>;
378
363
 
package/dist/index.mjs CHANGED
@@ -1,78 +1,38 @@
1
1
  import { defineComponent, h, renderSlot, capitalize } from 'vue';
2
- import { useAffix, affixProps, selectionEmits, useSelectionList, selectionProps, useSelectionItem, itemProps, useIcon, iconProps, switchEmits, useSwitch, switchProps } from '@hoci/core';
2
+ import { affixProps, useAffix, selectionProps, selectionEmits, useSelectionList, itemProps, useSelectionItem, iconProps, useIcon, switchProps, switchEmits, useSwitch } from '@hoci/core';
3
3
  import { capitalize as capitalize$1 } from 'tslx';
4
4
 
5
- var __defProp$4 = Object.defineProperty;
6
- var __defProps$4 = Object.defineProperties;
7
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
8
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
9
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
10
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues$4 = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp$4.call(b, prop))
15
- __defNormalProp$4(a, prop, b[prop]);
16
- if (__getOwnPropSymbols$4)
17
- for (var prop of __getOwnPropSymbols$4(b)) {
18
- if (__propIsEnum$4.call(b, prop))
19
- __defNormalProp$4(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
24
5
  const HiAffix = defineComponent({
25
6
  name: "HiAffix",
26
- props: __spreadProps$4(__spreadValues$4({}, affixProps), {
7
+ props: {
8
+ ...affixProps,
27
9
  as: {
28
10
  type: String,
29
11
  default: "div"
30
- },
31
- wrapperAs: {
32
- type: String,
33
- default: "div"
34
12
  }
35
- }),
13
+ },
36
14
  setup(props, context) {
37
- const { classNames, wrapperRef, isFixed, placeholderStyle, fixedStyle } = useAffix(props, context);
15
+ const { className, wrapperRef, isFixed, placeholderStyle, fixedStyle } = useAffix(props, context);
38
16
  return () => h(
39
17
  props.as,
40
18
  { ref: wrapperRef },
41
19
  [
42
20
  isFixed.value && h("div", { style: placeholderStyle.value }),
43
- h("div", { class: classNames.value, style: fixedStyle.value }, renderSlot(context.slots, "default"))
21
+ h("div", { class: className.value, style: fixedStyle.value }, renderSlot(context.slots, "default"))
44
22
  ]
45
23
  );
46
24
  }
47
25
  });
48
26
 
49
- var __defProp$3 = Object.defineProperty;
50
- var __defProps$3 = Object.defineProperties;
51
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
52
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
53
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
54
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
55
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
56
- var __spreadValues$3 = (a, b) => {
57
- for (var prop in b || (b = {}))
58
- if (__hasOwnProp$3.call(b, prop))
59
- __defNormalProp$3(a, prop, b[prop]);
60
- if (__getOwnPropSymbols$3)
61
- for (var prop of __getOwnPropSymbols$3(b)) {
62
- if (__propIsEnum$3.call(b, prop))
63
- __defNormalProp$3(a, prop, b[prop]);
64
- }
65
- return a;
66
- };
67
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
68
27
  const HiSelection = defineComponent({
69
28
  name: "HiSelection",
70
- props: __spreadProps$3(__spreadValues$3({}, selectionProps), {
29
+ props: {
30
+ ...selectionProps,
71
31
  as: {
72
32
  type: String,
73
33
  default: "div"
74
34
  }
75
- }),
35
+ },
76
36
  emits: selectionEmits,
77
37
  setup(props, context) {
78
38
  const { isActive, changeActive, renderItem } = useSelectionList(props, context);
@@ -86,33 +46,15 @@ const HiSelection = defineComponent({
86
46
  }
87
47
  });
88
48
 
89
- var __defProp$2 = Object.defineProperty;
90
- var __defProps$2 = Object.defineProperties;
91
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
92
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
93
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
94
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
95
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
96
- var __spreadValues$2 = (a, b) => {
97
- for (var prop in b || (b = {}))
98
- if (__hasOwnProp$2.call(b, prop))
99
- __defNormalProp$2(a, prop, b[prop]);
100
- if (__getOwnPropSymbols$2)
101
- for (var prop of __getOwnPropSymbols$2(b)) {
102
- if (__propIsEnum$2.call(b, prop))
103
- __defNormalProp$2(a, prop, b[prop]);
104
- }
105
- return a;
106
- };
107
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
108
49
  const HiItem = defineComponent({
109
50
  name: "HiItem",
110
- props: __spreadProps$2(__spreadValues$2({}, itemProps), {
51
+ props: {
52
+ ...itemProps,
111
53
  as: {
112
54
  type: String,
113
55
  default: "div"
114
56
  }
115
- }),
57
+ },
116
58
  setup(props, context) {
117
59
  const { render, activate, className, isDisabled, activateEvent } = useSelectionItem(
118
60
  props,
@@ -130,32 +72,14 @@ const HiItem = defineComponent({
130
72
  }
131
73
  });
132
74
 
133
- var __defProp$1 = Object.defineProperty;
134
- var __defProps$1 = Object.defineProperties;
135
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
136
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
137
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
138
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
139
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
140
- var __spreadValues$1 = (a, b) => {
141
- for (var prop in b || (b = {}))
142
- if (__hasOwnProp$1.call(b, prop))
143
- __defNormalProp$1(a, prop, b[prop]);
144
- if (__getOwnPropSymbols$1)
145
- for (var prop of __getOwnPropSymbols$1(b)) {
146
- if (__propIsEnum$1.call(b, prop))
147
- __defNormalProp$1(a, prop, b[prop]);
148
- }
149
- return a;
150
- };
151
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
152
75
  const HiIcon = defineComponent({
153
- props: __spreadProps$1(__spreadValues$1({}, iconProps), {
76
+ props: {
77
+ ...iconProps,
154
78
  as: {
155
79
  type: String,
156
- default: "i"
80
+ default: "div"
157
81
  }
158
- }),
82
+ },
159
83
  setup(props, context) {
160
84
  const { style } = useIcon(props, context);
161
85
  return () => {
@@ -166,43 +90,25 @@ const HiIcon = defineComponent({
166
90
  }
167
91
  });
168
92
 
169
- var __defProp = Object.defineProperty;
170
- var __defProps = Object.defineProperties;
171
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
172
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
173
- var __hasOwnProp = Object.prototype.hasOwnProperty;
174
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
175
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
176
- var __spreadValues = (a, b) => {
177
- for (var prop in b || (b = {}))
178
- if (__hasOwnProp.call(b, prop))
179
- __defNormalProp(a, prop, b[prop]);
180
- if (__getOwnPropSymbols)
181
- for (var prop of __getOwnPropSymbols(b)) {
182
- if (__propIsEnum.call(b, prop))
183
- __defNormalProp(a, prop, b[prop]);
184
- }
185
- return a;
186
- };
187
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
188
93
  const HiSwitch = defineComponent({
189
94
  name: "HiSwitch",
190
- props: __spreadProps(__spreadValues({}, switchProps), {
95
+ props: {
96
+ ...switchProps,
191
97
  as: {
192
98
  type: String,
193
99
  default: "div"
194
100
  }
195
- }),
101
+ },
196
102
  emits: switchEmits,
197
103
  setup(props, context) {
198
104
  const { slots } = context;
199
- const { className, toggle, modelValue, isDisabled } = useSwitch(props, context);
105
+ const { className, toggle, modelValue, isDisabled, activateEvent } = useSwitch(props, context);
200
106
  return () => {
201
107
  return h(
202
108
  props.as,
203
109
  {
204
110
  class: className.value,
205
- [`on${capitalize$1(props.activateEvent)}`]: toggle
111
+ [`on${capitalize$1(activateEvent.value)}`]: toggle
206
112
  },
207
113
  renderSlot(slots, "default", {
208
114
  active: modelValue.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoci/components",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "author": "chizuki",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  "sideEffects": false,
13
13
  "exports": {
14
14
  ".": {
15
+ "types": "./dist/index.d.ts",
15
16
  "require": "./dist/index.cjs",
16
17
  "import": "./dist/index.mjs"
17
18
  },
@@ -28,10 +29,10 @@
28
29
  "vue": "^3.3.4"
29
30
  },
30
31
  "dependencies": {
31
- "@vueuse/core": "^10.4.1",
32
- "maybe-types": "^0.0.3",
33
- "tslx": "^0.1.0",
34
- "@hoci/core": "0.2.1"
32
+ "@vueuse/core": "^10.5.0",
33
+ "maybe-types": "^0.1.0",
34
+ "tslx": "^0.1.1",
35
+ "@hoci/core": "0.4.0"
35
36
  },
36
37
  "scripts": {
37
38
  "build": "unbuild",