primevue 3.7.2 → 3.9.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 -2
- package/accordion/Accordion.vue +1 -1
- package/accordion/accordion.cjs.js +1 -1
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +1 -1
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +1 -1
- package/accordion/accordion.min.js +1 -1
- package/api/Api.d.ts +73 -32
- package/api/api.cjs.js +66 -32
- package/api/api.cjs.min.js +1 -1
- package/api/api.esm.js +66 -32
- package/api/api.esm.min.js +1 -1
- package/api/api.js +66 -32
- package/api/api.min.js +1 -1
- package/autocomplete/AutoComplete.d.ts +43 -9
- package/autocomplete/AutoComplete.vue +16 -9
- package/autocomplete/autocomplete.cjs.js +19 -11
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +19 -11
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +19 -11
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/BlockUI.vue +1 -1
- package/blockui/blockui.cjs.js +5 -7
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +6 -8
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +5 -7
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/Breadcrumb.d.ts +7 -0
- package/breadcrumb/Breadcrumb.vue +4 -0
- package/breadcrumb/BreadcrumbItem.vue +5 -2
- package/breadcrumb/breadcrumb.cjs.js +6 -3
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +6 -3
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +6 -3
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/calendar/Calendar.d.ts +11 -1
- package/calendar/Calendar.vue +362 -67
- package/calendar/calendar.cjs.js +459 -168
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +461 -170
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +459 -168
- package/calendar/calendar.min.js +1 -1
- package/carousel/Carousel.d.ts +6 -1
- package/carousel/Carousel.vue +2 -2
- package/carousel/carousel.cjs.js +6 -6
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +6 -6
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +6 -6
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +19 -6
- package/chart/Chart.vue +9 -2
- package/chart/chart.cjs.js +9 -2
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +9 -2
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +9 -2
- package/chart/chart.min.js +1 -1
- package/chips/Chips.d.ts +5 -1
- package/colorpicker/ColorPicker.d.ts +3 -0
- package/colorpicker/ColorPicker.vue +6 -1
- package/colorpicker/colorpicker.cjs.js +6 -1
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +6 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +6 -1
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/Column.d.ts +42 -11
- package/confirmationservice/ConfirmationService.d.ts +3 -2
- package/confirmdialog/ConfirmDialog.vue +8 -2
- package/confirmdialog/confirmdialog.cjs.js +11 -4
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +11 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +11 -4
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +7 -0
- package/confirmpopup/ConfirmPopup.vue +7 -4
- package/confirmpopup/confirmpopup.cjs.js +13 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +14 -6
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +13 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +5 -1
- package/contextmenu/ContextMenuSub.vue +8 -5
- package/contextmenu/contextmenu.cjs.js +8 -5
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +8 -5
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +8 -5
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +7644 -0
- package/core/core.min.js +47 -0
- package/datatable/BodyCell.vue +37 -17
- package/datatable/ColumnFilter.vue +17 -6
- package/datatable/DataTable.d.ts +37 -9
- package/datatable/DataTable.vue +90 -48
- package/datatable/FooterCell.vue +2 -2
- package/datatable/HeaderCell.vue +2 -2
- package/datatable/TableBody.vue +15 -6
- package/datatable/TableFooter.vue +17 -2
- package/datatable/TableHeader.vue +17 -2
- package/datatable/datatable.cjs.js +321 -197
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +321 -197
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +321 -197
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +9 -4
- package/dataview/DataView.vue +8 -8
- package/dataview/dataview.cjs.js +12 -12
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +12 -12
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +12 -12
- package/dataview/dataview.min.js +1 -1
- package/dialog/Dialog.vue +6 -1
- package/dialog/dialog.cjs.js +4 -2
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +4 -2
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +4 -2
- package/dialog/dialog.min.js +1 -1
- package/dock/Dock.d.ts +10 -1
- package/dock/Dock.vue +1 -1
- package/dock/DockSub.vue +13 -8
- package/dock/dock.cjs.js +24 -10
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +20 -10
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +25 -12
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.d.ts +56 -13
- package/dropdown/Dropdown.vue +1 -0
- package/dropdown/dropdown.cjs.js +1 -0
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +1 -0
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +1 -0
- package/dropdown/dropdown.min.js +1 -1
- package/fileupload/FileUpload.d.ts +5 -0
- package/galleria/Galleria.d.ts +20 -4
- package/inplace/Inplace.d.ts +1 -0
- package/inplace/Inplace.vue +12 -1
- package/inplace/inplace.cjs.js +13 -2
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +13 -2
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +13 -2
- package/inplace/inplace.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +1 -1
- package/inputnumber/InputNumber.vue +19 -3
- package/inputnumber/inputnumber.cjs.js +19 -3
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +19 -3
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +19 -3
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.vue +6 -3
- package/inputswitch/inputswitch.cjs.js +6 -3
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +6 -3
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +6 -3
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.d.ts +1 -1
- package/inputtext/InputText.vue +1 -1
- package/inputtext/inputtext.cjs.js +2 -2
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +3 -3
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +2 -2
- package/inputtext/inputtext.min.js +1 -1
- package/listbox/Listbox.d.ts +48 -12
- package/megamenu/MegaMenu.d.ts +5 -1
- package/megamenu/MegaMenu.vue +11 -8
- package/megamenu/megamenu.cjs.js +11 -8
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +11 -8
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +11 -8
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +5 -1
- package/menu/Menu.vue +6 -3
- package/menu/Menuitem.vue +5 -2
- package/menu/menu.cjs.js +11 -5
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +11 -5
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +11 -5
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +5 -1
- package/menubar/MenubarSub.vue +8 -5
- package/menubar/menubar.cjs.js +8 -5
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +8 -5
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +8 -5
- package/menubar/menubar.min.js +1 -1
- package/message/Message.d.ts +1 -0
- package/message/Message.vue +6 -2
- package/message/message.cjs.js +6 -2
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +6 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +6 -2
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +61 -14
- package/orderlist/OrderList.d.ts +8 -1
- package/orderlist/OrderList.vue +2 -0
- package/orderlist/orderlist.cjs.js +3 -1
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +3 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +3 -1
- package/orderlist/orderlist.min.js +1 -1
- package/overlaypanel/OverlayPanel.vue +1 -0
- package/overlaypanel/overlaypanel.cjs.js +1 -0
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +1 -0
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +1 -0
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +5 -1
- package/paginator/CurrentPageReport.vue +5 -1
- package/paginator/JumpToPageInput.vue +1 -1
- package/paginator/Paginator.d.ts +10 -4
- package/paginator/Paginator.vue +10 -7
- package/paginator/paginator.cjs.js +16 -8
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +16 -8
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +16 -8
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +1 -0
- package/panel/Panel.vue +1 -1
- package/panelmenu/PanelMenu.d.ts +5 -3
- package/panelmenu/PanelMenu.vue +6 -3
- package/panelmenu/PanelMenuSub.vue +8 -5
- package/panelmenu/panelmenu.cjs.js +14 -8
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +14 -8
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +14 -8
- package/panelmenu/panelmenu.min.js +1 -1
- package/picklist/PickList.d.ts +14 -3
- package/picklist/PickList.vue +10 -4
- package/picklist/picklist.cjs.js +13 -7
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +13 -7
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +13 -7
- package/picklist/picklist.min.js +1 -1
- package/progressbar/ProgressBar.vue +13 -12
- package/progressbar/progressbar.cjs.js +13 -12
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +14 -13
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +13 -12
- package/progressbar/progressbar.min.js +1 -1
- package/rating/Rating.vue +1 -1
- package/rating/rating.cjs.js +1 -1
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +1 -1
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +1 -1
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +5 -0
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +57 -16
- package/resources/themes/arya-green/theme.css +57 -16
- package/resources/themes/arya-orange/theme.css +57 -16
- package/resources/themes/arya-purple/theme.css +57 -16
- package/resources/themes/bootstrap4-dark-blue/theme.css +54 -20
- package/resources/themes/bootstrap4-dark-purple/theme.css +54 -20
- package/resources/themes/bootstrap4-light-blue/theme.css +54 -20
- package/resources/themes/bootstrap4-light-purple/theme.css +54 -20
- package/resources/themes/fluent-light/theme.css +57 -16
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +5414 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +5414 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/theme.css +5414 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +5414 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +5414 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +5414 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/theme.css +5414 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +5414 -0
- package/resources/themes/luna-amber/theme.css +54 -20
- package/resources/themes/luna-blue/theme.css +54 -20
- package/resources/themes/luna-green/theme.css +54 -20
- package/resources/themes/luna-pink/theme.css +54 -20
- package/resources/themes/md-dark-deeppurple/theme.css +245 -48
- package/resources/themes/md-dark-indigo/theme.css +245 -48
- package/resources/themes/md-light-deeppurple/theme.css +245 -48
- package/resources/themes/md-light-indigo/theme.css +245 -48
- package/resources/themes/mdc-dark-deeppurple/theme.css +245 -48
- package/resources/themes/mdc-dark-indigo/theme.css +245 -48
- package/resources/themes/mdc-light-deeppurple/theme.css +245 -48
- package/resources/themes/mdc-light-indigo/theme.css +245 -48
- package/resources/themes/nova/theme.css +54 -20
- package/resources/themes/nova-accent/theme.css +54 -20
- package/resources/themes/nova-alt/theme.css +54 -20
- package/resources/themes/nova-vue/theme.css +54 -20
- package/resources/themes/rhea/theme.css +54 -20
- package/resources/themes/saga-blue/theme.css +57 -16
- package/resources/themes/saga-green/theme.css +57 -16
- package/resources/themes/saga-orange/theme.css +57 -16
- package/resources/themes/saga-purple/theme.css +57 -16
- package/resources/themes/tailwind-light/theme.css +68 -19
- package/resources/themes/vela-blue/theme.css +57 -16
- package/resources/themes/vela-green/theme.css +57 -16
- package/resources/themes/vela-orange/theme.css +57 -16
- package/resources/themes/vela-purple/theme.css +57 -16
- package/selectbutton/SelectButton.d.ts +13 -5
- package/selectbutton/SelectButton.vue +8 -2
- package/selectbutton/selectbutton.cjs.js +14 -9
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +14 -9
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +14 -9
- package/selectbutton/selectbutton.min.js +1 -1
- package/speeddial/SpeedDial.d.ts +5 -1
- package/speeddial/SpeedDial.vue +2 -1
- package/speeddial/speeddial.cjs.js +2 -1
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +2 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +2 -1
- package/speeddial/speeddial.min.js +1 -1
- package/splitter/Splitter.vue +5 -3
- package/splitter/splitter.cjs.js +4 -2
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +5 -3
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +4 -2
- package/splitter/splitter.min.js +1 -1
- package/steps/Steps.d.ts +5 -3
- package/steps/Steps.vue +5 -2
- package/steps/steps.cjs.js +5 -2
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +5 -2
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +5 -2
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.d.ts +5 -3
- package/tabmenu/TabMenu.vue +10 -3
- package/tabmenu/tabmenu.cjs.js +7 -4
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +7 -4
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +7 -4
- package/tabmenu/tabmenu.min.js +1 -1
- package/terminal/terminal.js +1 -1
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/TerminalService.d.ts +9 -6
- package/tieredmenu/TieredMenu.d.ts +5 -3
- package/tieredmenu/TieredMenuSub.vue +8 -5
- package/tieredmenu/tieredmenu.cjs.js +8 -5
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +8 -5
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +8 -5
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/Timeline.d.ts +8 -3
- package/toast/Toast.d.ts +7 -0
- package/toastservice/ToastService.d.ts +3 -2
- package/tooltip/tooltip.cjs.js +5 -1
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +5 -1
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +5 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.d.ts +5 -1
- package/tree/TreeNode.vue +4 -1
- package/tree/tree.cjs.js +4 -1
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +4 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +4 -1
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +20 -3
- package/treeselect/TreeSelect.vue +9 -0
- package/treeselect/treeselect.cjs.js +9 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +9 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +9 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/BodyCell.vue +2 -3
- package/treetable/FooterCell.vue +2 -2
- package/treetable/HeaderCell.vue +2 -2
- package/treetable/TreeTable.d.ts +2 -2
- package/treetable/TreeTable.vue +10 -10
- package/treetable/TreeTableRow.vue +2 -2
- package/treetable/treetable.cjs.js +18 -18
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +19 -19
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +18 -18
- package/treetable/treetable.min.js +1 -1
- package/utils/Utils.d.ts +80 -0
- package/utils/package.json +3 -2
- package/utils/utils.cjs.js +126 -108
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +126 -108
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +126 -108
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +24 -0
- package/vetur-tags.json +9 -3
- package/virtualscroller/VirtualScroller.d.ts +52 -6
- package/virtualscroller/VirtualScroller.vue +1 -1
- package/virtualscroller/virtualscroller.cjs.js +1 -1
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +1 -1
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +228 -13
package/carousel/carousel.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.carousel=function(t,e,i){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n={name:"Carousel",emits:["update:page"],props:{value:null,page:{type:Number,default:0},numVisible:{type:Number,default:1},numScroll:{type:Number,default:1},responsiveOptions:Array,orientation:{type:String,default:"horizontal"},verticalViewPortHeight:{type:String,default:"300px"},contentClass:String,containerClass:String,indicatorsContentClass:String,circular:{type:Boolean,default:!1},autoplayInterval:{type:Number,default:0}},data(){return{id:t.UniqueComponentId(),remainingItems:0,d_numVisible:this.numVisible,d_numScroll:this.numScroll,d_oldNumScroll:0,d_oldNumVisible:0,d_oldValue:null,d_page:this.page,totalShiftedItems:this.page*this.numScroll*-1,allowAutoplay:!!this.autoplayInterval,d_circular:this.circular||this.allowAutoplay,swipeThreshold:20}},isRemainingItemsAdded:!1,watch:{page(t){this.d_page=t},circular(t){this.d_circular=t},numVisible(t,e){this.d_numVisible=t,this.d_oldNumVisible=e},numScroll(t,e){this.d_oldNumScroll=e,this.d_numScroll=t},value(t){this.d_oldValue=t}},methods:{step(e,i){let s=this.totalShiftedItems;const n=this.isCircular();if(null!=i)s=this.d_numScroll*i*-1,n&&(s-=this.d_numVisible),this.isRemainingItemsAdded=!1;else{s+=this.d_numScroll*e,this.isRemainingItemsAdded&&(s+=this.remainingItems-this.d_numScroll*e,this.isRemainingItemsAdded=!1);let t=n?s+this.d_numVisible:s;i=Math.abs(Math.floor(t/this.d_numScroll))}n&&this.d_page===this.totalIndicators-1&&-1===e?(s=-1*(this.value.length+this.d_numVisible),i=0):n&&0===this.d_page&&1===e?(s=0,i=this.totalIndicators-1):i===this.totalIndicators-1&&this.remainingItems>0&&(s+=-1*this.remainingItems-this.d_numScroll*e,this.isRemainingItemsAdded=!0),this.$refs.itemsContainer&&(t.DomHandler.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical()?`translate3d(0, ${s*(100/this.d_numVisible)}%, 0)`:`translate3d(${s*(100/this.d_numVisible)}%, 0, 0)`,this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=s,this.$emit("update:page",i),this.d_page=i},calculatePosition(){if(this.$refs.itemsContainer&&this.responsiveOptions){let t=window.innerWidth,e={numVisible:this.numVisible,numScroll:this.numScroll};for(let i=0;i<this.responsiveOptions.length;i++){let s=this.responsiveOptions[i];parseInt(s.breakpoint,10)>=t&&(e=s)}if(this.d_numScroll!==e.numScroll){let t=this.d_page;t=parseInt(t*this.d_numScroll/e.numScroll),this.totalShiftedItems=e.numScroll*t*-1,this.isCircular()&&(this.totalShiftedItems-=e.numVisible),this.d_numScroll=e.numScroll,this.$emit("update:page",t),this.d_page=t}this.d_numVisible!==e.numVisible&&(this.d_numVisible=e.numVisible)}},navBackward(t,e){(this.d_circular||0!==this.d_page)&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},navForward(t,e){(this.d_circular||this.d_page<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},onIndicatorClick(t,e){let i=this.d_page;e>i?this.navForward(t,e):e<i&&this.navBackward(t,e)},onTransitionEnd(){this.$refs.itemsContainer&&(t.DomHandler.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="",0!==this.d_page&&this.d_page!==this.totalIndicators-1||!this.isCircular()||(this.$refs.itemsContainer.style.transform=this.isVertical()?`translate3d(0, ${this.totalShiftedItems*(100/this.d_numVisible)}%, 0)`:`translate3d(${this.totalShiftedItems*(100/this.d_numVisible)}%, 0, 0)`))},onTouchStart(t){let e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},onTouchMove(t){t.cancelable&&t.preventDefault()},onTouchEnd(t){let e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)},changePageOnTouch(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))},bindDocumentListeners(){this.documentResizeListener||(this.documentResizeListener=t=>{this.calculatePosition(t)},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},startAutoplay(){this.interval=setInterval((()=>{this.d_page===this.totalIndicators-1?this.step(-1,0):this.step(-1,this.d_page+1)}),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)},createStyle(){this.carouselStyle||(this.carouselStyle=document.createElement("style"),this.carouselStyle.type="text/css",document.body.appendChild(this.carouselStyle));let t=`\n #${this.id} .p-carousel-item {\n flex: 1 0 ${100/this.d_numVisible}%\n }\n `;if(this.responsiveOptions){let e=[...this.responsiveOptions];e.sort(((t,e)=>{const i=t.breakpoint,s=e.breakpoint;let n=null;return n=null==i&&null!=s?-1:null!=i&&null==s?1:null==i&&null==s?0:"string"==typeof i&&"string"==typeof s?i.localeCompare(s,void 0,{numeric:!0}):i<s?-1:i>s?1:0,-1*n}));for(let i=0;i<e.length;i++){let s=e[i];t+=`\n @media screen and (max-width: ${s.breakpoint}) {\n #${this.id} .p-carousel-item {\n flex: 1 0 ${100/s.numVisible}%\n }\n }\n `}}this.carouselStyle.innerHTML=t},isVertical(){return"vertical"===this.orientation},isCircular(){return this.value&&this.d_circular&&this.value.length>=this.d_numVisible},isAutoplay(){return this.autoplayInterval&&this.allowAutoplay},firstIndex(){return this.isCircular()?-1*(this.totalShiftedItems+this.d_numVisible):-1*this.totalShiftedItems},lastIndex(){return this.firstIndex()+this.d_numVisible-1}},mounted(){this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners()},updated(){const t=this.isCircular();let e=!1,i=this.totalShiftedItems;if(this.autoplayInterval&&this.stopAutoplay(),this.d_oldNumScroll!==this.d_numScroll||this.d_oldNumVisible!==this.d_numVisible||this.d_oldValue.length!==this.value.length){this.remainingItems=(this.value.length-this.d_numVisible)%this.d_numScroll;let s=this.d_page;0!==this.totalIndicators&&s>=this.totalIndicators&&(s=this.totalIndicators-1,this.$emit("update:page",s),this.d_page=s,e=!0),i=s*this.d_numScroll*-1,t&&(i-=this.d_numVisible),s===this.totalIndicators-1&&this.remainingItems>0?(i+=-1*this.remainingItems+this.d_numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0),this.d_oldNumScroll=this.d_numScroll,this.d_oldNumVisible=this.d_numVisible,this.d_oldValue=this.value,this.$refs.itemsContainer.style.transform=this.isVertical()?`translate3d(0, ${i*(100/this.d_numVisible)}%, 0)`:`translate3d(${i*(100/this.d_numVisible)}%, 0, 0)`}t&&(0===this.d_page?i=-1*this.d_numVisible:0===i&&(i=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0)),!e&&this.isAutoplay()&&this.startAutoplay()},beforeUnmount(){this.responsiveOptions&&this.unbindDocumentListeners(),this.autoplayInterval&&this.stopAutoplay()},computed:{totalIndicators(){return this.value?Math.ceil((this.value.length-this.d_numVisible)/this.d_numScroll)+1:0},backwardIsDisabled(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&0===this.d_page},forwardIsDisabled(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&(this.d_page===this.totalIndicators-1||0===this.totalIndicators)},containerClasses(){return["p-carousel-container",this.containerClass]},contentClasses(){return["p-carousel-content ",this.contentClass]},indicatorsContentClasses(){return["p-carousel-indicators p-reset",this.indicatorsContentClass]}},directives:{ripple:s(e).default}};const l={key:0,class:"p-carousel-header"},a={key:1,class:"p-carousel-footer"};return function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}("\n.p-carousel {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n}\n.p-carousel-content {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n\toverflow: auto;\n}\n.p-carousel-prev,\n.p-carousel-next {\n\t-ms-flex-item-align: center;\n\t align-self: center;\n\t-webkit-box-flex: 0;\n\t -ms-flex-positive: 0;\n\t flex-grow: 0;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-carousel-container {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: row;\n\t flex-direction: row;\n}\n.p-carousel-items-content {\n\toverflow: hidden;\n width: 100%;\n}\n.p-carousel-items-container {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: row;\n\t flex-direction: row;\n}\n.p-carousel-indicators {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: row;\n\t flex-direction: row;\n\t-webkit-box-pack: center;\n\t -ms-flex-pack: center;\n\t justify-content: center;\n\t-ms-flex-wrap: wrap;\n\t flex-wrap: wrap;\n}\n.p-carousel-indicator > button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n/* Vertical */\n.p-carousel-vertical .p-carousel-container {\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n}\n.p-carousel-vertical .p-carousel-items-container {\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n\theight: 100%;\n}\n\n/* Keyboard Support */\n.p-items-hidden .p-carousel-item {\n\tvisibility: hidden;\n}\n.p-items-hidden .p-carousel-item.p-carousel-item-active {\n\tvisibility: visible;\n}\n"),n.render=function(t,e,s,n,o,r){const c=i.resolveDirective("ripple");return i.openBlock(),i.createBlock("div",{id:o.id,class:["p-carousel p-component",{"p-carousel-vertical":r.isVertical(),"p-carousel-horizontal":!r.isVertical()}]},[t.$slots.header?(i.openBlock(),i.createBlock("div",l,[i.renderSlot(t.$slots,"header")])):i.createCommentVNode("",!0),i.createVNode("div",{class:r.contentClasses},[i.createVNode("div",{class:r.containerClasses},[i.withDirectives(i.createVNode("button",{class:["p-carousel-prev p-link",{"p-disabled":r.backwardIsDisabled}],disabled:r.backwardIsDisabled,onClick:e[1]||(e[1]=(...t)=>r.navBackward&&r.navBackward(...t)),type:"button"},[i.createVNode("span",{class:["p-carousel-prev-icon pi",{"pi-chevron-left":!r.isVertical(),"pi-chevron-up":r.isVertical()}]},null,2)],10,["disabled"]),[[c]]),i.createVNode("div",{class:"p-carousel-items-content",style:[{height:r.isVertical()?s.verticalViewPortHeight:"auto"}]},[i.createVNode("div",{ref:"itemsContainer",class:"p-carousel-items-container",onTransitionend:e[2]||(e[2]=(...t)=>r.onTransitionEnd&&r.onTransitionEnd(...t)),onTouchend:e[3]||(e[3]=(...t)=>r.onTouchEnd&&r.onTouchEnd(...t)),onTouchstart:e[4]||(e[4]=(...t)=>r.onTouchStart&&r.onTouchStart(...t)),onTouchmove:e[5]||(e[5]=(...t)=>r.onTouchMove&&r.onTouchMove(...t))},[r.isCircular()?(i.openBlock(!0),i.createBlock(i.Fragment,{key:0},i.renderList(s.value.slice(-1*o.d_numVisible),((e,n)=>(i.openBlock(),i.createBlock("div",{key:n+"_scloned",class:["p-carousel-item p-carousel-item-cloned",{"p-carousel-item-active":-1*o.totalShiftedItems===s.value.length+o.d_numVisible,"p-carousel-item-start":0===n,"p-carousel-item-end":s.value.slice(-1*o.d_numVisible).length-1===n}]},[i.renderSlot(t.$slots,"item",{data:e,index:n})],2)))),128)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(s.value,((e,s)=>(i.openBlock(),i.createBlock("div",{key:s,class:["p-carousel-item",{"p-carousel-item-active":r.firstIndex()<=s&&r.lastIndex()>=s,"p-carousel-item-start":r.firstIndex()===s,"p-carousel-item-end":r.lastIndex()===s}]},[i.renderSlot(t.$slots,"item",{data:e,index:s})],2)))),128)),r.isCircular()?(i.openBlock(!0),i.createBlock(i.Fragment,{key:1},i.renderList(s.value.slice(0,o.d_numVisible),((e,n)=>(i.openBlock(),i.createBlock("div",{key:n+"_fcloned",class:["p-carousel-item p-carousel-item-cloned",{"p-carousel-item-active":0===o.totalShiftedItems,"p-carousel-item-start":0===n,"p-carousel-item-end":s.value.slice(0,o.d_numVisible).length-1===n}]},[i.renderSlot(t.$slots,"item",{data:e,index:n})],2)))),128)):i.createCommentVNode("",!0)],544)],4),i.withDirectives(i.createVNode("button",{class:["p-carousel-next p-link",{"p-disabled":r.forwardIsDisabled}],disabled:r.forwardIsDisabled,onClick:e[6]||(e[6]=(...t)=>r.navForward&&r.navForward(...t)),type:"button"},[i.createVNode("span",{class:["p-carousel-prev-icon pi",{"pi-chevron-right":!r.isVertical(),"pi-chevron-down":r.isVertical()}]},null,2)],10,["disabled"]),[[c]])],2),r.totalIndicators>=0?(i.openBlock(),i.createBlock("ul",{key:0,class:r.indicatorsContentClasses},[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(r.totalIndicators,((t,e)=>(i.openBlock(),i.createBlock("li",{key:"p-carousel-indicator-"+e.toString(),class:["p-carousel-indicator",{"p-highlight":o.d_page===e}]},[i.createVNode("button",{class:"p-link",onClick:t=>r.onIndicatorClick(t,e),type:"button"},null,8,["onClick"])],2)))),128))],2)):i.createCommentVNode("",!0)],2),t.$slots.footer?(i.openBlock(),i.createBlock("div",a,[i.renderSlot(t.$slots,"footer")])):i.createCommentVNode("",!0)],10,["id"])},n}(primevue.utils,primevue.ripple,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.carousel=function(t,e,i){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n={name:"Carousel",emits:["update:page"],props:{value:null,page:{type:Number,default:0},numVisible:{type:Number,default:1},numScroll:{type:Number,default:1},responsiveOptions:Array,orientation:{type:String,default:"horizontal"},verticalViewPortHeight:{type:String,default:"300px"},contentClass:String,containerClass:String,indicatorsContentClass:String,circular:{type:Boolean,default:!1},autoplayInterval:{type:Number,default:0}},data(){return{id:t.UniqueComponentId(),remainingItems:0,d_numVisible:this.numVisible,d_numScroll:this.numScroll,d_oldNumScroll:0,d_oldNumVisible:0,d_oldValue:null,d_page:this.page,totalShiftedItems:this.page*this.numScroll*-1,allowAutoplay:!!this.autoplayInterval,d_circular:this.circular||this.allowAutoplay,swipeThreshold:20}},isRemainingItemsAdded:!1,watch:{page(t){this.d_page=t},circular(t){this.d_circular=t},numVisible(t,e){this.d_numVisible=t,this.d_oldNumVisible=e},numScroll(t,e){this.d_oldNumScroll=e,this.d_numScroll=t},value(t){this.d_oldValue=t}},methods:{step(e,i){let s=this.totalShiftedItems;const n=this.isCircular();if(null!=i)s=this.d_numScroll*i*-1,n&&(s-=this.d_numVisible),this.isRemainingItemsAdded=!1;else{s+=this.d_numScroll*e,this.isRemainingItemsAdded&&(s+=this.remainingItems-this.d_numScroll*e,this.isRemainingItemsAdded=!1);let t=n?s+this.d_numVisible:s;i=Math.abs(Math.floor(t/this.d_numScroll))}n&&this.d_page===this.totalIndicators-1&&-1===e?(s=-1*(this.value.length+this.d_numVisible),i=0):n&&0===this.d_page&&1===e?(s=0,i=this.totalIndicators-1):i===this.totalIndicators-1&&this.remainingItems>0&&(s+=-1*this.remainingItems-this.d_numScroll*e,this.isRemainingItemsAdded=!0),this.$refs.itemsContainer&&(t.DomHandler.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical()?`translate3d(0, ${s*(100/this.d_numVisible)}%, 0)`:`translate3d(${s*(100/this.d_numVisible)}%, 0, 0)`,this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=s,this.$emit("update:page",i),this.d_page=i},calculatePosition(){if(this.$refs.itemsContainer&&this.responsiveOptions){let t=window.innerWidth,e={numVisible:this.numVisible,numScroll:this.numScroll};for(let i=0;i<this.responsiveOptions.length;i++){let s=this.responsiveOptions[i];parseInt(s.breakpoint,10)>=t&&(e=s)}if(this.d_numScroll!==e.numScroll){let t=this.d_page;t=parseInt(t*this.d_numScroll/e.numScroll),this.totalShiftedItems=e.numScroll*t*-1,this.isCircular()&&(this.totalShiftedItems-=e.numVisible),this.d_numScroll=e.numScroll,this.$emit("update:page",t),this.d_page=t}this.d_numVisible!==e.numVisible&&(this.d_numVisible=e.numVisible)}},navBackward(t,e){(this.d_circular||0!==this.d_page)&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},navForward(t,e){(this.d_circular||this.d_page<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},onIndicatorClick(t,e){let i=this.d_page;e>i?this.navForward(t,e):e<i&&this.navBackward(t,e)},onTransitionEnd(){this.$refs.itemsContainer&&(t.DomHandler.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="",0!==this.d_page&&this.d_page!==this.totalIndicators-1||!this.isCircular()||(this.$refs.itemsContainer.style.transform=this.isVertical()?`translate3d(0, ${this.totalShiftedItems*(100/this.d_numVisible)}%, 0)`:`translate3d(${this.totalShiftedItems*(100/this.d_numVisible)}%, 0, 0)`))},onTouchStart(t){let e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},onTouchMove(t){t.cancelable&&t.preventDefault()},onTouchEnd(t){let e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)},changePageOnTouch(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))},bindDocumentListeners(){this.documentResizeListener||(this.documentResizeListener=t=>{this.calculatePosition(t)},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},startAutoplay(){this.interval=setInterval((()=>{this.d_page===this.totalIndicators-1?this.step(-1,0):this.step(-1,this.d_page+1)}),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)},createStyle(){this.carouselStyle||(this.carouselStyle=document.createElement("style"),this.carouselStyle.type="text/css",document.body.appendChild(this.carouselStyle));let t=`\n #${this.id} .p-carousel-item {\n flex: 1 0 ${100/this.d_numVisible}%\n }\n `;if(this.responsiveOptions){let e=[...this.responsiveOptions];e.sort(((t,e)=>{const i=t.breakpoint,s=e.breakpoint;let n=null;return n=null==i&&null!=s?-1:null!=i&&null==s?1:null==i&&null==s?0:"string"==typeof i&&"string"==typeof s?i.localeCompare(s,void 0,{numeric:!0}):i<s?-1:i>s?1:0,-1*n}));for(let i=0;i<e.length;i++){let s=e[i];t+=`\n @media screen and (max-width: ${s.breakpoint}) {\n #${this.id} .p-carousel-item {\n flex: 1 0 ${100/s.numVisible}%\n }\n }\n `}}this.carouselStyle.innerHTML=t},isVertical(){return"vertical"===this.orientation},isCircular(){return this.value&&this.d_circular&&this.value.length>=this.d_numVisible},isAutoplay(){return this.autoplayInterval&&this.allowAutoplay},firstIndex(){return this.isCircular()?-1*(this.totalShiftedItems+this.d_numVisible):-1*this.totalShiftedItems},lastIndex(){return this.firstIndex()+this.d_numVisible-1}},mounted(){this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners()},updated(){const t=this.isCircular();let e=!1,i=this.totalShiftedItems;if(this.autoplayInterval&&this.stopAutoplay(),this.d_oldNumScroll!==this.d_numScroll||this.d_oldNumVisible!==this.d_numVisible||this.d_oldValue.length!==this.value.length){this.remainingItems=(this.value.length-this.d_numVisible)%this.d_numScroll;let s=this.d_page;0!==this.totalIndicators&&s>=this.totalIndicators&&(s=this.totalIndicators-1,this.$emit("update:page",s),this.d_page=s,e=!0),i=s*this.d_numScroll*-1,t&&(i-=this.d_numVisible),s===this.totalIndicators-1&&this.remainingItems>0?(i+=-1*this.remainingItems+this.d_numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0),this.d_oldNumScroll=this.d_numScroll,this.d_oldNumVisible=this.d_numVisible,this.d_oldValue=this.value,this.$refs.itemsContainer.style.transform=this.isVertical()?`translate3d(0, ${i*(100/this.d_numVisible)}%, 0)`:`translate3d(${i*(100/this.d_numVisible)}%, 0, 0)`}t&&(0===this.d_page?i=-1*this.d_numVisible:0===i&&(i=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0)),!e&&this.isAutoplay()&&this.startAutoplay()},beforeUnmount(){this.responsiveOptions&&this.unbindDocumentListeners(),this.autoplayInterval&&this.stopAutoplay()},computed:{totalIndicators(){return this.value?Math.ceil((this.value.length-this.d_numVisible)/this.d_numScroll)+1:0},backwardIsDisabled(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&0===this.d_page},forwardIsDisabled(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&(this.d_page===this.totalIndicators-1||0===this.totalIndicators)},containerClasses(){return["p-carousel-container",this.containerClass]},contentClasses(){return["p-carousel-content ",this.contentClass]},indicatorsContentClasses(){return["p-carousel-indicators p-reset",this.indicatorsContentClass]}},directives:{ripple:s(e).default}};const l={key:0,class:"p-carousel-header"},a={key:1,class:"p-carousel-footer"};return function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}("\n.p-carousel {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n}\n.p-carousel-content {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n\toverflow: auto;\n}\n.p-carousel-prev,\n.p-carousel-next {\n\t-ms-flex-item-align: center;\n\t align-self: center;\n\t-webkit-box-flex: 0;\n\t -ms-flex-positive: 0;\n\t flex-grow: 0;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-carousel-container {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: row;\n\t flex-direction: row;\n}\n.p-carousel-items-content {\n\toverflow: hidden;\n width: 100%;\n}\n.p-carousel-items-container {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: row;\n\t flex-direction: row;\n}\n.p-carousel-indicators {\n\tdisplay: -webkit-box;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: row;\n\t flex-direction: row;\n\t-webkit-box-pack: center;\n\t -ms-flex-pack: center;\n\t justify-content: center;\n\t-ms-flex-wrap: wrap;\n\t flex-wrap: wrap;\n}\n.p-carousel-indicator > button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n/* Vertical */\n.p-carousel-vertical .p-carousel-container {\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n}\n.p-carousel-vertical .p-carousel-items-container {\n\t-webkit-box-orient: vertical;\n\t-webkit-box-direction: normal;\n\t -ms-flex-direction: column;\n\t flex-direction: column;\n\theight: 100%;\n}\n\n/* Keyboard Support */\n.p-items-hidden .p-carousel-item {\n\tvisibility: hidden;\n}\n.p-items-hidden .p-carousel-item.p-carousel-item-active {\n\tvisibility: visible;\n}\n"),n.render=function(t,e,s,n,o,r){const c=i.resolveDirective("ripple");return i.openBlock(),i.createBlock("div",{id:o.id,class:["p-carousel p-component",{"p-carousel-vertical":r.isVertical(),"p-carousel-horizontal":!r.isVertical()}]},[t.$slots.header?(i.openBlock(),i.createBlock("div",l,[i.renderSlot(t.$slots,"header")])):i.createCommentVNode("",!0),i.createVNode("div",{class:r.contentClasses},[i.createVNode("div",{class:r.containerClasses},[i.withDirectives(i.createVNode("button",{class:["p-carousel-prev p-link",{"p-disabled":r.backwardIsDisabled}],disabled:r.backwardIsDisabled,onClick:e[1]||(e[1]=(...t)=>r.navBackward&&r.navBackward(...t)),type:"button"},[i.createVNode("span",{class:["p-carousel-prev-icon pi",{"pi-chevron-left":!r.isVertical(),"pi-chevron-up":r.isVertical()}]},null,2)],10,["disabled"]),[[c]]),i.createVNode("div",{class:"p-carousel-items-content",style:[{height:r.isVertical()?s.verticalViewPortHeight:"auto"}],onTouchend:e[3]||(e[3]=(...t)=>r.onTouchEnd&&r.onTouchEnd(...t)),onTouchstart:e[4]||(e[4]=(...t)=>r.onTouchStart&&r.onTouchStart(...t)),onTouchmove:e[5]||(e[5]=(...t)=>r.onTouchMove&&r.onTouchMove(...t))},[i.createVNode("div",{ref:"itemsContainer",class:"p-carousel-items-container",onTransitionend:e[2]||(e[2]=(...t)=>r.onTransitionEnd&&r.onTransitionEnd(...t))},[r.isCircular()?(i.openBlock(!0),i.createBlock(i.Fragment,{key:0},i.renderList(s.value.slice(-1*o.d_numVisible),((e,n)=>(i.openBlock(),i.createBlock("div",{key:n+"_scloned",class:["p-carousel-item p-carousel-item-cloned",{"p-carousel-item-active":-1*o.totalShiftedItems===s.value.length+o.d_numVisible,"p-carousel-item-start":0===n,"p-carousel-item-end":s.value.slice(-1*o.d_numVisible).length-1===n}]},[i.renderSlot(t.$slots,"item",{data:e,index:n})],2)))),128)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(s.value,((e,s)=>(i.openBlock(),i.createBlock("div",{key:s,class:["p-carousel-item",{"p-carousel-item-active":r.firstIndex()<=s&&r.lastIndex()>=s,"p-carousel-item-start":r.firstIndex()===s,"p-carousel-item-end":r.lastIndex()===s}]},[i.renderSlot(t.$slots,"item",{data:e,index:s})],2)))),128)),r.isCircular()?(i.openBlock(!0),i.createBlock(i.Fragment,{key:1},i.renderList(s.value.slice(0,o.d_numVisible),((e,n)=>(i.openBlock(),i.createBlock("div",{key:n+"_fcloned",class:["p-carousel-item p-carousel-item-cloned",{"p-carousel-item-active":0===o.totalShiftedItems,"p-carousel-item-start":0===n,"p-carousel-item-end":s.value.slice(0,o.d_numVisible).length-1===n}]},[i.renderSlot(t.$slots,"item",{data:e,index:n})],2)))),128)):i.createCommentVNode("",!0)],544)],36),i.withDirectives(i.createVNode("button",{class:["p-carousel-next p-link",{"p-disabled":r.forwardIsDisabled}],disabled:r.forwardIsDisabled,onClick:e[6]||(e[6]=(...t)=>r.navForward&&r.navForward(...t)),type:"button"},[i.createVNode("span",{class:["p-carousel-prev-icon pi",{"pi-chevron-right":!r.isVertical(),"pi-chevron-down":r.isVertical()}]},null,2)],10,["disabled"]),[[c]])],2),r.totalIndicators>=0?(i.openBlock(),i.createBlock("ul",{key:0,class:r.indicatorsContentClasses},[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(r.totalIndicators,((t,e)=>(i.openBlock(),i.createBlock("li",{key:"p-carousel-indicator-"+e.toString(),class:["p-carousel-indicator",{"p-highlight":o.d_page===e}]},[i.createVNode("button",{class:"p-link",onClick:t=>r.onIndicatorClick(t,e),type:"button"},null,8,["onClick"])],2)))),128))],2)):i.createCommentVNode("",!0)],2),t.$slots.footer?(i.openBlock(),i.createBlock("div",a,[i.renderSlot(t.$slots,"footer")])):i.createCommentVNode("",!0)],10,["id"])},n}(primevue.utils,primevue.ripple,Vue);
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
|
|
3
|
+
type CascadeSelectOptionLabelType = string | ((data: any) => string) | undefined;
|
|
4
|
+
type CascadeSelectOptionValueType = string | ((data: any) => any) | undefined;
|
|
5
|
+
type CascadeSelectOptionChildrenType = string[] | string | ((data: any) => any[]) | undefined;
|
|
6
|
+
|
|
3
7
|
interface CascadeSelectProps {
|
|
4
8
|
modelValue?: any;
|
|
5
9
|
options?: any[];
|
|
6
|
-
optionLabel?:
|
|
7
|
-
optionValue?:
|
|
8
|
-
optionGroupLabel?:
|
|
9
|
-
optionGroupChildren?:
|
|
10
|
+
optionLabel?: CascadeSelectOptionLabelType;
|
|
11
|
+
optionValue?: CascadeSelectOptionValueType;
|
|
12
|
+
optionGroupLabel?: CascadeSelectOptionLabelType;
|
|
13
|
+
optionGroupChildren?: CascadeSelectOptionChildrenType;
|
|
10
14
|
placeholder?: string;
|
|
11
15
|
disabled?: boolean;
|
|
12
16
|
dataKey?: string;
|
|
@@ -19,6 +23,15 @@ interface CascadeSelectProps {
|
|
|
19
23
|
loadingIcon?: string;
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
interface CascadeSelectOptionSlotInterface {
|
|
27
|
+
option: any;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface CascadeSelectValueSlotInterface {
|
|
31
|
+
value: any;
|
|
32
|
+
placeholder: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
22
35
|
declare class CascadeSelect {
|
|
23
36
|
$props: CascadeSelectProps;
|
|
24
37
|
$emit(eventName: 'update:modelValue', value: string): this;
|
|
@@ -29,8 +42,8 @@ declare class CascadeSelect {
|
|
|
29
42
|
$emit(eventName: 'show'): this;
|
|
30
43
|
$emit(eventName: 'hide'): this;
|
|
31
44
|
$slot: {
|
|
32
|
-
option:
|
|
33
|
-
value:
|
|
45
|
+
option: CascadeSelectOptionSlotInterface;
|
|
46
|
+
value: CascadeSelectValueSlotInterface;
|
|
34
47
|
indicator: VNode[];
|
|
35
48
|
}
|
|
36
49
|
}
|
package/chart/Chart.vue
CHANGED
|
@@ -32,8 +32,15 @@ export default {
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
watch: {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
/*
|
|
36
|
+
* Use deep watch to enable triggering watch for changes within structure
|
|
37
|
+
* otherwise the entire data object needs to be replaced to trigger watch
|
|
38
|
+
*/
|
|
39
|
+
data: {
|
|
40
|
+
handler() {
|
|
41
|
+
this.reinit();
|
|
42
|
+
},
|
|
43
|
+
deep: true
|
|
37
44
|
},
|
|
38
45
|
type() {
|
|
39
46
|
this.reinit();
|
package/chart/chart.cjs.js
CHANGED
|
@@ -49,8 +49,15 @@ var script = {
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
watch: {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
/*
|
|
53
|
+
* Use deep watch to enable triggering watch for changes within structure
|
|
54
|
+
* otherwise the entire data object needs to be replaced to trigger watch
|
|
55
|
+
*/
|
|
56
|
+
data: {
|
|
57
|
+
handler() {
|
|
58
|
+
this.reinit();
|
|
59
|
+
},
|
|
60
|
+
deep: true
|
|
54
61
|
},
|
|
55
62
|
type() {
|
|
56
63
|
this.reinit();
|
package/chart/chart.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("vue");function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var r={name:"Chart",emits:["select"],props:{type:String,data:null,options:null,width:{type:Number,default:300},height:{type:Number,default:150}},chart:null,mounted(){this.initChart()},beforeUnmount(){this.chart&&(this.chart.destroy(),this.chart=null)},watch:{data(){this.reinit()},type(){this.reinit()},options(){this.reinit()}},methods:{initChart(){Promise.resolve().then((function(){return e(require("chart.js/auto"))})).then((t=>{this.chart&&(this.chart.destroy(),this.chart=null),t&&t.default&&(this.chart=new t.default(this.$refs.canvas,{type:this.type,data:this.data,options:this.options}))}))},getCanvas(){return this.$canvas},getBase64Image(){return this.chart.toBase64Image()},refresh(){this.chart&&this.chart.update()},reinit(){this.initChart()},onCanvasClick(t){if(this.chart){const e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),r=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&r&&this.$emit("select",{originalEvent:t,element:e[0],dataset:r})}},generateLegend(){if(this.chart)return this.chart.generateLegend()}}};const n={class:"p-chart"};!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("\n.p-chart {\n position: relative;\n}\n"),r.render=function(e,r,i,a,s,h){return t.openBlock(),t.createBlock("div",n,[t.createVNode("canvas",{ref:"canvas",width:i.width,height:i.height,onClick:r[1]||(r[1]=t=>h.onCanvasClick(t))},null,8,["width","height"])])},module.exports=r;
|
|
1
|
+
"use strict";var t=require("vue");function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var r={name:"Chart",emits:["select"],props:{type:String,data:null,options:null,width:{type:Number,default:300},height:{type:Number,default:150}},chart:null,mounted(){this.initChart()},beforeUnmount(){this.chart&&(this.chart.destroy(),this.chart=null)},watch:{data:{handler(){this.reinit()},deep:!0},type(){this.reinit()},options(){this.reinit()}},methods:{initChart(){Promise.resolve().then((function(){return e(require("chart.js/auto"))})).then((t=>{this.chart&&(this.chart.destroy(),this.chart=null),t&&t.default&&(this.chart=new t.default(this.$refs.canvas,{type:this.type,data:this.data,options:this.options}))}))},getCanvas(){return this.$canvas},getBase64Image(){return this.chart.toBase64Image()},refresh(){this.chart&&this.chart.update()},reinit(){this.initChart()},onCanvasClick(t){if(this.chart){const e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),r=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&r&&this.$emit("select",{originalEvent:t,element:e[0],dataset:r})}},generateLegend(){if(this.chart)return this.chart.generateLegend()}}};const n={class:"p-chart"};!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("\n.p-chart {\n position: relative;\n}\n"),r.render=function(e,r,i,a,s,h){return t.openBlock(),t.createBlock("div",n,[t.createVNode("canvas",{ref:"canvas",width:i.width,height:i.height,onClick:r[1]||(r[1]=t=>h.onCanvasClick(t))},null,8,["width","height"])])},module.exports=r;
|
package/chart/chart.esm.js
CHANGED
|
@@ -27,8 +27,15 @@ var script = {
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
watch: {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/*
|
|
31
|
+
* Use deep watch to enable triggering watch for changes within structure
|
|
32
|
+
* otherwise the entire data object needs to be replaced to trigger watch
|
|
33
|
+
*/
|
|
34
|
+
data: {
|
|
35
|
+
handler() {
|
|
36
|
+
this.reinit();
|
|
37
|
+
},
|
|
38
|
+
deep: true
|
|
32
39
|
},
|
|
33
40
|
type() {
|
|
34
41
|
this.reinit();
|
package/chart/chart.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{openBlock as t,createBlock as e,createVNode as i}from"vue";var a={name:"Chart",emits:["select"],props:{type:String,data:null,options:null,width:{type:Number,default:300},height:{type:Number,default:150}},chart:null,mounted(){this.initChart()},beforeUnmount(){this.chart&&(this.chart.destroy(),this.chart=null)},watch:{data(){this.reinit()},type(){this.reinit()},options(){this.reinit()}},methods:{initChart(){import("chart.js/auto").then((t=>{this.chart&&(this.chart.destroy(),this.chart=null),t&&t.default&&(this.chart=new t.default(this.$refs.canvas,{type:this.type,data:this.data,options:this.options}))}))},getCanvas(){return this.$canvas},getBase64Image(){return this.chart.toBase64Image()},refresh(){this.chart&&this.chart.update()},reinit(){this.initChart()},onCanvasClick(t){if(this.chart){const e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&i&&this.$emit("select",{originalEvent:t,element:e[0],dataset:i})}},generateLegend(){if(this.chart)return this.chart.generateLegend()}}};const n={class:"p-chart"};!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}("\n.p-chart {\n position: relative;\n}\n"),a.render=function(a,h,s,r,c,
|
|
1
|
+
import{openBlock as t,createBlock as e,createVNode as i}from"vue";var a={name:"Chart",emits:["select"],props:{type:String,data:null,options:null,width:{type:Number,default:300},height:{type:Number,default:150}},chart:null,mounted(){this.initChart()},beforeUnmount(){this.chart&&(this.chart.destroy(),this.chart=null)},watch:{data:{handler(){this.reinit()},deep:!0},type(){this.reinit()},options(){this.reinit()}},methods:{initChart(){import("chart.js/auto").then((t=>{this.chart&&(this.chart.destroy(),this.chart=null),t&&t.default&&(this.chart=new t.default(this.$refs.canvas,{type:this.type,data:this.data,options:this.options}))}))},getCanvas(){return this.$canvas},getBase64Image(){return this.chart.toBase64Image()},refresh(){this.chart&&this.chart.update()},reinit(){this.initChart()},onCanvasClick(t){if(this.chart){const e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&i&&this.$emit("select",{originalEvent:t,element:e[0],dataset:i})}},generateLegend(){if(this.chart)return this.chart.generateLegend()}}};const n={class:"p-chart"};!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}("\n.p-chart {\n position: relative;\n}\n"),a.render=function(a,h,s,r,c,d){return t(),e("div",n,[i("canvas",{ref:"canvas",width:s.width,height:s.height,onClick:h[1]||(h[1]=t=>d.onCanvasClick(t))},null,8,["width","height"])])};export default a;
|
package/chart/chart.js
CHANGED
|
@@ -29,8 +29,15 @@ this.primevue.chart = (function (vue) {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
watch: {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
/*
|
|
33
|
+
* Use deep watch to enable triggering watch for changes within structure
|
|
34
|
+
* otherwise the entire data object needs to be replaced to trigger watch
|
|
35
|
+
*/
|
|
36
|
+
data: {
|
|
37
|
+
handler() {
|
|
38
|
+
this.reinit();
|
|
39
|
+
},
|
|
40
|
+
deep: true
|
|
34
41
|
},
|
|
35
42
|
type() {
|
|
36
43
|
this.reinit();
|
package/chart/chart.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.chart=function(t){"use strict";var e={name:"Chart",emits:["select"],props:{type:String,data:null,options:null,width:{type:Number,default:300},height:{type:Number,default:150}},chart:null,mounted(){this.initChart()},beforeUnmount(){this.chart&&(this.chart.destroy(),this.chart=null)},watch:{data(){this.reinit()},type(){this.reinit()},options(){this.reinit()}},methods:{initChart(){import("chart.js/auto").then((t=>{this.chart&&(this.chart.destroy(),this.chart=null),t&&t.default&&(this.chart=new t.default(this.$refs.canvas,{type:this.type,data:this.data,options:this.options}))}))},getCanvas(){return this.$canvas},getBase64Image(){return this.chart.toBase64Image()},refresh(){this.chart&&this.chart.update()},reinit(){this.initChart()},onCanvasClick(t){if(this.chart){const e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&i&&this.$emit("select",{originalEvent:t,element:e[0],dataset:i})}},generateLegend(){if(this.chart)return this.chart.generateLegend()}}};const i={class:"p-chart"};return function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}("\n.p-chart {\n position: relative;\n}\n"),e.render=function(e,a,n,
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.chart=function(t){"use strict";var e={name:"Chart",emits:["select"],props:{type:String,data:null,options:null,width:{type:Number,default:300},height:{type:Number,default:150}},chart:null,mounted(){this.initChart()},beforeUnmount(){this.chart&&(this.chart.destroy(),this.chart=null)},watch:{data:{handler(){this.reinit()},deep:!0},type(){this.reinit()},options(){this.reinit()}},methods:{initChart(){import("chart.js/auto").then((t=>{this.chart&&(this.chart.destroy(),this.chart=null),t&&t.default&&(this.chart=new t.default(this.$refs.canvas,{type:this.type,data:this.data,options:this.options}))}))},getCanvas(){return this.$canvas},getBase64Image(){return this.chart.toBase64Image()},refresh(){this.chart&&this.chart.update()},reinit(){this.initChart()},onCanvasClick(t){if(this.chart){const e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&i&&this.$emit("select",{originalEvent:t,element:e[0],dataset:i})}},generateLegend(){if(this.chart)return this.chart.generateLegend()}}};const i={class:"p-chart"};return function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}("\n.p-chart {\n position: relative;\n}\n"),e.render=function(e,a,n,h,r,s){return t.openBlock(),t.createBlock("div",i,[t.createVNode("canvas",{ref:"canvas",width:n.width,height:n.height,onClick:a[1]||(a[1]=t=>s.onCanvasClick(t))},null,8,["width","height"])])},e}(Vue);
|
package/chips/Chips.d.ts
CHANGED
|
@@ -10,13 +10,17 @@ interface ChipsProps {
|
|
|
10
10
|
style?: any;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
interface ChipsChipSlotInterface {
|
|
14
|
+
value: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
declare class Chips {
|
|
14
18
|
$props: ChipsProps;
|
|
15
19
|
$emit(eventName: 'update:modelValue', value: any[]): this;
|
|
16
20
|
$emit(eventName: 'add', e: { originalEvent: Event, value: any }): this;
|
|
17
21
|
$emit(eventName: 'remove', e: { originalEvent: Event, value: any }): this;
|
|
18
22
|
$slots: {
|
|
19
|
-
chip:
|
|
23
|
+
chip: ChipsChipSlotInterface;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
|
|
@@ -15,6 +15,9 @@ interface ColorPickerProps {
|
|
|
15
15
|
declare class ColorPicker {
|
|
16
16
|
$props: ColorPickerProps;
|
|
17
17
|
$emit(eventName: 'update:modelValue', value: any): this;
|
|
18
|
+
$emit(eventName: 'change', event: {originalEvent: Event, value: any}): this;
|
|
19
|
+
$emit(eventName: 'show'): this;
|
|
20
|
+
$emit(eventName: 'hide'): this;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export default ColorPicker;
|
|
@@ -29,7 +29,7 @@ import OverlayEventBus from 'primevue/overlayeventbus';
|
|
|
29
29
|
|
|
30
30
|
export default {
|
|
31
31
|
name: 'ColorPicker',
|
|
32
|
-
emits: ['update:modelValue'],
|
|
32
|
+
emits: ['update:modelValue', 'change', 'show', 'hide'],
|
|
33
33
|
props: {
|
|
34
34
|
modelValue: {
|
|
35
35
|
type: null,
|
|
@@ -141,6 +141,7 @@ export default {
|
|
|
141
141
|
this.updateColorHandle();
|
|
142
142
|
this.updateInput();
|
|
143
143
|
this.updateModel();
|
|
144
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
144
145
|
},
|
|
145
146
|
pickHue(event) {
|
|
146
147
|
let top = this.hueView.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
|
|
@@ -155,6 +156,7 @@ export default {
|
|
|
155
156
|
this.updateHue();
|
|
156
157
|
this.updateModel();
|
|
157
158
|
this.updateInput();
|
|
159
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
158
160
|
},
|
|
159
161
|
updateModel() {
|
|
160
162
|
switch(this.format) {
|
|
@@ -354,12 +356,15 @@ export default {
|
|
|
354
356
|
if (this.autoZIndex) {
|
|
355
357
|
ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
356
358
|
}
|
|
359
|
+
|
|
360
|
+
this.$emit('show');
|
|
357
361
|
},
|
|
358
362
|
onOverlayLeave() {
|
|
359
363
|
this.unbindOutsideClickListener();
|
|
360
364
|
this.unbindScrollListener();
|
|
361
365
|
this.unbindResizeListener();
|
|
362
366
|
this.clearRefs();
|
|
367
|
+
this.$emit('hide');
|
|
363
368
|
},
|
|
364
369
|
onOverlayAfterLeave(el) {
|
|
365
370
|
if (this.autoZIndex) {
|
|
@@ -10,7 +10,7 @@ var OverlayEventBus__default = /*#__PURE__*/_interopDefaultLegacy(OverlayEventBu
|
|
|
10
10
|
|
|
11
11
|
var script = {
|
|
12
12
|
name: 'ColorPicker',
|
|
13
|
-
emits: ['update:modelValue'],
|
|
13
|
+
emits: ['update:modelValue', 'change', 'show', 'hide'],
|
|
14
14
|
props: {
|
|
15
15
|
modelValue: {
|
|
16
16
|
type: null,
|
|
@@ -122,6 +122,7 @@ var script = {
|
|
|
122
122
|
this.updateColorHandle();
|
|
123
123
|
this.updateInput();
|
|
124
124
|
this.updateModel();
|
|
125
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
125
126
|
},
|
|
126
127
|
pickHue(event) {
|
|
127
128
|
let top = this.hueView.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
|
|
@@ -136,6 +137,7 @@ var script = {
|
|
|
136
137
|
this.updateHue();
|
|
137
138
|
this.updateModel();
|
|
138
139
|
this.updateInput();
|
|
140
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
139
141
|
},
|
|
140
142
|
updateModel() {
|
|
141
143
|
switch(this.format) {
|
|
@@ -328,12 +330,15 @@ var script = {
|
|
|
328
330
|
if (this.autoZIndex) {
|
|
329
331
|
utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
330
332
|
}
|
|
333
|
+
|
|
334
|
+
this.$emit('show');
|
|
331
335
|
},
|
|
332
336
|
onOverlayLeave() {
|
|
333
337
|
this.unbindOutsideClickListener();
|
|
334
338
|
this.unbindScrollListener();
|
|
335
339
|
this.unbindResizeListener();
|
|
336
340
|
this.clearRefs();
|
|
341
|
+
this.$emit('hide');
|
|
337
342
|
},
|
|
338
343
|
onOverlayAfterLeave(el) {
|
|
339
344
|
if (this.autoZIndex) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),i=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),r={name:"ColorPicker",emits:["update:modelValue"],props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},ariaLabelledBy:{type:String,default:null},appendTo:{type:String,default:"body"},panelClass:null},data:()=>({overlayVisible:!1}),hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&e.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted(){this.updateUI()},watch:{modelValue:{immediate:!0,handler(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},methods:{pickColor(e){let t=this.colorSelector.getBoundingClientRect(),i=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),n=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-n))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-i)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel()},pickHue(e){let t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput()},updateModel(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector(){if(this.colorSelector){let e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:e=>({h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}),validateRGB:e=>({r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}),validateHEX(e){var t=6-e.length;if(t>0){for(var i=[],n=0;n<t;n++)i.push("0");i.push(e),e=i.join("")}return e},HEXtoRGB(e){let t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB(e){var t={h:0,s:0,b:0},i=Math.min(e.r,e.g,e.b),n=Math.max(e.r,e.g,e.b),o=n-i;return t.b=n,t.s=0!==n?255*o/n:0,0!==t.s?e.r===n?t.h=(e.g-e.b)/o:e.g===n?t.h=2+(e.b-e.r)/o:t.h=4+(e.r-e.g)/o:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB(e){var t={r:null,g:null,b:null},i=Math.round(e.h),n=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===n)t={r:o,g:o,b:o};else{var r=o,l=(255-n)*o/255,s=i%60*(r-l)/60;360===i&&(i=0),i<60?(t.r=r,t.b=l,t.g=l+s):i<120?(t.g=r,t.b=l,t.r=r-s):i<180?(t.g=r,t.r=l,t.b=l+s):i<240?(t.b=r,t.r=l,t.g=r-s):i<300?(t.b=r,t.g=l,t.r=l+s):i<360?(t.r=r,t.g=l,t.b=r-s):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var i in t)1===t[i].length&&(t[i]="0"+t[i]);return t.join("")},HSBtoHEX(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB(e){let t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter(t){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay)},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs()},onOverlayAfterLeave(t){this.autoZIndex&&e.ZIndexUtils.clear(t)},alignOverlay(){this.appendDisabled?e.DomHandler.relativePosition(this.picker,this.$refs.input):e.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown(e){switch(e.which){case 32:this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case 27:case 9:this.overlayVisible=!1}},onColorMousedown(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart(t){this.disabled||(this.colorDragging=!0,this.pickColor(t),e.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),t.preventDefault())},onDrag(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd(){this.colorDragging=!1,this.hueDragging=!1,e.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart(t){this.disabled||(this.hueDragging=!0,this.pickHue(t),e.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.picker&&!this.picker.contains(e.target)&&!this.isInputClicked(e)&&(this.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&(this.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&(this.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef(e){this.picker=e},colorSelectorRef(e){this.colorSelector=e},colorHandleRef(e){this.colorHandle=e},hueViewRef(e){this.hueView=e},hueHandleRef(e){this.hueHandle=e},clearRefs(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick(e){o.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-colorpicker p-component",{"p-colorpicker-overlay":!this.inline}]},inputClass(){return["p-colorpicker-preview p-inputtext",{"p-disabled":this.disabled}]},pickerClass(){return["p-colorpicker-panel",this.panelClass,{"p-colorpicker-overlay-panel":!this.inline,"p-disabled":this.disabled,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},appendDisabled(){return"self"===this.appendTo||this.inline},appendTarget(){return this.appendDisabled?null:this.appendTo}}};const l={class:"p-colorpicker-content"},s={class:"p-colorpicker-color"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: .85;\n cursor: pointer;\n}\n"),r.render=function(e,t,n,o,r,a){return i.openBlock(),i.createBlock("div",{ref:"container",class:a.containerClass},[n.inline?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock("input",{key:0,ref:"input",type:"text",class:a.inputClass,readonly:"readonly",tabindex:n.tabindex,disabled:n.disabled,onClick:t[1]||(t[1]=(...e)=>a.onInputClick&&a.onInputClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>a.onInputKeydown&&a.onInputKeydown(...e)),"aria-labelledby":n.ariaLabelledBy},null,42,["tabindex","disabled","aria-labelledby"])),(i.openBlock(),i.createBlock(i.Teleport,{to:a.appendTarget,disabled:a.appendDisabled},[i.createVNode(i.Transition,{name:"p-connected-overlay",onEnter:a.onOverlayEnter,onLeave:a.onOverlayLeave,onAfterLeave:a.onOverlayAfterLeave},{default:i.withCtx((()=>[n.inline||r.overlayVisible?(i.openBlock(),i.createBlock("div",{key:0,ref:a.pickerRef,class:a.pickerClass,onClick:t[11]||(t[11]=(...e)=>a.onOverlayClick&&a.onOverlayClick(...e))},[i.createVNode("div",l,[i.createVNode("div",{ref:a.colorSelectorRef,class:"p-colorpicker-color-selector",onMousedown:t[3]||(t[3]=e=>a.onColorMousedown(e)),onTouchstart:t[4]||(t[4]=e=>a.onColorDragStart(e)),onTouchmove:t[5]||(t[5]=e=>a.onDrag(e)),onTouchend:t[6]||(t[6]=e=>a.onDragEnd())},[i.createVNode("div",s,[i.createVNode("div",{ref:a.colorHandleRef,class:"p-colorpicker-color-handle"},null,512)])],544),i.createVNode("div",{ref:a.hueViewRef,class:"p-colorpicker-hue",onMousedown:t[7]||(t[7]=e=>a.onHueMousedown(e)),onTouchstart:t[8]||(t[8]=e=>a.onHueDragStart(e)),onTouchmove:t[9]||(t[9]=e=>a.onDrag(e)),onTouchend:t[10]||(t[10]=e=>a.onDragEnd())},[i.createVNode("div",{ref:a.hueHandleRef,class:"p-colorpicker-hue-handle"},null,512)],544)])],2)):i.createCommentVNode("",!0)])),_:1},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)},module.exports=r;
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),i=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),r={name:"ColorPicker",emits:["update:modelValue","change","show","hide"],props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},ariaLabelledBy:{type:String,default:null},appendTo:{type:String,default:"body"},panelClass:null},data:()=>({overlayVisible:!1}),hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&e.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted(){this.updateUI()},watch:{modelValue:{immediate:!0,handler(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},methods:{pickColor(e){let t=this.colorSelector.getBoundingClientRect(),i=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),n=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-n))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-i)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue(e){let t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector(){if(this.colorSelector){let e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:e=>({h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}),validateRGB:e=>({r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}),validateHEX(e){var t=6-e.length;if(t>0){for(var i=[],n=0;n<t;n++)i.push("0");i.push(e),e=i.join("")}return e},HEXtoRGB(e){let t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB(e){var t={h:0,s:0,b:0},i=Math.min(e.r,e.g,e.b),n=Math.max(e.r,e.g,e.b),o=n-i;return t.b=n,t.s=0!==n?255*o/n:0,0!==t.s?e.r===n?t.h=(e.g-e.b)/o:e.g===n?t.h=2+(e.b-e.r)/o:t.h=4+(e.r-e.g)/o:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB(e){var t={r:null,g:null,b:null},i=Math.round(e.h),n=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===n)t={r:o,g:o,b:o};else{var r=o,l=(255-n)*o/255,s=i%60*(r-l)/60;360===i&&(i=0),i<60?(t.r=r,t.b=l,t.g=l+s):i<120?(t.g=r,t.b=l,t.r=r-s):i<180?(t.g=r,t.r=l,t.b=l+s):i<240?(t.b=r,t.r=l,t.g=r-s):i<300?(t.b=r,t.g=l,t.r=l+s):i<360?(t.r=r,t.g=l,t.b=r-s):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var i in t)1===t[i].length&&(t[i]="0"+t[i]);return t.join("")},HSBtoHEX(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB(e){let t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter(t){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave(t){this.autoZIndex&&e.ZIndexUtils.clear(t)},alignOverlay(){this.appendDisabled?e.DomHandler.relativePosition(this.picker,this.$refs.input):e.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown(e){switch(e.which){case 32:this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case 27:case 9:this.overlayVisible=!1}},onColorMousedown(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart(t){this.disabled||(this.colorDragging=!0,this.pickColor(t),e.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),t.preventDefault())},onDrag(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd(){this.colorDragging=!1,this.hueDragging=!1,e.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart(t){this.disabled||(this.hueDragging=!0,this.pickHue(t),e.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.picker&&!this.picker.contains(e.target)&&!this.isInputClicked(e)&&(this.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&(this.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&(this.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef(e){this.picker=e},colorSelectorRef(e){this.colorSelector=e},colorHandleRef(e){this.colorHandle=e},hueViewRef(e){this.hueView=e},hueHandleRef(e){this.hueHandle=e},clearRefs(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick(e){o.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-colorpicker p-component",{"p-colorpicker-overlay":!this.inline}]},inputClass(){return["p-colorpicker-preview p-inputtext",{"p-disabled":this.disabled}]},pickerClass(){return["p-colorpicker-panel",this.panelClass,{"p-colorpicker-overlay-panel":!this.inline,"p-disabled":this.disabled,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},appendDisabled(){return"self"===this.appendTo||this.inline},appendTarget(){return this.appendDisabled?null:this.appendTo}}};const l={class:"p-colorpicker-content"},s={class:"p-colorpicker-color"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: .85;\n cursor: pointer;\n}\n"),r.render=function(e,t,n,o,r,a){return i.openBlock(),i.createBlock("div",{ref:"container",class:a.containerClass},[n.inline?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock("input",{key:0,ref:"input",type:"text",class:a.inputClass,readonly:"readonly",tabindex:n.tabindex,disabled:n.disabled,onClick:t[1]||(t[1]=(...e)=>a.onInputClick&&a.onInputClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>a.onInputKeydown&&a.onInputKeydown(...e)),"aria-labelledby":n.ariaLabelledBy},null,42,["tabindex","disabled","aria-labelledby"])),(i.openBlock(),i.createBlock(i.Teleport,{to:a.appendTarget,disabled:a.appendDisabled},[i.createVNode(i.Transition,{name:"p-connected-overlay",onEnter:a.onOverlayEnter,onLeave:a.onOverlayLeave,onAfterLeave:a.onOverlayAfterLeave},{default:i.withCtx((()=>[n.inline||r.overlayVisible?(i.openBlock(),i.createBlock("div",{key:0,ref:a.pickerRef,class:a.pickerClass,onClick:t[11]||(t[11]=(...e)=>a.onOverlayClick&&a.onOverlayClick(...e))},[i.createVNode("div",l,[i.createVNode("div",{ref:a.colorSelectorRef,class:"p-colorpicker-color-selector",onMousedown:t[3]||(t[3]=e=>a.onColorMousedown(e)),onTouchstart:t[4]||(t[4]=e=>a.onColorDragStart(e)),onTouchmove:t[5]||(t[5]=e=>a.onDrag(e)),onTouchend:t[6]||(t[6]=e=>a.onDragEnd())},[i.createVNode("div",s,[i.createVNode("div",{ref:a.colorHandleRef,class:"p-colorpicker-color-handle"},null,512)])],544),i.createVNode("div",{ref:a.hueViewRef,class:"p-colorpicker-hue",onMousedown:t[7]||(t[7]=e=>a.onHueMousedown(e)),onTouchstart:t[8]||(t[8]=e=>a.onHueDragStart(e)),onTouchmove:t[9]||(t[9]=e=>a.onDrag(e)),onTouchend:t[10]||(t[10]=e=>a.onDragEnd())},[i.createVNode("div",{ref:a.hueHandleRef,class:"p-colorpicker-hue-handle"},null,512)],544)])],2)):i.createCommentVNode("",!0)])),_:1},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)},module.exports=r;
|
|
@@ -4,7 +4,7 @@ import { openBlock, createBlock, createCommentVNode, Teleport, createVNode, Tran
|
|
|
4
4
|
|
|
5
5
|
var script = {
|
|
6
6
|
name: 'ColorPicker',
|
|
7
|
-
emits: ['update:modelValue'],
|
|
7
|
+
emits: ['update:modelValue', 'change', 'show', 'hide'],
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {
|
|
10
10
|
type: null,
|
|
@@ -116,6 +116,7 @@ var script = {
|
|
|
116
116
|
this.updateColorHandle();
|
|
117
117
|
this.updateInput();
|
|
118
118
|
this.updateModel();
|
|
119
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
119
120
|
},
|
|
120
121
|
pickHue(event) {
|
|
121
122
|
let top = this.hueView.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
|
|
@@ -130,6 +131,7 @@ var script = {
|
|
|
130
131
|
this.updateHue();
|
|
131
132
|
this.updateModel();
|
|
132
133
|
this.updateInput();
|
|
134
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
133
135
|
},
|
|
134
136
|
updateModel() {
|
|
135
137
|
switch(this.format) {
|
|
@@ -322,12 +324,15 @@ var script = {
|
|
|
322
324
|
if (this.autoZIndex) {
|
|
323
325
|
ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
324
326
|
}
|
|
327
|
+
|
|
328
|
+
this.$emit('show');
|
|
325
329
|
},
|
|
326
330
|
onOverlayLeave() {
|
|
327
331
|
this.unbindOutsideClickListener();
|
|
328
332
|
this.unbindScrollListener();
|
|
329
333
|
this.unbindResizeListener();
|
|
330
334
|
this.clearRefs();
|
|
335
|
+
this.$emit('hide');
|
|
331
336
|
},
|
|
332
337
|
onOverlayAfterLeave(el) {
|
|
333
338
|
if (this.autoZIndex) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ZIndexUtils as e,DomHandler as t,ConnectedOverlayScrollHandler as i}from"primevue/utils";import n from"primevue/overlayeventbus";import{openBlock as o,createBlock as s,createCommentVNode as r,Teleport as l,createVNode as a,Transition as d,withCtx as h}from"vue";var u={name:"ColorPicker",emits:["update:modelValue"],props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},ariaLabelledBy:{type:String,default:null},appendTo:{type:String,default:"body"},panelClass:null},data:()=>({overlayVisible:!1}),hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&e.clear(this.picker),this.clearRefs()},mounted(){this.updateUI()},watch:{modelValue:{immediate:!0,handler(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},methods:{pickColor(e){let t=this.colorSelector.getBoundingClientRect(),i=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),n=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-n))/150),s=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-i)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:s}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel()},pickHue(e){let t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput()},updateModel(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector(){if(this.colorSelector){let e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:e=>({h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}),validateRGB:e=>({r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}),validateHEX(e){var t=6-e.length;if(t>0){for(var i=[],n=0;n<t;n++)i.push("0");i.push(e),e=i.join("")}return e},HEXtoRGB(e){let t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB(e){var t={h:0,s:0,b:0},i=Math.min(e.r,e.g,e.b),n=Math.max(e.r,e.g,e.b),o=n-i;return t.b=n,t.s=0!==n?255*o/n:0,0!==t.s?e.r===n?t.h=(e.g-e.b)/o:e.g===n?t.h=2+(e.b-e.r)/o:t.h=4+(e.r-e.g)/o:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB(e){var t={r:null,g:null,b:null},i=Math.round(e.h),n=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===n)t={r:o,g:o,b:o};else{var s=o,r=(255-n)*o/255,l=i%60*(s-r)/60;360===i&&(i=0),i<60?(t.r=s,t.b=r,t.g=r+l):i<120?(t.g=s,t.b=r,t.r=s-l):i<180?(t.g=s,t.r=r,t.b=r+l):i<240?(t.b=s,t.r=r,t.g=s-l):i<300?(t.b=s,t.g=r,t.r=r+l):i<360?(t.r=s,t.g=r,t.b=s-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var i in t)1===t[i].length&&(t[i]="0"+t[i]);return t.join("")},HSBtoHEX(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB(e){let t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter(t){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&e.set("overlay",t,this.$primevue.config.zIndex.overlay)},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs()},onOverlayAfterLeave(t){this.autoZIndex&&e.clear(t)},alignOverlay(){this.appendDisabled?t.relativePosition(this.picker,this.$refs.input):t.absolutePosition(this.picker,this.$refs.input)},onInputClick(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown(e){switch(e.which){case 32:this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case 27:case 9:this.overlayVisible=!1}},onColorMousedown(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),t.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd(){this.colorDragging=!1,this.hueDragging=!1,t.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),t.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.picker&&!this.picker.contains(e.target)&&!this.isInputClicked(e)&&(this.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i(this.$refs.container,(()=>{this.overlayVisible&&(this.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&(this.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef(e){this.picker=e},colorSelectorRef(e){this.colorSelector=e},colorHandleRef(e){this.colorHandle=e},hueViewRef(e){this.hueView=e},hueHandleRef(e){this.hueHandle=e},clearRefs(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-colorpicker p-component",{"p-colorpicker-overlay":!this.inline}]},inputClass(){return["p-colorpicker-preview p-inputtext",{"p-disabled":this.disabled}]},pickerClass(){return["p-colorpicker-panel",this.panelClass,{"p-colorpicker-overlay-panel":!this.inline,"p-disabled":this.disabled,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},appendDisabled(){return"self"===this.appendTo||this.inline},appendTarget(){return this.appendDisabled?null:this.appendTo}}};const p={class:"p-colorpicker-content"},c={class:"p-colorpicker-color"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: .85;\n cursor: pointer;\n}\n"),u.render=function(e,t,i,n,u,b){return o(),s("div",{ref:"container",class:b.containerClass},[i.inline?r("",!0):(o(),s("input",{key:0,ref:"input",type:"text",class:b.inputClass,readonly:"readonly",tabindex:i.tabindex,disabled:i.disabled,onClick:t[1]||(t[1]=(...e)=>b.onInputClick&&b.onInputClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>b.onInputKeydown&&b.onInputKeydown(...e)),"aria-labelledby":i.ariaLabelledBy},null,42,["tabindex","disabled","aria-labelledby"])),(o(),s(l,{to:b.appendTarget,disabled:b.appendDisabled},[a(d,{name:"p-connected-overlay",onEnter:b.onOverlayEnter,onLeave:b.onOverlayLeave,onAfterLeave:b.onOverlayAfterLeave},{default:h((()=>[i.inline||u.overlayVisible?(o(),s("div",{key:0,ref:b.pickerRef,class:b.pickerClass,onClick:t[11]||(t[11]=(...e)=>b.onOverlayClick&&b.onOverlayClick(...e))},[a("div",p,[a("div",{ref:b.colorSelectorRef,class:"p-colorpicker-color-selector",onMousedown:t[3]||(t[3]=e=>b.onColorMousedown(e)),onTouchstart:t[4]||(t[4]=e=>b.onColorDragStart(e)),onTouchmove:t[5]||(t[5]=e=>b.onDrag(e)),onTouchend:t[6]||(t[6]=e=>b.onDragEnd())},[a("div",c,[a("div",{ref:b.colorHandleRef,class:"p-colorpicker-color-handle"},null,512)])],544),a("div",{ref:b.hueViewRef,class:"p-colorpicker-hue",onMousedown:t[7]||(t[7]=e=>b.onHueMousedown(e)),onTouchstart:t[8]||(t[8]=e=>b.onHueDragStart(e)),onTouchmove:t[9]||(t[9]=e=>b.onDrag(e)),onTouchend:t[10]||(t[10]=e=>b.onDragEnd())},[a("div",{ref:b.hueHandleRef,class:"p-colorpicker-hue-handle"},null,512)],544)])],2)):r("",!0)])),_:1},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)};export default u;
|
|
1
|
+
import{ZIndexUtils as e,DomHandler as t,ConnectedOverlayScrollHandler as i}from"primevue/utils";import n from"primevue/overlayeventbus";import{openBlock as o,createBlock as s,createCommentVNode as l,Teleport as r,createVNode as a,Transition as h,withCtx as d}from"vue";var u={name:"ColorPicker",emits:["update:modelValue","change","show","hide"],props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},ariaLabelledBy:{type:String,default:null},appendTo:{type:String,default:"body"},panelClass:null},data:()=>({overlayVisible:!1}),hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&e.clear(this.picker),this.clearRefs()},mounted(){this.updateUI()},watch:{modelValue:{immediate:!0,handler(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},methods:{pickColor(e){let t=this.colorSelector.getBoundingClientRect(),i=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),n=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-n))/150),s=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-i)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:s}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue(e){let t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector(){if(this.colorSelector){let e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:e=>({h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}),validateRGB:e=>({r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}),validateHEX(e){var t=6-e.length;if(t>0){for(var i=[],n=0;n<t;n++)i.push("0");i.push(e),e=i.join("")}return e},HEXtoRGB(e){let t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB(e){var t={h:0,s:0,b:0},i=Math.min(e.r,e.g,e.b),n=Math.max(e.r,e.g,e.b),o=n-i;return t.b=n,t.s=0!==n?255*o/n:0,0!==t.s?e.r===n?t.h=(e.g-e.b)/o:e.g===n?t.h=2+(e.b-e.r)/o:t.h=4+(e.r-e.g)/o:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB(e){var t={r:null,g:null,b:null},i=Math.round(e.h),n=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===n)t={r:o,g:o,b:o};else{var s=o,l=(255-n)*o/255,r=i%60*(s-l)/60;360===i&&(i=0),i<60?(t.r=s,t.b=l,t.g=l+r):i<120?(t.g=s,t.b=l,t.r=s-r):i<180?(t.g=s,t.r=l,t.b=l+r):i<240?(t.b=s,t.r=l,t.g=s-r):i<300?(t.b=s,t.g=l,t.r=l+r):i<360?(t.r=s,t.g=l,t.b=s-r):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var i in t)1===t[i].length&&(t[i]="0"+t[i]);return t.join("")},HSBtoHEX(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB(e){let t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter(t){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&e.set("overlay",t,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave(t){this.autoZIndex&&e.clear(t)},alignOverlay(){this.appendDisabled?t.relativePosition(this.picker,this.$refs.input):t.absolutePosition(this.picker,this.$refs.input)},onInputClick(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown(e){switch(e.which){case 32:this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case 27:case 9:this.overlayVisible=!1}},onColorMousedown(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),t.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd(){this.colorDragging=!1,this.hueDragging=!1,t.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),t.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.picker&&!this.picker.contains(e.target)&&!this.isInputClicked(e)&&(this.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i(this.$refs.container,(()=>{this.overlayVisible&&(this.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&(this.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef(e){this.picker=e},colorSelectorRef(e){this.colorSelector=e},colorHandleRef(e){this.colorHandle=e},hueViewRef(e){this.hueView=e},hueHandleRef(e){this.hueHandle=e},clearRefs(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-colorpicker p-component",{"p-colorpicker-overlay":!this.inline}]},inputClass(){return["p-colorpicker-preview p-inputtext",{"p-disabled":this.disabled}]},pickerClass(){return["p-colorpicker-panel",this.panelClass,{"p-colorpicker-overlay-panel":!this.inline,"p-disabled":this.disabled,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},appendDisabled(){return"self"===this.appendTo||this.inline},appendTarget(){return this.appendDisabled?null:this.appendTo}}};const p={class:"p-colorpicker-content"},c={class:"p-colorpicker-color"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: .85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: .85;\n cursor: pointer;\n}\n"),u.render=function(e,t,i,n,u,b){return o(),s("div",{ref:"container",class:b.containerClass},[i.inline?l("",!0):(o(),s("input",{key:0,ref:"input",type:"text",class:b.inputClass,readonly:"readonly",tabindex:i.tabindex,disabled:i.disabled,onClick:t[1]||(t[1]=(...e)=>b.onInputClick&&b.onInputClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>b.onInputKeydown&&b.onInputKeydown(...e)),"aria-labelledby":i.ariaLabelledBy},null,42,["tabindex","disabled","aria-labelledby"])),(o(),s(r,{to:b.appendTarget,disabled:b.appendDisabled},[a(h,{name:"p-connected-overlay",onEnter:b.onOverlayEnter,onLeave:b.onOverlayLeave,onAfterLeave:b.onOverlayAfterLeave},{default:d((()=>[i.inline||u.overlayVisible?(o(),s("div",{key:0,ref:b.pickerRef,class:b.pickerClass,onClick:t[11]||(t[11]=(...e)=>b.onOverlayClick&&b.onOverlayClick(...e))},[a("div",p,[a("div",{ref:b.colorSelectorRef,class:"p-colorpicker-color-selector",onMousedown:t[3]||(t[3]=e=>b.onColorMousedown(e)),onTouchstart:t[4]||(t[4]=e=>b.onColorDragStart(e)),onTouchmove:t[5]||(t[5]=e=>b.onDrag(e)),onTouchend:t[6]||(t[6]=e=>b.onDragEnd())},[a("div",c,[a("div",{ref:b.colorHandleRef,class:"p-colorpicker-color-handle"},null,512)])],544),a("div",{ref:b.hueViewRef,class:"p-colorpicker-hue",onMousedown:t[7]||(t[7]=e=>b.onHueMousedown(e)),onTouchstart:t[8]||(t[8]=e=>b.onHueDragStart(e)),onTouchmove:t[9]||(t[9]=e=>b.onDrag(e)),onTouchend:t[10]||(t[10]=e=>b.onDragEnd())},[a("div",{ref:b.hueHandleRef,class:"p-colorpicker-hue-handle"},null,512)],544)])],2)):l("",!0)])),_:1},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)};export default u;
|
|
@@ -8,7 +8,7 @@ this.primevue.colorpicker = (function (utils, OverlayEventBus, vue) {
|
|
|
8
8
|
|
|
9
9
|
var script = {
|
|
10
10
|
name: 'ColorPicker',
|
|
11
|
-
emits: ['update:modelValue'],
|
|
11
|
+
emits: ['update:modelValue', 'change', 'show', 'hide'],
|
|
12
12
|
props: {
|
|
13
13
|
modelValue: {
|
|
14
14
|
type: null,
|
|
@@ -120,6 +120,7 @@ this.primevue.colorpicker = (function (utils, OverlayEventBus, vue) {
|
|
|
120
120
|
this.updateColorHandle();
|
|
121
121
|
this.updateInput();
|
|
122
122
|
this.updateModel();
|
|
123
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
123
124
|
},
|
|
124
125
|
pickHue(event) {
|
|
125
126
|
let top = this.hueView.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
|
|
@@ -134,6 +135,7 @@ this.primevue.colorpicker = (function (utils, OverlayEventBus, vue) {
|
|
|
134
135
|
this.updateHue();
|
|
135
136
|
this.updateModel();
|
|
136
137
|
this.updateInput();
|
|
138
|
+
this.$emit('change', {event: event, value: this.modelValue});
|
|
137
139
|
},
|
|
138
140
|
updateModel() {
|
|
139
141
|
switch(this.format) {
|
|
@@ -326,12 +328,15 @@ this.primevue.colorpicker = (function (utils, OverlayEventBus, vue) {
|
|
|
326
328
|
if (this.autoZIndex) {
|
|
327
329
|
utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
328
330
|
}
|
|
331
|
+
|
|
332
|
+
this.$emit('show');
|
|
329
333
|
},
|
|
330
334
|
onOverlayLeave() {
|
|
331
335
|
this.unbindOutsideClickListener();
|
|
332
336
|
this.unbindScrollListener();
|
|
333
337
|
this.unbindResizeListener();
|
|
334
338
|
this.clearRefs();
|
|
339
|
+
this.$emit('hide');
|
|
335
340
|
},
|
|
336
341
|
onOverlayAfterLeave(el) {
|
|
337
342
|
if (this.autoZIndex) {
|