From e2ef60225f6e1b1fad7eb6c75ad25eb1e4e5ae03 Mon Sep 17 00:00:00 2001 From: cesarParra Date: Wed, 1 Nov 2023 19:49:44 -0400 Subject: [PATCH] Input text cleanup --- README.md | 14 ++++++++++++++ .../components/exposed/lwc/inputText/inputText.js | 3 --- .../ui/components/exposed/lwc/navBar/navBar.js | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e81f18fe..15533a87 100644 --- a/README.md +++ b/README.md @@ -1884,6 +1884,20 @@ This action navigates to a URL. A Map expression with a "name" property must be This action reloads the page. +### Input Text + +> `Form` compatible + +The `Input Text` component allows you to display a text input. It can be used +in a community page. + +#### Properties + +- `Label` - The label to display. +- `Name` - Unique name for the input. This will be used as the key in the form data during submission. +- `Required` - Whether the input is required or not. +- `Error Message` - The error message to display when the input is required and empty. + ### Nav Bar The `Nav Bar` component allows you to display a navigation bar with links to other pages. It can be used diff --git a/expression-components/main/ui/components/exposed/lwc/inputText/inputText.js b/expression-components/main/ui/components/exposed/lwc/inputText/inputText.js index 301109d3..ff86f8d0 100644 --- a/expression-components/main/ui/components/exposed/lwc/inputText/inputText.js +++ b/expression-components/main/ui/components/exposed/lwc/inputText/inputText.js @@ -13,13 +13,10 @@ export default class InputText extends TwElement { @api reportValidity() { - console.log('reportValidity', this.value); if (this.required && !this.value) { - console.log('reportValidity', this.value, 'is invalid'); this.hasValidationError = true; return false; } - console.log('reportValidity', this.value, 'is valid'); this.hasValidationError = false; return true; } diff --git a/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js b/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js index f6bf9373..81191fbd 100644 --- a/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js +++ b/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js @@ -8,6 +8,7 @@ export default class NavBar extends ExpressionSiteElement { @api respectSharing; isOpen = false; + toggle() { this.isOpen = !this.isOpen; }