Skip to content

Commit

Permalink
Made most input elements form aware
Browse files Browse the repository at this point in the history
This makes most elements that represent an input be aware of their surrounding form. It currently handles sending the values to the form and reacting to resets. I need to do at least 2 more PRs to complete this:
1. To make dnn-richtext also form aware (need to fix a bug before that)
2. To iron out validation UX/logic when validating a whole form.

I though making those is separate PRs might make it easier to review.
  • Loading branch information
valadas committed Mar 7, 2024
1 parent 8b961f8 commit 0efb998
Show file tree
Hide file tree
Showing 26 changed files with 548 additions and 181 deletions.
66 changes: 63 additions & 3 deletions packages/stencil-library/custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@
"default": "false",
"required": false
},
{
"name": "form-button-type",
"type": {
"text": "\"button\" | \"reset\" | \"submit\""
},
"description": "Optional button type,\ncan be either submit, reset or button and defaults to button if not specified.\nWarning: DNN wraps the whole page in a form, only use this if you are handling\nform submission manually.",
"default": "'button'",
"required": false
},
{
"name": "reversed",
"type": {
Expand Down Expand Up @@ -156,6 +165,14 @@
"default": "\"unchecked\"",
"required": false
},
{
"name": "name",
"type": {
"text": "string"
},
"description": "The name to show in the formData (if using forms).",
"required": false
},
{
"name": "use-intermediate",
"type": {
Expand All @@ -171,6 +188,7 @@
"text": "string"
},
"description": "The value for this checkbox (not to be confused with its checked state).",
"default": "\"on\"",
"required": false
}
],
Expand Down Expand Up @@ -385,7 +403,7 @@
"type": {
"text": "string"
},
"description": "The name for this input, if not provided a random name will be assigned.",
"description": "The name for this input if forms are used.",
"required": false
},
{
Expand Down Expand Up @@ -565,6 +583,14 @@
},
"description": "Max file size in bytes.",
"required": false
},
{
"name": "name",
"type": {
"text": "string"
},
"description": "The name of the field when used in a form.",
"required": false
}
],
"members": [
Expand Down Expand Up @@ -651,6 +677,14 @@
"description": "Sets the desired final image height.",
"required": false
},
{
"name": "name",
"type": {
"text": "string"
},
"description": "The name of the control when used in a form.",
"required": false
},
{
"name": "prevent-undersized",
"type": {
Expand Down Expand Up @@ -814,7 +848,7 @@
"type": {
"text": "string"
},
"description": "The name for this input, if not provided a random name will be assigned.",
"description": "The name for this input when used in forms.",
"required": false
},
{
Expand Down Expand Up @@ -1046,12 +1080,21 @@
"default": "\"html\"",
"required": false
},
{
"name": "name",
"type": {
"text": "string"
},
"description": "The name of the control to use for forms.",
"required": false
},
{
"name": "value",
"type": {
"text": "string"
},
"description": "Sets the code contained in the editor",
"default": "\"\"",
"required": false
}
],
Expand Down Expand Up @@ -1391,7 +1434,7 @@
"type": {
"text": "string"
},
"description": "The name for this input, if not provided a random name will be assigned.",
"description": "The name for this input, if used in forms.",
"required": false
},
{
Expand Down Expand Up @@ -1607,6 +1650,23 @@
"description": "If 'true' the toggle is not be interacted with.",
"default": "false",
"required": false
},
{
"name": "name",
"type": {
"text": "string"
},
"description": "The field name to use in forms.",
"required": false
},
{
"name": "value",
"type": {
"text": "string"
},
"description": "The value to post when used in forms.",
"default": "\"on\"",
"required": false
}
],
"members": [],
Expand Down
81 changes: 1 addition & 80 deletions packages/stencil-library/licenses.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,11 @@
{
"@babel/code-frame@7.12.11": {
"licenses": "MIT",
"repository": "https://github.com/babel/babel",
"publisher": "Sebastian McKenzie",
"email": "sebmck@gmail.com",
"path": "node_modules\\@babel\\code-frame",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\@babel\\code-frame\\LICENSE"
},
"@dnncommunity/dnn-elements@0.23.3-alpha.7": {
"licenses": "MIT",
"repository": "https://github.com/dnncommunity/dnn-elements",
"path": "",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\README.md"
},
"@eslint/eslintrc@0.4.3": {
"licenses": "MIT",
"repository": "https://github.com/eslint/eslintrc",
"publisher": "Nicholas C. Zakas",
"path": "node_modules\\@eslint\\eslintrc",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\@eslint\\eslintrc\\LICENSE"
},
"@humanwhocodes/config-array@0.5.0": {
"licenses": "Apache-2.0",
"repository": "https://github.com/humanwhocodes/config-array",
"publisher": "Nicholas C. Zakas",
"path": "node_modules\\@humanwhocodes\\config-array",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\@humanwhocodes\\config-array\\LICENSE"
},
"@stencil/eslint-plugin@0.4.0": {
"licenses": "MIT",
"repository": "https://github.com/ionic-team/stencil-eslint",
"path": "node_modules\\@stencil\\eslint-plugin",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\@stencil\\eslint-plugin\\LICENSE.md"
},
"eslint-utils@2.1.0": {
"licenses": "MIT",
"repository": "https://github.com/mysticatea/eslint-utils",
"publisher": "Toru Nagashima",
"path": "node_modules\\eslint\\node_modules\\eslint-utils",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\eslint\\node_modules\\eslint-utils\\LICENSE"
},
"eslint-visitor-keys@1.3.0": {
"licenses": "Apache-2.0",
"repository": "https://github.com/eslint/eslint-visitor-keys",
"publisher": "Toru Nagashima",
"path": "node_modules\\espree\\node_modules\\eslint-visitor-keys",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\espree\\node_modules\\eslint-visitor-keys\\LICENSE"
},
"eslint@7.32.0": {
"licenses": "MIT",
"repository": "https://github.com/eslint/eslint",
"publisher": "Nicholas C. Zakas",
"email": "nicholas+npm@nczconsulting.com",
"path": "node_modules\\eslint",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\eslint\\LICENSE"
},
"espree@7.3.1": {
"licenses": "BSD-2-Clause",
"repository": "https://github.com/eslint/espree",
"publisher": "Nicholas C. Zakas",
"email": "nicholas+npm@nczconsulting.com",
"path": "node_modules\\espree",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\espree\\LICENSE"
},
"ignore@4.0.6": {
"licenses": "MIT",
"repository": "https://github.com/kaelzhang/node-ignore",
"publisher": "kael",
"path": "node_modules\\ignore",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\ignore\\LICENSE-MIT"
},
"tslib@1.14.1": {
"licenses": "0BSD",
"repository": "https://github.com/Microsoft/tslib",
"publisher": "Microsoft Corp.",
"path": "node_modules\\tslib",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\tslib\\LICENSE.txt"
},
"tsutils@3.0.0": {
"licenses": "MIT",
"repository": "https://github.com/ajafff/tsutils",
"publisher": "Klaus Meinhardt",
"path": "node_modules\\tsutils",
"licenseFile": "D:\\dnn-elements\\dnn-elements\\packages\\stencil-library\\node_modules\\tsutils\\LICENSE"
},
"typescript@4.9.5": {
"typescript@5.2.2": {
"licenses": "Apache-2.0",
"repository": "https://github.com/Microsoft/TypeScript",
"publisher": "Microsoft Corp.",
Expand Down
Loading

0 comments on commit 0efb998

Please sign in to comment.