diff --git a/src/assets/styles/primevue.css b/src/assets/styles/primevue.css index ac544b3a0..0f0e625ec 100644 --- a/src/assets/styles/primevue.css +++ b/src/assets/styles/primevue.css @@ -4,7 +4,6 @@ @import '../../components/checkbox/Checkbox.css'; @import '../../components/colorpicker/ColorPicker.css'; @import '../../components/inputtext/InputText.css'; -@import '../../components/password/Password.css'; @import '../../components/radiobutton/RadioButton.css'; @import '../../components/ripple/Ripple.css'; @import '../../components/tooltip/Tooltip.css'; \ No newline at end of file diff --git a/src/components/password/Password.d.ts b/src/components/password/Password.d.ts index 78de36621..8cb40b876 100755 --- a/src/components/password/Password.d.ts +++ b/src/components/password/Password.d.ts @@ -9,6 +9,8 @@ declare class Password extends Vue { mediumLabel?: string; strongLabel?: string; feedback?: boolean; + appendTo?: string; + toggleMask?: boolean; $emit(eventName: string, event: Event): this; } diff --git a/src/components/password/Password.vue b/src/components/password/Password.vue index d4b6cc591..8404a3d97 100755 --- a/src/components/password/Password.vue +++ b/src/components/password/Password.vue @@ -1,19 +1,24 @@ + + diff --git a/src/components/password/images/password-meter.png b/src/components/password/images/password-meter.png deleted file mode 100755 index ddb456d3f..000000000 Binary files a/src/components/password/images/password-meter.png and /dev/null differ diff --git a/src/views/password/PasswordDemo.vue b/src/views/password/PasswordDemo.vue index 9775ef9bd..63e49ed4a 100755 --- a/src/views/password/PasswordDemo.vue +++ b/src/views/password/PasswordDemo.vue @@ -10,7 +10,32 @@
- +
Basic
+ + +
Password Meter
+ + +
Show Password
+ + +
Templating
+ + + +
@@ -24,7 +49,10 @@ import PasswordDoc from './PasswordDoc'; export default { data() { return { - value: '' + value1: null, + value2: null, + value3: null, + value4: null } }, components: { @@ -32,3 +60,9 @@ export default { } } + + diff --git a/src/views/password/PasswordDoc.vue b/src/views/password/PasswordDoc.vue index f4e2adebf..b8d42056a 100755 --- a/src/views/password/PasswordDoc.vue +++ b/src/views/password/PasswordDoc.vue @@ -39,6 +39,28 @@ import Password from 'primevue/password';

It is possible to define your own checks with the mediumRegex and strongRegex properties.

+
Templating
+

3 slots are included to customize the overlay. These are header, content and footer. Note that content overrides the default meter.

+
+
+<Password v-model="value4">
+    <template #header>
+        <h6>Pick a password</h6>
+    </template>
+    <template #footer>
+        <Divider />
+        <p class="p-mt-2">Suggestions</p>
+        <ul class="p-pl-2 p-ml-2 p-mt-0" style="line-height: 1.5">
+            <li>At least one lowercase</li>
+            <li>At least one uppercase</li>
+            <li>At least one numeric</li>
+            <li>Minimum 8 characters</li>
+        </ul>
+    </template>
+</Password>
+
+
+
Properties

Any property such as name and placeholder are passed to the underlying input element. Following are the additional properties to configure the component.

@@ -99,6 +121,18 @@ import Password from 'primevue/password'; boolean true Whether to show the strength indicator or not. + + + toggleMask + boolean + false + Whether to show an icon to display the password as plain text. + + + appendTo + string + null + Id of the element or "body" for document where the overlay should be appended to.