@hoci/core 0.5.9 → 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 } 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';
@@ -30,7 +30,7 @@ declare const affixProps: {
30
30
  * @en Scroll container, default is `window`
31
31
  */
32
32
  target: {
33
- type: PropType<string | HTMLElement>;
33
+ type: PropType<string | Element | (() => Element | null | undefined)>;
34
34
  };
35
35
  /**
36
36
  * @zh z-index 值
@@ -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 | null>;
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>;
@@ -77,7 +77,7 @@ declare const useAffix: _hoci_shared.HookComponent<{
77
77
  * @en Scroll container, default is `window`
78
78
  */
79
79
  target: {
80
- type: PropType<string | HTMLElement>;
80
+ type: PropType<string | Element | (() => Element | null | undefined)>;
81
81
  };
82
82
  /**
83
83
  * @zh z-index 值
@@ -112,7 +112,7 @@ declare const useAffix: _hoci_shared.HookComponent<{
112
112
  * @en Scroll container, default is `window`
113
113
  */
114
114
  target: {
115
- type: PropType<string | HTMLElement>;
115
+ type: PropType<string | Element | (() => Element | null | undefined)>;
116
116
  };
117
117
  /**
118
118
  * @zh z-index 值
@@ -130,214 +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 | number;
157
- }
158
- declare const selectionProps: {
159
- modelValue: {
160
- type: PropType<any>;
161
- default: () => null;
162
- };
163
- /**
164
- * 选中时的 class
165
- */
166
- activeClass: {
167
- type: PropType<string | string[] | Record<string, boolean>>;
168
- default: string;
169
- };
170
- /**
171
- * 每个选项的 class
172
- */
173
- itemClass: {
174
- type: PropType<string | string[] | Record<string, boolean>>;
175
- default: string;
176
- };
177
- disabledClass: {
178
- type: PropType<string | string[] | Record<string, boolean>>;
179
- default: string;
133
+ declare const configProviderProps: {
134
+ icon: {
135
+ type: PropType<Partial<SharedConfig["icon"]>>;
180
136
  };
181
- unactiveClass: {
182
- type: PropType<string | string[] | Record<string, boolean>>;
183
- default: string;
137
+ activateEvent: {
138
+ type: PropType<Partial<SharedConfig["activateEvent"]>>;
184
139
  };
185
- label: {
186
- type: PropType<string | ((val?: any) => string) | null>;
140
+ };
141
+
142
+ declare const fileUploadProps: {
143
+ modelValue: {
144
+ type: PropType<File | File[]>;
145
+ default: () => never[];
187
146
  };
188
- /**
189
- * 多选模式
190
- */
191
147
  multiple: {
192
- type: (NumberConstructor | BooleanConstructor)[];
193
- default: () => false;
194
- };
195
- /**
196
- * 可清除
197
- */
198
- clearable: {
199
148
  type: BooleanConstructor;
149
+ default: boolean;
200
150
  };
201
- defaultValue: {
202
- type: PropType<any>;
203
- 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[];
204
176
  };
205
- activateEvent: {
206
- type: PropType<ActivateEvent>;
177
+ multiple: {
178
+ type: BooleanConstructor;
179
+ default: boolean;
207
180
  };
208
- };
209
- type SelectionProps = typeof selectionProps;
210
- declare const selectionEmits: ("change" | "load" | "unload" | "update:modelValue" | "reject")[];
211
- declare function useSelectionContext(): HiSelectionContext;
212
- declare const useSelectionList: _hoci_shared.HookComponent<{
213
- options: {
214
- id?: string | undefined;
215
- label?: string | undefined;
216
- value: any | null;
217
- render: () => ElementLike;
218
- }[];
219
- actives: any[];
220
- isActive: (value: any) => boolean;
221
- changeActive: (value: any) => void;
222
- renderItem: () => ElementLike;
223
- render: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
224
- [key: string]: any;
225
- }>;
226
- }, ("change" | "load" | "unload" | "update:modelValue" | "reject")[], {
181
+ }, vue.ExtractPropTypes<{
227
182
  modelValue: {
228
- type: PropType<any>;
229
- default: () => null;
183
+ type: PropType<File | File[]>;
184
+ default: () => never[];
230
185
  };
231
- /**
232
- * 选中时的 class
233
- */
234
- activeClass: {
235
- type: PropType<string | string[] | Record<string, boolean>>;
236
- default: string;
186
+ multiple: {
187
+ type: BooleanConstructor;
188
+ default: boolean;
237
189
  };
238
- /**
239
- * 每个选项的 class
240
- */
241
- itemClass: {
242
- type: PropType<string | string[] | Record<string, boolean>>;
243
- default: string;
190
+ }>, {
191
+ multiple: boolean;
192
+ modelValue: File | File[];
193
+ }>;
194
+
195
+ declare const iconProps: {
196
+ src: {
197
+ type: StringConstructor;
198
+ required: true;
244
199
  };
245
- disabledClass: {
246
- type: PropType<string | string[] | Record<string, boolean>>;
247
- default: string;
200
+ size: {
201
+ type: (StringConstructor | NumberConstructor)[];
248
202
  };
249
- unactiveClass: {
250
- type: PropType<string | string[] | Record<string, boolean>>;
251
- default: string;
203
+ width: {
204
+ type: (StringConstructor | NumberConstructor)[];
252
205
  };
253
- label: {
254
- type: PropType<string | ((val?: any) => string) | null>;
206
+ height: {
207
+ type: (StringConstructor | NumberConstructor)[];
255
208
  };
256
- /**
257
- * 多选模式
258
- */
259
- multiple: {
260
- type: (NumberConstructor | BooleanConstructor)[];
261
- default: () => false;
209
+ color: {
210
+ type: StringConstructor;
211
+ default: string;
262
212
  };
263
- /**
264
- * 可清除
265
- */
266
- clearable: {
267
- type: BooleanConstructor;
213
+ mask: {
214
+ type: PropType<boolean | "auto">;
215
+ default: () => "auto";
268
216
  };
269
- defaultValue: {
270
- type: PropType<any>;
271
- 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;
272
225
  };
273
- activateEvent: {
274
- type: PropType<ActivateEvent>;
226
+ size: {
227
+ type: (StringConstructor | NumberConstructor)[];
275
228
  };
276
- }, vue.ExtractPropTypes<{
277
- modelValue: {
278
- type: PropType<any>;
279
- default: () => null;
229
+ width: {
230
+ type: (StringConstructor | NumberConstructor)[];
280
231
  };
281
- /**
282
- * 选中时的 class
283
- */
284
- activeClass: {
285
- type: PropType<string | string[] | Record<string, boolean>>;
286
- default: string;
232
+ height: {
233
+ type: (StringConstructor | NumberConstructor)[];
287
234
  };
288
- /**
289
- * 每个选项的 class
290
- */
291
- itemClass: {
292
- type: PropType<string | string[] | Record<string, boolean>>;
235
+ color: {
236
+ type: StringConstructor;
293
237
  default: string;
294
238
  };
295
- disabledClass: {
296
- type: PropType<string | string[] | Record<string, boolean>>;
297
- default: string;
239
+ mask: {
240
+ type: PropType<boolean | "auto">;
241
+ default: () => "auto";
298
242
  };
299
- unactiveClass: {
300
- type: PropType<string | string[] | Record<string, boolean>>;
301
- default: string;
243
+ }, vue.ExtractPropTypes<{
244
+ src: {
245
+ type: StringConstructor;
246
+ required: true;
302
247
  };
303
- label: {
304
- type: PropType<string | ((val?: any) => string) | null>;
248
+ size: {
249
+ type: (StringConstructor | NumberConstructor)[];
305
250
  };
306
- /**
307
- * 多选模式
308
- */
309
- multiple: {
310
- type: (NumberConstructor | BooleanConstructor)[];
311
- default: () => false;
251
+ width: {
252
+ type: (StringConstructor | NumberConstructor)[];
312
253
  };
313
- /**
314
- * 可清除
315
- */
316
- clearable: {
317
- type: BooleanConstructor;
254
+ height: {
255
+ type: (StringConstructor | NumberConstructor)[];
318
256
  };
319
- defaultValue: {
320
- type: PropType<any>;
321
- default: () => null;
257
+ color: {
258
+ type: StringConstructor;
259
+ default: string;
322
260
  };
323
- activateEvent: {
324
- type: PropType<ActivateEvent>;
261
+ mask: {
262
+ type: PropType<boolean | "auto">;
263
+ default: () => "auto";
325
264
  };
326
265
  }>, {
327
- multiple: number | boolean;
328
- modelValue: any;
329
- activeClass: string | string[] | Record<string, boolean>;
330
- itemClass: string | string[] | Record<string, boolean>;
331
- disabledClass: string | string[] | Record<string, boolean>;
332
- unactiveClass: string | string[] | Record<string, boolean>;
333
- clearable: boolean;
334
- defaultValue: any;
266
+ mask: boolean | "auto";
267
+ color: string;
335
268
  }>;
336
- interface HiSelectionSlotData extends Record<string, unknown> {
337
- isActive: (value: any) => boolean;
338
- changeActive: (value: any) => void;
339
- renderItem: () => ElementLike;
340
- }
341
269
 
342
270
  declare const itemProps: {
343
271
  value: {
@@ -345,7 +273,7 @@ declare const itemProps: {
345
273
  default(): string;
346
274
  };
347
275
  label: {
348
- type: PropType<ElementLike | ((val: any) => string) | null>;
276
+ type: PropType<string | ((val: any) => string) | ElementLike | null>;
349
277
  };
350
278
  keepAlive: {
351
279
  type: BooleanConstructor;
@@ -376,7 +304,7 @@ declare const useSelectionItem: _hoci_shared.HookComponent<{
376
304
  default(): string;
377
305
  };
378
306
  label: {
379
- type: PropType<ElementLike | ((val: any) => string) | null>;
307
+ type: PropType<string | ((val: any) => string) | ElementLike | null>;
380
308
  };
381
309
  keepAlive: {
382
310
  type: BooleanConstructor;
@@ -395,7 +323,7 @@ declare const useSelectionItem: _hoci_shared.HookComponent<{
395
323
  default(): string;
396
324
  };
397
325
  label: {
398
- type: PropType<ElementLike | ((val: any) => string) | null>;
326
+ type: PropType<string | ((val: any) => string) | ElementLike | null>;
399
327
  };
400
328
  keepAlive: {
401
329
  type: BooleanConstructor;
@@ -415,191 +343,18 @@ declare const useSelectionItem: _hoci_shared.HookComponent<{
415
343
  }>;
416
344
  interface HiItemSlotsData {
417
345
  active: boolean;
418
- activate(): void;
346
+ activate: () => void;
419
347
  }
420
348
 
421
- declare const switchProps: {
422
- modelValue: {
423
- type: BooleanConstructor;
424
- default: () => false;
425
- };
426
- class: {
427
- type: PropType<string | string[] | Record<string, boolean>>;
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;
428
354
  };
429
- activeClass: {
430
- type: PropType<string | string[] | Record<string, boolean>>;
431
- };
432
- unactiveClass: {
433
- type: PropType<string | string[] | Record<string, boolean>>;
434
- };
435
- activateEvent: {
436
- type: PropType<ActivateEvent>;
437
- };
438
- disabled: {
439
- type: BooleanConstructor;
440
- default: () => false;
441
- };
442
- disabledClass: {
443
- type: PropType<string | string[] | Record<string, boolean>>;
444
- };
445
- };
446
- type HiSwitchProps = typeof switchProps;
447
- declare const switchEmits: ("change" | "update:modelValue" | "reject")[];
448
- declare const useSwitch: _hoci_shared.HookComponent<{
449
- toggle: (value?: any) => void;
450
- modelValue: vue.Ref<boolean> | vue.WritableComputedRef<boolean>;
451
- className: vue.ComputedRef<string>;
452
- isDisabled: vue.ComputedRef<boolean>;
453
- activateEvent: vue.ComputedRef<ActivateEvent>;
454
- }, ("change" | "update:modelValue" | "reject")[], {
455
- modelValue: {
456
- type: BooleanConstructor;
457
- default: () => false;
458
- };
459
- class: {
460
- type: PropType<string | string[] | Record<string, boolean>>;
461
- };
462
- activeClass: {
463
- type: PropType<string | string[] | Record<string, boolean>>;
464
- };
465
- unactiveClass: {
466
- type: PropType<string | string[] | Record<string, boolean>>;
467
- };
468
- activateEvent: {
469
- type: PropType<ActivateEvent>;
470
- };
471
- disabled: {
472
- type: BooleanConstructor;
473
- default: () => false;
474
- };
475
- disabledClass: {
476
- type: PropType<string | string[] | Record<string, boolean>>;
477
- };
478
- }, vue.ExtractPropTypes<{
479
- modelValue: {
480
- type: BooleanConstructor;
481
- default: () => false;
482
- };
483
- class: {
484
- type: PropType<string | string[] | Record<string, boolean>>;
485
- };
486
- activeClass: {
487
- type: PropType<string | string[] | Record<string, boolean>>;
488
- };
489
- unactiveClass: {
490
- type: PropType<string | string[] | Record<string, boolean>>;
491
- };
492
- activateEvent: {
493
- type: PropType<ActivateEvent>;
494
- };
495
- disabled: {
496
- type: BooleanConstructor;
497
- default: () => false;
498
- };
499
- disabledClass: {
500
- type: PropType<string | string[] | Record<string, boolean>>;
501
- };
502
- }>, {
503
- disabled: boolean;
504
- modelValue: boolean;
505
- }>;
506
-
507
- declare const iconProps: {
508
- src: {
509
- type: StringConstructor;
510
- required: true;
511
- };
512
- size: {
513
- type: (StringConstructor | NumberConstructor)[];
514
- };
515
- width: {
516
- type: (StringConstructor | NumberConstructor)[];
517
- };
518
- height: {
519
- type: (StringConstructor | NumberConstructor)[];
520
- };
521
- color: {
522
- type: StringConstructor;
523
- default: string;
524
- };
525
- mask: {
526
- type: PropType<boolean | "auto">;
527
- default: () => "auto";
528
- };
529
- };
530
- type HiIconProps = typeof iconProps;
531
- declare const useIcon: _hoci_shared.HookComponent<{
532
- style: vue.ComputedRef<CSSProperties$1>;
533
- }, vue.EmitsOptions, {
534
- src: {
535
- type: StringConstructor;
536
- required: true;
537
- };
538
- size: {
539
- type: (StringConstructor | NumberConstructor)[];
540
- };
541
- width: {
542
- type: (StringConstructor | NumberConstructor)[];
543
- };
544
- height: {
545
- type: (StringConstructor | NumberConstructor)[];
546
- };
547
- color: {
548
- type: StringConstructor;
549
- default: string;
550
- };
551
- mask: {
552
- type: PropType<boolean | "auto">;
553
- default: () => "auto";
554
- };
555
- }, vue.ExtractPropTypes<{
556
- src: {
557
- type: StringConstructor;
558
- required: true;
559
- };
560
- size: {
561
- type: (StringConstructor | NumberConstructor)[];
562
- };
563
- width: {
564
- type: (StringConstructor | NumberConstructor)[];
565
- };
566
- height: {
567
- type: (StringConstructor | NumberConstructor)[];
568
- };
569
- color: {
570
- type: StringConstructor;
571
- default: string;
572
- };
573
- mask: {
574
- type: PropType<boolean | "auto">;
575
- default: () => "auto";
576
- };
577
- }>, {
578
- mask: boolean | "auto";
579
- color: string;
580
- }>;
581
-
582
- declare const configProviderProps: {
583
- icon: {
584
- type: PropType<Partial<{
585
- size: number | undefined;
586
- sizeUnit: string | undefined;
587
- }>>;
588
- };
589
- activateEvent: {
590
- type: PropType<Partial<_hoci_shared.ActivateEvent>>;
591
- };
592
- };
593
-
594
- type Placement = "bottom" | "top" | "left" | "right" | "auto" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom" | "right-top" | "right-bottom";
595
- type TriggerEvent = "click" | "mousedown" | "dblclick" | "hover" | "contextmenu" | "focus" | "touch";
596
- declare const popoverProps: {
597
- popupClass: {
598
- type: StringConstructor;
599
- };
600
- placement: {
601
- type: PropType<Placement>;
602
- default: () => "auto";
355
+ placement: {
356
+ type: PropType<Placement>;
357
+ default: () => "auto";
603
358
  };
604
359
  triggerEvent: {
605
360
  type: PropType<TriggerEvent>;
@@ -622,7 +377,7 @@ declare const popoverProps: {
622
377
  default: () => false;
623
378
  };
624
379
  teleport: {
625
- type: PropType<string | boolean | HTMLElement>;
380
+ type: PropType<string | HTMLElement | boolean>;
626
381
  default: () => true;
627
382
  };
628
383
  };
@@ -644,8 +399,8 @@ declare const usePopover: _hoci_shared.HookComponent<{
644
399
  x: number;
645
400
  y: number;
646
401
  };
647
- triggerRef: vue.Ref<HTMLElement | undefined>;
648
- popupRef: vue.Ref<HTMLElement | undefined>;
402
+ triggerRef: _hoci_shared.ElementRef<HTMLElement>;
403
+ popupRef: _hoci_shared.ElementRef<HTMLElement>;
649
404
  popupClass: vue.ComputedRef<string | undefined>;
650
405
  popupStyle: vue.ComputedRef<{
651
406
  left: string;
@@ -682,7 +437,7 @@ declare const usePopover: _hoci_shared.HookComponent<{
682
437
  default: () => false;
683
438
  };
684
439
  teleport: {
685
- type: PropType<string | boolean | HTMLElement>;
440
+ type: PropType<string | HTMLElement | boolean>;
686
441
  default: () => true;
687
442
  };
688
443
  }, vue.ExtractPropTypes<{
@@ -714,7 +469,7 @@ declare const usePopover: _hoci_shared.HookComponent<{
714
469
  default: () => false;
715
470
  };
716
471
  teleport: {
717
- type: PropType<string | boolean | HTMLElement>;
472
+ type: PropType<string | HTMLElement | boolean>;
718
473
  default: () => true;
719
474
  };
720
475
  }>, {
@@ -727,4 +482,295 @@ declare const usePopover: _hoci_shared.HookComponent<{
727
482
  teleport: string | boolean | HTMLElement;
728
483
  }>;
729
484
 
730
- 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 };