primevue 3.24.0 → 3.26.0

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.
Files changed (212) hide show
  1. package/README.md +64 -176
  2. package/api/Api.d.ts +284 -292
  3. package/autocomplete/AutoComplete.d.ts +5 -5
  4. package/autocomplete/AutoComplete.vue +5 -5
  5. package/autocomplete/autocomplete.cjs.js +5 -5
  6. package/autocomplete/autocomplete.cjs.min.js +1 -1
  7. package/autocomplete/autocomplete.esm.js +5 -5
  8. package/autocomplete/autocomplete.esm.min.js +1 -1
  9. package/autocomplete/autocomplete.js +5 -5
  10. package/autocomplete/autocomplete.min.js +1 -1
  11. package/blockui/BlockUI.d.ts +2 -0
  12. package/calendar/Calendar.d.ts +4 -4
  13. package/calendar/Calendar.vue +71 -17
  14. package/calendar/calendar.cjs.js +58 -20
  15. package/calendar/calendar.cjs.min.js +1 -1
  16. package/calendar/calendar.esm.js +58 -20
  17. package/calendar/calendar.esm.min.js +1 -1
  18. package/calendar/calendar.js +58 -20
  19. package/calendar/calendar.min.js +1 -1
  20. package/cascadeselect/CascadeSelect.d.ts +4 -4
  21. package/cascadeselect/CascadeSelect.vue +4 -4
  22. package/cascadeselect/cascadeselect.cjs.js +4 -4
  23. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  24. package/cascadeselect/cascadeselect.esm.js +4 -4
  25. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  26. package/cascadeselect/cascadeselect.js +4 -4
  27. package/cascadeselect/cascadeselect.min.js +1 -1
  28. package/checkbox/Checkbox.d.ts +2 -2
  29. package/checkbox/Checkbox.vue +2 -2
  30. package/checkbox/checkbox.cjs.js +2 -2
  31. package/checkbox/checkbox.cjs.min.js +1 -1
  32. package/checkbox/checkbox.esm.js +2 -2
  33. package/checkbox/checkbox.esm.min.js +1 -1
  34. package/checkbox/checkbox.js +2 -2
  35. package/checkbox/checkbox.min.js +1 -1
  36. package/chips/Chips.d.ts +4 -3
  37. package/chips/Chips.vue +2 -2
  38. package/chips/chips.cjs.js +2 -2
  39. package/chips/chips.cjs.min.js +1 -1
  40. package/chips/chips.esm.js +2 -2
  41. package/chips/chips.esm.min.js +1 -1
  42. package/chips/chips.js +2 -2
  43. package/chips/chips.min.js +1 -1
  44. package/column/Column.d.ts +9 -0
  45. package/confirmationoptions/ConfirmationOptions.d.ts +1 -0
  46. package/confirmdialog/ConfirmDialog.d.ts +5 -0
  47. package/confirmdialog/ConfirmDialog.vue +17 -1
  48. package/confirmdialog/confirmdialog.cjs.js +7 -2
  49. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  50. package/confirmdialog/confirmdialog.esm.js +7 -2
  51. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  52. package/confirmdialog/confirmdialog.js +7 -2
  53. package/confirmdialog/confirmdialog.min.js +1 -1
  54. package/confirmpopup/ConfirmPopup.vue +3 -0
  55. package/confirmpopup/confirmpopup.cjs.js +3 -0
  56. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  57. package/confirmpopup/confirmpopup.esm.js +3 -0
  58. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  59. package/confirmpopup/confirmpopup.js +3 -0
  60. package/confirmpopup/confirmpopup.min.js +1 -1
  61. package/core/core.js +22 -15
  62. package/core/core.min.js +4 -4
  63. package/datatable/DataTable.d.ts +9 -9
  64. package/datatable/FooterCell.vue +2 -2
  65. package/datatable/TableBody.vue +6 -1
  66. package/datatable/datatable.cjs.js +8 -3
  67. package/datatable/datatable.cjs.min.js +1 -1
  68. package/datatable/datatable.esm.js +8 -3
  69. package/datatable/datatable.esm.min.js +1 -1
  70. package/datatable/datatable.js +8 -3
  71. package/datatable/datatable.min.js +1 -1
  72. package/dialog/Dialog.vue +24 -7
  73. package/dialog/dialog.cjs.js +14 -7
  74. package/dialog/dialog.cjs.min.js +1 -1
  75. package/dialog/dialog.esm.js +14 -7
  76. package/dialog/dialog.esm.min.js +1 -1
  77. package/dialog/dialog.js +14 -7
  78. package/dialog/dialog.min.js +1 -1
  79. package/dropdown/Dropdown.d.ts +10 -4
  80. package/dropdown/Dropdown.vue +5 -5
  81. package/dropdown/dropdown.cjs.js +5 -5
  82. package/dropdown/dropdown.cjs.min.js +1 -1
  83. package/dropdown/dropdown.esm.js +5 -5
  84. package/dropdown/dropdown.esm.min.js +1 -1
  85. package/dropdown/dropdown.js +5 -5
  86. package/dropdown/dropdown.min.js +1 -1
  87. package/dynamicdialog/DynamicDialog.vue +1 -1
  88. package/dynamicdialog/dynamicdialog.cjs.js +1 -1
  89. package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
  90. package/dynamicdialog/dynamicdialog.esm.js +2 -2
  91. package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
  92. package/dynamicdialog/dynamicdialog.js +1 -1
  93. package/dynamicdialog/dynamicdialog.min.js +1 -1
  94. package/editor/Editor.d.ts +1 -0
  95. package/inplace/Inplace.vue +5 -1
  96. package/inplace/inplace.cjs.js +10 -2
  97. package/inplace/inplace.cjs.min.js +1 -1
  98. package/inplace/inplace.esm.js +10 -3
  99. package/inplace/inplace.esm.min.js +1 -1
  100. package/inplace/inplace.js +11 -4
  101. package/inplace/inplace.min.js +1 -1
  102. package/inputmask/InputMask.vue +59 -49
  103. package/inputmask/inputmask.cjs.js +59 -49
  104. package/inputmask/inputmask.cjs.min.js +1 -1
  105. package/inputmask/inputmask.esm.js +59 -49
  106. package/inputmask/inputmask.esm.min.js +1 -1
  107. package/inputmask/inputmask.js +59 -49
  108. package/inputmask/inputmask.min.js +1 -1
  109. package/inputnumber/InputNumber.d.ts +2 -2
  110. package/inputnumber/InputNumber.vue +2 -2
  111. package/inputnumber/inputnumber.cjs.js +2 -2
  112. package/inputnumber/inputnumber.cjs.min.js +1 -1
  113. package/inputnumber/inputnumber.esm.js +2 -2
  114. package/inputnumber/inputnumber.esm.min.js +1 -1
  115. package/inputnumber/inputnumber.js +2 -2
  116. package/inputnumber/inputnumber.min.js +1 -1
  117. package/inputswitch/InputSwitch.d.ts +3 -2
  118. package/inputswitch/InputSwitch.vue +2 -2
  119. package/inputswitch/inputswitch.cjs.js +2 -2
  120. package/inputswitch/inputswitch.cjs.min.js +1 -1
  121. package/inputswitch/inputswitch.esm.js +2 -2
  122. package/inputswitch/inputswitch.esm.min.js +1 -1
  123. package/inputswitch/inputswitch.js +2 -2
  124. package/inputswitch/inputswitch.min.js +1 -1
  125. package/menuitem/MenuItem.d.ts +1 -1
  126. package/organizationchart/OrganizationChart.d.ts +3 -2
  127. package/package.json +1 -1
  128. package/panel/Panel.d.ts +4 -2
  129. package/password/Password.d.ts +4 -4
  130. package/password/Password.vue +4 -4
  131. package/password/password.cjs.js +4 -4
  132. package/password/password.cjs.min.js +1 -1
  133. package/password/password.esm.js +4 -4
  134. package/password/password.esm.min.js +1 -1
  135. package/password/password.js +4 -4
  136. package/password/password.min.js +1 -1
  137. package/portal/Portal.d.ts +1 -0
  138. package/radiobutton/RadioButton.d.ts +3 -2
  139. package/radiobutton/RadioButton.vue +2 -2
  140. package/radiobutton/radiobutton.cjs.js +2 -2
  141. package/radiobutton/radiobutton.cjs.min.js +1 -1
  142. package/radiobutton/radiobutton.esm.js +2 -2
  143. package/radiobutton/radiobutton.esm.min.js +1 -1
  144. package/radiobutton/radiobutton.js +2 -2
  145. package/radiobutton/radiobutton.min.js +1 -1
  146. package/row/Row.d.ts +1 -1
  147. package/selectbutton/SelectButton.d.ts +1 -1
  148. package/selectbutton/SelectButton.vue +2 -2
  149. package/selectbutton/selectbutton.cjs.js +2 -2
  150. package/selectbutton/selectbutton.cjs.min.js +1 -1
  151. package/selectbutton/selectbutton.esm.js +2 -2
  152. package/selectbutton/selectbutton.esm.min.js +1 -1
  153. package/selectbutton/selectbutton.js +2 -2
  154. package/selectbutton/selectbutton.min.js +1 -1
  155. package/slider/Slider.vue +3 -14
  156. package/slider/slider.cjs.js +3 -14
  157. package/slider/slider.cjs.min.js +1 -1
  158. package/slider/slider.esm.js +3 -14
  159. package/slider/slider.esm.min.js +1 -1
  160. package/slider/slider.js +3 -14
  161. package/slider/slider.min.js +1 -1
  162. package/splitbutton/SplitButton.vue +4 -2
  163. package/splitbutton/splitbutton.cjs.js +6 -4
  164. package/splitbutton/splitbutton.cjs.min.js +1 -1
  165. package/splitbutton/splitbutton.esm.js +6 -4
  166. package/splitbutton/splitbutton.esm.min.js +1 -1
  167. package/splitbutton/splitbutton.js +6 -4
  168. package/splitbutton/splitbutton.min.js +1 -1
  169. package/textarea/Textarea.d.ts +1 -0
  170. package/tieredmenu/TieredMenu.d.ts +2 -0
  171. package/toast/Toast.d.ts +0 -1
  172. package/togglebutton/ToggleButton.d.ts +2 -2
  173. package/togglebutton/ToggleButton.vue +2 -2
  174. package/togglebutton/togglebutton.cjs.js +2 -2
  175. package/togglebutton/togglebutton.cjs.min.js +1 -1
  176. package/togglebutton/togglebutton.esm.js +2 -2
  177. package/togglebutton/togglebutton.esm.min.js +1 -1
  178. package/togglebutton/togglebutton.js +2 -2
  179. package/togglebutton/togglebutton.min.js +1 -1
  180. package/tooltip/tooltip.cjs.js +1 -1
  181. package/tooltip/tooltip.cjs.min.js +1 -1
  182. package/tooltip/tooltip.esm.js +1 -1
  183. package/tooltip/tooltip.esm.min.js +1 -1
  184. package/tooltip/tooltip.js +1 -1
  185. package/tooltip/tooltip.min.js +1 -1
  186. package/tree/Tree.d.ts +3 -0
  187. package/treeselect/TreeSelect.d.ts +2 -2
  188. package/treeselect/TreeSelect.vue +3 -3
  189. package/treeselect/treeselect.cjs.js +3 -3
  190. package/treeselect/treeselect.cjs.min.js +1 -1
  191. package/treeselect/treeselect.esm.js +3 -3
  192. package/treeselect/treeselect.esm.min.js +1 -1
  193. package/treeselect/treeselect.js +3 -3
  194. package/treeselect/treeselect.min.js +1 -1
  195. package/treetable/TreeTable.d.ts +2 -0
  196. package/treetable/TreeTable.vue +3 -3
  197. package/treetable/treetable.cjs.js +3 -3
  198. package/treetable/treetable.cjs.min.js +1 -1
  199. package/treetable/treetable.esm.js +3 -3
  200. package/treetable/treetable.esm.min.js +1 -1
  201. package/treetable/treetable.js +3 -3
  202. package/treetable/treetable.min.js +1 -1
  203. package/tristatecheckbox/TriStateCheckbox.vue +1 -1
  204. package/tristatecheckbox/tristatecheckbox.cjs.js +1 -1
  205. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  206. package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
  207. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  208. package/tristatecheckbox/tristatecheckbox.js +1 -1
  209. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  210. package/vetur-attributes.json +32 -28
  211. package/vetur-tags.json +2 -1
  212. package/web-types.json +40 -30
