From 763b798bba314b4fb302bb3275fb613dfaadb8ba Mon Sep 17 00:00:00 2001
From: Rishi Mehta <69448117+rismehta@users.noreply.github.com>
Date: Mon, 30 Sep 2024 15:07:14 +0530
Subject: [PATCH 01/10] GH actions (#1428)
* GH actions
* Dummy change
* dummy
* change
* Fix error
* Fix error
* fix error
* Fix error
* fix regex
* Fix code
* dummy change
* Dummy change
* Fix errors
---
.github/workflows/exporter-validate-pr.yml | 12 +-
.../internal/form/FormConstants.java | 1 +
.../internal/models/v1/form/PasswordImpl.java | 90 +++++++++++
.../components/models/form/FieldType.java | 1 +
.../core/components/models/form/Password.java | 32 ++++
.../components/adaptive-form/password.less | 3 +
.../components/form/password/.content.xml | 7 +
.../components/form/password/_cq_template.xml | 5 +
.../.content.xml | 2 +-
.../fd/components/form/password/.content.xml | 3 +
.../components/form/password/v1/.content.xml | 4 +
.../form/password/v1/password/.content.xml | 8 +
.../form/password/v1/password/README.md | 91 +++++++++++
.../password/_cq_design_dialog/.content.xml | 78 ++++++++++
.../v1/password/_cq_dialog/.content.xml | 142 ++++++++++++++++++
.../password/v1/password/_cq_template.xml | 5 +
.../v1/password/clientlibs/.content.xml | 3 +
.../password/clientlibs/editor/.content.xml | 5 +
.../v1/password/clientlibs/editor/js.txt | 18 +++
.../clientlibs/editor/js/editDialog.js | 39 +++++
.../v1/password/clientlibs/site/.content.xml | 6 +
.../v1/password/clientlibs/site/css.txt | 18 +++
.../clientlibs/site/css/passwordview.css | 15 ++
.../v1/password/clientlibs/site/js.txt | 19 +++
.../clientlibs/site/js/passwordview.js | 87 +++++++++++
.../site/js/togglepasswordvisibility.js | 28 ++++
.../form/password/v1/password/password.html | 58 +++++++
.../form/password/v1/password/password.js | 34 +++++
28 files changed, 807 insertions(+), 7 deletions(-)
create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PasswordImpl.java
create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
create mode 100644 examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/password.less
create mode 100644 examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/.content.xml
create mode 100644 examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/_cq_template.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_design_dialog/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_dialog/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_template.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js.txt
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js/editDialog.js
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css.txt
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css/passwordview.css
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js.txt
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/togglepasswordvisibility.js
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.js
diff --git a/.github/workflows/exporter-validate-pr.yml b/.github/workflows/exporter-validate-pr.yml
index 8f3ac2c5b8..e8251f62af 100644
--- a/.github/workflows/exporter-validate-pr.yml
+++ b/.github/workflows/exporter-validate-pr.yml
@@ -34,8 +34,8 @@ jobs:
head_file=$(git show ${{ github.head_ref }}:$file)
# Compare the JSON keys
- base_keys=$(echo "$base_file" | jq -r 'paths | map(tostring) | join(".")' | sed 's/\./\\./g')
- head_keys=$(echo "$head_file" | jq -r 'paths | map(tostring) | join(".")' | sed 's/\./\\./g')
+ base_keys=$(echo "$base_file" | jq -r 'paths | map(tostring) | join(".")')
+ head_keys=$(echo "$head_file" | jq -r 'paths | map(tostring) | join(".")')
# Check for removed keys
removed_keys=$(comm -23 <(echo "$base_keys" | sort) <(echo "$head_keys" | sort))
@@ -45,11 +45,11 @@ jobs:
echo "$removed_keys"
exit 1
fi
-
+
# Check for changed values
for key in $base_keys; do
- base_value=$(echo "$base_file" | jq -r --arg key "$key" '.[$key]')
- head_value=$(echo "$head_file" | jq -r --arg key "$key" '.[$key]')
+ base_value=$(echo "$base_file" | jq -r ".$key")
+ head_value=$(echo "$head_file" | jq -r ".$key")
if [ "$base_value" != "$head_value" ]; then
echo "Backward incompatibility change detected in $file. The value of key '$key' was changed from '$base_value' to '$head_value'."
@@ -59,4 +59,4 @@ jobs:
done
echo "All exporter JSON files have only additions. No backward incompatibility changes detected."
- shell: bash
\ No newline at end of file
+ shell: bash
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java
index 09986f6e91..0939f9a7be 100644
--- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java
@@ -139,4 +139,5 @@ private FormConstants() {
/* The resource type for the pre-selected the linked panel */
public final static String RT_FD_FORM_REVIEW_DATASOURCE_V1 = RT_FD_FORM_PREFIX + "review/v1/datasource";
+ public static final String RT_FD_FORM_PASSWORD_V1 = RT_FD_FORM_PREFIX + "password/v1/password";
}
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PasswordImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PasswordImpl.java
new file mode 100644
index 0000000000..b8d2de195e
--- /dev/null
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PasswordImpl.java
@@ -0,0 +1,90 @@
+/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Copyright 2024 Adobe
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+package com.adobe.cq.forms.core.components.internal.models.v1.form;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.models.annotations.Default;
+import org.apache.sling.models.annotations.Exporter;
+import org.apache.sling.models.annotations.Model;
+import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
+
+import com.adobe.cq.export.json.ComponentExporter;
+import com.adobe.cq.export.json.ExporterConstants;
+import com.adobe.cq.forms.core.components.internal.form.FormConstants;
+import com.adobe.cq.forms.core.components.models.form.Password;
+import com.adobe.cq.forms.core.components.util.AbstractFieldImpl;
+
+@Model(
+ adaptables = { SlingHttpServletRequest.class, Resource.class },
+ adapters = { Password.class, ComponentExporter.class },
+ resourceType = { FormConstants.RT_FD_FORM_PASSWORD_V1 })
+@Exporter(
+ name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
+ extensions = ExporterConstants.SLING_MODEL_EXTENSION)
+public class PasswordImpl extends AbstractFieldImpl implements Password {
+
+ @ValueMapValue
+ @Default(values = "")
+ private String validationPattern;
+
+ @Override
+ public String getFieldType() {
+ return super.getFieldType();
+ }
+
+ @Override
+ public Integer getMinLength() {
+ return minLength;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ @Override
+ public Long getMinimum() {
+ return minimum;
+ }
+
+ @Override
+ public Long getMaximum() {
+ return maximum;
+ }
+
+ @Override
+ public Long getExclusiveMaximum() {
+ return exclusiveMaximum;
+ }
+
+ @Override
+ public Long getExclusiveMinimum() {
+ return exclusiveMinimum;
+ }
+
+ @Override
+ public String getFormat() {
+ return displayFormat;
+ }
+
+ @Override
+ public String getValidationPattern() {
+ return validationPattern;
+ }
+
+}
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/FieldType.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/FieldType.java
index 58fb6fb702..9eff634a66 100644
--- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/FieldType.java
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/FieldType.java
@@ -36,6 +36,7 @@ public enum FieldType {
FORM("form"),
CHECKBOX_GROUP("checkbox-group"),
IMAGE("image"),
+
TELEPHONE("tel"),
PASSWORD("password"),
RANGE("range"),
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
new file mode 100644
index 0000000000..0f8bea8956
--- /dev/null
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
@@ -0,0 +1,32 @@
+/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Copyright 2024 Adobe
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+package com.adobe.cq.forms.core.components.models.form;
+
+import org.osgi.annotation.versioning.ConsumerType;
+
+@ConsumerType
+public interface Password extends Field, StringConstraint, NumberConstraint {
+
+ /**
+ * Returns the validation pattern (regex) for the password field.
+ *
+ * @return the validation pattern
+ * @since com.adobe.cq.forms.core.components.models.form 1.0.0
+ */
+ String getValidationPattern();
+
+}
diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/password.less b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/password.less
new file mode 100644
index 0000000000..070e26a5da
--- /dev/null
+++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/password.less
@@ -0,0 +1,3 @@
+.cmp-adaptiveform-password {
+ .inputMixin();
+ }
\ No newline at end of file
diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/.content.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/.content.xml
new file mode 100644
index 0000000000..acb1cd0182
--- /dev/null
+++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/.content.xml
@@ -0,0 +1,7 @@
+
+
\ No newline at end of file
diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/_cq_template.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/_cq_template.xml
new file mode 100644
index 0000000000..fd92ff415e
--- /dev/null
+++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/password/_cq_template.xml
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml
index 4c0c770f99..e7ad284122 100644
--- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml
@@ -5,4 +5,4 @@
cssProcessor="[default:none,min:none]"
jsProcessor="[default:none,min:none]"
categories="[core.forms.components.runtime.all]"
- embed="[core.forms.components.runtime.base,core.forms.components.container.v2.runtime,core.forms.components.datePicker.v1.runtime,core.forms.components.textinput.v1.runtime,core.forms.components.numberinput.v1.runtime,core.forms.components.panelcontainer.v1.runtime,core.forms.components.radiobutton.v1.runtime,core.forms.components.text.v1.runtime,core.forms.components.checkboxgroup.v1.runtime,core.forms.components.button.v1.runtime,core.forms.components.image.v1.runtime,core.forms.components.dropdown.v1.runtime,core.forms.components.fileinput.v3.runtime,core.forms.components.accordion.v1.runtime,core.forms.components.tabs.v1.runtime,core.forms.components.wizard.v1.runtime,core.forms.components.verticaltabs.v1.runtime,core.forms.components.recaptcha.v1.runtime,core.forms.components.checkbox.v1.runtime,core.forms.components.fragment.v1.runtime,core.forms.components.switch.v1.runtime,core.forms.components.termsandconditions.v1.runtime, core.forms.components.hcaptcha.v1.runtime,core.forms.components.review.v1.runtime]"/>
+ embed="[core.forms.components.runtime.base,core.forms.components.container.v2.runtime,core.forms.components.datePicker.v1.runtime,core.forms.components.textinput.v1.runtime,core.forms.components.numberinput.v1.runtime,core.forms.components.panelcontainer.v1.runtime,core.forms.components.radiobutton.v1.runtime,core.forms.components.text.v1.runtime,core.forms.components.checkboxgroup.v1.runtime,core.forms.components.button.v1.runtime,core.forms.components.image.v1.runtime,core.forms.components.dropdown.v1.runtime,core.forms.components.fileinput.v3.runtime,core.forms.components.accordion.v1.runtime,core.forms.components.tabs.v1.runtime,core.forms.components.wizard.v1.runtime,core.forms.components.verticaltabs.v1.runtime,core.forms.components.recaptcha.v1.runtime,core.forms.components.checkbox.v1.runtime,core.forms.components.fragment.v1.runtime,core.forms.components.switch.v1.runtime,core.forms.components.termsandconditions.v1.runtime, core.forms.components.hcaptcha.v1.runtime,core.forms.components.review.v1.runtime, core.forms.components.password.v1.runtime]"/>
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/.content.xml
new file mode 100644
index 0000000000..491392d539
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/.content.xml
@@ -0,0 +1,3 @@
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/.content.xml
new file mode 100644
index 0000000000..12d179732b
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/.content.xml
@@ -0,0 +1,4 @@
+
+
+
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/.content.xml
new file mode 100644
index 0000000000..b568963358
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/.content.xml
@@ -0,0 +1,8 @@
+
+
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md
new file mode 100644
index 0000000000..87d7552110
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md
@@ -0,0 +1,91 @@
+
+Adaptive Form Password (v1)
+====
+Adaptive Form Password field component written in HTL.
+
+## Features
+
+* Provides the following type of input:
+ * password
+
+* Custom constraint messages for the above types
+* Styles
+* Allows replacing this component with other component (as mentioned below).
+
+### Use Object
+The Form Password component uses the `com.adobe.cq.forms.core.components.models.form.Password` Sling Model for its Use-object.
+
+### Edit Dialog Properties
+The following properties are written to JCR for this Form Password component and are expected to be available as `Resource` properties:
+
+1. `./jcr:title` - defines the label to use for this field
+2. `./hideTitle` - if set to `true`, the label of this field will be hidden
+3. `./name` - defines the name of the field, which will be submitted with the form data
+4. `./default` - defines the default value of the field
+5. `./description` - defines a help message that can be rendered in the field as a hint for the user
+6. `./required` - if set to `true`, this field will be marked as required, not allowing the form to be submitted until the field has a value
+7. `./requiredMessage` - defines the message displayed as tooltip when submitting the form if the value is left empty
+8. `./readOnly` - if set to `true`, the filed will be read only
+
+## Client Libraries
+The component provides a `core.forms.components.password.v1.runtime` client library category that contains the Javascript runtime for the component.
+It should be added to a relevant site client library using the `embed` property.
+
+It also provides a `core.forms.components.password.v1.editor` editor client library category that includes
+JavaScript handling for dialog interaction. It is already included by its edit dialog.
+
+## BEM Description
+```
+BLOCK cmp-adaptiveform-password
+ ELEMENT cmp-adaptiveform-password__label
+ ELEMENT cmp-adaptiveform-password__label-container
+ ELEMENT cmp-adaptiveform-password__widget
+ ELEMENT cmp-adaptiveform-password__questionmark
+ ELEMENT cmp-adaptiveform-password__shortdescription
+ ELEMENT cmp-adaptiveform-password__longdescription
+ ELEMENT cmp-adaptiveform-password__errormessage
+```
+
+### Note
+By placing the class names `cmp-adaptiveform-password__label` and `cmp-adaptiveform-password__questionmark` within the `cmp-adaptiveform-password__label-container` class, you create a logical grouping of the label and question mark elements. This approach simplifies the process of maintaining a consistent styling for both elements.
+
+## Replace feature:
+We support replace feature that allows replacing Reset Button component to any of the below components:
+
+* Button
+* Date Picker
+* Email Input
+* Number Input
+* Reset Button
+* Submit Button
+* Telephone Input
+* Text Box
+
+## JavaScript Data Attribute Bindings
+
+The following attributes must be added for the initialization of the password component in the form view:
+ 1. `data-cmp-is="adaptiveFormPassword"`
+ 2. `data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"`
+
+
+The following are optional attributes that can be added to the component in the form view:
+1. `data-cmp-valid` having a boolean value to indicate whether the field is currently valid or not
+2. `data-cmp-required` having a boolean value to indicate whether the field is currently required or not
+3. `data-cmp-readonly` having a boolean value to indicate whether the field is currently readonly or not
+4. `data-cmp-active` having a boolean value to indicate whether the field is currently active or not
+5. `data-cmp-visible` having a boolean value to indicate whether the field is currently visible or not
+6. `data-cmp-enabled` having a boolean value to indicate whether the field is currently enabled or not
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_design_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_design_dialog/.content.xml
new file mode 100644
index 0000000000..79e8649b56
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_design_dialog/.content.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_dialog/.content.xml
new file mode 100644
index 0000000000..b63ed7380a
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_dialog/.content.xml
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_template.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_template.xml
new file mode 100644
index 0000000000..fed340a46b
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/_cq_template.xml
@@ -0,0 +1,5 @@
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/.content.xml
new file mode 100644
index 0000000000..491392d539
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/.content.xml
@@ -0,0 +1,3 @@
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/.content.xml
new file mode 100644
index 0000000000..9db59eb5c7
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/.content.xml
@@ -0,0 +1,5 @@
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js.txt
new file mode 100644
index 0000000000..dd642eaed7
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js.txt
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright 2022 Adobe
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+
+#base=js
+editDialog.js
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js/editDialog.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js/editDialog.js
new file mode 100644
index 0000000000..66e54543a5
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/editor/js/editDialog.js
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright 2024 Adobe
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+(function($) {
+ "use strict";
+
+ var EDIT_DIALOG = ".cmp-adaptiveform-password__editdialog",
+ PASSWORD_MAXLENGTH = EDIT_DIALOG + " .cmp-adaptiveform-password__maxlength",
+ PASSWORD_MINLENGTH = EDIT_DIALOG + " .cmp-adaptiveform-password__minlength",
+ BASE_PLACEHOLDER = EDIT_DIALOG + " .cmp-adaptiveform-base__placeholder",
+ PASSWORD_VALUE = EDIT_DIALOG + " .cmp-adaptiveform-password__value",
+ PASSWORD_RICHTEXTVALUE = EDIT_DIALOG + " .cmp-adaptiveform-password__richtextvalue",
+ PASSWORD_VALIDATIONPATTERN = EDIT_DIALOG + " .cmp-adaptiveform-password__validationpattern",
+ PASSWORD_VALIDATIONFORMAT = EDIT_DIALOG + " .cmp-adaptiveform-password__validationformat",
+ Utils = window.CQ.FormsCoreComponents.Utils.v1;
+
+ function handleValidationPatternDropDown(dialog) {
+ Utils.handlePatternDropDown(dialog,PASSWORD_VALIDATIONPATTERN,PASSWORD_VALIDATIONFORMAT);
+ }
+
+ function handleValidationFormat(dialog){
+ Utils.handlePatternFormat(dialog,PASSWORD_VALIDATIONPATTERN,PASSWORD_VALIDATIONFORMAT);
+ }
+
+ Utils.initializeEditDialog(EDIT_DIALOG)(handleValidationPatternDropDown,handleValidationFormat);
+
+})(jQuery);
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml
new file mode 100644
index 0000000000..27631c55e6
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css.txt
new file mode 100644
index 0000000000..768068f910
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css.txt
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright 2022 Adobe
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+
+#base=css
+passwordview.css
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css/passwordview.css b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css/passwordview.css
new file mode 100644
index 0000000000..229055b840
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/css/passwordview.css
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright 2024 Adobe
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js.txt
new file mode 100644
index 0000000000..78e5ac68f6
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js.txt
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright 2022 Adobe
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+
+#base=js
+passwordview.js
+togglepasswordvisibility.js
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js
new file mode 100644
index 0000000000..40fcd8cf56
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright 2024 Adobe
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+(function() {
+
+ "use strict";
+ class Password extends FormView.FormFieldBase {
+
+ static NS = FormView.Constants.NS;
+ /**
+ * Each FormField has a data attribute class that is prefixed along with the global namespace to
+ * distinguish between them. If a component wants to put a data-attribute X, the attribute in HTML would be
+ * data-{NS}-{IS}-x=""
+ * @type {string}
+ */
+ static IS = "adaptiveFormPassword";
+ static bemBlock = 'cmp-adaptiveform-password'
+ static selectors = {
+ self: "[data-" + this.NS + '-is="' + this.IS + '"]',
+ widget: `.${Password.bemBlock}__widget`,
+ label: `.${Password.bemBlock}__label`,
+ description: `.${Password.bemBlock}__longdescription`,
+ qm: `.${Password.bemBlock}__questionmark`,
+ errorDiv: `.${Password.bemBlock}__errormessage`,
+ tooltipDiv: `.${Password.bemBlock}__shortdescription`
+ };
+
+ constructor(params) {
+ super(params);
+ }
+
+ getWidget() {
+ return this.element.querySelector(Password.selectors.widget);
+ }
+
+ getDescription() {
+ return this.element.querySelector(Password.selectors.description);
+ }
+
+ getLabel() {
+ return this.element.querySelector(Password.selectors.label);
+ }
+
+ getErrorDiv() {
+ return this.element.querySelector(Password.selectors.errorDiv);
+ }
+
+ getTooltipDiv() {
+ return this.element.querySelector(Password.selectors.tooltipDiv);
+ }
+
+ getQuestionMarkDiv() {
+ return this.element.querySelector(Password.selectors.qm);
+ }
+
+ setModel(model) {
+ super.setModel(model);
+ if (this.widget.value !== '') {
+ this._model.value = this.widget.value;
+ }
+ this.widget.addEventListener('blur', (e) => {
+ this._model.value = e.target.value;
+ this.setInactive();
+ });
+ this.widget.addEventListener('focus', (e) => {
+ this.setActive();
+ });
+ }
+ }
+
+ FormView.Utils.setupField(({element, formContainer}) => {
+ return new Password({element, formContainer})
+ }, Password.selectors.self);
+
+})();
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/togglepasswordvisibility.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/togglepasswordvisibility.js
new file mode 100644
index 0000000000..4117df083d
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/togglepasswordvisibility.js
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright 2024 Adobe
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+$(document).ready(function() {
+ $(document).on('click', '.ssnField .fisheye', function() {
+ var type = $(".ssnField").find("input").attr("type");
+ if (type == "text") {
+ $(".ssnField").find("input").attr("type", "password");
+ }
+
+ if (type == "password") {
+ $(".ssnField").find("input").attr("type", "text");
+ }
+ });
+ });
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html
new file mode 100644
index 0000000000..7a70e20574
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.js
new file mode 100644
index 0000000000..dc33ea8b81
--- /dev/null
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.js
@@ -0,0 +1,34 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Copyright 2024 Adobe
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+use(function () {
+
+ var clientlibsArr = ['core.forms.components.base.v1.editor'];
+ var labelPath = 'core/fd/components/af-commons/v1/fieldTemplates/label.html';
+ var shortDescriptionPath = "core/fd/components/af-commons/v1/fieldTemplates/shortDescription.html";
+ var longDescriptionPath = "core/fd/components/af-commons/v1/fieldTemplates/longDescription.html";
+ var questionMarkPath = "core/fd/components/af-commons/v1/fieldTemplates/questionMark.html"
+ var errorMessagePath = "core/fd/components/af-commons/v1/fieldTemplates/errorMessage.html";
+
+ return {
+ labelPath: labelPath,
+ shortDescriptionPath: shortDescriptionPath,
+ longDescriptionPath: longDescriptionPath,
+ questionMarkPath: questionMarkPath,
+ errorMessagePath: errorMessagePath,
+ clientlibs: clientlibsArr
+ }
+});
\ No newline at end of file
From d1d22826d3d811b117aa3dc5d7cfccc581edbc7d Mon Sep 17 00:00:00 2001
From: Sushil Kumar <88363275+kum-sushil@users.noreply.github.com>
Date: Fri, 23 Feb 2024 15:44:17 +0530
Subject: [PATCH 02/10] AF Password Component| Updated license year and few
code comments block update
---
.../adobe/cq/forms/core/components/models/form/Password.java | 2 +-
.../apps/core/fd/components/form/password/v1/password/README.md | 2 +-
.../form/password/v1/password/clientlibs/editor/js.txt | 2 +-
.../form/password/v1/password/clientlibs/site/css.txt | 2 +-
.../components/form/password/v1/password/clientlibs/site/js.txt | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
index 0f8bea8956..62ee8a5c02 100644
--- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
@@ -25,7 +25,7 @@ public interface Password extends Field, StringConstraint, NumberConstraint {
* Returns the validation pattern (regex) for the password field.
*
* @return the validation pattern
- * @since com.adobe.cq.forms.core.components.models.form 1.0.0
+ * @since com.adobe.cq.forms.core.components.models.form 2.0.0
*/
String getValidationPattern();
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md
index 87d7552110..3deb0fa3dc 100644
--- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md
@@ -1,5 +1,5 @@
-
+ dir="auto" aria-label="password"/>