@formkit/pro 0.112.7 → 0.114.0-b83e249

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/index.d.ts CHANGED
@@ -1,7 +1,16 @@
1
+ import type { AllReals } from '@formkit/inputs';
1
2
  import { FormKitExtendableSchemaRoot } from '@formkit/core';
3
+ import type { FormKitFrameworkContext } from '@formkit/core';
4
+ import type { FormKitInputs } from '@formkit/inputs';
5
+ import type { FormKitMessage } from '@formkit/core';
6
+ import type { FormKitNode } from '@formkit/core';
7
+ import type { FormKitOptionsItem } from '@formkit/inputs';
8
+ import type { FormKitOptionsProp } from '@formkit/inputs';
9
+ import type { FormKitOptionsValue } from '@formkit/inputs';
2
10
  import { FormKitPlugin } from '@formkit/core';
3
11
  import { FormKitSchemaExtendableSection } from '@formkit/inputs';
4
12
  import { FormKitSchemaNode } from '@formkit/core';
13
+ import type { FormKitSlotData } from '@formkit/inputs';
5
14
  import { FormKitTypeDefinition } from '@formkit/core';
6
15
 
7
16
  /**
@@ -20,6 +29,129 @@ export declare function $if(condition: string, then: FormKitProExtendableSection
20
29
  */
21
30
  export declare const autocomplete: FormKitProInput;
22
31
 
32
+ /**
33
+ * Data available to autocomplete slots.
34
+ *
35
+ * @public
36
+ */
37
+ export declare interface AutocompleteSlotData {
38
+ options: FormKitOptionsItem[];
39
+ debounce?: number | string;
40
+ multiple?: Bool;
41
+ selectionAppearance?: 'option' | 'text-input' | 'text';
42
+ openOnClick?: Bool;
43
+ filter?: (option: FormKitOptionsItem, search?: string) => boolean;
44
+ optionLoader?: OptionLoader;
45
+ emptyMessage?: string;
46
+ closeOnSelect?: Bool;
47
+ activeDescendant?: string;
48
+ activeValue?: unknown;
49
+ dropdownWrapperStyles: Record<string, boolean>;
50
+ expanded: boolean;
51
+ forceExpanded: undefined | true;
52
+ hasNextPage: (data?: any) => void;
53
+ isLoadingOption?: boolean;
54
+ listboxStyles: Record<string, boolean>;
55
+ loadMoreOption: FormKitOptionsItem;
56
+ loadOnCreated: undefined | true;
57
+ loadOnScroll: undefined | true;
58
+ max?: number | string;
59
+ option: FormKitOptionsItem;
60
+ optionsLoader?: FormKitOptionsLoader;
61
+ page: number;
62
+ placeholder?: string;
63
+ selections: FormKitOptionsItem[];
64
+ showEmptyMessage?: boolean;
65
+ handlers: FormKitFrameworkContext['handlers'] & {
66
+ selectOption: (option: FormKitOptionsItem) => void;
67
+ loadMoreSelected: () => void;
68
+ selectTag: (option: FormKitOptionsItem) => void;
69
+ toggleListbox: () => void;
70
+ removeSelection: (option: FormKitOptionsItem) => void;
71
+ touchmove: (e: TouchEvent) => void;
72
+ touchend: (e: TouchEvent) => void;
73
+ click: (e: MouseEvent) => void;
74
+ keydown: (e: KeyboardEvent) => void;
75
+ focus: (e: FocusEvent) => void;
76
+ loadMore: () => void;
77
+ };
78
+ fns: FormKitFrameworkContext['fns'] & {
79
+ isSelected: (option: FormKitOptionsItem) => boolean;
80
+ isActive: (option: FormKitOptionsItem) => boolean;
81
+ };
82
+ ui: FormKitFrameworkContext['ui'] & {
83
+ isLoading: FormKitMessage;
84
+ loadMore: FormKitMessage;
85
+ };
86
+ }
87
+
88
+ declare interface BasePart<T extends string = string> {
89
+ /**
90
+ * A textual representation to use as a placeholder.
91
+ */
92
+ placeholder: string;
93
+ /**
94
+ * A token that represents this pattern
95
+ */
96
+ token: T;
97
+ /**
98
+ * In select mode, which direction should types values flow?
99
+ */
100
+ selectDirection?: 'left' | 'right';
101
+ /**
102
+ * An optional character to fill the selection with when in select mode.
103
+ * This is different than the placeholder character in that this character is
104
+ * only used when the section has a value but that value is not "complete".
105
+ * This character should be a single character, and valid for the given part.
106
+ * For example, numbers may use a "0" as the selectFill since it leads to a
107
+ * valid number with leading zeros. ### would be 001 when a user types "1".
108
+ */
109
+ selectFill?: string;
110
+ }
111
+
112
+ declare type Bool = 'true' | 'false' | true | false | '';
113
+
114
+ /**
115
+ * A calendar is an array of months, where each month is an array of weeks,
116
+ * where each week is an array of days.
117
+ *
118
+ * @public
119
+ */
120
+ export declare type Calendar = Array<CalendarMonth>;
121
+
122
+ /**
123
+ * A calendar month is an array of weeks, where each week is an array of days.
124
+ *
125
+ * @public
126
+ */
127
+ export declare type CalendarMonth = Array<CalendarWeek>;
128
+
129
+ /**
130
+ * A calendar week is an array of 7 days (tuple of 7) where each day is a date.
131
+ *
132
+ * @public
133
+ */
134
+ export declare type CalendarWeek = [
135
+ monday: Date,
136
+ tuesday: Date,
137
+ wednesday: Date,
138
+ thursday: Date,
139
+ friday: Date,
140
+ saturday: Date,
141
+ sunday: Date
142
+ ];
143
+
144
+ declare interface CharPart {
145
+ /**
146
+ * Defined the part as a fixed length value
147
+ */
148
+ type: 'char';
149
+ /**
150
+ * Regular expression that defines what characters can be applied.
151
+ */
152
+ pattern: RegExp;
153
+ }
154
+
23
155
  /**
24
156
  * Creates a set of commonly used sections.
25
157
  * @param createSection - Creates commonly used sections.
@@ -56,23 +188,317 @@ export declare function createProPlugin(apiKey: string, inputs?: Record<string,
56
188
  */
57
189
  export declare function createSectionFactory(inputCode: string): SectionFactory;
58
190
 
191
+ /**
192
+ * Possible options for a format style.
193
+ */
194
+ declare type DateFormatStyle = 'full' | 'long' | 'medium' | 'short';
195
+
59
196
  /**
60
197
  * Input definition for a datepicker input.
61
198
  * @public
62
199
  */
63
200
  export declare const datepicker: FormKitProInput;
64
201
 