@@ -120,11 +120,11 @@ this.primevue.inputnumber = (function (Button, InputText, utils, vue) {
120
120
  default: null
121
121
  },
122
122
  inputClass: {
123
- type: String,
123
+ type: [String, Object],
124
124
  default: null
125
125
  },
126
126
  inputStyle: {
127
- type: null,
127
+ type: Object,
128
128
  default: null
129
129
  },
130
130
  inputProps: {
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.inputnumber=function(e,t,n,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e),u={name:"InputNumber",emits:["update:modelValue","input","focus","blur"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},highlightOnFocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},incrementButtonProps:{type:null,default:null},decrementButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data(){return{d_modelValue:this.modelValue,focused:!1}},watch:{modelValue(e){this.d_modelValue=e},locale(e,t){this.updateConstructParser(e,t)},localeMatcher(e,t){this.updateConstructParser(e,t)},mode(e,t){this.updateConstructParser(e,t)},currency(e,t){this.updateConstructParser(e,t)},currencyDisplay(e,t){this.updateConstructParser(e,t)},useGrouping(e,t){this.updateConstructParser(e,t)},minFractionDigits(e,t){this.updateConstructParser(e,t)},maxFractionDigits(e,t){this.updateConstructParser(e,t)},suffix(e,t){this.updateConstructParser(e,t)},prefix(e,t){this.updateConstructParser(e,t)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const e=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),t=new Map(e.map(((e,t)=>[e,t])));this._numeral=new RegExp(`[${e.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=e=>t.get(e)},updateConstructParser(e,t){e!==t&&this.constructParser()},escapeRegExp:e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const e=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${e.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=e.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${e.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const e=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${e.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=e.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=e.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(e){if(null!=e){if("-"===e)return e;if(this.format){let t=new Intl.NumberFormat(this.locale,this.getOptions()).format(e);return this.prefix&&(t=this.prefix+t),this.suffix&&(t+=this.suffix),t}return e.toString()}return""},parseValue(e){let t=e.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(t){if("-"===t)return t;let e=+t;return isNaN(e)?null:e}return null},repeat(e,t,n){if(this.readonly)return;let i=t||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(e,40,n)}),i),this.spin(e,n)},spin(e,t){if(this.$refs.input){let n=this.step*t,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(e,s),this.handleOnInput(e,i,s)}},onUpButtonMouseDown(e){this.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,1),e.preventDefault())},onUpButtonMouseUp(){this.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.disabled||this.clearTimer()},onUpButtonKeyUp(){this.disabled||this.clearTimer()},onUpButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)},onDownButtonMouseDown(e){this.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,-1),e.preventDefault())},onDownButtonMouseUp(){this.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.disabled||this.clearTimer()},onDownButtonKeyUp(){this.disabled||this.clearTimer()},onDownButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(e){if(this.readonly)return;if(this.lastValue=e.target.value,e.shiftKey||e.altKey)return void(this.isSpecialChar=!0);let t=e.target.selectionStart,n=e.target.selectionEnd,i=e.target.value,s=null;switch(e.altKey&&e.preventDefault(),e.code){case"ArrowUp":this.spin(e,1),e.preventDefault();break;case"ArrowDown":this.spin(e,-1),e.preventDefault();break;case"ArrowLeft":this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case"ArrowRight":this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case"Tab":case"Enter":s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(e,s);break;case"Backspace":if(e.preventDefault(),t===n){const n=i.charAt(t-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t-2)+i.slice(t-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t-1,t-1):s=i.slice(0,t-1)+i.slice(t);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t-1)+n+i.slice(t)}else 1===u?(s=i.slice(0,t-1)+"0"+i.slice(t),s=this.parseValue(s)>0?s:""):s=i.slice(0,t-1)+i.slice(t)}this.updateValue(e,s,null,"delete-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case"Delete":if(e.preventDefault(),t===n){const n=i.charAt(t),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t)+i.slice(t+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t+1,t+1):s=i.slice(0,t)+i.slice(t+1);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t)+n+i.slice(t+1)}else 1===u?(s=i.slice(0,t)+"0"+i.slice(t+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,t)+i.slice(t+1)}this.updateValue(e,s,null,"delete-back-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case"Home":this.min&&(this.updateModel(e,this.min),e.preventDefault());break;case"End":this.max&&(this.updateModel(e,this.max),e.preventDefault())}},onInputKeyPress(e){if(this.readonly)return;e.preventDefault();let t=e.which||e.keyCode,n=String.fromCharCode(t);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=t&&t<=57||s||i)&&this.insert(e,n,{isDecimalSign:i,isMinusSign:s})},onPaste(e){e.preventDefault();let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.parseValue(t);null!=n&&this.insert(e,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(e){return!(!this._minusSign.test(e)&&"-"!==e)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(e){return!!this._decimal.test(e)&&(this._decimal.lastIndex=0,!0)},isDecimalMode(){return"decimal"===this.mode},getDecimalCharIndexes(e){let t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:t,decimalCharIndexWithoutPrefix:n}},getCharIndexes(e){const t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.search(this._minusSign);this._minusSign.lastIndex=0;const i=e.search(this._suffix);this._suffix.lastIndex=0;const s=e.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:t,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:s}},insert(e,t,n={isDecimalSign:!1,isMinusSign:!1}){const i=t.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const{decimalCharIndex:l,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(u);let h;if(n.isMinusSign)0===s&&(h=u,-1!==a&&0===r||(h=this.insertText(u,t,0,r)),this.updateValue(e,h,t,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(e,u,t,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(h=this.insertText(u,t,s,r),this.updateValue(e,h,t,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(l>0&&s>l){if(s+t.length-(l+1)<=n){const n=p>=s?p-1:o>=s?o:u.length;h=u.slice(0,s)+t+u.slice(s+t.length,n)+u.slice(n),this.updateValue(e,h,t,i)}}else h=this.insertText(u,t,s,r),this.updateValue(e,h,t,i)}},insertText(e,t,n,i){if(2===("."===t?t:t.split(".")).length){const s=e.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?e.slice(0,n)+this.formatValue(t)+e.slice(i):e||this.formatValue(t)}return i-n===e.length?this.formatValue(t):0===n?t+e.slice(i):i===e.length?e.slice(0,n)+t:e.slice(0,n)+t+e.slice(i)},deleteRange(e,t,n){let i;return i=n-t===e.length?"":0===t?e.slice(n):n===e.length?e.slice(0,t):e.slice(0,t)+e.slice(n),i},initCursor(){let e=this.$refs.input.$el.selectionStart,t=this.$refs.input.$el.value,n=t.length,i=null,s=(this.prefixChar||"").length;t=t.replace(this._prefix,""),e-=s;let r=t.charAt(e);if(this.isNumeralChar(r))return e+s;let u=e-1;for(;u>=0;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(u=e;u<n;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){const e=this.$refs.input.$el.value;this.readonly||e===n.DomHandler.getSelection()||this.initCursor()},isNumeralChar(e){return!(1!==e.length||!(this._numeral.test(e)||this._decimal.test(e)||this._group.test(e)||this._minusSign.test(e)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(e,t,n,i){let s=this.$refs.input.$el.value,r=null;null!=t&&(r=this.parseValue(t),r=r||this.allowEmpty?r:0,this.updateInput(r,n,i,t),this.handleOnInput(e,s,r))},handleOnInput(e,t,n){this.isValueChanged(t,n)&&this.$emit("input",{originalEvent:e,value:n,formattedValue:t})},isValueChanged(e,t){if(null===t&&null!==e)return!0;if(null!=t){return t!==("string"==typeof e?this.parseValue(e):e)}return!1},validateValue(e){return"-"===e||null==e?null:null!=this.min&&e<this.min?this.min:null!=this.max&&e>this.max?this.max:e},updateInput(e,t,n,i){t=t||"";let s=this.$refs.input.$el.value,r=this.formatValue(e),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length;this.$refs.input.$el.setSelectionRange(e,e)}else{let e=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,e)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=t.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let e=s.charAt(i-1),t=s.charAt(i),n=u-l,r=this._group.test(t);r&&1===n?i+=1:!r&&this.isNumeralChar(e)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else if("-"===s&&"insert"===n){this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length+1;this.$refs.input.$el.setSelectionRange(e,e)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",e)},concatValues(e,t){if(e&&t){let n=t.search(this._decimal);return this._decimal.lastIndex=0,this.suffixChar?e.replace(this.suffixChar,"").split(this._decimal)[0]+t.replace(this.suffixChar,"").slice(n)+this.suffixChar:-1!==n?e.split(this._decimal)[0]+t.slice(n):e}return e},getDecimalLength(e){if(e){const t=e.split(this._decimal);if(2===t.length)return t[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(e,t){this.d_modelValue=t,this.$emit("update:modelValue",t)},onInputFocus(e){this.focused=!0,this.disabled||this.readonly||this.$refs.input.$el.value===n.DomHandler.getSelection()||!this.highlightOnFocus||e.target.select(),this.$emit("focus",e)},onInputBlur(e){this.focused=!1;let t=e.target,n=this.validateValue(this.parseValue(t.value));this.$emit("blur",{originalEvent:e,value:t.value}),t.value=this.formatValue(n),t.setAttribute("aria-valuenow",n),this.updateModel(e,n)},clearTimer(){this.timer&&clearInterval(this.timer)},maxBoundry(){return this.d_modelValue>=this.max},minBoundry(){return this.d_modelValue<=this.min}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass,{"p-disabled":this.showButtons&&null!==this.max&&this.maxBoundry()}]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass,{"p-disabled":this.showButtons&&null!==this.min&&this.minBoundry()}]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:e=>this.onUpButtonMouseDown(e),mouseup:e=>this.onUpButtonMouseUp(e),mouseleave:e=>this.onUpButtonMouseLeave(e),keydown:e=>this.onUpButtonKeyDown(e),keyup:e=>this.onUpButtonKeyUp(e)}},downButtonListeners(){return{mousedown:e=>this.onDownButtonMouseDown(e),mouseup:e=>this.onDownButtonMouseUp(e),mouseleave:e=>this.onDownButtonMouseLeave(e),keydown:e=>this.onDownButtonKeyDown(e),keyup:e=>this.onDownButtonKeyUp(e)}},formattedValue(){const e=this.modelValue||this.allowEmpty?this.modelValue:0;return this.formatValue(e)},getFormatter(){return this.numberFormat}},components:{INInputText:s(t).default,INButton:r.default}};const l={key:0,class:"p-inputnumber-button-group"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-inputnumber {\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label,\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label {\n display: none;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: flex;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),u.render=function(e,t,n,s,r,u){const a=i.resolveComponent("INInputText"),o=i.resolveComponent("INButton");return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass(u.containerClass)},[i.createVNode(a,i.mergeProps({ref:"input",id:n.inputId,class:["p-inputnumber-input",n.inputClass],role:"spinbutton",style:n.inputStyle,value:u.formattedValue,"aria-valuemin":n.min,"aria-valuemax":n.max,"aria-valuenow":n.modelValue,disabled:n.disabled,readonly:n.readonly,placeholder:n.placeholder,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onInput:u.onUserInput,onKeydown:u.onInputKeyDown,onKeypress:u.onInputKeyPress,onPaste:u.onPaste,onClick:u.onInputClick,onFocus:u.onInputFocus,onBlur:u.onInputBlur},n.inputProps),null,16,["id","class","style","value","aria-valuemin","aria-valuemax","aria-valuenow","disabled","readonly","placeholder","aria-labelledby","aria-label","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),n.showButtons&&"stacked"===n.buttonLayout?(i.openBlock(),i.createElementBlock("span",l,[i.createVNode(o,i.mergeProps({class:u.upButtonClass,icon:n.incrementButtonIcon},i.toHandlers(u.upButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.incrementButtonProps),null,16,["class","icon","disabled"]),i.createVNode(o,i.mergeProps({class:u.downButtonClass,icon:n.decrementButtonIcon},i.toHandlers(u.downButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.decrementButtonProps),null,16,["class","icon","disabled"])])):i.createCommentVNode("",!0),n.showButtons&&"stacked"!==n.buttonLayout?(i.openBlock(),i.createBlock(o,i.mergeProps({key:1,class:u.upButtonClass,icon:n.incrementButtonIcon},i.toHandlers(u.upButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.incrementButtonProps),null,16,["class","icon","disabled"])):i.createCommentVNode("",!0),n.showButtons&&"stacked"!==n.buttonLayout?(i.openBlock(),i.createBlock(o,i.mergeProps({key:2,class:u.downButtonClass,icon:n.decrementButtonIcon},i.toHandlers(u.downButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.decrementButtonProps),null,16,["class","icon","disabled"])):i.createCommentVNode("",!0)],2)},u}(primevue.button,primevue.inputtext,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.inputnumber=function(e,t,n,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e),u={name:"InputNumber",emits:["update:modelValue","input","focus","blur"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},highlightOnFocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},incrementButtonProps:{type:null,default:null},decrementButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data(){return{d_modelValue:this.modelValue,focused:!1}},watch:{modelValue(e){this.d_modelValue=e},locale(e,t){this.updateConstructParser(e,t)},localeMatcher(e,t){this.updateConstructParser(e,t)},mode(e,t){this.updateConstructParser(e,t)},currency(e,t){this.updateConstructParser(e,t)},currencyDisplay(e,t){this.updateConstructParser(e,t)},useGrouping(e,t){this.updateConstructParser(e,t)},minFractionDigits(e,t){this.updateConstructParser(e,t)},maxFractionDigits(e,t){this.updateConstructParser(e,t)},suffix(e,t){this.updateConstructParser(e,t)},prefix(e,t){this.updateConstructParser(e,t)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const e=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),t=new Map(e.map(((e,t)=>[e,t])));this._numeral=new RegExp(`[${e.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=e=>t.get(e)},updateConstructParser(e,t){e!==t&&this.constructParser()},escapeRegExp:e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const e=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${e.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=e.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${e.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const e=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${e.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=e.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=e.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(e){if(null!=e){if("-"===e)return e;if(this.format){let t=new Intl.NumberFormat(this.locale,this.getOptions()).format(e);return this.prefix&&(t=this.prefix+t),this.suffix&&(t+=this.suffix),t}return e.toString()}return""},parseValue(e){let t=e.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(t){if("-"===t)return t;let e=+t;return isNaN(e)?null:e}return null},repeat(e,t,n){if(this.readonly)return;let i=t||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(e,40,n)}),i),this.spin(e,n)},spin(e,t){if(this.$refs.input){let n=this.step*t,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(e,s),this.handleOnInput(e,i,s)}},onUpButtonMouseDown(e){this.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,1),e.preventDefault())},onUpButtonMouseUp(){this.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.disabled||this.clearTimer()},onUpButtonKeyUp(){this.disabled||this.clearTimer()},onUpButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)},onDownButtonMouseDown(e){this.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,-1),e.preventDefault())},onDownButtonMouseUp(){this.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.disabled||this.clearTimer()},onDownButtonKeyUp(){this.disabled||this.clearTimer()},onDownButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(e){if(this.readonly)return;if(this.lastValue=e.target.value,e.shiftKey||e.altKey)return void(this.isSpecialChar=!0);let t=e.target.selectionStart,n=e.target.selectionEnd,i=e.target.value,s=null;switch(e.altKey&&e.preventDefault(),e.code){case"ArrowUp":this.spin(e,1),e.preventDefault();break;case"ArrowDown":this.spin(e,-1),e.preventDefault();break;case"ArrowLeft":this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case"ArrowRight":this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case"Tab":case"Enter":s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(e,s);break;case"Backspace":if(e.preventDefault(),t===n){const n=i.charAt(t-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t-2)+i.slice(t-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t-1,t-1):s=i.slice(0,t-1)+i.slice(t);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t-1)+n+i.slice(t)}else 1===u?(s=i.slice(0,t-1)+"0"+i.slice(t),s=this.parseValue(s)>0?s:""):s=i.slice(0,t-1)+i.slice(t)}this.updateValue(e,s,null,"delete-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case"Delete":if(e.preventDefault(),t===n){const n=i.charAt(t),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t)+i.slice(t+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t+1,t+1):s=i.slice(0,t)+i.slice(t+1);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t)+n+i.slice(t+1)}else 1===u?(s=i.slice(0,t)+"0"+i.slice(t+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,t)+i.slice(t+1)}this.updateValue(e,s,null,"delete-back-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case"Home":this.min&&(this.updateModel(e,this.min),e.preventDefault());break;case"End":this.max&&(this.updateModel(e,this.max),e.preventDefault())}},onInputKeyPress(e){if(this.readonly)return;e.preventDefault();let t=e.which||e.keyCode,n=String.fromCharCode(t);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=t&&t<=57||s||i)&&this.insert(e,n,{isDecimalSign:i,isMinusSign:s})},onPaste(e){e.preventDefault();let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.parseValue(t);null!=n&&this.insert(e,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(e){return!(!this._minusSign.test(e)&&"-"!==e)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(e){return!!this._decimal.test(e)&&(this._decimal.lastIndex=0,!0)},isDecimalMode(){return"decimal"===this.mode},getDecimalCharIndexes(e){let t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:t,decimalCharIndexWithoutPrefix:n}},getCharIndexes(e){const t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.search(this._minusSign);this._minusSign.lastIndex=0;const i=e.search(this._suffix);this._suffix.lastIndex=0;const s=e.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:t,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:s}},insert(e,t,n={isDecimalSign:!1,isMinusSign:!1}){const i=t.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const{decimalCharIndex:l,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(u);let h;if(n.isMinusSign)0===s&&(h=u,-1!==a&&0===r||(h=this.insertText(u,t,0,r)),this.updateValue(e,h,t,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(e,u,t,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(h=this.insertText(u,t,s,r),this.updateValue(e,h,t,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(l>0&&s>l){if(s+t.length-(l+1)<=n){const n=p>=s?p-1:o>=s?o:u.length;h=u.slice(0,s)+t+u.slice(s+t.length,n)+u.slice(n),this.updateValue(e,h,t,i)}}else h=this.insertText(u,t,s,r),this.updateValue(e,h,t,i)}},insertText(e,t,n,i){if(2===("."===t?t:t.split(".")).length){const s=e.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?e.slice(0,n)+this.formatValue(t)+e.slice(i):e||this.formatValue(t)}return i-n===e.length?this.formatValue(t):0===n?t+e.slice(i):i===e.length?e.slice(0,n)+t:e.slice(0,n)+t+e.slice(i)},deleteRange(e,t,n){let i;return i=n-t===e.length?"":0===t?e.slice(n):n===e.length?e.slice(0,t):e.slice(0,t)+e.slice(n),i},initCursor(){let e=this.$refs.input.$el.selectionStart,t=this.$refs.input.$el.value,n=t.length,i=null,s=(this.prefixChar||"").length;t=t.replace(this._prefix,""),e-=s;let r=t.charAt(e);if(this.isNumeralChar(r))return e+s;let u=e-1;for(;u>=0;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(u=e;u<n;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){const e=this.$refs.input.$el.value;this.readonly||e===n.DomHandler.getSelection()||this.initCursor()},isNumeralChar(e){return!(1!==e.length||!(this._numeral.test(e)||this._decimal.test(e)||this._group.test(e)||this._minusSign.test(e)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(e,t,n,i){let s=this.$refs.input.$el.value,r=null;null!=t&&(r=this.parseValue(t),r=r||this.allowEmpty?r:0,this.updateInput(r,n,i,t),this.handleOnInput(e,s,r))},handleOnInput(e,t,n){this.isValueChanged(t,n)&&this.$emit("input",{originalEvent:e,value:n,formattedValue:t})},isValueChanged(e,t){if(null===t&&null!==e)return!0;if(null!=t){return t!==("string"==typeof e?this.parseValue(e):e)}return!1},validateValue(e){return"-"===e||null==e?null:null!=this.min&&e<this.min?this.min:null!=this.max&&e>this.max?this.max:e},updateInput(e,t,n,i){t=t||"";let s=this.$refs.input.$el.value,r=this.formatValue(e),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length;this.$refs.input.$el.setSelectionRange(e,e)}else{let e=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,e)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=t.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let e=s.charAt(i-1),t=s.charAt(i),n=u-l,r=this._group.test(t);r&&1===n?i+=1:!r&&this.isNumeralChar(e)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else if("-"===s&&"insert"===n){this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length+1;this.$refs.input.$el.setSelectionRange(e,e)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",e)},concatValues(e,t){if(e&&t){let n=t.search(this._decimal);return this._decimal.lastIndex=0,this.suffixChar?e.replace(this.suffixChar,"").split(this._decimal)[0]+t.replace(this.suffixChar,"").slice(n)+this.suffixChar:-1!==n?e.split(this._decimal)[0]+t.slice(n):e}return e},getDecimalLength(e){if(e){const t=e.split(this._decimal);if(2===t.length)return t[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(e,t){this.d_modelValue=t,this.$emit("update:modelValue",t)},onInputFocus(e){this.focused=!0,this.disabled||this.readonly||this.$refs.input.$el.value===n.DomHandler.getSelection()||!this.highlightOnFocus||e.target.select(),this.$emit("focus",e)},onInputBlur(e){this.focused=!1;let t=e.target,n=this.validateValue(this.parseValue(t.value));this.$emit("blur",{originalEvent:e,value:t.value}),t.value=this.formatValue(n),t.setAttribute("aria-valuenow",n),this.updateModel(e,n)},clearTimer(){this.timer&&clearInterval(this.timer)},maxBoundry(){return this.d_modelValue>=this.max},minBoundry(){return this.d_modelValue<=this.min}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass,{"p-disabled":this.showButtons&&null!==this.max&&this.maxBoundry()}]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass,{"p-disabled":this.showButtons&&null!==this.min&&this.minBoundry()}]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:e=>this.onUpButtonMouseDown(e),mouseup:e=>this.onUpButtonMouseUp(e),mouseleave:e=>this.onUpButtonMouseLeave(e),keydown:e=>this.onUpButtonKeyDown(e),keyup:e=>this.onUpButtonKeyUp(e)}},downButtonListeners(){return{mousedown:e=>this.onDownButtonMouseDown(e),mouseup:e=>this.onDownButtonMouseUp(e),mouseleave:e=>this.onDownButtonMouseLeave(e),keydown:e=>this.onDownButtonKeyDown(e),keyup:e=>this.onDownButtonKeyUp(e)}},formattedValue(){const e=this.modelValue||this.allowEmpty?this.modelValue:0;return this.formatValue(e)},getFormatter(){return this.numberFormat}},components:{INInputText:s(t).default,INButton:r.default}};const l={key:0,class:"p-inputnumber-button-group"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-inputnumber {\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label,\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label {\n display: none;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: flex;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),u.render=function(e,t,n,s,r,u){const a=i.resolveComponent("INInputText"),o=i.resolveComponent("INButton");return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass(u.containerClass)},[i.createVNode(a,i.mergeProps({ref:"input",id:n.inputId,class:["p-inputnumber-input",n.inputClass],role:"spinbutton",style:n.inputStyle,value:u.formattedValue,"aria-valuemin":n.min,"aria-valuemax":n.max,"aria-valuenow":n.modelValue,disabled:n.disabled,readonly:n.readonly,placeholder:n.placeholder,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onInput:u.onUserInput,onKeydown:u.onInputKeyDown,onKeypress:u.onInputKeyPress,onPaste:u.onPaste,onClick:u.onInputClick,onFocus:u.onInputFocus,onBlur:u.onInputBlur},n.inputProps),null,16,["id","class","style","value","aria-valuemin","aria-valuemax","aria-valuenow","disabled","readonly","placeholder","aria-labelledby","aria-label","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),n.showButtons&&"stacked"===n.buttonLayout?(i.openBlock(),i.createElementBlock("span",l,[i.createVNode(o,i.mergeProps({class:u.upButtonClass,icon:n.incrementButtonIcon},i.toHandlers(u.upButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.incrementButtonProps),null,16,["class","icon","disabled"]),i.createVNode(o,i.mergeProps({class:u.downButtonClass,icon:n.decrementButtonIcon},i.toHandlers(u.downButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.decrementButtonProps),null,16,["class","icon","disabled"])])):i.createCommentVNode("",!0),n.showButtons&&"stacked"!==n.buttonLayout?(i.openBlock(),i.createBlock(o,i.mergeProps({key:1,class:u.upButtonClass,icon:n.incrementButtonIcon},i.toHandlers(u.upButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.incrementButtonProps),null,16,["class","icon","disabled"])):i.createCommentVNode("",!0),n.showButtons&&"stacked"!==n.buttonLayout?(i.openBlock(),i.createBlock(o,i.mergeProps({key:2,class:u.downButtonClass,icon:n.decrementButtonIcon},i.toHandlers(u.downButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.decrementButtonProps),null,16,["class","icon","disabled"])):i.createCommentVNode("",!0)],2)},u}(primevue.button,primevue.inputtext,primevue.utils,Vue);
@@ -16,6 +16,7 @@ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
16
16
  export interface InputSwitchProps {
17
17
  /**
18
18
  * Specifies whether a inputswitch should be checked or not.
19
+ * @defaultValue false
19
20
  */
20
21
  modelValue?: boolean | string | undefined;
21
22
  /**
@@ -35,11 +36,11 @@ export interface InputSwitchProps {
35
36
  /**
36
37
  * Style class of the input field.
37
38
  */
38
- inputClass?: any | undefined;
39
+ inputClass?: string | object | undefined;
39
40
  /**
40
41
  * Inline style of the input field.
41
42
  */
42
- inputStyle?: any | undefined;
43
+ inputStyle?: object | undefined;
43
44
  /**
44
45
  * Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
45
46
  */
@@ -48,11 +48,11 @@ export default {
48
48
  default: null
49
49
  },
50
50
  inputClass: {
51
- type: String,
51
+ type: [String, Object],
52
52
  default: null
53
53
  },
54
54
  inputStyle: {
55
- type: null,
55
+ type: Object,
56
56
  default: null
57
57
  },
58
58
  inputProps: {
@@ -27,11 +27,11 @@ var script = {
27
27
  default: null
28
28
  },
29
29
  inputClass: {
30
- type: String,
30
+ type: [String, Object],
31
31
  default: null
32
32
  },
33
33
  inputStyle: {
34
- type: null,
34
+ type: Object,
35
35
  default: null
36
36
  },
37
37
  inputProps: {
@@ -1 +1 @@
1
- "use strict";var e=require("vue"),t={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const l={class:"p-hidden-accessible"},i=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],n=e.createElementVNode("span",{class:"p-inputswitch-slider"},null,-1);!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-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid transparent;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: '';\n top: 50%;\n}\n"),t.render=function(t,s,a,u,d,c){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.containerClass),onClick:s[2]||(s[2]=e=>c.onClick(e))},[e.createElementVNode("div",l,[e.createElementVNode("input",e.mergeProps({ref:"input",id:a.inputId,type:"checkbox",role:"switch",class:a.inputClass,style:a.inputStyle,checked:c.checked,disabled:a.disabled,"aria-checked":c.checked,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:s[0]||(s[0]=e=>c.onFocus(e)),onBlur:s[1]||(s[1]=e=>c.onBlur(e))},a.inputProps),null,16,i)]),n],2)},module.exports=t;
1
+ "use strict";var e=require("vue"),t={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const l={class:"p-hidden-accessible"},i=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],n=e.createElementVNode("span",{class:"p-inputswitch-slider"},null,-1);!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-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid transparent;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: '';\n top: 50%;\n}\n"),t.render=function(t,s,a,u,d,c){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.containerClass),onClick:s[2]||(s[2]=e=>c.onClick(e))},[e.createElementVNode("div",l,[e.createElementVNode("input",e.mergeProps({ref:"input",id:a.inputId,type:"checkbox",role:"switch",class:a.inputClass,style:a.inputStyle,checked:c.checked,disabled:a.disabled,"aria-checked":c.checked,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:s[0]||(s[0]=e=>c.onFocus(e)),onBlur:s[1]||(s[1]=e=>c.onBlur(e))},a.inputProps),null,16,i)]),n],2)},module.exports=t;
@@ -25,11 +25,11 @@ var script = {
25
25
  default: null
26
26
  },
27
27
  inputClass: {
28
- type: String,
28
+ type: [String, Object],
29
29
  default: null
30
30
  },
31
31
  inputStyle: {
32
- type: null,
32
+ type: Object,
33
33
  default: null
34
34
  },
35
35
  inputProps: {
@@ -1 +1 @@
1
- import{openBlock as e,createElementBlock as t,normalizeClass as l,createElementVNode as i,mergeProps as n}from"vue";var s={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const a={class:"p-hidden-accessible"},u=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],d=i("span",{class:"p-inputswitch-slider"},null,-1);!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-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid transparent;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: '';\n top: 50%;\n}\n"),s.render=function(s,c,o,p,r,h){return e(),t("div",{class:l(h.containerClass),onClick:c[2]||(c[2]=e=>h.onClick(e))},[i("div",a,[i("input",n({ref:"input",id:o.inputId,type:"checkbox",role:"switch",class:o.inputClass,style:o.inputStyle,checked:h.checked,disabled:o.disabled,"aria-checked":h.checked,"aria-labelledby":s.ariaLabelledby,"aria-label":s.ariaLabel,onFocus:c[0]||(c[0]=e=>h.onFocus(e)),onBlur:c[1]||(c[1]=e=>h.onBlur(e))},o.inputProps),null,16,u)]),d],2)};export{s as default};
1
+ import{openBlock as e,createElementBlock as t,normalizeClass as l,createElementVNode as i,mergeProps as n}from"vue";var s={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const a={class:"p-hidden-accessible"},u=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],d=i("span",{class:"p-inputswitch-slider"},null,-1);!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-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid transparent;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: '';\n top: 50%;\n}\n"),s.render=function(s,c,o,p,r,h){return e(),t("div",{class:l(h.containerClass),onClick:c[2]||(c[2]=e=>h.onClick(e))},[i("div",a,[i("input",n({ref:"input",id:o.inputId,type:"checkbox",role:"switch",class:o.inputClass,style:o.inputStyle,checked:h.checked,disabled:o.disabled,"aria-checked":h.checked,"aria-labelledby":s.ariaLabelledby,"aria-label":s.ariaLabel,onFocus:c[0]||(c[0]=e=>h.onFocus(e)),onBlur:c[1]||(c[1]=e=>h.onBlur(e))},o.inputProps),null,16,u)]),d],2)};export{s as default};
@@ -27,11 +27,11 @@ this.primevue.inputswitch = (function (vue) {
27
27
  default: null
28
28
  },
29
29
  inputClass: {
30
- type: String,
30
+ type: [String, Object],
31
31
  default: null
32
32
  },
33
33
  inputStyle: {
34
- type: null,
34
+ type: Object,
35
35
  default: null
36
36
  },
37
37
  inputProps: {
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.inputswitch=function(e){"use strict";var t={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const l={class:"p-hidden-accessible"},i=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],n=e.createElementVNode("span",{class:"p-inputswitch-slider"},null,-1);return 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-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid transparent;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: '';\n top: 50%;\n}\n"),t.render=function(t,s,a,u,d,c){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.containerClass),onClick:s[2]||(s[2]=e=>c.onClick(e))},[e.createElementVNode("div",l,[e.createElementVNode("input",e.mergeProps({ref:"input",id:a.inputId,type:"checkbox",role:"switch",class:a.inputClass,style:a.inputStyle,checked:c.checked,disabled:a.disabled,"aria-checked":c.checked,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:s[0]||(s[0]=e=>c.onFocus(e)),onBlur:s[1]||(s[1]=e=>c.onBlur(e))},a.inputProps),null,16,i)]),n],2)},t}(Vue);
1
+ this.primevue=this.primevue||{},this.primevue.inputswitch=function(e){"use strict";var t={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const i={class:"p-hidden-accessible"},l=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],n=e.createElementVNode("span",{class:"p-inputswitch-slider"},null,-1);return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&l.firstChild?l.insertBefore(n,l.firstChild):l.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid transparent;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: '';\n top: 50%;\n}\n"),t.render=function(t,s,a,u,c,d){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.containerClass),onClick:s[2]||(s[2]=e=>d.onClick(e))},[e.createElementVNode("div",i,[e.createElementVNode("input",e.mergeProps({ref:"input",id:a.inputId,type:"checkbox",role:"switch",class:a.inputClass,style:a.inputStyle,checked:d.checked,disabled:a.disabled,"aria-checked":d.checked,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:s[0]||(s[0]=e=>d.onFocus(e)),onBlur:s[1]||(s[1]=e=>d.onBlur(e))},a.inputProps),null,16,l)]),n],2)},t}(Vue);
@@ -9,7 +9,7 @@ import { RouteLocationRaw } from 'vue-router';
9
9
 
10
10
  /**
11
11
  * Custom command event.
12
- * @see {@link MenuItem.command}
12
+ * @todo next release should be able to change see menuItem.command
13
13
  */
14
14
  export interface MenuItemCommandEvent {
15
15
  /**
@@ -32,12 +32,12 @@ export interface OrganizationChartNode {
32
32
  data?: any;
33
33
  /**
34
34
  * Whether node is selectable when selection is enabled.
35
- * Default value is true.
35
+ * @defaultValue true
36
36
  */
37
37
  selectable?: boolean;
38
38
  /**
39
39
  * Whether node is collapsible when node expansion is enabled.
40
- * Default value is true.
40
+ * @defaultValue true
41
41
  */
42
42
  collapsible?: boolean;
43
43
  /**
@@ -86,6 +86,7 @@ export interface OrganizationChartProps {
86
86
  collapsedKeys?: OrganizationChartCollapsedKeys;
87
87
  /**
88
88
  * Whether the nodes can be expanded or toggled.
89
+ * @defaultValue false
89
90
  */
90
91
  collapsible?: boolean;
91
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primevue",
3
- "version": "3.24.0",
3
+ "version": "3.26.0",
4
4
  "homepage": "https://primevue.org/",
5
5
  "repository": {
6
6
  "type": "git",
package/panel/Panel.d.ts CHANGED
@@ -35,10 +35,12 @@ export interface PanelProps {
35
35
  header?: string;
36
36
  /**
37
37
  * Defines if content of panel can be expanded and collapsed.
38
+ * @defaultValue false
38
39
  */
39
40
  toggleable?: boolean;
40
41
  /**
41
42
  * Defines the initial state of panel content.
43
+ * @defaultValue false
42
44
  */
43
45
  collapsed?: boolean;
44
46
  /**
@@ -73,12 +75,12 @@ export interface PanelEmits {
73
75
  * Emitted when the collapsed changes.
74
76
  * @param {boolean} value - New value.
75
77
  */
76
- 'update:collapsed': (value: boolean) => void;
78
+ 'update:collapsed'(value: boolean): void;
77
79
  /**
78
80
  * Callback to invoke when a tab toggle.
79
81
  * @param {PanelToggleEvent} event - Custom toggle event.
80
82
  */
81
- toggle: (event: PanelToggleEvent) => void;
83
+ toggle(event: PanelToggleEvent): void;
82
84
  }
83
85
 
84
86
  /**
@@ -90,11 +90,11 @@ export interface PasswordProps extends InputHTMLAttributes {
90
90
  /**
91
91
  * Inline style of the input field.
92
92
  */
93
- inputStyle?: any | undefined;
93
+ inputStyle?: object | undefined;
94
94
  /**
95
95
  * Style class of the input field.
96
96
  */
97
- inputClass?: any | undefined;
97
+ inputClass?: string | object | undefined;
98
98
  /**
99
99
  * Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
100
100
  */
@@ -106,11 +106,11 @@ export interface PasswordProps extends InputHTMLAttributes {
106
106
  /**
107
107
  * Style class of the overlay panel.
108
108
  */
109
- panelClass?: any | undefined;
109
+ panelClass?: string | object | undefined;
110
110
  /**
111
111
  * Inline style of the overlay panel.
112
112
  */
113
- panelStyle?: any | undefined;
113
+ panelStyle?: object | undefined;
114
114
  /**
115
115
  * Uses to pass all properties of the HTMLDivElement to the overlay panel inside the component.
116
116
  */
@@ -114,11 +114,11 @@ export default {
114
114
  default: null
115
115
  },
116
116
  inputClass: {
117
- type: String,
117
+ type: [String, Object],
118
118
  default: null
119
119
  },
120
120
  inputStyle: {
121
- type: null,
121
+ type: Object,
122
122
  default: null
123
123
  },
124
124
  inputProps: {
@@ -130,11 +130,11 @@ export default {
130
130
  default: null
131
131
  },
132
132
  panelClass: {
133
- type: String,
133
+ type: [String, Object],
134
134
  default: null
135
135
  },
136
136
  panelStyle: {
137
- type: null,
137
+ type: Object,
138
138
  default: null
139
139
  },
140
140
  panelProps: {
@@ -78,11 +78,11 @@ var script = {
78
78
  default: null
79
79
  },
80
80
  inputClass: {
81
- type: String,
81
+ type: [String, Object],
82
82
  default: null
83
83
  },
84
84
  inputStyle: {
85
- type: null,
85
+ type: Object,
86
86
  default: null
87
87
  },
88
88
  inputProps: {
@@ -94,11 +94,11 @@ var script = {
94
94
  default: null
95
95
  },
96
96
  panelClass: {
97
- type: String,
97
+ type: [String, Object],
98
98
  default: null
99
99
  },
100
100
  panelStyle: {
101
- type: null,
101
+ type: Object,
102
102
  default: null
103
103
  },
104
104
  panelProps: {
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/inputtext"),t=require("primevue/overlayeventbus"),l=require("primevue/portal"),n=require("primevue/utils"),i=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e),a=s(t),o=s(l),d={name:"Password",emits:["update:modelValue","change","focus","blur","invalid"],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},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default: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&&(n.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(e){n.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(e){n.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?n.DomHandler.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=n.DomHandler.getOuterWidth(this.$refs.input.$el)+"px",n.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.setPasswordMeter(this.modelValue),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,{meter:l,label:n}=this.checkPasswordStrength(t);if(this.meter=l,this.infoText=n,"Escape"===e.code)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter(){if(!this.modelValue)return;const{meter:e,label:t}=this.checkPasswordStrength(this.modelValue);this.meter=e,this.infoText=t,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength(e){let t=null,l=null;switch(this.testStrength(e)){case 1:t=this.weakText,l={strength:"weak",width:"33.33%"};break;case 2:t=this.mediumText,l={strength:"medium",width:"66.66%"};break;case 3:t=this.strongText,l={strength:"strong",width:"100%"};break;default:t=this.promptText,l=null}return{label:t,meter:l}},onInvalid(e){this.$emit("invalid",e)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new n.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&&!n.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){a.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",this.inputClass,{"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:()=>n.UniqueComponentId()+"_panel"},components:{PInputText:r.default,Portal:o.default}};const p={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: 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 transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: flex;\n}\n.p-password-input::-ms-reveal,\n.p-password-input::-ms-clear {\n display: none;\n}\n"),d.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:r.inputFieldClass,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,required:l.required,onInput:r.onInput,onFocus:r.onFocus,onBlur:r.onBlur,onKeyup:r.onKeyUp,onInvalid:r.onInvalid},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","onInput","onFocus","onBlur","onKeyup","onInvalid"]),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",p,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=d;
1
+ "use strict";var e=require("primevue/inputtext"),t=require("primevue/overlayeventbus"),l=require("primevue/portal"),n=require("primevue/utils"),i=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e),a=s(t),o=s(l),d={name:"Password",emits:["update:modelValue","change","focus","blur","invalid"],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},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default: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&&(n.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(e){n.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(e){n.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?n.DomHandler.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=n.DomHandler.getOuterWidth(this.$refs.input.$el)+"px",n.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.setPasswordMeter(this.modelValue),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,{meter:l,label:n}=this.checkPasswordStrength(t);if(this.meter=l,this.infoText=n,"Escape"===e.code)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter(){if(!this.modelValue)return;const{meter:e,label:t}=this.checkPasswordStrength(this.modelValue);this.meter=e,this.infoText=t,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength(e){let t=null,l=null;switch(this.testStrength(e)){case 1:t=this.weakText,l={strength:"weak",width:"33.33%"};break;case 2:t=this.mediumText,l={strength:"medium",width:"66.66%"};break;case 3:t=this.strongText,l={strength:"strong",width:"100%"};break;default:t=this.promptText,l=null}return{label:t,meter:l}},onInvalid(e){this.$emit("invalid",e)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new n.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&&!n.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){a.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",this.inputClass,{"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:()=>n.UniqueComponentId()+"_panel"},components:{PInputText:r.default,Portal:o.default}};const p={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: 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 transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: flex;\n}\n.p-password-input::-ms-reveal,\n.p-password-input::-ms-clear {\n display: none;\n}\n"),d.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:r.inputFieldClass,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,required:l.required,onInput:r.onInput,onFocus:r.onFocus,onBlur:r.onBlur,onKeyup:r.onKeyUp,onInvalid:r.onInvalid},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","onInput","onFocus","onBlur","onKeyup","onInvalid"]),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",p,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=d;
@@ -70,11 +70,11 @@ var script = {
70
70
  default: null
71
71
  },
72
72
  inputClass: {
73
- type: String,
73
+ type: [String, Object],
74
74
  default: null
75
75
  },
76
76
  inputStyle: {
77
- type: null,
77
+ type: Object,
78
78
  default: null
79
79
  },
80
80
  inputProps: {
@@ -86,11 +86,11 @@ var script = {
86
86
  default: null
87
87
  },
88
88
  panelClass: {
89
- type: String,
89
+ type: [String, Object],
90
90
  default: null
91
91
  },
92
92
  panelStyle: {
93
- type: null,
93
+ type: Object,
94
94
  default: null
95
95
  },
96
96
  panelProps: {
@@ -1 +1 @@
1
- import e from"primevue/inputtext";import t from"primevue/overlayeventbus";import l from"primevue/portal";import{ZIndexUtils as i,DomHandler as n,ConnectedOverlayScrollHandler as s,UniqueComponentId as r}from"primevue/utils";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 f,Transition as g,renderSlot as v,normalizeStyle as b}from"vue";var w={name:"Password",emits:["update:modelValue","change","focus","blur","invalid"],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},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default: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&&(i.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(e){i.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(e){i.clear(e)},alignOverlay(){"self"===this.appendTo?n.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=n.getOuterWidth(this.$refs.input.$el)+"px",n.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.setPasswordMeter(this.modelValue),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,{meter:l,label:i}=this.checkPasswordStrength(t);if(this.meter=l,this.infoText=i,"Escape"===e.code)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter(){if(!this.modelValue)return;const{meter:e,label:t}=this.checkPasswordStrength(this.modelValue);this.meter=e,this.infoText=t,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength(e){let t=null,l=null;switch(this.testStrength(e)){case 1:t=this.weakText,l={strength:"weak",width:"33.33%"};break;case 2:t=this.mediumText,l={strength:"medium",width:"66.66%"};break;case 3:t=this.strongText,l={strength:"strong",width:"100%"};break;default:t=this.promptText,l=null}return{label:t,meter:l}},onInvalid(e){this.$emit("invalid",e)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new s(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&&!n.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){t.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",this.inputClass,{"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:()=>r()+"_panel"},components:{PInputText:e,Portal:l}};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: 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 transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: flex;\n}\n.p-password-input::-ms-reveal,\n.p-password-input::-ms-clear {\n display: none;\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:s.inputFieldClass,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,required:l.required,onInput:s.onInput,onFocus:s.onFocus,onBlur:s.onBlur,onKeyup:s.onKeyUp,onInvalid:s.onInvalid},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","onInput","onFocus","onBlur","onKeyup","onInvalid"]),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:f((()=>[u(g,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:f((()=>[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};
1
+ import e from"primevue/inputtext";import t from"primevue/overlayeventbus";import l from"primevue/portal";import{ZIndexUtils as i,DomHandler as n,ConnectedOverlayScrollHandler as s,UniqueComponentId as r}from"primevue/utils";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 f,Transition as g,renderSlot as v,normalizeStyle as b}from"vue";var w={name:"Password",emits:["update:modelValue","change","focus","blur","invalid"],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},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default: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&&(i.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(e){i.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(e){i.clear(e)},alignOverlay(){"self"===this.appendTo?n.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=n.getOuterWidth(this.$refs.input.$el)+"px",n.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.setPasswordMeter(this.modelValue),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,{meter:l,label:i}=this.checkPasswordStrength(t);if(this.meter=l,this.infoText=i,"Escape"===e.code)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter(){if(!this.modelValue)return;const{meter:e,label:t}=this.checkPasswordStrength(this.modelValue);this.meter=e,this.infoText=t,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength(e){let t=null,l=null;switch(this.testStrength(e)){case 1:t=this.weakText,l={strength:"weak",width:"33.33%"};break;case 2:t=this.mediumText,l={strength:"medium",width:"66.66%"};break;case 3:t=this.strongText,l={strength:"strong",width:"100%"};break;default:t=this.promptText,l=null}return{label:t,meter:l}},onInvalid(e){this.$emit("invalid",e)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new s(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&&!n.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){t.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",this.inputClass,{"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:()=>r()+"_panel"},components:{PInputText:e,Portal:l}};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: 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 transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: flex;\n}\n.p-password-input::-ms-reveal,\n.p-password-input::-ms-clear {\n display: none;\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:s.inputFieldClass,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,required:l.required,onInput:s.onInput,onFocus:s.onFocus,onBlur:s.onBlur,onKeyup:s.onKeyUp,onInvalid:s.onInvalid},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","onInput","onFocus","onBlur","onKeyup","onInvalid"]),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:f((()=>[u(g,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:f((()=>[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};
@@ -74,11 +74,11 @@ this.primevue.password = (function (InputText, OverlayEventBus, Portal, utils, v
74
74
  default: null
75
75
  },
76
76
  inputClass: {
77
- type: String,
77
+ type: [String, Object],
78
78
  default: null
79
79
  },
80
80
  inputStyle: {
81
- type: null,
81
+ type: Object,
82
82
  default: null
83
83
  },
84
84
  inputProps: {
@@ -90,11 +90,11 @@ this.primevue.password = (function (InputText, OverlayEventBus, Portal, utils, v
90
90
  default: null
91
91
  },
92
92
  panelClass: {
93
- type: String,
93
+ type: [String, Object],
94
94
  default: null
95
95
  },
96
96
  panelStyle: {
97
- type: null,
97
+ type: Object,
98
98
  default: null
99
99
  },
100
100
  panelProps: {
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.password=function(e,t,l,n,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e),a=s(t),o=s(l),d={name:"Password",emits:["update:modelValue","change","focus","blur","invalid"],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},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default: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&&(n.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(e){n.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(e){n.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?n.DomHandler.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=n.DomHandler.getOuterWidth(this.$refs.input.$el)+"px",n.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.setPasswordMeter(this.modelValue),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,{meter:l,label:n}=this.checkPasswordStrength(t);if(this.meter=l,this.infoText=n,"Escape"===e.code)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter(){if(!this.modelValue)return;const{meter:e,label:t}=this.checkPasswordStrength(this.modelValue);this.meter=e,this.infoText=t,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength(e){let t=null,l=null;switch(this.testStrength(e)){case 1:t=this.weakText,l={strength:"weak",width:"33.33%"};break;case 2:t=this.mediumText,l={strength:"medium",width:"66.66%"};break;case 3:t=this.strongText,l={strength:"strong",width:"100%"};break;default:t=this.promptText,l=null}return{label:t,meter:l}},onInvalid(e){this.$emit("invalid",e)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new n.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&&!n.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){a.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",this.inputClass,{"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:()=>n.UniqueComponentId()+"_panel"},components:{PInputText:r.default,Portal:o.default}};const p={class:"p-hidden-accessible","aria-live":"polite"},u=["id"],h={class:"p-password-meter"},c={class:"p-password-info"};return 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: 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 transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: flex;\n}\n.p-password-input::-ms-reveal,\n.p-password-input::-ms-clear {\n display: none;\n}\n"),d.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:r.inputFieldClass,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,required:l.required,onInput:r.onInput,onFocus:r.onFocus,onBlur:r.onBlur,onKeyup:r.onKeyUp,onInvalid:r.onInvalid},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","onInput","onFocus","onBlur","onKeyup","onInvalid"]),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",p,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)},d}(primevue.inputtext,primevue.overlayeventbus,primevue.portal,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.password=function(e,t,l,n,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e),a=s(t),o=s(l),d={name:"Password",emits:["update:modelValue","change","focus","blur","invalid"],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},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default: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&&(n.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter(e){n.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(e){n.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?n.DomHandler.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=n.DomHandler.getOuterWidth(this.$refs.input.$el)+"px",n.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.setPasswordMeter(this.modelValue),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,{meter:l,label:n}=this.checkPasswordStrength(t);if(this.meter=l,this.infoText=n,"Escape"===e.code)return void(this.overlayVisible&&(this.overlayVisible=!1));this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter(){if(!this.modelValue)return;const{meter:e,label:t}=this.checkPasswordStrength(this.modelValue);this.meter=e,this.infoText=t,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength(e){let t=null,l=null;switch(this.testStrength(e)){case 1:t=this.weakText,l={strength:"weak",width:"33.33%"};break;case 2:t=this.mediumText,l={strength:"medium",width:"66.66%"};break;case 3:t=this.strongText,l={strength:"strong",width:"100%"};break;default:t=this.promptText,l=null}return{label:t,meter:l}},onInvalid(e){this.$emit("invalid",e)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new n.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&&!n.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){a.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",this.inputClass,{"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:()=>n.UniqueComponentId()+"_panel"},components:{PInputText:r.default,Portal:o.default}};const p={class:"p-hidden-accessible","aria-live":"polite"},u=["id"],h={class:"p-password-meter"},c={class:"p-password-info"};return 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: 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 transition: width 1s ease-in-out;\n}\n.p-fluid .p-password {\n display: flex;\n}\n.p-password-input::-ms-reveal,\n.p-password-input::-ms-clear {\n display: none;\n}\n"),d.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:r.inputFieldClass,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,required:l.required,onInput:r.onInput,onFocus:r.onFocus,onBlur:r.onBlur,onKeyup:r.onKeyUp,onInvalid:r.onInvalid},l.inputProps),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","onInput","onFocus","onBlur","onKeyup","onInvalid"]),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",p,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)},d}(primevue.inputtext,primevue.overlayeventbus,primevue.portal,primevue.utils,Vue);