primevue 3.43.0 → 3.44.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/accordion/Accordion.d.ts +4 -0
- package/accordion/accordion.cjs.js +2 -2
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +2 -2
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +2 -2
- package/accordion/accordion.min.js +1 -1
- package/accordiontab/AccordionTab.d.ts +4 -0
- package/animateonscroll/animateonscroll.cjs.js +2 -2
- package/animateonscroll/animateonscroll.cjs.min.js +1 -1
- package/animateonscroll/animateonscroll.esm.js +2 -2
- package/animateonscroll/animateonscroll.esm.min.js +1 -1
- package/animateonscroll/animateonscroll.js +2 -2
- package/animateonscroll/animateonscroll.min.js +1 -1
- package/autocomplete/AutoComplete.d.ts +4 -0
- package/autocomplete/AutoComplete.vue +2 -1
- package/autocomplete/autocomplete.cjs.js +5 -3
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +5 -3
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +5 -3
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +4 -0
- package/badgedirective/BadgeDirective.d.ts +4 -0
- package/badgedirective/badgedirective.cjs.js +2 -2
- package/badgedirective/badgedirective.cjs.min.js +1 -1
- package/badgedirective/badgedirective.esm.js +2 -2
- package/badgedirective/badgedirective.esm.min.js +1 -1
- package/badgedirective/badgedirective.js +2 -2
- package/badgedirective/badgedirective.min.js +1 -1
- package/base/style/basestyle.cjs.js +2 -2
- package/base/style/basestyle.cjs.min.js +1 -1
- package/base/style/basestyle.esm.js +2 -2
- package/base/style/basestyle.esm.min.js +1 -1
- package/base/style/basestyle.js +2 -2
- package/base/style/basestyle.min.js +1 -1
- package/basecomponent/BaseComponent.vue +3 -1
- package/basecomponent/basecomponent.cjs.js +7 -5
- package/basecomponent/basecomponent.cjs.min.js +1 -1
- package/basecomponent/basecomponent.esm.js +7 -5
- package/basecomponent/basecomponent.esm.min.js +1 -1
- package/basecomponent/basecomponent.js +7 -5
- package/basecomponent/basecomponent.min.js +1 -1
- package/basecomponent/style/basecomponentstyle.cjs.js +2 -2
- package/basecomponent/style/basecomponentstyle.cjs.min.js +1 -1
- package/basecomponent/style/basecomponentstyle.esm.js +2 -2
- package/basecomponent/style/basecomponentstyle.esm.min.js +1 -1
- package/basecomponent/style/basecomponentstyle.js +2 -2
- package/basecomponent/style/basecomponentstyle.min.js +1 -1
- package/basedirective/basedirective.cjs.js +2 -3
- package/basedirective/basedirective.cjs.min.js +1 -1
- package/basedirective/basedirective.esm.js +2 -3
- package/basedirective/basedirective.esm.min.js +1 -1
- package/basedirective/basedirective.js +2 -3
- package/basedirective/basedirective.min.js +1 -1
- package/blockui/BlockUI.d.ts +4 -0
- package/breadcrumb/Breadcrumb.d.ts +4 -0
- package/button/style/buttonstyle.cjs.js +2 -2
- package/button/style/buttonstyle.cjs.min.js +1 -1
- package/button/style/buttonstyle.esm.js +2 -2
- package/button/style/buttonstyle.esm.min.js +1 -1
- package/button/style/buttonstyle.js +2 -2
- package/button/style/buttonstyle.min.js +1 -1
- package/calendar/Calendar.d.ts +8 -0
- package/calendar/Calendar.vue +26 -13
- package/calendar/calendar.cjs.js +26 -15
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +26 -15
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +26 -15
- package/calendar/calendar.min.js +1 -1
- package/carousel/Carousel.d.ts +4 -0
- package/carousel/carousel.cjs.js +2 -2
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +2 -2
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +2 -2
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +4 -0
- package/cascadeselect/CascadeSelect.vue +1 -1
- package/cascadeselect/CascadeSelectSub.vue +4 -1
- package/cascadeselect/cascadeselect.cjs.js +7 -4
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +7 -4
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +7 -4
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/Chart.d.ts +4 -0
- package/chart/chart.cjs.js +2 -2
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +2 -2
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +2 -2
- package/chart/chart.min.js +1 -1
- package/checkbox/Checkbox.d.ts +4 -0
- package/checkbox/checkbox.cjs.js +2 -2
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +2 -2
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +2 -2
- package/checkbox/checkbox.min.js +1 -1
- package/chip/Chip.d.ts +4 -0
- package/chips/Chips.d.ts +4 -0
- package/chips/chips.cjs.js +2 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -2
- package/chips/chips.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +4 -0
- package/column/Column.d.ts +4 -0
- package/columngroup/ColumnGroup.d.ts +4 -0
- package/config/config.cjs.js +2 -2
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +2 -2
- package/config/config.esm.min.js +1 -1
- package/config/config.js +2 -2
- package/config/config.min.js +1 -1
- package/confirmdialog/ConfirmDialog.d.ts +4 -0
- package/confirmpopup/ConfirmPopup.d.ts +4 -0
- package/confirmpopup/confirmpopup.cjs.js +2 -2
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +2 -2
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +2 -2
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +4 -0
- package/contextmenu/contextmenu.cjs.js +2 -2
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +2 -2
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +2 -2
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +84 -127
- package/core/core.min.js +23 -23
- package/datatable/DataTable.d.ts +4 -0
- package/datatable/RowCheckbox.vue +1 -0
- package/datatable/datatable.cjs.js +21 -20
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +21 -20
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +21 -20
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +4 -0
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +4 -0
- package/deferredcontent/DeferredContent.d.ts +4 -0
- package/dialog/dialog.cjs.js +2 -2
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +2 -2
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +2 -2
- package/dialog/dialog.min.js +1 -1
- package/divider/Divider.d.ts +4 -0
- package/dock/Dock.d.ts +4 -0
- package/dropdown/Dropdown.vue +3 -1
- package/dropdown/dropdown.cjs.js +6 -5
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +6 -5
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +6 -5
- package/dropdown/dropdown.min.js +1 -1
- package/dropdown/style/dropdownstyle.cjs.js +1 -1
- package/dropdown/style/dropdownstyle.cjs.min.js +1 -1
- package/dropdown/style/dropdownstyle.esm.js +1 -1
- package/dropdown/style/dropdownstyle.esm.min.js +1 -1
- package/dropdown/style/dropdownstyle.js +1 -1
- package/dropdown/style/dropdownstyle.min.js +1 -1
- package/dynamicdialog/DynamicDialog.vue +1 -1
- package/dynamicdialog/dynamicdialog.cjs.js +1 -3
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +1 -3
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +1 -3
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/editor/Editor.d.ts +4 -0
- package/editor/editor.cjs.js +2 -2
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +2 -2
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +2 -2
- package/editor/editor.min.js +1 -1
- package/fieldset/Fieldset.d.ts +4 -0
- package/fieldset/fieldset.cjs.js +2 -2
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +2 -2
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +2 -2
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/FileUpload.d.ts +4 -0
- package/galleria/Galleria.d.ts +4 -0
- package/galleria/galleria.cjs.js +6 -6
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +6 -6
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +6 -6
- package/galleria/galleria.min.js +1 -1
- package/image/Image.d.ts +4 -0
- package/image/image.cjs.js +2 -2
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +2 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +2 -2
- package/image/image.min.js +1 -1
- package/inlinemessage/InlineMessage.d.ts +4 -0
- package/inplace/Inplace.d.ts +4 -0
- package/inplace/inplace.cjs.js +2 -2
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +2 -2
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +2 -2
- package/inplace/inplace.min.js +1 -1
- package/inputgroup/InputGroup.d.ts +4 -0
- package/inputgroupaddon/InputGroupAddon.d.ts +4 -0
- package/inputmask/InputMask.d.ts +4 -0
- package/inputnumber/inputnumber.cjs.js +2 -2
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +2 -2
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +2 -2
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +4 -0
- package/inputswitch/inputswitch.cjs.js +2 -2
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +2 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +2 -2
- package/inputswitch/inputswitch.min.js +1 -1
- package/knob/Knob.d.ts +4 -0
- package/listbox/Listbox.d.ts +4 -0
- package/listbox/listbox.cjs.js +2 -2
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +2 -2
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +2 -2
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.d.ts +4 -0
- package/menu/Menu.d.ts +4 -0
- package/menu/menu.cjs.js +2 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +2 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +2 -2
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +4 -0
- package/menubar/menubar.cjs.js +2 -2
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +2 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +2 -2
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -2
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +2 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -2
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +4 -0
- package/multiselect/multiselect.cjs.js +4 -4
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +4 -4
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +4 -4
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.d.ts +4 -0
- package/orderlist/orderlist.cjs.js +2 -2
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -2
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +2 -2
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/OrganizationChart.d.ts +4 -0
- package/organizationchart/organizationchart.cjs.js +2 -2
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +2 -2
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +2 -2
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +4 -0
- package/overlaypanel/overlaypanel.cjs.js +2 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +2 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +2 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/style/paginatorstyle.cjs.js +2 -2
- package/paginator/style/paginatorstyle.cjs.min.js +1 -1
- package/paginator/style/paginatorstyle.esm.js +2 -2
- package/paginator/style/paginatorstyle.esm.min.js +1 -1
- package/paginator/style/paginatorstyle.js +2 -2
- package/paginator/style/paginatorstyle.min.js +1 -1
- package/panel/Panel.d.ts +4 -0
- package/panel/panel.cjs.js +2 -2
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +2 -2
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +2 -2
- package/panel/panel.min.js +1 -1
- package/panelmenu/PanelMenu.d.ts +4 -0
- package/panelmenu/panelmenu.cjs.js +2 -2
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +2 -2
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +2 -2
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/index.cjs.js +2 -2
- package/passthrough/index.cjs.min.js +1 -1
- package/passthrough/index.esm.js +2 -2
- package/passthrough/index.esm.min.js +1 -1
- package/passthrough/index.js +2 -2
- package/passthrough/index.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +2 -71
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +2 -71
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +2 -71
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/Password.d.ts +4 -0
- package/password/password.cjs.js +2 -4
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -4
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +4 -0
- package/picklist/picklist.cjs.js +2 -2
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +2 -2
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +2 -2
- package/picklist/picklist.min.js +1 -1
- package/progressspinner/ProgressSpinner.d.ts +4 -0
- package/radiobutton/RadioButton.d.ts +4 -0
- package/radiobutton/radiobutton.cjs.js +2 -2
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -2
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -2
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/Rating.d.ts +4 -0
- package/row/Row.d.ts +4 -0
- package/scrollpanel/ScrollPanel.d.ts +4 -0
- package/scrollpanel/ScrollPanel.vue +8 -1
- package/scrollpanel/scrollpanel.cjs.js +14 -5
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +14 -5
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +14 -5
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/ScrollTop.d.ts +4 -0
- package/selectbutton/SelectButton.d.ts +4 -0
- package/sidebar/Sidebar.d.ts +4 -0
- package/sidebar/sidebar.cjs.js +2 -2
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +2 -2
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +2 -2
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +4 -0
- package/slider/Slider.d.ts +4 -0
- package/speeddial/SpeedDial.d.ts +4 -0
- package/speeddial/speeddial.cjs.js +2 -2
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +2 -2
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +2 -2
- package/speeddial/speeddial.min.js +1 -1
- package/speeddial/style/speeddialstyle.cjs.js +2 -2
- package/speeddial/style/speeddialstyle.cjs.min.js +1 -1
- package/speeddial/style/speeddialstyle.esm.js +2 -2
- package/speeddial/style/speeddialstyle.esm.min.js +1 -1
- package/speeddial/style/speeddialstyle.js +2 -2
- package/speeddial/style/speeddialstyle.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +4 -0
- package/splitbutton/style/splitbuttonstyle.cjs.js +2 -2
- package/splitbutton/style/splitbuttonstyle.cjs.min.js +1 -1
- package/splitbutton/style/splitbuttonstyle.esm.js +2 -2
- package/splitbutton/style/splitbuttonstyle.esm.min.js +1 -1
- package/splitbutton/style/splitbuttonstyle.js +2 -2
- package/splitbutton/style/splitbuttonstyle.min.js +1 -1
- package/splitter/Splitter.d.ts +4 -0
- package/splitterpanel/SplitterPanel.d.ts +4 -0
- package/steps/Steps.d.ts +4 -0
- package/tabmenu/TabMenu.d.ts +4 -0
- package/tabpanel/TabPanel.d.ts +4 -0
- package/tabview/tabview.cjs.js +2 -2
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +2 -2
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +2 -2
- package/tabview/tabview.min.js +1 -1
- package/tag/Tag.d.ts +4 -0
- package/terminal/Terminal.d.ts +4 -0
- package/textarea/Textarea.d.ts +4 -0
- package/tieredmenu/tieredmenu.cjs.js +2 -2
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +2 -2
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +2 -2
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/Timeline.d.ts +4 -0
- package/toast/Toast.d.ts +4 -0
- package/toast/style/toaststyle.cjs.js +2 -2
- package/toast/style/toaststyle.cjs.min.js +1 -1
- package/toast/style/toaststyle.esm.js +2 -2
- package/toast/style/toaststyle.esm.min.js +1 -1
- package/toast/style/toaststyle.js +2 -2
- package/toast/style/toaststyle.min.js +1 -1
- package/toast/toast.cjs.js +4 -4
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +4 -4
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +4 -4
- package/toast/toast.min.js +1 -1
- package/togglebutton/ToggleButton.d.ts +4 -0
- package/togglebutton/togglebutton.cjs.js +2 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/Toolbar.d.ts +4 -0
- package/tooltip/Tooltip.d.ts +4 -0
- package/tree/tree.cjs.js +4 -4
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +4 -4
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +4 -4
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +4 -0
- package/treeselect/treeselect.cjs.js +4 -4
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +4 -4
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +4 -4
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/TreeTable.d.ts +4 -0
- package/treetable/treetable.cjs.js +12 -12
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +12 -12
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +12 -12
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +4 -0
- package/tristatecheckbox/tristatecheckbox.cjs.js +2 -2
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -2
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +2 -2
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/usestyle/usestyle.cjs.js +2 -2
- package/usestyle/usestyle.cjs.min.js +1 -1
- package/usestyle/usestyle.esm.js +2 -2
- package/usestyle/usestyle.esm.min.js +1 -1
- package/usestyle/usestyle.js +2 -2
- package/usestyle/usestyle.min.js +1 -1
- package/utils/Utils.d.ts +1 -0
- package/utils/utils.cjs.js +27 -3
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +27 -3
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +27 -3
- package/utils/utils.min.js +1 -1
- package/virtualscroller/VirtualScroller.d.ts +4 -0
- package/virtualscroller/VirtualScroller.vue +1 -1
- package/virtualscroller/virtualscroller.cjs.js +5 -5
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +5 -5
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +5 -5
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"primevue/icons/chevrondown";import e from"primevue/icons/chevronleft";import i from"primevue/icons/chevronright";import n from"primevue/icons/chevronup";import a from"primevue/ripple";import{DomHandler as s,ObjectUtils as o,UniqueComponentId as r}from"primevue/utils";import l from"primevue/basecomponent";import c from"primevue/carousel/style";import{resolveDirective as u,openBlock as d,createElementBlock as h,mergeProps as m,renderSlot as p,createCommentVNode as f,createElementVNode as v,withDirectives as b,createBlock as g,resolveDynamicComponent as y,Fragment as I,renderList as _}from"vue";function S(t){return V(t)||C(t)||w(t)||x()}function x(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return $(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?$(t,e):void 0}}function C(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function V(t){if(Array.isArray(t))return $(t)}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var A={name:"Carousel",extends:{name:"BaseCarousel",extends:l,props:{value:null,page:{type:Number,default:0},numVisible:{type:Number,default:1},numScroll:{type:Number,default:1},responsiveOptions:Array,orientation:{type:String,default:"horizontal"},verticalViewPortHeight:{type:String,default:"300px"},contentClass:String,containerClass:String,indicatorsContentClass:String,circular:{type:Boolean,default:!1},autoplayInterval:{type:Number,default:0},showNavigators:{type:Boolean,default:!0},showIndicators:{type:Boolean,default:!0},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},style:c,provide:function(){return{$parentInstance:this}}},emits:["update:page"],isRemainingItemsAdded:!1,data:function(){return{remainingItems:0,d_numVisible:this.numVisible,d_numScroll:this.numScroll,d_oldNumScroll:0,d_oldNumVisible:0,d_oldValue:null,d_page:this.page,totalShiftedItems:this.page*this.numScroll*-1,allowAutoplay:!!this.autoplayInterval,d_circular:this.circular||this.allowAutoplay,swipeThreshold:20}},watch:{page:function(t){t>this.d_page?this.navForward({},t):t<this.d_page&&this.navBackward({},t),this.d_page=t},circular:function(t){this.d_circular=t},numVisible:function(t,e){this.d_numVisible=t,this.d_oldNumVisible=e},numScroll:function(t,e){this.d_oldNumScroll=e,this.d_numScroll=t},value:function(t){this.d_oldValue=t}},mounted:function(){var t=!1;if(this.$el.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners(),this.isCircular()){var e=this.totalShiftedItems;0===this.d_page?e=-1*this.d_numVisible:0===e&&(e=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),e!==this.totalShiftedItems&&(this.totalShiftedItems=e,t=!0)}!t&&this.isAutoplay()&&this.startAutoplay()},updated:function(){var t=this.isCircular(),e=!1,i=this.totalShiftedItems;if(this.autoplayInterval&&this.stopAutoplay(),this.d_oldNumScroll!==this.d_numScroll||this.d_oldNumVisible!==this.d_numVisible||this.d_oldValue.length!==this.value.length){this.remainingItems=(this.value.length-this.d_numVisible)%this.d_numScroll;var n=this.d_page;0!==this.totalIndicators&&n>=this.totalIndicators&&(this.$emit("update:page",n=this.totalIndicators-1),this.d_page=n,e=!0),i=n*this.d_numScroll*-1,t&&(i-=this.d_numVisible),n===this.totalIndicators-1&&this.remainingItems>0?(i+=-1*this.remainingItems+this.d_numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0),this.d_oldNumScroll=this.d_numScroll,this.d_oldNumVisible=this.d_numVisible,this.d_oldValue=this.value,this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)")}t&&(0===this.d_page?i=-1*this.d_numVisible:0===i&&(i=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0)),!e&&this.isAutoplay()&&this.startAutoplay()},beforeUnmount:function(){this.responsiveOptions&&this.unbindDocumentListeners(),this.autoplayInterval&&this.stopAutoplay()},methods:{getIndicatorPTOptions:function(t){return{context:{highlighted:t===this.d_page}}},step:function(t,e){var i=this.totalShiftedItems,n=this.isCircular();null!=e?(i=this.d_numScroll*e*-1,n&&(i-=this.d_numVisible),this.isRemainingItemsAdded=!1):(i+=this.d_numScroll*t,this.isRemainingItemsAdded&&(i+=this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!1),e=Math.abs(Math.floor((n?i+this.d_numVisible:i)/this.d_numScroll)));n&&this.d_page===this.totalIndicators-1&&-1===t?(i=-1*(this.value.length+this.d_numVisible),e=0):n&&0===this.d_page&&1===t?(i=0,e=this.totalIndicators-1):e===this.totalIndicators-1&&this.remainingItems>0&&(i+=-1*this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!0),this.$refs.itemsContainer&&(!this.isUnstyled&&s.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)"),this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=i,this.$emit("update:page",e),this.d_page=e},calculatePosition:function(){if(this.$refs.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.numVisible,numScroll:this.numScroll},i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];parseInt(n.breakpoint,10)>=t&&(e=n)}if(this.d_numScroll!==e.numScroll){var a=this.d_page;a=parseInt(a*this.d_numScroll/e.numScroll),this.totalShiftedItems=e.numScroll*a*-1,this.isCircular()&&(this.totalShiftedItems-=e.numVisible),this.d_numScroll=e.numScroll,this.$emit("update:page",a),this.d_page=a}this.d_numVisible!==e.numVisible&&(this.d_numVisible=e.numVisible)}},navBackward:function(t,e){(this.d_circular||0!==this.d_page)&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},navForward:function(t,e){(this.d_circular||this.d_page<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},onIndicatorClick:function(t,e){var i=this.d_page;e>i?this.navForward(t,e):e<i&&this.navBackward(t,e)},onTransitionEnd:function(){this.$refs.itemsContainer&&(!this.isUnstyled&&s.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="",0!==this.d_page&&this.d_page!==this.totalIndicators-1||!this.isCircular()||(this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0, 0)")))},onTouchStart:function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},onTouchMove:function(t){t.cancelable&&t.preventDefault()},onTouchEnd:function(t){var e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)},changePageOnTouch:function(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))},onIndicatorKeydown:function(t){switch(t.code){case"ArrowRight":this.onRightKey();break;case"ArrowLeft":this.onLeftKey();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"ArrowUp":case"ArrowDown":case"PageUp":case"PageDown":t.preventDefault();break;case"Tab":this.onTabKey()}},onRightKey:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,e+1===t.length?t.length-1:e+1)},onLeftKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,t-1<=0?0:t-1)},onHomeKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,0)},onEndKey:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,t.length-1)},onTabKey:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=t.findIndex((function(t){return!0===s.getAttribute(t,"data-p-highlight")})),i=s.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]'),n=t.findIndex((function(t){return t===i.parentElement}));t[n].children[0].tabIndex="-1",t[e].children[0].tabIndex="0"},findFocusedIndicatorIndex:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=s.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]');return t.findIndex((function(t){return t===e.parentElement}))},changedFocusedIndicator:function(t,e){var i=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]'));i[t].children[0].tabIndex="-1",i[e].children[0].tabIndex="0",i[e].children[0].focus()},bindDocumentListeners:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(e){t.calculatePosition(e)},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},startAutoplay:function(){var t=this;this.interval=setInterval((function(){t.step(-1,t.d_page===t.totalIndicators-1?0:t.d_page+1)}),this.autoplayInterval)},stopAutoplay:function(){this.interval&&clearInterval(this.interval)},createStyle:function(){var t;this.carouselStyle||(this.carouselStyle=document.createElement("style"),this.carouselStyle.type="text/css",s.setAttribute(this.carouselStyle,"nonce",null===(t=this.$primevue)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.csp)||void 0===t?void 0:t.nonce),document.body.appendChild(this.carouselStyle));var e="\n .p-carousel[".concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/this.d_numVisible,"%\n }\n ");if(this.responsiveOptions&&!this.isUnstyled){var i=S(this.responsiveOptions),n=o.localeComparator();i.sort((function(t,e){return o.sort(t.breakpoint,e.breakpoint,-1,n)}));for(var a=0;a<i.length;a++){var r=i[a];e+="\n @media screen and (max-width: ".concat(r.breakpoint,") {\n .p-carousel[").concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/r.numVisible,"%\n }\n }\n ")}}this.carouselStyle.innerHTML=e},isVertical:function(){return"vertical"===this.orientation},isCircular:function(){return this.value&&this.d_circular&&this.value.length>=this.d_numVisible},isAutoplay:function(){return this.autoplayInterval&&this.allowAutoplay},firstIndex:function(){return this.isCircular()?-1*(this.totalShiftedItems+this.d_numVisible):-1*this.totalShiftedItems},lastIndex:function(){return this.firstIndex()+this.d_numVisible-1},ariaSlideNumber:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g,t):void 0},ariaPageLabel:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,t):void 0}},computed:{totalIndicators:function(){return this.value?Math.max(Math.ceil((this.value.length-this.d_numVisible)/this.d_numScroll)+1,0):0},backwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&0===this.d_page},forwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&(this.d_page===this.totalIndicators-1||0===this.totalIndicators)},ariaSlideLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slide:void 0},ariaPrevButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.prevPageLabel:void 0},ariaNextButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.nextPageLabel:void 0},attributeSelector:function(){return r()}},components:{ChevronRightIcon:i,ChevronDownIcon:t,ChevronLeftIcon:e,ChevronUpIcon:n},directives:{ripple:a}};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function k(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function O(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?k(Object(i),!0).forEach((function(e){T(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function T(t,e,i){return(e=L(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function L(t){var e=B(t,"string");return"symbol"===P(e)?e:String(e)}function B(t,e){if("object"!==P(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var D=["aria-live"],N=["disabled","aria-label"],R=["data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],E=["aria-hidden","aria-label","aria-roledescription","data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],j=["disabled","aria-label"],F=["data-p-highlight"],K=["tabindex","aria-label","aria-current","onClick"];A.render=function(t,e,i,n,a,s){var o=u("ripple");return d(),h("div",m({class:t.cx("root"),role:"region"},t.ptm("root")),[t.$slots.header?(d(),h("div",m({key:0,class:t.cx("header")},t.ptm("header")),[p(t.$slots,"header")],16)):f("",!0),v("div",m({class:[t.cx("content"),t.contentClass]},t.ptm("content")),[v("div",m({class:[t.cx("container"),t.containerClass],"aria-live":a.allowAutoplay?"polite":"off"},t.ptm("container")),[t.showNavigators?b((d(),h("button",m({key:0,type:"button",class:t.cx("previousButton"),disabled:s.backwardIsDisabled,"aria-label":s.ariaPrevButtonLabel,onClick:e[0]||(e[0]=function(){return s.navBackward&&s.navBackward.apply(s,arguments)})},O(O({},t.prevButtonProps),t.ptm("previousButton")),{"data-pc-group-section":"navigator"}),[p(t.$slots,"previousicon",{},(function(){return[(d(),g(y(s.isVertical()?"ChevronUpIcon":"ChevronLeftIcon"),m({class:t.cx("previousButtonIcon")},t.ptm("previousButtonIcon")),null,16,["class"]))]}))],16,N)),[[o]]):f("",!0),v("div",m({class:t.cx("itemsContent"),style:[{height:s.isVertical()?t.verticalViewPortHeight:"auto"}],onTouchend:e[2]||(e[2]=function(){return s.onTouchEnd&&s.onTouchEnd.apply(s,arguments)}),onTouchstart:e[3]||(e[3]=function(){return s.onTouchStart&&s.onTouchStart.apply(s,arguments)}),onTouchmove:e[4]||(e[4]=function(){return s.onTouchMove&&s.onTouchMove.apply(s,arguments)})},t.ptm("itemsContent")),[v("div",m({ref:"itemsContainer",class:t.cx("itemsContainer"),onTransitionend:e[1]||(e[1]=function(){return s.onTransitionEnd&&s.onTransitionEnd.apply(s,arguments)})},t.ptm("itemsContainer")),[s.isCircular()?(d(!0),h(I,{key:0},_(t.value.slice(-1*a.d_numVisible),(function(e,i){return d(),h("div",m({key:i+"_scloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:a.totalShiftedItems,d_numVisible:a.d_numVisible})},t.ptm("itemCloned"),{"data-p-carousel-item-active":-1*a.totalShiftedItems===t.value.length+a.d_numVisible,"data-p-carousel-item-start":0===i,"data-p-carousel-item-end":t.value.slice(-1*a.d_numVisible).length-1===i}),[p(t.$slots,"item",{data:e,index:i})],16,R)})),128)):f("",!0),(d(!0),h(I,null,_(t.value,(function(e,i){return d(),h("div",m({key:i,class:t.cx("item",{index:i}),role:"group","aria-hidden":s.firstIndex()>i||s.lastIndex()<i||void 0,"aria-label":s.ariaSlideNumber(i),"aria-roledescription":s.ariaSlideLabel},t.ptm("item"),{"data-p-carousel-item-active":s.firstIndex()<=i&&s.lastIndex()>=i,"data-p-carousel-item-start":s.firstIndex()===i,"data-p-carousel-item-end":s.lastIndex()===i}),[p(t.$slots,"item",{data:e,index:i})],16,E)})),128)),s.isCircular()?(d(!0),h(I,{key:1},_(t.value.slice(0,a.d_numVisible),(function(e,i){return d(),h("div",m({key:i+"_fcloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:a.totalShiftedItems,d_numVisible:a.d_numVisible})},t.ptm("itemCloned")),[p(t.$slots,"item",{data:e,index:i})],16)})),128)):f("",!0)],16)],16),t.showNavigators?b((d(),h("button",m({key:1,type:"button",class:t.cx("nextButton"),disabled:s.forwardIsDisabled,"aria-label":s.ariaNextButtonLabel,onClick:e[5]||(e[5]=function(){return s.navForward&&s.navForward.apply(s,arguments)})},O(O({},t.nextButtonProps),t.ptm("nextButton")),{"data-pc-group-section":"navigator"}),[p(t.$slots,"nexticon",{},(function(){return[(d(),g(y(s.isVertical()?"ChevronDownIcon":"ChevronRightIcon"),m({class:t.cx("nextButtonIcon")},t.ptm("nextButtonIcon")),null,16,["class"]))]}))],16,j)),[[o]]):f("",!0)],16,D),s.totalIndicators>=0&&t.showIndicators?(d(),h("ul",m({key:0,ref:"indicatorContent",class:[t.cx("indicators"),t.indicatorsContentClass],onKeydown:e[6]||(e[6]=function(){return s.onIndicatorKeydown&&s.onIndicatorKeydown.apply(s,arguments)})},t.ptm("indicators")),[(d(!0),h(I,null,_(s.totalIndicators,(function(e,i){return d(),h("li",m({key:"p-carousel-indicator-"+i.toString(),class:t.cx("indicator",{index:i})},t.ptm("indicator",s.getIndicatorPTOptions(i)),{"data-p-highlight":a.d_page===i}),[v("button",m({class:t.cx("indicatorButton"),type:"button",tabindex:a.d_page===i?"0":"-1","aria-label":s.ariaPageLabel(i+1),"aria-current":a.d_page===i?"page":void 0,onClick:function(t){return s.onIndicatorClick(t,i)}},t.ptm("indicatorButton",s.getIndicatorPTOptions(i))),null,16,K)],16,F)})),128))],16)):f("",!0)],16),t.$slots.footer?(d(),h("div",m({key:1,class:t.cx("footer")},t.ptm("footer")),[p(t.$slots,"footer")],16)):f("",!0)],16)};export{A as default};
|
|
1
|
+
import t from"primevue/icons/chevrondown";import e from"primevue/icons/chevronleft";import i from"primevue/icons/chevronright";import n from"primevue/icons/chevronup";import a from"primevue/ripple";import{DomHandler as s,ObjectUtils as o,UniqueComponentId as r}from"primevue/utils";import l from"primevue/basecomponent";import c from"primevue/carousel/style";import{resolveDirective as u,openBlock as d,createElementBlock as h,mergeProps as m,renderSlot as p,createCommentVNode as f,createElementVNode as v,withDirectives as b,createBlock as g,resolveDynamicComponent as y,Fragment as I,renderList as _}from"vue";function S(t){return V(t)||C(t)||w(t)||x()}function x(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return $(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?$(t,e):void 0}}function C(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function V(t){if(Array.isArray(t))return $(t)}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var A={name:"Carousel",extends:{name:"BaseCarousel",extends:l,props:{value:null,page:{type:Number,default:0},numVisible:{type:Number,default:1},numScroll:{type:Number,default:1},responsiveOptions:Array,orientation:{type:String,default:"horizontal"},verticalViewPortHeight:{type:String,default:"300px"},contentClass:String,containerClass:String,indicatorsContentClass:String,circular:{type:Boolean,default:!1},autoplayInterval:{type:Number,default:0},showNavigators:{type:Boolean,default:!0},showIndicators:{type:Boolean,default:!0},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},style:c,provide:function(){return{$parentInstance:this}}},emits:["update:page"],isRemainingItemsAdded:!1,data:function(){return{remainingItems:0,d_numVisible:this.numVisible,d_numScroll:this.numScroll,d_oldNumScroll:0,d_oldNumVisible:0,d_oldValue:null,d_page:this.page,totalShiftedItems:this.page*this.numScroll*-1,allowAutoplay:!!this.autoplayInterval,d_circular:this.circular||this.allowAutoplay,swipeThreshold:20}},watch:{page:function(t){t>this.d_page?this.navForward({},t):t<this.d_page&&this.navBackward({},t),this.d_page=t},circular:function(t){this.d_circular=t},numVisible:function(t,e){this.d_numVisible=t,this.d_oldNumVisible=e},numScroll:function(t,e){this.d_oldNumScroll=e,this.d_numScroll=t},value:function(t){this.d_oldValue=t}},mounted:function(){var t=!1;if(this.$el.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners(),this.isCircular()){var e=this.totalShiftedItems;0===this.d_page?e=-1*this.d_numVisible:0===e&&(e=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),e!==this.totalShiftedItems&&(this.totalShiftedItems=e,t=!0)}!t&&this.isAutoplay()&&this.startAutoplay()},updated:function(){var t=this.isCircular(),e=!1,i=this.totalShiftedItems;if(this.autoplayInterval&&this.stopAutoplay(),this.d_oldNumScroll!==this.d_numScroll||this.d_oldNumVisible!==this.d_numVisible||this.d_oldValue.length!==this.value.length){this.remainingItems=(this.value.length-this.d_numVisible)%this.d_numScroll;var n=this.d_page;0!==this.totalIndicators&&n>=this.totalIndicators&&(this.$emit("update:page",n=this.totalIndicators-1),this.d_page=n,e=!0),i=n*this.d_numScroll*-1,t&&(i-=this.d_numVisible),n===this.totalIndicators-1&&this.remainingItems>0?(i+=-1*this.remainingItems+this.d_numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0),this.d_oldNumScroll=this.d_numScroll,this.d_oldNumVisible=this.d_numVisible,this.d_oldValue=this.value,this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)")}t&&(0===this.d_page?i=-1*this.d_numVisible:0===i&&(i=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0)),!e&&this.isAutoplay()&&this.startAutoplay()},beforeUnmount:function(){this.responsiveOptions&&this.unbindDocumentListeners(),this.autoplayInterval&&this.stopAutoplay()},methods:{getIndicatorPTOptions:function(t){return{context:{highlighted:t===this.d_page}}},step:function(t,e){var i=this.totalShiftedItems,n=this.isCircular();null!=e?(i=this.d_numScroll*e*-1,n&&(i-=this.d_numVisible),this.isRemainingItemsAdded=!1):(i+=this.d_numScroll*t,this.isRemainingItemsAdded&&(i+=this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!1),e=Math.abs(Math.floor((n?i+this.d_numVisible:i)/this.d_numScroll)));n&&this.d_page===this.totalIndicators-1&&-1===t?(i=-1*(this.value.length+this.d_numVisible),e=0):n&&0===this.d_page&&1===t?(i=0,e=this.totalIndicators-1):e===this.totalIndicators-1&&this.remainingItems>0&&(i+=-1*this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!0),this.$refs.itemsContainer&&(!this.isUnstyled&&s.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)"),this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=i,this.$emit("update:page",e),this.d_page=e},calculatePosition:function(){if(this.$refs.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.numVisible,numScroll:this.numScroll},i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];parseInt(n.breakpoint,10)>=t&&(e=n)}if(this.d_numScroll!==e.numScroll){var a=this.d_page;a=parseInt(a*this.d_numScroll/e.numScroll),this.totalShiftedItems=e.numScroll*a*-1,this.isCircular()&&(this.totalShiftedItems-=e.numVisible),this.d_numScroll=e.numScroll,this.$emit("update:page",a),this.d_page=a}this.d_numVisible!==e.numVisible&&(this.d_numVisible=e.numVisible)}},navBackward:function(t,e){(this.d_circular||0!==this.d_page)&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},navForward:function(t,e){(this.d_circular||this.d_page<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},onIndicatorClick:function(t,e){var i=this.d_page;e>i?this.navForward(t,e):e<i&&this.navBackward(t,e)},onTransitionEnd:function(){this.$refs.itemsContainer&&(!this.isUnstyled&&s.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="",0!==this.d_page&&this.d_page!==this.totalIndicators-1||!this.isCircular()||(this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0, 0)")))},onTouchStart:function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},onTouchMove:function(t){t.cancelable&&t.preventDefault()},onTouchEnd:function(t){var e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)},changePageOnTouch:function(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))},onIndicatorKeydown:function(t){switch(t.code){case"ArrowRight":this.onRightKey();break;case"ArrowLeft":this.onLeftKey();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"ArrowUp":case"ArrowDown":case"PageUp":case"PageDown":t.preventDefault();break;case"Tab":this.onTabKey()}},onRightKey:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,e+1===t.length?t.length-1:e+1)},onLeftKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,t-1<=0?0:t-1)},onHomeKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,0)},onEndKey:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,t.length-1)},onTabKey:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=t.findIndex((function(t){return!0===s.getAttribute(t,"data-p-highlight")})),i=s.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]'),n=t.findIndex((function(t){return t===i.parentElement}));t[n].children[0].tabIndex="-1",t[e].children[0].tabIndex="0"},findFocusedIndicatorIndex:function(){var t=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=s.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]');return t.findIndex((function(t){return t===e.parentElement}))},changedFocusedIndicator:function(t,e){var i=S(s.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]'));i[t].children[0].tabIndex="-1",i[e].children[0].tabIndex="0",i[e].children[0].focus()},bindDocumentListeners:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(e){t.calculatePosition(e)},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},startAutoplay:function(){var t=this;this.interval=setInterval((function(){t.step(-1,t.d_page===t.totalIndicators-1?0:t.d_page+1)}),this.autoplayInterval)},stopAutoplay:function(){this.interval&&clearInterval(this.interval)},createStyle:function(){var t;this.carouselStyle||(this.carouselStyle=document.createElement("style"),this.carouselStyle.type="text/css",s.setAttribute(this.carouselStyle,"nonce",null===(t=this.$primevue)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.csp)||void 0===t?void 0:t.nonce),document.body.appendChild(this.carouselStyle));var e="\n .p-carousel[".concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/this.d_numVisible,"%\n }\n ");if(this.responsiveOptions&&!this.isUnstyled){var i=S(this.responsiveOptions),n=o.localeComparator();i.sort((function(t,e){return o.sort(t.breakpoint,e.breakpoint,-1,n)}));for(var a=0;a<i.length;a++){var r=i[a];e+="\n @media screen and (max-width: ".concat(r.breakpoint,") {\n .p-carousel[").concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/r.numVisible,"%\n }\n }\n ")}}this.carouselStyle.innerHTML=e},isVertical:function(){return"vertical"===this.orientation},isCircular:function(){return this.value&&this.d_circular&&this.value.length>=this.d_numVisible},isAutoplay:function(){return this.autoplayInterval&&this.allowAutoplay},firstIndex:function(){return this.isCircular()?-1*(this.totalShiftedItems+this.d_numVisible):-1*this.totalShiftedItems},lastIndex:function(){return this.firstIndex()+this.d_numVisible-1},ariaSlideNumber:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g,t):void 0},ariaPageLabel:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,t):void 0}},computed:{totalIndicators:function(){return this.value?Math.max(Math.ceil((this.value.length-this.d_numVisible)/this.d_numScroll)+1,0):0},backwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&0===this.d_page},forwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&(this.d_page===this.totalIndicators-1||0===this.totalIndicators)},ariaSlideLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slide:void 0},ariaPrevButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.prevPageLabel:void 0},ariaNextButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.nextPageLabel:void 0},attributeSelector:function(){return r()}},components:{ChevronRightIcon:i,ChevronDownIcon:t,ChevronLeftIcon:e,ChevronUpIcon:n},directives:{ripple:a}};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function k(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function O(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?k(Object(i),!0).forEach((function(e){T(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function T(t,e,i){var n;return(e="symbol"==P(n=L(e,"string"))?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function L(t,e){if("object"!=P(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var B=["aria-live"],D=["disabled","aria-label"],N=["data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],R=["aria-hidden","aria-label","aria-roledescription","data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],E=["disabled","aria-label"],j=["data-p-highlight"],F=["tabindex","aria-label","aria-current","onClick"];A.render=function(t,e,i,n,a,s){var o=u("ripple");return d(),h("div",m({class:t.cx("root"),role:"region"},t.ptm("root")),[t.$slots.header?(d(),h("div",m({key:0,class:t.cx("header")},t.ptm("header")),[p(t.$slots,"header")],16)):f("",!0),v("div",m({class:[t.cx("content"),t.contentClass]},t.ptm("content")),[v("div",m({class:[t.cx("container"),t.containerClass],"aria-live":a.allowAutoplay?"polite":"off"},t.ptm("container")),[t.showNavigators?b((d(),h("button",m({key:0,type:"button",class:t.cx("previousButton"),disabled:s.backwardIsDisabled,"aria-label":s.ariaPrevButtonLabel,onClick:e[0]||(e[0]=function(){return s.navBackward&&s.navBackward.apply(s,arguments)})},O(O({},t.prevButtonProps),t.ptm("previousButton")),{"data-pc-group-section":"navigator"}),[p(t.$slots,"previousicon",{},(function(){return[(d(),g(y(s.isVertical()?"ChevronUpIcon":"ChevronLeftIcon"),m({class:t.cx("previousButtonIcon")},t.ptm("previousButtonIcon")),null,16,["class"]))]}))],16,D)),[[o]]):f("",!0),v("div",m({class:t.cx("itemsContent"),style:[{height:s.isVertical()?t.verticalViewPortHeight:"auto"}],onTouchend:e[2]||(e[2]=function(){return s.onTouchEnd&&s.onTouchEnd.apply(s,arguments)}),onTouchstart:e[3]||(e[3]=function(){return s.onTouchStart&&s.onTouchStart.apply(s,arguments)}),onTouchmove:e[4]||(e[4]=function(){return s.onTouchMove&&s.onTouchMove.apply(s,arguments)})},t.ptm("itemsContent")),[v("div",m({ref:"itemsContainer",class:t.cx("itemsContainer"),onTransitionend:e[1]||(e[1]=function(){return s.onTransitionEnd&&s.onTransitionEnd.apply(s,arguments)})},t.ptm("itemsContainer")),[s.isCircular()?(d(!0),h(I,{key:0},_(t.value.slice(-1*a.d_numVisible),(function(e,i){return d(),h("div",m({key:i+"_scloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:a.totalShiftedItems,d_numVisible:a.d_numVisible})},t.ptm("itemCloned"),{"data-p-carousel-item-active":-1*a.totalShiftedItems===t.value.length+a.d_numVisible,"data-p-carousel-item-start":0===i,"data-p-carousel-item-end":t.value.slice(-1*a.d_numVisible).length-1===i}),[p(t.$slots,"item",{data:e,index:i})],16,N)})),128)):f("",!0),(d(!0),h(I,null,_(t.value,(function(e,i){return d(),h("div",m({key:i,class:t.cx("item",{index:i}),role:"group","aria-hidden":s.firstIndex()>i||s.lastIndex()<i||void 0,"aria-label":s.ariaSlideNumber(i),"aria-roledescription":s.ariaSlideLabel},t.ptm("item"),{"data-p-carousel-item-active":s.firstIndex()<=i&&s.lastIndex()>=i,"data-p-carousel-item-start":s.firstIndex()===i,"data-p-carousel-item-end":s.lastIndex()===i}),[p(t.$slots,"item",{data:e,index:i})],16,R)})),128)),s.isCircular()?(d(!0),h(I,{key:1},_(t.value.slice(0,a.d_numVisible),(function(e,i){return d(),h("div",m({key:i+"_fcloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:a.totalShiftedItems,d_numVisible:a.d_numVisible})},t.ptm("itemCloned")),[p(t.$slots,"item",{data:e,index:i})],16)})),128)):f("",!0)],16)],16),t.showNavigators?b((d(),h("button",m({key:1,type:"button",class:t.cx("nextButton"),disabled:s.forwardIsDisabled,"aria-label":s.ariaNextButtonLabel,onClick:e[5]||(e[5]=function(){return s.navForward&&s.navForward.apply(s,arguments)})},O(O({},t.nextButtonProps),t.ptm("nextButton")),{"data-pc-group-section":"navigator"}),[p(t.$slots,"nexticon",{},(function(){return[(d(),g(y(s.isVertical()?"ChevronDownIcon":"ChevronRightIcon"),m({class:t.cx("nextButtonIcon")},t.ptm("nextButtonIcon")),null,16,["class"]))]}))],16,E)),[[o]]):f("",!0)],16,B),s.totalIndicators>=0&&t.showIndicators?(d(),h("ul",m({key:0,ref:"indicatorContent",class:[t.cx("indicators"),t.indicatorsContentClass],onKeydown:e[6]||(e[6]=function(){return s.onIndicatorKeydown&&s.onIndicatorKeydown.apply(s,arguments)})},t.ptm("indicators")),[(d(!0),h(I,null,_(s.totalIndicators,(function(e,i){return d(),h("li",m({key:"p-carousel-indicator-"+i.toString(),class:t.cx("indicator",{index:i})},t.ptm("indicator",s.getIndicatorPTOptions(i)),{"data-p-highlight":a.d_page===i}),[v("button",m({class:t.cx("indicatorButton"),type:"button",tabindex:a.d_page===i?"0":"-1","aria-label":s.ariaPageLabel(i+1),"aria-current":a.d_page===i?"page":void 0,onClick:function(t){return s.onIndicatorClick(t,i)}},t.ptm("indicatorButton",s.getIndicatorPTOptions(i))),null,16,F)],16,j)})),128))],16)):f("",!0)],16),t.$slots.footer?(d(),h("div",m({key:1,class:t.cx("footer")},t.ptm("footer")),[p(t.$slots,"footer")],16)):f("",!0)],16)};export{A as default};
|
package/carousel/carousel.js
CHANGED
|
@@ -536,8 +536,8 @@ this.primevue.carousel = (function (ChevronDownIcon, ChevronLeftIcon, ChevronRig
|
|
|
536
536
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
537
537
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
538
538
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
539
|
-
function _toPropertyKey(
|
|
540
|
-
function _toPrimitive(
|
|
539
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
540
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
541
541
|
var _hoisted_1 = ["aria-live"];
|
|
542
542
|
var _hoisted_2 = ["disabled", "aria-label"];
|
|
543
543
|
var _hoisted_3 = ["data-p-carousel-item-active", "data-p-carousel-item-start", "data-p-carousel-item-end"];
|
package/carousel/carousel.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.carousel=function(t,e,i,n,o,a,r,s,l){"use strict";function c(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var d=c(t),u=c(e),h=c(i),m=c(n),p=c(o);function f(t){return y(t)||b(t)||g(t)||v()}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(t,e){if(t){if("string"==typeof t)return I(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?I(t,e):void 0}}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function y(t){if(Array.isArray(t))return I(t)}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var S={name:"Carousel",extends:{name:"BaseCarousel",extends:c(r).default,props:{value:null,page:{type:Number,default:0},numVisible:{type:Number,default:1},numScroll:{type:Number,default:1},responsiveOptions:Array,orientation:{type:String,default:"horizontal"},verticalViewPortHeight:{type:String,default:"300px"},contentClass:String,containerClass:String,indicatorsContentClass:String,circular:{type:Boolean,default:!1},autoplayInterval:{type:Number,default:0},showNavigators:{type:Boolean,default:!0},showIndicators:{type:Boolean,default:!0},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},style:c(s).default,provide:function(){return{$parentInstance:this}}},emits:["update:page"],isRemainingItemsAdded:!1,data:function(){return{remainingItems:0,d_numVisible:this.numVisible,d_numScroll:this.numScroll,d_oldNumScroll:0,d_oldNumVisible:0,d_oldValue:null,d_page:this.page,totalShiftedItems:this.page*this.numScroll*-1,allowAutoplay:!!this.autoplayInterval,d_circular:this.circular||this.allowAutoplay,swipeThreshold:20}},watch:{page:function(t){t>this.d_page?this.navForward({},t):t<this.d_page&&this.navBackward({},t),this.d_page=t},circular:function(t){this.d_circular=t},numVisible:function(t,e){this.d_numVisible=t,this.d_oldNumVisible=e},numScroll:function(t,e){this.d_oldNumScroll=e,this.d_numScroll=t},value:function(t){this.d_oldValue=t}},mounted:function(){var t=!1;if(this.$el.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners(),this.isCircular()){var e=this.totalShiftedItems;0===this.d_page?e=-1*this.d_numVisible:0===e&&(e=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),e!==this.totalShiftedItems&&(this.totalShiftedItems=e,t=!0)}!t&&this.isAutoplay()&&this.startAutoplay()},updated:function(){var t=this.isCircular(),e=!1,i=this.totalShiftedItems;if(this.autoplayInterval&&this.stopAutoplay(),this.d_oldNumScroll!==this.d_numScroll||this.d_oldNumVisible!==this.d_numVisible||this.d_oldValue.length!==this.value.length){this.remainingItems=(this.value.length-this.d_numVisible)%this.d_numScroll;var n=this.d_page;0!==this.totalIndicators&&n>=this.totalIndicators&&(this.$emit("update:page",n=this.totalIndicators-1),this.d_page=n,e=!0),i=n*this.d_numScroll*-1,t&&(i-=this.d_numVisible),n===this.totalIndicators-1&&this.remainingItems>0?(i+=-1*this.remainingItems+this.d_numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0),this.d_oldNumScroll=this.d_numScroll,this.d_oldNumVisible=this.d_numVisible,this.d_oldValue=this.value,this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)")}t&&(0===this.d_page?i=-1*this.d_numVisible:0===i&&(i=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0)),!e&&this.isAutoplay()&&this.startAutoplay()},beforeUnmount:function(){this.responsiveOptions&&this.unbindDocumentListeners(),this.autoplayInterval&&this.stopAutoplay()},methods:{getIndicatorPTOptions:function(t){return{context:{highlighted:t===this.d_page}}},step:function(t,e){var i=this.totalShiftedItems,n=this.isCircular();null!=e?(i=this.d_numScroll*e*-1,n&&(i-=this.d_numVisible),this.isRemainingItemsAdded=!1):(i+=this.d_numScroll*t,this.isRemainingItemsAdded&&(i+=this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!1),e=Math.abs(Math.floor((n?i+this.d_numVisible:i)/this.d_numScroll)));n&&this.d_page===this.totalIndicators-1&&-1===t?(i=-1*(this.value.length+this.d_numVisible),e=0):n&&0===this.d_page&&1===t?(i=0,e=this.totalIndicators-1):e===this.totalIndicators-1&&this.remainingItems>0&&(i+=-1*this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!0),this.$refs.itemsContainer&&(!this.isUnstyled&&a.DomHandler.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)"),this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=i,this.$emit("update:page",e),this.d_page=e},calculatePosition:function(){if(this.$refs.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.numVisible,numScroll:this.numScroll},i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];parseInt(n.breakpoint,10)>=t&&(e=n)}if(this.d_numScroll!==e.numScroll){var o=this.d_page;o=parseInt(o*this.d_numScroll/e.numScroll),this.totalShiftedItems=e.numScroll*o*-1,this.isCircular()&&(this.totalShiftedItems-=e.numVisible),this.d_numScroll=e.numScroll,this.$emit("update:page",o),this.d_page=o}this.d_numVisible!==e.numVisible&&(this.d_numVisible=e.numVisible)}},navBackward:function(t,e){(this.d_circular||0!==this.d_page)&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},navForward:function(t,e){(this.d_circular||this.d_page<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},onIndicatorClick:function(t,e){var i=this.d_page;e>i?this.navForward(t,e):e<i&&this.navBackward(t,e)},onTransitionEnd:function(){this.$refs.itemsContainer&&(!this.isUnstyled&&a.DomHandler.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="",0!==this.d_page&&this.d_page!==this.totalIndicators-1||!this.isCircular()||(this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0, 0)")))},onTouchStart:function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},onTouchMove:function(t){t.cancelable&&t.preventDefault()},onTouchEnd:function(t){var e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)},changePageOnTouch:function(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))},onIndicatorKeydown:function(t){switch(t.code){case"ArrowRight":this.onRightKey();break;case"ArrowLeft":this.onLeftKey();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"ArrowUp":case"ArrowDown":case"PageUp":case"PageDown":t.preventDefault();break;case"Tab":this.onTabKey()}},onRightKey:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,e+1===t.length?t.length-1:e+1)},onLeftKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,t-1<=0?0:t-1)},onHomeKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,0)},onEndKey:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,t.length-1)},onTabKey:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=t.findIndex((function(t){return!0===a.DomHandler.getAttribute(t,"data-p-highlight")})),i=a.DomHandler.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]'),n=t.findIndex((function(t){return t===i.parentElement}));t[n].children[0].tabIndex="-1",t[e].children[0].tabIndex="0"},findFocusedIndicatorIndex:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=a.DomHandler.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]');return t.findIndex((function(t){return t===e.parentElement}))},changedFocusedIndicator:function(t,e){var i=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]'));i[t].children[0].tabIndex="-1",i[e].children[0].tabIndex="0",i[e].children[0].focus()},bindDocumentListeners:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(e){t.calculatePosition(e)},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},startAutoplay:function(){var t=this;this.interval=setInterval((function(){t.step(-1,t.d_page===t.totalIndicators-1?0:t.d_page+1)}),this.autoplayInterval)},stopAutoplay:function(){this.interval&&clearInterval(this.interval)},createStyle:function(){var t;this.carouselStyle||(this.carouselStyle=document.createElement("style"),this.carouselStyle.type="text/css",a.DomHandler.setAttribute(this.carouselStyle,"nonce",null===(t=this.$primevue)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.csp)||void 0===t?void 0:t.nonce),document.body.appendChild(this.carouselStyle));var e="\n .p-carousel[".concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/this.d_numVisible,"%\n }\n ");if(this.responsiveOptions&&!this.isUnstyled){var i=f(this.responsiveOptions),n=a.ObjectUtils.localeComparator();i.sort((function(t,e){return a.ObjectUtils.sort(t.breakpoint,e.breakpoint,-1,n)}));for(var o=0;o<i.length;o++){var r=i[o];e+="\n @media screen and (max-width: ".concat(r.breakpoint,") {\n .p-carousel[").concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/r.numVisible,"%\n }\n }\n ")}}this.carouselStyle.innerHTML=e},isVertical:function(){return"vertical"===this.orientation},isCircular:function(){return this.value&&this.d_circular&&this.value.length>=this.d_numVisible},isAutoplay:function(){return this.autoplayInterval&&this.allowAutoplay},firstIndex:function(){return this.isCircular()?-1*(this.totalShiftedItems+this.d_numVisible):-1*this.totalShiftedItems},lastIndex:function(){return this.firstIndex()+this.d_numVisible-1},ariaSlideNumber:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g,t):void 0},ariaPageLabel:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,t):void 0}},computed:{totalIndicators:function(){return this.value?Math.max(Math.ceil((this.value.length-this.d_numVisible)/this.d_numScroll)+1,0):0},backwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&0===this.d_page},forwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&(this.d_page===this.totalIndicators-1||0===this.totalIndicators)},ariaSlideLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slide:void 0},ariaPrevButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.prevPageLabel:void 0},ariaNextButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.nextPageLabel:void 0},attributeSelector:function(){return a.UniqueComponentId()}},components:{ChevronRightIcon:h.default,ChevronDownIcon:d.default,ChevronLeftIcon:u.default,ChevronUpIcon:m.default},directives:{ripple:p.default}};function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function C(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function V(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?C(Object(i),!0).forEach((function(e){x(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):C(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function x(t,e,i){return(e=k(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function k(t){var e=w(t,"string");return"symbol"===_(e)?e:String(e)}function w(t,e){if("object"!==_(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var B=["aria-live"],P=["disabled","aria-label"],$=["data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],A=["aria-hidden","aria-label","aria-roledescription","data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],D=["disabled","aria-label"],E=["data-p-highlight"],O=["tabindex","aria-label","aria-current","onClick"];return S.render=function(t,e,i,n,o,a){var r=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",l.mergeProps({class:t.cx("root"),role:"region"},t.ptm("root")),[t.$slots.header?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:t.cx("header")},t.ptm("header")),[l.renderSlot(t.$slots,"header")],16)):l.createCommentVNode("",!0),l.createElementVNode("div",l.mergeProps({class:[t.cx("content"),t.contentClass]},t.ptm("content")),[l.createElementVNode("div",l.mergeProps({class:[t.cx("container"),t.containerClass],"aria-live":o.allowAutoplay?"polite":"off"},t.ptm("container")),[t.showNavigators?l.withDirectives((l.openBlock(),l.createElementBlock("button",l.mergeProps({key:0,type:"button",class:t.cx("previousButton"),disabled:a.backwardIsDisabled,"aria-label":a.ariaPrevButtonLabel,onClick:e[0]||(e[0]=function(){return a.navBackward&&a.navBackward.apply(a,arguments)})},V(V({},t.prevButtonProps),t.ptm("previousButton")),{"data-pc-group-section":"navigator"}),[l.renderSlot(t.$slots,"previousicon",{},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(a.isVertical()?"ChevronUpIcon":"ChevronLeftIcon"),l.mergeProps({class:t.cx("previousButtonIcon")},t.ptm("previousButtonIcon")),null,16,["class"]))]}))],16,P)),[[r]]):l.createCommentVNode("",!0),l.createElementVNode("div",l.mergeProps({class:t.cx("itemsContent"),style:[{height:a.isVertical()?t.verticalViewPortHeight:"auto"}],onTouchend:e[2]||(e[2]=function(){return a.onTouchEnd&&a.onTouchEnd.apply(a,arguments)}),onTouchstart:e[3]||(e[3]=function(){return a.onTouchStart&&a.onTouchStart.apply(a,arguments)}),onTouchmove:e[4]||(e[4]=function(){return a.onTouchMove&&a.onTouchMove.apply(a,arguments)})},t.ptm("itemsContent")),[l.createElementVNode("div",l.mergeProps({ref:"itemsContainer",class:t.cx("itemsContainer"),onTransitionend:e[1]||(e[1]=function(){return a.onTransitionEnd&&a.onTransitionEnd.apply(a,arguments)})},t.ptm("itemsContainer")),[a.isCircular()?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(t.value.slice(-1*o.d_numVisible),(function(e,i){return l.openBlock(),l.createElementBlock("div",l.mergeProps({key:i+"_scloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:o.totalShiftedItems,d_numVisible:o.d_numVisible})},t.ptm("itemCloned"),{"data-p-carousel-item-active":-1*o.totalShiftedItems===t.value.length+o.d_numVisible,"data-p-carousel-item-start":0===i,"data-p-carousel-item-end":t.value.slice(-1*o.d_numVisible).length-1===i}),[l.renderSlot(t.$slots,"item",{data:e,index:i})],16,$)})),128)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(function(e,i){return l.openBlock(),l.createElementBlock("div",l.mergeProps({key:i,class:t.cx("item",{index:i}),role:"group","aria-hidden":a.firstIndex()>i||a.lastIndex()<i||void 0,"aria-label":a.ariaSlideNumber(i),"aria-roledescription":a.ariaSlideLabel},t.ptm("item"),{"data-p-carousel-item-active":a.firstIndex()<=i&&a.lastIndex()>=i,"data-p-carousel-item-start":a.firstIndex()===i,"data-p-carousel-item-end":a.lastIndex()===i}),[l.renderSlot(t.$slots,"item",{data:e,index:i})],16,A)})),128)),a.isCircular()?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(t.value.slice(0,o.d_numVisible),(function(e,i){return l.openBlock(),l.createElementBlock("div",l.mergeProps({key:i+"_fcloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:o.totalShiftedItems,d_numVisible:o.d_numVisible})},t.ptm("itemCloned")),[l.renderSlot(t.$slots,"item",{data:e,index:i})],16)})),128)):l.createCommentVNode("",!0)],16)],16),t.showNavigators?l.withDirectives((l.openBlock(),l.createElementBlock("button",l.mergeProps({key:1,type:"button",class:t.cx("nextButton"),disabled:a.forwardIsDisabled,"aria-label":a.ariaNextButtonLabel,onClick:e[5]||(e[5]=function(){return a.navForward&&a.navForward.apply(a,arguments)})},V(V({},t.nextButtonProps),t.ptm("nextButton")),{"data-pc-group-section":"navigator"}),[l.renderSlot(t.$slots,"nexticon",{},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(a.isVertical()?"ChevronDownIcon":"ChevronRightIcon"),l.mergeProps({class:t.cx("nextButtonIcon")},t.ptm("nextButtonIcon")),null,16,["class"]))]}))],16,D)),[[r]]):l.createCommentVNode("",!0)],16,B),a.totalIndicators>=0&&t.showIndicators?(l.openBlock(),l.createElementBlock("ul",l.mergeProps({key:0,ref:"indicatorContent",class:[t.cx("indicators"),t.indicatorsContentClass],onKeydown:e[6]||(e[6]=function(){return a.onIndicatorKeydown&&a.onIndicatorKeydown.apply(a,arguments)})},t.ptm("indicators")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.totalIndicators,(function(e,i){return l.openBlock(),l.createElementBlock("li",l.mergeProps({key:"p-carousel-indicator-"+i.toString(),class:t.cx("indicator",{index:i})},t.ptm("indicator",a.getIndicatorPTOptions(i)),{"data-p-highlight":o.d_page===i}),[l.createElementVNode("button",l.mergeProps({class:t.cx("indicatorButton"),type:"button",tabindex:o.d_page===i?"0":"-1","aria-label":a.ariaPageLabel(i+1),"aria-current":o.d_page===i?"page":void 0,onClick:function(t){return a.onIndicatorClick(t,i)}},t.ptm("indicatorButton",a.getIndicatorPTOptions(i))),null,16,O)],16,E)})),128))],16)):l.createCommentVNode("",!0)],16),t.$slots.footer?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:1,class:t.cx("footer")},t.ptm("footer")),[l.renderSlot(t.$slots,"footer")],16)):l.createCommentVNode("",!0)],16)},S}(primevue.icons.chevrondown,primevue.icons.chevronleft,primevue.icons.chevronright,primevue.icons.chevronup,primevue.ripple,primevue.utils,primevue.basecomponent,primevue.carousel.style,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.carousel=function(t,e,i,n,o,a,r,s,l){"use strict";function c(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var d=c(t),u=c(e),h=c(i),m=c(n),p=c(o);function f(t){return y(t)||b(t)||g(t)||v()}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(t,e){if(t){if("string"==typeof t)return I(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?I(t,e):void 0}}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function y(t){if(Array.isArray(t))return I(t)}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var S={name:"Carousel",extends:{name:"BaseCarousel",extends:c(r).default,props:{value:null,page:{type:Number,default:0},numVisible:{type:Number,default:1},numScroll:{type:Number,default:1},responsiveOptions:Array,orientation:{type:String,default:"horizontal"},verticalViewPortHeight:{type:String,default:"300px"},contentClass:String,containerClass:String,indicatorsContentClass:String,circular:{type:Boolean,default:!1},autoplayInterval:{type:Number,default:0},showNavigators:{type:Boolean,default:!0},showIndicators:{type:Boolean,default:!0},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},style:c(s).default,provide:function(){return{$parentInstance:this}}},emits:["update:page"],isRemainingItemsAdded:!1,data:function(){return{remainingItems:0,d_numVisible:this.numVisible,d_numScroll:this.numScroll,d_oldNumScroll:0,d_oldNumVisible:0,d_oldValue:null,d_page:this.page,totalShiftedItems:this.page*this.numScroll*-1,allowAutoplay:!!this.autoplayInterval,d_circular:this.circular||this.allowAutoplay,swipeThreshold:20}},watch:{page:function(t){t>this.d_page?this.navForward({},t):t<this.d_page&&this.navBackward({},t),this.d_page=t},circular:function(t){this.d_circular=t},numVisible:function(t,e){this.d_numVisible=t,this.d_oldNumVisible=e},numScroll:function(t,e){this.d_oldNumScroll=e,this.d_numScroll=t},value:function(t){this.d_oldValue=t}},mounted:function(){var t=!1;if(this.$el.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners(),this.isCircular()){var e=this.totalShiftedItems;0===this.d_page?e=-1*this.d_numVisible:0===e&&(e=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),e!==this.totalShiftedItems&&(this.totalShiftedItems=e,t=!0)}!t&&this.isAutoplay()&&this.startAutoplay()},updated:function(){var t=this.isCircular(),e=!1,i=this.totalShiftedItems;if(this.autoplayInterval&&this.stopAutoplay(),this.d_oldNumScroll!==this.d_numScroll||this.d_oldNumVisible!==this.d_numVisible||this.d_oldValue.length!==this.value.length){this.remainingItems=(this.value.length-this.d_numVisible)%this.d_numScroll;var n=this.d_page;0!==this.totalIndicators&&n>=this.totalIndicators&&(this.$emit("update:page",n=this.totalIndicators-1),this.d_page=n,e=!0),i=n*this.d_numScroll*-1,t&&(i-=this.d_numVisible),n===this.totalIndicators-1&&this.remainingItems>0?(i+=-1*this.remainingItems+this.d_numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0),this.d_oldNumScroll=this.d_numScroll,this.d_oldNumVisible=this.d_numVisible,this.d_oldValue=this.value,this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)")}t&&(0===this.d_page?i=-1*this.d_numVisible:0===i&&(i=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),i!==this.totalShiftedItems&&(this.totalShiftedItems=i,e=!0)),!e&&this.isAutoplay()&&this.startAutoplay()},beforeUnmount:function(){this.responsiveOptions&&this.unbindDocumentListeners(),this.autoplayInterval&&this.stopAutoplay()},methods:{getIndicatorPTOptions:function(t){return{context:{highlighted:t===this.d_page}}},step:function(t,e){var i=this.totalShiftedItems,n=this.isCircular();null!=e?(i=this.d_numScroll*e*-1,n&&(i-=this.d_numVisible),this.isRemainingItemsAdded=!1):(i+=this.d_numScroll*t,this.isRemainingItemsAdded&&(i+=this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!1),e=Math.abs(Math.floor((n?i+this.d_numVisible:i)/this.d_numScroll)));n&&this.d_page===this.totalIndicators-1&&-1===t?(i=-1*(this.value.length+this.d_numVisible),e=0):n&&0===this.d_page&&1===t?(i=0,e=this.totalIndicators-1):e===this.totalIndicators-1&&this.remainingItems>0&&(i+=-1*this.remainingItems-this.d_numScroll*t,this.isRemainingItemsAdded=!0),this.$refs.itemsContainer&&(!this.isUnstyled&&a.DomHandler.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(i*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.d_numVisible),"%, 0, 0)"),this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=i,this.$emit("update:page",e),this.d_page=e},calculatePosition:function(){if(this.$refs.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.numVisible,numScroll:this.numScroll},i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];parseInt(n.breakpoint,10)>=t&&(e=n)}if(this.d_numScroll!==e.numScroll){var o=this.d_page;o=parseInt(o*this.d_numScroll/e.numScroll),this.totalShiftedItems=e.numScroll*o*-1,this.isCircular()&&(this.totalShiftedItems-=e.numVisible),this.d_numScroll=e.numScroll,this.$emit("update:page",o),this.d_page=o}this.d_numVisible!==e.numVisible&&(this.d_numVisible=e.numVisible)}},navBackward:function(t,e){(this.d_circular||0!==this.d_page)&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},navForward:function(t,e){(this.d_circular||this.d_page<this.totalIndicators-1)&&this.step(-1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()},onIndicatorClick:function(t,e){var i=this.d_page;e>i?this.navForward(t,e):e<i&&this.navBackward(t,e)},onTransitionEnd:function(){this.$refs.itemsContainer&&(!this.isUnstyled&&a.DomHandler.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="",0!==this.d_page&&this.d_page!==this.totalIndicators-1||!this.isCircular()||(this.$refs.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0)"):"translate3d(".concat(this.totalShiftedItems*(100/this.d_numVisible),"%, 0, 0)")))},onTouchStart:function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},onTouchMove:function(t){t.cancelable&&t.preventDefault()},onTouchEnd:function(t){var e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)},changePageOnTouch:function(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))},onIndicatorKeydown:function(t){switch(t.code){case"ArrowRight":this.onRightKey();break;case"ArrowLeft":this.onLeftKey();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"ArrowUp":case"ArrowDown":case"PageUp":case"PageDown":t.preventDefault();break;case"Tab":this.onTabKey()}},onRightKey:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,e+1===t.length?t.length-1:e+1)},onLeftKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,t-1<=0?0:t-1)},onHomeKey:function(){var t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,0)},onEndKey:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,t.length-1)},onTabKey:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=t.findIndex((function(t){return!0===a.DomHandler.getAttribute(t,"data-p-highlight")})),i=a.DomHandler.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]'),n=t.findIndex((function(t){return t===i.parentElement}));t[n].children[0].tabIndex="-1",t[e].children[0].tabIndex="0"},findFocusedIndicatorIndex:function(){var t=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]')),e=a.DomHandler.findSingle(this.$refs.indicatorContent,'[data-pc-section="indicator"] > button[tabindex="0"]');return t.findIndex((function(t){return t===e.parentElement}))},changedFocusedIndicator:function(t,e){var i=f(a.DomHandler.find(this.$refs.indicatorContent,'[data-pc-section="indicator"]'));i[t].children[0].tabIndex="-1",i[e].children[0].tabIndex="0",i[e].children[0].focus()},bindDocumentListeners:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(e){t.calculatePosition(e)},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},startAutoplay:function(){var t=this;this.interval=setInterval((function(){t.step(-1,t.d_page===t.totalIndicators-1?0:t.d_page+1)}),this.autoplayInterval)},stopAutoplay:function(){this.interval&&clearInterval(this.interval)},createStyle:function(){var t;this.carouselStyle||(this.carouselStyle=document.createElement("style"),this.carouselStyle.type="text/css",a.DomHandler.setAttribute(this.carouselStyle,"nonce",null===(t=this.$primevue)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.csp)||void 0===t?void 0:t.nonce),document.body.appendChild(this.carouselStyle));var e="\n .p-carousel[".concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/this.d_numVisible,"%\n }\n ");if(this.responsiveOptions&&!this.isUnstyled){var i=f(this.responsiveOptions),n=a.ObjectUtils.localeComparator();i.sort((function(t,e){return a.ObjectUtils.sort(t.breakpoint,e.breakpoint,-1,n)}));for(var o=0;o<i.length;o++){var r=i[o];e+="\n @media screen and (max-width: ".concat(r.breakpoint,") {\n .p-carousel[").concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/r.numVisible,"%\n }\n }\n ")}}this.carouselStyle.innerHTML=e},isVertical:function(){return"vertical"===this.orientation},isCircular:function(){return this.value&&this.d_circular&&this.value.length>=this.d_numVisible},isAutoplay:function(){return this.autoplayInterval&&this.allowAutoplay},firstIndex:function(){return this.isCircular()?-1*(this.totalShiftedItems+this.d_numVisible):-1*this.totalShiftedItems},lastIndex:function(){return this.firstIndex()+this.d_numVisible-1},ariaSlideNumber:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g,t):void 0},ariaPageLabel:function(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,t):void 0}},computed:{totalIndicators:function(){return this.value?Math.max(Math.ceil((this.value.length-this.d_numVisible)/this.d_numScroll)+1,0):0},backwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&0===this.d_page},forwardIsDisabled:function(){return this.value&&(!this.circular||this.value.length<this.d_numVisible)&&(this.d_page===this.totalIndicators-1||0===this.totalIndicators)},ariaSlideLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slide:void 0},ariaPrevButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.prevPageLabel:void 0},ariaNextButtonLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.nextPageLabel:void 0},attributeSelector:function(){return a.UniqueComponentId()}},components:{ChevronRightIcon:h.default,ChevronDownIcon:d.default,ChevronLeftIcon:u.default,ChevronUpIcon:m.default},directives:{ripple:p.default}};function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function C(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function V(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?C(Object(i),!0).forEach((function(e){x(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):C(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function x(t,e,i){var n;return(e="symbol"==_(n=k(e,"string"))?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function k(t,e){if("object"!=_(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var w=["aria-live"],B=["disabled","aria-label"],P=["data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],$=["aria-hidden","aria-label","aria-roledescription","data-p-carousel-item-active","data-p-carousel-item-start","data-p-carousel-item-end"],A=["disabled","aria-label"],D=["data-p-highlight"],E=["tabindex","aria-label","aria-current","onClick"];return S.render=function(t,e,i,n,o,a){var r=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",l.mergeProps({class:t.cx("root"),role:"region"},t.ptm("root")),[t.$slots.header?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:t.cx("header")},t.ptm("header")),[l.renderSlot(t.$slots,"header")],16)):l.createCommentVNode("",!0),l.createElementVNode("div",l.mergeProps({class:[t.cx("content"),t.contentClass]},t.ptm("content")),[l.createElementVNode("div",l.mergeProps({class:[t.cx("container"),t.containerClass],"aria-live":o.allowAutoplay?"polite":"off"},t.ptm("container")),[t.showNavigators?l.withDirectives((l.openBlock(),l.createElementBlock("button",l.mergeProps({key:0,type:"button",class:t.cx("previousButton"),disabled:a.backwardIsDisabled,"aria-label":a.ariaPrevButtonLabel,onClick:e[0]||(e[0]=function(){return a.navBackward&&a.navBackward.apply(a,arguments)})},V(V({},t.prevButtonProps),t.ptm("previousButton")),{"data-pc-group-section":"navigator"}),[l.renderSlot(t.$slots,"previousicon",{},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(a.isVertical()?"ChevronUpIcon":"ChevronLeftIcon"),l.mergeProps({class:t.cx("previousButtonIcon")},t.ptm("previousButtonIcon")),null,16,["class"]))]}))],16,B)),[[r]]):l.createCommentVNode("",!0),l.createElementVNode("div",l.mergeProps({class:t.cx("itemsContent"),style:[{height:a.isVertical()?t.verticalViewPortHeight:"auto"}],onTouchend:e[2]||(e[2]=function(){return a.onTouchEnd&&a.onTouchEnd.apply(a,arguments)}),onTouchstart:e[3]||(e[3]=function(){return a.onTouchStart&&a.onTouchStart.apply(a,arguments)}),onTouchmove:e[4]||(e[4]=function(){return a.onTouchMove&&a.onTouchMove.apply(a,arguments)})},t.ptm("itemsContent")),[l.createElementVNode("div",l.mergeProps({ref:"itemsContainer",class:t.cx("itemsContainer"),onTransitionend:e[1]||(e[1]=function(){return a.onTransitionEnd&&a.onTransitionEnd.apply(a,arguments)})},t.ptm("itemsContainer")),[a.isCircular()?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(t.value.slice(-1*o.d_numVisible),(function(e,i){return l.openBlock(),l.createElementBlock("div",l.mergeProps({key:i+"_scloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:o.totalShiftedItems,d_numVisible:o.d_numVisible})},t.ptm("itemCloned"),{"data-p-carousel-item-active":-1*o.totalShiftedItems===t.value.length+o.d_numVisible,"data-p-carousel-item-start":0===i,"data-p-carousel-item-end":t.value.slice(-1*o.d_numVisible).length-1===i}),[l.renderSlot(t.$slots,"item",{data:e,index:i})],16,P)})),128)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(function(e,i){return l.openBlock(),l.createElementBlock("div",l.mergeProps({key:i,class:t.cx("item",{index:i}),role:"group","aria-hidden":a.firstIndex()>i||a.lastIndex()<i||void 0,"aria-label":a.ariaSlideNumber(i),"aria-roledescription":a.ariaSlideLabel},t.ptm("item"),{"data-p-carousel-item-active":a.firstIndex()<=i&&a.lastIndex()>=i,"data-p-carousel-item-start":a.firstIndex()===i,"data-p-carousel-item-end":a.lastIndex()===i}),[l.renderSlot(t.$slots,"item",{data:e,index:i})],16,$)})),128)),a.isCircular()?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(t.value.slice(0,o.d_numVisible),(function(e,i){return l.openBlock(),l.createElementBlock("div",l.mergeProps({key:i+"_fcloned",class:t.cx("itemCloned",{index:i,value:t.value,totalShiftedItems:o.totalShiftedItems,d_numVisible:o.d_numVisible})},t.ptm("itemCloned")),[l.renderSlot(t.$slots,"item",{data:e,index:i})],16)})),128)):l.createCommentVNode("",!0)],16)],16),t.showNavigators?l.withDirectives((l.openBlock(),l.createElementBlock("button",l.mergeProps({key:1,type:"button",class:t.cx("nextButton"),disabled:a.forwardIsDisabled,"aria-label":a.ariaNextButtonLabel,onClick:e[5]||(e[5]=function(){return a.navForward&&a.navForward.apply(a,arguments)})},V(V({},t.nextButtonProps),t.ptm("nextButton")),{"data-pc-group-section":"navigator"}),[l.renderSlot(t.$slots,"nexticon",{},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(a.isVertical()?"ChevronDownIcon":"ChevronRightIcon"),l.mergeProps({class:t.cx("nextButtonIcon")},t.ptm("nextButtonIcon")),null,16,["class"]))]}))],16,A)),[[r]]):l.createCommentVNode("",!0)],16,w),a.totalIndicators>=0&&t.showIndicators?(l.openBlock(),l.createElementBlock("ul",l.mergeProps({key:0,ref:"indicatorContent",class:[t.cx("indicators"),t.indicatorsContentClass],onKeydown:e[6]||(e[6]=function(){return a.onIndicatorKeydown&&a.onIndicatorKeydown.apply(a,arguments)})},t.ptm("indicators")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.totalIndicators,(function(e,i){return l.openBlock(),l.createElementBlock("li",l.mergeProps({key:"p-carousel-indicator-"+i.toString(),class:t.cx("indicator",{index:i})},t.ptm("indicator",a.getIndicatorPTOptions(i)),{"data-p-highlight":o.d_page===i}),[l.createElementVNode("button",l.mergeProps({class:t.cx("indicatorButton"),type:"button",tabindex:o.d_page===i?"0":"-1","aria-label":a.ariaPageLabel(i+1),"aria-current":o.d_page===i?"page":void 0,onClick:function(t){return a.onIndicatorClick(t,i)}},t.ptm("indicatorButton",a.getIndicatorPTOptions(i))),null,16,E)],16,D)})),128))],16)):l.createCommentVNode("",!0)],16),t.$slots.footer?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:1,class:t.cx("footer")},t.ptm("footer")),[l.renderSlot(t.$slots,"footer")],16)):l.createCommentVNode("",!0)],16)},S}(primevue.icons.chevrondown,primevue.icons.chevronleft,primevue.icons.chevronright,primevue.icons.chevronup,primevue.ripple,primevue.utils,primevue.basecomponent,primevue.carousel.style,Vue);
|
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
return this.optionGroupLabel ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null;
|
|
148
148
|
},
|
|
149
149
|
getOptionGroupChildren(optionGroup, level) {
|
|
150
|
-
return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
|
|
150
|
+
return ObjectUtils.isString(this.optionGroupChildren) ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren) : ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
|
|
151
151
|
},
|
|
152
152
|
isOptionGroup(option, level) {
|
|
153
153
|
return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]);
|
|
@@ -73,7 +73,10 @@ export default {
|
|
|
73
73
|
optionDisabled: null,
|
|
74
74
|
optionGroupIcon: String,
|
|
75
75
|
optionGroupLabel: String,
|
|
76
|
-
optionGroupChildren:
|
|
76
|
+
optionGroupChildren: {
|
|
77
|
+
type: [String, Array],
|
|
78
|
+
default: null
|
|
79
|
+
},
|
|
77
80
|
activeOptionPath: Array,
|
|
78
81
|
level: Number,
|
|
79
82
|
templates: null,
|
|
@@ -152,7 +152,10 @@ var script$1 = {
|
|
|
152
152
|
optionDisabled: null,
|
|
153
153
|
optionGroupIcon: String,
|
|
154
154
|
optionGroupLabel: String,
|
|
155
|
-
optionGroupChildren:
|
|
155
|
+
optionGroupChildren: {
|
|
156
|
+
type: [String, Array],
|
|
157
|
+
"default": null
|
|
158
|
+
},
|
|
156
159
|
activeOptionPath: Array,
|
|
157
160
|
level: Number,
|
|
158
161
|
templates: null,
|
|
@@ -374,7 +377,7 @@ var script = {
|
|
|
374
377
|
return this.optionGroupLabel ? utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null;
|
|
375
378
|
},
|
|
376
379
|
getOptionGroupChildren: function getOptionGroupChildren(optionGroup, level) {
|
|
377
|
-
return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
|
|
380
|
+
return utils.ObjectUtils.isString(this.optionGroupChildren) ? utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren) : utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
|
|
378
381
|
},
|
|
379
382
|
isOptionGroup: function isOptionGroup(option, level) {
|
|
380
383
|
return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]);
|
|
@@ -1000,8 +1003,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1000
1003
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1001
1004
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1002
1005
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1003
|
-
function _toPropertyKey(
|
|
1004
|
-
function _toPrimitive(
|
|
1006
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
1007
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1005
1008
|
var _hoisted_1 = ["id", "disabled", "placeholder", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant"];
|
|
1006
1009
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1007
1010
|
var _component_SpinnerIcon = vue.resolveComponent("SpinnerIcon");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/icons/angleright"),t=require("primevue/icons/chevrondown"),i=require("primevue/icons/spinner"),n=require("primevue/overlayeventbus"),o=require("primevue/portal"),s=require("primevue/utils"),r=require("primevue/basecomponent"),l=require("primevue/cascadeselect/style"),a=require("primevue/ripple"),c=require("vue");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=p(e),d=p(t),h=p(i),f=p(n),O=p(o),v=p(r),y={name:"BaseCascadeSelect",extends:v.default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,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},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},optionGroupIcon:{type:String,default:void 0},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:p(l).default,provide:function(){return{$parentInstance:this}}},b={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:v.default,emits:["option-change"],container:null,props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null,isParentMount:Boolean},data:function(){return{mounted:!1}},watch:{isParentMount:{handler:function(e){e&&s.DomHandler.nestedPosition(this.container,this.level)}}},mounted:function(){(this.isParentMount||0===this.level)&&s.DomHandler.nestedPosition(this.container,this.level),this.mounted=!0},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},containerRef:function(e){this.container=e}},directives:{ripple:p(a).default},components:{AngleRightIcon:u.default}},m=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],g=["onClick"];b.render=function(e,t,i,n,o,s){var r=c.resolveComponent("AngleRightIcon"),l=c.resolveComponent("CascadeSelectSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({ref:s.containerRef,class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.options,(function(t,n){return c.openBlock(),c.createElementBlock("li",c.mergeProps({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption:t}),role:"treeitem","aria-label":s.getOptionLabelToRender(t),"aria-selected":s.isOptionGroup(t)?void 0:s.isOptionSelected(t),"aria-expanded":s.isOptionGroup(t)?s.isOptionActive(t):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":n+1},e.ptm("item"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[c.withDirectives((c.openBlock(),c.createElementBlock("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[i.templates.option?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.option),{key:0,option:t.option},null,8,["option"])):(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:e.cx("text")},e.ptm("text")),c.toDisplayString(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[i.templates.optiongroupicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,g)),[[a]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(c.openBlock(),c.createBlock(l,{key:0,role:"group",class:c.normalizeClass(e.cx("sublist")),selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled,isParentMount:o.mounted},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled","isParentMount"])):c.createCommentVNode("",!0)],16,m)})),128))],16)};var I={name:"CascadeSelect",extends:y,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||s.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.ObjectUtils.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.DomHandler.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.DomHandler.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!s.ObjectUtils.isEmpty(i)){var r=i.index,l=i.level,a=i.parentKey,c=s.ObjectUtils.isNotEmpty(i.children),p=this.activeOptionPath.filter((function(e){return e.parentKey!==a}));p.push(i),this.focusedOptionInfo={index:r,level:l,parentKey:a},this.activeOptionPath=p,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&s.DomHandler.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){f.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,r=s.ObjectUtils.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),r||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return t.key===e.key}))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t});e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),s.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){s.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return s.ObjectUtils.isNotEmpty(e)&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(s.ObjectUtils.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(s.ObjectUtils.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var r=this.findOptionPathByValue(e,o.children,i+1);if(r)return r.unshift(o),r}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions[t],isHide:!1}))},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=s.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex(),this.onOptionChange({processedOption:this.visibleOptions[this.focusedOptionInfo.index],isHide:!1}),!this.overlayVisible&&(this.focusedOptionInfo={index:-1,level:0,parentKey:""}))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,r){var l=(""!==o?o+"_":"")+r,a={option:e,index:r,level:i,key:l,parent:n,parentKey:o};a.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,a,l),s.push(a)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.ObjectUtils.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=s.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:b,Portal:O.default,ChevronDownIcon:d.default,SpinnerIcon:h.default,AngleRightIcon:u.default}};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function k(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){S(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function S(e,t,i){return(t=P(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function P(e){var t=C(e,"string");return"symbol"===x(t)?t:String(t)}function C(e,t){if("object"!==x(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var V=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];I.render=function(e,t,i,n,o,s){var r=c.resolveComponent("SpinnerIcon"),l=c.resolveComponent("CascadeSelectSub"),a=c.resolveComponent("Portal");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[c.createElementVNode("div",c.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[c.createElementVNode("input",c.mergeProps({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},k(k({},e.inputProps),e.ptm("input"))),null,16,V)],16),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},e.ptm("label")),[c.renderSlot(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[c.createTextVNode(c.toDisplayString(s.label),1)]}))],16),c.createElementVNode("div",c.mergeProps({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?c.renderSlot(e.$slots,"loadingicon",{key:0,class:c.normalizeClass(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):c.renderSlot(e.$slots,"dropdownicon",{key:1,class:c.normalizeClass(e.cx("dropdownIcon"))},(function(){return[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(e.dropdownIcon?"span":"ChevronDownIcon"),c.mergeProps({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.searchResultMessageText),17),c.createVNode(a,{appendTo:e.appendTo},{default:c.withCtx((function(){return[c.createVNode(c.Transition,c.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:c.withCtx((function(){return[o.overlayVisible?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},k(k({},e.panelProps),e.ptm("panel"))),[c.createElementVNode("div",c.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[c.createVNode(l,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?s.focusedOptionId:void 0,options:s.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.selectedMessageText),17)],16)):c.createCommentVNode("",!0)]})),_:1},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)},module.exports=I;
|
|
1
|
+
"use strict";var e=require("primevue/icons/angleright"),t=require("primevue/icons/chevrondown"),i=require("primevue/icons/spinner"),n=require("primevue/overlayeventbus"),o=require("primevue/portal"),s=require("primevue/utils"),r=require("primevue/basecomponent"),l=require("primevue/cascadeselect/style"),a=require("primevue/ripple"),c=require("vue");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=p(e),d=p(t),h=p(i),f=p(n),O=p(o),v=p(r),y={name:"BaseCascadeSelect",extends:v.default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,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},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},optionGroupIcon:{type:String,default:void 0},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:p(l).default,provide:function(){return{$parentInstance:this}}},b={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:v.default,emits:["option-change"],container:null,props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:{type:[String,Array],default:null},activeOptionPath:Array,level:Number,templates:null,isParentMount:Boolean},data:function(){return{mounted:!1}},watch:{isParentMount:{handler:function(e){e&&s.DomHandler.nestedPosition(this.container,this.level)}}},mounted:function(){(this.isParentMount||0===this.level)&&s.DomHandler.nestedPosition(this.container,this.level),this.mounted=!0},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},containerRef:function(e){this.container=e}},directives:{ripple:p(a).default},components:{AngleRightIcon:u.default}},m=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],g=["onClick"];b.render=function(e,t,i,n,o,s){var r=c.resolveComponent("AngleRightIcon"),l=c.resolveComponent("CascadeSelectSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({ref:s.containerRef,class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.options,(function(t,n){return c.openBlock(),c.createElementBlock("li",c.mergeProps({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption:t}),role:"treeitem","aria-label":s.getOptionLabelToRender(t),"aria-selected":s.isOptionGroup(t)?void 0:s.isOptionSelected(t),"aria-expanded":s.isOptionGroup(t)?s.isOptionActive(t):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":n+1},e.ptm("item"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[c.withDirectives((c.openBlock(),c.createElementBlock("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[i.templates.option?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.option),{key:0,option:t.option},null,8,["option"])):(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:e.cx("text")},e.ptm("text")),c.toDisplayString(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[i.templates.optiongroupicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,g)),[[a]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(c.openBlock(),c.createBlock(l,{key:0,role:"group",class:c.normalizeClass(e.cx("sublist")),selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled,isParentMount:o.mounted},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled","isParentMount"])):c.createCommentVNode("",!0)],16,m)})),128))],16)};var I={name:"CascadeSelect",extends:y,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||s.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.ObjectUtils.isString(this.optionGroupChildren)?s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren):s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.ObjectUtils.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.DomHandler.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.DomHandler.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!s.ObjectUtils.isEmpty(i)){var r=i.index,l=i.level,a=i.parentKey,c=s.ObjectUtils.isNotEmpty(i.children),p=this.activeOptionPath.filter((function(e){return e.parentKey!==a}));p.push(i),this.focusedOptionInfo={index:r,level:l,parentKey:a},this.activeOptionPath=p,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&s.DomHandler.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){f.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,r=s.ObjectUtils.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),r||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return t.key===e.key}))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t});e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),s.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){s.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return s.ObjectUtils.isNotEmpty(e)&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(s.ObjectUtils.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(s.ObjectUtils.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var r=this.findOptionPathByValue(e,o.children,i+1);if(r)return r.unshift(o),r}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions[t],isHide:!1}))},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=s.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex(),this.onOptionChange({processedOption:this.visibleOptions[this.focusedOptionInfo.index],isHide:!1}),!this.overlayVisible&&(this.focusedOptionInfo={index:-1,level:0,parentKey:""}))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,r){var l=(""!==o?o+"_":"")+r,a={option:e,index:r,level:i,key:l,parent:n,parentKey:o};a.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,a,l),s.push(a)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.ObjectUtils.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=s.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:b,Portal:O.default,ChevronDownIcon:d.default,SpinnerIcon:h.default,AngleRightIcon:u.default}};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function S(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){k(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function k(e,t,i){var n;return(t="symbol"==x(n=C(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function C(e,t){if("object"!=x(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var P=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];I.render=function(e,t,i,n,o,s){var r=c.resolveComponent("SpinnerIcon"),l=c.resolveComponent("CascadeSelectSub"),a=c.resolveComponent("Portal");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[c.createElementVNode("div",c.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[c.createElementVNode("input",c.mergeProps({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},S(S({},e.inputProps),e.ptm("input"))),null,16,P)],16),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},e.ptm("label")),[c.renderSlot(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[c.createTextVNode(c.toDisplayString(s.label),1)]}))],16),c.createElementVNode("div",c.mergeProps({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?c.renderSlot(e.$slots,"loadingicon",{key:0,class:c.normalizeClass(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):c.renderSlot(e.$slots,"dropdownicon",{key:1,class:c.normalizeClass(e.cx("dropdownIcon"))},(function(){return[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(e.dropdownIcon?"span":"ChevronDownIcon"),c.mergeProps({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.searchResultMessageText),17),c.createVNode(a,{appendTo:e.appendTo},{default:c.withCtx((function(){return[c.createVNode(c.Transition,c.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:c.withCtx((function(){return[o.overlayVisible?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},S(S({},e.panelProps),e.ptm("panel"))),[c.createElementVNode("div",c.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[c.createVNode(l,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?s.focusedOptionId:void 0,options:s.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.selectedMessageText),17)],16)):c.createCommentVNode("",!0)]})),_:1},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)},module.exports=I;
|
|
@@ -139,7 +139,10 @@ var script$1 = {
|
|
|
139
139
|
optionDisabled: null,
|
|
140
140
|
optionGroupIcon: String,
|
|
141
141
|
optionGroupLabel: String,
|
|
142
|
-
optionGroupChildren:
|
|
142
|
+
optionGroupChildren: {
|
|
143
|
+
type: [String, Array],
|
|
144
|
+
"default": null
|
|
145
|
+
},
|
|
143
146
|
activeOptionPath: Array,
|
|
144
147
|
level: Number,
|
|
145
148
|
templates: null,
|
|
@@ -361,7 +364,7 @@ var script = {
|
|
|
361
364
|
return this.optionGroupLabel ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null;
|
|
362
365
|
},
|
|
363
366
|
getOptionGroupChildren: function getOptionGroupChildren(optionGroup, level) {
|
|
364
|
-
return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
|
|
367
|
+
return ObjectUtils.isString(this.optionGroupChildren) ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren) : ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
|
|
365
368
|
},
|
|
366
369
|
isOptionGroup: function isOptionGroup(option, level) {
|
|
367
370
|
return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]);
|
|
@@ -987,8 +990,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
987
990
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
988
991
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
989
992
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
990
|
-
function _toPropertyKey(
|
|
991
|
-
function _toPrimitive(
|
|
993
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
994
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
992
995
|
var _hoisted_1 = ["id", "disabled", "placeholder", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant"];
|
|
993
996
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
994
997
|
var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
|