primevue 3.12.5 → 3.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/core.js +22 -6
- package/core/core.min.js +2 -2
- package/fileupload/FileUpload.d.ts +12 -0
- package/fileupload/FileUpload.vue +21 -7
- package/fileupload/fileupload.cjs.js +41 -26
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +41 -26
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +41 -26
- package/fileupload/fileupload.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +4 -0
- package/inputnumber/InputNumber.vue +20 -2
- package/inputnumber/inputnumber.cjs.js +21 -2
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +21 -2
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +21 -2
- package/inputnumber/inputnumber.min.js +1 -1
- package/package.json +1 -1
- package/password/Password.vue +1 -1
- package/password/password.cjs.js +1 -1
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +1 -1
- package/password/password.esm.min.js +1 -1
- package/password/password.js +1 -1
- package/password/password.min.js +1 -1
- package/resources/primevue.css +0 -4
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +10 -0
- package/resources/themes/arya-green/theme.css +10 -0
- package/resources/themes/arya-orange/theme.css +10 -0
- package/resources/themes/arya-purple/theme.css +10 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +10 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +10 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +10 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +10 -0
- package/resources/themes/fluent-light/theme.css +10 -0
- package/resources/themes/lara-dark-blue/theme.css +10 -0
- package/resources/themes/lara-dark-indigo/theme.css +10 -0
- package/resources/themes/lara-dark-purple/theme.css +10 -0
- package/resources/themes/lara-dark-teal/theme.css +10 -0
- package/resources/themes/lara-light-blue/theme.css +10 -0
- package/resources/themes/lara-light-indigo/theme.css +10 -0
- package/resources/themes/lara-light-purple/theme.css +10 -0
- package/resources/themes/lara-light-teal/theme.css +10 -0
- package/resources/themes/luna-amber/theme.css +10 -0
- package/resources/themes/luna-blue/theme.css +10 -0
- package/resources/themes/luna-green/theme.css +10 -0
- package/resources/themes/luna-pink/theme.css +10 -0
- package/resources/themes/md-dark-deeppurple/theme.css +11 -3
- package/resources/themes/md-dark-indigo/theme.css +11 -3
- package/resources/themes/md-light-deeppurple/theme.css +11 -3
- package/resources/themes/md-light-indigo/theme.css +11 -3
- package/resources/themes/mdc-dark-deeppurple/theme.css +11 -3
- package/resources/themes/mdc-dark-indigo/theme.css +11 -3
- package/resources/themes/mdc-light-deeppurple/theme.css +11 -3
- package/resources/themes/mdc-light-indigo/theme.css +11 -3
- package/resources/themes/nova/theme.css +10 -0
- package/resources/themes/nova-accent/theme.css +10 -0
- package/resources/themes/nova-alt/theme.css +10 -0
- package/resources/themes/nova-vue/theme.css +10 -0
- package/resources/themes/rhea/theme.css +10 -0
- package/resources/themes/saga-blue/theme.css +10 -0
- package/resources/themes/saga-green/theme.css +10 -0
- package/resources/themes/saga-orange/theme.css +10 -0
- package/resources/themes/saga-purple/theme.css +10 -0
- package/resources/themes/tailwind-light/theme.css +10 -0
- package/resources/themes/vela-blue/theme.css +10 -0
- package/resources/themes/vela-green/theme.css +10 -0
- package/resources/themes/vela-orange/theme.css +10 -0
- package/resources/themes/vela-purple/theme.css +10 -0
- package/sidebar/Sidebar.d.ts +4 -0
- package/sidebar/Sidebar.vue +3 -0
- package/sidebar/sidebar.cjs.js +17 -8
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +18 -9
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +17 -8
- package/sidebar/sidebar.min.js +1 -1
- package/tree/TreeNode.vue +1 -4
- package/tree/tree.cjs.js +1 -4
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +1 -4
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +1 -4
- package/tree/tree.min.js +1 -1
- package/vetur-attributes.json +17 -1
- package/vetur-tags.json +4 -0
- package/web-types.json +49 -2
package/core/core.js
CHANGED
|
@@ -2947,6 +2947,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
2947
2947
|
type: Boolean,
|
|
2948
2948
|
default: true
|
|
2949
2949
|
},
|
|
2950
|
+
readonly: {
|
|
2951
|
+
type: Boolean,
|
|
2952
|
+
default: false
|
|
2953
|
+
},
|
|
2950
2954
|
style: null,
|
|
2951
2955
|
class: null,
|
|
2952
2956
|
inputStyle: null,
|
|
@@ -3136,6 +3140,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
3136
3140
|
return null;
|
|
3137
3141
|
},
|
|
3138
3142
|
repeat(event, interval, dir) {
|
|
3143
|
+
if (this.readonly) {
|
|
3144
|
+
return;
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3139
3147
|
let i = interval || 500;
|
|
3140
3148
|
|
|
3141
3149
|
this.clearTimer();
|
|
@@ -3218,6 +3226,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
3218
3226
|
this.isSpecialChar = false;
|
|
3219
3227
|
},
|
|
3220
3228
|
onInputKeyDown(event) {
|
|
3229
|
+
if (this.readonly) {
|
|
3230
|
+
return;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3221
3233
|
this.lastValue = event.target.value;
|
|
3222
3234
|
if (event.shiftKey || event.altKey) {
|
|
3223
3235
|
this.isSpecialChar = true;
|
|
@@ -3364,6 +3376,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
3364
3376
|
}
|
|
3365
3377
|
},
|
|
3366
3378
|
onInputKeyPress(event) {
|
|
3379
|
+
if (this.readonly) {
|
|
3380
|
+
return;
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3367
3383
|
event.preventDefault();
|
|
3368
3384
|
let code = event.which || event.keyCode;
|
|
3369
3385
|
let char = String.fromCharCode(code);
|
|
@@ -3570,7 +3586,9 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
3570
3586
|
return index || 0;
|
|
3571
3587
|
},
|
|
3572
3588
|
onInputClick() {
|
|
3573
|
-
this.
|
|
3589
|
+
if (!this.readonly) {
|
|
3590
|
+
this.initCursor();
|
|
3591
|
+
}
|
|
3574
3592
|
},
|
|
3575
3593
|
isNumeralChar(char) {
|
|
3576
3594
|
if (char.length === 1 && (this._numeral.test(char) || this._decimal.test(char) || this._group.test(char) || this._minusSign.test(char))) {
|
|
@@ -3839,6 +3857,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
3839
3857
|
}, _ctx.$attrs, {
|
|
3840
3858
|
"aria-valumin": $props.min,
|
|
3841
3859
|
"aria-valuemax": $props.max,
|
|
3860
|
+
readonly: $props.readonly,
|
|
3842
3861
|
onInput: $options.onUserInput,
|
|
3843
3862
|
onKeydown: $options.onInputKeyDown,
|
|
3844
3863
|
onKeypress: $options.onInputKeyPress,
|
|
@@ -3846,7 +3865,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
3846
3865
|
onClick: $options.onInputClick,
|
|
3847
3866
|
onFocus: $options.onInputFocus,
|
|
3848
3867
|
onBlur: $options.onInputBlur
|
|
3849
|
-
}), null, 16, ["class", "style", "value", "aria-valumin", "aria-valuemax", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur"]),
|
|
3868
|
+
}), null, 16, ["class", "style", "value", "aria-valumin", "aria-valuemax", "readonly", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur"]),
|
|
3850
3869
|
($props.showButtons && $props.buttonLayout === 'stacked')
|
|
3851
3870
|
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, [
|
|
3852
3871
|
vue.createVNode(_component_INButton, vue.mergeProps({
|
|
@@ -6630,10 +6649,7 @@ this.primevue.tree = (function (utils, Ripple, vue) {
|
|
|
6630
6649
|
return ['p-treenode-icon', this.node.icon];
|
|
6631
6650
|
},
|
|
6632
6651
|
toggleIcon() {
|
|
6633
|
-
return ['p-tree-toggler-icon pi pi-fw',
|
|
6634
|
-
'pi-chevron-down': this.expanded,
|
|
6635
|
-
'pi-chevron-right': !this.expanded
|
|
6636
|
-
}];
|
|
6652
|
+
return ['p-tree-toggler-icon pi pi-fw', this.expanded ? this.node.expandedIcon || 'pi-chevron-down' : this.node.collapsedIcon || 'pi-chevron-right'];
|
|
6637
6653
|
},
|
|
6638
6654
|
checkboxClass() {
|
|
6639
6655
|
return ['p-checkbox-box', {'p-highlight': this.checked, 'p-indeterminate': this.partialChecked}];
|
package/core/core.min.js
CHANGED
|
@@ -26,7 +26,7 @@ this.primevue=this.primevue||{},this.primevue.button=function(t,e){"use strict";
|
|
|
26
26
|
|
|
27
27
|
this.primevue=this.primevue||{},this.primevue.inputtext=function(e){"use strict";var t={name:"InputText",emits:["update:modelValue"],props:{modelValue:null},methods:{onInput(e){this.$emit("update:modelValue",e.target.value)}},computed:{filled(){return null!=this.modelValue&&this.modelValue.toString().length>0}}};const u=["value"];return t.render=function(t,l,n,o,p,i){return e.openBlock(),e.createElementBlock("input",e.mergeProps({class:["p-inputtext p-component",{"p-filled":i.filled}],value:n.modelValue,onInput:l[0]||(l[0]=(...e)=>i.onInput&&i.onInput(...e))},t.$attrs),null,16,u)},t}(Vue);
|
|
28
28
|
|
|
29
|
-
this.primevue=this.primevue||{},this.primevue.inputnumber=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),r=i(t),u={name:"InputNumber",inheritAttrs:!1,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},style:null,class:null,inputStyle:null,inputClass: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){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.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,1),e.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)},onDownButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,-1),e.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.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.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.which){case 38:this.spin(e,1),e.preventDefault();break;case 40:this.spin(e,-1),e.preventDefault();break;case 37:this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case 39:this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case 13: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 8: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 46: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")}},onInputKeyPress(e){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(){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})},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,-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.$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",this.class,{"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.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: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\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: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\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 -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\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 -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\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,i,s,r,u){const a=n.resolveComponent("INInputText"),o=n.resolveComponent("INButton");return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass(u.containerClass),style:n.normalizeStyle(i.style)},[n.createVNode(a,n.mergeProps({ref:"input",class:["p-inputnumber-input",i.inputClass],style:i.inputStyle,value:u.formattedValue},e.$attrs,{"aria-valumin":i.min,"aria-valuemax":i.max,onInput:u.onUserInput,onKeydown:u.onInputKeyDown,onKeypress:u.onInputKeyPress,onPaste:u.onPaste,onClick:u.onInputClick,onFocus:u.onInputFocus,onBlur:u.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),i.showButtons&&"stacked"===i.buttonLayout?(n.openBlock(),n.createElementBlock("span",l,[n.createVNode(o,n.mergeProps({class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"]),n.createVNode(o,n.mergeProps({class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:1,class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:2,class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0)],6)},u}(primevue.inputtext,primevue.button,Vue);
|
|
29
|
+
this.primevue=this.primevue||{},this.primevue.inputnumber=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),r=i(t),l={name:"InputNumber",inheritAttrs:!1,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},readonly:{type:Boolean,default:!1},style:null,class:null,inputStyle:null,inputClass: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.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,1),e.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)},onDownButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,-1),e.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.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.which){case 38:this.spin(e,1),e.preventDefault();break;case 40:this.spin(e,-1),e.preventDefault();break;case 37:this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case 39:this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case 13: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 8:if(e.preventDefault(),t===n){const n=i.charAt(t-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:l}=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===l?(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 46:if(e.preventDefault(),t===n){const n=i.charAt(t),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:l}=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===l?(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")}},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 l=this.$refs.input.$el.value.trim();const{decimalCharIndex:u,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(l);let h;if(n.isMinusSign)0===s&&(h=l,-1!==a&&0===r||(h=this.insertText(l,t,0,r)),this.updateValue(e,h,t,"insert"));else if(n.isDecimalSign)u>0&&s===u?this.updateValue(e,l,t,"insert"):(u>s&&u<r||-1===u&&this.maxFractionDigits)&&(h=this.insertText(l,t,s,r),this.updateValue(e,h,t,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(u>0&&s>u){if(s+t.length-(u+1)<=n){const n=p>=s?p-1:o>=s?o:l.length;h=l.slice(0,s)+t+l.slice(s+t.length,n)+l.slice(n),this.updateValue(e,h,t,i)}}else h=this.insertText(l,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 l=e-1;for(;l>=0;){if(r=t.charAt(l),this.isNumeralChar(r)){i=l+s;break}l--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(l=e;l<n;){if(r=t.charAt(l),this.isNumeralChar(r)){i=l+s;break}l++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){this.readonly||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})},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),l=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===l){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 u=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,e)),l=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),u=new RegExp(l,"g");u.test(r);const a=t.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(u.lastIndex)),i=u.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(u===l)"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=l-u,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+=u-l,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,-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.$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",this.class,{"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.default,INButton:r.default}};const u={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: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\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: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\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 -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\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 -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\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"),l.render=function(e,t,i,s,r,l){const a=n.resolveComponent("INInputText"),o=n.resolveComponent("INButton");return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass(l.containerClass),style:n.normalizeStyle(i.style)},[n.createVNode(a,n.mergeProps({ref:"input",class:["p-inputnumber-input",i.inputClass],style:i.inputStyle,value:l.formattedValue},e.$attrs,{"aria-valumin":i.min,"aria-valuemax":i.max,readonly:i.readonly,onInput:l.onUserInput,onKeydown:l.onInputKeyDown,onKeypress:l.onInputKeyPress,onPaste:l.onPaste,onClick:l.onInputClick,onFocus:l.onInputFocus,onBlur:l.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","readonly","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),i.showButtons&&"stacked"===i.buttonLayout?(n.openBlock(),n.createElementBlock("span",u,[n.createVNode(o,n.mergeProps({class:l.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(l.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"]),n.createVNode(o,n.mergeProps({class:l.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(l.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:1,class:l.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(l.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:2,class:l.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(l.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0)],6)},l}(primevue.inputtext,primevue.button,Vue);
|
|
30
30
|
|
|
31
31
|
this.primevue=this.primevue||{},this.primevue.message=function(e,t){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s={name:"Message",emits:["close"],props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:null}},timeout:null,data:()=>({visible:!0}),mounted(){this.sticky||setTimeout((()=>{this.visible=!1}),this.life)},methods:{close(e){this.visible=!1,this.$emit("close",e)}},computed:{containerClass(){return"p-message p-component p-message-"+this.severity},iconClass(){return["p-message-icon pi",this.icon?this.icon:{"pi-info-circle":"info"===this.severity,"pi-check":"success"===this.severity,"pi-exclamation-triangle":"warn"===this.severity,"pi-times-circle":"error"===this.severity}]}},directives:{ripple:i(e).default}};const n={class:"p-message-wrapper"},a={class:"p-message-text"},l=[t.createElementVNode("i",{class:"p-message-close-icon pi pi-times"},null,-1)];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-message-wrapper {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-message-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-message-close.p-link {\n margin-left: auto;\n overflow: hidden;\n position: relative;\n}\n.p-message-enter-from {\n opacity: 0;\n}\n.p-message-enter-active {\n -webkit-transition: opacity .3s;\n transition: opacity .3s;\n}\n.p-message.p-message-leave-from {\n max-height: 1000px;\n}\n.p-message.p-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin: 0 !important;\n}\n.p-message-leave-active {\n overflow: hidden;\n -webkit-transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n}\n.p-message-leave-active .p-message-close {\n display: none;\n}\n"),s.render=function(e,i,s,o,r,c){const p=t.resolveDirective("ripple");return t.openBlock(),t.createBlock(t.Transition,{name:"p-message",appear:""},{default:t.withCtx((()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(c.containerClass),role:"alert"},[t.createElementVNode("div",n,[t.createElementVNode("span",{class:t.normalizeClass(c.iconClass)},null,2),t.createElementVNode("div",a,[t.renderSlot(e.$slots,"default")]),s.closable?t.withDirectives((t.openBlock(),t.createElementBlock("button",{key:0,class:"p-message-close p-link",onClick:i[0]||(i[0]=e=>c.close(e)),type:"button"},l)),[[p]]):t.createCommentVNode("",!0)])],2),[[t.vShow,r.visible]])])),_:3})},s}(primevue.ripple,Vue);
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@ this.primevue=this.primevue||{},this.primevue.dialog=function(e,t,n){"use strict
|
|
|
38
38
|
|
|
39
39
|
this.primevue=this.primevue||{},this.primevue.paginator=function(e,t,n,a){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(t),i=o(n),s=o(a),l={name:"CurrentPageReport",inheritAttrs:!1,props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const p={class:"p-paginator-current"};l.render=function(t,n,a,o,r,i){return e.openBlock(),e.createElementBlock("span",p,e.toDisplayString(i.text),1)};var c={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:r.default}};const g=[e.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];c.render=function(t,n,a,o,r,i){const s=e.resolveDirective("ripple");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(i.containerClass),type:"button"},g,2)),[[s]])};var u={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:r.default}};const d=[e.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];u.render=function(t,n,a,o,r,i){const s=e.resolveDirective("ripple");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(i.containerClass),type:"button"},d,2)),[[s]])};var m={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:r.default}};const h=[e.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];m.render=function(t,n,a,o,r,i){const s=e.resolveDirective("ripple");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(i.containerClass),type:"button"},h,2)),[[s]])};var k={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(e,t){this.$emit("click",{originalEvent:e,value:t})}},directives:{ripple:r.default}};const P={class:"p-paginator-pages"},f=["onClick"];k.render=function(t,n,a,o,r,i){const s=e.resolveDirective("ripple");return e.openBlock(),e.createElementBlock("span",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(t=>e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:t,class:e.normalizeClass(["p-paginator-page p-paginator-element p-link",{"p-highlight":t-1===a.page}]),type:"button",onClick:e=>i.onPageLinkClick(e,t)},[e.createTextVNode(e.toDisplayString(t),1)],10,f)),[[s]]))),128))])};var b={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:r.default}};const v=[e.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];b.render=function(t,n,a,o,r,i){const s=e.resolveDirective("ripple");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(i.containerClass),type:"button"},v,2)),[[s]])};var w={name:"RowsPerPageDropdown",inheritAttrs:!1,emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(e){this.$emit("rows-change",e)}},computed:{rowsOptions(){let e=[];if(this.options)for(let t=0;t<this.options.length;t++)e.push({label:String(this.options[t]),value:this.options[t]});return e}},components:{RPPDropdown:i.default}};w.render=function(t,n,a,o,r,i){const s=e.resolveComponent("RPPDropdown");return e.openBlock(),e.createBlock(s,{modelValue:a.rows,options:i.rowsOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":n[0]||(n[0]=e=>i.onChange(e)),class:"p-paginator-rpp-options",disabled:a.disabled},null,8,["modelValue","options","disabled"])};var C={name:"JumpToPageDropdown",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e)}},computed:{pageOptions(){let e=[];for(let t=0;t<this.pageCount;t++)e.push({label:String(t+1),value:t});return e}},components:{JTPDropdown:i.default}};C.render=function(t,n,a,o,r,i){const s=e.resolveComponent("JTPDropdown");return e.openBlock(),e.createBlock(s,{modelValue:a.page,options:i.pageOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":n[0]||(n[0]=e=>i.onChange(e)),class:"p-paginator-page-options",disabled:a.disabled},null,8,["modelValue","options","disabled"])};var y={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e-1)}},components:{JTPInput:s.default}};y.render=function(t,n,a,o,r,i){const s=e.resolveComponent("JTPInput");return e.openBlock(),e.createBlock(s,{modelValue:a.page,"onUpdate:modelValue":n[0]||(n[0]=e=>i.onChange(e)),class:"p-paginator-page-input",disabled:a.disabled},null,8,["modelValue","disabled"])};var B={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:String,default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(e){this.d_first=e},rows(e){this.d_rows=e},totalRecords(e){this.page>0&&e&&this.d_first>=e&&this.changePage(this.pageCount-1)}},methods:{changePage(e){const t=this.pageCount;if(e>=0&&e<t){this.d_first=this.d_rows*e;const n={page:e,first:this.d_first,rows:this.d_rows,pageCount:t};this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",n)}},changePageToFirst(e){this.isFirstPage||this.changePage(0),e.preventDefault()},changePageToPrev(e){this.changePage(this.page-1),e.preventDefault()},changePageLink(e){this.changePage(e.value-1),e.originalEvent.preventDefault()},changePageToNext(e){this.changePage(this.page+1),e.preventDefault()},changePageToLast(e){this.isLastPage||this.changePage(this.pageCount-1),e.preventDefault()},onRowChange(e){this.d_rows=e,this.changePage(this.page)}},computed:{templateItems(){let e=[];return this.template.split(" ").map((t=>{e.push(t.trim())})),e},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return 0===this.page},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const e=this.pageCount,t=Math.min(this.pageLinkSize,e);let n=Math.max(0,Math.ceil(this.page-t/2)),a=Math.min(e-1,n+t-1);const o=this.pageLinkSize-(a-n+1);return n=Math.max(0,n-o),[n,a]},pageLinks(){let e=[],t=this.calculatePageLinkBoundaries,n=t[0],a=t[1];for(var o=n;o<=a;o++)e.push(o+1);return e},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return 0===this.pageCount},currentPage(){return this.pageCount>0?this.page+1:0}},components:{CurrentPageReport:l,FirstPageLink:c,LastPageLink:u,NextPageLink:m,PageLinks:k,PrevPageLink:b,RowsPerPageDropdown:w,JumpToPageDropdown:C,JumpToPageInput:y}};const L={key:0,class:"p-paginator p-component"},x={key:0,class:"p-paginator-left-content"},N={key:1,class:"p-paginator-right-content"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-paginator {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n.p-paginator-left-content {\n\tmargin-right: auto;\n}\n.p-paginator-right-content {\n\tmargin-left: auto;\n}\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev,\n.p-paginator-current {\n cursor: pointer;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n line-height: 1;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n position: relative;\n}\n.p-paginator-element:focus {\n z-index: 1;\n position: relative;\n}\n"),B.render=function(t,n,a,o,r,i){const s=e.resolveComponent("FirstPageLink"),l=e.resolveComponent("PrevPageLink"),p=e.resolveComponent("NextPageLink"),c=e.resolveComponent("LastPageLink"),g=e.resolveComponent("PageLinks"),u=e.resolveComponent("CurrentPageReport"),d=e.resolveComponent("RowsPerPageDropdown"),m=e.resolveComponent("JumpToPageDropdown"),h=e.resolveComponent("JumpToPageInput");return a.alwaysShow||i.pageLinks&&i.pageLinks.length>1?(e.openBlock(),e.createElementBlock("div",L,[t.$slots.start?(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(t.$slots,"start",{state:i.currentState})])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.templateItems,(t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t},["FirstPageLink"===t?(e.openBlock(),e.createBlock(s,{key:0,onClick:n[0]||(n[0]=e=>i.changePageToFirst(e)),disabled:i.isFirstPage||i.empty},null,8,["disabled"])):"PrevPageLink"===t?(e.openBlock(),e.createBlock(l,{key:1,onClick:n[1]||(n[1]=e=>i.changePageToPrev(e)),disabled:i.isFirstPage||i.empty},null,8,["disabled"])):"NextPageLink"===t?(e.openBlock(),e.createBlock(p,{key:2,onClick:n[2]||(n[2]=e=>i.changePageToNext(e)),disabled:i.isLastPage||i.empty},null,8,["disabled"])):"LastPageLink"===t?(e.openBlock(),e.createBlock(c,{key:3,onClick:n[3]||(n[3]=e=>i.changePageToLast(e)),disabled:i.isLastPage||i.empty},null,8,["disabled"])):"PageLinks"===t?(e.openBlock(),e.createBlock(g,{key:4,value:i.pageLinks,page:i.page,onClick:n[4]||(n[4]=e=>i.changePageLink(e))},null,8,["value","page"])):"CurrentPageReport"===t?(e.openBlock(),e.createBlock(u,{key:5,template:a.currentPageReportTemplate,currentPage:i.currentPage,page:i.page,pageCount:i.pageCount,first:r.d_first,rows:r.d_rows,totalRecords:a.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):"RowsPerPageDropdown"===t&&a.rowsPerPageOptions?(e.openBlock(),e.createBlock(d,{key:6,rows:r.d_rows,options:a.rowsPerPageOptions,onRowsChange:n[5]||(n[5]=e=>i.onRowChange(e)),disabled:i.empty},null,8,["rows","options","disabled"])):"JumpToPageDropdown"===t?(e.openBlock(),e.createBlock(m,{key:7,page:i.page,pageCount:i.pageCount,onPageChange:n[6]||(n[6]=e=>i.changePage(e)),disabled:i.empty},null,8,["page","pageCount","disabled"])):"JumpToPageInput"===t?(e.openBlock(),e.createBlock(h,{key:8,page:i.currentPage,onPageChange:n[7]||(n[7]=e=>i.changePage(e)),disabled:i.empty},null,8,["page","disabled"])):e.createCommentVNode("",!0)],64)))),128)),t.$slots.end?(e.openBlock(),e.createElementBlock("div",N,[e.renderSlot(t.$slots,"end",{state:i.currentState})])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)},B}(Vue,primevue.ripple,primevue.dropdown,primevue.inputnumber);
|
|
40
40
|
|
|
41
|
-
this.primevue=this.primevue||{},this.primevue.tree=function(e,t,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.DomHandler.hasClass(t.target,"p-tree-toggler")||e.DomHandler.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,o=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(o=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],o||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.DomHandler.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",{"pi-chevron-down":this.expanded,"pi-chevron-right":!this.expanded}]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:l(t).default}};const i=["aria-expanded"],s={key:0,class:"p-checkbox p-component"},c=["aria-checked"],d={class:"p-treenode-label"},r={key:0,class:"p-treenode-children",role:"group"};o.render=function(e,t,l,o,a,h){const p=n.resolveComponent("TreeNode",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("li",{class:n.normalizeClass(h.containerClass)},[n.createElementVNode("div",{class:n.normalizeClass(h.contentClass),tabindex:"0",role:"treeitem","aria-expanded":h.expanded,onClick:t[1]||(t[1]=(...e)=>h.onClick&&h.onClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>h.onKeyDown&&h.onKeyDown(...e)),onTouchend:t[3]||(t[3]=(...e)=>h.onTouchEnd&&h.onTouchEnd(...e)),style:n.normalizeStyle(l.node.style)},[n.withDirectives((n.openBlock(),n.createElementBlock("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[0]||(t[0]=(...e)=>h.toggle&&h.toggle(...e)),tabindex:"-1"},[n.createElementVNode("span",{class:n.normalizeClass(h.toggleIcon)},null,2)])),[[u]]),h.checkboxMode?(n.openBlock(),n.createElementBlock("div",s,[n.createElementVNode("div",{class:n.normalizeClass(h.checkboxClass),role:"checkbox","aria-checked":h.checked},[n.createElementVNode("span",{class:n.normalizeClass(h.checkboxIcon)},null,2)],10,c)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(h.icon)},null,2),n.createElementVNode("span",d,[l.templates[l.node.type]||l.templates.default?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.templates[l.node.type]||l.templates.default),{key:0,node:l.node},null,8,["node"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(h.label(l.node)),1)],64))])],46,i),h.hasChildren&&h.expanded?(n.openBlock(),n.createElementBlock("ul",r,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.node.children,(e=>(n.openBlock(),n.createBlock(p,{key:e.key,node:e,templates:l.templates,expandedKeys:l.expandedKeys,onNodeToggle:h.onChildNodeToggle,onNodeClick:h.onChildNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:h.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):n.createCommentVNode("",!0)],2)};var a={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let o;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?o={}:(o={...this.selectionKeys},delete o[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?o={}:this.isMultipleSelectionMode()&&(o=l&&this.selectionKeys?{...this.selectionKeys}:{}),o[n.key]=!0,this.$emit("node-select",n)),o},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let o of l){let l={...o};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(t,{searchFields:n,filterText:l,strict:o}){let i=!1;for(let o of n){String(e.ObjectUtils.resolveFieldData(t,o)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(i=!0)}return(!i||o&&!this.isNodeLeaf(t))&&(i=this.findFilteredNodes(t,{searchFields:n,filterText:l,strict:o})||i),i}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let o of this.value){let i={...o},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(i,s)||this.isFilterMatched(i,s))||!l&&(this.isFilterMatched(i,s)||this.findFilteredNodes(i,s)))&&e.push(i)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:o}};const h={key:0,class:"p-tree-loading-overlay p-component-overlay"},p={key:1,class:"p-tree-filter-container"},u=["placeholder"],y=n.createElementVNode("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),k={class:"p-tree-container",role:"tree"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),a.render=function(e,t,l,o,i,s){const c=n.resolveComponent("TreeNode");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[l.loading?(n.openBlock(),n.createElementBlock("div",h,[n.createElementVNode("i",{class:n.normalizeClass(s.loadingIconClass)},null,2)])):n.createCommentVNode("",!0),l.filter?(n.openBlock(),n.createElementBlock("div",p,[n.withDirectives(n.createElementVNode("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onKeydown:t[0]||(t[0]=(...e)=>s.onFilterKeydown&&s.onFilterKeydown(...e)),"onUpdate:modelValue":t[1]||(t[1]=e=>i.filterValue=e)},null,40,u),[[n.vModelText,i.filterValue]]),y])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"p-tree-wrapper",style:n.normalizeStyle({maxHeight:l.scrollHeight})},[n.createElementVNode("ul",k,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.valueToRender,(t=>(n.openBlock(),n.createBlock(c,{key:t.key,node:t,templates:e.$slots,expandedKeys:i.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)},a}(primevue.utils,primevue.ripple,Vue);
|
|
41
|
+
this.primevue=this.primevue||{},this.primevue.tree=function(e,t,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.DomHandler.hasClass(t.target,"p-tree-toggler")||e.DomHandler.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,o=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(o=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],o||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.DomHandler.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",this.expanded?this.node.expandedIcon||"pi-chevron-down":this.node.collapsedIcon||"pi-chevron-right"]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:l(t).default}};const i=["aria-expanded"],s={key:0,class:"p-checkbox p-component"},c=["aria-checked"],d={class:"p-treenode-label"},r={key:0,class:"p-treenode-children",role:"group"};o.render=function(e,t,l,o,a,h){const p=n.resolveComponent("TreeNode",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("li",{class:n.normalizeClass(h.containerClass)},[n.createElementVNode("div",{class:n.normalizeClass(h.contentClass),tabindex:"0",role:"treeitem","aria-expanded":h.expanded,onClick:t[1]||(t[1]=(...e)=>h.onClick&&h.onClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>h.onKeyDown&&h.onKeyDown(...e)),onTouchend:t[3]||(t[3]=(...e)=>h.onTouchEnd&&h.onTouchEnd(...e)),style:n.normalizeStyle(l.node.style)},[n.withDirectives((n.openBlock(),n.createElementBlock("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[0]||(t[0]=(...e)=>h.toggle&&h.toggle(...e)),tabindex:"-1"},[n.createElementVNode("span",{class:n.normalizeClass(h.toggleIcon)},null,2)])),[[u]]),h.checkboxMode?(n.openBlock(),n.createElementBlock("div",s,[n.createElementVNode("div",{class:n.normalizeClass(h.checkboxClass),role:"checkbox","aria-checked":h.checked},[n.createElementVNode("span",{class:n.normalizeClass(h.checkboxIcon)},null,2)],10,c)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(h.icon)},null,2),n.createElementVNode("span",d,[l.templates[l.node.type]||l.templates.default?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.templates[l.node.type]||l.templates.default),{key:0,node:l.node},null,8,["node"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(h.label(l.node)),1)],64))])],46,i),h.hasChildren&&h.expanded?(n.openBlock(),n.createElementBlock("ul",r,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.node.children,(e=>(n.openBlock(),n.createBlock(p,{key:e.key,node:e,templates:l.templates,expandedKeys:l.expandedKeys,onNodeToggle:h.onChildNodeToggle,onNodeClick:h.onChildNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:h.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):n.createCommentVNode("",!0)],2)};var a={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let o;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?o={}:(o={...this.selectionKeys},delete o[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?o={}:this.isMultipleSelectionMode()&&(o=l&&this.selectionKeys?{...this.selectionKeys}:{}),o[n.key]=!0,this.$emit("node-select",n)),o},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let o of l){let l={...o};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(t,{searchFields:n,filterText:l,strict:o}){let i=!1;for(let o of n){String(e.ObjectUtils.resolveFieldData(t,o)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(i=!0)}return(!i||o&&!this.isNodeLeaf(t))&&(i=this.findFilteredNodes(t,{searchFields:n,filterText:l,strict:o})||i),i}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let o of this.value){let i={...o},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(i,s)||this.isFilterMatched(i,s))||!l&&(this.isFilterMatched(i,s)||this.findFilteredNodes(i,s)))&&e.push(i)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:o}};const h={key:0,class:"p-tree-loading-overlay p-component-overlay"},p={key:1,class:"p-tree-filter-container"},u=["placeholder"],y=n.createElementVNode("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),k={class:"p-tree-container",role:"tree"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),a.render=function(e,t,l,o,i,s){const c=n.resolveComponent("TreeNode");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[l.loading?(n.openBlock(),n.createElementBlock("div",h,[n.createElementVNode("i",{class:n.normalizeClass(s.loadingIconClass)},null,2)])):n.createCommentVNode("",!0),l.filter?(n.openBlock(),n.createElementBlock("div",p,[n.withDirectives(n.createElementVNode("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onKeydown:t[0]||(t[0]=(...e)=>s.onFilterKeydown&&s.onFilterKeydown(...e)),"onUpdate:modelValue":t[1]||(t[1]=e=>i.filterValue=e)},null,40,u),[[n.vModelText,i.filterValue]]),y])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"p-tree-wrapper",style:n.normalizeStyle({maxHeight:l.scrollHeight})},[n.createElementVNode("ul",k,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.valueToRender,(t=>(n.openBlock(),n.createBlock(c,{key:t.key,node:t,templates:e.$slots,expandedKeys:i.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)},a}(primevue.utils,primevue.ripple,Vue);
|
|
42
42
|
|
|
43
43
|
this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["click"],props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.$emit("click",{originalEvent:e,item:this.item,navigate:t})},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},computed:{containerClass(){return["p-menuitem",this.item.class]}},directives:{ripple:l(i).default}};const o=["href","onClick"],a={class:"p-menuitem-text"},c=["href","target","tabindex"],m={class:"p-menuitem-text"};r.render=function(e,t,i,l,s,r){const d=n.resolveComponent("router-link"),u=n.resolveDirective("ripple");return r.visible()?(n.openBlock(),n.createElementBlock("li",{key:0,class:n.normalizeClass(r.containerClass),role:"none",style:n.normalizeStyle(i.item.style)},[i.template?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.template),{key:1,item:i.item},null,8,["item"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[i.item.to&&!r.disabled(i.item)?(n.openBlock(),n.createBlock(d,{key:0,to:i.item.to,custom:""},{default:n.withCtx((({navigate:e,href:t,isActive:l,isExactActive:s})=>[n.withDirectives((n.openBlock(),n.createElementBlock("a",{href:t,onClick:t=>r.onClick(t,e),class:n.normalizeClass(r.linkClass(i.item,{isActive:l,isExactActive:s})),role:"menuitem"},[n.createElementVNode("span",{class:n.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2),n.createElementVNode("span",a,n.toDisplayString(r.label()),1)],10,o)),[[u]])])),_:1},8,["to"])):n.withDirectives((n.openBlock(),n.createElementBlock("a",{key:1,href:i.item.url,class:n.normalizeClass(r.linkClass(i.item)),onClick:t[0]||(t[0]=(...e)=>r.onClick&&r.onClick(...e)),target:i.item.target,role:"menuitem",tabindex:r.disabled(i.item)?null:"0"},[n.createElementVNode("span",{class:n.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2),n.createElementVNode("span",m,n.toDisplayString(r.label()),1)],10,c)),[[u]])],64))],6)):n.createCommentVNode("",!0)};var d={name:"Menu",emits:["show","hide"],inheritAttrs:!1,props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0}},data:()=>({overlayVisible:!1}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&e.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.hide())},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(t){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&e.ZIndexUtils.set("menu",t,this.baseZIndex+this.$primevue.config.zIndex.menu),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(t){this.autoZIndex&&e.ZIndexUtils.clear(t)},alignOverlay(){e.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=e.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,containerRef(e){this.container=e},onOverlayClick(e){s.default.emit("overlay-click",{originalEvent:e,target:this.target})}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]}},components:{Menuitem:r}};const u={class:"p-menu-list p-reset",role:"menu"},p={key:0,class:"p-submenu-header"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .p-menuitem-link {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),d.render=function(e,t,i,l,s,r){const o=n.resolveComponent("Menuitem");return n.openBlock(),n.createBlock(n.Teleport,{to:i.appendTo,disabled:!i.popup},[n.createVNode(n.Transition,{name:"p-connected-overlay",onEnter:r.onEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:n.withCtx((()=>[!i.popup||s.overlayVisible?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,ref:r.containerRef,class:r.containerClass},e.$attrs,{onClick:t[0]||(t[0]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e))}),[n.createElementVNode("ul",u,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.model,((t,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:r.label(t)+l.toString()},[t.items&&r.visible(t)&&!t.separator?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[t.items?(n.openBlock(),n.createElementBlock("li",p,[n.renderSlot(e.$slots,"item",{item:t},(()=>[n.createTextVNode(n.toDisplayString(r.label(t)),1)]))])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.items,((t,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:t.label+l+s},[r.visible(t)&&!t.separator?(n.openBlock(),n.createBlock(o,{key:0,item:t,onClick:r.itemClick,template:e.$slots.item,exact:i.exact},null,8,["item","onClick","template","exact"])):r.visible(t)&&t.separator?(n.openBlock(),n.createElementBlock("li",{class:n.normalizeClass(["p-menu-separator",t.class]),style:n.normalizeStyle(t.style),key:"separator"+l+s,role:"separator"},null,6)):n.createCommentVNode("",!0)],64)))),128))],64)):r.visible(t)&&t.separator?(n.openBlock(),n.createElementBlock("li",{class:n.normalizeClass(["p-menu-separator",t.class]),style:n.normalizeStyle(t.style),key:"separator"+l.toString(),role:"separator"},null,6)):(n.openBlock(),n.createBlock(o,{key:r.label(t)+l.toString(),item:t,onClick:r.itemClick,template:e.$slots.item,exact:i.exact},null,8,["item","onClick","template","exact"]))],64)))),128))])],16)):n.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"])},d}(primevue.utils,primevue.overlayeventbus,primevue.ripple,Vue);
|
|
44
44
|
|
|
@@ -178,6 +178,18 @@ export interface FileUploadProps {
|
|
|
178
178
|
* Default value is true.
|
|
179
179
|
*/
|
|
180
180
|
showCancelButton?: boolean | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Icon of the choose button.
|
|
183
|
+
*/
|
|
184
|
+
chooseIcon?: string | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* Icon of the upload button.
|
|
187
|
+
*/
|
|
188
|
+
uploadIcon?: string | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* Icon of the cancel button.
|
|
191
|
+
*/
|
|
192
|
+
cancelIcon?: string | undefined;
|
|
181
193
|
/**
|
|
182
194
|
* Inline style of the component.
|
|
183
195
|
*/
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<div class="p-fileupload-buttonbar">
|
|
4
4
|
<span :class="advancedChooseButtonClass" :style="style" @click="choose" @keydown.enter="choose" @focus="onFocus" @blur="onBlur" v-ripple tabindex="0">
|
|
5
5
|
<input ref="fileInput" type="file" @change="onFileSelect" :multiple="multiple" :accept="accept" :disabled="chooseDisabled" />
|
|
6
|
-
<span class="
|
|
6
|
+
<span :class="advancedChooseIconClass"></span>
|
|
7
7
|
<span class="p-button-label">{{chooseButtonLabel}}</span>
|
|
8
8
|
</span>
|
|
9
|
-
<FileUploadButton :label="uploadButtonLabel" icon="
|
|
10
|
-
<FileUploadButton :label="cancelButtonLabel" icon="
|
|
9
|
+
<FileUploadButton :label="uploadButtonLabel" :icon="uploadIcon" @click="upload" :disabled="uploadDisabled" v-if="showUploadButton" />
|
|
10
|
+
<FileUploadButton :label="cancelButtonLabel" :icon="cancelIcon" @click="clear" :disabled="cancelDisabled" v-if="showCancelButton" />
|
|
11
11
|
</div>
|
|
12
12
|
<div ref="content" class="p-fileupload-content" @dragenter="onDragEnter" @dragover="onDragOver" @dragleave="onDragLeave" @drop="onDrop">
|
|
13
13
|
<FileUploadProgressBar :value="progress" v-if="hasFiles" />
|
|
@@ -130,6 +130,18 @@ export default {
|
|
|
130
130
|
type: Boolean,
|
|
131
131
|
default: true
|
|
132
132
|
},
|
|
133
|
+
chooseIcon: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: 'pi pi-plus'
|
|
136
|
+
},
|
|
137
|
+
uploadIcon: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: 'pi pi-upload'
|
|
140
|
+
},
|
|
141
|
+
cancelIcon: {
|
|
142
|
+
type: String,
|
|
143
|
+
default: 'pi pi-times'
|
|
144
|
+
},
|
|
133
145
|
style: null,
|
|
134
146
|
class: null
|
|
135
147
|
},
|
|
@@ -424,11 +436,13 @@ export default {
|
|
|
424
436
|
'p-focus': this.focused
|
|
425
437
|
}];
|
|
426
438
|
},
|
|
439
|
+
advancedChooseIconClass() {
|
|
440
|
+
return ['p-button-icon p-button-icon-left pi-fw', this.chooseIcon];
|
|
441
|
+
},
|
|
427
442
|
basicChooseButtonIconClass() {
|
|
428
|
-
return ['p-button-icon p-button-icon-left
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}];
|
|
443
|
+
return ['p-button-icon p-button-icon-left',
|
|
444
|
+
!this.hasFiles || this.auto ? this.uploadIcon : this.chooseIcon
|
|
445
|
+
];
|
|
432
446
|
},
|
|
433
447
|
basicChooseButtonLabel() {
|
|
434
448
|
return this.auto ? this.chooseButtonLabel : (this.hasFiles ? this.files.map(f => f.name).join(', ') : this.chooseButtonLabel);
|
|
@@ -98,6 +98,18 @@ var script = {
|
|
|
98
98
|
type: Boolean,
|
|
99
99
|
default: true
|
|
100
100
|
},
|
|
101
|
+
chooseIcon: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: 'pi pi-plus'
|
|
104
|
+
},
|
|
105
|
+
uploadIcon: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: 'pi pi-upload'
|
|
108
|
+
},
|
|
109
|
+
cancelIcon: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: 'pi pi-times'
|
|
112
|
+
},
|
|
101
113
|
style: null,
|
|
102
114
|
class: null
|
|
103
115
|
},
|
|
@@ -392,11 +404,13 @@ var script = {
|
|
|
392
404
|
'p-focus': this.focused
|
|
393
405
|
}];
|
|
394
406
|
},
|
|
407
|
+
advancedChooseIconClass() {
|
|
408
|
+
return ['p-button-icon p-button-icon-left pi-fw', this.chooseIcon];
|
|
409
|
+
},
|
|
395
410
|
basicChooseButtonIconClass() {
|
|
396
|
-
return ['p-button-icon p-button-icon-left
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}];
|
|
411
|
+
return ['p-button-icon p-button-icon-left',
|
|
412
|
+
!this.hasFiles || this.auto ? this.uploadIcon : this.chooseIcon
|
|
413
|
+
];
|
|
400
414
|
},
|
|
401
415
|
basicChooseButtonLabel() {
|
|
402
416
|
return this.auto ? this.chooseButtonLabel : (this.hasFiles ? this.files.map(f => f.name).join(', ') : this.chooseButtonLabel);
|
|
@@ -439,24 +453,23 @@ const _hoisted_1 = {
|
|
|
439
453
|
};
|
|
440
454
|
const _hoisted_2 = { class: "p-fileupload-buttonbar" };
|
|
441
455
|
const _hoisted_3 = ["multiple", "accept", "disabled"];
|
|
442
|
-
const _hoisted_4 =
|
|
443
|
-
const _hoisted_5 = {
|
|
444
|
-
const _hoisted_6 = {
|
|
456
|
+
const _hoisted_4 = { class: "p-button-label" };
|
|
457
|
+
const _hoisted_5 = {
|
|
445
458
|
key: 1,
|
|
446
459
|
class: "p-fileupload-files"
|
|
447
460
|
};
|
|
448
|
-
const
|
|
449
|
-
const
|
|
450
|
-
const
|
|
461
|
+
const _hoisted_6 = ["alt", "src", "width"];
|
|
462
|
+
const _hoisted_7 = { class: "p-fileupload-filename" };
|
|
463
|
+
const _hoisted_8 = {
|
|
451
464
|
key: 2,
|
|
452
465
|
class: "p-fileupload-empty"
|
|
453
466
|
};
|
|
454
|
-
const
|
|
467
|
+
const _hoisted_9 = {
|
|
455
468
|
key: 1,
|
|
456
469
|
class: "p-fileupload p-fileupload-basic p-component"
|
|
457
470
|
};
|
|
458
|
-
const
|
|
459
|
-
const
|
|
471
|
+
const _hoisted_10 = { class: "p-button-label" };
|
|
472
|
+
const _hoisted_11 = ["accept", "disabled", "multiple"];
|
|
460
473
|
|
|
461
474
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
462
475
|
const _component_FileUploadButton = vue.resolveComponent("FileUploadButton");
|
|
@@ -484,8 +497,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
484
497
|
accept: $props.accept,
|
|
485
498
|
disabled: $options.chooseDisabled
|
|
486
499
|
}, null, 40, _hoisted_3),
|
|
487
|
-
|
|
488
|
-
|
|
500
|
+
vue.createElementVNode("span", {
|
|
501
|
+
class: vue.normalizeClass($options.advancedChooseIconClass)
|
|
502
|
+
}, null, 2),
|
|
503
|
+
vue.createElementVNode("span", _hoisted_4, vue.toDisplayString($options.chooseButtonLabel), 1)
|
|
489
504
|
], 38)), [
|
|
490
505
|
[_directive_ripple]
|
|
491
506
|
]),
|
|
@@ -493,19 +508,19 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
493
508
|
? (vue.openBlock(), vue.createBlock(_component_FileUploadButton, {
|
|
494
509
|
key: 0,
|
|
495
510
|
label: $options.uploadButtonLabel,
|
|
496
|
-
icon:
|
|
511
|
+
icon: $props.uploadIcon,
|
|
497
512
|
onClick: $options.upload,
|
|
498
513
|
disabled: $options.uploadDisabled
|
|
499
|
-
}, null, 8, ["label", "onClick", "disabled"]))
|
|
514
|
+
}, null, 8, ["label", "icon", "onClick", "disabled"]))
|
|
500
515
|
: vue.createCommentVNode("", true),
|
|
501
516
|
($props.showCancelButton)
|
|
502
517
|
? (vue.openBlock(), vue.createBlock(_component_FileUploadButton, {
|
|
503
518
|
key: 1,
|
|
504
519
|
label: $options.cancelButtonLabel,
|
|
505
|
-
icon:
|
|
520
|
+
icon: $props.cancelIcon,
|
|
506
521
|
onClick: $options.clear,
|
|
507
522
|
disabled: $options.cancelDisabled
|
|
508
|
-
}, null, 8, ["label", "onClick", "disabled"]))
|
|
523
|
+
}, null, 8, ["label", "icon", "onClick", "disabled"]))
|
|
509
524
|
: vue.createCommentVNode("", true)
|
|
510
525
|
]),
|
|
511
526
|
vue.createElementVNode("div", {
|
|
@@ -535,7 +550,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
535
550
|
}, 1032, ["onClose"]))
|
|
536
551
|
}), 128)),
|
|
537
552
|
($options.hasFiles)
|
|
538
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
553
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
539
554
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.files, (file, index) => {
|
|
540
555
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
541
556
|
class: "p-fileupload-row",
|
|
@@ -549,10 +564,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
549
564
|
alt: file.name,
|
|
550
565
|
src: file.objectURL,
|
|
551
566
|
width: $props.previewWidth
|
|
552
|
-
}, null, 8,
|
|
567
|
+
}, null, 8, _hoisted_6))
|
|
553
568
|
: vue.createCommentVNode("", true)
|
|
554
569
|
]),
|
|
555
|
-
vue.createElementVNode("div",
|
|
570
|
+
vue.createElementVNode("div", _hoisted_7, vue.toDisplayString(file.name), 1),
|
|
556
571
|
vue.createElementVNode("div", null, vue.toDisplayString($options.formatSize(file.size)), 1),
|
|
557
572
|
vue.createElementVNode("div", null, [
|
|
558
573
|
vue.createVNode(_component_FileUploadButton, {
|
|
@@ -566,14 +581,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
566
581
|
]))
|
|
567
582
|
: vue.createCommentVNode("", true),
|
|
568
583
|
(_ctx.$slots.empty && !$options.hasFiles)
|
|
569
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
584
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
570
585
|
vue.renderSlot(_ctx.$slots, "empty")
|
|
571
586
|
]))
|
|
572
587
|
: vue.createCommentVNode("", true)
|
|
573
588
|
], 544)
|
|
574
589
|
]))
|
|
575
590
|
: ($options.isBasic)
|
|
576
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
591
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
|
|
577
592
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.messages, (msg) => {
|
|
578
593
|
return (vue.openBlock(), vue.createBlock(_component_FileUploadMessage, {
|
|
579
594
|
severity: "error",
|
|
@@ -598,7 +613,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
598
613
|
vue.createElementVNode("span", {
|
|
599
614
|
class: vue.normalizeClass($options.basicChooseButtonIconClass)
|
|
600
615
|
}, null, 2),
|
|
601
|
-
vue.createElementVNode("span",
|
|
616
|
+
vue.createElementVNode("span", _hoisted_10, vue.toDisplayString($options.basicChooseButtonLabel), 1),
|
|
602
617
|
(!$options.hasFiles)
|
|
603
618
|
? (vue.openBlock(), vue.createElementBlock("input", {
|
|
604
619
|
key: 0,
|
|
@@ -610,7 +625,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
610
625
|
onChange: _cache[9] || (_cache[9] = (...args) => ($options.onFileSelect && $options.onFileSelect(...args))),
|
|
611
626
|
onFocus: _cache[10] || (_cache[10] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
612
627
|
onBlur: _cache[11] || (_cache[11] = (...args) => ($options.onBlur && $options.onBlur(...args)))
|
|
613
|
-
}, null, 40,
|
|
628
|
+
}, null, 40, _hoisted_11))
|
|
614
629
|
: vue.createCommentVNode("", true)
|
|
615
630
|
], 38)), [
|
|
616
631
|
[_directive_ripple]
|