@hoci/components 0.3.0 → 0.4.2
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 +36 -114
- package/dist/index.d.cts +9 -21
- package/dist/index.d.mts +9 -21
- package/dist/index.d.ts +9 -21
- package/dist/index.mjs +37 -116
- package/package.json +6 -5
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:
|
|
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 {
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
78
|
+
props: {
|
|
79
|
+
...core.iconProps,
|
|
156
80
|
as: {
|
|
157
81
|
type: String,
|
|
158
|
-
default: "
|
|
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:
|
|
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(
|
|
113
|
+
[`on${tslx.capitalize(activateEvent.value)}`]: toggle
|
|
208
114
|
},
|
|
209
115
|
vue.renderSlot(slots, "default", {
|
|
210
116
|
active: modelValue.value,
|
|
@@ -215,8 +121,24 @@ const HiSwitch = vue.defineComponent({
|
|
|
215
121
|
}
|
|
216
122
|
});
|
|
217
123
|
|
|
124
|
+
const components = {
|
|
125
|
+
__proto__: null,
|
|
126
|
+
HiAffix: HiAffix,
|
|
127
|
+
HiIcon: HiIcon,
|
|
128
|
+
HiItem: HiItem,
|
|
129
|
+
HiSelection: HiSelection,
|
|
130
|
+
HiSwitch: HiSwitch
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const install = (app) => {
|
|
134
|
+
for (const key in components) {
|
|
135
|
+
app.component(key, components[key]);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
218
139
|
exports.HiAffix = HiAffix;
|
|
219
140
|
exports.HiIcon = HiIcon;
|
|
220
141
|
exports.HiItem = HiItem;
|
|
221
142
|
exports.HiSelection = HiSelection;
|
|
222
143
|
exports.HiSwitch = HiSwitch;
|
|
144
|
+
exports.install = install;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
+
import { App } from 'vue';
|
|
2
3
|
import * as _hoci_core from '@hoci/core';
|
|
3
4
|
|
|
4
5
|
declare const HiAffix: vue.DefineComponent<{
|
|
@@ -6,10 +7,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
6
7
|
type: StringConstructor;
|
|
7
8
|
default: string;
|
|
8
9
|
};
|
|
9
|
-
wrapperAs: {
|
|
10
|
-
type: StringConstructor;
|
|
11
|
-
default: string;
|
|
12
|
-
};
|
|
13
10
|
fixedClass: {
|
|
14
11
|
type: StringConstructor;
|
|
15
12
|
default: string;
|
|
@@ -23,7 +20,7 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
23
20
|
default: string;
|
|
24
21
|
};
|
|
25
22
|
target: {
|
|
26
|
-
type: vue.PropType<string |
|
|
23
|
+
type: vue.PropType<string | HTMLElement>;
|
|
27
24
|
};
|
|
28
25
|
zIndex: {
|
|
29
26
|
type: NumberConstructor;
|
|
@@ -36,10 +33,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
36
33
|
type: StringConstructor;
|
|
37
34
|
default: string;
|
|
38
35
|
};
|
|
39
|
-
wrapperAs: {
|
|
40
|
-
type: StringConstructor;
|
|
41
|
-
default: string;
|
|
42
|
-
};
|
|
43
36
|
fixedClass: {
|
|
44
37
|
type: StringConstructor;
|
|
45
38
|
default: string;
|
|
@@ -53,7 +46,7 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
53
46
|
default: string;
|
|
54
47
|
};
|
|
55
48
|
target: {
|
|
56
|
-
type: vue.PropType<string |
|
|
49
|
+
type: vue.PropType<string | HTMLElement>;
|
|
57
50
|
};
|
|
58
51
|
zIndex: {
|
|
59
52
|
type: NumberConstructor;
|
|
@@ -65,7 +58,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
65
58
|
offsetType: "top" | "bottom";
|
|
66
59
|
zIndex: number;
|
|
67
60
|
as: string;
|
|
68
|
-
wrapperAs: string;
|
|
69
61
|
}, {}>;
|
|
70
62
|
|
|
71
63
|
declare const HiSelection: vue.DefineComponent<{
|
|
@@ -109,7 +101,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
109
101
|
};
|
|
110
102
|
activateEvent: {
|
|
111
103
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
112
|
-
default: () => "click";
|
|
113
104
|
};
|
|
114
105
|
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
115
106
|
[key: string]: any;
|
|
@@ -154,7 +145,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
154
145
|
};
|
|
155
146
|
activateEvent: {
|
|
156
147
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
157
|
-
default: () => "click";
|
|
158
148
|
};
|
|
159
149
|
}>> & {
|
|
160
150
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -170,7 +160,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
170
160
|
unactiveClass: string | string[] | Record<string, boolean>;
|
|
171
161
|
clearable: boolean;
|
|
172
162
|
defaultValue: any;
|
|
173
|
-
activateEvent: _hoci_core.ActivateEvent;
|
|
174
163
|
as: string;
|
|
175
164
|
}, {}>;
|
|
176
165
|
|
|
@@ -246,7 +235,6 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
246
235
|
};
|
|
247
236
|
size: {
|
|
248
237
|
type: (StringConstructor | NumberConstructor)[];
|
|
249
|
-
default: string;
|
|
250
238
|
};
|
|
251
239
|
width: {
|
|
252
240
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -256,6 +244,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
256
244
|
};
|
|
257
245
|
color: {
|
|
258
246
|
type: StringConstructor;
|
|
247
|
+
default: string;
|
|
259
248
|
};
|
|
260
249
|
mask: {
|
|
261
250
|
type: vue.PropType<boolean | "auto">;
|
|
@@ -274,7 +263,6 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
274
263
|
};
|
|
275
264
|
size: {
|
|
276
265
|
type: (StringConstructor | NumberConstructor)[];
|
|
277
|
-
default: string;
|
|
278
266
|
};
|
|
279
267
|
width: {
|
|
280
268
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -284,6 +272,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
284
272
|
};
|
|
285
273
|
color: {
|
|
286
274
|
type: StringConstructor;
|
|
275
|
+
default: string;
|
|
287
276
|
};
|
|
288
277
|
mask: {
|
|
289
278
|
type: vue.PropType<boolean | "auto">;
|
|
@@ -291,7 +280,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
291
280
|
};
|
|
292
281
|
}>>, {
|
|
293
282
|
mask: boolean | "auto";
|
|
294
|
-
|
|
283
|
+
color: string;
|
|
295
284
|
as: string;
|
|
296
285
|
}, {}>;
|
|
297
286
|
|
|
@@ -318,7 +307,6 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
318
307
|
};
|
|
319
308
|
activateEvent: {
|
|
320
309
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
321
|
-
default: string;
|
|
322
310
|
};
|
|
323
311
|
disabled: {
|
|
324
312
|
type: BooleanConstructor;
|
|
@@ -353,7 +341,6 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
353
341
|
};
|
|
354
342
|
activateEvent: {
|
|
355
343
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
356
|
-
default: string;
|
|
357
344
|
};
|
|
358
345
|
disabled: {
|
|
359
346
|
type: BooleanConstructor;
|
|
@@ -372,8 +359,9 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
372
359
|
activeClass: string | string[] | Record<string, boolean>;
|
|
373
360
|
disabledClass: string | string[] | Record<string, boolean>;
|
|
374
361
|
unactiveClass: string | string[] | Record<string, boolean>;
|
|
375
|
-
activateEvent: _hoci_core.ActivateEvent;
|
|
376
362
|
as: string;
|
|
377
363
|
}, {}>;
|
|
378
364
|
|
|
379
|
-
|
|
365
|
+
declare const install: (app: App) => void;
|
|
366
|
+
|
|
367
|
+
export { HiAffix, HiIcon, HiItem, HiSelection, HiSwitch, install };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
+
import { App } from 'vue';
|
|
2
3
|
import * as _hoci_core from '@hoci/core';
|
|
3
4
|
|
|
4
5
|
declare const HiAffix: vue.DefineComponent<{
|
|
@@ -6,10 +7,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
6
7
|
type: StringConstructor;
|
|
7
8
|
default: string;
|
|
8
9
|
};
|
|
9
|
-
wrapperAs: {
|
|
10
|
-
type: StringConstructor;
|
|
11
|
-
default: string;
|
|
12
|
-
};
|
|
13
10
|
fixedClass: {
|
|
14
11
|
type: StringConstructor;
|
|
15
12
|
default: string;
|
|
@@ -23,7 +20,7 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
23
20
|
default: string;
|
|
24
21
|
};
|
|
25
22
|
target: {
|
|
26
|
-
type: vue.PropType<string |
|
|
23
|
+
type: vue.PropType<string | HTMLElement>;
|
|
27
24
|
};
|
|
28
25
|
zIndex: {
|
|
29
26
|
type: NumberConstructor;
|
|
@@ -36,10 +33,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
36
33
|
type: StringConstructor;
|
|
37
34
|
default: string;
|
|
38
35
|
};
|
|
39
|
-
wrapperAs: {
|
|
40
|
-
type: StringConstructor;
|
|
41
|
-
default: string;
|
|
42
|
-
};
|
|
43
36
|
fixedClass: {
|
|
44
37
|
type: StringConstructor;
|
|
45
38
|
default: string;
|
|
@@ -53,7 +46,7 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
53
46
|
default: string;
|
|
54
47
|
};
|
|
55
48
|
target: {
|
|
56
|
-
type: vue.PropType<string |
|
|
49
|
+
type: vue.PropType<string | HTMLElement>;
|
|
57
50
|
};
|
|
58
51
|
zIndex: {
|
|
59
52
|
type: NumberConstructor;
|
|
@@ -65,7 +58,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
65
58
|
offsetType: "top" | "bottom";
|
|
66
59
|
zIndex: number;
|
|
67
60
|
as: string;
|
|
68
|
-
wrapperAs: string;
|
|
69
61
|
}, {}>;
|
|
70
62
|
|
|
71
63
|
declare const HiSelection: vue.DefineComponent<{
|
|
@@ -109,7 +101,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
109
101
|
};
|
|
110
102
|
activateEvent: {
|
|
111
103
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
112
|
-
default: () => "click";
|
|
113
104
|
};
|
|
114
105
|
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
115
106
|
[key: string]: any;
|
|
@@ -154,7 +145,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
154
145
|
};
|
|
155
146
|
activateEvent: {
|
|
156
147
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
157
|
-
default: () => "click";
|
|
158
148
|
};
|
|
159
149
|
}>> & {
|
|
160
150
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -170,7 +160,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
170
160
|
unactiveClass: string | string[] | Record<string, boolean>;
|
|
171
161
|
clearable: boolean;
|
|
172
162
|
defaultValue: any;
|
|
173
|
-
activateEvent: _hoci_core.ActivateEvent;
|
|
174
163
|
as: string;
|
|
175
164
|
}, {}>;
|
|
176
165
|
|
|
@@ -246,7 +235,6 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
246
235
|
};
|
|
247
236
|
size: {
|
|
248
237
|
type: (StringConstructor | NumberConstructor)[];
|
|
249
|
-
default: string;
|
|
250
238
|
};
|
|
251
239
|
width: {
|
|
252
240
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -256,6 +244,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
256
244
|
};
|
|
257
245
|
color: {
|
|
258
246
|
type: StringConstructor;
|
|
247
|
+
default: string;
|
|
259
248
|
};
|
|
260
249
|
mask: {
|
|
261
250
|
type: vue.PropType<boolean | "auto">;
|
|
@@ -274,7 +263,6 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
274
263
|
};
|
|
275
264
|
size: {
|
|
276
265
|
type: (StringConstructor | NumberConstructor)[];
|
|
277
|
-
default: string;
|
|
278
266
|
};
|
|
279
267
|
width: {
|
|
280
268
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -284,6 +272,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
284
272
|
};
|
|
285
273
|
color: {
|
|
286
274
|
type: StringConstructor;
|
|
275
|
+
default: string;
|
|
287
276
|
};
|
|
288
277
|
mask: {
|
|
289
278
|
type: vue.PropType<boolean | "auto">;
|
|
@@ -291,7 +280,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
291
280
|
};
|
|
292
281
|
}>>, {
|
|
293
282
|
mask: boolean | "auto";
|
|
294
|
-
|
|
283
|
+
color: string;
|
|
295
284
|
as: string;
|
|
296
285
|
}, {}>;
|
|
297
286
|
|
|
@@ -318,7 +307,6 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
318
307
|
};
|
|
319
308
|
activateEvent: {
|
|
320
309
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
321
|
-
default: string;
|
|
322
310
|
};
|
|
323
311
|
disabled: {
|
|
324
312
|
type: BooleanConstructor;
|
|
@@ -353,7 +341,6 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
353
341
|
};
|
|
354
342
|
activateEvent: {
|
|
355
343
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
356
|
-
default: string;
|
|
357
344
|
};
|
|
358
345
|
disabled: {
|
|
359
346
|
type: BooleanConstructor;
|
|
@@ -372,8 +359,9 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
372
359
|
activeClass: string | string[] | Record<string, boolean>;
|
|
373
360
|
disabledClass: string | string[] | Record<string, boolean>;
|
|
374
361
|
unactiveClass: string | string[] | Record<string, boolean>;
|
|
375
|
-
activateEvent: _hoci_core.ActivateEvent;
|
|
376
362
|
as: string;
|
|
377
363
|
}, {}>;
|
|
378
364
|
|
|
379
|
-
|
|
365
|
+
declare const install: (app: App) => void;
|
|
366
|
+
|
|
367
|
+
export { HiAffix, HiIcon, HiItem, HiSelection, HiSwitch, install };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
+
import { App } from 'vue';
|
|
2
3
|
import * as _hoci_core from '@hoci/core';
|
|
3
4
|
|
|
4
5
|
declare const HiAffix: vue.DefineComponent<{
|
|
@@ -6,10 +7,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
6
7
|
type: StringConstructor;
|
|
7
8
|
default: string;
|
|
8
9
|
};
|
|
9
|
-
wrapperAs: {
|
|
10
|
-
type: StringConstructor;
|
|
11
|
-
default: string;
|
|
12
|
-
};
|
|
13
10
|
fixedClass: {
|
|
14
11
|
type: StringConstructor;
|
|
15
12
|
default: string;
|
|
@@ -23,7 +20,7 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
23
20
|
default: string;
|
|
24
21
|
};
|
|
25
22
|
target: {
|
|
26
|
-
type: vue.PropType<string |
|
|
23
|
+
type: vue.PropType<string | HTMLElement>;
|
|
27
24
|
};
|
|
28
25
|
zIndex: {
|
|
29
26
|
type: NumberConstructor;
|
|
@@ -36,10 +33,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
36
33
|
type: StringConstructor;
|
|
37
34
|
default: string;
|
|
38
35
|
};
|
|
39
|
-
wrapperAs: {
|
|
40
|
-
type: StringConstructor;
|
|
41
|
-
default: string;
|
|
42
|
-
};
|
|
43
36
|
fixedClass: {
|
|
44
37
|
type: StringConstructor;
|
|
45
38
|
default: string;
|
|
@@ -53,7 +46,7 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
53
46
|
default: string;
|
|
54
47
|
};
|
|
55
48
|
target: {
|
|
56
|
-
type: vue.PropType<string |
|
|
49
|
+
type: vue.PropType<string | HTMLElement>;
|
|
57
50
|
};
|
|
58
51
|
zIndex: {
|
|
59
52
|
type: NumberConstructor;
|
|
@@ -65,7 +58,6 @@ declare const HiAffix: vue.DefineComponent<{
|
|
|
65
58
|
offsetType: "top" | "bottom";
|
|
66
59
|
zIndex: number;
|
|
67
60
|
as: string;
|
|
68
|
-
wrapperAs: string;
|
|
69
61
|
}, {}>;
|
|
70
62
|
|
|
71
63
|
declare const HiSelection: vue.DefineComponent<{
|
|
@@ -109,7 +101,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
109
101
|
};
|
|
110
102
|
activateEvent: {
|
|
111
103
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
112
|
-
default: () => "click";
|
|
113
104
|
};
|
|
114
105
|
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
115
106
|
[key: string]: any;
|
|
@@ -154,7 +145,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
154
145
|
};
|
|
155
146
|
activateEvent: {
|
|
156
147
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
157
|
-
default: () => "click";
|
|
158
148
|
};
|
|
159
149
|
}>> & {
|
|
160
150
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -170,7 +160,6 @@ declare const HiSelection: vue.DefineComponent<{
|
|
|
170
160
|
unactiveClass: string | string[] | Record<string, boolean>;
|
|
171
161
|
clearable: boolean;
|
|
172
162
|
defaultValue: any;
|
|
173
|
-
activateEvent: _hoci_core.ActivateEvent;
|
|
174
163
|
as: string;
|
|
175
164
|
}, {}>;
|
|
176
165
|
|
|
@@ -246,7 +235,6 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
246
235
|
};
|
|
247
236
|
size: {
|
|
248
237
|
type: (StringConstructor | NumberConstructor)[];
|
|
249
|
-
default: string;
|
|
250
238
|
};
|
|
251
239
|
width: {
|
|
252
240
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -256,6 +244,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
256
244
|
};
|
|
257
245
|
color: {
|
|
258
246
|
type: StringConstructor;
|
|
247
|
+
default: string;
|
|
259
248
|
};
|
|
260
249
|
mask: {
|
|
261
250
|
type: vue.PropType<boolean | "auto">;
|
|
@@ -274,7 +263,6 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
274
263
|
};
|
|
275
264
|
size: {
|
|
276
265
|
type: (StringConstructor | NumberConstructor)[];
|
|
277
|
-
default: string;
|
|
278
266
|
};
|
|
279
267
|
width: {
|
|
280
268
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -284,6 +272,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
284
272
|
};
|
|
285
273
|
color: {
|
|
286
274
|
type: StringConstructor;
|
|
275
|
+
default: string;
|
|
287
276
|
};
|
|
288
277
|
mask: {
|
|
289
278
|
type: vue.PropType<boolean | "auto">;
|
|
@@ -291,7 +280,7 @@ declare const HiIcon: vue.DefineComponent<{
|
|
|
291
280
|
};
|
|
292
281
|
}>>, {
|
|
293
282
|
mask: boolean | "auto";
|
|
294
|
-
|
|
283
|
+
color: string;
|
|
295
284
|
as: string;
|
|
296
285
|
}, {}>;
|
|
297
286
|
|
|
@@ -318,7 +307,6 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
318
307
|
};
|
|
319
308
|
activateEvent: {
|
|
320
309
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
321
|
-
default: string;
|
|
322
310
|
};
|
|
323
311
|
disabled: {
|
|
324
312
|
type: BooleanConstructor;
|
|
@@ -353,7 +341,6 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
353
341
|
};
|
|
354
342
|
activateEvent: {
|
|
355
343
|
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
356
|
-
default: string;
|
|
357
344
|
};
|
|
358
345
|
disabled: {
|
|
359
346
|
type: BooleanConstructor;
|
|
@@ -372,8 +359,9 @@ declare const HiSwitch: vue.DefineComponent<{
|
|
|
372
359
|
activeClass: string | string[] | Record<string, boolean>;
|
|
373
360
|
disabledClass: string | string[] | Record<string, boolean>;
|
|
374
361
|
unactiveClass: string | string[] | Record<string, boolean>;
|
|
375
|
-
activateEvent: _hoci_core.ActivateEvent;
|
|
376
362
|
as: string;
|
|
377
363
|
}, {}>;
|
|
378
364
|
|
|
379
|
-
|
|
365
|
+
declare const install: (app: App) => void;
|
|
366
|
+
|
|
367
|
+
export { HiAffix, HiIcon, HiItem, HiSelection, HiSwitch, install };
|
package/dist/index.mjs
CHANGED
|
@@ -1,78 +1,38 @@
|
|
|
1
1
|
import { defineComponent, h, renderSlot, capitalize } from 'vue';
|
|
2
|
-
import { useAffix,
|
|
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:
|
|
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 {
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
76
|
+
props: {
|
|
77
|
+
...iconProps,
|
|
154
78
|
as: {
|
|
155
79
|
type: String,
|
|
156
|
-
default: "
|
|
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:
|
|
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(
|
|
111
|
+
[`on${capitalize$1(activateEvent.value)}`]: toggle
|
|
206
112
|
},
|
|
207
113
|
renderSlot(slots, "default", {
|
|
208
114
|
active: modelValue.value,
|
|
@@ -213,4 +119,19 @@ const HiSwitch = defineComponent({
|
|
|
213
119
|
}
|
|
214
120
|
});
|
|
215
121
|
|
|
216
|
-
|
|
122
|
+
const components = {
|
|
123
|
+
__proto__: null,
|
|
124
|
+
HiAffix: HiAffix,
|
|
125
|
+
HiIcon: HiIcon,
|
|
126
|
+
HiItem: HiItem,
|
|
127
|
+
HiSelection: HiSelection,
|
|
128
|
+
HiSwitch: HiSwitch
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const install = (app) => {
|
|
132
|
+
for (const key in components) {
|
|
133
|
+
app.component(key, components[key]);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export { HiAffix, HiIcon, HiItem, HiSelection, HiSwitch, install };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hoci/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
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.
|
|
32
|
-
"maybe-types": "^0.0
|
|
33
|
-
"tslx": "^0.1.
|
|
34
|
-
"@hoci/core": "0.
|
|
32
|
+
"@vueuse/core": "^10.5.0",
|
|
33
|
+
"maybe-types": "^0.1.0",
|
|
34
|
+
"tslx": "^0.1.1",
|
|
35
|
+
"@hoci/core": "0.4.2"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "unbuild",
|