@formkit/pro 0.114.0-3277316 → 0.114.0-4235e0d

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
@@ -60,20 +60,23 @@ export declare interface AutocompleteSlotData {
60
60
  optionsLoader?: FormKitOptionsLoader;
61
61
  page: number;
62
62
  placeholder?: string;
63
+ reloadOnCommit: Bool;
63
64
  selections: FormKitOptionsItem[];
64
65
  showEmptyMessage?: boolean;
65
66
  handlers: FormKitFrameworkContext['handlers'] & {
66
67
  selectOption: (option: FormKitOptionsItem) => void;
67
68
  loadMoreSelected: () => void;
68
- selectTag: (option: FormKitOptionsItem) => void;
69
69
  toggleListbox: () => void;
70
- removeSelection: (option: FormKitOptionsItem) => void;
70
+ removeSelection: (option: FormKitOptionsItem) => (e: MouseEvent) => void;
71
71
  touchmove: (e: TouchEvent) => void;
72
72
  touchend: (e: TouchEvent) => void;
73
73
  click: (e: MouseEvent) => void;
74
74
  keydown: (e: KeyboardEvent) => void;
75
75
  focus: (e: FocusEvent) => void;
76
76
  loadMore: () => void;
77
+ selectionClick: (e: MouseEvent) => void;
78
+ selectionKeydown: (option: FormKitOptionsItem) => (e: KeyboardEvent) => void;
79
+ searchInputTagKeydown: (option: FormKitOptionsItem) => (e: KeyboardEvent) => void;
77
80
  };
78
81
  fns: FormKitFrameworkContext['fns'] & {
79
82
  isSelected: (option: FormKitOptionsItem) => boolean;
@@ -270,8 +273,26 @@ export declare interface DropdownSlotData {
270
273
  activeValue?: unknown;
271
274
  dropdownWrapperStyles: Record<string, boolean>;
272
275
  expanded: boolean;
273
- fns: FormKitFrameworkContext['fns'] & {};
274
- handlers: FormKitFrameworkContext['handlers'] & {};
276
+ fns: FormKitFrameworkContext['fns'] & {
277
+ isSelected: (option: FormKitOptionsItem) => boolean;
278
+ isActive: (option: FormKitOptionsItem) => boolean;
279
+ };
280
+ handlers: FormKitFrameworkContext['handlers'] & {
281
+ selectOption: (option: FormKitOptionsItem) => (e: MouseEvent) => void;
282
+ loadMoreSelected: () => void;
283
+ tagClick: (option: FormKitOptionsItem) => void;
284
+ tagFocus: (option: FormKitOptionsItem) => void;
285
+ tagBlur: () => void;
286
+ blur: () => void;
287
+ toggleListbox: () => void;
288
+ removeSelection: (option: FormKitOptionsItem) => (e: MouseEvent) => void;
289
+ touchmove: (e: TouchEvent) => void;
290
+ touchend: (e: TouchEvent) => void;
291
+ click: (e: MouseEvent) => void;
292
+ keydown: (e: KeyboardEvent) => void;
293
+ focus: (e: FocusEvent) => void;
294
+ loadMore: () => void;
295
+ };
275
296
  ui: FormKitFrameworkContext['ui'] & {
276
297
  isLoading: FormKitMessage;
277
298
  loadMore: FormKitMessage;
@@ -436,7 +457,10 @@ export declare interface FormKitDropdownSlots<Props extends FormKitInputs<Props>
436
457
  prefix: FormKitSlotData<Props, DropdownSlotData>;
437
458
  prefixIcon: FormKitSlotData<Props, DropdownSlotData>;
438
459
  selector: FormKitSlotData<Props, DropdownSlotData>;
439
- selection: FormKitSlotData<Props, DropdownSlotData>;
460
+ selection: FormKitSlotData<Props, DropdownSlotData & {
461
+ option: FormKitOptionsItem;
462
+ index: number;
463
+ }>;
440
464
  suffix: FormKitSlotData<Props, DropdownSlotData>;
441
465
  suffixIcon: FormKitSlotData<Props, DropdownSlotData>;
442
466
  help: FormKitSlotData<Props, DropdownSlotData>;
@@ -444,30 +468,30 @@ export declare interface FormKitDropdownSlots<Props extends FormKitInputs<Props>
444
468
  message: FormKitSlotData<Props, DropdownSlotData & {
445
469
  message: FormKitMessage;
446
470
  }>;
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 & {
471
+ listboxButton: FormKitSlotData<Props, DropdownSlotData>;
472
+ dropdownWrapper: FormKitSlotData<Props, DropdownSlotData>;
473
+ listbox: FormKitSlotData<Props, DropdownSlotData>;
474
+ listitem: FormKitSlotData<Props, DropdownSlotData>;
475
+ loadMore: FormKitSlotData<Props, DropdownSlotData>;
476
+ emptyMessageInner: FormKitSlotData<Props, DropdownSlotData>;
477
+ selectedIcon: FormKitSlotData<Props, DropdownSlotData & {
454
478
  option: FormKitOptionsItem;
455
479
  index: number;
456
480
  }>;
457
- option: FormKitSlotData<Props, TaglistSlotData & {
481
+ option: FormKitSlotData<Props, DropdownSlotData & {
458
482
  option: FormKitOptionsItem;
459
483
  index: number;
460
484
  }>;
461
- optionLoading: FormKitSlotData<Props, TaglistSlotData & {
485
+ optionLoading: FormKitSlotData<Props, DropdownSlotData & {
462
486
  option: FormKitOptionsItem;
463
487
  index: number;
464
488
  }>;
465
- removeSelection: FormKitSlotData<Props, TaglistSlotData & {
489
+ removeSelection: FormKitSlotData<Props, DropdownSlotData & {
466
490
  option: FormKitOptionsItem;
467
491
  index: number;
468
492
  }>;
469
493
  placeholder: FormKitSlotData<Props, DropdownSlotData>;
470
- tag: FormKitSlotData<Props, TaglistSlotData & {
494
+ tag: FormKitSlotData<Props, DropdownSlotData & {
471
495
  option: FormKitOptionsItem;
472
496
  index: number;
473
497
  }>;
@@ -983,9 +1007,25 @@ export declare interface TaglistSlotData {
983
1007
  page: number;
984
1008
  search: string;
985
1009
  hasNextPage: (data?: any) => void;
986
- fns: FormKitFrameworkContext['fns'] & {};
1010
+ fns: FormKitFrameworkContext['fns'] & {
1011
+ isSelected: (option: FormKitOptionsItem) => boolean;
1012
+ isActive: (option: FormKitOptionsItem) => boolean;
1013
+ };
987
1014
  handlers: FormKitFrameworkContext['handlers'] & {
988
- removeSelection: (option: FormKitOptionsItem) => void;
1015
+ selectOption: (option: FormKitOptionsItem) => (e: MouseEvent) => void;
1016
+ loadMoreSelected: () => void;
1017
+ tagClick: (option: FormKitOptionsItem) => void;
1018
+ tagFocus: (option: FormKitOptionsItem) => void;
1019
+ tagBlur: () => void;
1020
+ blur: () => void;
1021
+ toggleListbox: () => void;
1022
+ removeSelection: (option: FormKitOptionsItem) => (e: MouseEvent) => void;
1023
+ touchmove: (e: TouchEvent) => void;
1024
+ touchend: (e: TouchEvent) => void;
1025
+ click: (e: MouseEvent) => void;
1026
+ keydown: (e: KeyboardEvent) => void;
1027
+ focus: (e: FocusEvent) => void;
1028
+ loadMore: () => void;
989
1029
  };
990
1030
  ui: FormKitFrameworkContext['ui'] & {
991
1031
  isLoading: FormKitMessage;
@@ -1186,20 +1226,26 @@ declare module '@formkit/inputs' {
1186
1226
  interface FormKitInputProps<Props extends FormKitInputs<Props>> {
1187
1227
  autocomplete: {
1188
1228
  type: 'autocomplete'
1189
- value?: Props['multiple'] extends Yes ? any[] : any
1229
+ value?: Props['multiple'] extends Yes
1230
+ ? OptionsProValue<Props['options']>[]
1231
+ : OptionsProValue<Props['options']>
1190
1232
  debounce?: number | string
1191
1233
  multiple?: Bool
1192
1234
  options: FormKitProOptionsProp
1193
1235
  selectionAppearance?: 'option' | 'text-input'
1194
- openOnClick?: Bool
1195
1236
  filter?: (option: FormKitOptionsItem, search: string) => boolean
1196
1237
  optionLoader?: OptionLoader
1197
- emptyMessage?: string
1238
+ // Behavioral props
1198
1239
  max?: Props['multiple'] extends Yes ? number | string : undefined
1240
+ openOnClick?: Bool
1241
+ openOnFocus?: Bool
1199
1242
  closeOnSelect?: Bool
1243
+ openOnRemove?: Bool
1200
1244
  alwaysLoadOnOpen?: Bool
1245
+ selectionRemovable?: Props['multiple'] extends Yes ? undefined : Bool
1201
1246
  loadOnCreated?: Bool
1202
1247
  clearSearchOnOpen?: Bool
1248
+ emptyMessage?: string
1203
1249
  // TODO: audit these props.
1204
1250
  }
1205
1251
 
@@ -1230,20 +1276,21 @@ declare module '@formkit/inputs' {
1230
1276
  dropdown: {
1231
1277
  type: 'dropdown'
1232
1278
  value?: Props['multiple'] extends Yes ? any[] : any
1233
- debounce?: number | string
1234
1279
  multiple?: Bool
1235
1280
  options?: FormKitProOptionsProp
1236
1281
  selectionAppearance?: 'truncate' | 'tags'
1237
- openOnClick?: Bool
1238
1282
  filter?: (option: FormKitOptionsItem, search: string) => boolean
1239
1283
  optionLoader?: OptionLoader
1240
1284
  emptyMessage?: string
1241
1285
  max?: Props['multiple'] extends Yes ? number | string : undefined
1286
+ openOnFocus?: Bool
1287
+ openOnRemove?: Bool
1242
1288
  closeOnSelect?: Bool
1243
- alwaysLoadOnOpen?: Bool
1244
- loadOnCreated?: Bool
1245
1289
  clearSearchOnOpen?: Bool
1246
- // TODO: audit these props.
1290
+ selectionRemovable?: Props['multiple'] extends Yes ? undefined : Bool
1291
+ loadOnCreated?: Bool
1292
+ alwaysLoadOnOpen?: Bool
1293
+ optionsAppearance?: 'checkbox'
1247
1294
  }
1248
1295
 
1249
1296
  rating: {