docs/docs/reference/admin-ui-api/custom-input-components/default-inputs.mdx
A checkbox input. The default input component for boolean fields.
class BooleanFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'boolean-form-input';
readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'boolean-form-input'>;
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'boolean-form-input'>} />
A JSON editor input with syntax highlighting and error detection. Works well
with text type fields.
class HtmlEditorFormInputComponent extends BaseCodeEditorFormInputComponent implements FormInputComponent, AfterViewInit, OnInit {
static readonly id: DefaultFormComponentId = 'html-editor-form-input';
constructor(changeDetector: ChangeDetectorRef)
ngOnInit() => ;
}
Extends: BaseCodeEditorFormInputComponent
Implements: FormInputComponent, AfterViewInit, OnInit
<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="method" type={() => } />
A JSON editor input with syntax highlighting and error detection. Works well
with text type fields.
class JsonEditorFormInputComponent extends BaseCodeEditorFormInputComponent implements FormInputComponent, AfterViewInit, OnInit {
static readonly id: DefaultFormComponentId = 'json-editor-form-input';
constructor(changeDetector: ChangeDetectorRef)
ngOnInit() => ;
}
Extends: BaseCodeEditorFormInputComponent
Implements: FormInputComponent, AfterViewInit, OnInit
<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="method" type={() => } />
A special input used to display the "Combination mode" AND/OR toggle.
class CombinationModeFormInputComponent implements FormInputComponent, OnInit {
static readonly id: DefaultFormComponentId = 'combination-mode-form-input';
readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'combination-mode-form-input'>;
selectable$: Observable<boolean>;
constructor(configurableInputComponent: ConfigurableInputComponent)
ngOnInit() => ;
setCombinationModeAnd() => ;
setCombinationModeOr() => ;
}
FormInputComponent, OnInit<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'combination-mode-form-input'>} />
<MemberInfo kind="property" type={Observable<boolean>} />
<MemberInfo kind="method" type={() => } />
<MemberInfo kind="method" type={() => } />
<MemberInfo kind="method" type={() => } />
An input for monetary values. Should be used with int type fields.
class CurrencyFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'currency-form-input';
@Input() readonly: boolean;
formControl: UntypedFormControl;
currencyCode$: Observable<CurrencyCode>;
config: DefaultFormComponentConfig<'currency-form-input'>;
constructor(dataService: DataService)
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={Observable<<a href='/reference/typescript-api/common/currency-code#currencycode'>CurrencyCode</a>>} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'currency-form-input'>} />
Allows the selection of a Customer via an autocomplete select input.
Should be used with ID type fields which represent Customer IDs.
class CustomerGroupFormInputComponent implements FormInputComponent, OnInit {
static readonly id: DefaultFormComponentId = 'customer-group-form-input';
@Input() readonly: boolean;
formControl: FormControl<string | { id: string }>;
customerGroups$: Observable<GetCustomerGroupsQuery['customerGroups']['items']>;
config: DefaultFormComponentConfig<'customer-group-form-input'>;
constructor(dataService: DataService)
ngOnInit() => ;
selectGroup(group: ItemOf<GetCustomerGroupsQuery, 'customerGroups'>) => ;
compareWith(o1: T, o2: T) => ;
}
FormInputComponent, OnInit<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={FormControl<string | { id: string }>} />
<MemberInfo kind="property" type={Observable<GetCustomerGroupsQuery['customerGroups']['items']>} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'customer-group-form-input'>} />
<MemberInfo kind="method" type={() => } />
<MemberInfo kind="method" type={(group: ItemOf<GetCustomerGroupsQuery, 'customerGroups'>) => } />
<MemberInfo kind="method" type={(o1: T, o2: T) => } />
Allows selection of a datetime. Default input for datetime type fields.
class DateFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'date-form-input';
@Input() readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'date-form-input'>;
min: void
max: void
yearRange: void
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'date-form-input'>} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={``} />
</div> ## FacetValueFormInputComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.ts" sourceLine="16" packageName="@vendure/admin-ui" />Allows the selection of multiple FacetValues via an autocomplete select input.
Should be used with ID type list fields which represent FacetValue IDs.
class FacetValueFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'facet-value-form-input';
readonly isListInput = true;
readonly: boolean;
formControl: UntypedFormControl;
config: InputComponentConfig;
valueTransformFn = (values: FacetValueFragment[]) => {
const isUsedInConfigArg = this.config.__typename === 'ConfigArgDefinition';
if (isUsedInConfigArg) {
return JSON.stringify(values.map(s => s.id));
} else {
return values;
}
};
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={InputComponentConfig} />
<MemberInfo kind="property" type={``} />
</div> ## NumberFormInputComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/number-form-input/number-form-input.component.ts" sourceLine="14" packageName="@vendure/admin-ui" />Displays a number input. Default input for int and float type fields.
class NumberFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'number-form-input';
@Input() readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'number-form-input'>;
prefix: void
suffix: void
min: void
max: void
step: void
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'number-form-input'>} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={``} />
</div> ## PasswordFormInputComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/password-form-input/password-form-input.component.ts" sourceLine="14" packageName="@vendure/admin-ui" />Displays a password text input. Should be used with string type fields.
class PasswordFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'password-form-input';
readonly: boolean;
formControl: UntypedFormControl;
config: InputComponentConfig;
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={InputComponentConfig} />
Allows the selection of multiple ProductVariants via an autocomplete select input.
Should be used with ID type list fields which represent ProductVariant IDs.
class ProductSelectorFormInputComponent implements FormInputComponent, OnInit {
static readonly id: DefaultFormComponentId = 'product-selector-form-input';
readonly isListInput = true;
readonly: boolean;
formControl: FormControl<Array<string | { id: string }>>;
config: DefaultFormComponentUiConfig<'product-selector-form-input'>;
selection$: Observable<Array<GetProductVariantQuery['productVariant']>>;
constructor(dataService: DataService)
ngOnInit() => ;
addProductVariant(product: ProductSelectorSearchQuery['search']['items'][number]) => ;
removeProductVariant(id: string) => ;
}
FormInputComponent, OnInit<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={FormControl<Array<string | { id: string }>>} />
<MemberInfo kind="property" type={DefaultFormComponentUiConfig<'product-selector-form-input'>} />
<MemberInfo kind="property" type={Observable<Array<GetProductVariantQuery['productVariant']>>} />
<MemberInfo kind="method" type={() => } />
<MemberInfo kind="method" type={(product: ProductSelectorSearchQuery['search']['items'][number]) => } />
<MemberInfo kind="method" type={(id: string) => } />
The default input component for relation type custom fields. Allows the selection
of a ProductVariant, Product, Customer or Asset. For other entity types, a custom
implementation will need to be defined. See registerFormInputComponent.
class RelationFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'relation-form-input';
@Input() readonly: boolean;
formControl: UntypedFormControl;
config: RelationCustomFieldConfig;
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={RelationCustomFieldConfig} />
Uses the RichTextEditorComponent as in input for text type fields.
class RichTextFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'rich-text-form-input';
readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'rich-text-form-input'>;
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'rich-text-form-input'>} />
Uses a select input to allow the selection of a string value. Should be used with
string type fields with options.
class SelectFormInputComponent implements FormInputComponent, OnInit {
static readonly id: DefaultFormComponentId = 'select-form-input';
@Input() readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'select-form-input'> & CustomFieldConfigFragment;
uiLanguage$: Observable<LanguageCode>;
options: void
constructor(dataService: DataService)
ngOnInit() => ;
trackByFn(index: number, item: any) => ;
}
FormInputComponent, OnInit<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'select-form-input'> & CustomFieldConfigFragment} />
<MemberInfo kind="property" type={Observable<<a href='/reference/typescript-api/common/language-code#languagecode'>LanguageCode</a>>} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="method" type={() => } />
<MemberInfo kind="method" type={(index: number, item: any) => } />
A checkbox input. The default input component for boolean fields.
class StructFormInputComponent implements FormInputComponent, OnInit, OnDestroy {
static readonly id: DefaultFormComponentId = 'struct-form-input';
readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'struct-form-input'>;
uiLanguage$: Observable<LanguageCode>;
protected structFormGroup = new FormGroup({});
protected fields: Array<{
def: StructCustomFieldFragment['fields'][number];
formControl: FormControl;
}>;
constructor(dataService: DataService)
ngOnInit() => ;
ngOnDestroy() => ;
}
FormInputComponent, OnInit, OnDestroy<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'struct-form-input'>} />
<MemberInfo kind="property" type={Observable<<a href='/reference/typescript-api/common/language-code#languagecode'>LanguageCode</a>>} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={Array<{ def: StructCustomFieldFragment['fields'][number]; formControl: FormControl; }>} />
<MemberInfo kind="method" type={() => } />
<MemberInfo kind="method" type={() => } />
Uses a regular text form input. This is the default input for string and localeString type fields.
class TextFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'text-form-input';
readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'text-form-input'>;
prefix: void
suffix: void
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'text-form-input'>} />
<MemberInfo kind="property" type={``} />
<MemberInfo kind="property" type={``} />
</div> ## TextareaFormInputComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/textarea-form-input/textarea-form-input.component.ts" sourceLine="14" packageName="@vendure/admin-ui" />Uses textarea form input. This is the default input for text type fields.
class TextareaFormInputComponent implements FormInputComponent {
static readonly id: DefaultFormComponentId = 'textarea-form-input';
readonly: boolean;
formControl: UntypedFormControl;
config: DefaultFormComponentConfig<'textarea-form-input'>;
spellcheck: boolean
}
FormInputComponent<MemberInfo kind="property" type={<a href='/reference/typescript-api/configurable-operation-def/default-form-component-id#defaultformcomponentid'>DefaultFormComponentId</a>} />
<MemberInfo kind="property" type={boolean} />
<MemberInfo kind="property" type={UntypedFormControl} />
<MemberInfo kind="property" type={DefaultFormComponentConfig<'textarea-form-input'>} />
<MemberInfo kind="property" type={boolean} />