primevue 3.27.0 → 3.28.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 +1 -1
- package/autocomplete/AutoComplete.d.ts +10 -1
- package/autocomplete/AutoComplete.vue +1 -1
- package/autocomplete/autocomplete.cjs.js +4 -1
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +4 -1
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +4 -1
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +44 -0
- package/avatar/Avatar.vue +10 -8
- package/avatar/avatar.cjs.js +36 -34
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +33 -35
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +37 -36
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +27 -1
- package/avatargroup/AvatarGroup.vue +5 -2
- package/avatargroup/avatargroup.cjs.js +9 -5
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +6 -6
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +10 -7
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/Badge.d.ts +32 -0
- package/badge/Badge.vue +3 -1
- package/badge/badge.cjs.js +8 -4
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +5 -5
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +9 -6
- package/badge/badge.min.js +1 -1
- package/basecomponent/BaseComponent.vue +10 -3
- package/basecomponent/basecomponent.cjs.js +10 -3
- package/basecomponent/basecomponent.cjs.min.js +1 -1
- package/basecomponent/basecomponent.esm.js +10 -3
- package/basecomponent/basecomponent.esm.min.js +1 -1
- package/basecomponent/basecomponent.js +10 -3
- package/basecomponent/basecomponent.min.js +1 -1
- package/baseicon/BaseIcon.vue +2 -2
- package/baseicon/baseicon.cjs.js +2 -2
- package/baseicon/baseicon.cjs.min.js +1 -1
- package/baseicon/baseicon.esm.js +2 -2
- package/baseicon/baseicon.esm.min.js +1 -1
- package/baseicon/baseicon.js +2 -2
- package/baseicon/baseicon.min.js +1 -1
- package/blockui/BlockUI.d.ts +44 -0
- package/blockui/BlockUI.vue +3 -1
- package/blockui/blockui.cjs.js +9 -3
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +6 -4
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +10 -5
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/Breadcrumb.d.ts +60 -0
- package/breadcrumb/Breadcrumb.vue +8 -6
- package/breadcrumb/BreadcrumbItem.vue +14 -10
- package/breadcrumb/breadcrumb.cjs.js +53 -51
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +53 -52
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +54 -53
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/Button.d.ts +48 -0
- package/button/Button.vue +10 -9
- package/button/button.cjs.js +43 -44
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +43 -45
- package/button/button.esm.min.js +1 -1
- package/button/button.js +44 -46
- package/button/button.min.js +1 -1
- package/chart/Chart.d.ts +36 -0
- package/chart/Chart.vue +5 -2
- package/chart/chart.cjs.js +10 -5
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +7 -6
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +11 -7
- package/chart/chart.min.js +1 -1
- package/chip/Chip.d.ts +60 -0
- package/chip/Chip.vue +10 -9
- package/chip/chip.cjs.js +35 -36
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +35 -37
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +36 -38
- package/chip/chip.min.js +1 -1
- package/config/PrimeVue.d.ts +8 -0
- package/config/config.cjs.js +3 -1
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +3 -2
- package/config/config.esm.min.js +1 -1
- package/config/config.js +3 -1
- package/config/config.min.js +1 -1
- package/confirmdialog/ConfirmDialog.d.ts +88 -0
- package/confirmdialog/ConfirmDialog.vue +9 -6
- package/confirmdialog/confirmdialog.cjs.js +22 -18
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +22 -19
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +23 -20
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +75 -0
- package/confirmpopup/ConfirmPopup.vue +11 -9
- package/confirmpopup/confirmpopup.cjs.js +27 -25
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +27 -26
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +28 -27
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +135 -0
- package/contextmenu/ContextMenu.vue +4 -1
- package/contextmenu/ContextMenuSub.vue +46 -10
- package/contextmenu/contextmenu.cjs.js +57 -46
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +57 -47
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +58 -48
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +278 -246
- package/core/core.min.js +11 -11
- package/dialog/Dialog.d.ts +87 -0
- package/dialog/Dialog.vue +23 -10
- package/dialog/dialog.cjs.js +31 -30
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +31 -31
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +32 -32
- package/dialog/dialog.min.js +1 -1
- package/dock/Dock.d.ts +94 -0
- package/dock/Dock.vue +4 -2
- package/dock/DockSub.vue +30 -6
- package/dock/dock.cjs.js +52 -39
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +52 -40
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +53 -41
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.vue +1 -1
- package/dropdown/dropdown.cjs.js +1 -1
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +1 -1
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +1 -1
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.vue +3 -1
- package/dynamicdialog/dynamicdialog.cjs.js +5 -1
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +4 -1
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +6 -3
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/fileupload/FileContent.vue +11 -9
- package/fileupload/FileUpload.d.ts +154 -0
- package/fileupload/FileUpload.vue +26 -24
- package/fileupload/fileupload.cjs.js +100 -97
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +100 -98
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +101 -99
- package/fileupload/fileupload.min.js +1 -1
- package/inlinemessage/InlineMessage.d.ts +52 -0
- package/inlinemessage/InlineMessage.vue +7 -3
- package/inlinemessage/inlinemessage.cjs.js +12 -11
- package/inlinemessage/inlinemessage.cjs.min.js +1 -1
- package/inlinemessage/inlinemessage.esm.js +12 -12
- package/inlinemessage/inlinemessage.esm.min.js +1 -1
- package/inlinemessage/inlinemessage.js +13 -13
- package/inlinemessage/inlinemessage.min.js +1 -1
- package/inplace/Inplace.d.ts +59 -0
- package/inplace/Inplace.vue +7 -5
- package/inplace/inplace.cjs.js +17 -16
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +17 -17
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +18 -18
- package/inplace/inplace.min.js +1 -1
- package/listbox/Listbox.d.ts +1 -1
- package/megamenu/MegaMenu.d.ts +149 -0
- package/megamenu/MegaMenu.vue +6 -3
- package/megamenu/MegaMenuSub.vue +43 -15
- package/megamenu/megamenu.cjs.js +83 -75
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +83 -76
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +84 -77
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +113 -0
- package/menu/Menu.vue +11 -8
- package/menu/Menuitem.vue +20 -8
- package/menu/menu.cjs.js +73 -62
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +73 -63
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +74 -64
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +146 -0
- package/menubar/Menubar.vue +8 -5
- package/menubar/MenubarSub.vue +38 -10
- package/menubar/menubar.cjs.js +70 -60
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +70 -61
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +71 -62
- package/menubar/menubar.min.js +1 -1
- package/message/Message.d.ts +64 -1
- package/message/Message.vue +9 -7
- package/message/message.cjs.js +22 -21
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +22 -22
- package/message/message.esm.min.js +1 -1
- package/message/message.js +23 -23
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +1 -1
- package/overlaypanel/OverlayPanel.d.ts +56 -0
- package/overlaypanel/OverlayPanel.vue +6 -4
- package/overlaypanel/overlaypanel.cjs.js +13 -10
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +13 -11
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +14 -12
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/panel/Panel.d.ts +10 -1
- package/panel/Panel.vue +1 -1
- package/panel/panel.cjs.js +4 -1
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +4 -1
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +4 -1
- package/panel/panel.min.js +1 -1
- package/panelmenu/PanelMenu.d.ts +133 -0
- package/panelmenu/PanelMenu.vue +36 -13
- package/panelmenu/PanelMenuList.vue +3 -0
- package/panelmenu/PanelMenuSub.vue +33 -12
- package/panelmenu/panelmenu.cjs.js +115 -96
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +115 -97
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +116 -98
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/Password.vue +2 -2
- package/password/password.cjs.js +2 -2
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -2
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -2
- package/password/password.min.js +1 -1
- package/progressbar/ProgressBar.d.ts +40 -0
- package/progressbar/ProgressBar.vue +8 -5
- package/progressbar/progressbar.cjs.js +25 -23
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +22 -24
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +26 -25
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/ProgressSpinner.d.ts +40 -0
- package/progressspinner/ProgressSpinner.vue +6 -3
- package/progressspinner/progressspinner.cjs.js +18 -13
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +15 -14
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +19 -15
- package/progressspinner/progressspinner.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +1 -1
- package/resources/themes/arya-green/theme.css +1 -1
- package/resources/themes/arya-orange/theme.css +1 -1
- package/resources/themes/arya-purple/theme.css +1 -1
- package/resources/themes/bootstrap4-dark-blue/theme.css +1 -1
- package/resources/themes/bootstrap4-dark-purple/theme.css +1 -1
- package/resources/themes/bootstrap4-light-blue/theme.css +1 -1
- package/resources/themes/bootstrap4-light-purple/theme.css +1 -1
- package/resources/themes/fluent-light/theme.css +1 -1
- package/resources/themes/lara-dark-blue/theme.css +1 -1
- package/resources/themes/lara-dark-indigo/theme.css +1 -1
- package/resources/themes/lara-dark-purple/theme.css +1 -1
- package/resources/themes/lara-dark-teal/theme.css +1 -1
- package/resources/themes/lara-light-blue/theme.css +1 -1
- package/resources/themes/lara-light-indigo/theme.css +1 -1
- package/resources/themes/lara-light-purple/theme.css +1 -1
- package/resources/themes/lara-light-teal/theme.css +1 -1
- package/resources/themes/luna-amber/theme.css +1 -1
- package/resources/themes/luna-blue/theme.css +1 -1
- package/resources/themes/luna-green/theme.css +1 -1
- package/resources/themes/luna-pink/theme.css +1 -1
- package/resources/themes/md-dark-deeppurple/theme.css +4 -1
- package/resources/themes/md-dark-indigo/theme.css +4 -1
- package/resources/themes/md-light-deeppurple/theme.css +4 -1
- package/resources/themes/md-light-indigo/theme.css +4 -1
- package/resources/themes/mdc-dark-deeppurple/theme.css +4 -1
- package/resources/themes/mdc-dark-indigo/theme.css +4 -1
- package/resources/themes/mdc-light-deeppurple/theme.css +4 -1
- package/resources/themes/mdc-light-indigo/theme.css +4 -1
- package/resources/themes/mira/theme.css +1 -1
- package/resources/themes/nano/theme.css +1 -1
- package/resources/themes/nova/theme.css +1 -1
- package/resources/themes/nova-accent/theme.css +1 -1
- package/resources/themes/nova-alt/theme.css +1 -1
- package/resources/themes/nova-vue/theme.css +1 -1
- package/resources/themes/rhea/theme.css +1 -1
- package/resources/themes/saga-blue/theme.css +1 -1
- package/resources/themes/saga-green/theme.css +1 -1
- package/resources/themes/saga-orange/theme.css +1 -1
- package/resources/themes/saga-purple/theme.css +1 -1
- package/resources/themes/soho-dark/theme.css +1 -1
- package/resources/themes/soho-light/theme.css +1 -1
- package/resources/themes/tailwind-light/theme.css +1 -1
- package/resources/themes/vela-blue/theme.css +1 -1
- package/resources/themes/vela-green/theme.css +1 -1
- package/resources/themes/vela-orange/theme.css +1 -1
- package/resources/themes/vela-purple/theme.css +1 -1
- package/resources/themes/viva-dark/theme.css +1 -1
- package/resources/themes/viva-light/theme.css +1 -1
- package/scrolltop/ScrollTop.d.ts +48 -0
- package/scrolltop/ScrollTop.vue +5 -2
- package/scrolltop/scrolltop.cjs.js +10 -7
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +10 -8
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +11 -9
- package/scrolltop/scrolltop.min.js +1 -1
- package/sidebar/Sidebar.d.ts +68 -0
- package/sidebar/Sidebar.vue +9 -7
- package/sidebar/sidebar.cjs.js +26 -24
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +26 -25
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +27 -26
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +32 -0
- package/skeleton/Skeleton.vue +4 -1
- package/skeleton/skeleton.cjs.js +10 -4
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +7 -5
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +11 -6
- package/skeleton/skeleton.min.js +1 -1
- package/speeddial/SpeedDial.d.ts +101 -0
- package/speeddial/SpeedDial.vue +31 -8
- package/speeddial/speeddial.cjs.js +47 -33
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +47 -34
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +48 -35
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +64 -0
- package/splitbutton/SplitButton.vue +8 -5
- package/splitbutton/splitbutton.cjs.js +23 -18
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +23 -19
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +24 -20
- package/splitbutton/splitbutton.min.js +1 -1
- package/steps/Steps.d.ts +52 -0
- package/steps/Steps.vue +11 -8
- package/steps/steps.cjs.js +34 -33
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +31 -34
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +35 -35
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.d.ts +79 -0
- package/tabmenu/TabMenu.vue +20 -10
- package/tabmenu/tabmenu.cjs.js +47 -41
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +47 -42
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +48 -43
- package/tabmenu/tabmenu.min.js +1 -1
- package/tag/Tag.d.ts +40 -0
- package/tag/Tag.vue +7 -4
- package/tag/tag.cjs.js +14 -12
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +11 -13
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +15 -14
- package/tag/tag.min.js +1 -1
- package/terminal/Terminal.d.ts +79 -0
- package/terminal/Terminal.vue +12 -10
- package/terminal/terminal.cjs.js +23 -28
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +23 -29
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +24 -30
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/TieredMenu.d.ts +130 -0
- package/tieredmenu/TieredMenu.vue +4 -1
- package/tieredmenu/TieredMenuSub.vue +39 -11
- package/tieredmenu/tieredmenu.cjs.js +53 -41
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +53 -42
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +54 -43
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/Toast.d.ts +79 -0
- package/toast/Toast.vue +4 -1
- package/toast/ToastMessage.vue +12 -10
- package/toast/toast.cjs.js +31 -31
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +31 -32
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +32 -33
- package/toast/toast.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +1 -2
- package/vetur-attributes.json +160 -0
- package/vetur-tags.json +79 -34
- package/web-types.json +404 -2
package/dropdown/dropdown.js
CHANGED
|
@@ -802,7 +802,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
802
802
|
'p-disabled': this.disabled,
|
|
803
803
|
'p-dropdown-clearable': this.showClear && !this.disabled,
|
|
804
804
|
'p-focus': this.focused,
|
|
805
|
-
'p-inputwrapper-filled': this.
|
|
805
|
+
'p-inputwrapper-filled': this.hasSelectedOption,
|
|
806
806
|
'p-inputwrapper-focus': this.focused || this.overlayVisible,
|
|
807
807
|
'p-overlay-open': this.overlayVisible
|
|
808
808
|
}
|
package/dropdown/dropdown.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.dropdown=function(e,t,i,n,o,s,l,r,a,d,p){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(t),h=c(i),f=c(n),y=c(o),b=c(s),v=c(l),m=c(r),O=c(d),g={name:"Dropdown",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||a.UniqueComponentId()},modelValue(){this.isModelValueChanged=!0},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||a.UniqueComponentId(),this.autoUpdateModel()},updated(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(a.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?a.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?a.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,t){return(this.dataKey?a.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&a.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return a.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return a.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&a.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&a.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,this.editable);break;case"Home":this.onHomeKey(e,this.editable);break;case"End":this.onEndKey(e,this.editable);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Space":this.onSpaceKey(e,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&a.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(e,e.key))}},onEditableInput(e){const t=e.target.value;this.searchValue="";!this.searchOptions(e,t)&&(this.focusedOptionIndex=-1),this.updateModel(e,t)},onContainerClick(e){this.disabled||this.loading||a.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick(e){this.updateModel(e,null)},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?a.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?a.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.DomHandler.focus(t)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.updateModel(e,n),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){b.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e,t=!1){t&&(this.focusedOptionIndex=-1)},onHomeKey(e,t=!1){t?(e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),e.preventDefault()},onEndKey(e,t=!1){if(t){const t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onSpaceKey(e,t=!1){!t&&this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(a.DomHandler.focus(this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey(e,t=!1){t&&!this.overlayVisible&&this.show()},onOverlayEnter(e){a.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&a.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){a.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?a.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=a.DomHandler.getOuterWidth(this.$el)+"px",a.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new a.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!a.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return a.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.isValidOption(e)&&a.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return a.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?a.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionIndex?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionIndex&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=a.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-dropdown p-component p-inputwrapper",{"p-disabled":this.disabled,"p-dropdown-clearable":this.showClear&&!this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-dropdown-label p-inputtext",this.inputClass,{"p-placeholder":!this.editable&&this.label===this.placeholder,"p-dropdown-label-empty":!(this.editable||this.$slots.value||"p-emptylabel"!==this.label&&0!==this.label.length)}]},panelStyleClass(){return["p-dropdown-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const n=this.getOptionGroupChildren(e).filter((e=>i.includes(e)));n.length>0&&t.push({...e,["string"==typeof this.optionGroupChildren?this.optionGroupChildren:"items"]:[...n]})})),this.flatOptions(t)}return i}return t},hasSelectedOption(){return a.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.placeholder||"p-emptylabel"},editableInputValue(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.modelValue||""},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return a.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:m.default},components:{VirtualScroller:O.default,Portal:v.default,TimesIcon:y.default,ChevronDownIcon:u.default,SpinnerIcon:f.default,FilterIcon:h.default}};const x=["id"],I=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],w=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],S={class:"p-dropdown-trigger"},V={key:0,class:"p-dropdown-header"},k={class:"p-dropdown-filter-container"},C=["value","placeholder","aria-owns","aria-activedescendant"],F={role:"status","aria-live":"polite",class:"p-hidden-accessible"},L=["id"],D=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],K={key:0,class:"p-dropdown-empty-message",role:"option"},B={key:1,class:"p-dropdown-empty-message",role:"option"},M={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},T={role:"status","aria-live":"polite",class:"p-hidden-accessible"};return 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-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-dropdown-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-dropdown-label-empty {\n overflow: hidden;\n opacity: 0;\n}\ninput.p-dropdown-label {\n cursor: default;\n}\n.p-dropdown .p-dropdown-panel {\n min-width: 100%;\n}\n.p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-dropdown-items-wrapper {\n overflow: auto;\n}\n.p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-dropdown-item-group {\n cursor: auto;\n}\n.p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-dropdown-filter {\n width: 100%;\n}\n.p-dropdown-filter-container {\n position: relative;\n}\n.p-dropdown-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-fluid .p-dropdown {\n display: flex;\n}\n.p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n}\n"),g.render=function(e,t,i,n,o,s){const l=p.resolveComponent("SpinnerIcon"),r=p.resolveComponent("VirtualScroller"),a=p.resolveComponent("Portal"),d=p.resolveDirective("ripple");return p.openBlock(),p.createElementBlock("div",{ref:"container",id:o.id,class:p.normalizeClass(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.editable?(p.openBlock(),p.createElementBlock("input",p.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.editableInputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onEditableInput&&s.onEditableInput(...e))},i.inputProps),null,16,I)):(p.openBlock(),p.createElementBlock("span",p.mergeProps({key:1,ref:"focusInput",id:i.inputId,style:i.inputStyle,class:s.inputStyleClass,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===s.label?void 0:s.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[4]||(t[4]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[6]||(t[6]=(...e)=>s.onKeyDown&&s.onKeyDown(...e))},i.inputProps),[p.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[p.createTextVNode(p.toDisplayString("p-emptylabel"===s.label?" ":s.label||"empty"),1)]))],16,w)),i.showClear&&null!=i.modelValue?p.renderSlot(e.$slots,"clearicon",{key:2,onClick:s.onClearClick},(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(i.clearIcon?"i":"TimesIcon"),p.mergeProps({class:["p-dropdown-clear-icon",i.clearIcon],onClick:s.onClearClick},i.clearIconProps),null,16,["class","onClick"]))])):p.createCommentVNode("",!0),p.createElementVNode("div",S,[i.loading?p.renderSlot(e.$slots,"loadingicon",{key:0,class:"p-dropdown-trigger-icon"},(()=>[i.loadingIcon?(p.openBlock(),p.createElementBlock("span",{key:0,class:p.normalizeClass(["p-dropdown-trigger-icon pi-spin",i.loadingIcon]),"aria-hidden":"true"},null,2)):(p.openBlock(),p.createBlock(l,{key:1,class:"p-dropdown-trigger-icon",spin:"","aria-hidden":"true"}))])):p.renderSlot(e.$slots,"dropdownicon",{key:1,class:"p-dropdown-trigger-icon"},(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(i.dropdownIcon?"span":"ChevronDownIcon"),{class:p.normalizeClass(["p-dropdown-trigger-icon",i.dropdownIcon]),"aria-hidden":"true"},null,8,["class"]))]))]),p.createVNode(a,{appendTo:i.appendTo},{default:p.withCtx((()=>[p.createVNode(p.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:p.withCtx((()=>[o.overlayVisible?(p.openBlock(),p.createElementBlock("div",p.mergeProps({key:0,ref:s.overlayRef,style:i.panelStyle,class:s.panelStyleClass,onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[p.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[7]||(t[7]=(...e)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...e))},null,544),p.renderSlot(e.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.filter?(p.openBlock(),p.createElementBlock("div",V,[p.createElementVNode("div",k,[p.createElementVNode("input",p.mergeProps({ref:"filterInput",type:"text",value:o.filterValue,onVnodeUpdated:t[8]||(t[8]=(...e)=>s.onFilterUpdated&&s.onFilterUpdated(...e)),class:"p-dropdown-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:t[9]||(t[9]=(...e)=>s.onFilterKeyDown&&s.onFilterKeyDown(...e)),onBlur:t[10]||(t[10]=(...e)=>s.onFilterBlur&&s.onFilterBlur(...e)),onInput:t[11]||(t[11]=(...e)=>s.onFilterChange&&s.onFilterChange(...e))},i.filterInputProps),null,16,C),p.renderSlot(e.$slots,"filtericon",{},(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(i.filterIcon?"span":"FilterIcon"),{class:p.normalizeClass(["p-dropdown-filter-icon",i.filterIcon])},null,8,["class"]))]))]),p.createElementVNode("span",F,p.toDisplayString(s.filterResultMessageText),1)])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:"p-dropdown-items-wrapper",style:p.normalizeStyle({"max-height":s.virtualScrollerDisabled?i.scrollHeight:""})},[p.createVNode(r,p.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{items:s.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled}),p.createSlots({content:p.withCtx((({styleClass:t,contentRef:n,items:l,getItemOptions:r,contentStyle:a,itemSize:c})=>[p.createElementVNode("ul",{ref:e=>s.listRef(e,n),id:o.id+"_list",class:p.normalizeClass(["p-dropdown-items",t]),style:p.normalizeStyle(a),role:"listbox"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(l,((t,i)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,r))},[s.isOptionGroup(t)?(p.openBlock(),p.createElementBlock("li",{key:0,id:o.id+"_"+s.getOptionIndex(i,r),style:p.normalizeStyle({height:c?c+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[p.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:s.getOptionIndex(i,r)},(()=>[p.createTextVNode(p.toDisplayString(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,D)):p.withDirectives((p.openBlock(),p.createElementBlock("li",{key:1,id:o.id+"_"+s.getOptionIndex(i,r),style:p.normalizeStyle({height:c?c+"px":void 0}),class:p.normalizeClass(["p-dropdown-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,r),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,r)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,r))},[p.renderSlot(e.$slots,"option",{option:t,index:s.getOptionIndex(i,r)},(()=>[p.createTextVNode(p.toDisplayString(s.getOptionLabel(t)),1)]))],46,E)),[[d]])],64)))),128)),o.filterValue&&(!l||l&&0===l.length)?(p.openBlock(),p.createElementBlock("li",K,[p.renderSlot(e.$slots,"emptyfilter",{},(()=>[p.createTextVNode(p.toDisplayString(s.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(p.openBlock(),p.createElementBlock("li",B,[p.renderSlot(e.$slots,"empty",{},(()=>[p.createTextVNode(p.toDisplayString(s.emptyMessageText),1)]))])):p.createCommentVNode("",!0)],14,L)])),_:2},[e.$slots.loader?{name:"loader",fn:p.withCtx((({options:t})=>[p.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),p.renderSlot(e.$slots,"footer",{value:i.modelValue,options:s.visibleOptions}),!i.options||i.options&&0===i.options.length?(p.openBlock(),p.createElementBlock("span",M,p.toDisplayString(s.emptyMessageText),1)):p.createCommentVNode("",!0),p.createElementVNode("span",T,p.toDisplayString(s.selectedMessageText),1),p.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=(...e)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...e))},null,544)],16)):p.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],10,x)},g}(primevue.api,primevue.icons.chevrondown,primevue.icons.filter,primevue.icons.spinner,primevue.icons.times,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.dropdown=function(e,t,i,n,o,s,l,r,a,d,p){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(t),h=c(i),f=c(n),y=c(o),b=c(s),v=c(l),m=c(r),O=c(d),g={name:"Dropdown",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||a.UniqueComponentId()},modelValue(){this.isModelValueChanged=!0},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||a.UniqueComponentId(),this.autoUpdateModel()},updated(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(a.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?a.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?a.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,t){return(this.dataKey?a.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&a.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return a.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return a.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&a.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&a.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,this.editable);break;case"Home":this.onHomeKey(e,this.editable);break;case"End":this.onEndKey(e,this.editable);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Space":this.onSpaceKey(e,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&a.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(e,e.key))}},onEditableInput(e){const t=e.target.value;this.searchValue="";!this.searchOptions(e,t)&&(this.focusedOptionIndex=-1),this.updateModel(e,t)},onContainerClick(e){this.disabled||this.loading||a.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick(e){this.updateModel(e,null)},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?a.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?a.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.DomHandler.focus(t)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.updateModel(e,n),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){b.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e,t=!1){t&&(this.focusedOptionIndex=-1)},onHomeKey(e,t=!1){t?(e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),e.preventDefault()},onEndKey(e,t=!1){if(t){const t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onSpaceKey(e,t=!1){!t&&this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(a.DomHandler.focus(this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey(e,t=!1){t&&!this.overlayVisible&&this.show()},onOverlayEnter(e){a.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&a.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){a.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?a.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=a.DomHandler.getOuterWidth(this.$el)+"px",a.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new a.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!a.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return a.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.isValidOption(e)&&a.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return a.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?a.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionIndex?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionIndex&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=a.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-dropdown p-component p-inputwrapper",{"p-disabled":this.disabled,"p-dropdown-clearable":this.showClear&&!this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.hasSelectedOption,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-dropdown-label p-inputtext",this.inputClass,{"p-placeholder":!this.editable&&this.label===this.placeholder,"p-dropdown-label-empty":!(this.editable||this.$slots.value||"p-emptylabel"!==this.label&&0!==this.label.length)}]},panelStyleClass(){return["p-dropdown-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const n=this.getOptionGroupChildren(e).filter((e=>i.includes(e)));n.length>0&&t.push({...e,["string"==typeof this.optionGroupChildren?this.optionGroupChildren:"items"]:[...n]})})),this.flatOptions(t)}return i}return t},hasSelectedOption(){return a.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.placeholder||"p-emptylabel"},editableInputValue(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.modelValue||""},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return a.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:m.default},components:{VirtualScroller:O.default,Portal:v.default,TimesIcon:y.default,ChevronDownIcon:u.default,SpinnerIcon:f.default,FilterIcon:h.default}};const x=["id"],I=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],w=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],S={class:"p-dropdown-trigger"},V={key:0,class:"p-dropdown-header"},k={class:"p-dropdown-filter-container"},C=["value","placeholder","aria-owns","aria-activedescendant"],F={role:"status","aria-live":"polite",class:"p-hidden-accessible"},L=["id"],D=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],K={key:0,class:"p-dropdown-empty-message",role:"option"},B={key:1,class:"p-dropdown-empty-message",role:"option"},M={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},T={role:"status","aria-live":"polite",class:"p-hidden-accessible"};return 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-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-dropdown-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-dropdown-label-empty {\n overflow: hidden;\n opacity: 0;\n}\ninput.p-dropdown-label {\n cursor: default;\n}\n.p-dropdown .p-dropdown-panel {\n min-width: 100%;\n}\n.p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-dropdown-items-wrapper {\n overflow: auto;\n}\n.p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-dropdown-item-group {\n cursor: auto;\n}\n.p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-dropdown-filter {\n width: 100%;\n}\n.p-dropdown-filter-container {\n position: relative;\n}\n.p-dropdown-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-fluid .p-dropdown {\n display: flex;\n}\n.p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n}\n"),g.render=function(e,t,i,n,o,s){const l=p.resolveComponent("SpinnerIcon"),r=p.resolveComponent("VirtualScroller"),a=p.resolveComponent("Portal"),d=p.resolveDirective("ripple");return p.openBlock(),p.createElementBlock("div",{ref:"container",id:o.id,class:p.normalizeClass(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.editable?(p.openBlock(),p.createElementBlock("input",p.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.editableInputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onEditableInput&&s.onEditableInput(...e))},i.inputProps),null,16,I)):(p.openBlock(),p.createElementBlock("span",p.mergeProps({key:1,ref:"focusInput",id:i.inputId,style:i.inputStyle,class:s.inputStyleClass,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===s.label?void 0:s.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[4]||(t[4]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[6]||(t[6]=(...e)=>s.onKeyDown&&s.onKeyDown(...e))},i.inputProps),[p.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[p.createTextVNode(p.toDisplayString("p-emptylabel"===s.label?" ":s.label||"empty"),1)]))],16,w)),i.showClear&&null!=i.modelValue?p.renderSlot(e.$slots,"clearicon",{key:2,onClick:s.onClearClick},(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(i.clearIcon?"i":"TimesIcon"),p.mergeProps({class:["p-dropdown-clear-icon",i.clearIcon],onClick:s.onClearClick},i.clearIconProps),null,16,["class","onClick"]))])):p.createCommentVNode("",!0),p.createElementVNode("div",S,[i.loading?p.renderSlot(e.$slots,"loadingicon",{key:0,class:"p-dropdown-trigger-icon"},(()=>[i.loadingIcon?(p.openBlock(),p.createElementBlock("span",{key:0,class:p.normalizeClass(["p-dropdown-trigger-icon pi-spin",i.loadingIcon]),"aria-hidden":"true"},null,2)):(p.openBlock(),p.createBlock(l,{key:1,class:"p-dropdown-trigger-icon",spin:"","aria-hidden":"true"}))])):p.renderSlot(e.$slots,"dropdownicon",{key:1,class:"p-dropdown-trigger-icon"},(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(i.dropdownIcon?"span":"ChevronDownIcon"),{class:p.normalizeClass(["p-dropdown-trigger-icon",i.dropdownIcon]),"aria-hidden":"true"},null,8,["class"]))]))]),p.createVNode(a,{appendTo:i.appendTo},{default:p.withCtx((()=>[p.createVNode(p.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:p.withCtx((()=>[o.overlayVisible?(p.openBlock(),p.createElementBlock("div",p.mergeProps({key:0,ref:s.overlayRef,style:i.panelStyle,class:s.panelStyleClass,onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[p.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[7]||(t[7]=(...e)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...e))},null,544),p.renderSlot(e.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.filter?(p.openBlock(),p.createElementBlock("div",V,[p.createElementVNode("div",k,[p.createElementVNode("input",p.mergeProps({ref:"filterInput",type:"text",value:o.filterValue,onVnodeUpdated:t[8]||(t[8]=(...e)=>s.onFilterUpdated&&s.onFilterUpdated(...e)),class:"p-dropdown-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:t[9]||(t[9]=(...e)=>s.onFilterKeyDown&&s.onFilterKeyDown(...e)),onBlur:t[10]||(t[10]=(...e)=>s.onFilterBlur&&s.onFilterBlur(...e)),onInput:t[11]||(t[11]=(...e)=>s.onFilterChange&&s.onFilterChange(...e))},i.filterInputProps),null,16,C),p.renderSlot(e.$slots,"filtericon",{},(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(i.filterIcon?"span":"FilterIcon"),{class:p.normalizeClass(["p-dropdown-filter-icon",i.filterIcon])},null,8,["class"]))]))]),p.createElementVNode("span",F,p.toDisplayString(s.filterResultMessageText),1)])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:"p-dropdown-items-wrapper",style:p.normalizeStyle({"max-height":s.virtualScrollerDisabled?i.scrollHeight:""})},[p.createVNode(r,p.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{items:s.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled}),p.createSlots({content:p.withCtx((({styleClass:t,contentRef:n,items:l,getItemOptions:r,contentStyle:a,itemSize:c})=>[p.createElementVNode("ul",{ref:e=>s.listRef(e,n),id:o.id+"_list",class:p.normalizeClass(["p-dropdown-items",t]),style:p.normalizeStyle(a),role:"listbox"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(l,((t,i)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,r))},[s.isOptionGroup(t)?(p.openBlock(),p.createElementBlock("li",{key:0,id:o.id+"_"+s.getOptionIndex(i,r),style:p.normalizeStyle({height:c?c+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[p.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:s.getOptionIndex(i,r)},(()=>[p.createTextVNode(p.toDisplayString(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,D)):p.withDirectives((p.openBlock(),p.createElementBlock("li",{key:1,id:o.id+"_"+s.getOptionIndex(i,r),style:p.normalizeStyle({height:c?c+"px":void 0}),class:p.normalizeClass(["p-dropdown-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,r),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,r)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,r))},[p.renderSlot(e.$slots,"option",{option:t,index:s.getOptionIndex(i,r)},(()=>[p.createTextVNode(p.toDisplayString(s.getOptionLabel(t)),1)]))],46,E)),[[d]])],64)))),128)),o.filterValue&&(!l||l&&0===l.length)?(p.openBlock(),p.createElementBlock("li",K,[p.renderSlot(e.$slots,"emptyfilter",{},(()=>[p.createTextVNode(p.toDisplayString(s.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(p.openBlock(),p.createElementBlock("li",B,[p.renderSlot(e.$slots,"empty",{},(()=>[p.createTextVNode(p.toDisplayString(s.emptyMessageText),1)]))])):p.createCommentVNode("",!0)],14,L)])),_:2},[e.$slots.loader?{name:"loader",fn:p.withCtx((({options:t})=>[p.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),p.renderSlot(e.$slots,"footer",{value:i.modelValue,options:s.visibleOptions}),!i.options||i.options&&0===i.options.length?(p.openBlock(),p.createElementBlock("span",M,p.toDisplayString(s.emptyMessageText),1)):p.createCommentVNode("",!0),p.createElementVNode("span",T,p.toDisplayString(s.selectedMessageText),1),p.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=(...e)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...e))},null,544)],16)):p.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],10,x)},g}(primevue.api,primevue.icons.chevrondown,primevue.icons.filter,primevue.icons.spinner,primevue.icons.times,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<template v-for="(instance, key) in instanceMap" :key="key">
|
|
3
|
-
<DDialog v-model:visible="instance.visible" :_instance="instance" v-bind="instance.options.props" @hide="onDialogHide(instance)" @after-hide="onDialogAfterHide">
|
|
3
|
+
<DDialog v-model:visible="instance.visible" :_instance="instance" v-bind="instance.options.props" :pt="pt" @hide="onDialogHide(instance)" @after-hide="onDialogAfterHide">
|
|
4
4
|
<template v-if="instance.options.templates && instance.options.templates.header" #header>
|
|
5
5
|
<component v-for="(header, index) in getTemplateItems(instance.options.templates.header)" :is="header" :key="index + '_header'"></component>
|
|
6
6
|
</template>
|
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
|
+
import BaseComponent from 'primevue/basecomponent';
|
|
16
17
|
import Dialog from 'primevue/dialog';
|
|
17
18
|
import DynamicDialogEventBus from 'primevue/dynamicdialogeventbus';
|
|
18
19
|
import { UniqueComponentId } from 'primevue/utils';
|
|
19
20
|
|
|
20
21
|
export default {
|
|
21
22
|
name: 'DynamicDialog',
|
|
23
|
+
extends: BaseComponent,
|
|
22
24
|
inheritAttrs: false,
|
|
23
25
|
data() {
|
|
24
26
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var BaseComponent = require('primevue/basecomponent');
|
|
3
4
|
var Dialog = require('primevue/dialog');
|
|
4
5
|
var DynamicDialogEventBus = require('primevue/dynamicdialogeventbus');
|
|
5
6
|
var utils = require('primevue/utils');
|
|
@@ -7,11 +8,13 @@ var vue = require('vue');
|
|
|
7
8
|
|
|
8
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
10
|
|
|
11
|
+
var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
|
10
12
|
var Dialog__default = /*#__PURE__*/_interopDefaultLegacy(Dialog);
|
|
11
13
|
var DynamicDialogEventBus__default = /*#__PURE__*/_interopDefaultLegacy(DynamicDialogEventBus);
|
|
12
14
|
|
|
13
15
|
var script = {
|
|
14
16
|
name: 'DynamicDialog',
|
|
17
|
+
extends: BaseComponent__default["default"],
|
|
15
18
|
inheritAttrs: false,
|
|
16
19
|
data() {
|
|
17
20
|
return {
|
|
@@ -76,6 +79,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
76
79
|
"onUpdate:visible": $event => ((instance.visible) = $event),
|
|
77
80
|
_instance: instance
|
|
78
81
|
}, instance.options.props, {
|
|
82
|
+
pt: _ctx.pt,
|
|
79
83
|
onHide: $event => ($options.onDialogHide(instance)),
|
|
80
84
|
onAfterHide: $options.onDialogAfterHide
|
|
81
85
|
}), vue.createSlots({
|
|
@@ -110,7 +114,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
110
114
|
key: "1"
|
|
111
115
|
}
|
|
112
116
|
: undefined
|
|
113
|
-
]), 1040, ["visible", "onUpdate:visible", "_instance", "onHide", "onAfterHide"]))
|
|
117
|
+
]), 1040, ["visible", "onUpdate:visible", "_instance", "pt", "onHide", "onAfterHide"]))
|
|
114
118
|
}), 128))
|
|
115
119
|
}
|
|
116
120
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/
|
|
1
|
+
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/dialog"),n=require("primevue/dynamicdialogeventbus"),o=require("primevue/utils"),i=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e),l=s(t),a=s(n),c={name:"DynamicDialog",extends:r.default,inheritAttrs:!1,data:()=>({instanceMap:{}}),openListener:null,closeListener:null,currentInstance:null,mounted(){this.openListener=({instance:e})=>{const t=o.UniqueComponentId()+"_dynamic_dialog";e.visible=!0,e.key=t,this.instanceMap[t]=e},this.closeListener=({instance:e,params:t})=>{const n=e.key,o=this.instanceMap[n];o&&(o.visible=!1,o.options.onClose&&o.options.onClose({data:t,type:"config-close"}),this.currentInstance=o)},a.default.on("open",this.openListener),a.default.on("close",this.closeListener)},beforeUnmount(){a.default.off("open",this.openListener),a.default.off("close",this.closeListener)},methods:{onDialogHide(e){!this.currentInstance&&e.options.onClose&&e.options.onClose({type:"dialog-close"})},onDialogAfterHide(){this.currentInstance&&delete this.currentInstance,this.currentInstance=null},getTemplateItems:e=>Array.isArray(e)?e:[e]},components:{DDialog:l.default}};c.render=function(e,t,n,o,s,r){const l=i.resolveComponent("DDialog");return i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.instanceMap,((t,n)=>(i.openBlock(),i.createBlock(l,i.mergeProps({key:n,visible:t.visible,"onUpdate:visible":e=>t.visible=e,_instance:t},t.options.props,{pt:e.pt,onHide:e=>r.onDialogHide(t),onAfterHide:r.onDialogAfterHide}),i.createSlots({default:i.withCtx((()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.content),i.normalizeProps(i.guardReactiveProps(t.options.emits)),null,16))])),_:2},[t.options.templates&&t.options.templates.header?{name:"header",fn:i.withCtx((()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.getTemplateItems(t.options.templates.header),((e,t)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e),{key:t+"_header"})))),128))])),key:"0"}:void 0,t.options.templates&&t.options.templates.footer?{name:"footer",fn:i.withCtx((()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.getTemplateItems(t.options.templates.footer),((e,t)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e),{key:t+"_footer"})))),128))])),key:"1"}:void 0]),1040,["visible","onUpdate:visible","_instance","pt","onHide","onAfterHide"])))),128)},module.exports=c;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import BaseComponent from 'primevue/basecomponent';
|
|
1
2
|
import Dialog from 'primevue/dialog';
|
|
2
3
|
import DynamicDialogEventBus from 'primevue/dynamicdialogeventbus';
|
|
3
4
|
import { UniqueComponentId } from 'primevue/utils';
|
|
@@ -5,6 +6,7 @@ import { resolveComponent, openBlock, createElementBlock, Fragment, renderList,
|
|
|
5
6
|
|
|
6
7
|
var script = {
|
|
7
8
|
name: 'DynamicDialog',
|
|
9
|
+
extends: BaseComponent,
|
|
8
10
|
inheritAttrs: false,
|
|
9
11
|
data() {
|
|
10
12
|
return {
|
|
@@ -69,6 +71,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
69
71
|
"onUpdate:visible": $event => ((instance.visible) = $event),
|
|
70
72
|
_instance: instance
|
|
71
73
|
}, instance.options.props, {
|
|
74
|
+
pt: _ctx.pt,
|
|
72
75
|
onHide: $event => ($options.onDialogHide(instance)),
|
|
73
76
|
onAfterHide: $options.onDialogAfterHide
|
|
74
77
|
}), createSlots({
|
|
@@ -103,7 +106,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
103
106
|
key: "1"
|
|
104
107
|
}
|
|
105
108
|
: undefined
|
|
106
|
-
]), 1040, ["visible", "onUpdate:visible", "_instance", "onHide", "onAfterHide"]))
|
|
109
|
+
]), 1040, ["visible", "onUpdate:visible", "_instance", "pt", "onHide", "onAfterHide"]))
|
|
107
110
|
}), 128))
|
|
108
111
|
}
|
|
109
112
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/
|
|
1
|
+
import e from"primevue/basecomponent";import t from"primevue/dialog";import n from"primevue/dynamicdialogeventbus";import{UniqueComponentId as o}from"primevue/utils";import{resolveComponent as i,openBlock as s,createElementBlock as a,Fragment as r,renderList as l,createBlock as p,mergeProps as c,createSlots as m,withCtx as d,resolveDynamicComponent as u,normalizeProps as f,guardReactiveProps as h}from"vue";var v={name:"DynamicDialog",extends:e,inheritAttrs:!1,data:()=>({instanceMap:{}}),openListener:null,closeListener:null,currentInstance:null,mounted(){this.openListener=({instance:e})=>{const t=o()+"_dynamic_dialog";e.visible=!0,e.key=t,this.instanceMap[t]=e},this.closeListener=({instance:e,params:t})=>{const n=e.key,o=this.instanceMap[n];o&&(o.visible=!1,o.options.onClose&&o.options.onClose({data:t,type:"config-close"}),this.currentInstance=o)},n.on("open",this.openListener),n.on("close",this.closeListener)},beforeUnmount(){n.off("open",this.openListener),n.off("close",this.closeListener)},methods:{onDialogHide(e){!this.currentInstance&&e.options.onClose&&e.options.onClose({type:"dialog-close"})},onDialogAfterHide(){this.currentInstance&&delete this.currentInstance,this.currentInstance=null},getTemplateItems:e=>Array.isArray(e)?e:[e]},components:{DDialog:t}};v.render=function(e,t,n,o,v,g){const y=i("DDialog");return s(!0),a(r,null,l(v.instanceMap,((t,n)=>(s(),p(y,c({key:n,visible:t.visible,"onUpdate:visible":e=>t.visible=e,_instance:t},t.options.props,{pt:e.pt,onHide:e=>g.onDialogHide(t),onAfterHide:g.onDialogAfterHide}),m({default:d((()=>[(s(),p(u(t.content),f(h(t.options.emits)),null,16))])),_:2},[t.options.templates&&t.options.templates.header?{name:"header",fn:d((()=>[(s(!0),a(r,null,l(g.getTemplateItems(t.options.templates.header),((e,t)=>(s(),p(u(e),{key:t+"_header"})))),128))])),key:"0"}:void 0,t.options.templates&&t.options.templates.footer?{name:"footer",fn:d((()=>[(s(!0),a(r,null,l(g.getTemplateItems(t.options.templates.footer),((e,t)=>(s(),p(u(e),{key:t+"_footer"})))),128))])),key:"1"}:void 0]),1040,["visible","onUpdate:visible","_instance","pt","onHide","onAfterHide"])))),128)};export{v as default};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
this.primevue = this.primevue || {};
|
|
2
|
-
this.primevue.dynamicdialog = (function (Dialog, DynamicDialogEventBus, utils, vue) {
|
|
2
|
+
this.primevue.dynamicdialog = (function (BaseComponent, Dialog, DynamicDialogEventBus, utils, vue) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
6
|
|
|
7
|
+
var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
|
7
8
|
var Dialog__default = /*#__PURE__*/_interopDefaultLegacy(Dialog);
|
|
8
9
|
var DynamicDialogEventBus__default = /*#__PURE__*/_interopDefaultLegacy(DynamicDialogEventBus);
|
|
9
10
|
|
|
10
11
|
var script = {
|
|
11
12
|
name: 'DynamicDialog',
|
|
13
|
+
extends: BaseComponent__default["default"],
|
|
12
14
|
inheritAttrs: false,
|
|
13
15
|
data() {
|
|
14
16
|
return {
|
|
@@ -73,6 +75,7 @@ this.primevue.dynamicdialog = (function (Dialog, DynamicDialogEventBus, utils, v
|
|
|
73
75
|
"onUpdate:visible": $event => ((instance.visible) = $event),
|
|
74
76
|
_instance: instance
|
|
75
77
|
}, instance.options.props, {
|
|
78
|
+
pt: _ctx.pt,
|
|
76
79
|
onHide: $event => ($options.onDialogHide(instance)),
|
|
77
80
|
onAfterHide: $options.onDialogAfterHide
|
|
78
81
|
}), vue.createSlots({
|
|
@@ -107,7 +110,7 @@ this.primevue.dynamicdialog = (function (Dialog, DynamicDialogEventBus, utils, v
|
|
|
107
110
|
key: "1"
|
|
108
111
|
}
|
|
109
112
|
: undefined
|
|
110
|
-
]), 1040, ["visible", "onUpdate:visible", "_instance", "onHide", "onAfterHide"]))
|
|
113
|
+
]), 1040, ["visible", "onUpdate:visible", "_instance", "pt", "onHide", "onAfterHide"]))
|
|
111
114
|
}), 128))
|
|
112
115
|
}
|
|
113
116
|
|
|
@@ -115,4 +118,4 @@ this.primevue.dynamicdialog = (function (Dialog, DynamicDialogEventBus, utils, v
|
|
|
115
118
|
|
|
116
119
|
return script;
|
|
117
120
|
|
|
118
|
-
})(primevue.dialog, primevue.dynamicdialogeventbus, primevue.utils, Vue);
|
|
121
|
+
})(primevue.basecomponent, primevue.dialog, primevue.dynamicdialogeventbus, primevue.utils, Vue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.dynamicdialog=function(e,t,n,o){"use strict";function
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.dynamicdialog=function(e,t,n,o,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),r=s(n),c={name:"DynamicDialog",extends:l.default,inheritAttrs:!1,data:()=>({instanceMap:{}}),openListener:null,closeListener:null,currentInstance:null,mounted(){this.openListener=({instance:e})=>{const t=o.UniqueComponentId()+"_dynamic_dialog";e.visible=!0,e.key=t,this.instanceMap[t]=e},this.closeListener=({instance:e,params:t})=>{const n=e.key,o=this.instanceMap[n];o&&(o.visible=!1,o.options.onClose&&o.options.onClose({data:t,type:"config-close"}),this.currentInstance=o)},r.default.on("open",this.openListener),r.default.on("close",this.closeListener)},beforeUnmount(){r.default.off("open",this.openListener),r.default.off("close",this.closeListener)},methods:{onDialogHide(e){!this.currentInstance&&e.options.onClose&&e.options.onClose({type:"dialog-close"})},onDialogAfterHide(){this.currentInstance&&delete this.currentInstance,this.currentInstance=null},getTemplateItems:e=>Array.isArray(e)?e:[e]},components:{DDialog:a.default}};return c.render=function(e,t,n,o,s,l){const a=i.resolveComponent("DDialog");return i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.instanceMap,((t,n)=>(i.openBlock(),i.createBlock(a,i.mergeProps({key:n,visible:t.visible,"onUpdate:visible":e=>t.visible=e,_instance:t},t.options.props,{pt:e.pt,onHide:e=>l.onDialogHide(t),onAfterHide:l.onDialogAfterHide}),i.createSlots({default:i.withCtx((()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.content),i.normalizeProps(i.guardReactiveProps(t.options.emits)),null,16))])),_:2},[t.options.templates&&t.options.templates.header?{name:"header",fn:i.withCtx((()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.getTemplateItems(t.options.templates.header),((e,t)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e),{key:t+"_header"})))),128))])),key:"0"}:void 0,t.options.templates&&t.options.templates.footer?{name:"footer",fn:i.withCtx((()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.getTemplateItems(t.options.templates.footer),((e,t)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e),{key:t+"_footer"})))),128))])),key:"1"}:void 0]),1040,["visible","onUpdate:visible","_instance","pt","onHide","onAfterHide"])))),128)},c}(primevue.basecomponent,primevue.dialog,primevue.dynamicdialogeventbus,primevue.utils,Vue);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div v-for="(file, index) of files" :key="file.name + file.type + file.size" class="p-fileupload-file">
|
|
3
|
-
<img role="presentation" class="p-fileupload-file-thumbnail" :alt="file.name" :src="file.objectURL" :width="previewWidth" />
|
|
4
|
-
<div class="p-fileupload-file-details">
|
|
5
|
-
<div class="p-fileupload-file-name">{{ file.name }}</div>
|
|
6
|
-
<span class="p-fileupload-file-size">{{ formatSize(file.size) }}</span>
|
|
7
|
-
<FileUploadBadge :value="badgeValue" class="p-fileupload-file-badge" :severity="badgeSeverity" />
|
|
2
|
+
<div v-for="(file, index) of files" :key="file.name + file.type + file.size" class="p-fileupload-file" v-bind="ptm('file')">
|
|
3
|
+
<img role="presentation" class="p-fileupload-file-thumbnail" :alt="file.name" :src="file.objectURL" :width="previewWidth" v-bind="ptm('thumbnail')" />
|
|
4
|
+
<div class="p-fileupload-file-details" v-bind="ptm('details')">
|
|
5
|
+
<div class="p-fileupload-file-name" v-bind="ptm('fileName')">{{ file.name }}</div>
|
|
6
|
+
<span class="p-fileupload-file-size" v-bind="ptm('fileSize')">{{ formatSize(file.size) }}</span>
|
|
7
|
+
<FileUploadBadge :value="badgeValue" class="p-fileupload-file-badge" :severity="badgeSeverity" :pt="ptm('badge')" />
|
|
8
8
|
</div>
|
|
9
|
-
<div class="p-fileupload-file-actions">
|
|
10
|
-
<FileUploadButton @click="$emit('remove', index)" text rounded severity="danger" class="p-fileupload-file-remove">
|
|
9
|
+
<div class="p-fileupload-file-actions" v-bind="ptm('actions')">
|
|
10
|
+
<FileUploadButton @click="$emit('remove', index)" text rounded severity="danger" class="p-fileupload-file-remove" :pt="ptm('removeButton')">
|
|
11
11
|
<template #icon="iconProps">
|
|
12
12
|
<component v-if="templates.fileremoveicon" :is="templates.fileremoveicon" :class="iconProps.class" :file="file" :index="index" />
|
|
13
|
-
<TimesIcon v-else :class="iconProps.class" aria-hidden="true" />
|
|
13
|
+
<TimesIcon v-else :class="iconProps.class" aria-hidden="true" v-bind="ptm('removeButton')['icon']" />
|
|
14
14
|
</template>
|
|
15
15
|
</FileUploadButton>
|
|
16
16
|
</div>
|
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
|
|
20
20
|
<script>
|
|
21
21
|
import Badge from 'primevue/badge';
|
|
22
|
+
import BaseComponent from 'primevue/basecomponent';
|
|
22
23
|
import Button from 'primevue/button';
|
|
23
24
|
import TimesIcon from 'primevue/icons/times';
|
|
24
25
|
|
|
25
26
|
export default {
|
|
27
|
+
extends: BaseComponent,
|
|
26
28
|
emits: ['remove'],
|
|
27
29
|
props: {
|
|
28
30
|
files: {
|
|
@@ -8,8 +8,20 @@
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
import { VNode } from 'vue';
|
|
11
|
+
import { ButtonPassThroughOptions } from '../button';
|
|
12
|
+
import { MessagePassThroughOptions } from '../message';
|
|
11
13
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
12
14
|
|
|
15
|
+
export declare type FileUploadPassThroughOptionType = FileUploadPassThroughAttributes | ((options: FileUploadPassThroughMethodOptions) => FileUploadPassThroughAttributes) | null | undefined;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Custom passthrough(pt) option method.
|
|
19
|
+
*/
|
|
20
|
+
export interface FileUploadPassThroughMethodOptions {
|
|
21
|
+
props: FileUploadProps;
|
|
22
|
+
state: FileUploadState;
|
|
23
|
+
}
|
|
24
|
+
|
|
13
25
|
/**
|
|
14
26
|
* Custom select event.
|
|
15
27
|
* @see {@link FileUploadEmits.select}
|
|
@@ -138,6 +150,143 @@ export interface FileUploadRemoveUploadedFile {
|
|
|
138
150
|
files: File[];
|
|
139
151
|
}
|
|
140
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Custom passthrough(pt) options.
|
|
155
|
+
* @see {@link FileUploadProps.pt}
|
|
156
|
+
*/
|
|
157
|
+
export interface FileUploadPassThroughOptions {
|
|
158
|
+
/**
|
|
159
|
+
* Uses to pass attributes to the root's DOM element.
|
|
160
|
+
*/
|
|
161
|
+
root?: FileUploadPassThroughOptionType;
|
|
162
|
+
/**
|
|
163
|
+
* Uses to pass attributes to the input's DOM element.
|
|
164
|
+
*/
|
|
165
|
+
input?: FileUploadPassThroughOptionType;
|
|
166
|
+
/**
|
|
167
|
+
* Uses to pass attributes to the buttonbar's DOM element.
|
|
168
|
+
*/
|
|
169
|
+
buttonbar?: FileUploadPassThroughOptionType;
|
|
170
|
+
/**
|
|
171
|
+
* Uses to pass attributes to the header' DOM element.
|
|
172
|
+
*/
|
|
173
|
+
header?: FileUploadPassThroughOptionType;
|
|
174
|
+
/**
|
|
175
|
+
* Uses to pass attributes to the button's DOM element.
|
|
176
|
+
*/
|
|
177
|
+
button?: FileUploadPassThroughOptionType;
|
|
178
|
+
/**
|
|
179
|
+
* Uses to pass attributes to the choose icon's DOM element.
|
|
180
|
+
*/
|
|
181
|
+
chooseIcon?: FileUploadPassThroughOptionType;
|
|
182
|
+
/**
|
|
183
|
+
* Uses to pass attributes to the upload button's DOM element.
|
|
184
|
+
* @see {@link ButtonPassThroughOptions}
|
|
185
|
+
*/
|
|
186
|
+
uploadButton?: ButtonPassThroughOptions;
|
|
187
|
+
/**
|
|
188
|
+
* Uses to pass attributes to the cancel button's DOM element.
|
|
189
|
+
* @see {@link ButtonPassThroughOptions}
|
|
190
|
+
*/
|
|
191
|
+
cancelButton?: ButtonPassThroughOptions;
|
|
192
|
+
/**
|
|
193
|
+
* Uses to pass attributes to the content's DOM element.
|
|
194
|
+
*/
|
|
195
|
+
content?: FileUploadPassThroughOptionType;
|
|
196
|
+
/**
|
|
197
|
+
* Uses to pass attributes to the progressbar's DOM element.
|
|
198
|
+
*/
|
|
199
|
+
progressbar?: FileUploadPassThroughOptionType;
|
|
200
|
+
/**
|
|
201
|
+
* Uses to pass attributes to the messages' DOM element.
|
|
202
|
+
* @see {@link MessagePassThroughOptions}
|
|
203
|
+
*/
|
|
204
|
+
messages?: MessagePassThroughOptions;
|
|
205
|
+
/**
|
|
206
|
+
* Uses to pass attributes to the empty's DOM element.
|
|
207
|
+
*/
|
|
208
|
+
empty?: FileUploadPassThroughOptionType;
|
|
209
|
+
/**
|
|
210
|
+
* Uses to pass attributes to the basic button's DOM element.
|
|
211
|
+
*/
|
|
212
|
+
basicButton?: FileUploadPassThroughOptionType;
|
|
213
|
+
/**
|
|
214
|
+
* Uses to pass attributes to the upload icon's DOM element.
|
|
215
|
+
*/
|
|
216
|
+
uploadIcon?: FileUploadPassThroughOptionType;
|
|
217
|
+
/**
|
|
218
|
+
* Uses to pass attributes to the label's DOM element.
|
|
219
|
+
*/
|
|
220
|
+
label?: FileUploadPassThroughOptionType;
|
|
221
|
+
/**
|
|
222
|
+
* Uses to pass attributes to the file's DOM element.
|
|
223
|
+
*/
|
|
224
|
+
file?: FileUploadPassThroughOptionType;
|
|
225
|
+
/**
|
|
226
|
+
* Uses to pass attributes to the thumbnail's DOM element.
|
|
227
|
+
*/
|
|
228
|
+
thumbnail?: FileUploadPassThroughOptionType;
|
|
229
|
+
/**
|
|
230
|
+
* Uses to pass attributes to the details's DOM element.
|
|
231
|
+
*/
|
|
232
|
+
details?: FileUploadPassThroughOptionType;
|
|
233
|
+
/**
|
|
234
|
+
* Uses to pass attributes to the fileName's DOM element.
|
|
235
|
+
*/
|
|
236
|
+
fileName?: FileUploadPassThroughOptionType;
|
|
237
|
+
/**
|
|
238
|
+
* Uses to pass attributes to the fileSize's DOM element.
|
|
239
|
+
*/
|
|
240
|
+
fileSize?: FileUploadPassThroughOptionType;
|
|
241
|
+
/**
|
|
242
|
+
* Uses to pass attributes to the badge's DOM element.
|
|
243
|
+
*/
|
|
244
|
+
badge?: FileUploadPassThroughOptionType;
|
|
245
|
+
/**
|
|
246
|
+
* Uses to pass attributes to the actions's DOM element.
|
|
247
|
+
*/
|
|
248
|
+
actions?: FileUploadPassThroughOptionType;
|
|
249
|
+
/**
|
|
250
|
+
* Uses to pass attributes to the remove button's DOM element.
|
|
251
|
+
* @see {@link ButtonPassThroughOptions}
|
|
252
|
+
*/
|
|
253
|
+
removeButton?: ButtonPassThroughOptions;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Custom passthrough attributes for each DOM elements
|
|
258
|
+
*/
|
|
259
|
+
export interface FileUploadPassThroughAttributes {
|
|
260
|
+
[key: string]: any;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Defines current inline state in FileUpload component.
|
|
265
|
+
*/
|
|
266
|
+
export interface FileUploadState {
|
|
267
|
+
/**
|
|
268
|
+
* Current uploaded file count state as a number.
|
|
269
|
+
* @defaultValue 0
|
|
270
|
+
*/
|
|
271
|
+
uploadedFileCount: number;
|
|
272
|
+
/**
|
|
273
|
+
* Current files.
|
|
274
|
+
*/
|
|
275
|
+
files: any[];
|
|
276
|
+
/**
|
|
277
|
+
* Current messages.
|
|
278
|
+
*/
|
|
279
|
+
messages: any[];
|
|
280
|
+
/**
|
|
281
|
+
* Current progress state as a number.
|
|
282
|
+
*/
|
|
283
|
+
progress: number;
|
|
284
|
+
/**
|
|
285
|
+
* Current uploaded files.
|
|
286
|
+
*/
|
|
287
|
+
uploadedFiles: any[];
|
|
288
|
+
}
|
|
289
|
+
|
|
141
290
|
/**
|
|
142
291
|
* Defines valid properties in FileUpload component.
|
|
143
292
|
*/
|
|
@@ -257,6 +406,11 @@ export interface FileUploadProps {
|
|
|
257
406
|
* Style class of the component.
|
|
258
407
|
*/
|
|
259
408
|
class?: any;
|
|
409
|
+
/**
|
|
410
|
+
* Uses to pass attributes to DOM elements inside the component.
|
|
411
|
+
* @type {FileUploadPassThroughOptions}
|
|
412
|
+
*/
|
|
413
|
+
pt?: FileUploadPassThroughOptions;
|
|
260
414
|
}
|
|
261
415
|
|
|
262
416
|
/**
|