202
+ /**
203
+ * Slot information that pertains specifically to the datepicker input.
204
+ *
205
+ * @public
206
+ */
207
+ export declare type DatePickerSlotData = {
208
+ panel: Panels;
209
+ calendar: Calendar;
210
+ inputText: string;
211
+ renderedDate: Date;
212
+ expanded: boolean;
213
+ showPagination: boolean;
214
+ localTime: string;
215
+ visibilityStyles: Record<string, boolean>;
216
+ fns: FormKitFrameworkContext['fns'] & {
217
+ format: (date: Date | string, format: string) => string;
218
+ sameDay: (date: Date) => boolean;
219
+ sameMonth: (month: Date) => boolean;
220
+ notInMonth: (month: Date, day: Date) => boolean;
221
+ isDisabled: (node: FormKitNode, date?: Date) => boolean;
222
+ isDisabledMonth: (month: Date) => boolean;
223
+ isSelected: (date: Date) => boolean;
224
+ };
225
+ handlers: FormKitFrameworkContext['handlers'] & {
226
+ next: () => void;
227
+ prev: () => void;
228
+ open: () => void;
229
+ _blurOut: () => void;
230
+ jumpTo: (date: Date) => void;
231
+ localTime: (e: InputEvent) => void;
232
+ setDate: (date: Date) => () => void;
233
+ keydown: (e: KeyboardEvent) => void;
234
+ mouseEnter: (date: Date) => void;
235
+ mouseLeave: () => void;
236
+ };
237
+ ui: FormKitFrameworkContext['ui'] & {
238
+ changeDate: FormKitMessage;
239
+ chooseDate: FormKitMessage;
240
+ };
241
+ dayButtonFormat: string;
242
+ monthButtonFormat: string;
243
+ yearFormat: string;
244
+ };
245
+
65
246
  /**
66
247
  * Input definition for a dropdown input.
67
248
  * @public
68
249
  */
69
250
  export declare const dropdown: FormKitProInput;
70
251
 
252
+ /**
253
+ * Slot data for dropdown types.
254
+ *
255
+ * @public
256
+ */
257
+ export declare interface DropdownSlotData {
258
+ options: FormKitOptionsItem[];
259
+ option?: FormKitOptionsItem;
260
+ debounce?: number | string;
261
+ multiple?: Bool;
262
+ selectionAppearance?: 'truncate' | 'tags';
263
+ openOnClick?: Bool;
264
+ filter?: (option: FormKitOptionsItem, search: string) => boolean;
265
+ optionLoader?: OptionLoader;
266
+ emptyMessage?: string;
267
+ max?: number | string;
268
+ closeOnSelect?: Bool;
269
+ activeDescendant?: string;
270
+ activeValue?: unknown;
271
+ dropdownWrapperStyles: Record<string, boolean>;
272
+ expanded: boolean;
273
+ fns: FormKitFrameworkContext['fns'] & {};
274
+ handlers: FormKitFrameworkContext['handlers'] & {};
275
+ ui: FormKitFrameworkContext['ui'] & {
276
+ isLoading: FormKitMessage;
277
+ loadMore: FormKitMessage;
278
+ };
279
+ }
280
+
281
+ declare interface EnumPart {
282
+ /**
283
+ * Defines the part as an enumerated list of options.
284
+ */
285
+ type: 'enum';
286
+ /**
287
+ * The values allowed by an enum part.
288
+ */
289
+ values: string[];
290
+ }
291
+
71
292
  /**
72
293
  * A schema section that is compatible with FormKitPro’s schema composition.
73
294
  */
74
295
  declare type ExtendableSchema<IsRoot> = IsRoot extends true ? FormKitExtendableSchemaRoot : FormKitSchemaExtendableSection;
75
296
 
