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
|
@@ -5,13 +5,30 @@ var vue = require('vue');
|
|
|
5
5
|
|
|
6
6
|
var script = {
|
|
7
7
|
name: 'RadioButton',
|
|
8
|
-
|
|
9
|
-
emits: ['click', 'update:modelValue', 'change'],
|
|
8
|
+
emits: ['click', 'update:modelValue', 'change', 'focus', 'blur'],
|
|
10
9
|
props: {
|
|
11
10
|
value: null,
|
|
12
11
|
modelValue: null,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
name: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: null
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
inputId: null,
|
|
21
|
+
inputClass: null,
|
|
22
|
+
inputStyle: null,
|
|
23
|
+
inputProps: null,
|
|
24
|
+
'aria-labelledby': {
|
|
25
|
+
type: String,
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
28
|
+
'aria-label': {
|
|
29
|
+
type: String,
|
|
30
|
+
default: null
|
|
31
|
+
}
|
|
15
32
|
},
|
|
16
33
|
data() {
|
|
17
34
|
return {
|
|
@@ -20,7 +37,7 @@ var script = {
|
|
|
20
37
|
},
|
|
21
38
|
methods: {
|
|
22
39
|
onClick(event) {
|
|
23
|
-
if (!this
|
|
40
|
+
if (!this.disabled) {
|
|
24
41
|
this.$emit('click', event);
|
|
25
42
|
this.$emit('update:modelValue', this.value);
|
|
26
43
|
this.$refs.input.focus();
|
|
@@ -30,11 +47,13 @@ var script = {
|
|
|
30
47
|
}
|
|
31
48
|
}
|
|
32
49
|
},
|
|
33
|
-
onFocus() {
|
|
50
|
+
onFocus(event) {
|
|
34
51
|
this.focused = true;
|
|
52
|
+
this.$emit('focus', event);
|
|
35
53
|
},
|
|
36
|
-
onBlur() {
|
|
54
|
+
onBlur(event) {
|
|
37
55
|
this.focused = false;
|
|
56
|
+
this.$emit('blur', event);
|
|
38
57
|
}
|
|
39
58
|
},
|
|
40
59
|
computed: {
|
|
@@ -42,43 +61,50 @@ var script = {
|
|
|
42
61
|
return this.modelValue != null && utils.ObjectUtils.equals(this.modelValue, this.value);
|
|
43
62
|
},
|
|
44
63
|
containerClass() {
|
|
45
|
-
return [
|
|
64
|
+
return [
|
|
65
|
+
'p-radiobutton p-component', {
|
|
66
|
+
'p-radiobutton-checked': this.checked,
|
|
67
|
+
'p-radiobutton-disabled': this.disabled,
|
|
68
|
+
'p-radiobutton-focused': this.focused
|
|
69
|
+
}];
|
|
46
70
|
}
|
|
47
71
|
}
|
|
48
72
|
};
|
|
49
73
|
|
|
50
74
|
const _hoisted_1 = { class: "p-hidden-accessible" };
|
|
51
|
-
const _hoisted_2 = ["checked", "value"];
|
|
52
|
-
const _hoisted_3 =
|
|
53
|
-
const _hoisted_4 =
|
|
54
|
-
|
|
55
|
-
_hoisted_4
|
|
75
|
+
const _hoisted_2 = ["id", "name", "checked", "disabled", "value", "aria-labelledby", "aria-label"];
|
|
76
|
+
const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
|
|
77
|
+
const _hoisted_4 = [
|
|
78
|
+
_hoisted_3
|
|
56
79
|
];
|
|
57
80
|
|
|
58
81
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
59
82
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
60
83
|
class: vue.normalizeClass($options.containerClass),
|
|
61
|
-
onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
|
|
62
|
-
style: vue.normalizeStyle($props.style)
|
|
84
|
+
onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
|
|
63
85
|
}, [
|
|
64
86
|
vue.createElementVNode("div", _hoisted_1, [
|
|
65
87
|
vue.createElementVNode("input", vue.mergeProps({
|
|
66
88
|
ref: "input",
|
|
67
89
|
type: "radio",
|
|
90
|
+
id: $props.inputId,
|
|
91
|
+
class: $props.inputClass,
|
|
92
|
+
style: $props.inputStyle,
|
|
93
|
+
name: $props.name,
|
|
68
94
|
checked: $options.checked,
|
|
69
|
-
|
|
70
|
-
|
|
95
|
+
disabled: $props.disabled,
|
|
96
|
+
value: $props.value,
|
|
97
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
98
|
+
"aria-label": _ctx.ariaLabel,
|
|
71
99
|
onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
72
100
|
onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args)))
|
|
73
|
-
}), null, 16, _hoisted_2)
|
|
101
|
+
}, $props.inputProps), null, 16, _hoisted_2)
|
|
74
102
|
]),
|
|
75
103
|
vue.createElementVNode("div", {
|
|
76
104
|
ref: "box",
|
|
77
|
-
class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled':
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, _hoisted_5, 10, _hoisted_3)
|
|
81
|
-
], 6))
|
|
105
|
+
class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
|
|
106
|
+
}, _hoisted_4, 2)
|
|
107
|
+
], 2))
|
|
82
108
|
}
|
|
83
109
|
|
|
84
110
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),
|
|
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:null,inputClass:null,inputStyle:null,inputProps: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,n,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",a,[l.createElementVNode("input",l.mergeProps({ref:"input",type:"radio",id:s.inputId,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":d.focused}])},u,2)],2)},module.exports=t;
|
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
import { ObjectUtils } from 'primevue/utils';
|
|
2
|
-
import { openBlock, createElementBlock, normalizeClass,
|
|
2
|
+
import { openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps } from 'vue';
|
|
3
3
|
|
|
4
4
|
var script = {
|
|
5
5
|
name: 'RadioButton',
|
|
6
|
-
|
|
7
|
-
emits: ['click', 'update:modelValue', 'change'],
|
|
6
|
+
emits: ['click', 'update:modelValue', 'change', 'focus', 'blur'],
|
|
8
7
|
props: {
|
|
9
8
|
value: null,
|
|
10
9
|
modelValue: null,
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: null
|
|
13
|
+
},
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
inputId: null,
|
|
19
|
+
inputClass: null,
|
|
20
|
+
inputStyle: null,
|
|
21
|
+
inputProps: null,
|
|
22
|
+
'aria-labelledby': {
|
|
23
|
+
type: String,
|
|
24
|
+
default: null
|
|
25
|
+
},
|
|
26
|
+
'aria-label': {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null
|
|
29
|
+
}
|
|
13
30
|
},
|
|
14
31
|
data() {
|
|
15
32
|
return {
|
|
@@ -18,7 +35,7 @@ var script = {
|
|
|
18
35
|
},
|
|
19
36
|
methods: {
|
|
20
37
|
onClick(event) {
|
|
21
|
-
if (!this
|
|
38
|
+
if (!this.disabled) {
|
|
22
39
|
this.$emit('click', event);
|
|
23
40
|
this.$emit('update:modelValue', this.value);
|
|
24
41
|
this.$refs.input.focus();
|
|
@@ -28,11 +45,13 @@ var script = {
|
|
|
28
45
|
}
|
|
29
46
|
}
|
|
30
47
|
},
|
|
31
|
-
onFocus() {
|
|
48
|
+
onFocus(event) {
|
|
32
49
|
this.focused = true;
|
|
50
|
+
this.$emit('focus', event);
|
|
33
51
|
},
|
|
34
|
-
onBlur() {
|
|
52
|
+
onBlur(event) {
|
|
35
53
|
this.focused = false;
|
|
54
|
+
this.$emit('blur', event);
|
|
36
55
|
}
|
|
37
56
|
},
|
|
38
57
|
computed: {
|
|
@@ -40,43 +59,50 @@ var script = {
|
|
|
40
59
|
return this.modelValue != null && ObjectUtils.equals(this.modelValue, this.value);
|
|
41
60
|
},
|
|
42
61
|
containerClass() {
|
|
43
|
-
return [
|
|
62
|
+
return [
|
|
63
|
+
'p-radiobutton p-component', {
|
|
64
|
+
'p-radiobutton-checked': this.checked,
|
|
65
|
+
'p-radiobutton-disabled': this.disabled,
|
|
66
|
+
'p-radiobutton-focused': this.focused
|
|
67
|
+
}];
|
|
44
68
|
}
|
|
45
69
|
}
|
|
46
70
|
};
|
|
47
71
|
|
|
48
72
|
const _hoisted_1 = { class: "p-hidden-accessible" };
|
|
49
|
-
const _hoisted_2 = ["checked", "value"];
|
|
50
|
-
const _hoisted_3 =
|
|
51
|
-
const _hoisted_4 =
|
|
52
|
-
|
|
53
|
-
_hoisted_4
|
|
73
|
+
const _hoisted_2 = ["id", "name", "checked", "disabled", "value", "aria-labelledby", "aria-label"];
|
|
74
|
+
const _hoisted_3 = /*#__PURE__*/createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
|
|
75
|
+
const _hoisted_4 = [
|
|
76
|
+
_hoisted_3
|
|
54
77
|
];
|
|
55
78
|
|
|
56
79
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
57
80
|
return (openBlock(), createElementBlock("div", {
|
|
58
81
|
class: normalizeClass($options.containerClass),
|
|
59
|
-
onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
|
|
60
|
-
style: normalizeStyle($props.style)
|
|
82
|
+
onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
|
|
61
83
|
}, [
|
|
62
84
|
createElementVNode("div", _hoisted_1, [
|
|
63
85
|
createElementVNode("input", mergeProps({
|
|
64
86
|
ref: "input",
|
|
65
87
|
type: "radio",
|
|
88
|
+
id: $props.inputId,
|
|
89
|
+
class: $props.inputClass,
|
|
90
|
+
style: $props.inputStyle,
|
|
91
|
+
name: $props.name,
|
|
66
92
|
checked: $options.checked,
|
|
67
|
-
|
|
68
|
-
|
|
93
|
+
disabled: $props.disabled,
|
|
94
|
+
value: $props.value,
|
|
95
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
96
|
+
"aria-label": _ctx.ariaLabel,
|
|
69
97
|
onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
70
98
|
onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args)))
|
|
71
|
-
}), null, 16, _hoisted_2)
|
|
99
|
+
}, $props.inputProps), null, 16, _hoisted_2)
|
|
72
100
|
]),
|
|
73
101
|
createElementVNode("div", {
|
|
74
102
|
ref: "box",
|
|
75
|
-
class: normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled':
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, _hoisted_5, 10, _hoisted_3)
|
|
79
|
-
], 6))
|
|
103
|
+
class: normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
|
|
104
|
+
}, _hoisted_4, 2)
|
|
105
|
+
], 2))
|
|
80
106
|
}
|
|
81
107
|
|
|
82
108
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ObjectUtils as e}from"primevue/utils";import{openBlock as
|
|
1
|
+
import{ObjectUtils as e}from"primevue/utils";import{openBlock as l,createElementBlock as i,normalizeClass as a,createElementVNode as t,mergeProps as u}from"vue";var s={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:null,inputClass:null,inputStyle:null,inputProps: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 d={class:"p-hidden-accessible"},n=["id","name","checked","disabled","value","aria-labelledby","aria-label"],o=[t("div",{class:"p-radiobutton-icon"},null,-1)];s.render=function(e,s,c,r,p,b){return l(),i("div",{class:a(b.containerClass),onClick:s[2]||(s[2]=e=>b.onClick(e))},[t("div",d,[t("input",u({ref:"input",type:"radio",id:c.inputId,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:s[0]||(s[0]=(...e)=>b.onFocus&&b.onFocus(...e)),onBlur:s[1]||(s[1]=(...e)=>b.onBlur&&b.onBlur(...e))},c.inputProps),null,16,n)]),t("div",{ref:"box",class:a(["p-radiobutton-box",{"p-highlight":b.checked,"p-disabled":c.disabled,"p-focus":p.focused}])},o,2)],2)};export{s as default};
|
|
@@ -4,13 +4,30 @@ this.primevue.radiobutton = (function (utils, vue) {
|
|
|
4
4
|
|
|
5
5
|
var script = {
|
|
6
6
|
name: 'RadioButton',
|
|
7
|
-
|
|
8
|
-
emits: ['click', 'update:modelValue', 'change'],
|
|
7
|
+
emits: ['click', 'update:modelValue', 'change', 'focus', 'blur'],
|
|
9
8
|
props: {
|
|
10
9
|
value: null,
|
|
11
10
|
modelValue: null,
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
disabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
inputId: null,
|
|
20
|
+
inputClass: null,
|
|
21
|
+
inputStyle: null,
|
|
22
|
+
inputProps: null,
|
|
23
|
+
'aria-labelledby': {
|
|
24
|
+
type: String,
|
|
25
|
+
default: null
|
|
26
|
+
},
|
|
27
|
+
'aria-label': {
|
|
28
|
+
type: String,
|
|
29
|
+
default: null
|
|
30
|
+
}
|
|
14
31
|
},
|
|
15
32
|
data() {
|
|
16
33
|
return {
|
|
@@ -19,7 +36,7 @@ this.primevue.radiobutton = (function (utils, vue) {
|
|
|
19
36
|
},
|
|
20
37
|
methods: {
|
|
21
38
|
onClick(event) {
|
|
22
|
-
if (!this
|
|
39
|
+
if (!this.disabled) {
|
|
23
40
|
this.$emit('click', event);
|
|
24
41
|
this.$emit('update:modelValue', this.value);
|
|
25
42
|
this.$refs.input.focus();
|
|
@@ -29,11 +46,13 @@ this.primevue.radiobutton = (function (utils, vue) {
|
|
|
29
46
|
}
|
|
30
47
|
}
|
|
31
48
|
},
|
|
32
|
-
onFocus() {
|
|
49
|
+
onFocus(event) {
|
|
33
50
|
this.focused = true;
|
|
51
|
+
this.$emit('focus', event);
|
|
34
52
|
},
|
|
35
|
-
onBlur() {
|
|
53
|
+
onBlur(event) {
|
|
36
54
|
this.focused = false;
|
|
55
|
+
this.$emit('blur', event);
|
|
37
56
|
}
|
|
38
57
|
},
|
|
39
58
|
computed: {
|
|
@@ -41,43 +60,50 @@ this.primevue.radiobutton = (function (utils, vue) {
|
|
|
41
60
|
return this.modelValue != null && utils.ObjectUtils.equals(this.modelValue, this.value);
|
|
42
61
|
},
|
|
43
62
|
containerClass() {
|
|
44
|
-
return [
|
|
63
|
+
return [
|
|
64
|
+
'p-radiobutton p-component', {
|
|
65
|
+
'p-radiobutton-checked': this.checked,
|
|
66
|
+
'p-radiobutton-disabled': this.disabled,
|
|
67
|
+
'p-radiobutton-focused': this.focused
|
|
68
|
+
}];
|
|
45
69
|
}
|
|
46
70
|
}
|
|
47
71
|
};
|
|
48
72
|
|
|
49
73
|
const _hoisted_1 = { class: "p-hidden-accessible" };
|
|
50
|
-
const _hoisted_2 = ["checked", "value"];
|
|
51
|
-
const _hoisted_3 =
|
|
52
|
-
const _hoisted_4 =
|
|
53
|
-
|
|
54
|
-
_hoisted_4
|
|
74
|
+
const _hoisted_2 = ["id", "name", "checked", "disabled", "value", "aria-labelledby", "aria-label"];
|
|
75
|
+
const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
|
|
76
|
+
const _hoisted_4 = [
|
|
77
|
+
_hoisted_3
|
|
55
78
|
];
|
|
56
79
|
|
|
57
80
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
58
81
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
59
82
|
class: vue.normalizeClass($options.containerClass),
|
|
60
|
-
onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
|
|
61
|
-
style: vue.normalizeStyle($props.style)
|
|
83
|
+
onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
|
|
62
84
|
}, [
|
|
63
85
|
vue.createElementVNode("div", _hoisted_1, [
|
|
64
86
|
vue.createElementVNode("input", vue.mergeProps({
|
|
65
87
|
ref: "input",
|
|
66
88
|
type: "radio",
|
|
89
|
+
id: $props.inputId,
|
|
90
|
+
class: $props.inputClass,
|
|
91
|
+
style: $props.inputStyle,
|
|
92
|
+
name: $props.name,
|
|
67
93
|
checked: $options.checked,
|
|
68
|
-
|
|
69
|
-
|
|
94
|
+
disabled: $props.disabled,
|
|
95
|
+
value: $props.value,
|
|
96
|
+
"aria-labelledby": _ctx.ariaLabelledby,
|
|
97
|
+
"aria-label": _ctx.ariaLabel,
|
|
70
98
|
onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
71
99
|
onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args)))
|
|
72
|
-
}), null, 16, _hoisted_2)
|
|
100
|
+
}, $props.inputProps), null, 16, _hoisted_2)
|
|
73
101
|
]),
|
|
74
102
|
vue.createElementVNode("div", {
|
|
75
103
|
ref: "box",
|
|
76
|
-
class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled':
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, _hoisted_5, 10, _hoisted_3)
|
|
80
|
-
], 6))
|
|
104
|
+
class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
|
|
105
|
+
}, _hoisted_4, 2)
|
|
106
|
+
], 2))
|
|
81
107
|
}
|
|
82
108
|
|
|
83
109
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.radiobutton=function(e,
|
|
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:null,inputClass:null,inputStyle:null,inputProps: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,s,n,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",type:"radio",id:s.inputId,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,a)]),l.createElementVNode("div",{ref:"box",class:l.normalizeClass(["p-radiobutton-box",{"p-highlight":o.checked,"p-disabled":s.disabled,"p-focus":d.focused}])},u,2)],2)},t}(primevue.utils,Vue);
|
package/rating/Rating.d.ts
CHANGED
package/rating/Rating.vue
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="containerClass">
|
|
3
|
-
<span class="p-rating-icon p-rating-cancel pi pi-ban
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<span :class="['p-rating-icon p-rating-cancel pi pi-ban', {'p-focus': focusIndex === 0}]" v-if="cancel" @click="onCancelClick" @keydown="onKeyDown">
|
|
4
|
+
<span class="p-hidden-accessible" v-if="cancel">
|
|
5
|
+
<input type="radio" value="0" :name="name" :checked="modelValue === 0" :disabled="disabled" :readonly="readonly" :aria-label="$primevue.config.locale.clear" @focus="onFocus($event, 0)" @blur="onBlur" @keydown="onKeyDown($event, 0)">
|
|
6
|
+
</span>
|
|
7
|
+
</span>
|
|
8
|
+
<template :key="i" v-for="i in stars">
|
|
9
|
+
<span :class="['p-rating-icon', {'pi pi-star': (i > modelValue), 'pi pi-star-fill': (i <= modelValue), 'p-focus': i === focusIndex}]" @click="onStarClick($event,i)">
|
|
10
|
+
<span class="p-hidden-accessible">
|
|
11
|
+
<input type="radio" :value="i" :name="name" :checked="modelValue === i" :disabled="disabled" :readonly="readonly" :aria-label="ariaLabelTemplate(i)" @focus="onFocus($event, i)" @blur="onBlur" @keydown="onKeyDown($event,i)">
|
|
12
|
+
</span>
|
|
13
|
+
</span>
|
|
14
|
+
</template>
|
|
6
15
|
</div>
|
|
7
16
|
</template>
|
|
8
17
|
|
|
9
18
|
<script>
|
|
10
19
|
export default {
|
|
11
20
|
name: 'Rating',
|
|
12
|
-
emits: ['update:modelValue', 'change'],
|
|
21
|
+
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
|
13
22
|
props: {
|
|
14
23
|
modelValue: {
|
|
15
24
|
type: Number,
|
|
16
25
|
default: null
|
|
26
|
+
},
|
|
27
|
+
name: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: null
|
|
17
30
|
},
|
|
18
31
|
disabled: {
|
|
19
32
|
type: Boolean,
|
|
@@ -32,12 +45,46 @@ export default {
|
|
|
32
45
|
default: true
|
|
33
46
|
}
|
|
34
47
|
},
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
focusIndex: null
|
|
51
|
+
};
|
|
52
|
+
},
|
|
35
53
|
methods: {
|
|
36
54
|
onStarClick(event, value) {
|
|
37
55
|
if (!this.readonly && !this.disabled) {
|
|
38
56
|
this.updateModel(event, value);
|
|
57
|
+
this.focusIndex = value;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
onKeyDown(event, value) {
|
|
61
|
+
if (event.code === 'Space') {
|
|
62
|
+
this.updateModel(event, value);
|
|
63
|
+
}
|
|
64
|
+
if (event.code === 'Tab') {
|
|
65
|
+
this.focusIndex = null;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
onFocus(event, index) {
|
|
69
|
+
if (!this.readonly) {
|
|
70
|
+
if (this.modelValue === null && this.focusIndex === null) {
|
|
71
|
+
this.cancel ? this.focusIndex = 0 : this.focusIndex = 1;
|
|
72
|
+
}
|
|
73
|
+
else if (this.modelValue !== null && this.focusIndex === null) {
|
|
74
|
+
this.focusIndex = this.modelValue;
|
|
75
|
+
this.updateModel(event, this.modelValue);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.focusIndex = index;
|
|
79
|
+
this.updateModel(event, index);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
this.$emit('focus', event);
|
|
39
83
|
}
|
|
40
84
|
},
|
|
85
|
+
onBlur(event) {
|
|
86
|
+
this.$emit('blur', event);
|
|
87
|
+
},
|
|
41
88
|
onCancelClick(event) {
|
|
42
89
|
if (!this.readonly && !this.disabled) {
|
|
43
90
|
this.updateModel(event, null);
|
|
@@ -49,6 +96,9 @@ export default {
|
|
|
49
96
|
originalEvent: event,
|
|
50
97
|
value: value
|
|
51
98
|
});
|
|
99
|
+
},
|
|
100
|
+
ariaLabelTemplate(index) {
|
|
101
|
+
return index === 1 ? this.$primevue.config.locale.aria.star : this.$primevue.config.locale.aria.stars.replace(/{star}/g, index);
|
|
52
102
|
}
|
|
53
103
|
},
|
|
54
104
|
computed: {
|
|
@@ -60,9 +110,6 @@ export default {
|
|
|
60
110
|
'p-disabled': this.disabled
|
|
61
111
|
}
|
|
62
112
|
];
|
|
63
|
-
},
|
|
64
|
-
focusIndex() {
|
|
65
|
-
return (this.disabled || this.readonly) ? null : '0';
|
|
66
113
|
}
|
|
67
114
|
}
|
|
68
115
|
}
|
|
@@ -76,4 +123,11 @@ export default {
|
|
|
76
123
|
.p-rating.p-rating-readonly .p-rating-icon {
|
|
77
124
|
cursor: default;
|
|
78
125
|
}
|
|
126
|
+
|
|
127
|
+
.p-rating:not(.p-disabled) .p-rating-icon.p-focus {
|
|
128
|
+
outline: 0 none;
|
|
129
|
+
outline-offset: 0;
|
|
130
|
+
box-shadow: 0 0 0 0.2rem #BFDBFE;
|
|
131
|
+
border-color: #3B82F6;
|
|
132
|
+
}
|
|
79
133
|
</style>
|