primevue 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -94
- package/accordion/index.d.ts +2 -2
- package/accordion/index.mjs.map +1 -1
- package/accordion/style/index.mjs +1 -1
- package/accordion/style/index.mjs.map +1 -1
- package/accordioncontent/index.d.ts +2 -2
- package/accordioncontent/index.mjs.map +1 -1
- package/accordioncontent/style/index.mjs.map +1 -1
- package/accordionheader/index.d.ts +2 -2
- package/accordionheader/index.mjs.map +1 -1
- package/accordionheader/style/index.mjs.map +1 -1
- package/accordionpanel/index.d.ts +2 -2
- package/accordionpanel/index.mjs.map +1 -1
- package/accordionpanel/style/index.mjs.map +1 -1
- package/accordiontab/index.d.ts +2 -2
- package/accordiontab/index.mjs.map +1 -1
- package/accordiontab/style/index.mjs.map +1 -1
- package/animateonscroll/index.mjs.map +1 -1
- package/animateonscroll/style/index.mjs.map +1 -1
- package/autocomplete/AutoComplete.vue +36 -32
- package/autocomplete/BaseAutoComplete.vue +2 -19
- package/autocomplete/index.d.ts +23 -2
- package/autocomplete/index.mjs +40 -53
- package/autocomplete/index.mjs.map +1 -1
- package/autocomplete/style/index.mjs +7 -7
- package/autocomplete/style/index.mjs.map +1 -1
- package/avatar/index.d.ts +2 -2
- package/avatar/index.mjs.map +1 -1
- package/avatar/style/index.mjs +1 -1
- package/avatar/style/index.mjs.map +1 -1
- package/avatargroup/index.d.ts +2 -2
- package/avatargroup/index.mjs.map +1 -1
- package/avatargroup/style/index.mjs.map +1 -1
- package/badge/index.d.ts +2 -2
- package/badge/index.mjs.map +1 -1
- package/badge/style/index.mjs.map +1 -1
- package/badgedirective/index.d.ts +2 -2
- package/badgedirective/index.mjs.map +1 -1
- package/badgedirective/style/index.mjs.map +1 -1
- package/blockui/index.d.ts +2 -2
- package/blockui/index.mjs.map +1 -1
- package/blockui/style/index.mjs.map +1 -1
- package/breadcrumb/Breadcrumb.vue +1 -1
- package/breadcrumb/index.d.ts +2 -2
- package/breadcrumb/index.mjs +2 -1
- package/breadcrumb/index.mjs.map +1 -1
- package/breadcrumb/style/index.d.ts +4 -0
- package/breadcrumb/style/index.mjs +2 -1
- package/breadcrumb/style/index.mjs.map +1 -1
- package/button/BaseButton.vue +4 -0
- package/button/index.d.ts +8 -2
- package/button/index.mjs +4 -0
- package/button/index.mjs.map +1 -1
- package/button/style/index.mjs +3 -3
- package/button/style/index.mjs.map +1 -1
- package/buttongroup/index.d.ts +2 -2
- package/buttongroup/index.mjs.map +1 -1
- package/buttongroup/style/index.mjs +1 -1
- package/buttongroup/style/index.mjs.map +1 -1
- package/calendar/index.d.ts +2 -2
- package/calendar/index.mjs.map +1 -1
- package/calendar/style/index.mjs.map +1 -1
- package/card/index.d.ts +2 -2
- package/card/index.mjs.map +1 -1
- package/card/style/index.mjs.map +1 -1
- package/carousel/index.d.ts +2 -2
- package/carousel/index.mjs.map +1 -1
- package/carousel/style/index.mjs +1 -1
- package/carousel/style/index.mjs.map +1 -1
- package/cascadeselect/BaseCascadeSelect.vue +8 -14
- package/cascadeselect/CascadeSelect.vue +86 -55
- package/cascadeselect/CascadeSelectSub.vue +8 -17
- package/cascadeselect/index.d.ts +47 -2
- package/cascadeselect/index.mjs +148 -99
- package/cascadeselect/index.mjs.map +1 -1
- package/cascadeselect/style/index.d.ts +4 -0
- package/cascadeselect/style/index.mjs +9 -6
- package/cascadeselect/style/index.mjs.map +1 -1
- package/chart/index.d.ts +2 -2
- package/chart/index.mjs.map +1 -1
- package/chart/style/index.mjs.map +1 -1
- package/checkbox/BaseCheckbox.vue +2 -19
- package/checkbox/Checkbox.vue +18 -6
- package/checkbox/index.d.ts +19 -2
- package/checkbox/index.mjs +20 -25
- package/checkbox/index.mjs.map +1 -1
- package/checkbox/style/index.mjs +5 -3
- package/checkbox/style/index.mjs.map +1 -1
- package/checkboxgroup/BaseCheckboxGroup.vue +16 -0
- package/checkboxgroup/CheckboxGroup.vue +29 -0
- package/checkboxgroup/index.d.ts +160 -0
- package/checkboxgroup/index.mjs +46 -0
- package/checkboxgroup/index.mjs.map +1 -0
- package/checkboxgroup/package.json +11 -0
- package/checkboxgroup/style/index.d.ts +19 -0
- package/checkboxgroup/style/index.mjs +17 -0
- package/checkboxgroup/style/index.mjs.map +1 -0
- package/checkboxgroup/style/package.json +6 -0
- package/chip/index.d.ts +2 -2
- package/chip/index.mjs.map +1 -1
- package/chip/style/index.mjs +1 -1
- package/chip/style/index.mjs.map +1 -1
- package/chips/index.d.ts +2 -2
- package/chips/index.mjs.map +1 -1
- package/chips/style/index.mjs.map +1 -1
- package/colorpicker/BaseColorPicker.vue +2 -10
- package/colorpicker/ColorPicker.vue +7 -4
- package/colorpicker/index.d.ts +24 -2
- package/colorpicker/index.mjs +21 -23
- package/colorpicker/index.mjs.map +1 -1
- package/colorpicker/style/index.mjs +5 -3
- package/colorpicker/style/index.mjs.map +1 -1
- package/column/index.d.ts +2 -2
- package/column/index.mjs.map +1 -1
- package/column/style/index.mjs.map +1 -1
- package/columngroup/index.d.ts +2 -2
- package/columngroup/index.mjs.map +1 -1
- package/columngroup/style/index.mjs.map +1 -1
- package/config/index.d.ts +4 -0
- package/confirmationservice/index.mjs.map +1 -1
- package/confirmdialog/index.d.ts +2 -2
- package/confirmdialog/index.mjs.map +1 -1
- package/confirmdialog/style/index.mjs.map +1 -1
- package/confirmpopup/index.d.ts +2 -2
- package/confirmpopup/index.mjs.map +1 -1
- package/confirmpopup/style/index.mjs +1 -1
- package/confirmpopup/style/index.mjs.map +1 -1
- package/contextmenu/ContextMenu.vue +8 -3
- package/contextmenu/index.d.ts +2 -2
- package/contextmenu/index.mjs +6 -3
- package/contextmenu/index.mjs.map +1 -1
- package/contextmenu/style/index.mjs +1 -1
- package/contextmenu/style/index.mjs.map +1 -1
- package/datatable/BodyCell.vue +15 -6
- package/datatable/DataTable.vue +58 -4
- package/datatable/FooterCell.vue +15 -6
- package/datatable/HeaderCell.vue +15 -6
- package/datatable/index.d.ts +14 -10
- package/datatable/index.mjs +167 -82
- package/datatable/index.mjs.map +1 -1
- package/datatable/style/index.mjs +1 -1
- package/datatable/style/index.mjs.map +1 -1
- package/dataview/DataView.vue +33 -1
- package/dataview/index.d.ts +6 -2
- package/dataview/index.mjs +42 -6
- package/dataview/index.mjs.map +1 -1
- package/dataview/style/index.mjs.map +1 -1
- package/datepicker/BaseDatePicker.vue +2 -23
- package/datepicker/DatePicker.vue +39 -40
- package/datepicker/index.d.ts +23 -6
- package/datepicker/index.mjs +45 -65
- package/datepicker/index.mjs.map +1 -1
- package/datepicker/style/index.mjs +4 -5
- package/datepicker/style/index.mjs.map +1 -1
- package/deferredcontent/index.d.ts +2 -2
- package/deferredcontent/index.mjs.map +1 -1
- package/deferredcontent/style/index.mjs.map +1 -1
- package/dialog/index.d.ts +2 -2
- package/dialog/index.mjs.map +1 -1
- package/dialog/style/index.mjs +1 -1
- package/dialog/style/index.mjs.map +1 -1
- package/dialogservice/index.mjs.map +1 -1
- package/divider/index.d.ts +2 -2
- package/divider/index.mjs.map +1 -1
- package/divider/style/index.mjs +1 -1
- package/divider/style/index.mjs.map +1 -1
- package/dock/index.d.ts +2 -2
- package/dock/index.mjs.map +1 -1
- package/dock/style/index.mjs +1 -1
- package/dock/style/index.mjs.map +1 -1
- package/drawer/index.d.ts +2 -2
- package/drawer/index.mjs.map +1 -1
- package/drawer/style/index.mjs +1 -1
- package/drawer/style/index.mjs.map +1 -1
- package/dropdown/index.d.ts +2 -2
- package/dropdown/index.mjs.map +1 -1
- package/dropdown/style/index.mjs.map +1 -1
- package/dynamicdialog/index.d.ts +2 -2
- package/dynamicdialog/index.mjs.map +1 -1
- package/dynamicdialog/style/index.mjs.map +1 -1
- package/editor/BaseEditor.vue +2 -3
- package/editor/Editor.vue +3 -3
- package/editor/index.d.ts +24 -2
- package/editor/index.mjs +5 -6
- package/editor/index.mjs.map +1 -1
- package/editor/style/index.mjs +7 -2
- package/editor/style/index.mjs.map +1 -1
- package/fieldset/index.d.ts +2 -2
- package/fieldset/index.mjs.map +1 -1
- package/fieldset/style/index.mjs +1 -1
- package/fieldset/style/index.mjs.map +1 -1
- package/fileupload/index.d.ts +2 -2
- package/fileupload/index.mjs.map +1 -1
- package/fileupload/style/index.mjs +1 -1
- package/fileupload/style/index.mjs.map +1 -1
- package/floatlabel/index.d.ts +2 -2
- package/floatlabel/index.mjs.map +1 -1
- package/floatlabel/style/index.mjs +1 -1
- package/floatlabel/style/index.mjs.map +1 -1
- package/fluid/index.d.ts +2 -2
- package/fluid/index.mjs.map +1 -1
- package/fluid/style/index.mjs.map +1 -1
- package/focustrap/index.mjs.map +1 -1
- package/focustrap/style/index.mjs.map +1 -1
- package/galleria/index.d.ts +2 -2
- package/galleria/index.mjs.map +1 -1
- package/galleria/style/index.mjs +1 -1
- package/galleria/style/index.mjs.map +1 -1
- package/iconfield/index.d.ts +2 -2
- package/iconfield/index.mjs.map +1 -1
- package/iconfield/style/index.mjs +1 -1
- package/iconfield/style/index.mjs.map +1 -1
- package/iftalabel/index.d.ts +2 -2
- package/iftalabel/index.mjs.map +1 -1
- package/iftalabel/style/index.mjs +1 -1
- package/iftalabel/style/index.mjs.map +1 -1
- package/image/index.d.ts +2 -2
- package/image/index.mjs.map +1 -1
- package/image/style/index.mjs +1 -1
- package/image/style/index.mjs.map +1 -1
- package/imagecompare/ImageCompare.vue +33 -1
- package/imagecompare/index.d.ts +2 -2
- package/imagecompare/index.mjs +35 -1
- package/imagecompare/index.mjs.map +1 -1
- package/imagecompare/style/index.mjs +1 -1
- package/imagecompare/style/index.mjs.map +1 -1
- package/index.d.ts +811 -0
- package/index.mjs +531 -0
- package/index.mjs.map +1 -0
- package/inlinemessage/index.d.ts +2 -2
- package/inlinemessage/index.mjs.map +1 -1
- package/inlinemessage/style/index.mjs.map +1 -1
- package/inplace/index.d.ts +2 -6
- package/inplace/index.mjs.map +1 -1
- package/inplace/style/index.mjs.map +1 -1
- package/inputchips/index.d.ts +2 -2
- package/inputchips/index.mjs.map +1 -1
- package/inputchips/style/index.mjs.map +1 -1
- package/inputgroup/index.d.ts +2 -2
- package/inputgroup/index.mjs.map +1 -1
- package/inputgroup/style/index.mjs +1 -1
- package/inputgroup/style/index.mjs.map +1 -1
- package/inputgroupaddon/index.d.ts +2 -2
- package/inputgroupaddon/index.mjs.map +1 -1
- package/inputgroupaddon/style/index.mjs.map +1 -1
- package/inputicon/index.d.ts +2 -2
- package/inputicon/index.mjs.map +1 -1
- package/inputicon/style/index.mjs.map +1 -1
- package/inputmask/BaseInputMask.vue +2 -23
- package/inputmask/InputMask.vue +9 -14
- package/inputmask/index.d.ts +15 -2
- package/inputmask/index.mjs +13 -38
- package/inputmask/index.mjs.map +1 -1
- package/inputmask/style/index.mjs +1 -1
- package/inputmask/style/index.mjs.map +1 -1
- package/inputnumber/BaseInputNumber.vue +2 -22
- package/inputnumber/InputNumber.vue +14 -16
- package/inputnumber/index.d.ts +28 -2
- package/inputnumber/index.mjs +22 -39
- package/inputnumber/index.mjs.map +1 -1
- package/inputnumber/style/index.mjs +3 -3
- package/inputnumber/style/index.mjs.map +1 -1
- package/inputotp/BaseInputOtp.vue +2 -18
- package/inputotp/InputOtp.vue +4 -2
- package/inputotp/index.d.ts +23 -2
- package/inputotp/index.mjs +7 -21
- package/inputotp/index.mjs.map +1 -1
- package/inputotp/style/index.mjs +2 -2
- package/inputotp/style/index.mjs.map +1 -1
- package/inputswitch/index.d.ts +2 -2
- package/inputswitch/index.mjs.map +1 -1
- package/inputswitch/style/index.mjs.map +1 -1
- package/inputtext/BaseInputText.vue +2 -21
- package/inputtext/InputText.vue +13 -22
- package/inputtext/index.d.ts +19 -2
- package/inputtext/index.mjs +16 -48
- package/inputtext/index.mjs.map +1 -1
- package/inputtext/style/index.mjs +7 -7
- package/inputtext/style/index.mjs.map +1 -1
- package/keyfilter/index.mjs.map +1 -1
- package/keyfilter/style/index.mjs.map +1 -1
- package/knob/BaseKnob.vue +2 -10
- package/knob/Knob.vue +23 -19
- package/knob/index.d.ts +26 -4
- package/knob/index.mjs +31 -32
- package/knob/index.mjs.map +1 -1
- package/knob/style/index.mjs +4 -2
- package/knob/style/index.mjs.map +1 -1
- package/listbox/BaseListbox.vue +2 -11
- package/listbox/Listbox.vue +21 -20
- package/listbox/index.d.ts +19 -2
- package/listbox/index.mjs +23 -31
- package/listbox/index.mjs.map +1 -1
- package/listbox/style/index.mjs +4 -3
- package/listbox/style/index.mjs.map +1 -1
- package/megamenu/BaseMegaMenu.vue +4 -0
- package/megamenu/MegaMenu.vue +15 -5
- package/megamenu/index.d.ts +7 -2
- package/megamenu/index.mjs +23 -6
- package/megamenu/index.mjs.map +1 -1
- package/megamenu/style/index.mjs +5 -5
- package/megamenu/style/index.mjs.map +1 -1
- package/menu/index.d.ts +2 -2
- package/menu/index.mjs.map +1 -1
- package/menu/style/index.mjs +1 -1
- package/menu/style/index.mjs.map +1 -1
- package/menubar/Menubar.vue +8 -3
- package/menubar/index.d.ts +2 -2
- package/menubar/index.mjs +6 -3
- package/menubar/index.mjs.map +1 -1
- package/menubar/style/index.mjs +1 -1
- package/menubar/style/index.mjs.map +1 -1
- package/message/BaseMessage.vue +8 -0
- package/message/index.d.ts +11 -2
- package/message/index.mjs +8 -0
- package/message/index.mjs.map +1 -1
- package/message/style/index.mjs +7 -2
- package/message/style/index.mjs.map +1 -1
- package/metergroup/index.d.ts +2 -2
- package/metergroup/index.mjs.map +1 -1
- package/metergroup/style/index.mjs +1 -1
- package/metergroup/style/index.mjs.map +1 -1
- package/multiselect/BaseMultiSelect.vue +14 -19
- package/multiselect/MultiSelect.vue +45 -31
- package/multiselect/index.d.ts +52 -2
- package/multiselect/index.mjs +71 -52
- package/multiselect/index.mjs.map +1 -1
- package/multiselect/style/index.d.ts +4 -0
- package/multiselect/style/index.mjs +8 -5
- package/multiselect/style/index.mjs.map +1 -1
- package/orderlist/index.d.ts +2 -2
- package/orderlist/index.mjs.map +1 -1
- package/orderlist/style/index.mjs.map +1 -1
- package/organizationchart/index.d.ts +2 -2
- package/organizationchart/index.mjs.map +1 -1
- package/organizationchart/style/index.mjs +1 -1
- package/organizationchart/style/index.mjs.map +1 -1
- package/overlaybadge/index.d.ts +2 -2
- package/overlaybadge/index.mjs.map +1 -1
- package/overlaybadge/style/index.mjs +1 -1
- package/overlaybadge/style/index.mjs.map +1 -1
- package/overlaypanel/index.d.ts +2 -2
- package/overlaypanel/index.mjs.map +1 -1
- package/overlaypanel/style/index.mjs.map +1 -1
- package/package.json +15 -6
- package/paginator/Paginator.vue +104 -84
- package/paginator/index.d.ts +56 -2
- package/paginator/index.mjs +21 -3
- package/paginator/index.mjs.map +1 -1
- package/paginator/style/index.mjs +1 -1
- package/paginator/style/index.mjs.map +1 -1
- package/panel/index.d.ts +2 -2
- package/panel/index.mjs.map +1 -1
- package/panel/style/index.mjs.map +1 -1
- package/panelmenu/index.d.ts +2 -2
- package/panelmenu/index.mjs.map +1 -1
- package/panelmenu/style/index.mjs +1 -1
- package/panelmenu/style/index.mjs.map +1 -1
- package/passthrough/index.mjs.map +1 -1
- package/password/BasePassword.vue +2 -15
- package/password/Password.vue +13 -18
- package/password/index.d.ts +23 -2
- package/password/index.mjs +14 -32
- package/password/index.mjs.map +1 -1
- package/password/style/index.mjs +3 -3
- package/password/style/index.mjs.map +1 -1
- package/picklist/index.d.ts +2 -2
- package/picklist/index.mjs.map +1 -1
- package/picklist/style/index.mjs.map +1 -1
- package/popover/index.d.ts +2 -2
- package/popover/index.mjs.map +1 -1
- package/popover/style/index.mjs +1 -1
- package/popover/style/index.mjs.map +1 -1
- package/portal/index.d.ts +2 -2
- package/portal/index.mjs.map +1 -1
- package/portal/style/index.mjs.map +1 -1
- package/progressbar/index.d.ts +2 -2
- package/progressbar/index.mjs.map +1 -1
- package/progressbar/style/index.mjs +1 -1
- package/progressbar/style/index.mjs.map +1 -1
- package/progressspinner/index.d.ts +2 -2
- package/progressspinner/index.mjs.map +1 -1
- package/progressspinner/style/index.mjs.map +1 -1
- package/radiobutton/BaseRadioButton.vue +2 -19
- package/radiobutton/RadioButton.vue +15 -4
- package/radiobutton/index.d.ts +19 -2
- package/radiobutton/index.mjs +17 -23
- package/radiobutton/index.mjs.map +1 -1
- package/radiobutton/style/index.mjs +5 -3
- package/radiobutton/style/index.mjs.map +1 -1
- package/radiobuttongroup/BaseRadioButtonGroup.vue +16 -0
- package/radiobuttongroup/RadioButtonGroup.vue +29 -0
- package/radiobuttongroup/index.d.ts +160 -0
- package/radiobuttongroup/index.mjs +46 -0
- package/radiobuttongroup/index.mjs.map +1 -0
- package/radiobuttongroup/package.json +11 -0
- package/radiobuttongroup/style/index.d.ts +19 -0
- package/radiobuttongroup/style/index.mjs +17 -0
- package/radiobuttongroup/style/index.mjs.map +1 -0
- package/radiobuttongroup/style/package.json +6 -0
- package/rating/BaseRating.vue +2 -10
- package/rating/Rating.vue +17 -16
- package/rating/index.d.ts +20 -2
- package/rating/index.mjs +17 -23
- package/rating/index.mjs.map +1 -1
- package/rating/style/index.mjs +14 -5
- package/rating/style/index.mjs.map +1 -1
- package/ripple/index.mjs.map +1 -1
- package/ripple/style/index.mjs.map +1 -1
- package/row/index.d.ts +2 -2
- package/row/index.mjs.map +1 -1
- package/row/style/index.mjs.map +1 -1
- package/scrollpanel/ScrollPanel.vue +38 -5
- package/scrollpanel/index.d.ts +2 -2
- package/scrollpanel/index.mjs +58 -28
- package/scrollpanel/index.mjs.map +1 -1
- package/scrollpanel/style/index.mjs +1 -1
- package/scrollpanel/style/index.mjs.map +1 -1
- package/scrolltop/index.d.ts +2 -2
- package/scrolltop/index.mjs.map +1 -1
- package/scrolltop/style/index.mjs +1 -1
- package/scrolltop/style/index.mjs.map +1 -1
- package/select/BaseSelect.vue +2 -19
- package/select/Select.vue +15 -19
- package/select/index.d.ts +23 -2
- package/select/index.mjs +18 -40
- package/select/index.mjs.map +1 -1
- package/select/style/index.mjs +7 -5
- package/select/style/index.mjs.map +1 -1
- package/selectbutton/BaseSelectButton.vue +6 -8
- package/selectbutton/SelectButton.vue +9 -8
- package/selectbutton/index.d.ts +23 -2
- package/selectbutton/index.mjs +15 -16
- package/selectbutton/index.mjs.map +1 -1
- package/selectbutton/style/index.mjs +3 -3
- package/selectbutton/style/index.mjs.map +1 -1
- package/sidebar/index.d.ts +2 -2
- package/sidebar/index.mjs.map +1 -1
- package/sidebar/style/index.mjs.map +1 -1
- package/skeleton/index.d.ts +2 -2
- package/skeleton/index.mjs.map +1 -1
- package/skeleton/style/index.mjs +1 -1
- package/skeleton/style/index.mjs.map +1 -1
- package/slider/BaseSlider.vue +2 -7
- package/slider/Slider.vue +94 -38
- package/slider/index.d.ts +24 -2
- package/slider/index.mjs +145 -72
- package/slider/index.mjs.map +1 -1
- package/slider/style/index.mjs +4 -2
- package/slider/style/index.mjs.map +1 -1
- package/speeddial/index.d.ts +2 -2
- package/speeddial/index.mjs.map +1 -1
- package/speeddial/style/index.mjs +1 -1
- package/speeddial/style/index.mjs.map +1 -1
- package/splitbutton/index.d.ts +2 -2
- package/splitbutton/index.mjs.map +1 -1
- package/splitbutton/style/index.mjs +1 -1
- package/splitbutton/style/index.mjs.map +1 -1
- package/splitter/Splitter.vue +31 -3
- package/splitter/index.d.ts +2 -2
- package/splitter/index.mjs +50 -20
- package/splitter/index.mjs.map +1 -1
- package/splitter/style/index.mjs.map +1 -1
- package/splitterpanel/index.d.ts +2 -2
- package/splitterpanel/index.mjs.map +1 -1
- package/splitterpanel/style/index.mjs.map +1 -1
- package/step/index.d.ts +2 -2
- package/step/index.mjs.map +1 -1
- package/step/style/index.mjs.map +1 -1
- package/stepitem/index.d.ts +2 -2
- package/stepitem/index.mjs.map +1 -1
- package/stepitem/style/index.mjs.map +1 -1
- package/steplist/index.d.ts +2 -2
- package/steplist/index.mjs.map +1 -1
- package/steplist/style/index.mjs.map +1 -1
- package/steppanel/index.d.ts +2 -2
- package/steppanel/index.mjs.map +1 -1
- package/steppanel/style/index.mjs.map +1 -1
- package/steppanels/index.d.ts +2 -2
- package/steppanels/index.mjs.map +1 -1
- package/steppanels/style/index.mjs.map +1 -1
- package/stepper/index.d.ts +2 -2
- package/stepper/index.mjs.map +1 -1
- package/stepper/style/index.mjs +1 -1
- package/stepper/style/index.mjs.map +1 -1
- package/steps/index.d.ts +2 -2
- package/steps/index.mjs.map +1 -1
- package/steps/style/index.mjs +1 -1
- package/steps/style/index.mjs.map +1 -1
- package/styleclass/index.mjs.map +1 -1
- package/styleclass/style/index.mjs.map +1 -1
- package/tab/index.d.ts +2 -2
- package/tab/index.mjs.map +1 -1
- package/tab/style/index.mjs.map +1 -1
- package/tablist/TabList.vue +40 -5
- package/tablist/index.d.ts +2 -2
- package/tablist/index.mjs +38 -5
- package/tablist/index.mjs.map +1 -1
- package/tablist/style/index.mjs.map +1 -1
- package/tabmenu/index.d.ts +2 -2
- package/tabmenu/index.mjs.map +1 -1
- package/tabmenu/style/index.mjs.map +1 -1
- package/tabpanel/index.d.ts +2 -2
- package/tabpanel/index.mjs.map +1 -1
- package/tabpanel/style/index.mjs.map +1 -1
- package/tabpanels/index.d.ts +2 -2
- package/tabpanels/index.mjs.map +1 -1
- package/tabpanels/style/index.mjs.map +1 -1
- package/tabs/index.d.ts +2 -2
- package/tabs/index.mjs.map +1 -1
- package/tabs/style/index.mjs +1 -1
- package/tabs/style/index.mjs.map +1 -1
- package/tabview/index.d.ts +2 -2
- package/tabview/index.mjs.map +1 -1
- package/tabview/style/index.mjs.map +1 -1
- package/tag/index.d.ts +2 -2
- package/tag/index.mjs.map +1 -1
- package/tag/style/index.mjs.map +1 -1
- package/terminal/index.d.ts +2 -2
- package/terminal/index.mjs.map +1 -1
- package/terminal/style/index.mjs +1 -1
- package/terminal/style/index.mjs.map +1 -1
- package/textarea/BaseTextarea.vue +3 -16
- package/textarea/Textarea.vue +13 -19
- package/textarea/index.d.ts +23 -2
- package/textarea/index.mjs +14 -38
- package/textarea/index.mjs.map +1 -1
- package/textarea/style/index.mjs +7 -5
- package/textarea/style/index.mjs.map +1 -1
- package/tieredmenu/TieredMenu.vue +8 -3
- package/tieredmenu/index.d.ts +2 -2
- package/tieredmenu/index.mjs +6 -3
- package/tieredmenu/index.mjs.map +1 -1
- package/tieredmenu/style/index.mjs +1 -1
- package/tieredmenu/style/index.mjs.map +1 -1
- package/timeline/index.d.ts +2 -2
- package/timeline/index.mjs.map +1 -1
- package/timeline/style/index.mjs.map +1 -1
- package/toast/Toast.vue +0 -1
- package/toast/index.d.ts +2 -2
- package/toast/index.mjs.map +1 -1
- package/toast/style/index.mjs +1 -1
- package/toast/style/index.mjs.map +1 -1
- package/toastservice/index.mjs.map +1 -1
- package/togglebutton/BaseToggleButton.vue +6 -11
- package/togglebutton/ToggleButton.vue +11 -7
- package/togglebutton/index.d.ts +23 -2
- package/togglebutton/index.mjs +20 -18
- package/togglebutton/index.mjs.map +1 -1
- package/togglebutton/style/index.mjs +4 -2
- package/togglebutton/style/index.mjs.map +1 -1
- package/toggleswitch/BaseToggleSwitch.vue +2 -14
- package/toggleswitch/ToggleSwitch.vue +4 -3
- package/toggleswitch/index.d.ts +19 -2
- package/toggleswitch/index.mjs +7 -17
- package/toggleswitch/index.mjs.map +1 -1
- package/toggleswitch/style/index.mjs +2 -2
- package/toggleswitch/style/index.mjs.map +1 -1
- package/toolbar/index.d.ts +2 -2
- package/toolbar/index.mjs.map +1 -1
- package/toolbar/style/index.mjs.map +1 -1
- package/tooltip/index.mjs.map +1 -1
- package/tooltip/style/index.mjs +1 -1
- package/tooltip/style/index.mjs.map +1 -1
- package/tree/Tree.vue +1 -1
- package/tree/TreeNode.vue +1 -1
- package/tree/index.d.ts +2 -2
- package/tree/index.mjs +5 -4
- package/tree/index.mjs.map +1 -1
- package/tree/style/index.mjs +2 -1
- package/tree/style/index.mjs.map +1 -1
- package/treeselect/BaseTreeSelect.vue +18 -19
- package/treeselect/TreeSelect.vue +61 -18
- package/treeselect/index.d.ts +82 -28
- package/treeselect/index.mjs +87 -38
- package/treeselect/index.mjs.map +1 -1
- package/treeselect/style/index.d.ts +4 -0
- package/treeselect/style/index.mjs +8 -5
- package/treeselect/style/index.mjs.map +1 -1
- package/treetable/BodyCell.vue +21 -12
- package/treetable/FooterCell.vue +15 -6
- package/treetable/HeaderCell.vue +15 -6
- package/treetable/TreeTable.vue +57 -2
- package/treetable/index.d.ts +14 -10
- package/treetable/index.mjs +146 -59
- package/treetable/index.mjs.map +1 -1
- package/treetable/style/index.mjs +1 -1
- package/treetable/style/index.mjs.map +1 -1
- package/umd/primevue.min.js +1 -1
- package/useconfirm/index.mjs.map +1 -1
- package/usedialog/index.mjs.map +1 -1
- package/usetoast/index.mjs.map +1 -1
- package/virtualscroller/index.d.ts +2 -2
- package/virtualscroller/index.mjs.map +1 -1
- package/virtualscroller/style/index.mjs.map +1 -1
- package/web-types.json +2 -2
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
2
|
+
import BaseEditableHolder from '@primevue/core/baseeditableholder';
|
|
3
3
|
import ToggleButtonStyle from 'primevue/togglebutton/style';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
name: 'BaseToggleButton',
|
|
7
|
-
extends:
|
|
7
|
+
extends: BaseEditableHolder,
|
|
8
8
|
props: {
|
|
9
|
-
modelValue: Boolean,
|
|
10
9
|
onIcon: String,
|
|
11
10
|
offIcon: String,
|
|
12
11
|
onLabel: {
|
|
@@ -21,14 +20,6 @@ export default {
|
|
|
21
20
|
type: String,
|
|
22
21
|
default: 'left'
|
|
23
22
|
},
|
|
24
|
-
invalid: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false
|
|
27
|
-
},
|
|
28
|
-
disabled: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
23
|
readonly: {
|
|
33
24
|
type: Boolean,
|
|
34
25
|
default: false
|
|
@@ -44,6 +35,10 @@ export default {
|
|
|
44
35
|
ariaLabel: {
|
|
45
36
|
type: String,
|
|
46
37
|
default: null
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: null
|
|
47
42
|
}
|
|
48
43
|
},
|
|
49
44
|
style: ToggleButtonStyle,
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
:class="cx('root')"
|
|
6
6
|
:tabindex="tabindex"
|
|
7
7
|
:disabled="disabled"
|
|
8
|
-
:aria-pressed="
|
|
8
|
+
:aria-pressed="d_value"
|
|
9
9
|
@click="onChange"
|
|
10
|
+
@blur="onBlur"
|
|
10
11
|
v-bind="getPTOptions('root')"
|
|
11
12
|
:aria-labelledby="ariaLabelledby"
|
|
12
13
|
:data-p-checked="active"
|
|
@@ -14,8 +15,8 @@
|
|
|
14
15
|
>
|
|
15
16
|
<span :class="cx('content')" v-bind="getPTOptions('content')">
|
|
16
17
|
<slot>
|
|
17
|
-
<slot name="icon" :value="
|
|
18
|
-
<span v-if="onIcon || offIcon" :class="[cx('icon'),
|
|
18
|
+
<slot name="icon" :value="d_value" :class="cx('icon')">
|
|
19
|
+
<span v-if="onIcon || offIcon" :class="[cx('icon'), d_value ? onIcon : offIcon]" v-bind="getPTOptions('icon')" />
|
|
19
20
|
</slot>
|
|
20
21
|
<span :class="cx('label')" v-bind="getPTOptions('label')">{{ label }}</span>
|
|
21
22
|
</slot>
|
|
@@ -32,7 +33,7 @@ export default {
|
|
|
32
33
|
name: 'ToggleButton',
|
|
33
34
|
extends: BaseToggleButton,
|
|
34
35
|
inheritAttrs: false,
|
|
35
|
-
emits: ['
|
|
36
|
+
emits: ['change'],
|
|
36
37
|
methods: {
|
|
37
38
|
getPTOptions(key) {
|
|
38
39
|
const _ptm = key === 'root' ? this.ptmi : this.ptm;
|
|
@@ -46,20 +47,23 @@ export default {
|
|
|
46
47
|
},
|
|
47
48
|
onChange(event) {
|
|
48
49
|
if (!this.disabled && !this.readonly) {
|
|
49
|
-
this
|
|
50
|
+
this.writeValue(!this.d_value, event);
|
|
50
51
|
this.$emit('change', event);
|
|
51
52
|
}
|
|
53
|
+
},
|
|
54
|
+
onBlur(event) {
|
|
55
|
+
this.formField.onBlur?.(event);
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
58
|
computed: {
|
|
55
59
|
active() {
|
|
56
|
-
return this.
|
|
60
|
+
return this.d_value === true;
|
|
57
61
|
},
|
|
58
62
|
hasLabel() {
|
|
59
63
|
return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);
|
|
60
64
|
},
|
|
61
65
|
label() {
|
|
62
|
-
return this.hasLabel ? (this.
|
|
66
|
+
return this.hasLabel ? (this.d_value ? this.onLabel : this.offLabel) : ' ';
|
|
63
67
|
}
|
|
64
68
|
},
|
|
65
69
|
directives: {
|
package/togglebutton/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module togglebutton
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
import type { DefineComponent, DesignToken, EmitFn,
|
|
10
|
+
import type { DefineComponent, DesignToken, EmitFn, PassThrough } from '@primevue/core';
|
|
11
11
|
import type { ComponentHooks } from '@primevue/core/basecomponent';
|
|
12
12
|
import type { PassThroughOptions } from 'primevue/passthrough';
|
|
13
13
|
import { VNode } from 'vue';
|
|
@@ -104,6 +104,14 @@ export interface ToggleButtonProps {
|
|
|
104
104
|
* @defaultValue false
|
|
105
105
|
*/
|
|
106
106
|
modelValue?: boolean | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* The default value for the input when not controlled by `modelValue`.
|
|
109
|
+
*/
|
|
110
|
+
defaultValue?: boolean | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* The name attribute for the element, typically used in form submissions.
|
|
113
|
+
*/
|
|
114
|
+
name?: string | undefined;
|
|
107
115
|
/**
|
|
108
116
|
* Icon for the on state.
|
|
109
117
|
*/
|
|
@@ -150,6 +158,14 @@ export interface ToggleButtonProps {
|
|
|
150
158
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
|
151
159
|
*/
|
|
152
160
|
ariaLabelledby?: string | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* Defines the size of the component.
|
|
163
|
+
*/
|
|
164
|
+
size?: 'small' | 'large' | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Form control object, typically used for handling validation and form state.
|
|
167
|
+
*/
|
|
168
|
+
formControl?: Record<string, any> | undefined;
|
|
153
169
|
/**
|
|
154
170
|
* It generates scoped CSS variables using design tokens for the component.
|
|
155
171
|
*/
|
|
@@ -204,6 +220,11 @@ export interface ToggleButtonEmitsOptions {
|
|
|
204
220
|
* @param {boolean} value - New value.
|
|
205
221
|
*/
|
|
206
222
|
'update:modelValue'(value: boolean): void;
|
|
223
|
+
/**
|
|
224
|
+
* Emitted when the value changes in uncontrolled mode.
|
|
225
|
+
* @param {boolean} value - New value.
|
|
226
|
+
*/
|
|
227
|
+
'value-change'(value: boolean): void;
|
|
207
228
|
/**
|
|
208
229
|
* Callback to invoke on value change.
|
|
209
230
|
* @param {Event} event - Browser event.
|
|
@@ -239,7 +260,7 @@ declare const ToggleButton: DefineComponent<ToggleButtonProps, ToggleButtonSlots
|
|
|
239
260
|
|
|
240
261
|
declare module 'vue' {
|
|
241
262
|
export interface GlobalComponents {
|
|
242
|
-
ToggleButton:
|
|
263
|
+
ToggleButton: DefineComponent<ToggleButtonProps, ToggleButtonSlots, ToggleButtonEmits>;
|
|
243
264
|
}
|
|
244
265
|
}
|
|
245
266
|
|
package/togglebutton/index.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { isNotEmpty } from '@primeuix/utils/object';
|
|
2
2
|
import Ripple from 'primevue/ripple';
|
|
3
|
-
import
|
|
3
|
+
import BaseEditableHolder from '@primevue/core/baseeditableholder';
|
|
4
4
|
import ToggleButtonStyle from 'primevue/togglebutton/style';
|
|
5
5
|
import { resolveDirective, withDirectives, openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot, normalizeClass, createCommentVNode, toDisplayString } from 'vue';
|
|
6
6
|
|
|
7
7
|
var script$1 = {
|
|
8
8
|
name: 'BaseToggleButton',
|
|
9
|
-
"extends":
|
|
9
|
+
"extends": BaseEditableHolder,
|
|
10
10
|
props: {
|
|
11
|
-
modelValue: Boolean,
|
|
12
11
|
onIcon: String,
|
|
13
12
|
offIcon: String,
|
|
14
13
|
onLabel: {
|
|
@@ -23,14 +22,6 @@ var script$1 = {
|
|
|
23
22
|
type: String,
|
|
24
23
|
"default": 'left'
|
|
25
24
|
},
|
|
26
|
-
invalid: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
"default": false
|
|
29
|
-
},
|
|
30
|
-
disabled: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
"default": false
|
|
33
|
-
},
|
|
34
25
|
readonly: {
|
|
35
26
|
type: Boolean,
|
|
36
27
|
"default": false
|
|
@@ -46,6 +37,10 @@ var script$1 = {
|
|
|
46
37
|
ariaLabel: {
|
|
47
38
|
type: String,
|
|
48
39
|
"default": null
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
type: String,
|
|
43
|
+
"default": null
|
|
49
44
|
}
|
|
50
45
|
},
|
|
51
46
|
style: ToggleButtonStyle,
|
|
@@ -61,7 +56,7 @@ var script = {
|
|
|
61
56
|
name: 'ToggleButton',
|
|
62
57
|
"extends": script$1,
|
|
63
58
|
inheritAttrs: false,
|
|
64
|
-
emits: ['
|
|
59
|
+
emits: ['change'],
|
|
65
60
|
methods: {
|
|
66
61
|
getPTOptions: function getPTOptions(key) {
|
|
67
62
|
var _ptm = key === 'root' ? this.ptmi : this.ptm;
|
|
@@ -74,20 +69,24 @@ var script = {
|
|
|
74
69
|
},
|
|
75
70
|
onChange: function onChange(event) {
|
|
76
71
|
if (!this.disabled && !this.readonly) {
|
|
77
|
-
this
|
|
72
|
+
this.writeValue(!this.d_value, event);
|
|
78
73
|
this.$emit('change', event);
|
|
79
74
|
}
|
|
75
|
+
},
|
|
76
|
+
onBlur: function onBlur(event) {
|
|
77
|
+
var _this$formField$onBlu, _this$formField;
|
|
78
|
+
(_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event);
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
computed: {
|
|
83
82
|
active: function active() {
|
|
84
|
-
return this.
|
|
83
|
+
return this.d_value === true;
|
|
85
84
|
},
|
|
86
85
|
hasLabel: function hasLabel() {
|
|
87
86
|
return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);
|
|
88
87
|
},
|
|
89
88
|
label: function label() {
|
|
90
|
-
return this.hasLabel ? this.
|
|
89
|
+
return this.hasLabel ? this.d_value ? this.onLabel : this.offLabel : ' ';
|
|
91
90
|
}
|
|
92
91
|
},
|
|
93
92
|
directives: {
|
|
@@ -103,9 +102,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
103
102
|
"class": _ctx.cx('root'),
|
|
104
103
|
tabindex: _ctx.tabindex,
|
|
105
104
|
disabled: _ctx.disabled,
|
|
106
|
-
"aria-pressed": _ctx.
|
|
105
|
+
"aria-pressed": _ctx.d_value,
|
|
107
106
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
108
107
|
return $options.onChange && $options.onChange.apply($options, arguments);
|
|
108
|
+
}),
|
|
109
|
+
onBlur: _cache[1] || (_cache[1] = function () {
|
|
110
|
+
return $options.onBlur && $options.onBlur.apply($options, arguments);
|
|
109
111
|
})
|
|
110
112
|
}, $options.getPTOptions('root'), {
|
|
111
113
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
@@ -115,12 +117,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
115
117
|
"class": _ctx.cx('content')
|
|
116
118
|
}, $options.getPTOptions('content')), [renderSlot(_ctx.$slots, "default", {}, function () {
|
|
117
119
|
return [renderSlot(_ctx.$slots, "icon", {
|
|
118
|
-
value: _ctx.
|
|
120
|
+
value: _ctx.d_value,
|
|
119
121
|
"class": normalizeClass(_ctx.cx('icon'))
|
|
120
122
|
}, function () {
|
|
121
123
|
return [_ctx.onIcon || _ctx.offIcon ? (openBlock(), createElementBlock("span", mergeProps({
|
|
122
124
|
key: 0,
|
|
123
|
-
"class": [_ctx.cx('icon'), _ctx.
|
|
125
|
+
"class": [_ctx.cx('icon'), _ctx.d_value ? _ctx.onIcon : _ctx.offIcon]
|
|
124
126
|
}, $options.getPTOptions('icon')), null, 16)) : createCommentVNode("", true)];
|
|
125
127
|
}), createElementVNode("span", mergeProps({
|
|
126
128
|
"class": _ctx.cx('label')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/togglebutton/BaseToggleButton.vue","../../src/togglebutton/ToggleButton.vue","../../src/togglebutton/ToggleButton.vue?vue&type=template&id=d8d31a32&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport ToggleButtonStyle from 'primevue/togglebutton/style';\n\nexport default {\n name: 'BaseToggleButton',\n extends: BaseComponent,\n props: {\n modelValue: Boolean,\n onIcon: String,\n offIcon: String,\n onLabel: {\n type: String,\n default: 'Yes'\n },\n offLabel: {\n type: String,\n default: 'No'\n },\n iconPos: {\n type: String,\n default: 'left'\n },\n invalid: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n tabindex: {\n type: Number,\n default: null\n },\n ariaLabelledby: {\n type: String,\n default: null\n },\n ariaLabel: {\n type: String,\n default: null\n }\n },\n style: ToggleButtonStyle,\n provide() {\n return {\n $pcToggleButton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <button\n v-ripple\n type=\"button\"\n :class=\"cx('root')\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n :aria-pressed=\"modelValue\"\n @click=\"onChange\"\n v-bind=\"getPTOptions('root')\"\n :aria-labelledby=\"ariaLabelledby\"\n :data-p-checked=\"active\"\n :data-p-disabled=\"disabled\"\n >\n <span :class=\"cx('content')\" v-bind=\"getPTOptions('content')\">\n <slot>\n <slot name=\"icon\" :value=\"modelValue\" :class=\"cx('icon')\">\n <span v-if=\"onIcon || offIcon\" :class=\"[cx('icon'), modelValue ? onIcon : offIcon]\" v-bind=\"getPTOptions('icon')\" />\n </slot>\n <span :class=\"cx('label')\" v-bind=\"getPTOptions('label')\">{{ label }}</span>\n </slot>\n </span>\n </button>\n</template>\n\n<script>\nimport { isNotEmpty } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport BaseToggleButton from './BaseToggleButton.vue';\n\nexport default {\n name: 'ToggleButton',\n extends: BaseToggleButton,\n inheritAttrs: false,\n emits: ['update:modelValue', 'change'],\n methods: {\n getPTOptions(key) {\n const _ptm = key === 'root' ? this.ptmi : this.ptm;\n\n return _ptm(key, {\n context: {\n active: this.active,\n disabled: this.disabled\n }\n });\n },\n onChange(event) {\n if (!this.disabled && !this.readonly) {\n this.$emit('update:modelValue', !this.modelValue);\n this.$emit('change', event);\n }\n }\n },\n computed: {\n active() {\n return this.modelValue === true;\n },\n hasLabel() {\n return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);\n },\n label() {\n return this.hasLabel ? (this.modelValue ? this.onLabel : this.offLabel) : ' ';\n }\n },\n directives: {\n ripple: Ripple\n }\n};\n</script>\n","<template>\n <button\n v-ripple\n type=\"button\"\n :class=\"cx('root')\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n :aria-pressed=\"modelValue\"\n @click=\"onChange\"\n v-bind=\"getPTOptions('root')\"\n :aria-labelledby=\"ariaLabelledby\"\n :data-p-checked=\"active\"\n :data-p-disabled=\"disabled\"\n >\n <span :class=\"cx('content')\" v-bind=\"getPTOptions('content')\">\n <slot>\n <slot name=\"icon\" :value=\"modelValue\" :class=\"cx('icon')\">\n <span v-if=\"onIcon || offIcon\" :class=\"[cx('icon'), modelValue ? onIcon : offIcon]\" v-bind=\"getPTOptions('icon')\" />\n </slot>\n <span :class=\"cx('label')\" v-bind=\"getPTOptions('label')\">{{ label }}</span>\n </slot>\n </span>\n </button>\n</template>\n\n<script>\nimport { isNotEmpty } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport BaseToggleButton from './BaseToggleButton.vue';\n\nexport default {\n name: 'ToggleButton',\n extends: BaseToggleButton,\n inheritAttrs: false,\n emits: ['update:modelValue', 'change'],\n methods: {\n getPTOptions(key) {\n const _ptm = key === 'root' ? this.ptmi : this.ptm;\n\n return _ptm(key, {\n context: {\n active: this.active,\n disabled: this.disabled\n }\n });\n },\n onChange(event) {\n if (!this.disabled && !this.readonly) {\n this.$emit('update:modelValue', !this.modelValue);\n this.$emit('change', event);\n }\n }\n },\n computed: {\n active() {\n return this.modelValue === true;\n },\n hasLabel() {\n return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);\n },\n label() {\n return this.hasLabel ? (this.modelValue ? this.onLabel : this.offLabel) : ' ';\n }\n },\n directives: {\n ripple: Ripple\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","modelValue","Boolean","onIcon","String","offIcon","onLabel","type","offLabel","iconPos","invalid","disabled","readonly","tabindex","Number","ariaLabelledby","ariaLabel","style","ToggleButtonStyle","provide","$pcToggleButton","$parentInstance","BaseToggleButton","inheritAttrs","emits","methods","getPTOptions","key","_ptm","ptmi","ptm","context","active","onChange","event","$emit","computed","hasLabel","isNotEmpty","label","directives","ripple","Ripple","_withDirectives","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","onClick","$options","apply","arguments","_createElementVNode","_renderSlot","$slots","value"],"mappings":";;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,kBAAkB;AACxB,EAAA,SAAA,EAASC,aAAa;AACtBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,UAAU,EAAEC,OAAO;AACnBC,IAAAA,MAAM,EAAEC,MAAM;AACdC,IAAAA,OAAO,EAAED,MAAM;AACfE,IAAAA,OAAO,EAAE;AACLC,MAAAA,IAAI,EAAEH,MAAM;MACZ,SAAS,EAAA,KAAA;KACZ;AACDI,IAAAA,QAAQ,EAAE;AACND,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A2E,CAAA;AAApE,MAAA,OAAA,EAAOC,IAAE,CAAAC,EAAA,CAAA,OAAA,CAAA;AAAmB,KAAA,EAAAE,QAAA,CAAAxB,YAAY,4BAAcwB,QAAM,CAAAX,KAAA,CAAA,EAAA,EAAA,CAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/togglebutton/BaseToggleButton.vue","../../src/togglebutton/ToggleButton.vue","../../src/togglebutton/ToggleButton.vue?vue&type=template&id=42e829fe&lang.js"],"sourcesContent":["<script>\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport ToggleButtonStyle from 'primevue/togglebutton/style';\n\nexport default {\n name: 'BaseToggleButton',\n extends: BaseEditableHolder,\n props: {\n onIcon: String,\n offIcon: String,\n onLabel: {\n type: String,\n default: 'Yes'\n },\n offLabel: {\n type: String,\n default: 'No'\n },\n iconPos: {\n type: String,\n default: 'left'\n },\n readonly: {\n type: Boolean,\n default: false\n },\n tabindex: {\n type: Number,\n default: null\n },\n ariaLabelledby: {\n type: String,\n default: null\n },\n ariaLabel: {\n type: String,\n default: null\n },\n size: {\n type: String,\n default: null\n }\n },\n style: ToggleButtonStyle,\n provide() {\n return {\n $pcToggleButton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <button\n v-ripple\n type=\"button\"\n :class=\"cx('root')\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n :aria-pressed=\"d_value\"\n @click=\"onChange\"\n @blur=\"onBlur\"\n v-bind=\"getPTOptions('root')\"\n :aria-labelledby=\"ariaLabelledby\"\n :data-p-checked=\"active\"\n :data-p-disabled=\"disabled\"\n >\n <span :class=\"cx('content')\" v-bind=\"getPTOptions('content')\">\n <slot>\n <slot name=\"icon\" :value=\"d_value\" :class=\"cx('icon')\">\n <span v-if=\"onIcon || offIcon\" :class=\"[cx('icon'), d_value ? onIcon : offIcon]\" v-bind=\"getPTOptions('icon')\" />\n </slot>\n <span :class=\"cx('label')\" v-bind=\"getPTOptions('label')\">{{ label }}</span>\n </slot>\n </span>\n </button>\n</template>\n\n<script>\nimport { isNotEmpty } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport BaseToggleButton from './BaseToggleButton.vue';\n\nexport default {\n name: 'ToggleButton',\n extends: BaseToggleButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getPTOptions(key) {\n const _ptm = key === 'root' ? this.ptmi : this.ptm;\n\n return _ptm(key, {\n context: {\n active: this.active,\n disabled: this.disabled\n }\n });\n },\n onChange(event) {\n if (!this.disabled && !this.readonly) {\n this.writeValue(!this.d_value, event);\n this.$emit('change', event);\n }\n },\n onBlur(event) {\n this.formField.onBlur?.(event);\n }\n },\n computed: {\n active() {\n return this.d_value === true;\n },\n hasLabel() {\n return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);\n },\n label() {\n return this.hasLabel ? (this.d_value ? this.onLabel : this.offLabel) : ' ';\n }\n },\n directives: {\n ripple: Ripple\n }\n};\n</script>\n","<template>\n <button\n v-ripple\n type=\"button\"\n :class=\"cx('root')\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n :aria-pressed=\"d_value\"\n @click=\"onChange\"\n @blur=\"onBlur\"\n v-bind=\"getPTOptions('root')\"\n :aria-labelledby=\"ariaLabelledby\"\n :data-p-checked=\"active\"\n :data-p-disabled=\"disabled\"\n >\n <span :class=\"cx('content')\" v-bind=\"getPTOptions('content')\">\n <slot>\n <slot name=\"icon\" :value=\"d_value\" :class=\"cx('icon')\">\n <span v-if=\"onIcon || offIcon\" :class=\"[cx('icon'), d_value ? onIcon : offIcon]\" v-bind=\"getPTOptions('icon')\" />\n </slot>\n <span :class=\"cx('label')\" v-bind=\"getPTOptions('label')\">{{ label }}</span>\n </slot>\n </span>\n </button>\n</template>\n\n<script>\nimport { isNotEmpty } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport BaseToggleButton from './BaseToggleButton.vue';\n\nexport default {\n name: 'ToggleButton',\n extends: BaseToggleButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getPTOptions(key) {\n const _ptm = key === 'root' ? this.ptmi : this.ptm;\n\n return _ptm(key, {\n context: {\n active: this.active,\n disabled: this.disabled\n }\n });\n },\n onChange(event) {\n if (!this.disabled && !this.readonly) {\n this.writeValue(!this.d_value, event);\n this.$emit('change', event);\n }\n },\n onBlur(event) {\n this.formField.onBlur?.(event);\n }\n },\n computed: {\n active() {\n return this.d_value === true;\n },\n hasLabel() {\n return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);\n },\n label() {\n return this.hasLabel ? (this.d_value ? this.onLabel : this.offLabel) : ' ';\n }\n },\n directives: {\n ripple: Ripple\n }\n};\n</script>\n"],"names":["name","BaseEditableHolder","props","onIcon","String","offIcon","onLabel","type","offLabel","iconPos","readonly","Boolean","tabindex","Number","ariaLabelledby","ariaLabel","size","style","ToggleButtonStyle","provide","$pcToggleButton","$parentInstance","BaseToggleButton","inheritAttrs","emits","methods","getPTOptions","key","_ptm","ptmi","ptm","context","active","disabled","onChange","event","writeValue","d_value","$emit","onBlur","_this$formField$onBlu","_this$formField","formField","call","computed","hasLabel","isNotEmpty","label","directives","ripple","Ripple","_withDirectives","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","onClick","$options","apply","arguments","_createElementVNode","_renderSlot","$slots","value"],"mappings":";;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,kBAAkB;AACxB,EAAA,SAAA,EAASC,kBAAkB;AAC3BC,EAAAA,KAAK,EAAE;AACHC,IAAAA,MAAM,EAAEC,MAAM;AACdC,IAAAA,OAAO,EAAED,MAAM;AACfE,IAAAA,OAAO,EAAE;AACLC,MAAAA,IAAI,EAAEH,MAAM;MACZ,SAAS,EAAA;KACZ;AACDI,IAAAA,QAAQ,EAAE;AACND,MAAAA,IAAI,EAAEH,MAAM;MACZ,SAAS,EAAA;KACZ;AACDK,IAAAA,OAAO,EAAE;AACLF,MAAAA,IAAI,EAAEH,MAAM;M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AAA;AAApE,MAAA,OAAA,EAAOC,IAAE,CAAAC,EAAA,CAAA,OAAA;AAAmB,KAAA,EAAAE,QAAA,CAAAhC,YAAY,4BAAcgC,QAAM,CAAAX,KAAA,CAAA,EAAA,EAAA,CAAA;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import BaseStyle from '@primevue/core/base/style';
|
|
|
2
2
|
|
|
3
3
|
var theme = function theme(_ref) {
|
|
4
4
|
var dt = _ref.dt;
|
|
5
|
-
return "\n.p-togglebutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n color: ".concat(dt('togglebutton.color'), ";\n background: ").concat(dt('togglebutton.background'), ";\n border: 1px solid ").concat(dt('togglebutton.border.color'), ";\n padding: ").concat(dt('togglebutton.padding'), ";\n font-size: 1rem;\n font-family: inherit;\n font-feature-settings: inherit;\n transition: background ").concat(dt('togglebutton.transition.duration'), ", color ").concat(dt('togglebutton.transition.duration'), ", border-color ").concat(dt('togglebutton.transition.duration'), ",\n outline-color ").concat(dt('togglebutton.transition.duration'), ", box-shadow ").concat(dt('togglebutton.transition.duration'), ";\n border-radius: ").concat(dt('togglebutton.border.radius'), ";\n outline-color: transparent;\n font-weight: ").concat(dt('togglebutton.font.weight'), ";\n}\n\n.p-togglebutton-content {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ").concat(dt('togglebutton.gap'), ";\n}\n\n.p-togglebutton-label,\n.p-togglebutton-icon {\n position: relative;\n transition: none;\n}\n\n.p-togglebutton::before {\n content: \"\";\n background: transparent;\n transition: background ").concat(dt('togglebutton.transition.duration'), ", color ").concat(dt('togglebutton.transition.duration'), ", border-color ").concat(dt('togglebutton.transition.duration'), ",\n outline-color ").concat(dt('togglebutton.transition.duration'), ", box-shadow ").concat(dt('togglebutton.transition.duration'), ";\n position: absolute;\n
|
|
5
|
+
return "\n.p-togglebutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n color: ".concat(dt('togglebutton.color'), ";\n background: ").concat(dt('togglebutton.background'), ";\n border: 1px solid ").concat(dt('togglebutton.border.color'), ";\n padding: ").concat(dt('togglebutton.padding'), ";\n font-size: 1rem;\n font-family: inherit;\n font-feature-settings: inherit;\n transition: background ").concat(dt('togglebutton.transition.duration'), ", color ").concat(dt('togglebutton.transition.duration'), ", border-color ").concat(dt('togglebutton.transition.duration'), ",\n outline-color ").concat(dt('togglebutton.transition.duration'), ", box-shadow ").concat(dt('togglebutton.transition.duration'), ";\n border-radius: ").concat(dt('togglebutton.border.radius'), ";\n outline-color: transparent;\n font-weight: ").concat(dt('togglebutton.font.weight'), ";\n}\n\n.p-togglebutton-content {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ").concat(dt('togglebutton.gap'), ";\n}\n\n.p-togglebutton-label,\n.p-togglebutton-icon {\n position: relative;\n transition: none;\n}\n\n.p-togglebutton::before {\n content: \"\";\n background: transparent;\n transition: background ").concat(dt('togglebutton.transition.duration'), ", color ").concat(dt('togglebutton.transition.duration'), ", border-color ").concat(dt('togglebutton.transition.duration'), ",\n outline-color ").concat(dt('togglebutton.transition.duration'), ", box-shadow ").concat(dt('togglebutton.transition.duration'), ";\n position: absolute;\n inset-inline-start: ").concat(dt('togglebutton.content.left'), ";\n inset-block-start: ").concat(dt('togglebutton.content.top'), ";\n width: calc(100% - calc(2 * ").concat(dt('togglebutton.content.left'), "));\n height: calc(100% - calc(2 * ").concat(dt('togglebutton.content.top'), "));\n border-radius: ").concat(dt('togglebutton.border.radius'), ";\n}\n\n.p-togglebutton.p-togglebutton-checked::before {\n background: ").concat(dt('togglebutton.content.checked.background'), ";\n box-shadow: ").concat(dt('togglebutton.content.checked.shadow'), ";\n}\n\n.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover {\n background: ").concat(dt('togglebutton.hover.background'), ";\n color: ").concat(dt('togglebutton.hover.color'), ";\n}\n\n.p-togglebutton.p-togglebutton-checked {\n background: ").concat(dt('togglebutton.checked.background'), ";\n border-color: ").concat(dt('togglebutton.checked.border.color'), ";\n color: ").concat(dt('togglebutton.checked.color'), ";\n}\n\n.p-togglebutton:focus-visible {\n box-shadow: ").concat(dt('togglebutton.focus.ring.shadow'), ";\n outline: ").concat(dt('togglebutton.focus.ring.width'), " ").concat(dt('togglebutton.focus.ring.style'), " ").concat(dt('togglebutton.focus.ring.color'), ";\n outline-offset: ").concat(dt('togglebutton.focus.ring.offset'), ";\n}\n\n.p-togglebutton.p-invalid {\n border-color: ").concat(dt('togglebutton.invalid.border.color'), ";\n}\n\n.p-togglebutton:disabled {\n opacity: 1;\n cursor: default;\n background: ").concat(dt('togglebutton.disabled.background'), ";\n border-color: ").concat(dt('togglebutton.disabled.border.color'), ";\n color: ").concat(dt('togglebutton.disabled.color'), ";\n}\n\n.p-togglebutton-icon {\n color: ").concat(dt('togglebutton.icon.color'), ";\n}\n\n.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover .p-togglebutton-icon {\n color: ").concat(dt('togglebutton.icon.hover.color'), ";\n}\n\n.p-togglebutton.p-togglebutton-checked .p-togglebutton-icon {\n color: ").concat(dt('togglebutton.icon.checked.color'), ";\n}\n\n.p-togglebutton:disabled .p-togglebutton-icon {\n color: ").concat(dt('togglebutton.icon.disabled.color'), ";\n}\n\n.p-togglebutton-sm {\n padding: ").concat(dt('togglebutton.sm.padding'), ";\n font-size: ").concat(dt('togglebutton.sm.font.size'), ";\n}\n\n.p-togglebutton-lg {\n padding: ").concat(dt('togglebutton.lg.padding'), ";\n font-size: ").concat(dt('togglebutton.lg.font.size'), ";\n}\n");
|
|
6
6
|
};
|
|
7
7
|
var classes = {
|
|
8
8
|
root: function root(_ref2) {
|
|
@@ -10,7 +10,9 @@ var classes = {
|
|
|
10
10
|
props = _ref2.props;
|
|
11
11
|
return ['p-togglebutton p-component', {
|
|
12
12
|
'p-togglebutton-checked': instance.active,
|
|
13
|
-
'p-invalid':
|
|
13
|
+
'p-invalid': instance.$invalid,
|
|
14
|
+
'p-togglebutton-sm p-inputfield-sm': props.size === 'small',
|
|
15
|
+
'p-togglebutton-lg p-inputfield-lg': props.size === 'large'
|
|
14
16
|
}];
|
|
15
17
|
},
|
|
16
18
|
content: 'p-togglebutton-content',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/togglebutton/style/ToggleButtonStyle.js"],"sourcesContent":["import BaseStyle from '@primevue/core/base/style';\n\nconst theme = ({ dt }) => `\n.p-togglebutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n color: ${dt('togglebutton.color')};\n background: ${dt('togglebutton.background')};\n border: 1px solid ${dt('togglebutton.border.color')};\n padding: ${dt('togglebutton.padding')};\n font-size: 1rem;\n font-family: inherit;\n font-feature-settings: inherit;\n transition: background ${dt('togglebutton.transition.duration')}, color ${dt('togglebutton.transition.duration')}, border-color ${dt('togglebutton.transition.duration')},\n outline-color ${dt('togglebutton.transition.duration')}, box-shadow ${dt('togglebutton.transition.duration')};\n border-radius: ${dt('togglebutton.border.radius')};\n outline-color: transparent;\n font-weight: ${dt('togglebutton.font.weight')};\n}\n\n.p-togglebutton-content {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${dt('togglebutton.gap')};\n}\n\n.p-togglebutton-label,\n.p-togglebutton-icon {\n position: relative;\n transition: none;\n}\n\n.p-togglebutton::before {\n content: \"\";\n background: transparent;\n transition: background ${dt('togglebutton.transition.duration')}, color ${dt('togglebutton.transition.duration')}, border-color ${dt('togglebutton.transition.duration')},\n outline-color ${dt('togglebutton.transition.duration')}, box-shadow ${dt('togglebutton.transition.duration')};\n position: absolute;\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/togglebutton/style/ToggleButtonStyle.js"],"sourcesContent":["import BaseStyle from '@primevue/core/base/style';\n\nconst theme = ({ dt }) => `\n.p-togglebutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n color: ${dt('togglebutton.color')};\n background: ${dt('togglebutton.background')};\n border: 1px solid ${dt('togglebutton.border.color')};\n padding: ${dt('togglebutton.padding')};\n font-size: 1rem;\n font-family: inherit;\n font-feature-settings: inherit;\n transition: background ${dt('togglebutton.transition.duration')}, color ${dt('togglebutton.transition.duration')}, border-color ${dt('togglebutton.transition.duration')},\n outline-color ${dt('togglebutton.transition.duration')}, box-shadow ${dt('togglebutton.transition.duration')};\n border-radius: ${dt('togglebutton.border.radius')};\n outline-color: transparent;\n font-weight: ${dt('togglebutton.font.weight')};\n}\n\n.p-togglebutton-content {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${dt('togglebutton.gap')};\n}\n\n.p-togglebutton-label,\n.p-togglebutton-icon {\n position: relative;\n transition: none;\n}\n\n.p-togglebutton::before {\n content: \"\";\n background: transparent;\n transition: background ${dt('togglebutton.transition.duration')}, color ${dt('togglebutton.transition.duration')}, border-color ${dt('togglebutton.transition.duration')},\n outline-color ${dt('togglebutton.transition.duration')}, box-shadow ${dt('togglebutton.transition.duration')};\n position: absolute;\n inset-inline-start: ${dt('togglebutton.content.left')};\n inset-block-start: ${dt('togglebutton.content.top')};\n width: calc(100% - calc(2 * ${dt('togglebutton.content.left')}));\n height: calc(100% - calc(2 * ${dt('togglebutton.content.top')}));\n border-radius: ${dt('togglebutton.border.radius')};\n}\n\n.p-togglebutton.p-togglebutton-checked::before {\n background: ${dt('togglebutton.content.checked.background')};\n box-shadow: ${dt('togglebutton.content.checked.shadow')};\n}\n\n.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover {\n background: ${dt('togglebutton.hover.background')};\n color: ${dt('togglebutton.hover.color')};\n}\n\n.p-togglebutton.p-togglebutton-checked {\n background: ${dt('togglebutton.checked.background')};\n border-color: ${dt('togglebutton.checked.border.color')};\n color: ${dt('togglebutton.checked.color')};\n}\n\n.p-togglebutton:focus-visible {\n box-shadow: ${dt('togglebutton.focus.ring.shadow')};\n outline: ${dt('togglebutton.focus.ring.width')} ${dt('togglebutton.focus.ring.style')} ${dt('togglebutton.focus.ring.color')};\n outline-offset: ${dt('togglebutton.focus.ring.offset')};\n}\n\n.p-togglebutton.p-invalid {\n border-color: ${dt('togglebutton.invalid.border.color')};\n}\n\n.p-togglebutton:disabled {\n opacity: 1;\n cursor: default;\n background: ${dt('togglebutton.disabled.background')};\n border-color: ${dt('togglebutton.disabled.border.color')};\n color: ${dt('togglebutton.disabled.color')};\n}\n\n.p-togglebutton-icon {\n color: ${dt('togglebutton.icon.color')};\n}\n\n.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover .p-togglebutton-icon {\n color: ${dt('togglebutton.icon.hover.color')};\n}\n\n.p-togglebutton.p-togglebutton-checked .p-togglebutton-icon {\n color: ${dt('togglebutton.icon.checked.color')};\n}\n\n.p-togglebutton:disabled .p-togglebutton-icon {\n color: ${dt('togglebutton.icon.disabled.color')};\n}\n\n.p-togglebutton-sm {\n padding: ${dt('togglebutton.sm.padding')};\n font-size: ${dt('togglebutton.sm.font.size')};\n}\n\n.p-togglebutton-lg {\n padding: ${dt('togglebutton.lg.padding')};\n font-size: ${dt('togglebutton.lg.font.size')};\n}\n`;\n\nconst classes = {\n root: ({ instance, props }) => [\n 'p-togglebutton p-component',\n {\n 'p-togglebutton-checked': instance.active,\n 'p-invalid': instance.$invalid,\n 'p-togglebutton-sm p-inputfield-sm': props.size === 'small',\n 'p-togglebutton-lg p-inputfield-lg': props.size === 'large'\n }\n ],\n content: 'p-togglebutton-content',\n icon: 'p-togglebutton-icon',\n label: 'p-togglebutton-label'\n};\n\nexport default BaseStyle.extend({\n name: 'togglebutton',\n theme,\n classes\n});\n"],"names":["theme","_ref","dt","concat","classes","root","_ref2","instance","props","active","$invalid","size","content","icon","label","BaseStyle","extend","name"],"mappings":";;AAEA,IAAMA,KAAK,G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;AACpBjB,EAAAA,KAAK,EAALA,KAAK;AACLI,EAAAA,OAAO,EAAPA;AACJ,CAAC,CAAC;;;;"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
2
|
+
import BaseEditableHolder from '@primevue/core/baseeditableholder';
|
|
3
3
|
import ToggleSwitchStyle from 'primevue/toggleswitch/style';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
name: 'BaseToggleSwitch',
|
|
7
|
-
extends:
|
|
7
|
+
extends: BaseEditableHolder,
|
|
8
8
|
props: {
|
|
9
|
-
modelValue: {
|
|
10
|
-
type: null,
|
|
11
|
-
default: false
|
|
12
|
-
},
|
|
13
9
|
trueValue: {
|
|
14
10
|
type: null,
|
|
15
11
|
default: true
|
|
@@ -18,14 +14,6 @@ export default {
|
|
|
18
14
|
type: null,
|
|
19
15
|
default: false
|
|
20
16
|
},
|
|
21
|
-
invalid: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: false
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: false
|
|
28
|
-
},
|
|
29
17
|
readonly: {
|
|
30
18
|
type: Boolean,
|
|
31
19
|
default: false
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
name: 'ToggleSwitch',
|
|
35
35
|
extends: BaseToggleSwitch,
|
|
36
36
|
inheritAttrs: false,
|
|
37
|
-
emits: ['
|
|
37
|
+
emits: ['change', 'focus', 'blur'],
|
|
38
38
|
methods: {
|
|
39
39
|
getPTOptions(key) {
|
|
40
40
|
const _ptm = key === 'root' ? this.ptmi : this.ptm;
|
|
@@ -50,7 +50,7 @@ export default {
|
|
|
50
50
|
if (!this.disabled && !this.readonly) {
|
|
51
51
|
const newValue = this.checked ? this.falseValue : this.trueValue;
|
|
52
52
|
|
|
53
|
-
this
|
|
53
|
+
this.writeValue(newValue, event);
|
|
54
54
|
this.$emit('change', event);
|
|
55
55
|
}
|
|
56
56
|
},
|
|
@@ -59,11 +59,12 @@ export default {
|
|
|
59
59
|
},
|
|
60
60
|
onBlur(event) {
|
|
61
61
|
this.$emit('blur', event);
|
|
62
|
+
this.formField.onBlur?.(event);
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
computed: {
|
|
65
66
|
checked() {
|
|
66
|
-
return this.
|
|
67
|
+
return this.d_value === this.trueValue;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
};
|
package/toggleswitch/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module toggleswitch
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
import type { DefineComponent, DesignToken, EmitFn,
|
|
10
|
+
import type { DefineComponent, DesignToken, EmitFn, PassThrough } from '@primevue/core';
|
|
11
11
|
import type { ComponentHooks } from '@primevue/core/basecomponent';
|
|
12
12
|
import type { PassThroughOptions } from 'primevue/passthrough';
|
|
13
13
|
import { VNode } from 'vue';
|
|
@@ -88,6 +88,14 @@ export interface ToggleSwitchProps {
|
|
|
88
88
|
* @defaultValue false
|
|
89
89
|
*/
|
|
90
90
|
modelValue?: boolean | string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* The default value for the input when not controlled by `modelValue`.
|
|
93
|
+
*/
|
|
94
|
+
defaultValue?: boolean | string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* The name attribute for the element, typically used in form submissions.
|
|
97
|
+
*/
|
|
98
|
+
name?: string | undefined;
|
|
91
99
|
/**
|
|
92
100
|
* Value in checked state.
|
|
93
101
|
* @defaultValue true
|
|
@@ -137,6 +145,10 @@ export interface ToggleSwitchProps {
|
|
|
137
145
|
* Establishes a string value that labels the component.
|
|
138
146
|
*/
|
|
139
147
|
ariaLabel?: string | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* Form control object, typically used for handling validation and form state.
|
|
150
|
+
*/
|
|
151
|
+
formControl?: Record<string, any> | undefined;
|
|
140
152
|
/**
|
|
141
153
|
* It generates scoped CSS variables using design tokens for the component.
|
|
142
154
|
*/
|
|
@@ -196,6 +208,11 @@ export interface ToggleSwitchEmitsOptions {
|
|
|
196
208
|
* @param {boolean} value - New value.
|
|
197
209
|
*/
|
|
198
210
|
'update:modelValue'(value: boolean): void;
|
|
211
|
+
/**
|
|
212
|
+
* Emitted when the value changes in uncontrolled mode.
|
|
213
|
+
* @param {boolean} value - New value.
|
|
214
|
+
*/
|
|
215
|
+
'value-change'(value: boolean): void;
|
|
199
216
|
/**
|
|
200
217
|
* Callback to invoke on value change.
|
|
201
218
|
* @param {Event} event - Browser event.
|
|
@@ -231,7 +248,7 @@ declare const ToggleSwitch: DefineComponent<ToggleSwitchProps, ToggleSwitchSlots
|
|
|
231
248
|
|
|
232
249
|
declare module 'vue' {
|
|
233
250
|
export interface GlobalComponents {
|
|
234
|
-
ToggleSwitch:
|
|
251
|
+
ToggleSwitch: DefineComponent<ToggleSwitchProps, ToggleSwitchSlots, ToggleSwitchEmits>;
|
|
235
252
|
}
|
|
236
253
|
}
|
|
237
254
|
|
package/toggleswitch/index.mjs
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BaseEditableHolder from '@primevue/core/baseeditableholder';
|
|
2
2
|
import ToggleSwitchStyle from 'primevue/toggleswitch/style';
|
|
3
3
|
import { openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot } from 'vue';
|
|
4
4
|
|
|
5
5
|
var script$1 = {
|
|
6
6
|
name: 'BaseToggleSwitch',
|
|
7
|
-
"extends":
|
|
7
|
+
"extends": BaseEditableHolder,
|
|
8
8
|
props: {
|
|
9
|
-
modelValue: {
|
|
10
|
-
type: null,
|
|
11
|
-
"default": false
|
|
12
|
-
},
|
|
13
9
|
trueValue: {
|
|
14
10
|
type: null,
|
|
15
11
|
"default": true
|
|
@@ -18,14 +14,6 @@ var script$1 = {
|
|
|
18
14
|
type: null,
|
|
19
15
|
"default": false
|
|
20
16
|
},
|
|
21
|
-
invalid: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
"default": false
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
"default": false
|
|
28
|
-
},
|
|
29
17
|
readonly: {
|
|
30
18
|
type: Boolean,
|
|
31
19
|
"default": false
|
|
@@ -68,7 +56,7 @@ var script = {
|
|
|
68
56
|
name: 'ToggleSwitch',
|
|
69
57
|
"extends": script$1,
|
|
70
58
|
inheritAttrs: false,
|
|
71
|
-
emits: ['
|
|
59
|
+
emits: ['change', 'focus', 'blur'],
|
|
72
60
|
methods: {
|
|
73
61
|
getPTOptions: function getPTOptions(key) {
|
|
74
62
|
var _ptm = key === 'root' ? this.ptmi : this.ptm;
|
|
@@ -82,7 +70,7 @@ var script = {
|
|
|
82
70
|
onChange: function onChange(event) {
|
|
83
71
|
if (!this.disabled && !this.readonly) {
|
|
84
72
|
var newValue = this.checked ? this.falseValue : this.trueValue;
|
|
85
|
-
this
|
|
73
|
+
this.writeValue(newValue, event);
|
|
86
74
|
this.$emit('change', event);
|
|
87
75
|
}
|
|
88
76
|
},
|
|
@@ -90,12 +78,14 @@ var script = {
|
|
|
90
78
|
this.$emit('focus', event);
|
|
91
79
|
},
|
|
92
80
|
onBlur: function onBlur(event) {
|
|
81
|
+
var _this$formField$onBlu, _this$formField;
|
|
93
82
|
this.$emit('blur', event);
|
|
83
|
+
(_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event);
|
|
94
84
|
}
|
|
95
85
|
},
|
|
96
86
|
computed: {
|
|
97
87
|
checked: function checked() {
|
|
98
|
-
return this.
|
|
88
|
+
return this.d_value === this.trueValue;
|
|
99
89
|
}
|
|
100
90
|
}
|
|
101
91
|
};
|