Skip to content

Commit

Permalink
feat(types): alt + data support and search fields
Browse files Browse the repository at this point in the history
* feat(types): alt support and search fields

* feat(types): dropdown data attributes
  • Loading branch information
lubber-de authored Apr 9, 2024
1 parent 6e78472 commit 45d16a0
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 2 deletions.
12 changes: 12 additions & 0 deletions types/fomantic-ui-dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,12 @@ declare namespace FomanticUI {
*/
text: string;

/**
* custom data atttributes
* @default 'data'
*/
data: string;

/**
* Type of dropdown element
* @default 'type'
Expand All @@ -1050,6 +1056,12 @@ declare namespace FomanticUI {
*/
imageClass: string;

/**
* Optional alt text for image
* @default 'alt'
*/
alt: string;

/**
* Optional icon name
* @default 'icon'
Expand Down
19 changes: 18 additions & 1 deletion types/fomantic-ui-embed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ declare namespace FomanticUI {
*/
id: false | string;

/**
* Specifies a path for a placeholder image.
* @default false
*/
placeholder: false | string;

/**
* Specifies an alt text for a given placeholder image.
* @default false
*/
alt: false | string;

/**
* Specify an object containing key/value pairs to add to the iframes GET parameters.
* @default false
Expand Down Expand Up @@ -270,6 +282,11 @@ declare namespace FomanticUI {
*/
placeholder: string;

/**
* @default 'alt'
*/
alt: string;

/**
* @default 'source'
*/
Expand Down Expand Up @@ -307,7 +324,7 @@ declare namespace FomanticUI {
/**
* @default function
*/
placeholder(image: string, icon: string): string;
placeholder(image: string, icon: string, alt: string | false | undefined): string;
}

interface Errors {
Expand Down
83 changes: 82 additions & 1 deletion types/fomantic-ui-search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ declare namespace FomanticUI {
* List mapping display content to JSON property, either with API or 'source'.
* @default {}
*/
fields: object;
fields: Search.FieldsSettings;

/**
* Specify object properties inside local source object which will be searched.
Expand Down Expand Up @@ -377,6 +377,7 @@ declare namespace FomanticUI {
type RegExpSettings = Partial<Pick<Settings.RegExps, keyof Settings.RegExps>>;
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
type FieldsSettings = Partial<Pick<Settings.Fields, keyof Settings.Fields>>;
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;

namespace Settings {
Expand Down Expand Up @@ -480,6 +481,86 @@ declare namespace FomanticUI {
results: string;
}

interface Fields {
/**
* Array of categories (category view)
* @default 'results'
*/
categories: string;

/**
* Name of category (category view)
* @default 'name'
*/
categoryName: string;

/**
* Array of results (category view)
* @default 'results'
*/
categoryResults: string;

/**
* Sesult description
* @default ' description'
*/
description: string;

/**
* Result image
* @default 'image'
*/
image: string;

/**
* Result alt text for image
* @default 'alt'
*/
alt: string;

/**
* Result price
* @default 'price'
*/
price: string;

/**
* Array of results (standard)
* @default 'results'
*/
results: string;

/**
* Result title
* @default 'title'
*/
title: string;

/**
* Result url
* @default 'url'
*/
url: string;

/**
* "view more" object name
* @default 'action'
*/
action: string;

/**
* "view more" text
* @default 'text'
*/
actionText: string;

/**
* "view more" url
* @default 'url'
*/
actionURL: string;
}

interface Errors {
/**
* @default 'Cannot search. No source used, and Fomantic API module was not included'
Expand Down
7 changes: 7 additions & 0 deletions types/fomantic-ui-toast.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ declare namespace FomanticUI {
*/
showImage: false | string;

/**
* Alt text for a given showImage.
*
* @default false
*/
alt: false | string;

/**
* Define if the toast should display an icon which matches to a given class.
* If a string is given, this will be used as icon classname.
Expand Down

0 comments on commit 45d16a0

Please sign in to comment.