297
+ /**
298
+ * Possible objects for the dateStyle and timeStyle.
299
+ */
300
+ export declare type FormatStyleObj = {
301
+ date: DateFormatStyle;
302
+ time: TimeFormatStyle;
303
+ } | {
304
+ date: DateFormatStyle;
305
+ } | {
306
+ time: TimeFormatStyle;
307
+ };
308
+
309
+ export declare interface FormKitAutocompleteSlots<Props extends FormKitInputs<Props>> {
310
+ outer: FormKitSlotData<Props, AutocompleteSlotData>;
311
+ wrapper: FormKitSlotData<Props, AutocompleteSlotData>;
312
+ label: FormKitSlotData<Props, AutocompleteSlotData>;
313
+ inner: FormKitSlotData<Props, AutocompleteSlotData>;
314
+ prefixIcon: FormKitSlotData<Props, AutocompleteSlotData>;
315
+ prefix: FormKitSlotData<Props, AutocompleteSlotData>;
316
+ input: FormKitSlotData<Props, AutocompleteSlotData>;
317
+ selections: FormKitSlotData<Props, AutocompleteSlotData>;
318
+ selection: FormKitSlotData<Props, AutocompleteSlotData>;
319
+ listboxButton: FormKitSlotData<Props, AutocompleteSlotData>;
320
+ dropdownWrapper: FormKitSlotData<Props, AutocompleteSlotData>;
321
+ listbox: FormKitSlotData<Props, AutocompleteSlotData>;
322
+ listitem: FormKitSlotData<Props, AutocompleteSlotData>;
323
+ loadMore: FormKitSlotData<Props, AutocompleteSlotData>;
324
+ emptyMessageInner: FormKitSlotData<Props, AutocompleteSlotData>;
325
+ selectedIcon: FormKitSlotData<Props, AutocompleteSlotData & {
326
+ option: FormKitOptionsItem<OptionsProValue<Props['options']>>;
327
+ index: number;
328
+ }>;
329
+ option: FormKitSlotData<Props, AutocompleteSlotData & {
330
+ option: FormKitOptionsItem<OptionsProValue<Props['options']>>;
331
+ index: number;
332
+ }>;
333
+ optionLoading: FormKitSlotData<Props, AutocompleteSlotData & {
334
+ option: FormKitOptionsItem<OptionsProValue<Props['options']>>;
335
+ index: number;
336
+ }>;
337
+ removeSelection: FormKitSlotData<Props, AutocompleteSlotData & {
338
+ option: FormKitOptionsItem<OptionsProValue<Props['options']>>;
339
+ index: number;
340
+ }>;
341
+ suffix: FormKitSlotData<Props, AutocompleteSlotData>;
342
+ suffixIcon: FormKitSlotData<Props, AutocompleteSlotData>;
343
+ help: FormKitSlotData<Props, AutocompleteSlotData>;
344
+ messages: FormKitSlotData<Props, AutocompleteSlotData>;
345
+ message: FormKitSlotData<Props, AutocompleteSlotData>;
346
+ }
347
+
348
+ /**
349
+ * Slot information that pertains specifically to the datepicker input.
350
+ *
351
+ * @public
352
+ */
353
+ export declare interface FormKitDatePickerSlots<Props extends FormKitInputs<Props>> {
354
+ calendar: FormKitSlotData<Props, DatePickerSlotData & {
355
+ month: CalendarMonth;
356
+ }>;
357
+ calendarHeader: FormKitSlotData<Props, DatePickerSlotData & {
358
+ month: CalendarMonth;
359
+ }>;
360
+ calendarWeeks: FormKitSlotData<Props, DatePickerSlotData & {
361
+ month: CalendarMonth;
362
+ }>;
363
+ day: FormKitSlotData<Props, DatePickerSlotData & {
364
+ month: CalendarMonth;
365
+ week: CalendarWeek;
366
+ day: Date;
367
+ }>;
368
+ dayButton: FormKitSlotData<Props, DatePickerSlotData & {
369
+ day: Date;
370
+ }>;
371
+ dayCell: FormKitSlotData<Props, DatePickerSlotData & {
372
+ day: Date;
373
+ week: CalendarWeek;
374
+ month: CalendarMonth;
375
+ }>;
376
+ daysHeader: FormKitSlotData<Props, DatePickerSlotData>;
377
+ help: FormKitSlotData<Props, DatePickerSlotData>;
378
+ prefixIcon: FormKitSlotData<Props, DatePickerSlotData>;
379
+ suffixIcon: FormKitSlotData<Props, DatePickerSlotData>;
380
+ inner: FormKitSlotData<Props, DatePickerSlotData>;
381
+ input: FormKitSlotData<Props, DatePickerSlotData>;
382
+ label: FormKitSlotData<Props, DatePickerSlotData>;
383
+ message: FormKitSlotData<Props, DatePickerSlotData & {
384
+ message: FormKitMessage;
385
+ }>;
386
+ messages: FormKitSlotData<Props, DatePickerSlotData>;
387
+ month: FormKitSlotData<Props, DatePickerSlotData & {
388
+ month: Date;
389
+ months: Array<Date>;
390
+ }>;
391
+ monthButton: FormKitSlotData<Props, DatePickerSlotData>;
392
+ months: FormKitSlotData<Props, DatePickerSlotData>;
393
+ monthsHeader: FormKitSlotData<Props, DatePickerSlotData>;
394
+ next: FormKitSlotData<Props, DatePickerSlotData>;
395
+ nextLabel: FormKitSlotData<Props, DatePickerSlotData>;
396
+ openButton: FormKitSlotData<Props, DatePickerSlotData>;
397
+ outer: FormKitSlotData<Props, DatePickerSlotData>;
398
+ panel: FormKitSlotData<Props, DatePickerSlotData>;
399
+ panelHeader: FormKitSlotData<Props, DatePickerSlotData>;
400
+ panelWrapper: FormKitSlotData<Props, DatePickerSlotData>;
401
+ prefix: FormKitSlotData<Props, DatePickerSlotData>;
402
+ prev: FormKitSlotData<Props, DatePickerSlotData>;
403
+ prevLabel: FormKitSlotData<Props, DatePickerSlotData>;
404
+ suffix: FormKitSlotData<Props, DatePickerSlotData>;
405
+ time: FormKitSlotData<Props, DatePickerSlotData>;
406
+ timeHeader: FormKitSlotData<Props, DatePickerSlotData>;
407
+ timeInput: FormKitSlotData<Props, DatePickerSlotData>;
408
+ week: FormKitSlotData<Props, DatePickerSlotData & {
409
+ month: CalendarMonth;
410
+ }>;
411
+ weekDay: FormKitSlotData<Props, DatePickerSlotData & {
412
+ month: CalendarMonth;
413
+ }>;
414
+ weekDays: FormKitSlotData<Props, DatePickerSlotData & {
415
+ month: CalendarMonth;
416
+ }>;
417
+ wrapper: FormKitSlotData<Props, DatePickerSlotData>;
418
+ year: FormKitSlotData<Props, DatePickerSlotData & {
419
+ years: Array<Date>;
420
+ }>;
421
+ yearButton: FormKitSlotData<Props, DatePickerSlotData & {
422
+ years: Array<Date>;
423
+ year: Date;
424
+ }>;
425
+ years: FormKitSlotData<Props, DatePickerSlotData & {
426
+ years: Array<Date>;
427
+ }>;
428
+ yearsHeader: FormKitSlotData<Props, DatePickerSlotData>;
429
+ }
430
+
431
+ export declare interface FormKitDropdownSlots<Props extends FormKitInputs<Props>> {
432
+ outer: FormKitSlotData<Props, DropdownSlotData>;
433
+ wrapper: FormKitSlotData<Props, DropdownSlotData>;
434
+ inner: FormKitSlotData<Props, DropdownSlotData>;
435
+ label: FormKitSlotData<Props, DropdownSlotData>;
436
+ prefix: FormKitSlotData<Props, DropdownSlotData>;
437
+ prefixIcon: FormKitSlotData<Props, DropdownSlotData>;
438
+ selector: FormKitSlotData<Props, DropdownSlotData>;
439
+ selection: FormKitSlotData<Props, DropdownSlotData>;
440
+ suffix: FormKitSlotData<Props, DropdownSlotData>;
441
+ suffixIcon: FormKitSlotData<Props, DropdownSlotData>;
442
+ help: FormKitSlotData<Props, DropdownSlotData>;
443
+ messages: FormKitSlotData<Props, DropdownSlotData>;
444
+ message: FormKitSlotData<Props, DropdownSlotData & {
445
+ message: FormKitMessage;
446
+ }>;
447
+ listboxButton: FormKitSlotData<Props, TaglistSlotData>;
448
+ dropdownWrapper: FormKitSlotData<Props, TaglistSlotData>;
449
+ listbox: FormKitSlotData<Props, TaglistSlotData>;
450
+ listitem: FormKitSlotData<Props, TaglistSlotData>;
451
+ loadMore: FormKitSlotData<Props, TaglistSlotData>;
452
+ emptyMessageInner: FormKitSlotData<Props, TaglistSlotData>;
453
+ selectedIcon: FormKitSlotData<Props, TaglistSlotData & {
454
+ option: FormKitOptionsItem;
455
+ index: number;
456
+ }>;
457
+ option: FormKitSlotData<Props, TaglistSlotData & {
458
+ option: FormKitOptionsItem;
459
+ index: number;
460
+ }>;
461
+ optionLoading: FormKitSlotData<Props, TaglistSlotData & {
462
+ option: FormKitOptionsItem;
463
+ index: number;
464
+ }>;
465
+ removeSelection: FormKitSlotData<Props, TaglistSlotData & {
466
+ option: FormKitOptionsItem;
467
+ index: number;
468
+ }>;
469
+ placeholder: FormKitSlotData<Props, DropdownSlotData>;
470
+ }
471
+
472
+ /**
473
+ * The option loader function type.
474
+ *
475
+ * @public
476
+ */
477
+ export declare interface FormKitOptionsLoader {
478
+ (context: FormKitFrameworkContext<any>): Promise<FormKitOptionsProp> | FormKitOptionsProp;
479
+ (...args: any[]): Promise<FormKitOptionsProp> | FormKitOptionsProp;
480
+ }
481
+
482
+ export declare type FormKitOverlaySlots<Props extends FormKitInputs<Props>> = Props['overlay'] extends Yes ? {
483
+ overlay: FormKitSlotData<Props, DatePickerSlotData>;
484
+ overlayChar: FormKitSlotData<Props, DatePickerSlotData & {
485
+ part: Meta;
486
+ }>;
487
+ overlayEnum: FormKitSlotData<Props, DatePickerSlotData & {
488
+ part: Meta;
489
+ }>;
490
+ overlayInner: FormKitSlotData<Props, DatePickerSlotData>;
491
+ overlayLiteral: FormKitSlotData<Props, DatePickerSlotData & {
492
+ part: Meta;
493
+ }>;
494
+ overlayParts: FormKitSlotData<Props, DatePickerSlotData & {
495
+ part: Meta;
496
+ }>;
497
+ overlayPlaceholder: FormKitSlotData<Props, DatePickerSlotData & {
498
+ part: Meta;
499
+ }>;
500
+ } : {};
501
+
76
502
  /**
77
503
  * An extendable schema section that is compatible with FormKitPro’s schema
78
504
  * composition.
@@ -89,6 +515,14 @@ export declare type FormKitProInput = Omit<FormKitTypeDefinition, 'schema'> & {
89
515
  schema: FormKitProSchema;
90
516
  };
91
517
 
518
+ /**
519
+ * The options prop for option-based inputs in pro like `autocomplete` and
520
+ * `dropdown`.
521
+ *
522
+ * @public
523
+ */
524
+ export declare type FormKitProOptionsProp = FormKitOptionsProp | FormKitOptionsLoader;
525
+
92
526
  /**
93
527
  * The type definition of a FormKit pro schema.
94
528
  * @public
@@ -104,6 +538,243 @@ declare interface FormKitProSection<IsRoot extends boolean = false> {
104
538
  (...children: Array<string | FormKitProExtendableSection>): FormKitProExtendableSection<IsRoot>;
105
539
  }
106
540
 
541
+ export declare interface FormKitRatingSlots<Props extends FormKitInputs<Props>> {
542
+ itemsWrapper: FormKitSlotData<Props, RatingSlotData>;
543
+ onItem: FormKitSlotData<Props, RatingSlotData & {
544
+ item: number;
545
+ }>;
546
+ offItem: FormKitSlotData<Props, RatingSlotData & {
547
+ item: number;
548
+ }>;
549
+ default: FormKitSlotData<Props, RatingSlotData & {
550
+ item: number;
551
+ }>;
552
+ ratingIcon: FormKitSlotData<Props, RatingSlotData & {
553
+ item: number;
554
+ }>;
555
+ }
556
+
557
+ /**
558
+ * Slot information that pertains specifically to the datepicker input.
559
+ *
560
+ * @public
561
+ */
562
+ export declare interface FormKitRepeaterSlots<Props extends FormKitInputs<Props>> {
563
+ outer: FormKitSlotData<Props, RepeaterSlotData>;
564
+ fieldset: FormKitSlotData<Props, RepeaterSlotData>;
565
+ legend: FormKitSlotData<Props, RepeaterSlotData>;
566
+ help: FormKitSlotData<Props, RepeaterSlotData>;
567
+ prefix: FormKitSlotData<Props, RepeaterSlotData>;
568
+ default: FormKitSlotData<Props, RepeaterSlotData>;
569
+ items: FormKitSlotData<Props, RepeaterSlotData>;
570
+ item: FormKitSlotData<Props, RepeaterSlotData>;
571
+ content: FormKitSlotData<Props, RepeaterSlotData & {
572
+ item: symbol;
573
+ index: number;
574
+ }>;
575
+ group: FormKitSlotData<Props, RepeaterSlotData & {
576
+ item: symbol;
577
+ index: number;
578
+ }>;
579
+ controls: FormKitSlotData<Props, RepeaterSlotData & {
580
+ item: symbol;
581
+ index: number;
582
+ }>;
583
+ up: FormKitSlotData<Props, RepeaterSlotData & {
584
+ item: symbol;
585
+ index: number;
586
+ }>;
587
+ upControl: FormKitSlotData<Props, RepeaterSlotData & {
588
+ item: symbol;
589
+ index: number;
590
+ }>;
591
+ controlLabel: FormKitSlotData<Props, RepeaterSlotData & {
592
+ item: symbol;
593
+ index: number;
594
+ }>;
595
+ moveUpIcon: FormKitSlotData<Props, RepeaterSlotData & {
596
+ item: symbol;
597
+ index: number;
598
+ }>;
599
+ remove: FormKitSlotData<Props, RepeaterSlotData & {
600
+ item: symbol;
601
+ index: number;
602
+ }>;
603
+ removeControl: FormKitSlotData<Props, RepeaterSlotData & {
604
+ item: symbol;
605
+ index: number;
606
+ }>;
607
+ removeIcon: FormKitSlotData<Props, RepeaterSlotData & {
608
+ item: symbol;
609
+ index: number;
610
+ }>;
611
+ insert: FormKitSlotData<Props, RepeaterSlotData & {
612
+ item: symbol;
613
+ index: number;
614
+ }>;
615
+ insertControl: FormKitSlotData<Props, RepeaterSlotData & {
616
+ item: symbol;
617
+ index: number;
618
+ }>;
619
+ addIcon: FormKitSlotData<Props, RepeaterSlotData & {
620
+ item: symbol;
621
+ index: number;
622
+ }>;
623
+ down: FormKitSlotData<Props, RepeaterSlotData & {
624
+ item: symbol;
625
+ index: number;
626
+ }>;
627
+ downControl: FormKitSlotData<Props, RepeaterSlotData & {
628
+ item: symbol;
629
+ index: number;
630
+ }>;
631
+ moveDownIcon: FormKitSlotData<Props, RepeaterSlotData & {
632
+ item: symbol;
633
+ index: number;
634
+ }>;
635
+ suffix: FormKitSlotData<Props, RepeaterSlotData>;
636
+ addButton: FormKitSlotData<Props, RepeaterSlotData>;
637
+ message: FormKitSlotData<Props, RepeaterSlotData & {
638
+ message: FormKitMessage;
639
+ }>;
640
+ messages: FormKitSlotData<Props, RepeaterSlotData>;
641
+ }
642
+
643
+ /**
644
+ * Slots available to the slider.
645
+ *
646
+ * @public
647
+ */
648
+ export declare interface FormKitSliderSlots<Props extends FormKitInputs<Props>> {
649
+ outer: FormKitSlotData<Props, SliderSlotData>;
650
+ wrapper: FormKitSlotData<Props, SliderSlotData>;
651
+ label: FormKitSlotData<Props, SliderSlotData>;
652
+ help: FormKitSlotData<Props, SliderSlotData>;
653
+ sliderInner: FormKitSlotData<Props, SliderSlotData>;
654
+ iconPrefix: FormKitSlotData<Props, SliderSlotData>;
655
+ prefix: FormKitSlotData<Props, SliderSlotData>;
656
+ track: FormKitSlotData<Props, SliderSlotData>;
657
+ trackWrapper: FormKitSlotData<Props, SliderSlotData>;
658
+ trackInner: FormKitSlotData<Props, SliderSlotData>;
659
+ fill: FormKitSlotData<Props, SliderSlotData>;
660
+ marks: FormKitSlotData<Props, SliderSlotData>;
661
+ mark: FormKitSlotData<Props, SliderSlotData>;
662
+ markLabel: FormKitSlotData<Props, SliderSlotData & {
663
+ index: number;
664
+ step: {
665
+ at: number;
666
+ label?: string;
667
+ };
668
+ }>;
669
+ handles: FormKitSlotData<Props, SliderSlotData>;
670
+ handleMin: FormKitSlotData<Props, SliderSlotData>;
671
+ handleMax: FormKitSlotData<Props, SliderSlotData>;
672
+ tooltipMin: FormKitSlotData<Props, SliderSlotData>;
673
+ tooltipMax: FormKitSlotData<Props, SliderSlotData>;
674
+ suffix: FormKitSlotData<Props, SliderSlotData>;
675
+ suffixIcon: FormKitSlotData<Props, SliderSlotData>;
676
+ minValue: FormKitSlotData<Props, SliderSlotData>;
677
+ maxValue: FormKitSlotData<Props, SliderSlotData>;
678
+ linkedValues: FormKitSlotData<Props, SliderSlotData>;
679
+ message: FormKitSlotData<Props, SliderSlotData & {
680
+ message: FormKitMessage;
681
+ }>;
682
+ messages: FormKitSlotData<Props, SliderSlotData>;
683
+ }
684
+
685
+ export declare interface FormKitTaglistSlots<Props extends FormKitInputs<Props>> {
686
+ outer: FormKitSlotData<Props, TaglistSlotData>;
687
+ wrapper: FormKitSlotData<Props, TaglistSlotData>;
688
+ inner: FormKitSlotData<Props, TaglistSlotData>;
689
+ label: FormKitSlotData<Props, TaglistSlotData>;
690
+ prefix: FormKitSlotData<Props, TaglistSlotData>;
691
+ prefixIcon: FormKitSlotData<Props, TaglistSlotData>;
692
+ tag: FormKitSlotData<Props, TaglistSlotData & {
693
+ option: FormKitOptionsItem;
694
+ index: number;
695
+ }>;
696
+ tagWrapper: FormKitSlotData<Props, TaglistSlotData>;
697
+ tagLoading: FormKitSlotData<Props, TaglistSlotData & {
698
+ option: FormKitOptionsItem;
699
+ index: number;
700
+ }>;
701
+ suffix: FormKitSlotData<Props, TaglistSlotData>;
702
+ suffixIcon: FormKitSlotData<Props, TaglistSlotData>;
703
+ help: FormKitSlotData<Props, TaglistSlotData>;
704
+ messages: FormKitSlotData<Props, TaglistSlotData>;
705
+ message: FormKitSlotData<Props, TaglistSlotData & {
706
+ message: FormKitMessage;
707
+ }>;
708
+ listboxButton: FormKitSlotData<Props, TaglistSlotData>;
709
+ dropdownWrapper: FormKitSlotData<Props, TaglistSlotData>;
710
+ listbox: FormKitSlotData<Props, TaglistSlotData>;
711
+ listitem: FormKitSlotData<Props, TaglistSlotData>;
712
+ loadMore: FormKitSlotData<Props, TaglistSlotData>;
713
+ emptyMessageInner: FormKitSlotData<Props, TaglistSlotData>;
714
+ selectedIcon: FormKitSlotData<Props, TaglistSlotData & {
715
+ option: FormKitOptionsItem;
716
+ index: number;
717
+ }>;
718
+ option: FormKitSlotData<Props, TaglistSlotData & {
719
+ option: FormKitOptionsItem;
720
+ index: number;
721
+ }>;
722
+ optionLoading: FormKitSlotData<Props, TaglistSlotData & {
723
+ option: FormKitOptionsItem;
724
+ index: number;
725
+ }>;
726
+ removeSelection: FormKitSlotData<Props, TaglistSlotData & {
727
+ option: FormKitOptionsItem;
728
+ index: number;
729
+ }>;
730
+ input: FormKitSlotData<Props, TaglistSlotData>;
731
+ tags: FormKitSlotData<Props, TaglistSlotData>;
732
+ tagLabel: FormKitSlotData<Props, TaglistSlotData & {
733
+ option: FormKitOptionsItem;
734
+ index: number;
735
+ }>;
736
+ }
737
+
738
+ /**
739
+ * Toggle slots.
740
+ *
741
+ * @public
742
+ */
743
+ export declare interface FormKitToggleSlots<Props extends FormKitInputs<Props>> {
744
+ outer: FormKitSlotData<Props, ToggleSlotData<Props>>;
745
+ wrapper: FormKitSlotData<Props, ToggleSlotData<Props>>;
746
+ altLabel: FormKitSlotData<Props, ToggleSlotData<Props>>;
747
+ inner: FormKitSlotData<Props, ToggleSlotData<Props>>;
748
+ prefix: FormKitSlotData<Props, ToggleSlotData<Props>>;
749
+ input: FormKitSlotData<Props, ToggleSlotData<Props>>;
750
+ track: FormKitSlotData<Props, ToggleSlotData<Props>>;
751
+ innerLabel: FormKitSlotData<Props, ToggleSlotData<Props>>;
752
+ thumbWrapper: FormKitSlotData<Props, ToggleSlotData<Props>>;
753
+ suffix: FormKitSlotData<Props, ToggleSlotData<Props>>;
754
+ valueLabel: FormKitSlotData<Props, ToggleSlotData<Props>>;
755
+ label: FormKitSlotData<Props, ToggleSlotData<Props>>;
756
+ help: FormKitSlotData<Props, ToggleSlotData<Props>>;
757
+ messages: FormKitSlotData<Props, ToggleSlotData<Props>>;
758
+ message: FormKitSlotData<Props, ToggleSlotData<Props> & {
759
+ message: FormKitMessage;
760
+ }>;
761
+ }
762
+
763
+ /**
764
+ * Behavioral group options.
765
+ */
766
+ declare interface GroupOptions {
767
+ repeat?: boolean;
768
+ optional?: boolean;
769
+ placeholder?: string;
770
+ nextPart?: MaskPart;
771
+ }
772
+
773
+ declare type GroupPart = {
774
+ type: 'group';
775
+ parts: MaskPart[];
776
+ } & GroupOptions;
777
+
107
778
  declare namespace inputs {
108
779
  export {
109
780
  dropdown,
@@ -120,24 +791,110 @@ declare namespace inputs {
120
791
  }
121
792
  export { inputs }
122
793
 
794
+ declare interface LiteralPart<T extends string = string> {
795
+ /**
796
+ * Defines a literal (immutable) string.
797
+ */
798
+ type: 'literal';
799
+ /**
800
+ * The value of the immutable string.
801
+ */
802
+ value: T;
803
+ }
804
+
123
805
  /**
124
806
  * Input definition for a mask input.
125
807
  * @public
126
808
  */
127
809
  export declare const mask: FormKitProInput;
128
810
 
811
+ /**
812
+ * Defines a specific part of a mask pattern.
813
+ */
814
+ declare type MaskPart<T extends string = string> = ((BasePart<T> & CharPart) | (BasePart<T> & EnumPart)) | LiteralPart<T> | GroupPart;
815
+
816
+ declare interface Meta {
817
+ value: string;
818
+ type: 'placeholder' | 'literal' | 'char' | 'enum';
819
+ }
820
+
821
+ export declare interface OptionLoader {
822
+ (value: any, cachedItem: FormKitOptionsItem<any>): FormKitOptionsItem<any> | string | void | Promise<FormKitOptionsItem<any> | string | void>;
823
+ }
824
+
825
+ /**
826
+ * Gets the allowed value type from the `options` prop.
827
+ *
828
+ * @public
829
+ */
830
+ export declare type OptionsProValue<Options> = Options extends FormKitProOptionsProp ? Options extends (...args: any[]) => any ? ReturnType<Options> extends FormKitOptionsProp ? FormKitOptionsValue<ReturnType<Options>> : ReturnType<Options> extends Promise<infer T> ? T extends FormKitOptionsProp ? FormKitOptionsValue<T> : unknown : unknown : Options extends FormKitOptionsProp ? FormKitOptionsValue<Options> : unknown : unknown;
831
+
832
+ /**
833
+ * The available popover panels for the datepicker.
834
+ *
835
+ * @public
836
+ */
837
+ export declare type Panels = 'year' | 'month' | 'day' | 'time';
838
+
839
+ /**
840
+ * A map of the parts used
841
+ */
842
+ export declare type PartMap<T = MaskPart> = {
843
+ [index: string]: T;
844
+ };
845
+
129
846
  /**
130
847
  * Input definition for a rating input.
131
848
  * @public
132
849
  */
133
850
  export declare const rating: FormKitProInput;
134
851
 
852
+ /**
853
+ * Slot data for ratings
854
+ *
855
+ * @public
856
+ */
857
+ declare interface RatingSlotData {
858
+ min: number;
859
+ max: number;
860
+ offWidth: number;
861
+ onWidth: number;
862
+ onColor: number;
863
+ offColor: number;
864
+ handlers: FormKitFrameworkContext['handlers'] & {
865
+ ratingHoverOver: () => void;
866
+ ratingHoverOut: () => void;
867
+ handleClick: () => void;
868
+ };
869
+ }
870
+
135
871
  /**
136
872
  * Input definition for a repeater input.
137
873
  * @public
138
874
  */
139
875
  export declare const repeater: FormKitProInput;
140
876
 
877
+ declare interface RepeaterSlotData {
878
+ items: Array<symbol>;
879
+ removeControl: boolean;
880
+ insertControl: boolean;
881
+ upControl: boolean;
882
+ downControl: boolean;
883
+ addLabel?: string;
884
+ fns: FormKitFrameworkContext['fns'] & {
885
+ createShift: (index: number, delta: 1 | -1) => () => void;
886
+ createInsert: (index: number) => () => void;
887
+ createAppend: () => () => void;
888
+ createRemove: (index: number) => () => void;
889
+ };
890
+ ui: FormKitFrameworkContext['ui'] & {
891
+ moveUp: FormKitMessage;
892
+ moveDown: FormKitMessage;
893
+ add: FormKitMessage;
894
+ remove: FormKitMessage;
895
+ };
896
+ }
897
+
141
898
  /**
142
899
  * A factory that creates createSection functions that are curried with the
143
900
  * input code.
@@ -150,37 +907,235 @@ declare type SectionFactory = <IsRoot extends boolean = false>(sectionName: stri
150
907
  */
151
908
  export declare const slider: FormKitProInput;
152
909
 
910
+ /**
911
+ * Conditional slots available to the slider when using a chart.
912
+ *
913
+ * @public
914
+ */
915
+ export declare interface SliderChartSlots<Props extends FormKitInputs<Props>> {
916
+ chart: FormKitSlotData<Props, SliderSlotData>;
917
+ chartBar: FormKitSlotData<Props, SliderSlotData>;
918
+ }
919
+
920
+ /**
921
+ * Slot data for sliders.
922
+ *
923
+ * @public
924
+ */
925
+ export declare interface SliderSlotData {
926
+ chart?: Array<{
927
+ value: number;
928
+ at: number;
929
+ }>;
930
+ inputAttrs?: Record<string, any>;
931
+ marks?: Bool | Array<{
932
+ at?: number;
933
+ label?: string;
934
+ }>;
935
+ markLabel?: Bool;
936
+ max: number | string;
937
+ maxInputAttrs?: Record<string, any>;
938
+ min: number;
939
+ minInputAttrs?: Record<string, any>;
940
+ prefix?: string;
941
+ showInput?: Bool;
942
+ snapToMarks?: Bool;
943
+ suffix?: string;
944
+ tooltip?: Bool;
945
+ isMulti: boolean;
946
+ fillStyles: Record<string, boolean>;
947
+ lastHandleInteraction?: 'min' | 'max';
948
+ handlers: FormKitFrameworkContext['handlers'] & {
949
+ clickTrack: (e: MouseEvent) => void;
950
+ focus: (e: FocusEvent) => void;
951
+ clickHandle: (e: MouseEvent) => void;
952
+ startDrag: (e: Event) => void;
953
+ keydown: (e: KeyboardEvent) => void;
954
+ maxNode: (node: FormKitNode) => void;
955
+ minNode: (node: FormKitNode) => void;
956
+ inputBlur: () => void;
957
+ };
958
+ }
959
+
153
960
  /**
154
961
  * Input definition for a taglist input.
155
962
  * @public
156
963
  */
157
964
  export declare const taglist: FormKitProInput;
158
965
 
966
+ export declare interface TaglistSlotData {
967
+ options: FormKitOptionsItem[];
968
+ debounce?: number | string;
969
+ openOnClick?: Bool;
970
+ filter?: (option: FormKitOptionsItem, search: string) => boolean;
971
+ optionLoader?: OptionLoader;
972
+ emptyMessage?: string;
973
+ max?: number | string;
974
+ closeOnSelect?: Bool;
975
+ activeDescendant?: string;
976
+ activeValue?: unknown;
977
+ dropdownWrapperStyles: Record<string, boolean>;
978
+ expanded: boolean;
979
+ page: number;
980
+ search: string;
981
+ hasNextPage: (data?: any) => void;
982
+ fns: FormKitFrameworkContext['fns'] & {};
983
+ handlers: FormKitFrameworkContext['handlers'] & {};
984
+ ui: FormKitFrameworkContext['ui'] & {
985
+ isLoading: FormKitMessage;
986
+ loadMore: FormKitMessage;
987
+ };
988
+ }
989
+
990
+ declare type TimeFormatStyle = 'long' | 'medium' | 'short';
991
+
159
992
  /**
160
993
  * Input definition for a toggle input.
161
994
  * @public
162
995
  */
163
996
  export declare const toggle: FormKitProInput;
164
997
 
998
+ /**
999
+ * Slot data for toggles
1000
+ */
1001
+ export declare interface ToggleSlotData<Props extends FormKitInputs<Props>> {
1002
+ onValue: Props['onValue'] extends AllReals ? Props['onValue'] : true;
1003
+ offValue: Props['offValue'] extends AllReals ? Props['offValue'] : true;
1004
+ altLabelPosition?: Bool;
1005
+ offValueLabel?: string;
1006
+ onValueLabel?: string;
1007
+ valueLabelDisplay?: 'on' | 'off' | 'inner' | 'hidden';
1008
+ valueLabelColorOff?: string;
1009
+ valueLabelColorOn?: string;
1010
+ thumbIcon?: string;
1011
+ thumbColorOn?: string;
1012
+ iconColorOff?: string;
1013
+ iconColorOn?: string;
1014
+ trackColorOff?: string;
1015
+ trackColorOn?: string;
1016
+ handlers: FormKitFrameworkContext['handlers'] & {
1017
+ toggles: (e: InputEvent) => void;
1018
+ };
1019
+ }
1020
+
165
1021
  /**
166
1022
  * Input definition for a transferlist input.
167
1023
  * @public
168
1024
  */
169
1025
  export declare const transferlist: FormKitProInput;
170
1026
 
171
-
172
- /**
173
- * @public
174
- */
175
- declare module '@formkit/inputs' {
176
- export interface FormKitOptionsPropExtensions {
177
- asLoaderFunction: FormKitOptionsLoader | Promise<FormKitOptionsLoader>
178
- }
179
- }
180
-
181
- /**
182
- * @public
183
- */
1027
+ /**
1028
+ * Data available to transfer lists.
1029
+ *
1030
+ * @public
1031
+ */
1032
+ export declare interface TransferlistSlotData {
1033
+ options: FormKitOptionsItem[];
1034
+ debounce?: string | number;
1035
+ filter?: (option: FormKitOptionsItem, search?: string) => boolean;
1036
+ optionLoader?: OptionLoader;
1037
+ sourceEmptyMessage?: string;
1038
+ targetEmptyMessage?: string;
1039
+ max?: string | number;
1040
+ clearOnSelect?: Bool;
1041
+ searchable?: Bool;
1042
+ sourceLabel?: string;
1043
+ targetLabel?: string;
1044
+ transferOnSelect?: boolean;
1045
+ placeholder?: string;
1046
+ selections: FormKitOptionsItem[];
1047
+ activeValue?: unknown;
1048
+ activeDescendant?: string;
1049
+ sourceSelected?: boolean;
1050
+ targetOptions?: FormKitOptionsItem[];
1051
+ sourceOptions?: FormKitOptionsItem[];
1052
+ inputText: string;
1053
+ hasNextPage?: (dataForNextPage?: unknown) => void;
1054
+ page: number;
1055
+ targetLoading?: boolean;
1056
+ disabled?: boolean;
1057
+ showSourceEmptyMessage: boolean;
1058
+ showTargetEmptyMessage: boolean;
1059
+ fns: FormKitFrameworkContext['fns'] & {
1060
+ isSelected: (option: FormKitOptionsItem) => boolean;
1061
+ isActive: (option: FormKitOptionsItem) => boolean;
1062
+ optionValue: (option: FormKitOptionsItem) => unknown;
1063
+ getOptionCount: (targetOptions: boolean) => number;
1064
+ };
1065
+ handlers: FormKitFrameworkContext['handlers'] & {
1066
+ clearSearch: () => void;
1067
+ selectOption: (option: FormKitOptionsItem, isSource: boolean) => void;
1068
+ transferForward: () => void;
1069
+ transferForwardAll: () => void;
1070
+ transferBackward: () => void;
1071
+ transferBackwardAll: () => void;
1072
+ onSearch: (e: InputEvent) => void;
1073
+ handleSourceSearchKeyDown: (e: KeyboardEvent) => void;
1074
+ sourceKeyDown: (e: KeyboardEvent) => void;
1075
+ targetKeyDown: (e: KeyboardEvent) => void;
1076
+ sourceFocused: () => void;
1077
+ targetFocused: () => void;
1078
+ onMouseEnter: () => void;
1079
+ onMouseLeave: () => void;
1080
+ };
1081
+ }
1082
+
1083
+ export declare interface TransferlistSlots<Props extends FormKitInputs<Props>> {
1084
+ outer: FormKitSlotData<Props, TransferlistSlotData>;
1085
+ fieldset: FormKitSlotData<Props, TransferlistSlotData>;
1086
+ legend: FormKitSlotData<Props, TransferlistSlotData>;
1087
+ help: FormKitSlotData<Props, TransferlistSlotData>;
1088
+ wrapper: FormKitSlotData<Props, TransferlistSlotData>;
1089
+ source: FormKitSlotData<Props, TransferlistSlotData>;
1090
+ sourceHeader: FormKitSlotData<Props, TransferlistSlotData>;
1091
+ sourceHeaderLabel: FormKitSlotData<Props, TransferlistSlotData>;
1092
+ sourceHeaderItemCount: FormKitSlotData<Props, TransferlistSlotData>;
1093
+ sourceControls: FormKitSlotData<Props, TransferlistSlotData>;
1094
+ sourceSearch: FormKitSlotData<Props, TransferlistSlotData>;
1095
+ sourceSearchInput: FormKitSlotData<Props, TransferlistSlotData>;
1096
+ sourceSearchClear: FormKitSlotData<Props, TransferlistSlotData>;
1097
+ closeIcon: FormKitSlotData<Props, TransferlistSlotData>;
1098
+ sourceListItems: FormKitSlotData<Props, TransferlistSlotData>;
1099
+ sourceEmptyMessage: FormKitSlotData<Props, TransferlistSlotData>;
1100
+ emptyMessageInner: FormKitSlotData<Props, TransferlistSlotData>;
1101
+ sourceListItem: FormKitSlotData<Props, TransferlistSlotData>;
1102
+ selectedIcon: FormKitSlotData<Props, TransferlistSlotData>;
1103
+ sourceOption: FormKitSlotData<Props, TransferlistSlotData & {
1104
+ option: FormKitOptionsItem;
1105
+ }>;
1106
+ sourceLoadMore: FormKitSlotData<Props, TransferlistSlotData>;
1107
+ loadMoreInner: FormKitSlotData<Props, TransferlistSlotData>;
1108
+ loaderIcon: FormKitSlotData<Props, TransferlistSlotData>;
1109
+ transferControls: FormKitSlotData<Props, TransferlistSlotData>;
1110
+ transferButtonForward: FormKitSlotData<Props, TransferlistSlotData>;
1111
+ transferButtonForwardAll: FormKitSlotData<Props, TransferlistSlotData>;
1112
+ transferButtonBackward: FormKitSlotData<Props, TransferlistSlotData>;
1113
+ transferButtonBackwardAll: FormKitSlotData<Props, TransferlistSlotData>;
1114
+ controlLabel: FormKitSlotData<Props, TransferlistSlotData>;
1115
+ fastForwardIcon: FormKitSlotData<Props, TransferlistSlotData>;
1116
+ moveRightIcon: FormKitSlotData<Props, TransferlistSlotData>;
1117
+ moveLeftIcon: FormKitSlotData<Props, TransferlistSlotData>;
1118
+ rewindIcon: FormKitSlotData<Props, TransferlistSlotData>;
1119
+ target: FormKitSlotData<Props, TransferlistSlotData>;
1120
+ targetHeader: FormKitSlotData<Props, TransferlistSlotData>;
1121
+ targetHeaderLabel: FormKitSlotData<Props, TransferlistSlotData>;
1122
+ targetHeaderItemCount: FormKitSlotData<Props, TransferlistSlotData>;
1123
+ targetListItems: FormKitSlotData<Props, TransferlistSlotData>;
1124
+ targetEmptyMessage: FormKitSlotData<Props, TransferlistSlotData>;
1125
+ targetListItem: FormKitSlotData<Props, TransferlistSlotData>;
1126
+ targetOption: FormKitSlotData<Props, TransferlistSlotData & {
1127
+ option: FormKitOptionsItem;
1128
+ }>;
1129
+ targetLoadMore: FormKitSlotData<Props, TransferlistSlotData>;
1130
+ messages: FormKitSlotData<Props, ToggleSlotData<Props>>;
1131
+ message: FormKitSlotData<Props, ToggleSlotData<Props> & {
1132
+ message: FormKitMessage;
1133
+ }>;
1134
+ }
1135
+
1136
+ declare type Yes = 'true' | true | '';
1137
+
1138
+ /* <declare> */
184
1139
  declare module '@formkit/core' {
185
1140
  export interface FormKitFrameworkContext {
186
1141
  hasNextPage: (dataForNextPage?: unknown) => void
@@ -188,6 +1143,235 @@ declare module '@formkit/core' {
188
1143
  search: string
189
1144
  }
190
1145
  }
1146
+ /* </declare> */
1147
+ /* <declare> */
1148
+
1149
+ export interface OptionLoader {
1150
+ (value: any, cachedItem: FormKitOptionsItem<any>):
1151
+ | FormKitOptionsItem<any>
1152
+ | string
1153
+ | void
1154
+ | Promise<FormKitOptionsItem<any> | string | void>
1155
+ }
1156
+
1157
+ declare module '@formkit/inputs' {
1158
+ interface FormKitConditionalProps {
1159
+ overlay?: undefined
1160
+ chart?: undefined
1161
+ }
1162
+
1163
+ /**
1164
+ * General input events available to all FormKit inputs.
1165
+ * @public
1166
+ */
1167
+ interface FormKitBaseEvents<Props extends FormKitInputs<Props>> {
1168
+ (event: 'input', value: PropType<Props, 'value'>, node: FormKitNode): any
1169
+ (event: 'inputRaw', value: PropType<Props, 'value'>, node: FormKitNode): any
1170
+ (
1171
+ event: 'input-raw',
1172
+ value: PropType<Props, 'value'>,
1173
+ node: FormKitNode
1174
+ ): any
1175
+ (event: 'update:modelValue', value: PropType<Props, 'value'>): any
1176
+ (event: 'update:model-value', value: PropType<Props, 'value'>): any
1177
+ (event: 'node', node: FormKitNode): any
1178
+ }
1179
+
1180
+ interface FormKitInputProps<Props extends FormKitInputs<Props>> {
1181
+ autocomplete: {
1182
+ type: 'autocomplete'
1183
+ value?: Props['multiple'] extends Yes ? any[] : any
1184
+ debounce?: number | string
1185
+ multiple?: Bool
1186
+ options: FormKitProOptionsProp
1187
+ selectionAppearance?: 'option' | 'text-input'
1188
+ openOnClick?: Bool
1189
+ filter?: (option: FormKitOptionsItem, search: string) => boolean
1190
+ optionLoader?: OptionLoader
1191
+ emptyMessage?: string
1192
+ max?: Props['multiple'] extends Yes ? number | string : undefined
1193
+ closeOnSelect?: Bool
1194
+ alwaysLoadOnOpen?: Bool
1195
+ loadOnCreated?: Bool
1196
+ clearSearchOnOpen?: Bool
1197
+ // TODO: audit these props.
1198
+ }
1199
+
1200
+ datepicker: {
1201
+ type: 'datepicker'
1202
+ value?: string | Date
1203
+ dateFormat?: string
1204
+ disabledDays?: (node: FormKitNode, date: Date) => boolean
1205
+ format?: string | FormatStyleObj
1206
+ maxDate?: Date | string
1207
+ maxScan?: number
1208
+ minDate?: Date | string
1209
+ monthButtonFormat?: 'M' | 'MM' | 'MMM' | 'MMMM'
1210
+ monthFormat?: 'M' | 'MM' | 'MMM' | 'MMMM'
1211
+ overlay?: Bool
1212
+ pickerOnly?: Bool
1213
+ showMonths?: number
1214
+ sequence?: Array<Panels>
1215
+ valueFormat?: string
1216
+ valueLocale?: string
1217
+ weekStart?: 0 | 1 | 2 | 3 | 4 | 5 | 6
1218
+ weekDayFormat?: 'dddd' | 'ddd' | 'dd'
1219
+ yearFormat?: 'YY' | 'YYYY'
1220
+ prefixIcon?: string
1221
+ suffixIcon?: string
1222
+ }
1223
+
1224
+ dropdown: {
1225
+ type: 'dropdown'
1226
+ value?: Props['multiple'] extends Yes ? any[] : any
1227
+ debounce?: number | string
1228
+ multiple?: Bool
1229
+ options?: FormKitProOptionsProp
1230
+ selectionAppearance?: 'truncate' | 'tags'
1231
+ openOnClick?: Bool
1232
+ filter?: (option: FormKitOptionsItem, search: string) => boolean
1233
+ optionLoader?: OptionLoader
1234
+ emptyMessage?: string
1235
+ max?: Props['multiple'] extends Yes ? number | string : undefined
1236
+ closeOnSelect?: Bool
1237
+ alwaysLoadOnOpen?: Bool
1238
+ loadOnCreated?: Bool
1239
+ clearSearchOnOpen?: Bool
1240
+ // TODO: audit these props.
1241
+ }
1242
+
1243
+ rating: {
1244
+ value?: number | string
1245
+ type: 'rating'
1246
+ min?: string | number
1247
+ max?: string | number
1248
+ step?: string | number
1249
+ hoverHighlight?: Bool
1250
+ offColor?: string
1251
+ onColor?: string
1252
+ }
1253
+
1254
+ repeater: {
1255
+ type: 'repeater'
1256
+ value?: Array<Record<string, any>>
1257
+ addLabel?: string
1258
+ addAttrs?: Record<string, any>
1259
+ addButton?: Bool
1260
+ upControl?: Bool
1261
+ downControl?: Bool
1262
+ insertControl?: Bool
1263
+ removeControl?: Bool
1264
+ min?: number | string
1265
+ max?: number | string | null
1266
+ }
1267
+
1268
+ mask: {
1269
+ type: 'mask'
1270
+ mask: string
1271
+ value?: string
1272
+ allowIncomplete?: Bool
1273
+ mode?: 'shift' | 'replace' | 'select'
1274
+ overlay?: Bool
1275
+ prefix?: string
1276
+ showMask?: Bool
1277
+ suffix?: string
1278
+ tokens?: PartMap
1279
+ unmaskValue?: Bool
1280
+ }
1281
+
1282
+ slider: {
1283
+ type: 'slider'
1284
+ value?: string | string[] | number | number[]
1285
+ chart?: Array<{ value: number; at: number }>
1286
+ inputAttrs?: Record<string, any>
1287
+ marks?: Bool | Array<{ at?: number; label?: string }>
1288
+ markLabel?: Bool
1289
+ max?: number | string
1290
+ maxInputAttrs?: Record<string, any>
1291
+ min?: string | number
1292
+ minInputAttrs?: Record<string, any>
1293
+ prefix?: string
1294
+ showInput?: Bool
1295
+ snapToMarks?: Bool
1296
+ step?: number | string
1297
+ suffix?: string
1298
+ tooltip?: Bool
1299
+ tooltipFormat?: (value: number, handle: string) => string | undefined
1300
+ }
1301
+
1302
+ taglist: {
1303
+ type: 'taglist'
1304
+ value?: any[]
1305
+ debounce?: number | string
1306
+ options?: FormKitProOptionsProp
1307
+ selectionAppearance?: 'truncate' | 'tags'
1308
+ openOnClick?: Bool
1309
+ filter?: (option: FormKitOptionsItem, search: string) => boolean
1310
+ optionLoader?: OptionLoader
1311
+ emptyMessage?: string
1312
+ max?: number | string
1313
+ closeOnSelect?: Bool
1314
+ alwaysLoadOnOpen?: Bool
1315
+ loadOnCreated?: Bool
1316
+ clearSearchOnOpen?: Bool
1317
+ }
1318
+
1319
+ toggle: {
1320
+ type: 'toggle'
1321
+ onValue?: any
1322
+ offValue?: any
1323
+ value?:
1324
+ | (Props['onValue'] extends AllReals ? Props['onValue'] : true)
1325
+ | (Props['offValue'] extends AllReals ? Props['offValue'] : false)
1326
+ altLabelPosition?: Bool
1327
+ offValueLabel?: string
1328
+ onValueLabel?: string
1329
+ valueLabelDisplay?: 'on' | 'off' | 'inner' | 'hidden'
1330
+ valueLabelColorOff?: string
1331
+ valueLabelColorOn?: string
1332
+ thumbIcon?: string
1333
+ thumbColorOn?: string
1334
+ iconColorOff?: string
1335
+ iconColorOn?: string
1336
+ trackColorOff?: string
1337
+ trackColorOn?: string
1338
+ }
1339
+
1340
+ transferlist: {
1341
+ type: 'transferlist'
1342
+ value?: OptionsProValue<Props['options']>[]
1343
+ options: FormKitProOptionsProp
1344
+ debounce?: number | string
1345
+ filter?: (option: FormKitOptionsItem, search: string) => boolean
1346
+ optionLoader?: OptionLoader
1347
+ sourceEmptyMessage?: string
1348
+ targetEmptyMessage?: string
1349
+ max?: string | number
1350
+ clearOnSelect?: Bool
1351
+ searchable?: Bool
1352
+ sourceLabel?: string
1353
+ targetLabel?: string
1354
+ transferOnSelect?: Bool
1355
+ }
1356
+ }
1357
+
1358
+ interface FormKitInputSlots<Props extends FormKitInputs<Props>> {
1359
+ autocomplete: FormKitAutocompleteSlots<Props>
1360
+ datepicker: FormKitDatePickerSlots<Props> & FormKitOverlaySlots<Props>
1361
+ dropdown: FormKitDropdownSlots<Props>
1362
+ mask: FormKitBaseSlots<Props> & FormKitOverlaySlots<Props>
1363
+ rating: FormKitBaseSlots<Props> & FormKitRatingSlots<Props>
1364
+ repeater: FormKitRepeaterSlots<Props>
1365
+ slider: FormKitSliderSlots<Props> &
1366
+ (Props['chart'] extends Array<{ at: number; value: number }>
1367
+ ? SliderChartSlots<Props>
1368
+ : {})
1369
+ taglist: FormKitTaglistSlots<Props>
1370
+ toggle: FormKitToggleSlots<Props>
1371
+ transferlist: TransferlistSlots<Props>
1372
+ }
1373
+ }
1374
+ /* </declare> */
191
1375
 
192
1376
  export { }
193
1377