Skip to content

Commit 45d16a0

Browse files
authored
feat(types): alt + data support and search fields
* feat(types): alt support and search fields * feat(types): dropdown data attributes
1 parent 6e78472 commit 45d16a0

File tree

4 files changed

+119
-2
lines changed

4 files changed

+119
-2
lines changed

types/fomantic-ui-dropdown.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,12 @@ declare namespace FomanticUI {
10321032
*/
10331033
text: string;
10341034

1035+
/**
1036+
* custom data atttributes
1037+
* @default 'data'
1038+
*/
1039+
data: string;
1040+
10351041
/**
10361042
* Type of dropdown element
10371043
* @default 'type'
@@ -1050,6 +1056,12 @@ declare namespace FomanticUI {
10501056
*/
10511057
imageClass: string;
10521058

1059+
/**
1060+
* Optional alt text for image
1061+
* @default 'alt'
1062+
*/
1063+
alt: string;
1064+
10531065
/**
10541066
* Optional icon name
10551067
* @default 'icon'

types/fomantic-ui-embed.d.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ declare namespace FomanticUI {
9393
*/
9494
id: false | string;
9595

96+
/**
97+
* Specifies a path for a placeholder image.
98+
* @default false
99+
*/
100+
placeholder: false | string;
101+
102+
/**
103+
* Specifies an alt text for a given placeholder image.
104+
* @default false
105+
*/
106+
alt: false | string;
107+
96108
/**
97109
* Specify an object containing key/value pairs to add to the iframes GET parameters.
98110
* @default false
@@ -270,6 +282,11 @@ declare namespace FomanticUI {
270282
*/
271283
placeholder: string;
272284

285+
/**
286+
* @default 'alt'
287+
*/
288+
alt: string;
289+
273290
/**
274291
* @default 'source'
275292
*/
@@ -307,7 +324,7 @@ declare namespace FomanticUI {
307324
/**
308325
* @default function
309326
*/
310-
placeholder(image: string, icon: string): string;
327+
placeholder(image: string, icon: string, alt: string | false | undefined): string;
311328
}
312329

313330
interface Errors {

types/fomantic-ui-search.d.ts

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ declare namespace FomanticUI {
192192
* List mapping display content to JSON property, either with API or 'source'.
193193
* @default {}
194194
*/
195-
fields: object;
195+
fields: Search.FieldsSettings;
196196

197197
/**
198198
* Specify object properties inside local source object which will be searched.
@@ -377,6 +377,7 @@ declare namespace FomanticUI {
377377
type RegExpSettings = Partial<Pick<Settings.RegExps, keyof Settings.RegExps>>;
378378
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
379379
type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
380+
type FieldsSettings = Partial<Pick<Settings.Fields, keyof Settings.Fields>>;
380381
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
381382

382383
namespace Settings {
@@ -480,6 +481,86 @@ declare namespace FomanticUI {
480481
results: string;
481482
}
482483

484+
interface Fields {
485+
/**
486+
* Array of categories (category view)
487+
* @default 'results'
488+
*/
489+
categories: string;
490+
491+
/**
492+
* Name of category (category view)
493+
* @default 'name'
494+
*/
495+
categoryName: string;
496+
497+
/**
498+
* Array of results (category view)
499+
* @default 'results'
500+
*/
501+
categoryResults: string;
502+
503+
/**
504+
* Sesult description
505+
* @default ' description'
506+
*/
507+
description: string;
508+
509+
/**
510+
* Result image
511+
* @default 'image'
512+
*/
513+
image: string;
514+
515+
/**
516+
* Result alt text for image
517+
* @default 'alt'
518+
*/
519+
alt: string;
520+
521+
/**
522+
* Result price
523+
* @default 'price'
524+
*/
525+
price: string;
526+
527+
/**
528+
* Array of results (standard)
529+
* @default 'results'
530+
*/
531+
results: string;
532+
533+
/**
534+
* Result title
535+
* @default 'title'
536+
*/
537+
title: string;
538+
539+
/**
540+
* Result url
541+
* @default 'url'
542+
*/
543+
url: string;
544+
545+
/**
546+
* "view more" object name
547+
* @default 'action'
548+
*/
549+
action: string;
550+
551+
/**
552+
* "view more" text
553+
* @default 'text'
554+
*/
555+
actionText: string;
556+
557+
/**
558+
* "view more" url
559+
* @default 'url'
560+
*/
561+
actionURL: string;
562+
}
563+
483564
interface Errors {
484565
/**
485566
* @default 'Cannot search. No source used, and Fomantic API module was not included'

types/fomantic-ui-toast.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ declare namespace FomanticUI {
125125
*/
126126
showImage: false | string;
127127

128+
/**
129+
* Alt text for a given showImage.
130+
*
131+
* @default false
132+
*/
133+
alt: false | string;
134+
128135
/**
129136
* Define if the toast should display an icon which matches to a given class.
130137
* If a string is given, this will be used as icon classname.

0 commit comments

Comments
 (0)