Skip to content

Commit

Permalink
feat: add option to define width of Dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
aaschlote committed Aug 26, 2024
1 parent 05153e6 commit 38c7790
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
12 changes: 11 additions & 1 deletion src/components/form-elements/dropdown.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"collectionName": "components_form_elements_dropdowns",
"info": {
"displayName": "Dropdown"
"displayName": "Dropdown",
"description": ""
},
"options": {},
"attributes": {
Expand All @@ -27,6 +28,15 @@
"type": "relation",
"relation": "oneToMany",
"target": "api::error.error"
},
"width": {
"type": "enumeration",
"enum": [
"characters16",
"characters24",
"characters36",
"characters54"
]
}
}
}
32 changes: 18 additions & 14 deletions types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,19 @@ export interface FormHelperErrors extends Schema.Component {
};
}

export interface FieldField extends Schema.Component {
collectionName: 'components_field_fields';
info: {
displayName: 'Field';
icon: '';
description: '';
};
attributes: {
name: Attribute.String & Attribute.Required;
value: Attribute.Text & Attribute.Required;
};
}

export interface FormElementsTimeInput extends Schema.Component {
collectionName: 'components_form_elements_time_inputs';
info: {
Expand Down Expand Up @@ -493,6 +506,7 @@ export interface FormElementsDropdown extends Schema.Component {
collectionName: 'components_form_elements_dropdowns';
info: {
displayName: 'Dropdown';
description: '';
};
attributes: {
name: Attribute.String & Attribute.Required;
Expand All @@ -505,6 +519,9 @@ export interface FormElementsDropdown extends Schema.Component {
'oneToMany',
'api::error.error'
>;
width: Attribute.Enumeration<
['characters16', 'characters24', 'characters36', 'characters54']
>;
};
}

Expand Down Expand Up @@ -597,19 +614,6 @@ export interface FormElementsAutoSuggestInput extends Schema.Component {
};
}

export interface FieldField extends Schema.Component {
collectionName: 'components_field_fields';
info: {
displayName: 'Field';
icon: '';
description: '';
};
attributes: {
name: Attribute.String & Attribute.Required;
value: Attribute.Text & Attribute.Required;
};
}

export interface BasicParagraph extends Schema.Component {
collectionName: 'components_basic_paragraphs';
info: {
Expand Down Expand Up @@ -693,6 +697,7 @@ declare module '@strapi/types' {
'form-helper.tile': FormHelperTile;
'form-helper.select-option': FormHelperSelectOption;
'form-helper.errors': FormHelperErrors;
'field.field': FieldField;
'form-elements.time-input': FormElementsTimeInput;
'form-elements.tile-group': FormElementsTileGroup;
'form-elements.textarea': FormElementsTextarea;
Expand All @@ -704,7 +709,6 @@ declare module '@strapi/types' {
'form-elements.checkbox': FormElementsCheckbox;
'form-elements.button': FormElementsButton;
'form-elements.auto-suggest-input': FormElementsAutoSuggestInput;
'field.field': FieldField;
'basic.paragraph': BasicParagraph;
'basic.link': BasicLink;
'basic.heading': BasicHeading;
Expand Down

0 comments on commit 38c7790

Please sign in to comment.