@hoci/core 0.6.0 → 0.7.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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _hoci_shared from '@hoci/shared';
2
- import { ElementLike, ActivateEvent, SharedConfig } from '@hoci/shared';
2
+ import { SharedConfig, ElementLike, ActivateEvent } from '@hoci/shared';
3
3
  export * from '@hoci/shared';
4
4
  import * as vue from 'vue';
5
5
  import { PropType, InjectionKey, MaybeRefOrGetter, Ref, CSSProperties as CSSProperties$1 } from 'vue';
@@ -46,8 +46,8 @@ declare const affixEmits: ("scroll" | "change")[];
46
46
  declare const AFFIX_TARGET_KEY: InjectionKey<MaybeRefOrGetter<Element | null | undefined>>;
47
47
  declare const useAffix: _hoci_shared.HookComponent<{
48
48
  className: vue.ComputedRef<string>;
49
- wrapperRef: Ref<HTMLElement | undefined>;
50
- containerRef: vue.ComputedRef<Element | (Window & typeof globalThis) | null>;
49
+ wrapperRef: _hoci_shared.ElementRef<HTMLElement>;
50
+ containerRef: vue.ComputedRef<(Window & typeof globalThis) | Element | null>;
51
51
  isFixed: Ref<boolean>;
52
52
  placeholderStyle: Ref<CSSProperties>;
53
53
  fixedStyle: Ref<CSSProperties>;
@@ -130,215 +130,142 @@ declare const useAffix: _hoci_shared.HookComponent<{
130
130
  }>;
131
131
  declare function provideAffixTarget(target: MaybeRefOrGetter<Element | null | undefined>): void;
132
132
 
133
- type InitFunction = (option: Option) => () => void;
134
- interface Option {
135
- id?: string;
136
- label?: string;
137
- value: any | null;
138
- render(): ElementLike;
139
- }
140
- interface HiSelectionContext {
141
- activate: (_: any) => void;
142
- reject: (_: any) => void;
143
- /**
144
- * @deprecated
145
- * use activate instead
146
- */
147
- changeActive: (_: any) => void;
148
- isActive: (_: any) => boolean;
149
- init?: InitFunction;
150
- activateEvent: ActivateEvent;
151
- activeClass: string;
152
- itemClass: string;
153
- unactiveClass: string;
154
- disabledClass: string;
155
- label: string | ((_: any) => ElementLike | null | undefined) | null | undefined;
156
- multiple: boolean;
157
- limit: [number, number];
158
- }
159
- declare const selectionProps: {
160
- modelValue: {
161
- type: PropType<any>;
162
- default: () => null;
163
- };
164
- /**
165
- * 选中时的 class
166
- */
167
- activeClass: {
168
- type: PropType<string | string[] | Record<string, boolean>>;
169
- default: string;
170
- };
171
- /**
172
- * 每个选项的 class
173
- */
174
- itemClass: {
175
- type: PropType<string | string[] | Record<string, boolean>>;
176
- default: string;
177
- };
178
- disabledClass: {
179
- type: PropType<string | string[] | Record<string, boolean>>;
180
- default: string;
133
+ declare const configProviderProps: {
134
+ icon: {
135
+ type: PropType<Partial<SharedConfig["icon"]>>;
181
136
  };
182
- unactiveClass: {
183
- type: PropType<string | string[] | Record<string, boolean>>;
184
- default: string;
137
+ activateEvent: {
138
+ type: PropType<Partial<SharedConfig["activateEvent"]>>;
185
139
  };
186
- label: {
187
- type: PropType<string | ((val?: any) => string) | null>;
140
+ };
141
+
142
+ declare const fileUploadProps: {
143
+ modelValue: {
144
+ type: PropType<File | File[]>;
145
+ default: () => never[];
188
146
  };
189
- /**
190
- * 多选模式
191
- */
192
147
  multiple: {
193
- type: PropType<boolean | number | [number, number?]>;
194
- default: () => false;
195
- };
196
- /**
197
- * 可清除
198
- */
199
- clearable: {
200
148
  type: BooleanConstructor;
149
+ default: boolean;
201
150
  };
202
- defaultValue: {
203
- type: PropType<any>;
204
- default: () => null;
151
+ };
152
+ declare const fileUploadEmits: ("change" | "update:modelValue")[];
153
+ type HiFileUploadProps = typeof fileUploadProps;
154
+ interface HiFileUploadSlotData {
155
+ files: File[];
156
+ }
157
+ declare const useFileUpload: _hoci_shared.HookComponent<{
158
+ fileInputRef: _hoci_shared.ElementRef<HTMLInputElement>;
159
+ files: vue.Ref<{
160
+ readonly lastModified: number;
161
+ readonly name: string;
162
+ readonly webkitRelativePath: string;
163
+ readonly size: number;
164
+ readonly type: string;
165
+ arrayBuffer: () => Promise<ArrayBuffer>;
166
+ bytes: () => Promise<Uint8Array>;
167
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
168
+ stream: () => ReadableStream<Uint8Array>;
169
+ text: () => Promise<string>;
170
+ }[]>;
171
+ openFileInput: () => void;
172
+ }, ("change" | "update:modelValue")[], {
173
+ modelValue: {
174
+ type: PropType<File | File[]>;
175
+ default: () => never[];
205
176
  };
206
- activateEvent: {
207
- type: PropType<ActivateEvent>;
177
+ multiple: {
178
+ type: BooleanConstructor;
179
+ default: boolean;
208
180
  };
209
- };
210
- type SelectionProps = typeof selectionProps;
211
- declare const selectionEmits: ("change" | "load" | "unload" | "update:modelValue" | "reject")[];
212
- declare function useSelectionContext(): HiSelectionContext;
213
- declare const useSelectionList: _hoci_shared.HookComponent<{
214
- options: {
215
- id?: string;
216
- label?: string;
217
- value: any | null;
218
- render: () => ElementLike;
219
- }[];
220
- actives: any[];
221
- isActive: (value: any) => boolean;
222
- changeActive: (value: any) => void;
223
- renderItem: () => ElementLike;
224
- render: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
225
- [key: string]: any;
226
- }>;
227
- }, ("change" | "load" | "unload" | "update:modelValue" | "reject")[], {
181
+ }, vue.ExtractPropTypes<{
228
182
  modelValue: {
229
- type: PropType<any>;
230
- default: () => null;
183
+ type: PropType<File | File[]>;
184
+ default: () => never[];
231
185
  };
232
- /**
233
- * 选中时的 class
234
- */
235
- activeClass: {
236
- type: PropType<string | string[] | Record<string, boolean>>;
237
- default: string;
186
+ multiple: {
187
+ type: BooleanConstructor;
188
+ default: boolean;
238
189
  };
239
- /**
240
- * 每个选项的 class
241
- */
242
- itemClass: {
243
- type: PropType<string | string[] | Record<string, boolean>>;
244
- default: string;
190
+ }>, {
191
+ multiple: boolean;
192
+ modelValue: File | File[];
193
+ }>;
194
+
195
+ declare const iconProps: {
196
+ src: {
197
+ type: StringConstructor;
198
+ required: true;
245
199
  };
246
- disabledClass: {
247
- type: PropType<string | string[] | Record<string, boolean>>;
248
- default: string;
200
+ size: {
201
+ type: (StringConstructor | NumberConstructor)[];
249
202
  };
250
- unactiveClass: {
251
- type: PropType<string | string[] | Record<string, boolean>>;
252
- default: string;
203
+ width: {
204
+ type: (StringConstructor | NumberConstructor)[];
253
205
  };
254
- label: {
255
- type: PropType<string | ((val?: any) => string) | null>;
206
+ height: {
207
+ type: (StringConstructor | NumberConstructor)[];
256
208
  };
257
- /**
258
- * 多选模式
259
- */
260
- multiple: {
261
- type: PropType<boolean | number | [number, number?]>;
262
- default: () => false;
209
+ color: {
210
+ type: StringConstructor;
211
+ default: string;
263
212
  };
264
- /**
265
- * 可清除
266
- */
267
- clearable: {
268
- type: BooleanConstructor;
213
+ mask: {
214
+ type: PropType<boolean | "auto">;
215
+ default: () => "auto";
269
216
  };
270
- defaultValue: {
271
- type: PropType<any>;
272
- default: () => null;
217
+ };
218
+ type HiIconProps = typeof iconProps;
219
+ declare const useIcon: _hoci_shared.HookComponent<{
220
+ style: vue.ComputedRef<CSSProperties$1>;
221
+ }, vue.EmitsOptions, {
222
+ src: {
223
+ type: StringConstructor;
224
+ required: true;
273
225
  };
274
- activateEvent: {
275
- type: PropType<ActivateEvent>;
226
+ size: {
227
+ type: (StringConstructor | NumberConstructor)[];
276
228
  };
277
- }, vue.ExtractPropTypes<{
278
- modelValue: {
279
- type: PropType<any>;
280
- default: () => null;
229
+ width: {
230
+ type: (StringConstructor | NumberConstructor)[];
281
231
  };
282
- /**
283
- * 选中时的 class
284
- */
285
- activeClass: {
286
- type: PropType<string | string[] | Record<string, boolean>>;
287
- default: string;
232
+ height: {
233
+ type: (StringConstructor | NumberConstructor)[];
288
234
  };
289
- /**
290
- * 每个选项的 class
291
- */
292
- itemClass: {
293
- type: PropType<string | string[] | Record<string, boolean>>;
235
+ color: {
236
+ type: StringConstructor;
294
237
  default: string;
295
238
  };
296
- disabledClass: {
297
- type: PropType<string | string[] | Record<string, boolean>>;
298
- default: string;
239
+ mask: {
240
+ type: PropType<boolean | "auto">;
241
+ default: () => "auto";
299
242
  };
300
- unactiveClass: {
301
- type: PropType<string | string[] | Record<string, boolean>>;
302
- default: string;
243
+ }, vue.ExtractPropTypes<{
244
+ src: {
245
+ type: StringConstructor;
246
+ required: true;
303
247
  };
304
- label: {
305
- type: PropType<string | ((val?: any) => string) | null>;
248
+ size: {
249
+ type: (StringConstructor | NumberConstructor)[];
306
250
  };
307
- /**
308
- * 多选模式
309
- */
310
- multiple: {
311
- type: PropType<boolean | number | [number, number?]>;
312
- default: () => false;
251
+ width: {
252
+ type: (StringConstructor | NumberConstructor)[];
313
253
  };
314
- /**
315
- * 可清除
316
- */
317
- clearable: {
318
- type: BooleanConstructor;
254
+ height: {
255
+ type: (StringConstructor | NumberConstructor)[];
319
256
  };
320
- defaultValue: {
321
- type: PropType<any>;
322
- default: () => null;
257
+ color: {
258
+ type: StringConstructor;
259
+ default: string;
323
260
  };
324
- activateEvent: {
325
- type: PropType<ActivateEvent>;
261
+ mask: {
262
+ type: PropType<boolean | "auto">;
263
+ default: () => "auto";
326
264
  };
327
265
  }>, {
328
- multiple: number | boolean | [number, (number | undefined)?];
329
- modelValue: any;
330
- activeClass: string | string[] | Record<string, boolean>;
331
- itemClass: string | string[] | Record<string, boolean>;
332
- disabledClass: string | string[] | Record<string, boolean>;
333
- unactiveClass: string | string[] | Record<string, boolean>;
334
- clearable: boolean;
335
- defaultValue: any;
266
+ mask: boolean | "auto";
267
+ color: string;
336
268
  }>;
337
- interface HiSelectionSlotData extends Record<string, unknown> {
338
- isActive: (value: any) => boolean;
339
- changeActive: (value: any) => void;
340
- renderItem: () => ElementLike;
341
- }
342
269
 
343
270
  declare const itemProps: {
344
271
  value: {
@@ -416,184 +343,14 @@ declare const useSelectionItem: _hoci_shared.HookComponent<{
416
343
  }>;
417
344
  interface HiItemSlotsData {
418
345
  active: boolean;
419
- activate(): void;
346
+ activate: () => void;
420
347
  }
421
348
 
422
- declare const switchProps: {
423
- modelValue: {
424
- type: BooleanConstructor;
425
- default: () => false;
426
- };
427
- class: {
428
- type: PropType<string | string[] | Record<string, boolean>>;
429
- };
430
- activeClass: {
431
- type: PropType<string | string[] | Record<string, boolean>>;
432
- };
433
- unactiveClass: {
434
- type: PropType<string | string[] | Record<string, boolean>>;
435
- };
436
- activateEvent: {
437
- type: PropType<ActivateEvent>;
438
- };
439
- disabled: {
440
- type: BooleanConstructor;
441
- default: () => false;
442
- };
443
- disabledClass: {
444
- type: PropType<string | string[] | Record<string, boolean>>;
445
- };
446
- };
447
- type HiSwitchProps = typeof switchProps;
448
- declare const switchEmits: ("change" | "update:modelValue" | "reject")[];
449
- declare const useSwitch: _hoci_shared.HookComponent<{
450
- toggle: (value?: any) => void;
451
- modelValue: vue.Ref<boolean> | vue.WritableComputedRef<boolean>;
452
- className: vue.ComputedRef<string>;
453
- isDisabled: vue.ComputedRef<boolean>;
454
- activateEvent: vue.ComputedRef<ActivateEvent>;
455
- }, ("change" | "update:modelValue" | "reject")[], {
456
- modelValue: {
457
- type: BooleanConstructor;
458
- default: () => false;
459
- };
460
- class: {
461
- type: PropType<string | string[] | Record<string, boolean>>;
462
- };
463
- activeClass: {
464
- type: PropType<string | string[] | Record<string, boolean>>;
465
- };
466
- unactiveClass: {
467
- type: PropType<string | string[] | Record<string, boolean>>;
468
- };
469
- activateEvent: {
470
- type: PropType<ActivateEvent>;
471
- };
472
- disabled: {
473
- type: BooleanConstructor;
474
- default: () => false;
475
- };
476
- disabledClass: {
477
- type: PropType<string | string[] | Record<string, boolean>>;
478
- };
479
- }, vue.ExtractPropTypes<{
480
- modelValue: {
481
- type: BooleanConstructor;
482
- default: () => false;
483
- };
484
- class: {
485
- type: PropType<string | string[] | Record<string, boolean>>;
486
- };
487
- activeClass: {
488
- type: PropType<string | string[] | Record<string, boolean>>;
489
- };
490
- unactiveClass: {
491
- type: PropType<string | string[] | Record<string, boolean>>;
492
- };
493
- activateEvent: {
494
- type: PropType<ActivateEvent>;
495
- };
496
- disabled: {
497
- type: BooleanConstructor;
498
- default: () => false;
499
- };
500
- disabledClass: {
501
- type: PropType<string | string[] | Record<string, boolean>>;
502
- };
503
- }>, {
504
- disabled: boolean;
505
- modelValue: boolean;
506
- }>;
507
-
508
- declare const iconProps: {
509
- src: {
510
- type: StringConstructor;
511
- required: true;
512
- };
513
- size: {
514
- type: (StringConstructor | NumberConstructor)[];
515
- };
516
- width: {
517
- type: (StringConstructor | NumberConstructor)[];
518
- };
519
- height: {
520
- type: (StringConstructor | NumberConstructor)[];
521
- };
522
- color: {
523
- type: StringConstructor;
524
- default: string;
525
- };
526
- mask: {
527
- type: PropType<boolean | "auto">;
528
- default: () => "auto";
529
- };
530
- };
531
- type HiIconProps = typeof iconProps;
532
- declare const useIcon: _hoci_shared.HookComponent<{
533
- style: vue.ComputedRef<CSSProperties$1>;
534
- }, vue.EmitsOptions, {
535
- src: {
536
- type: StringConstructor;
537
- required: true;
538
- };
539
- size: {
540
- type: (StringConstructor | NumberConstructor)[];
541
- };
542
- width: {
543
- type: (StringConstructor | NumberConstructor)[];
544
- };
545
- height: {
546
- type: (StringConstructor | NumberConstructor)[];
547
- };
548
- color: {
549
- type: StringConstructor;
550
- default: string;
551
- };
552
- mask: {
553
- type: PropType<boolean | "auto">;
554
- default: () => "auto";
555
- };
556
- }, vue.ExtractPropTypes<{
557
- src: {
558
- type: StringConstructor;
559
- required: true;
560
- };
561
- size: {
562
- type: (StringConstructor | NumberConstructor)[];
563
- };
564
- width: {
565
- type: (StringConstructor | NumberConstructor)[];
566
- };
567
- height: {
568
- type: (StringConstructor | NumberConstructor)[];
569
- };
570
- color: {
571
- type: StringConstructor;
572
- default: string;
573
- };
574
- mask: {
575
- type: PropType<boolean | "auto">;
576
- default: () => "auto";
577
- };
578
- }>, {
579
- mask: boolean | "auto";
580
- color: string;
581
- }>;
582
-
583
- declare const configProviderProps: {
584
- icon: {
585
- type: PropType<Partial<SharedConfig["icon"]>>;
586
- };
587
- activateEvent: {
588
- type: PropType<Partial<SharedConfig["activateEvent"]>>;
589
- };
590
- };
591
-
592
- type Placement = "bottom" | "top" | "left" | "right" | "auto" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom" | "right-top" | "right-bottom";
593
- type TriggerEvent = "click" | "mousedown" | "dblclick" | "hover" | "contextmenu" | "focus" | "touch";
594
- declare const popoverProps: {
595
- popupClass: {
596
- type: StringConstructor;
349
+ type Placement = "bottom" | "top" | "left" | "right" | "auto" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom" | "right-top" | "right-bottom";
350
+ type TriggerEvent = "click" | "mousedown" | "dblclick" | "hover" | "contextmenu" | "focus" | "touch";
351
+ declare const popoverProps: {
352
+ popupClass: {
353
+ type: StringConstructor;
597
354
  };
598
355
  placement: {
599
356
  type: PropType<Placement>;
@@ -642,8 +399,8 @@ declare const usePopover: _hoci_shared.HookComponent<{
642
399
  x: number;
643
400
  y: number;
644
401
  };
645
- triggerRef: vue.Ref<HTMLElement | undefined>;
646
- popupRef: vue.Ref<HTMLElement | undefined>;
402
+ triggerRef: _hoci_shared.ElementRef<HTMLElement>;
403
+ popupRef: _hoci_shared.ElementRef<HTMLElement>;
647
404
  popupClass: vue.ComputedRef<string | undefined>;
648
405
  popupStyle: vue.ComputedRef<{
649
406
  left: string;
@@ -725,4 +482,295 @@ declare const usePopover: _hoci_shared.HookComponent<{
725
482
  teleport: string | boolean | HTMLElement;
726
483
  }>;
727
484
 
728
- export { AFFIX_TARGET_KEY, type AffixProps, type HiIconProps, type HiItemSlotsData, type HiSelectionContext, type HiSelectionSlotData, type HiSwitchProps, type InitFunction, type Option, type Placement, type SelectionProps, type TriggerEvent, affixEmits, affixProps, configProviderProps, iconProps, itemEmits, itemProps, popoverEmits, popoverProps, provideAffixTarget, selectionEmits, selectionProps, switchEmits, switchProps, useAffix, useIcon, usePopover, useSelectionContext, useSelectionItem, useSelectionList, useSwitch };
485
+ type InitFunction = (option: Option) => () => void;
486
+ interface Option {
487
+ id?: string;
488
+ label?: string;
489
+ value: any | null;
490
+ render: () => ElementLike;
491
+ }
492
+ interface HiSelectionContext {
493
+ activate: (_: any) => void;
494
+ reject: (_: any) => void;
495
+ /**
496
+ * @deprecated
497
+ * use activate instead
498
+ */
499
+ changeActive: (_: any) => void;
500
+ isActive: (_: any) => boolean;
501
+ init?: InitFunction;
502
+ activateEvent: ActivateEvent;
503
+ activeClass: string;
504
+ itemClass: string;
505
+ unactiveClass: string;
506
+ disabledClass: string;
507
+ label: string | ((_: any) => ElementLike | null | undefined) | null | undefined;
508
+ multiple: boolean;
509
+ limit: [number, number];
510
+ }
511
+ declare const selectionProps: {
512
+ modelValue: {
513
+ type: PropType<any>;
514
+ default: () => null;
515
+ };
516
+ /**
517
+ * 选中时的 class
518
+ */
519
+ activeClass: {
520
+ type: PropType<string | string[] | Record<string, boolean>>;
521
+ default: string;
522
+ };
523
+ /**
524
+ * 每个选项的 class
525
+ */
526
+ itemClass: {
527
+ type: PropType<string | string[] | Record<string, boolean>>;
528
+ default: string;
529
+ };
530
+ disabledClass: {
531
+ type: PropType<string | string[] | Record<string, boolean>>;
532
+ default: string;
533
+ };
534
+ unactiveClass: {
535
+ type: PropType<string | string[] | Record<string, boolean>>;
536
+ default: string;
537
+ };
538
+ label: {
539
+ type: PropType<string | ((val?: any) => string) | null>;
540
+ };
541
+ /**
542
+ * 多选模式
543
+ */
544
+ multiple: {
545
+ type: PropType<boolean | number | [number, number?]>;
546
+ default: () => false;
547
+ };
548
+ /**
549
+ * 可清除
550
+ */
551
+ clearable: {
552
+ type: BooleanConstructor;
553
+ };
554
+ defaultValue: {
555
+ type: PropType<any>;
556
+ default: () => null;
557
+ };
558
+ activateEvent: {
559
+ type: PropType<ActivateEvent>;
560
+ };
561
+ };
562
+ type SelectionProps = typeof selectionProps;
563
+ declare const selectionEmits: ("change" | "load" | "unload" | "update:modelValue" | "reject")[];
564
+ declare function useSelectionContext(): HiSelectionContext;
565
+ declare const useSelectionList: _hoci_shared.HookComponent<{
566
+ options: vue.Reactive<Option[]>;
567
+ actives: any[];
568
+ isActive: (value: any) => boolean;
569
+ changeActive: (value: any) => void;
570
+ renderItem: () => ElementLike;
571
+ render: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
572
+ [key: string]: any;
573
+ }>;
574
+ }, ("change" | "load" | "unload" | "update:modelValue" | "reject")[], {
575
+ modelValue: {
576
+ type: PropType<any>;
577
+ default: () => null;
578
+ };
579
+ /**
580
+ * 选中时的 class
581
+ */
582
+ activeClass: {
583
+ type: PropType<string | string[] | Record<string, boolean>>;
584
+ default: string;
585
+ };
586
+ /**
587
+ * 每个选项的 class
588
+ */
589
+ itemClass: {
590
+ type: PropType<string | string[] | Record<string, boolean>>;
591
+ default: string;
592
+ };
593
+ disabledClass: {
594
+ type: PropType<string | string[] | Record<string, boolean>>;
595
+ default: string;
596
+ };
597
+ unactiveClass: {
598
+ type: PropType<string | string[] | Record<string, boolean>>;
599
+ default: string;
600
+ };
601
+ label: {
602
+ type: PropType<string | ((val?: any) => string) | null>;
603
+ };
604
+ /**
605
+ * 多选模式
606
+ */
607
+ multiple: {
608
+ type: PropType<boolean | number | [number, number?]>;
609
+ default: () => false;
610
+ };
611
+ /**
612
+ * 可清除
613
+ */
614
+ clearable: {
615
+ type: BooleanConstructor;
616
+ };
617
+ defaultValue: {
618
+ type: PropType<any>;
619
+ default: () => null;
620
+ };
621
+ activateEvent: {
622
+ type: PropType<ActivateEvent>;
623
+ };
624
+ }, vue.ExtractPropTypes<{
625
+ modelValue: {
626
+ type: PropType<any>;
627
+ default: () => null;
628
+ };
629
+ /**
630
+ * 选中时的 class
631
+ */
632
+ activeClass: {
633
+ type: PropType<string | string[] | Record<string, boolean>>;
634
+ default: string;
635
+ };
636
+ /**
637
+ * 每个选项的 class
638
+ */
639
+ itemClass: {
640
+ type: PropType<string | string[] | Record<string, boolean>>;
641
+ default: string;
642
+ };
643
+ disabledClass: {
644
+ type: PropType<string | string[] | Record<string, boolean>>;
645
+ default: string;
646
+ };
647
+ unactiveClass: {
648
+ type: PropType<string | string[] | Record<string, boolean>>;
649
+ default: string;
650
+ };
651
+ label: {
652
+ type: PropType<string | ((val?: any) => string) | null>;
653
+ };
654
+ /**
655
+ * 多选模式
656
+ */
657
+ multiple: {
658
+ type: PropType<boolean | number | [number, number?]>;
659
+ default: () => false;
660
+ };
661
+ /**
662
+ * 可清除
663
+ */
664
+ clearable: {
665
+ type: BooleanConstructor;
666
+ };
667
+ defaultValue: {
668
+ type: PropType<any>;
669
+ default: () => null;
670
+ };
671
+ activateEvent: {
672
+ type: PropType<ActivateEvent>;
673
+ };
674
+ }>, {
675
+ multiple: number | boolean | [number, (number | undefined)?];
676
+ modelValue: any;
677
+ activeClass: string | string[] | Record<string, boolean>;
678
+ itemClass: string | string[] | Record<string, boolean>;
679
+ disabledClass: string | string[] | Record<string, boolean>;
680
+ unactiveClass: string | string[] | Record<string, boolean>;
681
+ clearable: boolean;
682
+ defaultValue: any;
683
+ }>;
684
+ interface HiSelectionSlotData extends Record<string, unknown> {
685
+ isActive: (value: any) => boolean;
686
+ changeActive: (value: any) => void;
687
+ renderItem: () => ElementLike;
688
+ }
689
+
690
+ declare const switchProps: {
691
+ modelValue: {
692
+ type: BooleanConstructor;
693
+ default: () => false;
694
+ };
695
+ class: {
696
+ type: PropType<string | string[] | Record<string, boolean>>;
697
+ };
698
+ activeClass: {
699
+ type: PropType<string | string[] | Record<string, boolean>>;
700
+ };
701
+ unactiveClass: {
702
+ type: PropType<string | string[] | Record<string, boolean>>;
703
+ };
704
+ activateEvent: {
705
+ type: PropType<ActivateEvent>;
706
+ };
707
+ disabled: {
708
+ type: BooleanConstructor;
709
+ default: () => false;
710
+ };
711
+ disabledClass: {
712
+ type: PropType<string | string[] | Record<string, boolean>>;
713
+ };
714
+ };
715
+ type HiSwitchProps = typeof switchProps;
716
+ declare const switchEmits: ("change" | "update:modelValue" | "reject")[];
717
+ declare const useSwitch: _hoci_shared.HookComponent<{
718
+ toggle: (value?: any) => void;
719
+ modelValue: vue.Ref<boolean> | vue.WritableComputedRef<boolean>;
720
+ className: vue.ComputedRef<string>;
721
+ isDisabled: vue.ComputedRef<boolean>;
722
+ activateEvent: vue.ComputedRef<ActivateEvent>;
723
+ }, ("change" | "update:modelValue" | "reject")[], {
724
+ modelValue: {
725
+ type: BooleanConstructor;
726
+ default: () => false;
727
+ };
728
+ class: {
729
+ type: PropType<string | string[] | Record<string, boolean>>;
730
+ };
731
+ activeClass: {
732
+ type: PropType<string | string[] | Record<string, boolean>>;
733
+ };
734
+ unactiveClass: {
735
+ type: PropType<string | string[] | Record<string, boolean>>;
736
+ };
737
+ activateEvent: {
738
+ type: PropType<ActivateEvent>;
739
+ };
740
+ disabled: {
741
+ type: BooleanConstructor;
742
+ default: () => false;
743
+ };
744
+ disabledClass: {
745
+ type: PropType<string | string[] | Record<string, boolean>>;
746
+ };
747
+ }, vue.ExtractPropTypes<{
748
+ modelValue: {
749
+ type: BooleanConstructor;
750
+ default: () => false;
751
+ };
752
+ class: {
753
+ type: PropType<string | string[] | Record<string, boolean>>;
754
+ };
755
+ activeClass: {
756
+ type: PropType<string | string[] | Record<string, boolean>>;
757
+ };
758
+ unactiveClass: {
759
+ type: PropType<string | string[] | Record<string, boolean>>;
760
+ };
761
+ activateEvent: {
762
+ type: PropType<ActivateEvent>;
763
+ };
764
+ disabled: {
765
+ type: BooleanConstructor;
766
+ default: () => false;
767
+ };
768
+ disabledClass: {
769
+ type: PropType<string | string[] | Record<string, boolean>>;
770
+ };
771
+ }>, {
772
+ disabled: boolean;
773
+ modelValue: boolean;
774
+ }>;
775
+
776
+ export { AFFIX_TARGET_KEY, type AffixProps, type HiFileUploadProps, type HiFileUploadSlotData, type HiIconProps, type HiItemSlotsData, type HiSelectionContext, type HiSelectionSlotData, type HiSwitchProps, type InitFunction, type Option, type Placement, type SelectionProps, type TriggerEvent, affixEmits, affixProps, configProviderProps, fileUploadEmits, fileUploadProps, iconProps, itemEmits, itemProps, popoverEmits, popoverProps, provideAffixTarget, selectionEmits, selectionProps, switchEmits, switchProps, useAffix, useFileUpload, useIcon, usePopover, useSelectionContext, useSelectionItem, useSelectionList, useSwitch };