Skip to content

Commit

Permalink
fix(form-core): update types for FormCrontrol and FormRegister
Browse files Browse the repository at this point in the history
  • Loading branch information
donecarlo committed May 15, 2024
1 parent 6826938 commit 22dc57f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ui/components/form-core/src/FormControlMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const FormControlMixinImplementation = superclass =>
/** @type {any} */
static get properties() {
return {
name: { type: String, reflect: true },
readOnly: { type: Boolean, attribute: 'readonly', reflect: true },
label: String, // FIXME: { attribute: false } breaks a bunch of tests, but shouldn't...
labelSrOnly: { type: Boolean, attribute: 'label-sr-only', reflect: true },
Expand Down
11 changes: 11 additions & 0 deletions packages/ui/components/form-core/types/FormControlMixinTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export declare interface HTMLElementWithValue extends HTMLElement {
export declare class FormControlHost {
static get styles(): CSSResultArray;
static get properties(): {
name: {
type: StringConstructor;
reflect: boolean;
};
readOnly: {
type: BooleanConstructor;
attribute: string;
Expand All @@ -69,6 +73,13 @@ export declare class FormControlHost {
*/
readOnly: boolean;

/**
* The name the element will be registered with to the .formElements collection
* of the parent. Also, it serves as the key of key/value pairs in
* modelValue/serializedValue objects
*/
name: string;

/**
* The model value is the result of the parser function(when available).
* It should be considered as the internal value used for validation and reasoning/logic.
Expand Down

0 comments on commit 22dc57f

Please sign in to comment.