primevue 3.15.0 → 3.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/AutoComplete.d.ts +182 -38
- package/autocomplete/AutoComplete.vue +636 -342
- package/autocomplete/autocomplete.cjs.js +745 -416
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +747 -418
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +745 -416
- package/autocomplete/autocomplete.min.js +1 -1
- package/button/Button.vue +4 -1
- package/button/button.cjs.js +5 -1
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +5 -1
- package/button/button.esm.min.js +1 -1
- package/button/button.js +5 -1
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +51 -12
- package/calendar/Calendar.vue +259 -114
- package/calendar/calendar.cjs.js +414 -220
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +415 -221
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +414 -220
- package/calendar/calendar.min.js +1 -1
- package/carousel/Carousel.vue +25 -0
- package/carousel/carousel.cjs.js +25 -0
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +25 -0
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +25 -0
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +97 -17
- package/cascadeselect/CascadeSelect.vue +560 -135
- package/cascadeselect/CascadeSelectSub.vue +48 -129
- package/cascadeselect/cascadeselect.cjs.js +670 -306
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +672 -308
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +670 -306
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/Checkbox.d.ts +40 -4
- package/checkbox/Checkbox.vue +50 -13
- package/checkbox/checkbox.cjs.js +64 -23
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +65 -24
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +64 -23
- package/checkbox/checkbox.min.js +1 -1
- package/chips/Chips.d.ts +36 -12
- package/chips/Chips.vue +116 -22
- package/chips/chips.cjs.js +149 -37
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +150 -38
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +150 -39
- package/chips/chips.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +3 -6
- package/colorpicker/ColorPicker.vue +1 -5
- package/colorpicker/colorpicker.cjs.js +2 -7
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -7
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +2 -7
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/Column.d.ts +4 -0
- package/column/Column.vue +4 -0
- package/column/column.cjs.js +4 -0
- package/column/column.cjs.min.js +1 -1
- package/column/column.esm.js +4 -0
- package/column/column.esm.min.js +1 -1
- package/column/column.js +4 -0
- package/column/column.min.js +1 -1
- package/config/PrimeVue.d.ts +42 -0
- package/config/config.cjs.js +35 -4
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +35 -4
- package/config/config.esm.min.js +1 -1
- package/config/config.js +35 -4
- package/config/config.min.js +1 -1
- package/confirmdialog/ConfirmDialog.vue +4 -1
- package/confirmdialog/confirmdialog.cjs.js +6 -2
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +6 -2
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +6 -2
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +1 -1
- package/contextmenu/ContextMenuSub.vue +3 -3
- package/contextmenu/contextmenu.cjs.js +14 -8
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +15 -9
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +14 -8
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +1128 -772
- package/core/core.min.js +12 -12
- package/datatable/BodyCell.vue +11 -2
- package/datatable/DataTable.vue +23 -2
- package/datatable/datatable.cjs.js +34 -4
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +34 -4
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +34 -4
- package/datatable/datatable.min.js +1 -1
- package/dialog/Dialog.d.ts +5 -1
- package/dropdown/Dropdown.d.ts +92 -38
- package/dropdown/Dropdown.vue +538 -399
- package/dropdown/dropdown.cjs.js +657 -486
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +659 -488
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +657 -486
- package/dropdown/dropdown.min.js +1 -1
- package/editor/Editor.d.ts +32 -0
- package/editor/Editor.vue +15 -1
- package/editor/editor.cjs.js +15 -1
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +15 -1
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +15 -1
- package/editor/editor.min.js +1 -1
- package/inputmask/InputMask.vue +9 -6
- package/inputmask/inputmask.cjs.js +14 -6
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +15 -7
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +14 -6
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +31 -7
- package/inputnumber/InputNumber.vue +53 -20
- package/inputnumber/inputnumber.cjs.js +75 -29
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +76 -30
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +75 -29
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +24 -8
- package/inputswitch/InputSwitch.vue +27 -12
- package/inputswitch/inputswitch.cjs.js +38 -20
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +39 -21
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +38 -20
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.vue +1 -2
- package/inputtext/inputtext.cjs.js +3 -4
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +4 -5
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +3 -4
- package/inputtext/inputtext.min.js +1 -1
- package/knob/Knob.d.ts +12 -0
- package/knob/Knob.vue +62 -2
- package/knob/knob.cjs.js +73 -5
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +73 -5
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +73 -5
- package/knob/knob.min.js +1 -1
- package/listbox/Listbox.d.ts +53 -7
- package/listbox/Listbox.vue +500 -135
- package/listbox/listbox.cjs.js +597 -193
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +599 -195
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +597 -193
- package/listbox/listbox.min.js +1 -1
- package/menu/Menu.d.ts +1 -1
- package/menu/Menuitem.vue +2 -2
- package/menu/menu.cjs.js +12 -6
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +13 -7
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +12 -6
- package/menu/menu.min.js +1 -1
- package/menubar/MenubarSub.vue +3 -3
- package/menubar/menubar.cjs.js +14 -8
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +15 -9
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +14 -8
- package/menubar/menubar.min.js +1 -1
- package/menuitem/MenuItem.d.ts +1 -1
- package/multiselect/MultiSelect.d.ts +111 -51
- package/multiselect/MultiSelect.vue +629 -338
- package/multiselect/multiselect.cjs.js +748 -428
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +750 -430
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +748 -428
- package/multiselect/multiselect.min.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +1 -1
- package/overlaypanel/OverlayPanel.vue +14 -2
- package/overlaypanel/overlaypanel.cjs.js +14 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +14 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +14 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +2 -2
- package/paginator/Paginator.d.ts +2 -2
- package/password/Password.d.ts +36 -8
- package/password/Password.vue +50 -14
- package/password/password.cjs.js +69 -24
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +71 -26
- package/password/password.esm.min.js +1 -1
- package/password/password.js +69 -24
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +8 -0
- package/picklist/PickList.vue +10 -2
- package/picklist/picklist.cjs.js +68 -50
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +69 -51
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +68 -50
- package/picklist/picklist.min.js +1 -1
- package/portal/Portal.d.ts +1 -1
- package/radiobutton/RadioButton.d.ts +28 -4
- package/radiobutton/RadioButton.vue +36 -11
- package/radiobutton/radiobutton.cjs.js +49 -23
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +50 -24
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +49 -23
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/Rating.d.ts +4 -0
- package/rating/Rating.vue +61 -7
- package/rating/rating.cjs.js +90 -16
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +91 -17
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +90 -16
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +8 -0
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +82 -40
- package/resources/themes/arya-green/theme.css +82 -40
- package/resources/themes/arya-orange/theme.css +82 -40
- package/resources/themes/arya-purple/theme.css +82 -40
- package/resources/themes/bootstrap4-dark-blue/theme.css +82 -40
- package/resources/themes/bootstrap4-dark-purple/theme.css +82 -40
- package/resources/themes/bootstrap4-light-blue/theme.css +82 -40
- package/resources/themes/bootstrap4-light-purple/theme.css +82 -40
- package/resources/themes/fluent-light/theme.css +82 -40
- package/resources/themes/lara-dark-blue/theme.css +82 -40
- package/resources/themes/lara-dark-indigo/theme.css +82 -40
- package/resources/themes/lara-dark-purple/theme.css +82 -40
- package/resources/themes/lara-dark-teal/theme.css +82 -40
- package/resources/themes/lara-light-blue/theme.css +82 -40
- package/resources/themes/lara-light-indigo/theme.css +82 -40
- package/resources/themes/lara-light-purple/theme.css +82 -40
- package/resources/themes/lara-light-teal/theme.css +82 -40
- package/resources/themes/luna-amber/theme.css +82 -40
- package/resources/themes/luna-blue/theme.css +82 -40
- package/resources/themes/luna-green/theme.css +82 -40
- package/resources/themes/luna-pink/theme.css +82 -40
- package/resources/themes/md-dark-deeppurple/theme.css +82 -40
- package/resources/themes/md-dark-indigo/theme.css +82 -40
- package/resources/themes/md-light-deeppurple/theme.css +82 -40
- package/resources/themes/md-light-indigo/theme.css +82 -40
- package/resources/themes/mdc-dark-deeppurple/theme.css +82 -40
- package/resources/themes/mdc-dark-indigo/theme.css +82 -40
- package/resources/themes/mdc-light-deeppurple/theme.css +82 -40
- package/resources/themes/mdc-light-indigo/theme.css +82 -40
- package/resources/themes/nova/theme.css +82 -40
- package/resources/themes/nova-accent/theme.css +82 -40
- package/resources/themes/nova-alt/theme.css +82 -40
- package/resources/themes/nova-vue/theme.css +82 -40
- package/resources/themes/rhea/theme.css +82 -40
- package/resources/themes/saga-blue/theme.css +82 -40
- package/resources/themes/saga-green/theme.css +82 -40
- package/resources/themes/saga-orange/theme.css +82 -40
- package/resources/themes/saga-purple/theme.css +82 -40
- package/resources/themes/tailwind-light/theme.css +82 -40
- package/resources/themes/vela-blue/theme.css +82 -40
- package/resources/themes/vela-green/theme.css +82 -40
- package/resources/themes/vela-orange/theme.css +82 -40
- package/resources/themes/vela-purple/theme.css +82 -40
- package/ripple/ripple.cjs.js +1 -0
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +1 -0
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +1 -0
- package/ripple/ripple.min.js +1 -1
- package/selectbutton/SelectButton.d.ts +6 -2
- package/selectbutton/SelectButton.vue +89 -12
- package/selectbutton/selectbutton.cjs.js +97 -22
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +99 -24
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +97 -22
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/Slider.d.ts +9 -1
- package/slider/Slider.vue +50 -34
- package/slider/slider.cjs.js +59 -38
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +59 -38
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +59 -38
- package/slider/slider.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +1 -1
- package/splitter/Splitter.vue +30 -1
- package/splitter/splitter.cjs.js +30 -1
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +30 -1
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +30 -1
- package/splitter/splitter.min.js +1 -1
- package/textarea/Textarea.vue +1 -2
- package/textarea/textarea.cjs.js +3 -5
- package/textarea/textarea.cjs.min.js +1 -1
- package/textarea/textarea.esm.js +4 -6
- package/textarea/textarea.esm.min.js +1 -1
- package/textarea/textarea.js +3 -5
- package/textarea/textarea.min.js +1 -1
- package/tieredmenu/TieredMenu.d.ts +1 -1
- package/tieredmenu/TieredMenuSub.vue +3 -3
- package/tieredmenu/tieredmenu.cjs.js +14 -8
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +15 -9
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +14 -8
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/Timeline.d.ts +10 -1
- package/timeline/Timeline.vue +1 -1
- package/timeline/timeline.cjs.js +5 -1
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +5 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +5 -1
- package/timeline/timeline.min.js +1 -1
- package/togglebutton/ToggleButton.d.ts +42 -0
- package/togglebutton/ToggleButton.vue +44 -7
- package/togglebutton/togglebutton.cjs.js +59 -13
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +60 -14
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +59 -13
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.cjs.js +20 -11
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +21 -12
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +20 -11
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.vue +5 -1
- package/tree/TreeNode.vue +20 -19
- package/tree/tree.cjs.js +47 -32
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +47 -32
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +47 -32
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +26 -10
- package/treeselect/TreeSelect.vue +52 -29
- package/treeselect/treeselect.cjs.js +74 -41
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +76 -43
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +74 -41
- package/treeselect/treeselect.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +20 -4
- package/tristatecheckbox/TriStateCheckbox.vue +52 -15
- package/tristatecheckbox/tristatecheckbox.cjs.js +67 -26
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +68 -27
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +67 -26
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/Utils.d.ts +3 -2
- package/utils/utils.cjs.js +239 -173
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +239 -173
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +239 -173
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +612 -136
- package/vetur-tags.json +180 -59
- package/virtualscroller/VirtualScroller.d.ts +10 -0
- package/virtualscroller/VirtualScroller.vue +18 -17
- package/virtualscroller/virtualscroller.cjs.js +22 -20
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +22 -20
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +22 -20
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1745 -338
package/password/Password.vue
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="containerClass"
|
|
3
|
-
<PInputText ref="input" :
|
|
2
|
+
<div :class="containerClass">
|
|
3
|
+
<PInputText ref="input" :id="inputId" :type="inputType" :class="inputClass" :style="inputStyle" :value="modelValue" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
|
|
4
|
+
:aria-controls="(panelProps&&panelProps.id)||panelId||panelUniqueId" :aria-expanded="overlayVisible" :aria-haspopup="true" :placeholder="placeholder"
|
|
5
|
+
@input="onInput" @focus="onFocus" @blur="onBlur" @keyup="onKeyUp" v-bind="inputProps" />
|
|
4
6
|
<i v-if="toggleMask" :class="toggleIconClass" @click="onMaskToggle" />
|
|
7
|
+
<span class="p-hidden-accessible" aria-live="polite">
|
|
8
|
+
{{infoText}}
|
|
9
|
+
</span>
|
|
5
10
|
<Portal :appendTo="appendTo">
|
|
6
11
|
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave">
|
|
7
|
-
<div :ref="overlayRef" :class="panelStyleClass" v-if="overlayVisible" @click="onOverlayClick">
|
|
12
|
+
<div :ref="overlayRef" :id="panelId||panelUniqueId" :class="panelStyleClass" :style="panelStyle" v-if="overlayVisible" @click="onOverlayClick" v-bind="panelProps">
|
|
8
13
|
<slot name="header"></slot>
|
|
9
14
|
<slot name="content">
|
|
10
15
|
<div class="p-password-meter">
|
|
@@ -20,15 +25,14 @@
|
|
|
20
25
|
</template>
|
|
21
26
|
|
|
22
27
|
<script>
|
|
23
|
-
import {ConnectedOverlayScrollHandler,DomHandler,ZIndexUtils} from 'primevue/utils';
|
|
28
|
+
import {ConnectedOverlayScrollHandler,DomHandler,ZIndexUtils,UniqueComponentId} from 'primevue/utils';
|
|
24
29
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
25
30
|
import InputText from 'primevue/inputtext';
|
|
26
31
|
import Portal from 'primevue/portal';
|
|
27
32
|
|
|
28
33
|
export default {
|
|
29
34
|
name: 'Password',
|
|
30
|
-
emits: ['update:modelValue'],
|
|
31
|
-
inheritAttrs: false,
|
|
35
|
+
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
|
32
36
|
props: {
|
|
33
37
|
modelValue: String,
|
|
34
38
|
promptLabel: {
|
|
@@ -75,11 +79,30 @@ export default {
|
|
|
75
79
|
type: String,
|
|
76
80
|
default: 'pi pi-eye'
|
|
77
81
|
},
|
|
82
|
+
disabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false
|
|
85
|
+
},
|
|
86
|
+
placeholder: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: null
|
|
89
|
+
},
|
|
90
|
+
inputId: null,
|
|
78
91
|
inputClass: null,
|
|
79
92
|
inputStyle: null,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
panelClass:
|
|
93
|
+
inputProps: null,
|
|
94
|
+
panelId: null,
|
|
95
|
+
panelClass: null,
|
|
96
|
+
panelStyle: null,
|
|
97
|
+
panelProps: null,
|
|
98
|
+
'aria-labelledby': {
|
|
99
|
+
type: String,
|
|
100
|
+
default: null
|
|
101
|
+
},
|
|
102
|
+
'aria-label': {
|
|
103
|
+
type: String,
|
|
104
|
+
default: null
|
|
105
|
+
}
|
|
83
106
|
},
|
|
84
107
|
data() {
|
|
85
108
|
return {
|
|
@@ -151,17 +174,21 @@ export default {
|
|
|
151
174
|
onInput(event) {
|
|
152
175
|
this.$emit('update:modelValue', event.target.value)
|
|
153
176
|
},
|
|
154
|
-
onFocus() {
|
|
177
|
+
onFocus(event) {
|
|
155
178
|
this.focused = true;
|
|
156
179
|
if (this.feedback) {
|
|
157
180
|
this.overlayVisible = true;
|
|
158
181
|
}
|
|
182
|
+
|
|
183
|
+
this.$emit('focus', event);
|
|
159
184
|
},
|
|
160
|
-
onBlur() {
|
|
185
|
+
onBlur(event) {
|
|
161
186
|
this.focused = false;
|
|
162
187
|
if (this.feedback) {
|
|
163
188
|
this.overlayVisible = false;
|
|
164
189
|
}
|
|
190
|
+
|
|
191
|
+
this.$emit('blur', event);
|
|
165
192
|
},
|
|
166
193
|
onKeyUp(event) {
|
|
167
194
|
if (this.feedback) {
|
|
@@ -203,6 +230,12 @@ export default {
|
|
|
203
230
|
this.meter = meter;
|
|
204
231
|
this.infoText = label;
|
|
205
232
|
|
|
233
|
+
//escape
|
|
234
|
+
if (event.which === 27) {
|
|
235
|
+
this.overlayVisible && (this.overlayVisible = false);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
206
239
|
if (!this.overlayVisible) {
|
|
207
240
|
this.overlayVisible = true;
|
|
208
241
|
}
|
|
@@ -255,15 +288,15 @@ export default {
|
|
|
255
288
|
},
|
|
256
289
|
computed: {
|
|
257
290
|
containerClass() {
|
|
258
|
-
return ['p-password p-component p-inputwrapper',
|
|
291
|
+
return ['p-password p-component p-inputwrapper', {
|
|
259
292
|
'p-inputwrapper-filled': this.filled,
|
|
260
293
|
'p-inputwrapper-focus': this.focused,
|
|
261
294
|
'p-input-icon-right': this.toggleMask
|
|
262
295
|
}];
|
|
263
296
|
},
|
|
264
297
|
inputFieldClass() {
|
|
265
|
-
return ['p-password-input',
|
|
266
|
-
'p-disabled': this
|
|
298
|
+
return ['p-password-input', {
|
|
299
|
+
'p-disabled': this.disabled
|
|
267
300
|
}];
|
|
268
301
|
},
|
|
269
302
|
panelStyleClass() {
|
|
@@ -295,6 +328,9 @@ export default {
|
|
|
295
328
|
},
|
|
296
329
|
promptText() {
|
|
297
330
|
return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
|
|
331
|
+
},
|
|
332
|
+
panelUniqueId() {
|
|
333
|
+
return UniqueComponentId() + '_panel';
|
|
298
334
|
}
|
|
299
335
|
},
|
|
300
336
|
components: {
|
package/password/password.cjs.js
CHANGED
|
@@ -14,8 +14,7 @@ var Portal__default = /*#__PURE__*/_interopDefaultLegacy(Portal);
|
|
|
14
14
|
|
|
15
15
|
var script = {
|
|
16
16
|
name: 'Password',
|
|
17
|
-
emits: ['update:modelValue'],
|
|
18
|
-
inheritAttrs: false,
|
|
17
|
+
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
|
19
18
|
props: {
|
|
20
19
|
modelValue: String,
|
|
21
20
|
promptLabel: {
|
|
@@ -62,11 +61,30 @@ var script = {
|
|
|
62
61
|
type: String,
|
|
63
62
|
default: 'pi pi-eye'
|
|
64
63
|
},
|
|
64
|
+
disabled: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
placeholder: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: null
|
|
71
|
+
},
|
|
72
|
+
inputId: null,
|
|
65
73
|
inputClass: null,
|
|
66
74
|
inputStyle: null,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
panelClass:
|
|
75
|
+
inputProps: null,
|
|
76
|
+
panelId: null,
|
|
77
|
+
panelClass: null,
|
|
78
|
+
panelStyle: null,
|
|
79
|
+
panelProps: null,
|
|
80
|
+
'aria-labelledby': {
|
|
81
|
+
type: String,
|
|
82
|
+
default: null
|
|
83
|
+
},
|
|
84
|
+
'aria-label': {
|
|
85
|
+
type: String,
|
|
86
|
+
default: null
|
|
87
|
+
}
|
|
70
88
|
},
|
|
71
89
|
data() {
|
|
72
90
|
return {
|
|
@@ -138,17 +156,21 @@ var script = {
|
|
|
138
156
|
onInput(event) {
|
|
139
157
|
this.$emit('update:modelValue', event.target.value);
|
|
140
158
|
},
|
|
141
|
-
onFocus() {
|
|
159
|
+
onFocus(event) {
|
|
142
160
|
this.focused = true;
|
|
143
161
|
if (this.feedback) {
|
|
144
162
|
this.overlayVisible = true;
|
|
145
163
|
}
|
|
164
|
+
|
|
165
|
+
this.$emit('focus', event);
|
|
146
166
|
},
|
|
147
|
-
onBlur() {
|
|
167
|
+
onBlur(event) {
|
|
148
168
|
this.focused = false;
|
|
149
169
|
if (this.feedback) {
|
|
150
170
|
this.overlayVisible = false;
|
|
151
171
|
}
|
|
172
|
+
|
|
173
|
+
this.$emit('blur', event);
|
|
152
174
|
},
|
|
153
175
|
onKeyUp(event) {
|
|
154
176
|
if (this.feedback) {
|
|
@@ -190,6 +212,12 @@ var script = {
|
|
|
190
212
|
this.meter = meter;
|
|
191
213
|
this.infoText = label;
|
|
192
214
|
|
|
215
|
+
//escape
|
|
216
|
+
if (event.which === 27) {
|
|
217
|
+
this.overlayVisible && (this.overlayVisible = false);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
|
|
193
221
|
if (!this.overlayVisible) {
|
|
194
222
|
this.overlayVisible = true;
|
|
195
223
|
}
|
|
@@ -242,15 +270,15 @@ var script = {
|
|
|
242
270
|
},
|
|
243
271
|
computed: {
|
|
244
272
|
containerClass() {
|
|
245
|
-
return ['p-password p-component p-inputwrapper',
|
|
273
|
+
return ['p-password p-component p-inputwrapper', {
|
|
246
274
|
'p-inputwrapper-filled': this.filled,
|
|
247
275
|
'p-inputwrapper-focus': this.focused,
|
|
248
276
|
'p-input-icon-right': this.toggleMask
|
|
249
277
|
}];
|
|
250
278
|
},
|
|
251
279
|
inputFieldClass() {
|
|
252
|
-
return ['p-password-input',
|
|
253
|
-
'p-disabled': this
|
|
280
|
+
return ['p-password-input', {
|
|
281
|
+
'p-disabled': this.disabled
|
|
254
282
|
}];
|
|
255
283
|
},
|
|
256
284
|
panelStyleClass() {
|
|
@@ -282,6 +310,9 @@ var script = {
|
|
|
282
310
|
},
|
|
283
311
|
promptText() {
|
|
284
312
|
return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
|
|
313
|
+
},
|
|
314
|
+
panelUniqueId() {
|
|
315
|
+
return utils.UniqueComponentId() + '_panel';
|
|
285
316
|
}
|
|
286
317
|
},
|
|
287
318
|
components: {
|
|
@@ -290,28 +321,39 @@ var script = {
|
|
|
290
321
|
}
|
|
291
322
|
};
|
|
292
323
|
|
|
293
|
-
const _hoisted_1 = {
|
|
294
|
-
|
|
324
|
+
const _hoisted_1 = {
|
|
325
|
+
class: "p-hidden-accessible",
|
|
326
|
+
"aria-live": "polite"
|
|
327
|
+
};
|
|
328
|
+
const _hoisted_2 = ["id"];
|
|
329
|
+
const _hoisted_3 = { class: "p-password-meter" };
|
|
330
|
+
const _hoisted_4 = { class: "p-password-info" };
|
|
295
331
|
|
|
296
332
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
297
333
|
const _component_PInputText = vue.resolveComponent("PInputText");
|
|
298
334
|
const _component_Portal = vue.resolveComponent("Portal");
|
|
299
335
|
|
|
300
336
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
301
|
-
class: vue.normalizeClass($options.containerClass)
|
|
302
|
-
style: vue.normalizeStyle($props.style)
|
|
337
|
+
class: vue.normalizeClass($options.containerClass)
|
|
303
338
|
}, [
|
|
304
339
|
vue.createVNode(_component_PInputText, vue.mergeProps({
|
|
305
340
|
ref: "input",
|
|
306
|
-
|
|
307
|
-
style: $props.inputStyle,
|
|
341
|
+
id: $props.inputId,
|
|
308
342
|
type: $options.inputType,
|
|
343
|
+
class: $props.inputClass,
|
|
344
|
+
style: $props.inputStyle,
|
|
309
345
|
value: $props.modelValue,
|
|
346
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
347
|
+
"aria-label": _ctx.ariaLabel,
|
|
348
|
+
"aria-controls": ($props.panelProps&&$props.panelProps.id)||$props.panelId||$options.panelUniqueId,
|
|
349
|
+
"aria-expanded": $data.overlayVisible,
|
|
350
|
+
"aria-haspopup": true,
|
|
351
|
+
placeholder: $props.placeholder,
|
|
310
352
|
onInput: $options.onInput,
|
|
311
353
|
onFocus: $options.onFocus,
|
|
312
354
|
onBlur: $options.onBlur,
|
|
313
355
|
onKeyup: $options.onKeyUp
|
|
314
|
-
},
|
|
356
|
+
}, $props.inputProps), null, 16, ["id", "type", "class", "style", "value", "aria-labelledby", "aria-label", "aria-controls", "aria-expanded", "placeholder", "onInput", "onFocus", "onBlur", "onKeyup"]),
|
|
315
357
|
($props.toggleMask)
|
|
316
358
|
? (vue.openBlock(), vue.createElementBlock("i", {
|
|
317
359
|
key: 0,
|
|
@@ -319,6 +361,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
319
361
|
onClick: _cache[0] || (_cache[0] = (...args) => ($options.onMaskToggle && $options.onMaskToggle(...args)))
|
|
320
362
|
}, null, 2))
|
|
321
363
|
: vue.createCommentVNode("", true),
|
|
364
|
+
vue.createElementVNode("span", _hoisted_1, vue.toDisplayString($data.infoText), 1),
|
|
322
365
|
vue.createVNode(_component_Portal, { appendTo: $props.appendTo }, {
|
|
323
366
|
default: vue.withCtx(() => [
|
|
324
367
|
vue.createVNode(vue.Transition, {
|
|
@@ -329,24 +372,26 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
329
372
|
}, {
|
|
330
373
|
default: vue.withCtx(() => [
|
|
331
374
|
($data.overlayVisible)
|
|
332
|
-
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
375
|
+
? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
333
376
|
key: 0,
|
|
334
377
|
ref: $options.overlayRef,
|
|
335
|
-
|
|
378
|
+
id: $props.panelId||$options.panelUniqueId,
|
|
379
|
+
class: $options.panelStyleClass,
|
|
380
|
+
style: $props.panelStyle,
|
|
336
381
|
onClick: _cache[1] || (_cache[1] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
|
|
337
|
-
}, [
|
|
382
|
+
}, $props.panelProps), [
|
|
338
383
|
vue.renderSlot(_ctx.$slots, "header"),
|
|
339
384
|
vue.renderSlot(_ctx.$slots, "content", {}, () => [
|
|
340
|
-
vue.createElementVNode("div",
|
|
385
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
341
386
|
vue.createElementVNode("div", {
|
|
342
387
|
class: vue.normalizeClass($options.strengthClass),
|
|
343
388
|
style: vue.normalizeStyle({'width': $data.meter ? $data.meter.width : ''})
|
|
344
389
|
}, null, 6)
|
|
345
390
|
]),
|
|
346
|
-
vue.createElementVNode("div",
|
|
391
|
+
vue.createElementVNode("div", _hoisted_4, vue.toDisplayString($data.infoText), 1)
|
|
347
392
|
]),
|
|
348
393
|
vue.renderSlot(_ctx.$slots, "footer")
|
|
349
|
-
],
|
|
394
|
+
], 16, _hoisted_2))
|
|
350
395
|
: vue.createCommentVNode("", true)
|
|
351
396
|
]),
|
|
352
397
|
_: 3
|
|
@@ -354,7 +399,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
354
399
|
]),
|
|
355
400
|
_: 3
|
|
356
401
|
}, 8, ["appendTo"])
|
|
357
|
-
],
|
|
402
|
+
], 2))
|
|
358
403
|
}
|
|
359
404
|
|
|
360
405
|
function styleInject(css, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),l=require("primevue/inputtext"),n=require("primevue/portal"),i=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t),a=s(l),o=s(n),p={name:"Password",emits:["update:modelValue","change","focus","blur"],props:{modelValue:String,promptLabel:{type:String,default:null},mediumRegex:{type:String,default:"^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"},strongRegex:{type:String,default:"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})"},weakLabel:{type:String,default:null},mediumLabel:{type:String,default:null},strongLabel:{type:String,default:null},feedback:{type:Boolean,default:!0},appendTo:{type:String,default:"body"},toggleMask:{type:Boolean,default:!1},hideIcon:{type:String,default:"pi pi-eye-slash"},showIcon:{type:String,default:"pi pi-eye"},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},inputId:null,inputClass:null,inputStyle:null,inputProps:null,panelId:null,panelClass:null,panelStyle:null,panelProps:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({overlayVisible:!1,meter:null,infoText:null,focused:!1,unmasked:!1}),mediumCheckRegExp:null,strongCheckRegExp:null,resizeListener:null,scrollHandler:null,overlay:null,mounted(){this.infoText=this.promptText,this.mediumCheckRegExp=new RegExp(this.mediumRegex),this.strongCheckRegExp=new RegExp(this.strongRegex)},beforeUnmount(){this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(t){e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){"self"===this.appendTo?e.DomHandler.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(this.$refs.input.$el)+"px",e.DomHandler.absolutePosition(this.overlay,this.$refs.input.$el))},testStrength(e){let t=0;return this.strongCheckRegExp.test(e)?t=3:this.mediumCheckRegExp.test(e)?t=2:e.length&&(t=1),t},onInput(e){this.$emit("update:modelValue",e.target.value)},onFocus(e){this.focused=!0,this.feedback&&(this.overlayVisible=!0),this.$emit("focus",e)},onBlur(e){this.focused=!1,this.feedback&&(this.overlayVisible=!1),this.$emit("blur",e)},onKeyUp(e){if(this.feedback){const t=e.target.value;let l=null,n=null;switch(this.testStrength(t)){case 1:l=this.weakText,n={strength:"weak",width:"33.33%"};break;case 2:l=this.mediumText,n={strength:"medium",width:"66.66%"};break;case 3:l=this.strongText,n={strength:"strong",width:"100%"};break;default:l=this.promptText,n=null}if(this.meter=n,this.infoText=l,27===e.which)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.input.$el,(()=>{this.overlayVisible&&(this.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!e.DomHandler.isTouchDevice()&&(this.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},overlayRef(e){this.overlay=e},onMaskToggle(){this.unmasked=!this.unmasked},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-password p-component p-inputwrapper",{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-input-icon-right":this.toggleMask}]},inputFieldClass(){return["p-password-input",{"p-disabled":this.disabled}]},panelStyleClass(){return["p-password-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},toggleIconClass(){return this.unmasked?this.hideIcon:this.showIcon},strengthClass(){return`p-password-strength ${this.meter?this.meter.strength:""}`},inputType(){return this.unmasked?"text":"password"},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},weakText(){return this.weakLabel||this.$primevue.config.locale.weak},mediumText(){return this.mediumLabel||this.$primevue.config.locale.medium},strongText(){return this.strongLabel||this.$primevue.config.locale.strong},promptText(){return this.promptLabel||this.$primevue.config.locale.passwordPrompt},panelUniqueId:()=>e.UniqueComponentId()+"_panel"},components:{PInputText:a.default,Portal:o.default}};const d={class:"p-hidden-accessible","aria-live":"polite"},u=["id"],h={class:"p-password-meter"},c={class:"p-password-info"};!function(e,t){void 0===t&&(t={});var l=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===l&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-password {\n position: relative;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-password-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-password .p-password-panel {\n min-width: 100%;\n}\n.p-password-meter {\n height: 10px;\n}\n.p-password-strength {\n height: 100%;\n width: 0;\n -webkit-transition: width 1s ease-in-out;\n transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),p.render=function(e,t,l,n,s,r){const a=i.resolveComponent("PInputText"),o=i.resolveComponent("Portal");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(r.containerClass)},[i.createVNode(a,i.mergeProps({ref:"input",id:l.inputId,type:r.inputType,class:l.inputClass,style:l.inputStyle,value:l.modelValue,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-controls":l.panelProps&&l.panelProps.id||l.panelId||r.panelUniqueId,"aria-expanded":s.overlayVisible,"aria-haspopup":!0,placeholder:l.placeholder,onInput:r.onInput,onFocus:r.onFocus,onBlur:r.onBlur,onKeyup:r.onKeyUp},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","onInput","onFocus","onBlur","onKeyup"]),l.toggleMask?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(r.toggleIconClass),onClick:t[0]||(t[0]=(...e)=>r.onMaskToggle&&r.onMaskToggle(...e))},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",d,i.toDisplayString(s.infoText),1),i.createVNode(o,{appendTo:l.appendTo},{default:i.withCtx((()=>[i.createVNode(i.Transition,{name:"p-connected-overlay",onEnter:r.onOverlayEnter,onLeave:r.onOverlayLeave,onAfterLeave:r.onOverlayAfterLeave},{default:i.withCtx((()=>[s.overlayVisible?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,ref:r.overlayRef,id:l.panelId||r.panelUniqueId,class:r.panelStyleClass,style:l.panelStyle,onClick:t[1]||(t[1]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e))},l.panelProps),[i.renderSlot(e.$slots,"header"),i.renderSlot(e.$slots,"content",{},(()=>[i.createElementVNode("div",h,[i.createElementVNode("div",{class:i.normalizeClass(r.strengthClass),style:i.normalizeStyle({width:s.meter?s.meter.width:""})},null,6)]),i.createElementVNode("div",c,i.toDisplayString(s.infoText),1)])),i.renderSlot(e.$slots,"footer")],16,u)):i.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},module.exports=p;
|
package/password/password.esm.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ZIndexUtils, DomHandler, ConnectedOverlayScrollHandler } from 'primevue/utils';
|
|
1
|
+
import { ZIndexUtils, DomHandler, ConnectedOverlayScrollHandler, UniqueComponentId } from 'primevue/utils';
|
|
2
2
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
3
3
|
import InputText from 'primevue/inputtext';
|
|
4
4
|
import Portal from 'primevue/portal';
|
|
5
|
-
import { resolveComponent, openBlock, createElementBlock, normalizeClass,
|
|
5
|
+
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, createCommentVNode, createElementVNode, toDisplayString, withCtx, Transition, renderSlot, normalizeStyle } from 'vue';
|
|
6
6
|
|
|
7
7
|
var script = {
|
|
8
8
|
name: 'Password',
|
|
9
|
-
emits: ['update:modelValue'],
|
|
10
|
-
inheritAttrs: false,
|
|
9
|
+
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
|
11
10
|
props: {
|
|
12
11
|
modelValue: String,
|
|
13
12
|
promptLabel: {
|
|
@@ -54,11 +53,30 @@ var script = {
|
|
|
54
53
|
type: String,
|
|
55
54
|
default: 'pi pi-eye'
|
|
56
55
|
},
|
|
56
|
+
disabled: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
placeholder: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: null
|
|
63
|
+
},
|
|
64
|
+
inputId: null,
|
|
57
65
|
inputClass: null,
|
|
58
66
|
inputStyle: null,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
panelClass:
|
|
67
|
+
inputProps: null,
|
|
68
|
+
panelId: null,
|
|
69
|
+
panelClass: null,
|
|
70
|
+
panelStyle: null,
|
|
71
|
+
panelProps: null,
|
|
72
|
+
'aria-labelledby': {
|
|
73
|
+
type: String,
|
|
74
|
+
default: null
|
|
75
|
+
},
|
|
76
|
+
'aria-label': {
|
|
77
|
+
type: String,
|
|
78
|
+
default: null
|
|
79
|
+
}
|
|
62
80
|
},
|
|
63
81
|
data() {
|
|
64
82
|
return {
|
|
@@ -130,17 +148,21 @@ var script = {
|
|
|
130
148
|
onInput(event) {
|
|
131
149
|
this.$emit('update:modelValue', event.target.value);
|
|
132
150
|
},
|
|
133
|
-
onFocus() {
|
|
151
|
+
onFocus(event) {
|
|
134
152
|
this.focused = true;
|
|
135
153
|
if (this.feedback) {
|
|
136
154
|
this.overlayVisible = true;
|
|
137
155
|
}
|
|
156
|
+
|
|
157
|
+
this.$emit('focus', event);
|
|
138
158
|
},
|
|
139
|
-
onBlur() {
|
|
159
|
+
onBlur(event) {
|
|
140
160
|
this.focused = false;
|
|
141
161
|
if (this.feedback) {
|
|
142
162
|
this.overlayVisible = false;
|
|
143
163
|
}
|
|
164
|
+
|
|
165
|
+
this.$emit('blur', event);
|
|
144
166
|
},
|
|
145
167
|
onKeyUp(event) {
|
|
146
168
|
if (this.feedback) {
|
|
@@ -182,6 +204,12 @@ var script = {
|
|
|
182
204
|
this.meter = meter;
|
|
183
205
|
this.infoText = label;
|
|
184
206
|
|
|
207
|
+
//escape
|
|
208
|
+
if (event.which === 27) {
|
|
209
|
+
this.overlayVisible && (this.overlayVisible = false);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
185
213
|
if (!this.overlayVisible) {
|
|
186
214
|
this.overlayVisible = true;
|
|
187
215
|
}
|
|
@@ -234,15 +262,15 @@ var script = {
|
|
|
234
262
|
},
|
|
235
263
|
computed: {
|
|
236
264
|
containerClass() {
|
|
237
|
-
return ['p-password p-component p-inputwrapper',
|
|
265
|
+
return ['p-password p-component p-inputwrapper', {
|
|
238
266
|
'p-inputwrapper-filled': this.filled,
|
|
239
267
|
'p-inputwrapper-focus': this.focused,
|
|
240
268
|
'p-input-icon-right': this.toggleMask
|
|
241
269
|
}];
|
|
242
270
|
},
|
|
243
271
|
inputFieldClass() {
|
|
244
|
-
return ['p-password-input',
|
|
245
|
-
'p-disabled': this
|
|
272
|
+
return ['p-password-input', {
|
|
273
|
+
'p-disabled': this.disabled
|
|
246
274
|
}];
|
|
247
275
|
},
|
|
248
276
|
panelStyleClass() {
|
|
@@ -274,6 +302,9 @@ var script = {
|
|
|
274
302
|
},
|
|
275
303
|
promptText() {
|
|
276
304
|
return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
|
|
305
|
+
},
|
|
306
|
+
panelUniqueId() {
|
|
307
|
+
return UniqueComponentId() + '_panel';
|
|
277
308
|
}
|
|
278
309
|
},
|
|
279
310
|
components: {
|
|
@@ -282,28 +313,39 @@ var script = {
|
|
|
282
313
|
}
|
|
283
314
|
};
|
|
284
315
|
|
|
285
|
-
const _hoisted_1 = {
|
|
286
|
-
|
|
316
|
+
const _hoisted_1 = {
|
|
317
|
+
class: "p-hidden-accessible",
|
|
318
|
+
"aria-live": "polite"
|
|
319
|
+
};
|
|
320
|
+
const _hoisted_2 = ["id"];
|
|
321
|
+
const _hoisted_3 = { class: "p-password-meter" };
|
|
322
|
+
const _hoisted_4 = { class: "p-password-info" };
|
|
287
323
|
|
|
288
324
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
289
325
|
const _component_PInputText = resolveComponent("PInputText");
|
|
290
326
|
const _component_Portal = resolveComponent("Portal");
|
|
291
327
|
|
|
292
328
|
return (openBlock(), createElementBlock("div", {
|
|
293
|
-
class: normalizeClass($options.containerClass)
|
|
294
|
-
style: normalizeStyle($props.style)
|
|
329
|
+
class: normalizeClass($options.containerClass)
|
|
295
330
|
}, [
|
|
296
331
|
createVNode(_component_PInputText, mergeProps({
|
|
297
332
|
ref: "input",
|
|
298
|
-
|
|
299
|
-
style: $props.inputStyle,
|
|
333
|
+
id: $props.inputId,
|
|
300
334
|
type: $options.inputType,
|
|
335
|
+
class: $props.inputClass,
|
|
336
|
+
style: $props.inputStyle,
|
|
301
337
|
value: $props.modelValue,
|
|
338
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
339
|
+
"aria-label": _ctx.ariaLabel,
|
|
340
|
+
"aria-controls": ($props.panelProps&&$props.panelProps.id)||$props.panelId||$options.panelUniqueId,
|
|
341
|
+
"aria-expanded": $data.overlayVisible,
|
|
342
|
+
"aria-haspopup": true,
|
|
343
|
+
placeholder: $props.placeholder,
|
|
302
344
|
onInput: $options.onInput,
|
|
303
345
|
onFocus: $options.onFocus,
|
|
304
346
|
onBlur: $options.onBlur,
|
|
305
347
|
onKeyup: $options.onKeyUp
|
|
306
|
-
},
|
|
348
|
+
}, $props.inputProps), null, 16, ["id", "type", "class", "style", "value", "aria-labelledby", "aria-label", "aria-controls", "aria-expanded", "placeholder", "onInput", "onFocus", "onBlur", "onKeyup"]),
|
|
307
349
|
($props.toggleMask)
|
|
308
350
|
? (openBlock(), createElementBlock("i", {
|
|
309
351
|
key: 0,
|
|
@@ -311,6 +353,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
311
353
|
onClick: _cache[0] || (_cache[0] = (...args) => ($options.onMaskToggle && $options.onMaskToggle(...args)))
|
|
312
354
|
}, null, 2))
|
|
313
355
|
: createCommentVNode("", true),
|
|
356
|
+
createElementVNode("span", _hoisted_1, toDisplayString($data.infoText), 1),
|
|
314
357
|
createVNode(_component_Portal, { appendTo: $props.appendTo }, {
|
|
315
358
|
default: withCtx(() => [
|
|
316
359
|
createVNode(Transition, {
|
|
@@ -321,24 +364,26 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
321
364
|
}, {
|
|
322
365
|
default: withCtx(() => [
|
|
323
366
|
($data.overlayVisible)
|
|
324
|
-
? (openBlock(), createElementBlock("div", {
|
|
367
|
+
? (openBlock(), createElementBlock("div", mergeProps({
|
|
325
368
|
key: 0,
|
|
326
369
|
ref: $options.overlayRef,
|
|
327
|
-
|
|
370
|
+
id: $props.panelId||$options.panelUniqueId,
|
|
371
|
+
class: $options.panelStyleClass,
|
|
372
|
+
style: $props.panelStyle,
|
|
328
373
|
onClick: _cache[1] || (_cache[1] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
|
|
329
|
-
}, [
|
|
374
|
+
}, $props.panelProps), [
|
|
330
375
|
renderSlot(_ctx.$slots, "header"),
|
|
331
376
|
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
332
|
-
createElementVNode("div",
|
|
377
|
+
createElementVNode("div", _hoisted_3, [
|
|
333
378
|
createElementVNode("div", {
|
|
334
379
|
class: normalizeClass($options.strengthClass),
|
|
335
380
|
style: normalizeStyle({'width': $data.meter ? $data.meter.width : ''})
|
|
336
381
|
}, null, 6)
|
|
337
382
|
]),
|
|
338
|
-
createElementVNode("div",
|
|
383
|
+
createElementVNode("div", _hoisted_4, toDisplayString($data.infoText), 1)
|
|
339
384
|
]),
|
|
340
385
|
renderSlot(_ctx.$slots, "footer")
|
|
341
|
-
],
|
|
386
|
+
], 16, _hoisted_2))
|
|
342
387
|
: createCommentVNode("", true)
|
|
343
388
|
]),
|
|
344
389
|
_: 3
|
|
@@ -346,7 +391,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
346
391
|
]),
|
|
347
392
|
_: 3
|
|
348
393
|
}, 8, ["appendTo"])
|
|
349
|
-
],
|
|
394
|
+
], 2))
|
|
350
395
|
}
|
|
351
396
|
|
|
352
397
|
function styleInject(css, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ZIndexUtils as e,DomHandler as t,ConnectedOverlayScrollHandler as
|
|
1
|
+
import{ZIndexUtils as e,DomHandler as t,ConnectedOverlayScrollHandler as l,UniqueComponentId as i}from"primevue/utils";import n from"primevue/overlayeventbus";import s from"primevue/inputtext";import r from"primevue/portal";import{resolveComponent as a,openBlock as o,createElementBlock as p,normalizeClass as d,createVNode as u,mergeProps as h,createCommentVNode as c,createElementVNode as y,toDisplayString as m,withCtx as g,Transition as f,renderSlot as v,normalizeStyle as b}from"vue";var w={name:"Password",emits:["update:modelValue","change","focus","blur"],props:{modelValue:String,promptLabel:{type:String,default:null},mediumRegex:{type:String,default:"^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"},strongRegex:{type:String,default:"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})"},weakLabel:{type:String,default:null},mediumLabel:{type:String,default:null},strongLabel:{type:String,default:null},feedback:{type:Boolean,default:!0},appendTo:{type:String,default:"body"},toggleMask:{type:Boolean,default:!1},hideIcon:{type:String,default:"pi pi-eye-slash"},showIcon:{type:String,default:"pi pi-eye"},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},inputId:null,inputClass:null,inputStyle:null,inputProps:null,panelId:null,panelClass:null,panelStyle:null,panelProps:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({overlayVisible:!1,meter:null,infoText:null,focused:!1,unmasked:!1}),mediumCheckRegExp:null,strongCheckRegExp:null,resizeListener:null,scrollHandler:null,overlay:null,mounted(){this.infoText=this.promptText,this.mediumCheckRegExp=new RegExp(this.mediumRegex),this.strongCheckRegExp=new RegExp(this.strongRegex)},beforeUnmount(){this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(t){e.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(t){e.clear(t)},alignOverlay(){"self"===this.appendTo?t.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=t.getOuterWidth(this.$refs.input.$el)+"px",t.absolutePosition(this.overlay,this.$refs.input.$el))},testStrength(e){let t=0;return this.strongCheckRegExp.test(e)?t=3:this.mediumCheckRegExp.test(e)?t=2:e.length&&(t=1),t},onInput(e){this.$emit("update:modelValue",e.target.value)},onFocus(e){this.focused=!0,this.feedback&&(this.overlayVisible=!0),this.$emit("focus",e)},onBlur(e){this.focused=!1,this.feedback&&(this.overlayVisible=!1),this.$emit("blur",e)},onKeyUp(e){if(this.feedback){const t=e.target.value;let l=null,i=null;switch(this.testStrength(t)){case 1:l=this.weakText,i={strength:"weak",width:"33.33%"};break;case 2:l=this.mediumText,i={strength:"medium",width:"66.66%"};break;case 3:l=this.strongText,i={strength:"strong",width:"100%"};break;default:l=this.promptText,i=null}if(this.meter=i,this.infoText=l,27===e.which)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.$refs.input.$el,(()=>{this.overlayVisible&&(this.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!t.isTouchDevice()&&(this.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},overlayRef(e){this.overlay=e},onMaskToggle(){this.unmasked=!this.unmasked},onOverlayClick(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-password p-component p-inputwrapper",{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-input-icon-right":this.toggleMask}]},inputFieldClass(){return["p-password-input",{"p-disabled":this.disabled}]},panelStyleClass(){return["p-password-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},toggleIconClass(){return this.unmasked?this.hideIcon:this.showIcon},strengthClass(){return`p-password-strength ${this.meter?this.meter.strength:""}`},inputType(){return this.unmasked?"text":"password"},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},weakText(){return this.weakLabel||this.$primevue.config.locale.weak},mediumText(){return this.mediumLabel||this.$primevue.config.locale.medium},strongText(){return this.strongLabel||this.$primevue.config.locale.strong},promptText(){return this.promptLabel||this.$primevue.config.locale.passwordPrompt},panelUniqueId:()=>i()+"_panel"},components:{PInputText:s,Portal:r}};const x={class:"p-hidden-accessible","aria-live":"polite"},k=["id"],L={class:"p-password-meter"},S={class:"p-password-info"};!function(e,t){void 0===t&&(t={});var l=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===l&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-password {\n position: relative;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-password-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-password .p-password-panel {\n min-width: 100%;\n}\n.p-password-meter {\n height: 10px;\n}\n.p-password-strength {\n height: 100%;\n width: 0;\n -webkit-transition: width 1s ease-in-out;\n transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),w.render=function(e,t,l,i,n,s){const r=a("PInputText"),w=a("Portal");return o(),p("div",{class:d(s.containerClass)},[u(r,h({ref:"input",id:l.inputId,type:s.inputType,class:l.inputClass,style:l.inputStyle,value:l.modelValue,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-controls":l.panelProps&&l.panelProps.id||l.panelId||s.panelUniqueId,"aria-expanded":n.overlayVisible,"aria-haspopup":!0,placeholder:l.placeholder,onInput:s.onInput,onFocus:s.onFocus,onBlur:s.onBlur,onKeyup:s.onKeyUp},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","onInput","onFocus","onBlur","onKeyup"]),l.toggleMask?(o(),p("i",{key:0,class:d(s.toggleIconClass),onClick:t[0]||(t[0]=(...e)=>s.onMaskToggle&&s.onMaskToggle(...e))},null,2)):c("",!0),y("span",x,m(n.infoText),1),u(w,{appendTo:l.appendTo},{default:g((()=>[u(f,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:g((()=>[n.overlayVisible?(o(),p("div",h({key:0,ref:s.overlayRef,id:l.panelId||s.panelUniqueId,class:s.panelStyleClass,style:l.panelStyle,onClick:t[1]||(t[1]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e))},l.panelProps),[v(e.$slots,"header"),v(e.$slots,"content",{},(()=>[y("div",L,[y("div",{class:d(s.strengthClass),style:b({width:n.meter?n.meter.width:""})},null,6)]),y("div",S,m(n.infoText),1)])),v(e.$slots,"footer")],16,k)):c("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)};export{w as default};
|