Skip to content

Commit

Permalink
feat: TextField rework (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-martinez authored May 2, 2022
1 parent b2ad0ef commit 31af0cc
Show file tree
Hide file tree
Showing 19 changed files with 632 additions and 29 deletions.
116 changes: 87 additions & 29 deletions api/components/textfield.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,115 @@
]
},
"value": {
"description": "the value displayed in the element",
"description": "The value displayed inside the Textfield",
"type": "string"
},
"label": {
"description": "the text displayed aside the textfield",
"type": "string"
},
"hintText": {
"description": "the text displayed inside the textfield",
"type": "string"
"autocorrect": {
"description": "Whether to enable the autocorrection",
"type": "boolean"
},
"description": {
"description": "the text displayed under the textfield",
"type": "string"
"autofillHints": {
"description": "The type of this text input to provide autofill hints.",
"type": "array",
"items": {
"$ref": "defs/autofillHints.schema.json"
}
},
"obscure": {
"description": "Whether the input text should be hidden or not",
"autofocus": {
"description": "Whether this Textfield should be focused initially.",
"type": "boolean"
},
"disabled": {
"description": "Whether the input should be disabled or not",
"buildCounter": {
"description": "Callback that generates a custom counter widget.",
"$ref": "defs/listener.schema.json"
},
"style": {
"description": "The style of the Textfield.",
"$ref": "defs/textFieldStyle.schema.json"
},
"dragStartBehavior": {
"description": "Determines the way that drag start behavior is handled.",
"$ref": "defs/dragStartBehavior.schema.json"
},
"enabled": {
"description": "Whether the text field is enabled.",
"type": "boolean"
},
"inRow": {
"description": "Whether the input and label should be in row or not",
"enableInteractiveSelection": {
"description": "Whether to enable user interface options to change the text selection.",
"type": "boolean"
},
"error": {
"description": "Whether the textfield should show and error or not",
"expands": {
"description": "Whether the TextField is sized to fill its parent.",
"type": "boolean"
},
"errorMessage": {
"description": "The error message to display whenever the input is incorrect",
"type": "string"
"keyboardType": {
"description": "The type of the keyboard to use for editing the text.",
"$ref": "defs/textInputType.schema.json"
},
"minLines": {
"description": "the minimum number of lines for the textfield",
"maxLength": {
"description": "The maximum number of characters to allow in the text field.",
"type": "integer"
},
"maxLengthEnforcement": {
"description": "Determines how the maxLength limit should be enforced.",
"$ref": "defs/maxLengthEnforcement.schema.json"
},
"maxLines": {
"description": "the maximum number of lines for the textfield",
"description": "The maximum number of lines to show at one time.",
"type": "integer"
},
"size": {
"$ref": "defs/size.schema.json"
"minLines": {
"description": "The minimum number of lines to occupy on the screen.",
"type": "integer"
},
"obscureText": {
"description": "Whether to hide the text being edited.",
"type": "boolean"
},
"onAppPrivateCommand": {
"description": "This is used to receive a private command from the input method.",
"$ref": "defs/listener.schema.json"
},
"onChanged": {
"description": "Callback when the user changes the text field value.",
"$ref": "defs/listener.schema.json"
},
"autofillHints": {
"$ref": "defs/autofillHints.schema.json"
"onEditingComplete": {
"description": "Callback when the user finishes editing the text field.",
"$ref": "defs/listener.schema.json"
},
"onSubmitted": {
"description": "Callback when the user tells he is done editing the text field.",
"$ref": "defs/listener.schema.json"
},
"onTap": {
"description": "Callback when the user taps on the text field.",
"$ref": "defs/listener.schema.json"
},
"readOnly": {
"description": "Whether the text can be changed.",
"type": "boolean"
},
"showCursor": {
"description": "Whether to show the cursor.",
"type": "boolean"
},
"textCapitalization": {
"description": "Configures how the platform keyboard will select an uppercase or lowercase keyboard.",
"$ref": "defs/textCapitalization.schema.json"
},
"textDirection": {
"description": "The direction of the text.",
"$ref": "defs/textDirection.schema.json"
},
"textInputAction": {
"description": "The type of the action button to use for the keyboard.",
"$ref": "defs/textInputAction.schema.json"
},
"toolbarOptions": {
"description": "Configuration of toolbar options",
"$ref": "defs/toolbarOptions.schema.json"
}
},
"required": [
Expand Down
15 changes: 15 additions & 0 deletions api/defs/boxHeightStyle.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "boxHeightStyle.schema.json",
"title": "BoxHeightStyle",
"description": "Component of type BoxHeightStyle.",
"type": "string",
"enum": [
"includeLineSpacingBottom",
"includeLineSpacingMiddle",
"includeLineSpacingTop",
"max",
"strut",
"tight"
]
}
11 changes: 11 additions & 0 deletions api/defs/boxWidthStyle.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "boxWidthStyle.schema.json",
"title": "BoxWidthStyle",
"description": "Component of type BoxWidthStyle.",
"type": "string",
"enum": [
"max",
"tight"
]
}
11 changes: 11 additions & 0 deletions api/defs/brightness.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "brightness.schema.json",
"title": "Brightness",
"description": "Component of type Brightness.",
"type": "string",
"enum": [
"dark",
"light"
]
}
11 changes: 11 additions & 0 deletions api/defs/dragStartBehavior.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "dragStartBehavior.schema.json",
"title": "DragStartBehavior",
"description": "Component of type DragStartBehavior.",
"type": "string",
"enum": [
"start",
"down"
]
}
12 changes: 12 additions & 0 deletions api/defs/floatingLabelBehavior.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "floatingLabelBehavior.schema.json",
"title": "FloatingLabelBehavior",
"description": "Element of type FloatingLabelBehavior.",
"type": "string",
"enum": [
"always",
"auto",
"never"
]
}
27 changes: 27 additions & 0 deletions api/defs/inputBorder.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "inputBorder.schema.json",
"title": "InputBorder",
"description": "Element of type InputBorder",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"underline",
"outline"
],
"default": "underline"
},
"borderRadius": {
"$ref": "defs/borderRadius.schema.json"
},
"borderSide": {
"$ref": "defs/borderSide.schema.json"
}
},
"required": [
"borderSide"
],
"additionalProperties": false
}
Loading

0 comments on commit 31af0cc

Please sign in to comment.