@hoci/components 0.2.1
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/LICENSE +21 -0
- package/dist/index.cjs +222 -0
- package/dist/index.d.cts +379 -0
- package/dist/index.d.mts +379 -0
- package/dist/index.d.ts +379 -0
- package/dist/index.mjs +216 -0
- package/package.json +41 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import * as _hoci_core from '@hoci/core';
|
|
3
|
+
|
|
4
|
+
declare const HiAffix: vue.DefineComponent<{
|
|
5
|
+
as: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
wrapperAs: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
fixedClass: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
offset: {
|
|
18
|
+
type: NumberConstructor;
|
|
19
|
+
default: number;
|
|
20
|
+
};
|
|
21
|
+
offsetType: {
|
|
22
|
+
type: vue.PropType<"top" | "bottom">;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
target: {
|
|
26
|
+
type: vue.PropType<string | Window | HTMLElement>;
|
|
27
|
+
};
|
|
28
|
+
zIndex: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
35
|
+
as: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
wrapperAs: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
fixedClass: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
offset: {
|
|
48
|
+
type: NumberConstructor;
|
|
49
|
+
default: number;
|
|
50
|
+
};
|
|
51
|
+
offsetType: {
|
|
52
|
+
type: vue.PropType<"top" | "bottom">;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
target: {
|
|
56
|
+
type: vue.PropType<string | Window | HTMLElement>;
|
|
57
|
+
};
|
|
58
|
+
zIndex: {
|
|
59
|
+
type: NumberConstructor;
|
|
60
|
+
default: number;
|
|
61
|
+
};
|
|
62
|
+
}>>, {
|
|
63
|
+
fixedClass: string;
|
|
64
|
+
offset: number;
|
|
65
|
+
offsetType: "top" | "bottom";
|
|
66
|
+
zIndex: number;
|
|
67
|
+
as: string;
|
|
68
|
+
wrapperAs: string;
|
|
69
|
+
}, {}>;
|
|
70
|
+
|
|
71
|
+
declare const HiSelection: vue.DefineComponent<{
|
|
72
|
+
as: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
default: string;
|
|
75
|
+
};
|
|
76
|
+
modelValue: {
|
|
77
|
+
type: vue.PropType<any>;
|
|
78
|
+
default: () => null;
|
|
79
|
+
};
|
|
80
|
+
activeClass: {
|
|
81
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
84
|
+
itemClass: {
|
|
85
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
86
|
+
default: string;
|
|
87
|
+
};
|
|
88
|
+
disabledClass: {
|
|
89
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
90
|
+
default: string;
|
|
91
|
+
};
|
|
92
|
+
unactiveClass: {
|
|
93
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
94
|
+
default: string;
|
|
95
|
+
};
|
|
96
|
+
label: {
|
|
97
|
+
type: vue.PropType<string | ((val?: any) => string) | null>;
|
|
98
|
+
};
|
|
99
|
+
multiple: {
|
|
100
|
+
type: (NumberConstructor | BooleanConstructor)[];
|
|
101
|
+
default: () => false;
|
|
102
|
+
};
|
|
103
|
+
clearable: {
|
|
104
|
+
type: BooleanConstructor;
|
|
105
|
+
};
|
|
106
|
+
defaultValue: {
|
|
107
|
+
type: vue.PropType<any>;
|
|
108
|
+
default: () => null;
|
|
109
|
+
};
|
|
110
|
+
activateEvent: {
|
|
111
|
+
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
112
|
+
default: () => "click";
|
|
113
|
+
};
|
|
114
|
+
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
115
|
+
[key: string]: any;
|
|
116
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "load" | "unload" | "update:modelValue")[], "change" | "load" | "unload" | "update:modelValue", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
117
|
+
as: {
|
|
118
|
+
type: StringConstructor;
|
|
119
|
+
default: string;
|
|
120
|
+
};
|
|
121
|
+
modelValue: {
|
|
122
|
+
type: vue.PropType<any>;
|
|
123
|
+
default: () => null;
|
|
124
|
+
};
|
|
125
|
+
activeClass: {
|
|
126
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
127
|
+
default: string;
|
|
128
|
+
};
|
|
129
|
+
itemClass: {
|
|
130
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
disabledClass: {
|
|
134
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
unactiveClass: {
|
|
138
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
139
|
+
default: string;
|
|
140
|
+
};
|
|
141
|
+
label: {
|
|
142
|
+
type: vue.PropType<string | ((val?: any) => string) | null>;
|
|
143
|
+
};
|
|
144
|
+
multiple: {
|
|
145
|
+
type: (NumberConstructor | BooleanConstructor)[];
|
|
146
|
+
default: () => false;
|
|
147
|
+
};
|
|
148
|
+
clearable: {
|
|
149
|
+
type: BooleanConstructor;
|
|
150
|
+
};
|
|
151
|
+
defaultValue: {
|
|
152
|
+
type: vue.PropType<any>;
|
|
153
|
+
default: () => null;
|
|
154
|
+
};
|
|
155
|
+
activateEvent: {
|
|
156
|
+
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
157
|
+
default: () => "click";
|
|
158
|
+
};
|
|
159
|
+
}>> & {
|
|
160
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
161
|
+
onLoad?: ((...args: any[]) => any) | undefined;
|
|
162
|
+
onUnload?: ((...args: any[]) => any) | undefined;
|
|
163
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
multiple: number | boolean;
|
|
166
|
+
modelValue: any;
|
|
167
|
+
activeClass: string | string[] | Record<string, boolean>;
|
|
168
|
+
itemClass: string | string[] | Record<string, boolean>;
|
|
169
|
+
disabledClass: string | string[] | Record<string, boolean>;
|
|
170
|
+
unactiveClass: string | string[] | Record<string, boolean>;
|
|
171
|
+
clearable: boolean;
|
|
172
|
+
defaultValue: any;
|
|
173
|
+
activateEvent: _hoci_core.ActivateEvent;
|
|
174
|
+
as: string;
|
|
175
|
+
}, {}>;
|
|
176
|
+
|
|
177
|
+
declare const HiItem: vue.DefineComponent<{
|
|
178
|
+
as: {
|
|
179
|
+
type: StringConstructor;
|
|
180
|
+
default: string;
|
|
181
|
+
};
|
|
182
|
+
value: {
|
|
183
|
+
type: vue.PropType<any>;
|
|
184
|
+
default(): string;
|
|
185
|
+
};
|
|
186
|
+
label: {
|
|
187
|
+
type: vue.PropType<_hoci_core.ElementLike | ((val: any) => string) | null>;
|
|
188
|
+
};
|
|
189
|
+
keepAlive: {
|
|
190
|
+
type: BooleanConstructor;
|
|
191
|
+
default: () => true;
|
|
192
|
+
};
|
|
193
|
+
key: {
|
|
194
|
+
type: vue.PropType<string | number | symbol>;
|
|
195
|
+
};
|
|
196
|
+
activateEvent: {
|
|
197
|
+
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
198
|
+
};
|
|
199
|
+
disabled: {
|
|
200
|
+
type: BooleanConstructor;
|
|
201
|
+
default: boolean;
|
|
202
|
+
};
|
|
203
|
+
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
204
|
+
[key: string]: any;
|
|
205
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
206
|
+
as: {
|
|
207
|
+
type: StringConstructor;
|
|
208
|
+
default: string;
|
|
209
|
+
};
|
|
210
|
+
value: {
|
|
211
|
+
type: vue.PropType<any>;
|
|
212
|
+
default(): string;
|
|
213
|
+
};
|
|
214
|
+
label: {
|
|
215
|
+
type: vue.PropType<_hoci_core.ElementLike | ((val: any) => string) | null>;
|
|
216
|
+
};
|
|
217
|
+
keepAlive: {
|
|
218
|
+
type: BooleanConstructor;
|
|
219
|
+
default: () => true;
|
|
220
|
+
};
|
|
221
|
+
key: {
|
|
222
|
+
type: vue.PropType<string | number | symbol>;
|
|
223
|
+
};
|
|
224
|
+
activateEvent: {
|
|
225
|
+
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
226
|
+
};
|
|
227
|
+
disabled: {
|
|
228
|
+
type: BooleanConstructor;
|
|
229
|
+
default: boolean;
|
|
230
|
+
};
|
|
231
|
+
}>>, {
|
|
232
|
+
value: any;
|
|
233
|
+
disabled: boolean;
|
|
234
|
+
keepAlive: boolean;
|
|
235
|
+
as: string;
|
|
236
|
+
}, {}>;
|
|
237
|
+
|
|
238
|
+
declare const HiIcon: vue.DefineComponent<{
|
|
239
|
+
as: {
|
|
240
|
+
type: StringConstructor;
|
|
241
|
+
default: string;
|
|
242
|
+
};
|
|
243
|
+
src: {
|
|
244
|
+
type: StringConstructor;
|
|
245
|
+
required: true;
|
|
246
|
+
};
|
|
247
|
+
size: {
|
|
248
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
249
|
+
default: string;
|
|
250
|
+
};
|
|
251
|
+
width: {
|
|
252
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
253
|
+
};
|
|
254
|
+
height: {
|
|
255
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
256
|
+
};
|
|
257
|
+
color: {
|
|
258
|
+
type: StringConstructor;
|
|
259
|
+
};
|
|
260
|
+
mask: {
|
|
261
|
+
type: vue.PropType<boolean | "auto">;
|
|
262
|
+
default: () => "auto";
|
|
263
|
+
};
|
|
264
|
+
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
265
|
+
[key: string]: any;
|
|
266
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
267
|
+
as: {
|
|
268
|
+
type: StringConstructor;
|
|
269
|
+
default: string;
|
|
270
|
+
};
|
|
271
|
+
src: {
|
|
272
|
+
type: StringConstructor;
|
|
273
|
+
required: true;
|
|
274
|
+
};
|
|
275
|
+
size: {
|
|
276
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
277
|
+
default: string;
|
|
278
|
+
};
|
|
279
|
+
width: {
|
|
280
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
281
|
+
};
|
|
282
|
+
height: {
|
|
283
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
284
|
+
};
|
|
285
|
+
color: {
|
|
286
|
+
type: StringConstructor;
|
|
287
|
+
};
|
|
288
|
+
mask: {
|
|
289
|
+
type: vue.PropType<boolean | "auto">;
|
|
290
|
+
default: () => "auto";
|
|
291
|
+
};
|
|
292
|
+
}>>, {
|
|
293
|
+
mask: boolean | "auto";
|
|
294
|
+
size: string | number;
|
|
295
|
+
as: string;
|
|
296
|
+
}, {}>;
|
|
297
|
+
|
|
298
|
+
declare const HiSwitch: vue.DefineComponent<{
|
|
299
|
+
as: {
|
|
300
|
+
type: StringConstructor;
|
|
301
|
+
default: string;
|
|
302
|
+
};
|
|
303
|
+
modelValue: {
|
|
304
|
+
type: BooleanConstructor;
|
|
305
|
+
default: boolean;
|
|
306
|
+
};
|
|
307
|
+
class: {
|
|
308
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
309
|
+
required: true;
|
|
310
|
+
};
|
|
311
|
+
activeClass: {
|
|
312
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
313
|
+
default: string;
|
|
314
|
+
};
|
|
315
|
+
unactiveClass: {
|
|
316
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
317
|
+
default: string;
|
|
318
|
+
};
|
|
319
|
+
activateEvent: {
|
|
320
|
+
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
321
|
+
default: string;
|
|
322
|
+
};
|
|
323
|
+
disabled: {
|
|
324
|
+
type: BooleanConstructor;
|
|
325
|
+
default: boolean;
|
|
326
|
+
};
|
|
327
|
+
disabledClass: {
|
|
328
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
329
|
+
default: string;
|
|
330
|
+
};
|
|
331
|
+
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
332
|
+
[key: string]: any;
|
|
333
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
334
|
+
as: {
|
|
335
|
+
type: StringConstructor;
|
|
336
|
+
default: string;
|
|
337
|
+
};
|
|
338
|
+
modelValue: {
|
|
339
|
+
type: BooleanConstructor;
|
|
340
|
+
default: boolean;
|
|
341
|
+
};
|
|
342
|
+
class: {
|
|
343
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
344
|
+
required: true;
|
|
345
|
+
};
|
|
346
|
+
activeClass: {
|
|
347
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
348
|
+
default: string;
|
|
349
|
+
};
|
|
350
|
+
unactiveClass: {
|
|
351
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
352
|
+
default: string;
|
|
353
|
+
};
|
|
354
|
+
activateEvent: {
|
|
355
|
+
type: vue.PropType<_hoci_core.ActivateEvent>;
|
|
356
|
+
default: string;
|
|
357
|
+
};
|
|
358
|
+
disabled: {
|
|
359
|
+
type: BooleanConstructor;
|
|
360
|
+
default: boolean;
|
|
361
|
+
};
|
|
362
|
+
disabledClass: {
|
|
363
|
+
type: vue.PropType<string | string[] | Record<string, boolean>>;
|
|
364
|
+
default: string;
|
|
365
|
+
};
|
|
366
|
+
}>> & {
|
|
367
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
368
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
369
|
+
}, {
|
|
370
|
+
disabled: boolean;
|
|
371
|
+
modelValue: boolean;
|
|
372
|
+
activeClass: string | string[] | Record<string, boolean>;
|
|
373
|
+
disabledClass: string | string[] | Record<string, boolean>;
|
|
374
|
+
unactiveClass: string | string[] | Record<string, boolean>;
|
|
375
|
+
activateEvent: _hoci_core.ActivateEvent;
|
|
376
|
+
as: string;
|
|
377
|
+
}, {}>;
|
|
378
|
+
|
|
379
|
+
export { HiAffix, HiIcon, HiItem, HiSelection, HiSwitch };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
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';
|
|
3
|
+
import { capitalize as capitalize$1 } from 'tslx';
|
|
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
|
+
const HiAffix = defineComponent({
|
|
25
|
+
name: "HiAffix",
|
|
26
|
+
props: __spreadProps$4(__spreadValues$4({}, affixProps), {
|
|
27
|
+
as: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "div"
|
|
30
|
+
},
|
|
31
|
+
wrapperAs: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "div"
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
setup(props, context) {
|
|
37
|
+
const { classNames, wrapperRef, isFixed, placeholderStyle, fixedStyle } = useAffix(props, context);
|
|
38
|
+
return () => h(
|
|
39
|
+
props.as,
|
|
40
|
+
{ ref: wrapperRef },
|
|
41
|
+
[
|
|
42
|
+
isFixed.value && h("div", { style: placeholderStyle.value }),
|
|
43
|
+
h("div", { class: classNames.value, style: fixedStyle.value }, renderSlot(context.slots, "default"))
|
|
44
|
+
]
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
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
|
+
const HiSelection = defineComponent({
|
|
69
|
+
name: "HiSelection",
|
|
70
|
+
props: __spreadProps$3(__spreadValues$3({}, selectionProps), {
|
|
71
|
+
as: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "div"
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
emits: selectionEmits,
|
|
77
|
+
setup(props, context) {
|
|
78
|
+
const { isActive, changeActive, renderItem } = useSelectionList(props, context);
|
|
79
|
+
const { slots } = context;
|
|
80
|
+
const slotData = {
|
|
81
|
+
isActive,
|
|
82
|
+
changeActive,
|
|
83
|
+
renderItem
|
|
84
|
+
};
|
|
85
|
+
return () => h(props.as, {}, renderSlot(slots, "default", slotData));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
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
|
+
const HiItem = defineComponent({
|
|
109
|
+
name: "HiItem",
|
|
110
|
+
props: __spreadProps$2(__spreadValues$2({}, itemProps), {
|
|
111
|
+
as: {
|
|
112
|
+
type: String,
|
|
113
|
+
default: "div"
|
|
114
|
+
}
|
|
115
|
+
}),
|
|
116
|
+
setup(props, context) {
|
|
117
|
+
const { render, activate, className, isDisabled, activateEvent } = useSelectionItem(
|
|
118
|
+
props,
|
|
119
|
+
context
|
|
120
|
+
);
|
|
121
|
+
return () => h(
|
|
122
|
+
props.as,
|
|
123
|
+
{
|
|
124
|
+
class: className.value,
|
|
125
|
+
[`on${capitalize(activateEvent.value)}`]: activate,
|
|
126
|
+
disabled: isDisabled.value
|
|
127
|
+
},
|
|
128
|
+
render()
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
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
|
+
const HiIcon = defineComponent({
|
|
153
|
+
props: __spreadProps$1(__spreadValues$1({}, iconProps), {
|
|
154
|
+
as: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: "i"
|
|
157
|
+
}
|
|
158
|
+
}),
|
|
159
|
+
setup(props, context) {
|
|
160
|
+
const { style } = useIcon(props, context);
|
|
161
|
+
return () => {
|
|
162
|
+
return h(props.as, {
|
|
163
|
+
style: style.value
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
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
|
+
const HiSwitch = defineComponent({
|
|
189
|
+
name: "HiSwitch",
|
|
190
|
+
props: __spreadProps(__spreadValues({}, switchProps), {
|
|
191
|
+
as: {
|
|
192
|
+
type: String,
|
|
193
|
+
default: "div"
|
|
194
|
+
}
|
|
195
|
+
}),
|
|
196
|
+
emits: switchEmits,
|
|
197
|
+
setup(props, context) {
|
|
198
|
+
const { slots } = context;
|
|
199
|
+
const { className, toggle, modelValue, isDisabled } = useSwitch(props, context);
|
|
200
|
+
return () => {
|
|
201
|
+
return h(
|
|
202
|
+
props.as,
|
|
203
|
+
{
|
|
204
|
+
class: className.value,
|
|
205
|
+
[`on${capitalize$1(props.activateEvent)}`]: toggle
|
|
206
|
+
},
|
|
207
|
+
renderSlot(slots, "default", {
|
|
208
|
+
active: modelValue.value,
|
|
209
|
+
isDisabled: isDisabled.value
|
|
210
|
+
})
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
export { HiAffix, HiIcon, HiItem, HiSelection, HiSwitch };
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hoci/components",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "chizuki",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/chizukicn/hoci.git",
|
|
10
|
+
"directory": "packages/components"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"require": "./dist/index.cjs",
|
|
16
|
+
"import": "./dist/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./*": "./dist/*"
|
|
19
|
+
},
|
|
20
|
+
"main": "dist/index.cjs",
|
|
21
|
+
"module": "dist/index.mjs",
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist/"
|
|
25
|
+
],
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@vueuse/core": ">=10",
|
|
28
|
+
"vue": "^3.3.4"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@vueuse/core": "^10.4.1",
|
|
32
|
+
"maybe-types": "^0.0.3",
|
|
33
|
+
"tslx": "^0.1.0",
|
|
34
|
+
"@hoci/core": "0.2.1"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "unbuild",
|
|
38
|
+
"stub": "unbuild --stub",
|
|
39
|
+
"prepublish": "pnpm build"
|
|
40
|
+
}
|
|
41
|
+
}
|