primevue 3.24.0 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -176
- package/api/Api.d.ts +284 -292
- package/autocomplete/AutoComplete.d.ts +5 -5
- package/autocomplete/AutoComplete.vue +5 -5
- package/autocomplete/autocomplete.cjs.js +5 -5
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +5 -5
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +5 -5
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/BlockUI.d.ts +2 -0
- package/calendar/Calendar.d.ts +4 -4
- package/calendar/Calendar.vue +71 -17
- package/calendar/calendar.cjs.js +58 -20
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +58 -20
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +58 -20
- package/calendar/calendar.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +4 -4
- package/cascadeselect/CascadeSelect.vue +4 -4
- package/cascadeselect/cascadeselect.cjs.js +4 -4
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +4 -4
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +4 -4
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.vue +2 -2
- package/checkbox/checkbox.cjs.js +2 -2
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +2 -2
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +2 -2
- package/checkbox/checkbox.min.js +1 -1
- package/chips/Chips.d.ts +4 -3
- package/chips/Chips.vue +2 -2
- package/chips/chips.cjs.js +2 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -2
- package/chips/chips.min.js +1 -1
- package/column/Column.d.ts +9 -0
- package/confirmationoptions/ConfirmationOptions.d.ts +1 -0
- package/confirmdialog/ConfirmDialog.d.ts +5 -0
- package/confirmdialog/ConfirmDialog.vue +17 -1
- package/confirmdialog/confirmdialog.cjs.js +7 -2
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +7 -2
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +7 -2
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.vue +3 -0
- package/confirmpopup/confirmpopup.cjs.js +3 -0
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +3 -0
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +3 -0
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/core/core.js +22 -15
- package/core/core.min.js +4 -4
- package/datatable/DataTable.d.ts +9 -9
- package/datatable/FooterCell.vue +2 -2
- package/datatable/TableBody.vue +6 -1
- package/datatable/datatable.cjs.js +8 -3
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +8 -3
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +8 -3
- package/datatable/datatable.min.js +1 -1
- package/dialog/Dialog.vue +24 -7
- package/dialog/dialog.cjs.js +14 -7
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +14 -7
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +14 -7
- package/dialog/dialog.min.js +1 -1
- package/dropdown/Dropdown.d.ts +10 -4
- package/dropdown/Dropdown.vue +5 -5
- package/dropdown/dropdown.cjs.js +5 -5
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +5 -5
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +5 -5
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.vue +1 -1
- package/dynamicdialog/dynamicdialog.cjs.js +1 -1
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +2 -2
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +1 -1
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/editor/Editor.d.ts +1 -0
- package/inplace/Inplace.vue +5 -1
- package/inplace/inplace.cjs.js +10 -2
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +10 -3
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +11 -4
- package/inplace/inplace.min.js +1 -1
- package/inputmask/InputMask.vue +59 -49
- package/inputmask/inputmask.cjs.js +59 -49
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +59 -49
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +59 -49
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +2 -2
- package/inputnumber/InputNumber.vue +2 -2
- package/inputnumber/inputnumber.cjs.js +2 -2
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +2 -2
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +2 -2
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +3 -2
- package/inputswitch/InputSwitch.vue +2 -2
- package/inputswitch/inputswitch.cjs.js +2 -2
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +2 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +2 -2
- package/inputswitch/inputswitch.min.js +1 -1
- package/menuitem/MenuItem.d.ts +1 -1
- package/organizationchart/OrganizationChart.d.ts +3 -2
- package/package.json +1 -1
- package/panel/Panel.d.ts +4 -2
- package/password/Password.d.ts +4 -4
- package/password/Password.vue +4 -4
- package/password/password.cjs.js +4 -4
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +4 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +4 -4
- package/password/password.min.js +1 -1
- package/portal/Portal.d.ts +1 -0
- package/radiobutton/RadioButton.d.ts +3 -2
- package/radiobutton/RadioButton.vue +2 -2
- package/radiobutton/radiobutton.cjs.js +2 -2
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -2
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -2
- package/radiobutton/radiobutton.min.js +1 -1
- package/row/Row.d.ts +1 -1
- package/selectbutton/SelectButton.d.ts +1 -1
- package/selectbutton/SelectButton.vue +2 -2
- package/selectbutton/selectbutton.cjs.js +2 -2
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -2
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -2
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/Slider.vue +3 -14
- package/slider/slider.cjs.js +3 -14
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +3 -14
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +3 -14
- package/slider/slider.min.js +1 -1
- package/splitbutton/SplitButton.vue +4 -2
- package/splitbutton/splitbutton.cjs.js +6 -4
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +6 -4
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +6 -4
- package/splitbutton/splitbutton.min.js +1 -1
- package/textarea/Textarea.d.ts +1 -0
- package/tieredmenu/TieredMenu.d.ts +2 -0
- package/toast/Toast.d.ts +0 -1
- package/togglebutton/ToggleButton.d.ts +2 -2
- package/togglebutton/ToggleButton.vue +2 -2
- package/togglebutton/togglebutton.cjs.js +2 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.cjs.js +1 -1
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.d.ts +3 -0
- package/treeselect/TreeSelect.d.ts +2 -2
- package/treeselect/TreeSelect.vue +3 -3
- package/treeselect/treeselect.cjs.js +3 -3
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +3 -3
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +3 -3
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/TreeTable.d.ts +2 -0
- package/treetable/TreeTable.vue +3 -3
- package/treetable/treetable.cjs.js +3 -3
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +3 -3
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +3 -3
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.vue +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +1 -1
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/vetur-attributes.json +32 -28
- package/vetur-tags.json +2 -1
- package/web-types.json +40 -30
package/portal/Portal.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export interface RadioButtonProps {
|
|
|
28
28
|
name?: string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* When present, it specifies that the component should be disabled.
|
|
31
|
+
* @defaultValue false
|
|
31
32
|
*/
|
|
32
33
|
disabled?: boolean | undefined;
|
|
33
34
|
/**
|
|
@@ -37,11 +38,11 @@ export interface RadioButtonProps {
|
|
|
37
38
|
/**
|
|
38
39
|
* Inline style of the input field.
|
|
39
40
|
*/
|
|
40
|
-
inputStyle?:
|
|
41
|
+
inputStyle?: object | undefined;
|
|
41
42
|
/**
|
|
42
43
|
* Style class of the input field.
|
|
43
44
|
*/
|
|
44
|
-
inputClass?:
|
|
45
|
+
inputClass?: string | object | undefined;
|
|
45
46
|
/**
|
|
46
47
|
* Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
|
|
47
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),l=require("vue"),t={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:
|
|
1
|
+
"use strict";var e=require("primevue/utils"),l=require("vue"),t={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){this.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{checked(){return null!=this.modelValue&&e.ObjectUtils.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.disabled,"p-radiobutton-focused":this.focused}]}}};const a={class:"p-hidden-accessible"},i=["id","name","checked","disabled","value","aria-labelledby","aria-label"],u=[l.createElementVNode("div",{class:"p-radiobutton-icon"},null,-1)];t.render=function(e,t,s,d,n,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(o.containerClass),onClick:t[2]||(t[2]=e=>o.onClick(e))},[l.createElementVNode("div",a,[l.createElementVNode("input",l.mergeProps({ref:"input",id:s.inputId,type:"radio",class:s.inputClass,style:s.inputStyle,name:s.name,checked:o.checked,disabled:s.disabled,value:s.value,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e))},s.inputProps),null,16,i)]),l.createElementVNode("div",{ref:"box",class:l.normalizeClass(["p-radiobutton-box",{"p-highlight":o.checked,"p-disabled":s.disabled,"p-focus":n.focused}])},u,2)],2)},module.exports=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ObjectUtils as e}from"primevue/utils";import{openBlock as l,createElementBlock as t,normalizeClass as a,createElementVNode as i,mergeProps as u}from"vue";var d={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:
|
|
1
|
+
import{ObjectUtils as e}from"primevue/utils";import{openBlock as l,createElementBlock as t,normalizeClass as a,createElementVNode as i,mergeProps as u}from"vue";var d={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){this.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{checked(){return null!=this.modelValue&&e.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.disabled,"p-radiobutton-focused":this.focused}]}}};const s={class:"p-hidden-accessible"},n=["id","name","checked","disabled","value","aria-labelledby","aria-label"],o=[i("div",{class:"p-radiobutton-icon"},null,-1)];d.render=function(e,d,c,r,p,b){return l(),t("div",{class:a(b.containerClass),onClick:d[2]||(d[2]=e=>b.onClick(e))},[i("div",s,[i("input",u({ref:"input",id:c.inputId,type:"radio",class:c.inputClass,style:c.inputStyle,name:c.name,checked:b.checked,disabled:c.disabled,value:c.value,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onFocus:d[0]||(d[0]=(...e)=>b.onFocus&&b.onFocus(...e)),onBlur:d[1]||(d[1]=(...e)=>b.onBlur&&b.onBlur(...e))},c.inputProps),null,16,n)]),i("div",{ref:"box",class:a(["p-radiobutton-box",{"p-highlight":b.checked,"p-disabled":c.disabled,"p-focus":p.focused}])},o,2)],2)};export{d as default};
|
|
@@ -21,11 +21,11 @@ this.primevue.radiobutton = (function (utils, vue) {
|
|
|
21
21
|
default: null
|
|
22
22
|
},
|
|
23
23
|
inputClass: {
|
|
24
|
-
type: String,
|
|
24
|
+
type: [String, Object],
|
|
25
25
|
default: null
|
|
26
26
|
},
|
|
27
27
|
inputStyle: {
|
|
28
|
-
type:
|
|
28
|
+
type: Object,
|
|
29
29
|
default: null
|
|
30
30
|
},
|
|
31
31
|
inputProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.radiobutton=function(e,l){"use strict";var t={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.radiobutton=function(e,l){"use strict";var t={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(e){this.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{checked(){return null!=this.modelValue&&e.ObjectUtils.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.disabled,"p-radiobutton-focused":this.focused}]}}};const i={class:"p-hidden-accessible"},a=["id","name","checked","disabled","value","aria-labelledby","aria-label"],u=[l.createElementVNode("div",{class:"p-radiobutton-icon"},null,-1)];return t.render=function(e,t,n,s,d,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(o.containerClass),onClick:t[2]||(t[2]=e=>o.onClick(e))},[l.createElementVNode("div",i,[l.createElementVNode("input",l.mergeProps({ref:"input",id:n.inputId,type:"radio",class:n.inputClass,style:n.inputStyle,name:n.name,checked:o.checked,disabled:n.disabled,value:n.value,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e))},n.inputProps),null,16,a)]),l.createElementVNode("div",{ref:"box",class:l.normalizeClass(["p-radiobutton-box",{"p-highlight":o.checked,"p-disabled":n.disabled,"p-focus":d.focused}])},u,2)],2)},t}(primevue.utils,Vue);
|
package/row/Row.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export default {
|
|
|
38
38
|
multiple: Boolean,
|
|
39
39
|
unselectable: {
|
|
40
40
|
type: Boolean,
|
|
41
|
-
default:
|
|
41
|
+
default: false
|
|
42
42
|
},
|
|
43
43
|
disabled: Boolean,
|
|
44
44
|
dataKey: null,
|
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
|
|
86
86
|
let selected = this.isSelected(option);
|
|
87
87
|
|
|
88
|
-
if (selected &&
|
|
88
|
+
if (selected && this.unselectable) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -20,7 +20,7 @@ var script = {
|
|
|
20
20
|
multiple: Boolean,
|
|
21
21
|
unselectable: {
|
|
22
22
|
type: Boolean,
|
|
23
|
-
default:
|
|
23
|
+
default: false
|
|
24
24
|
},
|
|
25
25
|
disabled: Boolean,
|
|
26
26
|
dataKey: null,
|
|
@@ -67,7 +67,7 @@ var script = {
|
|
|
67
67
|
|
|
68
68
|
let selected = this.isSelected(option);
|
|
69
69
|
|
|
70
|
-
if (selected &&
|
|
70
|
+
if (selected && this.unselectable) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/ripple"),t=require("primevue/utils"),l=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n={name:"SelectButton",emits:["update:modelValue","focus","blur","change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,unselectable:{type:Boolean,default:!
|
|
1
|
+
"use strict";var e=require("primevue/ripple"),t=require("primevue/utils"),l=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n={name:"SelectButton",emits:["update:modelValue","focus","blur","change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,unselectable:{type:Boolean,default:!1},disabled:Boolean,dataKey:null,"aria-labelledby":{type:String,default:null}},data:()=>({focusedIndex:0}),mounted(){this.defaultTabIndexes()},methods:{defaultTabIndexes(){let e=t.DomHandler.find(this.$refs.container,".p-button"),l=t.DomHandler.findSingle(this.$refs.container,".p-highlight");for(let i=0;i<e.length;i++)(t.DomHandler.hasClass(e[i],"p-highlight")&&t.ObjectUtils.equals(e[i],l)||null===l&&0==i)&&(this.focusedIndex=i)},getOptionLabel(e){return this.optionLabel?t.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?t.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?t.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!!this.optionDisabled&&t.ObjectUtils.resolveFieldData(e,this.optionDisabled)},onOptionSelect(e,l,i){if(this.disabled||this.isOptionDisabled(l))return;let n=this.isSelected(l);if(n&&this.unselectable)return;let a,o=this.getOptionValue(l);a=this.multiple?n?this.modelValue.filter((e=>!t.ObjectUtils.equals(e,o,this.equalityKey))):this.modelValue?[...this.modelValue,o]:[o]:n?null:o,this.focusedIndex=i,this.$emit("update:modelValue",a),this.$emit("change",{event:e,value:a})},isSelected(e){let l=!1,i=this.getOptionValue(e);if(this.multiple){if(this.modelValue)for(let e of this.modelValue)if(t.ObjectUtils.equals(e,i,this.equalityKey)){l=!0;break}}else l=t.ObjectUtils.equals(this.modelValue,i,this.equalityKey);return l},onKeydown(e,t,l){switch(e.code){case"Space":this.onOptionSelect(e,t,l),e.preventDefault();break;case"ArrowDown":case"ArrowRight":this.changeTabIndexes(e,"next"),e.preventDefault();break;case"ArrowUp":case"ArrowLeft":this.changeTabIndexes(e,"prev"),e.preventDefault()}},changeTabIndexes(e,t){let l,i;for(let e=0;e<=this.$refs.container.children.length-1;e++)"0"===this.$refs.container.children[e].getAttribute("tabindex")&&(l={elem:this.$refs.container.children[e],index:e});i="prev"===t?0===l.index?this.$refs.container.children.length-1:l.index-1:l.index===this.$refs.container.children.length-1?0:l.index+1,this.focusedIndex=i,this.$refs.container.children[i].focus()},onFocus(e){this.$emit("focus",e)},onBlur(e,t){e.target&&e.relatedTarget&&e.target.parentElement!==e.relatedTarget.parentElement&&this.defaultTabIndexes(),this.$emit("blur",e,t)},getButtonClass(e){return["p-button p-component",{"p-highlight":this.isSelected(e),"p-disabled":this.isOptionDisabled(e)}]}},computed:{containerClass(){return["p-selectbutton p-buttonset p-component",{"p-disabled":this.disabled}]},equalityKey(){return this.optionValue?null:this.dataKey}},directives:{ripple:i(e).default}};const a=["aria-labelledby"],o=["tabindex","aria-label","role","aria-checked","aria-disabled","onClick","onKeydown","onBlur"],s={class:"p-button-label"};n.render=function(e,t,i,n,r,d){const u=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",{ref:"container",class:l.normalizeClass(d.containerClass),role:"group","aria-labelledby":e.ariaLabelledby},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.options,((n,a)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:d.getOptionRenderKey(n),tabindex:a===r.focusedIndex?"0":"-1","aria-label":d.getOptionLabel(n),role:i.multiple?"checkbox":"radio","aria-checked":d.isSelected(n),"aria-disabled":i.optionDisabled,class:l.normalizeClass(d.getButtonClass(n,a)),onClick:e=>d.onOptionSelect(e,n,a),onKeydown:e=>d.onKeydown(e,n,a),onFocus:t[0]||(t[0]=e=>d.onFocus(e)),onBlur:e=>d.onBlur(e,n)},[l.renderSlot(e.$slots,"option",{option:n,index:a},(()=>[l.createElementVNode("span",s,l.toDisplayString(d.getOptionLabel(n)),1)]))],42,o)),[[u]]))),128))],10,a)},module.exports=n;
|
|
@@ -14,7 +14,7 @@ var script = {
|
|
|
14
14
|
multiple: Boolean,
|
|
15
15
|
unselectable: {
|
|
16
16
|
type: Boolean,
|
|
17
|
-
default:
|
|
17
|
+
default: false
|
|
18
18
|
},
|
|
19
19
|
disabled: Boolean,
|
|
20
20
|
dataKey: null,
|
|
@@ -61,7 +61,7 @@ var script = {
|
|
|
61
61
|
|
|
62
62
|
let selected = this.isSelected(option);
|
|
63
63
|
|
|
64
|
-
if (selected &&
|
|
64
|
+
if (selected && this.unselectable) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/ripple";import{DomHandler as t,ObjectUtils as i}from"primevue/utils";import{resolveDirective as l,openBlock as n,createElementBlock as a,normalizeClass as o,Fragment as s,renderList as r,withDirectives as d,renderSlot as u,createElementVNode as h,toDisplayString as p}from"vue";var c={name:"SelectButton",emits:["update:modelValue","focus","blur","change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,unselectable:{type:Boolean,default:!
|
|
1
|
+
import e from"primevue/ripple";import{DomHandler as t,ObjectUtils as i}from"primevue/utils";import{resolveDirective as l,openBlock as n,createElementBlock as a,normalizeClass as o,Fragment as s,renderList as r,withDirectives as d,renderSlot as u,createElementVNode as h,toDisplayString as p}from"vue";var c={name:"SelectButton",emits:["update:modelValue","focus","blur","change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,unselectable:{type:Boolean,default:!1},disabled:Boolean,dataKey:null,"aria-labelledby":{type:String,default:null}},data:()=>({focusedIndex:0}),mounted(){this.defaultTabIndexes()},methods:{defaultTabIndexes(){let e=t.find(this.$refs.container,".p-button"),l=t.findSingle(this.$refs.container,".p-highlight");for(let n=0;n<e.length;n++)(t.hasClass(e[n],"p-highlight")&&i.equals(e[n],l)||null===l&&0==n)&&(this.focusedIndex=n)},getOptionLabel(e){return this.optionLabel?i.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?i.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?i.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!!this.optionDisabled&&i.resolveFieldData(e,this.optionDisabled)},onOptionSelect(e,t,l){if(this.disabled||this.isOptionDisabled(t))return;let n=this.isSelected(t);if(n&&this.unselectable)return;let a,o=this.getOptionValue(t);a=this.multiple?n?this.modelValue.filter((e=>!i.equals(e,o,this.equalityKey))):this.modelValue?[...this.modelValue,o]:[o]:n?null:o,this.focusedIndex=l,this.$emit("update:modelValue",a),this.$emit("change",{event:e,value:a})},isSelected(e){let t=!1,l=this.getOptionValue(e);if(this.multiple){if(this.modelValue)for(let e of this.modelValue)if(i.equals(e,l,this.equalityKey)){t=!0;break}}else t=i.equals(this.modelValue,l,this.equalityKey);return t},onKeydown(e,t,i){switch(e.code){case"Space":this.onOptionSelect(e,t,i),e.preventDefault();break;case"ArrowDown":case"ArrowRight":this.changeTabIndexes(e,"next"),e.preventDefault();break;case"ArrowUp":case"ArrowLeft":this.changeTabIndexes(e,"prev"),e.preventDefault()}},changeTabIndexes(e,t){let i,l;for(let e=0;e<=this.$refs.container.children.length-1;e++)"0"===this.$refs.container.children[e].getAttribute("tabindex")&&(i={elem:this.$refs.container.children[e],index:e});l="prev"===t?0===i.index?this.$refs.container.children.length-1:i.index-1:i.index===this.$refs.container.children.length-1?0:i.index+1,this.focusedIndex=l,this.$refs.container.children[l].focus()},onFocus(e){this.$emit("focus",e)},onBlur(e,t){e.target&&e.relatedTarget&&e.target.parentElement!==e.relatedTarget.parentElement&&this.defaultTabIndexes(),this.$emit("blur",e,t)},getButtonClass(e){return["p-button p-component",{"p-highlight":this.isSelected(e),"p-disabled":this.isOptionDisabled(e)}]}},computed:{containerClass(){return["p-selectbutton p-buttonset p-component",{"p-disabled":this.disabled}]},equalityKey(){return this.optionValue?null:this.dataKey}},directives:{ripple:e}};const b=["aria-labelledby"],f=["tabindex","aria-label","role","aria-checked","aria-disabled","onClick","onKeydown","onBlur"],g={class:"p-button-label"};c.render=function(e,t,i,c,m,y){const x=l("ripple");return n(),a("div",{ref:"container",class:o(y.containerClass),role:"group","aria-labelledby":e.ariaLabelledby},[(n(!0),a(s,null,r(i.options,((l,s)=>d((n(),a("div",{key:y.getOptionRenderKey(l),tabindex:s===m.focusedIndex?"0":"-1","aria-label":y.getOptionLabel(l),role:i.multiple?"checkbox":"radio","aria-checked":y.isSelected(l),"aria-disabled":i.optionDisabled,class:o(y.getButtonClass(l,s)),onClick:e=>y.onOptionSelect(e,l,s),onKeydown:e=>y.onKeydown(e,l,s),onFocus:t[0]||(t[0]=e=>y.onFocus(e)),onBlur:e=>y.onBlur(e,l)},[u(e.$slots,"option",{option:l,index:s},(()=>[h("span",g,p(y.getOptionLabel(l)),1)]))],42,f)),[[x]]))),128))],10,b)};export{c as default};
|
|
@@ -18,7 +18,7 @@ this.primevue.selectbutton = (function (Ripple, utils, vue) {
|
|
|
18
18
|
multiple: Boolean,
|
|
19
19
|
unselectable: {
|
|
20
20
|
type: Boolean,
|
|
21
|
-
default:
|
|
21
|
+
default: false
|
|
22
22
|
},
|
|
23
23
|
disabled: Boolean,
|
|
24
24
|
dataKey: null,
|
|
@@ -65,7 +65,7 @@ this.primevue.selectbutton = (function (Ripple, utils, vue) {
|
|
|
65
65
|
|
|
66
66
|
let selected = this.isSelected(option);
|
|
67
67
|
|
|
68
|
-
if (selected &&
|
|
68
|
+
if (selected && this.unselectable) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.selectbutton=function(e,t,l){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n={name:"SelectButton",emits:["update:modelValue","focus","blur","change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,unselectable:{type:Boolean,default:!
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.selectbutton=function(e,t,l){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n={name:"SelectButton",emits:["update:modelValue","focus","blur","change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,unselectable:{type:Boolean,default:!1},disabled:Boolean,dataKey:null,"aria-labelledby":{type:String,default:null}},data:()=>({focusedIndex:0}),mounted(){this.defaultTabIndexes()},methods:{defaultTabIndexes(){let e=t.DomHandler.find(this.$refs.container,".p-button"),l=t.DomHandler.findSingle(this.$refs.container,".p-highlight");for(let i=0;i<e.length;i++)(t.DomHandler.hasClass(e[i],"p-highlight")&&t.ObjectUtils.equals(e[i],l)||null===l&&0==i)&&(this.focusedIndex=i)},getOptionLabel(e){return this.optionLabel?t.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?t.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?t.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!!this.optionDisabled&&t.ObjectUtils.resolveFieldData(e,this.optionDisabled)},onOptionSelect(e,l,i){if(this.disabled||this.isOptionDisabled(l))return;let n=this.isSelected(l);if(n&&this.unselectable)return;let a,s=this.getOptionValue(l);a=this.multiple?n?this.modelValue.filter((e=>!t.ObjectUtils.equals(e,s,this.equalityKey))):this.modelValue?[...this.modelValue,s]:[s]:n?null:s,this.focusedIndex=i,this.$emit("update:modelValue",a),this.$emit("change",{event:e,value:a})},isSelected(e){let l=!1,i=this.getOptionValue(e);if(this.multiple){if(this.modelValue)for(let e of this.modelValue)if(t.ObjectUtils.equals(e,i,this.equalityKey)){l=!0;break}}else l=t.ObjectUtils.equals(this.modelValue,i,this.equalityKey);return l},onKeydown(e,t,l){switch(e.code){case"Space":this.onOptionSelect(e,t,l),e.preventDefault();break;case"ArrowDown":case"ArrowRight":this.changeTabIndexes(e,"next"),e.preventDefault();break;case"ArrowUp":case"ArrowLeft":this.changeTabIndexes(e,"prev"),e.preventDefault()}},changeTabIndexes(e,t){let l,i;for(let e=0;e<=this.$refs.container.children.length-1;e++)"0"===this.$refs.container.children[e].getAttribute("tabindex")&&(l={elem:this.$refs.container.children[e],index:e});i="prev"===t?0===l.index?this.$refs.container.children.length-1:l.index-1:l.index===this.$refs.container.children.length-1?0:l.index+1,this.focusedIndex=i,this.$refs.container.children[i].focus()},onFocus(e){this.$emit("focus",e)},onBlur(e,t){e.target&&e.relatedTarget&&e.target.parentElement!==e.relatedTarget.parentElement&&this.defaultTabIndexes(),this.$emit("blur",e,t)},getButtonClass(e){return["p-button p-component",{"p-highlight":this.isSelected(e),"p-disabled":this.isOptionDisabled(e)}]}},computed:{containerClass(){return["p-selectbutton p-buttonset p-component",{"p-disabled":this.disabled}]},equalityKey(){return this.optionValue?null:this.dataKey}},directives:{ripple:i(e).default}};const a=["aria-labelledby"],s=["tabindex","aria-label","role","aria-checked","aria-disabled","onClick","onKeydown","onBlur"],o={class:"p-button-label"};return n.render=function(e,t,i,n,r,d){const u=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",{ref:"container",class:l.normalizeClass(d.containerClass),role:"group","aria-labelledby":e.ariaLabelledby},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.options,((n,a)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:d.getOptionRenderKey(n),tabindex:a===r.focusedIndex?"0":"-1","aria-label":d.getOptionLabel(n),role:i.multiple?"checkbox":"radio","aria-checked":d.isSelected(n),"aria-disabled":i.optionDisabled,class:l.normalizeClass(d.getButtonClass(n,a)),onClick:e=>d.onOptionSelect(e,n,a),onKeydown:e=>d.onKeydown(e,n,a),onFocus:t[0]||(t[0]=e=>d.onFocus(e)),onBlur:e=>d.onBlur(e,n)},[l.renderSlot(e.$slots,"option",{option:n,index:a},(()=>[l.createElementVNode("span",o,l.toDisplayString(d.getOptionLabel(n)),1)]))],42,s)),[[u]]))),128))],10,a)},n}(primevue.ripple,primevue.utils,Vue);
|
package/slider/Slider.vue
CHANGED
|
@@ -155,24 +155,12 @@ export default {
|
|
|
155
155
|
if (newValue < this.min) newValue = this.min;
|
|
156
156
|
else if (newValue >= this.max) newValue = this.max;
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
modelValue[1] = newValue;
|
|
160
|
-
|
|
161
|
-
this.handleIndex = 1;
|
|
162
|
-
} else {
|
|
163
|
-
modelValue[0] = newValue;
|
|
164
|
-
}
|
|
158
|
+
modelValue[0] = newValue;
|
|
165
159
|
} else {
|
|
166
160
|
if (newValue > this.max) newValue = this.max;
|
|
167
161
|
else if (newValue <= this.min) newValue = this.min;
|
|
168
162
|
|
|
169
|
-
|
|
170
|
-
modelValue[0] = newValue;
|
|
171
|
-
|
|
172
|
-
this.handleIndex = 0;
|
|
173
|
-
} else {
|
|
174
|
-
modelValue[1] = newValue;
|
|
175
|
-
}
|
|
163
|
+
modelValue[1] = newValue;
|
|
176
164
|
}
|
|
177
165
|
} else {
|
|
178
166
|
if (newValue < this.min) newValue = this.min;
|
|
@@ -199,6 +187,7 @@ export default {
|
|
|
199
187
|
this.handleIndex = index;
|
|
200
188
|
}
|
|
201
189
|
|
|
190
|
+
event.currentTarget.focus();
|
|
202
191
|
event.preventDefault();
|
|
203
192
|
},
|
|
204
193
|
onDrag(event) {
|
package/slider/slider.cjs.js
CHANGED
|
@@ -97,24 +97,12 @@ var script = {
|
|
|
97
97
|
if (newValue < this.min) newValue = this.min;
|
|
98
98
|
else if (newValue >= this.max) newValue = this.max;
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
modelValue[1] = newValue;
|
|
102
|
-
|
|
103
|
-
this.handleIndex = 1;
|
|
104
|
-
} else {
|
|
105
|
-
modelValue[0] = newValue;
|
|
106
|
-
}
|
|
100
|
+
modelValue[0] = newValue;
|
|
107
101
|
} else {
|
|
108
102
|
if (newValue > this.max) newValue = this.max;
|
|
109
103
|
else if (newValue <= this.min) newValue = this.min;
|
|
110
104
|
|
|
111
|
-
|
|
112
|
-
modelValue[0] = newValue;
|
|
113
|
-
|
|
114
|
-
this.handleIndex = 0;
|
|
115
|
-
} else {
|
|
116
|
-
modelValue[1] = newValue;
|
|
117
|
-
}
|
|
105
|
+
modelValue[1] = newValue;
|
|
118
106
|
}
|
|
119
107
|
} else {
|
|
120
108
|
if (newValue < this.min) newValue = this.min;
|
|
@@ -141,6 +129,7 @@ var script = {
|
|
|
141
129
|
this.handleIndex = index;
|
|
142
130
|
}
|
|
143
131
|
|
|
132
|
+
event.currentTarget.focus();
|
|
144
133
|
event.preventDefault();
|
|
145
134
|
},
|
|
146
135
|
onDrag(event) {
|
package/slider/slider.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("vue"),i={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+e.DomHandler.getWindowScrollLeft(),this.initY=t.top+e.DomHandler.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(e){let t,i=e.touches?e.touches[0].pageX:e.pageX,a=e.touches?e.touches[0].pageY:e.pageY;t="horizontal"===this.orientation?100*(i-this.initX)/this.barWidth:100*(this.initY+this.barHeight-a)/this.barHeight;let n=(this.max-this.min)*(t/100)+this.min;if(this.step){const e=this.range?this.modelValue[this.handleIndex]:this.modelValue,t=n-e;t<0?n=e+Math.ceil(n/this.step-e/this.step)*this.step:t>0&&(n=e+Math.floor(n/this.step-e/this.step)*this.step)}else n=Math.floor(n);this.updateModel(e,n)},updateModel(e,t){let i,a=parseFloat(t.toFixed(10));this.range?(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("vue"),i={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+e.DomHandler.getWindowScrollLeft(),this.initY=t.top+e.DomHandler.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(e){let t,i=e.touches?e.touches[0].pageX:e.pageX,a=e.touches?e.touches[0].pageY:e.pageY;t="horizontal"===this.orientation?100*(i-this.initX)/this.barWidth:100*(this.initY+this.barHeight-a)/this.barHeight;let n=(this.max-this.min)*(t/100)+this.min;if(this.step){const e=this.range?this.modelValue[this.handleIndex]:this.modelValue,t=n-e;t<0?n=e+Math.ceil(n/this.step-e/this.step)*this.step:t>0&&(n=e+Math.floor(n/this.step-e/this.step)*this.step)}else n=Math.floor(n);this.updateModel(e,n)},updateModel(e,t){let i,a=parseFloat(t.toFixed(10));this.range?(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),i[0]=a):(a>this.max?a=this.max:a<=this.min&&(a=this.min),i[1]=a)):(a<this.min?a=this.min:a>this.max&&(a=this.max),i=a),this.$emit("update:modelValue",i),this.$emit("change",i)},onDragStart(t,i){this.disabled||(e.DomHandler.addClass(this.$el,"p-slider-sliding"),this.dragging=!0,this.updateDomData(),this.range&&this.modelValue[0]===this.max?this.handleIndex=0:this.handleIndex=i,t.currentTarget.focus(),t.preventDefault())},onDrag(e){this.dragging&&(this.setValue(e),e.preventDefault())},onDragEnd(t){this.dragging&&(this.dragging=!1,e.DomHandler.removeClass(this.$el,"p-slider-sliding"),this.$emit("slideend",{originalEvent:t,value:this.modelValue}))},onBarClick(t){this.disabled||e.DomHandler.hasClass(t.target,"p-slider-handle")||(this.updateDomData(),this.setValue(t))},onMouseDown(e,t){this.bindDragListeners(),this.onDragStart(e,t)},onKeyDown(e,t){switch(this.handleIndex=t,e.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(e,t),e.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(e,t),e.preventDefault();break;case"PageDown":this.decrementValue(e,t,!0),e.preventDefault();break;case"PageUp":this.incrementValue(e,t,!0),e.preventDefault();break;case"Home":this.updateModel(e,this.min),e.preventDefault();break;case"End":this.updateModel(e,this.max),e.preventDefault()}},decrementValue(e,t,i=!1){let a;a=this.range?this.step?this.modelValue[t]-this.step:this.modelValue[t]-1:this.step?this.modelValue-this.step:!this.step&&i?this.modelValue-10:this.modelValue-1,this.updateModel(e,a),e.preventDefault()},incrementValue(e,t,i=!1){let a;a=this.range?this.step?this.modelValue[t]+this.step:this.modelValue[t]+1:this.step?this.modelValue+this.step:!this.step&&i?this.modelValue+10:this.modelValue+1,this.updateModel(e,a),e.preventDefault()},bindDragListeners(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},computed:{containerClass(){return["p-slider p-component",{"p-disabled":this.disabled,"p-slider-horizontal":"horizontal"===this.orientation,"p-slider-vertical":"vertical"===this.orientation}]},horizontal(){return"horizontal"===this.orientation},vertical(){return"vertical"===this.orientation},rangeStyle(){if(this.range){const e=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,t=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{left:t+"%",width:e+"%"}:{bottom:t+"%",height:e+"%"}}return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle(){return this.horizontal?{left:this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},handlePosition(){return this.modelValue<this.min?0:this.modelValue>this.max?100:100*(this.modelValue-this.min)/(this.max-this.min)},rangeStartPosition(){return this.modelValue&&this.modelValue[0]?100*(this.modelValue[0]<this.min?0:this.modelValue[0]-this.min)/(this.max-this.min):0},rangeEndPosition(){return this.modelValue&&2===this.modelValue.length?100*(this.modelValue[1]>this.max?100:this.modelValue[1]-this.min)/(this.max-this.min):100},rangeStartHandleStyle(){return this.horizontal?{left:this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle(){return this.horizontal?{left:this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}}};const a=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],n=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],l=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-slider {\n position: relative;\n}\n.p-slider .p-slider-handle {\n position: absolute;\n cursor: grab;\n touch-action: none;\n display: block;\n}\n.p-slider-range {\n position: absolute;\n display: block;\n}\n.p-slider-horizontal .p-slider-range {\n top: 0;\n left: 0;\n height: 100%;\n}\n.p-slider-horizontal .p-slider-handle {\n top: 50%;\n}\n.p-slider-vertical {\n height: 100px;\n}\n.p-slider-vertical .p-slider-handle {\n left: 50%;\n}\n.p-slider-vertical .p-slider-range {\n bottom: 0;\n left: 0;\n width: 100%;\n}\n"),i.render=function(e,i,s,r,o,d){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(d.containerClass),onClick:i[15]||(i[15]=(...e)=>d.onBarClick&&d.onBarClick(...e))},[t.createElementVNode("span",{class:"p-slider-range",style:t.normalizeStyle(d.rangeStyle)},null,4),s.range?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:"p-slider-handle",style:t.normalizeStyle(d.handleStyle),onTouchstart:i[0]||(i[0]=e=>d.onDragStart(e)),onTouchmove:i[1]||(i[1]=e=>d.onDrag(e)),onTouchend:i[2]||(i[2]=e=>d.onDragEnd(e)),onMousedown:i[3]||(i[3]=e=>d.onMouseDown(e)),onKeydown:i[4]||(i[4]=e=>d.onKeyDown(e)),tabindex:s.tabindex,role:"slider","aria-valuemin":s.min,"aria-valuenow":s.modelValue,"aria-valuemax":s.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":s.orientation},null,44,a)),s.range?(t.openBlock(),t.createElementBlock("span",{key:1,class:"p-slider-handle",style:t.normalizeStyle(d.rangeStartHandleStyle),onTouchstart:i[5]||(i[5]=e=>d.onDragStart(e,0)),onTouchmove:i[6]||(i[6]=e=>d.onDrag(e)),onTouchend:i[7]||(i[7]=e=>d.onDragEnd(e)),onMousedown:i[8]||(i[8]=e=>d.onMouseDown(e,0)),onKeydown:i[9]||(i[9]=e=>d.onKeyDown(e,0)),tabindex:s.tabindex,role:"slider","aria-valuemin":s.min,"aria-valuenow":s.modelValue?s.modelValue[0]:null,"aria-valuemax":s.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":s.orientation},null,44,n)):t.createCommentVNode("",!0),s.range?(t.openBlock(),t.createElementBlock("span",{key:2,class:"p-slider-handle",style:t.normalizeStyle(d.rangeEndHandleStyle),onTouchstart:i[10]||(i[10]=e=>d.onDragStart(e,1)),onTouchmove:i[11]||(i[11]=e=>d.onDrag(e)),onTouchend:i[12]||(i[12]=e=>d.onDragEnd(e)),onMousedown:i[13]||(i[13]=e=>d.onMouseDown(e,1)),onKeydown:i[14]||(i[14]=e=>d.onKeyDown(e,1)),tabindex:s.tabindex,role:"slider","aria-valuemin":s.min,"aria-valuenow":s.modelValue?s.modelValue[1]:null,"aria-valuemax":s.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":s.orientation},null,44,l)):t.createCommentVNode("",!0)],2)},module.exports=i;
|
package/slider/slider.esm.js
CHANGED
|
@@ -95,24 +95,12 @@ var script = {
|
|
|
95
95
|
if (newValue < this.min) newValue = this.min;
|
|
96
96
|
else if (newValue >= this.max) newValue = this.max;
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
modelValue[1] = newValue;
|
|
100
|
-
|
|
101
|
-
this.handleIndex = 1;
|
|
102
|
-
} else {
|
|
103
|
-
modelValue[0] = newValue;
|
|
104
|
-
}
|
|
98
|
+
modelValue[0] = newValue;
|
|
105
99
|
} else {
|
|
106
100
|
if (newValue > this.max) newValue = this.max;
|
|
107
101
|
else if (newValue <= this.min) newValue = this.min;
|
|
108
102
|
|
|
109
|
-
|
|
110
|
-
modelValue[0] = newValue;
|
|
111
|
-
|
|
112
|
-
this.handleIndex = 0;
|
|
113
|
-
} else {
|
|
114
|
-
modelValue[1] = newValue;
|
|
115
|
-
}
|
|
103
|
+
modelValue[1] = newValue;
|
|
116
104
|
}
|
|
117
105
|
} else {
|
|
118
106
|
if (newValue < this.min) newValue = this.min;
|
|
@@ -139,6 +127,7 @@ var script = {
|
|
|
139
127
|
this.handleIndex = index;
|
|
140
128
|
}
|
|
141
129
|
|
|
130
|
+
event.currentTarget.focus();
|
|
142
131
|
event.preventDefault();
|
|
143
132
|
},
|
|
144
133
|
onDrag(event) {
|
package/slider/slider.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DomHandler as e}from"primevue/utils";import{openBlock as t,createElementBlock as i,normalizeClass as a,createElementVNode as n,normalizeStyle as l,createCommentVNode as s}from"vue";var r={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+e.getWindowScrollLeft(),this.initY=t.top+e.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(e){let t,i=e.touches?e.touches[0].pageX:e.pageX,a=e.touches?e.touches[0].pageY:e.pageY;t="horizontal"===this.orientation?100*(i-this.initX)/this.barWidth:100*(this.initY+this.barHeight-a)/this.barHeight;let n=(this.max-this.min)*(t/100)+this.min;if(this.step){const e=this.range?this.modelValue[this.handleIndex]:this.modelValue,t=n-e;t<0?n=e+Math.ceil(n/this.step-e/this.step)*this.step:t>0&&(n=e+Math.floor(n/this.step-e/this.step)*this.step)}else n=Math.floor(n);this.updateModel(e,n)},updateModel(e,t){let i,a=parseFloat(t.toFixed(10));this.range?(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),
|
|
1
|
+
import{DomHandler as e}from"primevue/utils";import{openBlock as t,createElementBlock as i,normalizeClass as a,createElementVNode as n,normalizeStyle as l,createCommentVNode as s}from"vue";var r={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+e.getWindowScrollLeft(),this.initY=t.top+e.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(e){let t,i=e.touches?e.touches[0].pageX:e.pageX,a=e.touches?e.touches[0].pageY:e.pageY;t="horizontal"===this.orientation?100*(i-this.initX)/this.barWidth:100*(this.initY+this.barHeight-a)/this.barHeight;let n=(this.max-this.min)*(t/100)+this.min;if(this.step){const e=this.range?this.modelValue[this.handleIndex]:this.modelValue,t=n-e;t<0?n=e+Math.ceil(n/this.step-e/this.step)*this.step:t>0&&(n=e+Math.floor(n/this.step-e/this.step)*this.step)}else n=Math.floor(n);this.updateModel(e,n)},updateModel(e,t){let i,a=parseFloat(t.toFixed(10));this.range?(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),i[0]=a):(a>this.max?a=this.max:a<=this.min&&(a=this.min),i[1]=a)):(a<this.min?a=this.min:a>this.max&&(a=this.max),i=a),this.$emit("update:modelValue",i),this.$emit("change",i)},onDragStart(t,i){this.disabled||(e.addClass(this.$el,"p-slider-sliding"),this.dragging=!0,this.updateDomData(),this.range&&this.modelValue[0]===this.max?this.handleIndex=0:this.handleIndex=i,t.currentTarget.focus(),t.preventDefault())},onDrag(e){this.dragging&&(this.setValue(e),e.preventDefault())},onDragEnd(t){this.dragging&&(this.dragging=!1,e.removeClass(this.$el,"p-slider-sliding"),this.$emit("slideend",{originalEvent:t,value:this.modelValue}))},onBarClick(t){this.disabled||e.hasClass(t.target,"p-slider-handle")||(this.updateDomData(),this.setValue(t))},onMouseDown(e,t){this.bindDragListeners(),this.onDragStart(e,t)},onKeyDown(e,t){switch(this.handleIndex=t,e.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(e,t),e.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(e,t),e.preventDefault();break;case"PageDown":this.decrementValue(e,t,!0),e.preventDefault();break;case"PageUp":this.incrementValue(e,t,!0),e.preventDefault();break;case"Home":this.updateModel(e,this.min),e.preventDefault();break;case"End":this.updateModel(e,this.max),e.preventDefault()}},decrementValue(e,t,i=!1){let a;a=this.range?this.step?this.modelValue[t]-this.step:this.modelValue[t]-1:this.step?this.modelValue-this.step:!this.step&&i?this.modelValue-10:this.modelValue-1,this.updateModel(e,a),e.preventDefault()},incrementValue(e,t,i=!1){let a;a=this.range?this.step?this.modelValue[t]+this.step:this.modelValue[t]+1:this.step?this.modelValue+this.step:!this.step&&i?this.modelValue+10:this.modelValue+1,this.updateModel(e,a),e.preventDefault()},bindDragListeners(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},computed:{containerClass(){return["p-slider p-component",{"p-disabled":this.disabled,"p-slider-horizontal":"horizontal"===this.orientation,"p-slider-vertical":"vertical"===this.orientation}]},horizontal(){return"horizontal"===this.orientation},vertical(){return"vertical"===this.orientation},rangeStyle(){if(this.range){const e=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,t=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{left:t+"%",width:e+"%"}:{bottom:t+"%",height:e+"%"}}return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle(){return this.horizontal?{left:this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},handlePosition(){return this.modelValue<this.min?0:this.modelValue>this.max?100:100*(this.modelValue-this.min)/(this.max-this.min)},rangeStartPosition(){return this.modelValue&&this.modelValue[0]?100*(this.modelValue[0]<this.min?0:this.modelValue[0]-this.min)/(this.max-this.min):0},rangeEndPosition(){return this.modelValue&&2===this.modelValue.length?100*(this.modelValue[1]>this.max?100:this.modelValue[1]-this.min)/(this.max-this.min):100},rangeStartHandleStyle(){return this.horizontal?{left:this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle(){return this.horizontal?{left:this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}}};const o=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],d=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],h=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-slider {\n position: relative;\n}\n.p-slider .p-slider-handle {\n position: absolute;\n cursor: grab;\n touch-action: none;\n display: block;\n}\n.p-slider-range {\n position: absolute;\n display: block;\n}\n.p-slider-horizontal .p-slider-range {\n top: 0;\n left: 0;\n height: 100%;\n}\n.p-slider-horizontal .p-slider-handle {\n top: 50%;\n}\n.p-slider-vertical {\n height: 100px;\n}\n.p-slider-vertical .p-slider-handle {\n left: 50%;\n}\n.p-slider-vertical .p-slider-range {\n bottom: 0;\n left: 0;\n width: 100%;\n}\n"),r.render=function(e,r,u,m,g,p){return t(),i("div",{class:a(p.containerClass),onClick:r[15]||(r[15]=(...e)=>p.onBarClick&&p.onBarClick(...e))},[n("span",{class:"p-slider-range",style:l(p.rangeStyle)},null,4),u.range?s("",!0):(t(),i("span",{key:0,class:"p-slider-handle",style:l(p.handleStyle),onTouchstart:r[0]||(r[0]=e=>p.onDragStart(e)),onTouchmove:r[1]||(r[1]=e=>p.onDrag(e)),onTouchend:r[2]||(r[2]=e=>p.onDragEnd(e)),onMousedown:r[3]||(r[3]=e=>p.onMouseDown(e)),onKeydown:r[4]||(r[4]=e=>p.onKeyDown(e)),tabindex:u.tabindex,role:"slider","aria-valuemin":u.min,"aria-valuenow":u.modelValue,"aria-valuemax":u.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":u.orientation},null,44,o)),u.range?(t(),i("span",{key:1,class:"p-slider-handle",style:l(p.rangeStartHandleStyle),onTouchstart:r[5]||(r[5]=e=>p.onDragStart(e,0)),onTouchmove:r[6]||(r[6]=e=>p.onDrag(e)),onTouchend:r[7]||(r[7]=e=>p.onDragEnd(e)),onMousedown:r[8]||(r[8]=e=>p.onMouseDown(e,0)),onKeydown:r[9]||(r[9]=e=>p.onKeyDown(e,0)),tabindex:u.tabindex,role:"slider","aria-valuemin":u.min,"aria-valuenow":u.modelValue?u.modelValue[0]:null,"aria-valuemax":u.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":u.orientation},null,44,d)):s("",!0),u.range?(t(),i("span",{key:2,class:"p-slider-handle",style:l(p.rangeEndHandleStyle),onTouchstart:r[10]||(r[10]=e=>p.onDragStart(e,1)),onTouchmove:r[11]||(r[11]=e=>p.onDrag(e)),onTouchend:r[12]||(r[12]=e=>p.onDragEnd(e)),onMousedown:r[13]||(r[13]=e=>p.onMouseDown(e,1)),onKeydown:r[14]||(r[14]=e=>p.onKeyDown(e,1)),tabindex:u.tabindex,role:"slider","aria-valuemin":u.min,"aria-valuenow":u.modelValue?u.modelValue[1]:null,"aria-valuemax":u.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":u.orientation},null,44,h)):s("",!0)],2)};export{r as default};
|
package/slider/slider.js
CHANGED
|
@@ -96,24 +96,12 @@ this.primevue.slider = (function (utils, vue) {
|
|
|
96
96
|
if (newValue < this.min) newValue = this.min;
|
|
97
97
|
else if (newValue >= this.max) newValue = this.max;
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
modelValue[1] = newValue;
|
|
101
|
-
|
|
102
|
-
this.handleIndex = 1;
|
|
103
|
-
} else {
|
|
104
|
-
modelValue[0] = newValue;
|
|
105
|
-
}
|
|
99
|
+
modelValue[0] = newValue;
|
|
106
100
|
} else {
|
|
107
101
|
if (newValue > this.max) newValue = this.max;
|
|
108
102
|
else if (newValue <= this.min) newValue = this.min;
|
|
109
103
|
|
|
110
|
-
|
|
111
|
-
modelValue[0] = newValue;
|
|
112
|
-
|
|
113
|
-
this.handleIndex = 0;
|
|
114
|
-
} else {
|
|
115
|
-
modelValue[1] = newValue;
|
|
116
|
-
}
|
|
104
|
+
modelValue[1] = newValue;
|
|
117
105
|
}
|
|
118
106
|
} else {
|
|
119
107
|
if (newValue < this.min) newValue = this.min;
|
|
@@ -140,6 +128,7 @@ this.primevue.slider = (function (utils, vue) {
|
|
|
140
128
|
this.handleIndex = index;
|
|
141
129
|
}
|
|
142
130
|
|
|
131
|
+
event.currentTarget.focus();
|
|
143
132
|
event.preventDefault();
|
|
144
133
|
},
|
|
145
134
|
onDrag(event) {
|
package/slider/slider.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.slider=function(e,t){"use strict";var i={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+e.DomHandler.getWindowScrollLeft(),this.initY=t.top+e.DomHandler.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(e){let t,i=e.touches?e.touches[0].pageX:e.pageX,a=e.touches?e.touches[0].pageY:e.pageY;t="horizontal"===this.orientation?100*(i-this.initX)/this.barWidth:100*(this.initY+this.barHeight-a)/this.barHeight;let n=(this.max-this.min)*(t/100)+this.min;if(this.step){const e=this.range?this.modelValue[this.handleIndex]:this.modelValue,t=n-e;t<0?n=e+Math.ceil(n/this.step-e/this.step)*this.step:t>0&&(n=e+Math.floor(n/this.step-e/this.step)*this.step)}else n=Math.floor(n);this.updateModel(e,n)},updateModel(e,t){let i,a=parseFloat(t.toFixed(10));this.range?(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.slider=function(e,t){"use strict";var i={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+e.DomHandler.getWindowScrollLeft(),this.initY=t.top+e.DomHandler.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(e){let t,i=e.touches?e.touches[0].pageX:e.pageX,a=e.touches?e.touches[0].pageY:e.pageY;t="horizontal"===this.orientation?100*(i-this.initX)/this.barWidth:100*(this.initY+this.barHeight-a)/this.barHeight;let n=(this.max-this.min)*(t/100)+this.min;if(this.step){const e=this.range?this.modelValue[this.handleIndex]:this.modelValue,t=n-e;t<0?n=e+Math.ceil(n/this.step-e/this.step)*this.step:t>0&&(n=e+Math.floor(n/this.step-e/this.step)*this.step)}else n=Math.floor(n);this.updateModel(e,n)},updateModel(e,t){let i,a=parseFloat(t.toFixed(10));this.range?(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),i[0]=a):(a>this.max?a=this.max:a<=this.min&&(a=this.min),i[1]=a)):(a<this.min?a=this.min:a>this.max&&(a=this.max),i=a),this.$emit("update:modelValue",i),this.$emit("change",i)},onDragStart(t,i){this.disabled||(e.DomHandler.addClass(this.$el,"p-slider-sliding"),this.dragging=!0,this.updateDomData(),this.range&&this.modelValue[0]===this.max?this.handleIndex=0:this.handleIndex=i,t.currentTarget.focus(),t.preventDefault())},onDrag(e){this.dragging&&(this.setValue(e),e.preventDefault())},onDragEnd(t){this.dragging&&(this.dragging=!1,e.DomHandler.removeClass(this.$el,"p-slider-sliding"),this.$emit("slideend",{originalEvent:t,value:this.modelValue}))},onBarClick(t){this.disabled||e.DomHandler.hasClass(t.target,"p-slider-handle")||(this.updateDomData(),this.setValue(t))},onMouseDown(e,t){this.bindDragListeners(),this.onDragStart(e,t)},onKeyDown(e,t){switch(this.handleIndex=t,e.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(e,t),e.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(e,t),e.preventDefault();break;case"PageDown":this.decrementValue(e,t,!0),e.preventDefault();break;case"PageUp":this.incrementValue(e,t,!0),e.preventDefault();break;case"Home":this.updateModel(e,this.min),e.preventDefault();break;case"End":this.updateModel(e,this.max),e.preventDefault()}},decrementValue(e,t,i=!1){let a;a=this.range?this.step?this.modelValue[t]-this.step:this.modelValue[t]-1:this.step?this.modelValue-this.step:!this.step&&i?this.modelValue-10:this.modelValue-1,this.updateModel(e,a),e.preventDefault()},incrementValue(e,t,i=!1){let a;a=this.range?this.step?this.modelValue[t]+this.step:this.modelValue[t]+1:this.step?this.modelValue+this.step:!this.step&&i?this.modelValue+10:this.modelValue+1,this.updateModel(e,a),e.preventDefault()},bindDragListeners(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},computed:{containerClass(){return["p-slider p-component",{"p-disabled":this.disabled,"p-slider-horizontal":"horizontal"===this.orientation,"p-slider-vertical":"vertical"===this.orientation}]},horizontal(){return"horizontal"===this.orientation},vertical(){return"vertical"===this.orientation},rangeStyle(){if(this.range){const e=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,t=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{left:t+"%",width:e+"%"}:{bottom:t+"%",height:e+"%"}}return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle(){return this.horizontal?{left:this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},handlePosition(){return this.modelValue<this.min?0:this.modelValue>this.max?100:100*(this.modelValue-this.min)/(this.max-this.min)},rangeStartPosition(){return this.modelValue&&this.modelValue[0]?100*(this.modelValue[0]<this.min?0:this.modelValue[0]-this.min)/(this.max-this.min):0},rangeEndPosition(){return this.modelValue&&2===this.modelValue.length?100*(this.modelValue[1]>this.max?100:this.modelValue[1]-this.min)/(this.max-this.min):100},rangeStartHandleStyle(){return this.horizontal?{left:this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle(){return this.horizontal?{left:this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}}};const a=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],n=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],l=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-slider {\n position: relative;\n}\n.p-slider .p-slider-handle {\n position: absolute;\n cursor: grab;\n touch-action: none;\n display: block;\n}\n.p-slider-range {\n position: absolute;\n display: block;\n}\n.p-slider-horizontal .p-slider-range {\n top: 0;\n left: 0;\n height: 100%;\n}\n.p-slider-horizontal .p-slider-handle {\n top: 50%;\n}\n.p-slider-vertical {\n height: 100px;\n}\n.p-slider-vertical .p-slider-handle {\n left: 50%;\n}\n.p-slider-vertical .p-slider-range {\n bottom: 0;\n left: 0;\n width: 100%;\n}\n"),i.render=function(e,i,s,r,o,d){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(d.containerClass),onClick:i[15]||(i[15]=(...e)=>d.onBarClick&&d.onBarClick(...e))},[t.createElementVNode("span",{class:"p-slider-range",style:t.normalizeStyle(d.rangeStyle)},null,4),s.range?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:"p-slider-handle",style:t.normalizeStyle(d.handleStyle),onTouchstart:i[0]||(i[0]=e=>d.onDragStart(e)),onTouchmove:i[1]||(i[1]=e=>d.onDrag(e)),onTouchend:i[2]||(i[2]=e=>d.onDragEnd(e)),onMousedown:i[3]||(i[3]=e=>d.onMouseDown(e)),onKeydown:i[4]||(i[4]=e=>d.onKeyDown(e)),tabindex:s.tabindex,role:"slider","aria-valuemin":s.min,"aria-valuenow":s.modelValue,"aria-valuemax":s.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":s.orientation},null,44,a)),s.range?(t.openBlock(),t.createElementBlock("span",{key:1,class:"p-slider-handle",style:t.normalizeStyle(d.rangeStartHandleStyle),onTouchstart:i[5]||(i[5]=e=>d.onDragStart(e,0)),onTouchmove:i[6]||(i[6]=e=>d.onDrag(e)),onTouchend:i[7]||(i[7]=e=>d.onDragEnd(e)),onMousedown:i[8]||(i[8]=e=>d.onMouseDown(e,0)),onKeydown:i[9]||(i[9]=e=>d.onKeyDown(e,0)),tabindex:s.tabindex,role:"slider","aria-valuemin":s.min,"aria-valuenow":s.modelValue?s.modelValue[0]:null,"aria-valuemax":s.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":s.orientation},null,44,n)):t.createCommentVNode("",!0),s.range?(t.openBlock(),t.createElementBlock("span",{key:2,class:"p-slider-handle",style:t.normalizeStyle(d.rangeEndHandleStyle),onTouchstart:i[10]||(i[10]=e=>d.onDragStart(e,1)),onTouchmove:i[11]||(i[11]=e=>d.onDrag(e)),onTouchend:i[12]||(i[12]=e=>d.onDragEnd(e)),onMousedown:i[13]||(i[13]=e=>d.onMouseDown(e,1)),onKeydown:i[14]||(i[14]=e=>d.onKeyDown(e,1)),tabindex:s.tabindex,role:"slider","aria-valuemin":s.min,"aria-valuenow":s.modelValue?s.modelValue[1]:null,"aria-valuemax":s.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":s.orientation},null,44,l)):t.createCommentVNode("",!0)],2)},i}(primevue.utils,Vue);
|
|
@@ -123,9 +123,11 @@ export default {
|
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
onDefaultButtonClick(event) {
|
|
126
|
-
this
|
|
126
|
+
if (this.isExpanded) {
|
|
127
|
+
this.$refs.menu.hide(event);
|
|
128
|
+
}
|
|
127
129
|
|
|
128
|
-
this.$emit('click');
|
|
130
|
+
this.$emit('click', event);
|
|
129
131
|
}
|
|
130
132
|
},
|
|
131
133
|
computed: {
|