primevue 3.15.0 → 3.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/AutoComplete.d.ts +182 -38
- package/autocomplete/AutoComplete.vue +636 -342
- package/autocomplete/autocomplete.cjs.js +745 -416
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +747 -418
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +745 -416
- package/autocomplete/autocomplete.min.js +1 -1
- package/button/Button.vue +4 -1
- package/button/button.cjs.js +5 -1
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +5 -1
- package/button/button.esm.min.js +1 -1
- package/button/button.js +5 -1
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +51 -12
- package/calendar/Calendar.vue +259 -114
- package/calendar/calendar.cjs.js +414 -220
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +415 -221
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +414 -220
- package/calendar/calendar.min.js +1 -1
- package/carousel/Carousel.vue +25 -0
- package/carousel/carousel.cjs.js +25 -0
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +25 -0
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +25 -0
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +97 -17
- package/cascadeselect/CascadeSelect.vue +560 -135
- package/cascadeselect/CascadeSelectSub.vue +48 -129
- package/cascadeselect/cascadeselect.cjs.js +670 -306
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +672 -308
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +670 -306
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/Checkbox.d.ts +40 -4
- package/checkbox/Checkbox.vue +50 -13
- package/checkbox/checkbox.cjs.js +64 -23
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +65 -24
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +64 -23
- package/checkbox/checkbox.min.js +1 -1
- package/chips/Chips.d.ts +36 -12
- package/chips/Chips.vue +116 -22
- package/chips/chips.cjs.js +149 -37
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +150 -38
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +150 -39
- package/chips/chips.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +3 -6
- package/colorpicker/ColorPicker.vue +1 -5
- package/colorpicker/colorpicker.cjs.js +2 -7
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -7
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +2 -7
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/Column.d.ts +4 -0
- package/column/Column.vue +4 -0
- package/column/column.cjs.js +4 -0
- package/column/column.cjs.min.js +1 -1
- package/column/column.esm.js +4 -0
- package/column/column.esm.min.js +1 -1
- package/column/column.js +4 -0
- package/column/column.min.js +1 -1
- package/config/PrimeVue.d.ts +42 -0
- package/config/config.cjs.js +35 -4
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +35 -4
- package/config/config.esm.min.js +1 -1
- package/config/config.js +35 -4
- package/config/config.min.js +1 -1
- package/confirmdialog/ConfirmDialog.vue +4 -1
- package/confirmdialog/confirmdialog.cjs.js +6 -2
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +6 -2
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +6 -2
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +1 -1
- package/contextmenu/ContextMenuSub.vue +3 -3
- package/contextmenu/contextmenu.cjs.js +14 -8
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +15 -9
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +14 -8
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +1128 -772
- package/core/core.min.js +12 -12
- package/datatable/BodyCell.vue +11 -2
- package/datatable/DataTable.vue +23 -2
- package/datatable/datatable.cjs.js +34 -4
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +34 -4
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +34 -4
- package/datatable/datatable.min.js +1 -1
- package/dialog/Dialog.d.ts +5 -1
- package/dropdown/Dropdown.d.ts +92 -38
- package/dropdown/Dropdown.vue +538 -399
- package/dropdown/dropdown.cjs.js +657 -486
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +659 -488
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +657 -486
- package/dropdown/dropdown.min.js +1 -1
- package/editor/Editor.d.ts +32 -0
- package/editor/Editor.vue +15 -1
- package/editor/editor.cjs.js +15 -1
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +15 -1
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +15 -1
- package/editor/editor.min.js +1 -1
- package/inputmask/InputMask.vue +9 -6
- package/inputmask/inputmask.cjs.js +14 -6
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +15 -7
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +14 -6
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +31 -7
- package/inputnumber/InputNumber.vue +53 -20
- package/inputnumber/inputnumber.cjs.js +75 -29
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +76 -30
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +75 -29
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +24 -8
- package/inputswitch/InputSwitch.vue +27 -12
- package/inputswitch/inputswitch.cjs.js +38 -20
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +39 -21
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +38 -20
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.vue +1 -2
- package/inputtext/inputtext.cjs.js +3 -4
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +4 -5
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +3 -4
- package/inputtext/inputtext.min.js +1 -1
- package/knob/Knob.d.ts +12 -0
- package/knob/Knob.vue +62 -2
- package/knob/knob.cjs.js +73 -5
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +73 -5
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +73 -5
- package/knob/knob.min.js +1 -1
- package/listbox/Listbox.d.ts +53 -7
- package/listbox/Listbox.vue +500 -135
- package/listbox/listbox.cjs.js +597 -193
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +599 -195
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +597 -193
- package/listbox/listbox.min.js +1 -1
- package/menu/Menu.d.ts +1 -1
- package/menu/Menuitem.vue +2 -2
- package/menu/menu.cjs.js +12 -6
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +13 -7
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +12 -6
- package/menu/menu.min.js +1 -1
- package/menubar/MenubarSub.vue +3 -3
- package/menubar/menubar.cjs.js +14 -8
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +15 -9
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +14 -8
- package/menubar/menubar.min.js +1 -1
- package/menuitem/MenuItem.d.ts +1 -1
- package/multiselect/MultiSelect.d.ts +111 -51
- package/multiselect/MultiSelect.vue +629 -338
- package/multiselect/multiselect.cjs.js +748 -428
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +750 -430
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +748 -428
- package/multiselect/multiselect.min.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +1 -1
- package/overlaypanel/OverlayPanel.vue +14 -2
- package/overlaypanel/overlaypanel.cjs.js +14 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +14 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +14 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +2 -2
- package/paginator/Paginator.d.ts +2 -2
- package/password/Password.d.ts +36 -8
- package/password/Password.vue +50 -14
- package/password/password.cjs.js +69 -24
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +71 -26
- package/password/password.esm.min.js +1 -1
- package/password/password.js +69 -24
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +8 -0
- package/picklist/PickList.vue +10 -2
- package/picklist/picklist.cjs.js +68 -50
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +69 -51
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +68 -50
- package/picklist/picklist.min.js +1 -1
- package/portal/Portal.d.ts +1 -1
- package/radiobutton/RadioButton.d.ts +28 -4
- package/radiobutton/RadioButton.vue +36 -11
- package/radiobutton/radiobutton.cjs.js +49 -23
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +50 -24
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +49 -23
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/Rating.d.ts +4 -0
- package/rating/Rating.vue +61 -7
- package/rating/rating.cjs.js +90 -16
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +91 -17
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +90 -16
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +8 -0
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +82 -40
- package/resources/themes/arya-green/theme.css +82 -40
- package/resources/themes/arya-orange/theme.css +82 -40
- package/resources/themes/arya-purple/theme.css +82 -40
- package/resources/themes/bootstrap4-dark-blue/theme.css +82 -40
- package/resources/themes/bootstrap4-dark-purple/theme.css +82 -40
- package/resources/themes/bootstrap4-light-blue/theme.css +82 -40
- package/resources/themes/bootstrap4-light-purple/theme.css +82 -40
- package/resources/themes/fluent-light/theme.css +82 -40
- package/resources/themes/lara-dark-blue/theme.css +82 -40
- package/resources/themes/lara-dark-indigo/theme.css +82 -40
- package/resources/themes/lara-dark-purple/theme.css +82 -40
- package/resources/themes/lara-dark-teal/theme.css +82 -40
- package/resources/themes/lara-light-blue/theme.css +82 -40
- package/resources/themes/lara-light-indigo/theme.css +82 -40
- package/resources/themes/lara-light-purple/theme.css +82 -40
- package/resources/themes/lara-light-teal/theme.css +82 -40
- package/resources/themes/luna-amber/theme.css +82 -40
- package/resources/themes/luna-blue/theme.css +82 -40
- package/resources/themes/luna-green/theme.css +82 -40
- package/resources/themes/luna-pink/theme.css +82 -40
- package/resources/themes/md-dark-deeppurple/theme.css +82 -40
- package/resources/themes/md-dark-indigo/theme.css +82 -40
- package/resources/themes/md-light-deeppurple/theme.css +82 -40
- package/resources/themes/md-light-indigo/theme.css +82 -40
- package/resources/themes/mdc-dark-deeppurple/theme.css +82 -40
- package/resources/themes/mdc-dark-indigo/theme.css +82 -40
- package/resources/themes/mdc-light-deeppurple/theme.css +82 -40
- package/resources/themes/mdc-light-indigo/theme.css +82 -40
- package/resources/themes/nova/theme.css +82 -40
- package/resources/themes/nova-accent/theme.css +82 -40
- package/resources/themes/nova-alt/theme.css +82 -40
- package/resources/themes/nova-vue/theme.css +82 -40
- package/resources/themes/rhea/theme.css +82 -40
- package/resources/themes/saga-blue/theme.css +82 -40
- package/resources/themes/saga-green/theme.css +82 -40
- package/resources/themes/saga-orange/theme.css +82 -40
- package/resources/themes/saga-purple/theme.css +82 -40
- package/resources/themes/tailwind-light/theme.css +82 -40
- package/resources/themes/vela-blue/theme.css +82 -40
- package/resources/themes/vela-green/theme.css +82 -40
- package/resources/themes/vela-orange/theme.css +82 -40
- package/resources/themes/vela-purple/theme.css +82 -40
- package/ripple/ripple.cjs.js +1 -0
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +1 -0
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +1 -0
- package/ripple/ripple.min.js +1 -1
- package/selectbutton/SelectButton.d.ts +6 -2
- package/selectbutton/SelectButton.vue +89 -12
- package/selectbutton/selectbutton.cjs.js +97 -22
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +99 -24
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +97 -22
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/Slider.d.ts +9 -1
- package/slider/Slider.vue +50 -34
- package/slider/slider.cjs.js +59 -38
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +59 -38
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +59 -38
- package/slider/slider.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +1 -1
- package/splitter/Splitter.vue +30 -1
- package/splitter/splitter.cjs.js +30 -1
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +30 -1
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +30 -1
- package/splitter/splitter.min.js +1 -1
- package/textarea/Textarea.vue +1 -2
- package/textarea/textarea.cjs.js +3 -5
- package/textarea/textarea.cjs.min.js +1 -1
- package/textarea/textarea.esm.js +4 -6
- package/textarea/textarea.esm.min.js +1 -1
- package/textarea/textarea.js +3 -5
- package/textarea/textarea.min.js +1 -1
- package/tieredmenu/TieredMenu.d.ts +1 -1
- package/tieredmenu/TieredMenuSub.vue +3 -3
- package/tieredmenu/tieredmenu.cjs.js +14 -8
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +15 -9
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +14 -8
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/Timeline.d.ts +10 -1
- package/timeline/Timeline.vue +1 -1
- package/timeline/timeline.cjs.js +5 -1
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +5 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +5 -1
- package/timeline/timeline.min.js +1 -1
- package/togglebutton/ToggleButton.d.ts +42 -0
- package/togglebutton/ToggleButton.vue +44 -7
- package/togglebutton/togglebutton.cjs.js +59 -13
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +60 -14
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +59 -13
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.cjs.js +20 -11
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +21 -12
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +20 -11
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.vue +5 -1
- package/tree/TreeNode.vue +20 -19
- package/tree/tree.cjs.js +47 -32
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +47 -32
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +47 -32
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +26 -10
- package/treeselect/TreeSelect.vue +52 -29
- package/treeselect/treeselect.cjs.js +74 -41
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +76 -43
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +74 -41
- package/treeselect/treeselect.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +20 -4
- package/tristatecheckbox/TriStateCheckbox.vue +52 -15
- package/tristatecheckbox/tristatecheckbox.cjs.js +67 -26
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +68 -27
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +67 -26
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/Utils.d.ts +3 -2
- package/utils/utils.cjs.js +239 -173
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +239 -173
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +239 -173
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +612 -136
- package/vetur-tags.json +180 -59
- package/virtualscroller/VirtualScroller.d.ts +10 -0
- package/virtualscroller/VirtualScroller.vue +18 -17
- package/virtualscroller/virtualscroller.cjs.js +22 -20
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +22 -20
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +22 -20
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1745 -338
package/slider/Slider.d.ts
CHANGED
|
@@ -48,10 +48,18 @@ export interface SliderProps {
|
|
|
48
48
|
* When present, it specifies that the component should be disabled.
|
|
49
49
|
*/
|
|
50
50
|
disabled?: boolean | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Index of the element in tabbing order.
|
|
53
|
+
*/
|
|
54
|
+
tabindex?: number | undefined;
|
|
51
55
|
/**
|
|
52
56
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
|
53
57
|
*/
|
|
54
|
-
|
|
58
|
+
'aria-labelledby'?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Used to define a string that labels the element.
|
|
61
|
+
*/
|
|
62
|
+
'aria-label'?: string | undefined;
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
export interface SliderSlots {
|
package/slider/Slider.vue
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="containerClass" @click="onBarClick">
|
|
3
3
|
<span class="p-slider-range" :style="rangeStyle"></span>
|
|
4
|
-
<span v-if="!range" class="p-slider-handle" :style="handleStyle" @touchstart="onDragStart($event)" @touchmove="onDrag($event)" @touchend="onDragEnd($event)" @mousedown="onMouseDown($event)" @keydown="onKeyDown($event)" tabindex="
|
|
5
|
-
role="slider" :aria-valuemin="min" :aria-valuenow="modelValue" :aria-valuemax="max" :aria-labelledby="
|
|
6
|
-
<span v-if="range" class="p-slider-handle" :style="rangeStartHandleStyle" @touchstart="onDragStart($event, 0)" @touchmove="onDrag($event)" @touchend="onDragEnd($event)" @mousedown="onMouseDown($event, 0)" @keydown="onKeyDown($event)" tabindex="
|
|
7
|
-
role="slider" :aria-valuemin="min" :aria-valuenow="modelValue ? modelValue[0] : null" :aria-valuemax="max" :aria-labelledby="
|
|
8
|
-
<span v-if="range" class="p-slider-handle" :style="rangeEndHandleStyle" @touchstart="onDragStart($event, 1)" @touchmove="onDrag($event)" @touchend="onDragEnd($event)" @mousedown="onMouseDown($event, 1)" @keydown="onKeyDown($event, 1)" tabindex="
|
|
9
|
-
role="slider" :aria-valuemin="min" :aria-valuenow="modelValue ? modelValue[1] : null" :aria-valuemax="max" :aria-labelledby="
|
|
4
|
+
<span v-if="!range" class="p-slider-handle" :style="handleStyle" @touchstart="onDragStart($event)" @touchmove="onDrag($event)" @touchend="onDragEnd($event)" @mousedown="onMouseDown($event)" @keydown="onKeyDown($event)" :tabindex="tabindex"
|
|
5
|
+
role="slider" :aria-valuemin="min" :aria-valuenow="modelValue" :aria-valuemax="max" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" :aria-orientation="orientation"></span>
|
|
6
|
+
<span v-if="range" class="p-slider-handle" :style="rangeStartHandleStyle" @touchstart="onDragStart($event, 0)" @touchmove="onDrag($event)" @touchend="onDragEnd($event)" @mousedown="onMouseDown($event, 0)" @keydown="onKeyDown($event, 0)" :tabindex="tabindex"
|
|
7
|
+
role="slider" :aria-valuemin="min" :aria-valuenow="modelValue ? modelValue[0] : null" :aria-valuemax="max" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" :aria-orientation="orientation"></span>
|
|
8
|
+
<span v-if="range" class="p-slider-handle" :style="rangeEndHandleStyle" @touchstart="onDragStart($event, 1)" @touchmove="onDrag($event)" @touchend="onDragEnd($event)" @mousedown="onMouseDown($event, 1)" @keydown="onKeyDown($event, 1)" :tabindex="tabindex"
|
|
9
|
+
role="slider" :aria-valuemin="min" :aria-valuenow="modelValue ? modelValue[1] : null" :aria-valuemax="max" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" :aria-orientation="orientation"></span>
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
@@ -42,9 +42,17 @@ export default {
|
|
|
42
42
|
type: Boolean,
|
|
43
43
|
default: false
|
|
44
44
|
},
|
|
45
|
-
|
|
45
|
+
tabindex: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 0
|
|
48
|
+
},
|
|
49
|
+
'aria-labelledby': {
|
|
46
50
|
type: String,
|
|
47
51
|
default: null
|
|
52
|
+
},
|
|
53
|
+
'aria-label': {
|
|
54
|
+
type: String,
|
|
55
|
+
default: null
|
|
48
56
|
}
|
|
49
57
|
},
|
|
50
58
|
dragging: false,
|
|
@@ -175,40 +183,44 @@ export default {
|
|
|
175
183
|
},
|
|
176
184
|
onKeyDown(event, index) {
|
|
177
185
|
this.handleIndex = index;
|
|
178
|
-
switch (event.
|
|
179
|
-
|
|
180
|
-
case
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
event.preventDefault();
|
|
184
|
-
}
|
|
186
|
+
switch (event.code) {
|
|
187
|
+
case 'ArrowDown':
|
|
188
|
+
case 'ArrowLeft':
|
|
189
|
+
this.decrementValue(event, index);
|
|
190
|
+
event.preventDefault();
|
|
185
191
|
break;
|
|
186
|
-
|
|
187
|
-
case
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
+
|
|
193
|
+
case 'ArrowUp':
|
|
194
|
+
case 'ArrowRight':
|
|
195
|
+
this.incrementValue(event, index);
|
|
196
|
+
event.preventDefault();
|
|
192
197
|
break;
|
|
193
|
-
|
|
194
|
-
case
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
event.preventDefault();
|
|
198
|
-
}
|
|
198
|
+
|
|
199
|
+
case 'PageDown':
|
|
200
|
+
this.decrementValue(event, index, true);
|
|
201
|
+
event.preventDefault();
|
|
199
202
|
break;
|
|
200
|
-
|
|
201
|
-
case
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
event.preventDefault();
|
|
205
|
-
}
|
|
203
|
+
|
|
204
|
+
case 'PageUp':
|
|
205
|
+
this.incrementValue(event, index, true);
|
|
206
|
+
event.preventDefault();
|
|
206
207
|
break;
|
|
208
|
+
|
|
209
|
+
case 'Home':
|
|
210
|
+
this.updateModel(event, this.min);
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
break;
|
|
213
|
+
|
|
214
|
+
case 'End':
|
|
215
|
+
this.updateModel(event, this.max);
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
break;
|
|
218
|
+
|
|
207
219
|
default:
|
|
208
220
|
break;
|
|
209
221
|
}
|
|
210
222
|
},
|
|
211
|
-
decrementValue(event, index) {
|
|
223
|
+
decrementValue(event, index, pageKey = false) {
|
|
212
224
|
let newValue;
|
|
213
225
|
if (this.range) {
|
|
214
226
|
if (this.step)
|
|
@@ -219,13 +231,15 @@ export default {
|
|
|
219
231
|
else {
|
|
220
232
|
if (this.step)
|
|
221
233
|
newValue = this.modelValue - this.step;
|
|
234
|
+
else if (!this.step && pageKey)
|
|
235
|
+
newValue = this.modelValue - 10;
|
|
222
236
|
else
|
|
223
237
|
newValue = this.modelValue - 1;
|
|
224
238
|
}
|
|
225
239
|
this.updateModel(event, newValue);
|
|
226
240
|
event.preventDefault();
|
|
227
241
|
},
|
|
228
|
-
incrementValue(event, index) {
|
|
242
|
+
incrementValue(event, index, pageKey = false) {
|
|
229
243
|
let newValue;
|
|
230
244
|
if (this.range) {
|
|
231
245
|
if (this.step)
|
|
@@ -236,6 +250,8 @@ export default {
|
|
|
236
250
|
else {
|
|
237
251
|
if (this.step)
|
|
238
252
|
newValue = this.modelValue + this.step;
|
|
253
|
+
else if (!this.step && pageKey)
|
|
254
|
+
newValue = this.modelValue + 10;
|
|
239
255
|
else
|
|
240
256
|
newValue = this.modelValue + 1;
|
|
241
257
|
}
|
package/slider/slider.cjs.js
CHANGED
|
@@ -32,9 +32,17 @@ var script = {
|
|
|
32
32
|
type: Boolean,
|
|
33
33
|
default: false
|
|
34
34
|
},
|
|
35
|
-
|
|
35
|
+
tabindex: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0
|
|
38
|
+
},
|
|
39
|
+
'aria-labelledby': {
|
|
36
40
|
type: String,
|
|
37
41
|
default: null
|
|
42
|
+
},
|
|
43
|
+
'aria-label': {
|
|
44
|
+
type: String,
|
|
45
|
+
default: null
|
|
38
46
|
}
|
|
39
47
|
},
|
|
40
48
|
dragging: false,
|
|
@@ -165,38 +173,41 @@ var script = {
|
|
|
165
173
|
},
|
|
166
174
|
onKeyDown(event, index) {
|
|
167
175
|
this.handleIndex = index;
|
|
168
|
-
switch (event.
|
|
169
|
-
|
|
170
|
-
case
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
switch (event.code) {
|
|
177
|
+
case 'ArrowDown':
|
|
178
|
+
case 'ArrowLeft':
|
|
179
|
+
this.decrementValue(event, index);
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
break;
|
|
182
|
+
|
|
183
|
+
case 'ArrowUp':
|
|
184
|
+
case 'ArrowRight':
|
|
185
|
+
this.incrementValue(event, index);
|
|
186
|
+
event.preventDefault();
|
|
175
187
|
break;
|
|
176
|
-
|
|
177
|
-
case
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
event.preventDefault();
|
|
181
|
-
}
|
|
188
|
+
|
|
189
|
+
case 'PageDown':
|
|
190
|
+
this.decrementValue(event, index, true);
|
|
191
|
+
event.preventDefault();
|
|
182
192
|
break;
|
|
183
|
-
|
|
184
|
-
case
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
event.preventDefault();
|
|
188
|
-
}
|
|
193
|
+
|
|
194
|
+
case 'PageUp':
|
|
195
|
+
this.incrementValue(event, index, true);
|
|
196
|
+
event.preventDefault();
|
|
189
197
|
break;
|
|
190
|
-
|
|
191
|
-
case
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
198
|
+
|
|
199
|
+
case 'Home':
|
|
200
|
+
this.updateModel(event, this.min);
|
|
201
|
+
event.preventDefault();
|
|
202
|
+
break;
|
|
203
|
+
|
|
204
|
+
case 'End':
|
|
205
|
+
this.updateModel(event, this.max);
|
|
206
|
+
event.preventDefault();
|
|
196
207
|
break;
|
|
197
208
|
}
|
|
198
209
|
},
|
|
199
|
-
decrementValue(event, index) {
|
|
210
|
+
decrementValue(event, index, pageKey = false) {
|
|
200
211
|
let newValue;
|
|
201
212
|
if (this.range) {
|
|
202
213
|
if (this.step)
|
|
@@ -207,13 +218,15 @@ var script = {
|
|
|
207
218
|
else {
|
|
208
219
|
if (this.step)
|
|
209
220
|
newValue = this.modelValue - this.step;
|
|
221
|
+
else if (!this.step && pageKey)
|
|
222
|
+
newValue = this.modelValue - 10;
|
|
210
223
|
else
|
|
211
224
|
newValue = this.modelValue - 1;
|
|
212
225
|
}
|
|
213
226
|
this.updateModel(event, newValue);
|
|
214
227
|
event.preventDefault();
|
|
215
228
|
},
|
|
216
|
-
incrementValue(event, index) {
|
|
229
|
+
incrementValue(event, index, pageKey = false) {
|
|
217
230
|
let newValue;
|
|
218
231
|
if (this.range) {
|
|
219
232
|
if (this.step)
|
|
@@ -224,6 +237,8 @@ var script = {
|
|
|
224
237
|
else {
|
|
225
238
|
if (this.step)
|
|
226
239
|
newValue = this.modelValue + this.step;
|
|
240
|
+
else if (!this.step && pageKey)
|
|
241
|
+
newValue = this.modelValue + 10;
|
|
227
242
|
else
|
|
228
243
|
newValue = this.modelValue + 1;
|
|
229
244
|
}
|
|
@@ -320,9 +335,9 @@ var script = {
|
|
|
320
335
|
}
|
|
321
336
|
};
|
|
322
337
|
|
|
323
|
-
const _hoisted_1 = ["aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby"];
|
|
324
|
-
const _hoisted_2 = ["aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby"];
|
|
325
|
-
const _hoisted_3 = ["aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby"];
|
|
338
|
+
const _hoisted_1 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
|
|
339
|
+
const _hoisted_2 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
|
|
340
|
+
const _hoisted_3 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
|
|
326
341
|
|
|
327
342
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
328
343
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -343,12 +358,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
343
358
|
onTouchend: _cache[2] || (_cache[2] = $event => ($options.onDragEnd($event))),
|
|
344
359
|
onMousedown: _cache[3] || (_cache[3] = $event => ($options.onMouseDown($event))),
|
|
345
360
|
onKeydown: _cache[4] || (_cache[4] = $event => ($options.onKeyDown($event))),
|
|
346
|
-
tabindex:
|
|
361
|
+
tabindex: $props.tabindex,
|
|
347
362
|
role: "slider",
|
|
348
363
|
"aria-valuemin": $props.min,
|
|
349
364
|
"aria-valuenow": $props.modelValue,
|
|
350
365
|
"aria-valuemax": $props.max,
|
|
351
|
-
"aria-labelledby":
|
|
366
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
367
|
+
"aria-label": _ctx.ariaLabel,
|
|
368
|
+
"aria-orientation": $props.orientation
|
|
352
369
|
}, null, 44, _hoisted_1))
|
|
353
370
|
: vue.createCommentVNode("", true),
|
|
354
371
|
($props.range)
|
|
@@ -360,13 +377,15 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
360
377
|
onTouchmove: _cache[6] || (_cache[6] = $event => ($options.onDrag($event))),
|
|
361
378
|
onTouchend: _cache[7] || (_cache[7] = $event => ($options.onDragEnd($event))),
|
|
362
379
|
onMousedown: _cache[8] || (_cache[8] = $event => ($options.onMouseDown($event, 0))),
|
|
363
|
-
onKeydown: _cache[9] || (_cache[9] = $event => ($options.onKeyDown($event))),
|
|
364
|
-
tabindex:
|
|
380
|
+
onKeydown: _cache[9] || (_cache[9] = $event => ($options.onKeyDown($event, 0))),
|
|
381
|
+
tabindex: $props.tabindex,
|
|
365
382
|
role: "slider",
|
|
366
383
|
"aria-valuemin": $props.min,
|
|
367
384
|
"aria-valuenow": $props.modelValue ? $props.modelValue[0] : null,
|
|
368
385
|
"aria-valuemax": $props.max,
|
|
369
|
-
"aria-labelledby":
|
|
386
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
387
|
+
"aria-label": _ctx.ariaLabel,
|
|
388
|
+
"aria-orientation": $props.orientation
|
|
370
389
|
}, null, 44, _hoisted_2))
|
|
371
390
|
: vue.createCommentVNode("", true),
|
|
372
391
|
($props.range)
|
|
@@ -379,12 +398,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
379
398
|
onTouchend: _cache[12] || (_cache[12] = $event => ($options.onDragEnd($event))),
|
|
380
399
|
onMousedown: _cache[13] || (_cache[13] = $event => ($options.onMouseDown($event, 1))),
|
|
381
400
|
onKeydown: _cache[14] || (_cache[14] = $event => ($options.onKeyDown($event, 1))),
|
|
382
|
-
tabindex:
|
|
401
|
+
tabindex: $props.tabindex,
|
|
383
402
|
role: "slider",
|
|
384
403
|
"aria-valuemin": $props.min,
|
|
385
404
|
"aria-valuenow": $props.modelValue ? $props.modelValue[1] : null,
|
|
386
405
|
"aria-valuemax": $props.max,
|
|
387
|
-
"aria-labelledby":
|
|
406
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
407
|
+
"aria-label": _ctx.ariaLabel,
|
|
408
|
+
"aria-orientation": $props.orientation
|
|
388
409
|
}, null, 44, _hoisted_3))
|
|
389
410
|
: vue.createCommentVNode("", true)
|
|
390
411
|
], 2))
|
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},
|
|
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));if(this.range)if(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex){let e=this.modelValue?this.modelValue[1]:this.max;a<this.min?a=this.min:a>=e&&(a=e),i[0]=a,i[1]=i[1]||this.max}else{let e=this.modelValue?this.modelValue[0]:this.min;a>this.max?a=this.max:a<=e&&(a=e),i[0]=i[0]||this.min,i[1]=a}else 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.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(){return this.range?this.horizontal?{left:this.rangeStartPosition+"%",width:this.rangeEndPosition-this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%",height:this.rangeEndPosition-this.rangeStartHandlePosition+"%"}: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\tposition: relative;\n}\n.p-slider .p-slider-handle {\n\tposition: absolute;\n\tcursor: -webkit-grab;\n\tcursor: grab;\n -ms-touch-action: none;\n touch-action: none;\n display: block;\n}\n.p-slider-range {\n\tposition: absolute;\n display: block;\n}\n.p-slider-horizontal .p-slider-range {\n top: 0;\n left: 0;\n\theight: 100%;\n}\n.p-slider-horizontal .p-slider-handle {\n top: 50%;\n}\n.p-slider-vertical {\n\theight: 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,o,r,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
|
@@ -30,9 +30,17 @@ var script = {
|
|
|
30
30
|
type: Boolean,
|
|
31
31
|
default: false
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
tabindex: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 0
|
|
36
|
+
},
|
|
37
|
+
'aria-labelledby': {
|
|
34
38
|
type: String,
|
|
35
39
|
default: null
|
|
40
|
+
},
|
|
41
|
+
'aria-label': {
|
|
42
|
+
type: String,
|
|
43
|
+
default: null
|
|
36
44
|
}
|
|
37
45
|
},
|
|
38
46
|
dragging: false,
|
|
@@ -163,38 +171,41 @@ var script = {
|
|
|
163
171
|
},
|
|
164
172
|
onKeyDown(event, index) {
|
|
165
173
|
this.handleIndex = index;
|
|
166
|
-
switch (event.
|
|
167
|
-
|
|
168
|
-
case
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
switch (event.code) {
|
|
175
|
+
case 'ArrowDown':
|
|
176
|
+
case 'ArrowLeft':
|
|
177
|
+
this.decrementValue(event, index);
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
break;
|
|
180
|
+
|
|
181
|
+
case 'ArrowUp':
|
|
182
|
+
case 'ArrowRight':
|
|
183
|
+
this.incrementValue(event, index);
|
|
184
|
+
event.preventDefault();
|
|
173
185
|
break;
|
|
174
|
-
|
|
175
|
-
case
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
event.preventDefault();
|
|
179
|
-
}
|
|
186
|
+
|
|
187
|
+
case 'PageDown':
|
|
188
|
+
this.decrementValue(event, index, true);
|
|
189
|
+
event.preventDefault();
|
|
180
190
|
break;
|
|
181
|
-
|
|
182
|
-
case
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
event.preventDefault();
|
|
186
|
-
}
|
|
191
|
+
|
|
192
|
+
case 'PageUp':
|
|
193
|
+
this.incrementValue(event, index, true);
|
|
194
|
+
event.preventDefault();
|
|
187
195
|
break;
|
|
188
|
-
|
|
189
|
-
case
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
|
|
197
|
+
case 'Home':
|
|
198
|
+
this.updateModel(event, this.min);
|
|
199
|
+
event.preventDefault();
|
|
200
|
+
break;
|
|
201
|
+
|
|
202
|
+
case 'End':
|
|
203
|
+
this.updateModel(event, this.max);
|
|
204
|
+
event.preventDefault();
|
|
194
205
|
break;
|
|
195
206
|
}
|
|
196
207
|
},
|
|
197
|
-
decrementValue(event, index) {
|
|
208
|
+
decrementValue(event, index, pageKey = false) {
|
|
198
209
|
let newValue;
|
|
199
210
|
if (this.range) {
|
|
200
211
|
if (this.step)
|
|
@@ -205,13 +216,15 @@ var script = {
|
|
|
205
216
|
else {
|
|
206
217
|
if (this.step)
|
|
207
218
|
newValue = this.modelValue - this.step;
|
|
219
|
+
else if (!this.step && pageKey)
|
|
220
|
+
newValue = this.modelValue - 10;
|
|
208
221
|
else
|
|
209
222
|
newValue = this.modelValue - 1;
|
|
210
223
|
}
|
|
211
224
|
this.updateModel(event, newValue);
|
|
212
225
|
event.preventDefault();
|
|
213
226
|
},
|
|
214
|
-
incrementValue(event, index) {
|
|
227
|
+
incrementValue(event, index, pageKey = false) {
|
|
215
228
|
let newValue;
|
|
216
229
|
if (this.range) {
|
|
217
230
|
if (this.step)
|
|
@@ -222,6 +235,8 @@ var script = {
|
|
|
222
235
|
else {
|
|
223
236
|
if (this.step)
|
|
224
237
|
newValue = this.modelValue + this.step;
|
|
238
|
+
else if (!this.step && pageKey)
|
|
239
|
+
newValue = this.modelValue + 10;
|
|
225
240
|
else
|
|
226
241
|
newValue = this.modelValue + 1;
|
|
227
242
|
}
|
|
@@ -318,9 +333,9 @@ var script = {
|
|
|
318
333
|
}
|
|
319
334
|
};
|
|
320
335
|
|
|
321
|
-
const _hoisted_1 = ["aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby"];
|
|
322
|
-
const _hoisted_2 = ["aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby"];
|
|
323
|
-
const _hoisted_3 = ["aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby"];
|
|
336
|
+
const _hoisted_1 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
|
|
337
|
+
const _hoisted_2 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
|
|
338
|
+
const _hoisted_3 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
|
|
324
339
|
|
|
325
340
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
326
341
|
return (openBlock(), createElementBlock("div", {
|
|
@@ -341,12 +356,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
341
356
|
onTouchend: _cache[2] || (_cache[2] = $event => ($options.onDragEnd($event))),
|
|
342
357
|
onMousedown: _cache[3] || (_cache[3] = $event => ($options.onMouseDown($event))),
|
|
343
358
|
onKeydown: _cache[4] || (_cache[4] = $event => ($options.onKeyDown($event))),
|
|
344
|
-
tabindex:
|
|
359
|
+
tabindex: $props.tabindex,
|
|
345
360
|
role: "slider",
|
|
346
361
|
"aria-valuemin": $props.min,
|
|
347
362
|
"aria-valuenow": $props.modelValue,
|
|
348
363
|
"aria-valuemax": $props.max,
|
|
349
|
-
"aria-labelledby":
|
|
364
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
365
|
+
"aria-label": _ctx.ariaLabel,
|
|
366
|
+
"aria-orientation": $props.orientation
|
|
350
367
|
}, null, 44, _hoisted_1))
|
|
351
368
|
: createCommentVNode("", true),
|
|
352
369
|
($props.range)
|
|
@@ -358,13 +375,15 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
358
375
|
onTouchmove: _cache[6] || (_cache[6] = $event => ($options.onDrag($event))),
|
|
359
376
|
onTouchend: _cache[7] || (_cache[7] = $event => ($options.onDragEnd($event))),
|
|
360
377
|
onMousedown: _cache[8] || (_cache[8] = $event => ($options.onMouseDown($event, 0))),
|
|
361
|
-
onKeydown: _cache[9] || (_cache[9] = $event => ($options.onKeyDown($event))),
|
|
362
|
-
tabindex:
|
|
378
|
+
onKeydown: _cache[9] || (_cache[9] = $event => ($options.onKeyDown($event, 0))),
|
|
379
|
+
tabindex: $props.tabindex,
|
|
363
380
|
role: "slider",
|
|
364
381
|
"aria-valuemin": $props.min,
|
|
365
382
|
"aria-valuenow": $props.modelValue ? $props.modelValue[0] : null,
|
|
366
383
|
"aria-valuemax": $props.max,
|
|
367
|
-
"aria-labelledby":
|
|
384
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
385
|
+
"aria-label": _ctx.ariaLabel,
|
|
386
|
+
"aria-orientation": $props.orientation
|
|
368
387
|
}, null, 44, _hoisted_2))
|
|
369
388
|
: createCommentVNode("", true),
|
|
370
389
|
($props.range)
|
|
@@ -377,12 +396,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
377
396
|
onTouchend: _cache[12] || (_cache[12] = $event => ($options.onDragEnd($event))),
|
|
378
397
|
onMousedown: _cache[13] || (_cache[13] = $event => ($options.onMouseDown($event, 1))),
|
|
379
398
|
onKeydown: _cache[14] || (_cache[14] = $event => ($options.onKeyDown($event, 1))),
|
|
380
|
-
tabindex:
|
|
399
|
+
tabindex: $props.tabindex,
|
|
381
400
|
role: "slider",
|
|
382
401
|
"aria-valuemin": $props.min,
|
|
383
402
|
"aria-valuenow": $props.modelValue ? $props.modelValue[1] : null,
|
|
384
403
|
"aria-valuemax": $props.max,
|
|
385
|
-
"aria-labelledby":
|
|
404
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
405
|
+
"aria-label": _ctx.ariaLabel,
|
|
406
|
+
"aria-orientation": $props.orientation
|
|
386
407
|
}, null, 44, _hoisted_3))
|
|
387
408
|
: createCommentVNode("", true)
|
|
388
409
|
], 2))
|
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
|
|
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));if(this.range)if(i=this.modelValue?[...this.modelValue]:[],0==this.handleIndex){let e=this.modelValue?this.modelValue[1]:this.max;a<this.min?a=this.min:a>=e&&(a=e),i[0]=a,i[1]=i[1]||this.max}else{let e=this.modelValue?this.modelValue[0]:this.min;a>this.max?a=this.max:a<=e&&(a=e),i[0]=i[0]||this.min,i[1]=a}else 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.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(){return this.range?this.horizontal?{left:this.rangeStartPosition+"%",width:this.rangeEndPosition-this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%",height:this.rangeEndPosition-this.rangeStartHandlePosition+"%"}: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\tposition: relative;\n}\n.p-slider .p-slider-handle {\n\tposition: absolute;\n\tcursor: -webkit-grab;\n\tcursor: grab;\n -ms-touch-action: none;\n touch-action: none;\n display: block;\n}\n.p-slider-range {\n\tposition: absolute;\n display: block;\n}\n.p-slider-horizontal .p-slider-range {\n top: 0;\n left: 0;\n\theight: 100%;\n}\n.p-slider-horizontal .p-slider-handle {\n top: 50%;\n}\n.p-slider-vertical {\n\theight: 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};
|