primevue 3.50.0 → 3.52.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 +2 -2
- package/accordiontab/AccordionTab.d.ts +2 -2
- package/autocomplete/AutoComplete.d.ts +2 -2
- package/autocomplete/AutoComplete.vue +10 -4
- package/autocomplete/autocomplete.cjs.js +35 -25
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +35 -25
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +35 -25
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +2 -2
- package/avatargroup/AvatarGroup.d.ts +2 -2
- package/badge/Badge.d.ts +2 -2
- package/blockui/BlockUI.d.ts +2 -2
- package/breadcrumb/Breadcrumb.d.ts +2 -2
- package/button/Button.d.ts +2 -2
- package/buttongroup/ButtonGroup.d.ts +2 -2
- package/calendar/Calendar.d.ts +6 -5
- package/calendar/Calendar.vue +10 -13
- package/calendar/calendar.cjs.js +9 -11
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +10 -12
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +9 -11
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +2 -2
- package/carousel/Carousel.d.ts +6 -2
- package/carousel/Carousel.vue +62 -52
- package/carousel/carousel.cjs.js +65 -49
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +66 -50
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +65 -49
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +2 -2
- package/cascadeselect/CascadeSelectSub.vue +4 -1
- package/cascadeselect/cascadeselect.cjs.js +11 -6
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +11 -6
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +11 -6
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/Chart.d.ts +2 -2
- package/checkbox/Checkbox.d.ts +2 -2
- package/chip/Chip.d.ts +2 -2
- package/chips/Chips.d.ts +2 -2
- package/colorpicker/ColorPicker.d.ts +2 -2
- package/column/Column.d.ts +2 -2
- package/columngroup/ColumnGroup.d.ts +2 -2
- package/config/PrimeVue.d.ts +1 -0
- package/config/config.cjs.js +2 -1
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +2 -1
- package/config/config.esm.min.js +1 -1
- package/config/config.js +2 -1
- package/config/config.min.js +1 -1
- package/confirmdialog/ConfirmDialog.d.ts +2 -2
- package/confirmpopup/ConfirmPopup.d.ts +2 -2
- package/contextmenu/ContextMenu.d.ts +2 -2
- package/contextmenu/ContextMenu.vue +4 -1
- package/contextmenu/contextmenu.cjs.js +4 -1
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +4 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +4 -1
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +60 -34
- package/core/core.min.js +8 -8
- package/datatable/BodyRow.vue +1 -0
- package/datatable/DataTable.d.ts +10 -7
- package/datatable/DataTable.vue +1 -0
- package/datatable/TableHeader.vue +5 -0
- package/datatable/datatable.cjs.js +9 -2
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +9 -2
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +9 -2
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +2 -2
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +2 -2
- package/deferredcontent/DeferredContent.d.ts +2 -2
- package/dialog/Dialog.d.ts +2 -2
- package/divider/Divider.d.ts +2 -2
- package/dock/Dock.d.ts +2 -2
- package/dropdown/Dropdown.d.ts +11 -3
- package/dropdown/Dropdown.vue +6 -1
- package/dropdown/dropdown.cjs.js +8 -2
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +8 -2
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +8 -2
- package/dropdown/dropdown.min.js +1 -1
- package/dropdown/style/dropdownstyle.cjs.js +2 -1
- package/dropdown/style/dropdownstyle.cjs.min.js +1 -1
- package/dropdown/style/dropdownstyle.esm.js +2 -1
- package/dropdown/style/dropdownstyle.esm.min.js +1 -1
- package/dropdown/style/dropdownstyle.js +2 -1
- package/dropdown/style/dropdownstyle.min.js +1 -1
- package/dynamicdialog/DynamicDialog.d.ts +2 -2
- package/editor/Editor.d.ts +2 -2
- package/fieldset/Fieldset.d.ts +2 -2
- package/fileupload/FileUpload.d.ts +2 -2
- package/fileupload/FileUpload.vue +1 -1
- package/fileupload/fileupload.cjs.js +10 -10
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +10 -10
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +10 -10
- package/fileupload/fileupload.min.js +1 -1
- package/floatlabel/FloatLabel.d.ts +2 -2
- package/galleria/Galleria.d.ts +2 -2
- package/iconfield/IconField.d.ts +2 -2
- package/icons/angledoubledown/index.d.ts +2 -2
- package/icons/angledoubleleft/index.d.ts +2 -2
- package/icons/angledoubleright/index.d.ts +2 -2
- package/icons/angledoubleup/index.d.ts +2 -2
- package/icons/angledown/index.d.ts +2 -2
- package/icons/angleleft/index.d.ts +2 -2
- package/icons/angleright/index.d.ts +2 -2
- package/icons/angleup/index.d.ts +2 -2
- package/icons/arrowdown/index.d.ts +2 -2
- package/icons/arrowup/index.d.ts +2 -2
- package/icons/ban/index.d.ts +2 -2
- package/icons/bars/index.d.ts +2 -2
- package/icons/blank/index.d.ts +2 -2
- package/icons/calendar/index.d.ts +2 -2
- package/icons/check/index.d.ts +2 -2
- package/icons/chevrondown/index.d.ts +2 -2
- package/icons/chevronleft/index.d.ts +2 -2
- package/icons/chevronright/index.d.ts +2 -2
- package/icons/chevronup/index.d.ts +2 -2
- package/icons/exclamationtriangle/index.d.ts +2 -2
- package/icons/eye/index.d.ts +2 -2
- package/icons/eyeslash/index.d.ts +2 -2
- package/icons/filter/index.d.ts +2 -2
- package/icons/filterslash/index.d.ts +2 -2
- package/icons/infocircle/index.d.ts +2 -2
- package/icons/minus/index.d.ts +2 -2
- package/icons/pencil/index.d.ts +2 -2
- package/icons/plus/index.d.ts +2 -2
- package/icons/refresh/index.d.ts +2 -2
- package/icons/search/index.d.ts +2 -2
- package/icons/searchminus/index.d.ts +2 -2
- package/icons/searchplus/index.d.ts +2 -2
- package/icons/sortalt/index.d.ts +2 -2
- package/icons/sortamountdown/index.d.ts +2 -2
- package/icons/sortamountupalt/index.d.ts +2 -2
- package/icons/spinner/index.d.ts +2 -2
- package/icons/star/index.d.ts +2 -2
- package/icons/starfill/index.d.ts +2 -2
- package/icons/thlarge/index.d.ts +2 -2
- package/icons/times/index.d.ts +2 -2
- package/icons/timescircle/index.d.ts +2 -2
- package/icons/trash/index.d.ts +2 -2
- package/icons/undo/index.d.ts +2 -2
- package/icons/upload/index.d.ts +2 -2
- package/icons/windowmaximize/index.d.ts +2 -2
- package/icons/windowminimize/index.d.ts +2 -2
- package/image/Image.d.ts +2 -2
- package/inlinemessage/InlineMessage.d.ts +2 -2
- package/inplace/Inplace.d.ts +2 -2
- package/inputgroup/InputGroup.d.ts +2 -2
- package/inputgroupaddon/InputGroupAddon.d.ts +2 -2
- package/inputicon/InputIcon.d.ts +2 -2
- package/inputmask/InputMask.d.ts +2 -2
- package/inputnumber/InputNumber.d.ts +6 -2
- package/inputnumber/InputNumber.vue +20 -17
- package/inputnumber/inputnumber.cjs.js +23 -20
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +23 -20
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +23 -20
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputotp/InputOtp.d.ts +2 -2
- package/inputotp/InputOtp.vue +1 -1
- package/inputotp/inputotp.cjs.js +1 -1
- package/inputotp/inputotp.cjs.min.js +1 -1
- package/inputotp/inputotp.esm.js +1 -1
- package/inputotp/inputotp.esm.min.js +1 -1
- package/inputotp/inputotp.js +1 -1
- package/inputotp/inputotp.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +2 -2
- package/inputtext/InputText.d.ts +2 -2
- package/knob/BaseKnob.vue +1 -1
- package/knob/Knob.d.ts +3 -3
- package/knob/Knob.vue +5 -1
- package/knob/knob.cjs.js +6 -2
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +6 -2
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +6 -2
- package/knob/knob.min.js +1 -1
- package/listbox/Listbox.d.ts +2 -2
- package/megamenu/MegaMenu.d.ts +2 -2
- package/megamenu/MegaMenu.vue +4 -1
- package/megamenu/megamenu.cjs.js +4 -1
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +4 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +4 -1
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +2 -2
- package/menu/Menu.vue +15 -2
- package/menu/menu.cjs.js +5 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +5 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +5 -2
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +2 -2
- package/menubar/Menubar.vue +4 -1
- package/menubar/menubar.cjs.js +4 -1
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +4 -1
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +4 -1
- package/menubar/menubar.min.js +1 -1
- package/message/Message.d.ts +2 -2
- package/metergroup/MeterGroup.d.ts +2 -2
- package/multiselect/MultiSelect.d.ts +2 -2
- package/multiselect/MultiSelect.vue +6 -3
- package/multiselect/multiselect.cjs.js +8 -4
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +8 -4
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +8 -4
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.d.ts +2 -2
- package/organizationchart/OrganizationChart.d.ts +2 -2
- package/overlaypanel/OverlayPanel.d.ts +2 -2
- package/package.json +1 -1
- package/paginator/Paginator.d.ts +2 -2
- package/paginator/Paginator.vue +0 -1
- package/paginator/paginator.cjs.js +1 -1
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +1 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +1 -1
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +2 -2
- package/panelmenu/PanelMenu.d.ts +2 -2
- package/password/Password.d.ts +2 -2
- package/picklist/PickList.d.ts +2 -2
- package/portal/Portal.d.ts +2 -2
- package/progressbar/ProgressBar.d.ts +2 -2
- package/progressspinner/ProgressSpinner.d.ts +2 -2
- package/radiobutton/RadioButton.d.ts +2 -2
- package/rating/Rating.d.ts +2 -2
- package/resources/themes/arya-blue/theme.css +1 -0
- package/resources/themes/arya-green/theme.css +1 -0
- package/resources/themes/arya-orange/theme.css +1 -0
- package/resources/themes/arya-purple/theme.css +1 -0
- package/resources/themes/aura-dark-amber/theme.css +1 -0
- package/resources/themes/aura-dark-blue/theme.css +1 -0
- package/resources/themes/aura-dark-cyan/theme.css +1 -0
- package/resources/themes/aura-dark-green/theme.css +1 -0
- package/resources/themes/aura-dark-indigo/theme.css +1 -0
- package/resources/themes/aura-dark-lime/theme.css +1 -0
- package/resources/themes/aura-dark-noir/theme.css +1 -0
- package/resources/themes/aura-dark-pink/theme.css +1 -0
- package/resources/themes/aura-dark-purple/theme.css +1 -0
- package/resources/themes/aura-dark-teal/theme.css +1 -0
- package/resources/themes/aura-light-amber/theme.css +7 -1
- package/resources/themes/aura-light-blue/theme.css +7 -1
- package/resources/themes/aura-light-cyan/theme.css +7 -1
- package/resources/themes/aura-light-green/theme.css +7 -1
- package/resources/themes/aura-light-indigo/theme.css +7 -1
- package/resources/themes/aura-light-lime/theme.css +7 -1
- package/resources/themes/aura-light-noir/theme.css +7 -1
- package/resources/themes/aura-light-pink/theme.css +7 -1
- package/resources/themes/aura-light-purple/theme.css +7 -1
- package/resources/themes/aura-light-teal/theme.css +7 -1
- package/resources/themes/bootstrap4-dark-blue/theme.css +1 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +1 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +1 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +1 -0
- package/resources/themes/fluent-light/theme.css +1 -0
- package/resources/themes/lara-dark-amber/theme.css +1 -0
- package/resources/themes/lara-dark-blue/theme.css +1 -0
- package/resources/themes/lara-dark-cyan/theme.css +1 -0
- package/resources/themes/lara-dark-green/theme.css +1 -0
- package/resources/themes/lara-dark-indigo/theme.css +1 -0
- package/resources/themes/lara-dark-pink/theme.css +1 -0
- package/resources/themes/lara-dark-purple/theme.css +1 -0
- package/resources/themes/lara-dark-teal/theme.css +1 -0
- package/resources/themes/lara-light-amber/theme.css +1 -0
- package/resources/themes/lara-light-blue/theme.css +1 -0
- package/resources/themes/lara-light-cyan/theme.css +1 -0
- package/resources/themes/lara-light-green/theme.css +1 -0
- package/resources/themes/lara-light-indigo/theme.css +1 -0
- package/resources/themes/lara-light-pink/theme.css +1 -0
- package/resources/themes/lara-light-purple/theme.css +1 -0
- package/resources/themes/lara-light-teal/theme.css +1 -0
- package/resources/themes/luna-amber/theme.css +1 -0
- package/resources/themes/luna-blue/theme.css +1 -0
- package/resources/themes/luna-green/theme.css +1 -0
- package/resources/themes/luna-pink/theme.css +1 -0
- package/resources/themes/md-dark-deeppurple/theme.css +1 -0
- package/resources/themes/md-dark-indigo/theme.css +1 -0
- package/resources/themes/md-light-deeppurple/theme.css +1 -0
- package/resources/themes/md-light-indigo/theme.css +1 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +1 -0
- package/resources/themes/mdc-dark-indigo/theme.css +1 -0
- package/resources/themes/mdc-light-deeppurple/theme.css +1 -0
- package/resources/themes/mdc-light-indigo/theme.css +1 -0
- package/resources/themes/mira/theme.css +1 -0
- package/resources/themes/nano/theme.css +1 -0
- package/resources/themes/nova/theme.css +1 -0
- package/resources/themes/nova-accent/theme.css +1 -0
- package/resources/themes/nova-alt/theme.css +1 -0
- package/resources/themes/nova-vue/theme.css +1 -0
- package/resources/themes/rhea/theme.css +1 -0
- package/resources/themes/saga-blue/theme.css +1 -0
- package/resources/themes/saga-green/theme.css +1 -0
- package/resources/themes/saga-orange/theme.css +1 -0
- package/resources/themes/saga-purple/theme.css +1 -0
- package/resources/themes/soho-dark/theme.css +1 -0
- package/resources/themes/soho-light/theme.css +1 -0
- package/resources/themes/tailwind-light/theme.css +1 -0
- package/resources/themes/vela-blue/theme.css +1 -0
- package/resources/themes/vela-green/theme.css +1 -0
- package/resources/themes/vela-orange/theme.css +1 -0
- package/resources/themes/vela-purple/theme.css +1 -0
- package/resources/themes/viva-dark/theme.css +1 -0
- package/resources/themes/viva-light/theme.css +1 -0
- package/row/Row.d.ts +2 -2
- package/scrollpanel/ScrollPanel.d.ts +2 -2
- package/scrollpanel/ScrollPanel.vue +19 -14
- package/scrollpanel/scrollpanel.cjs.js +18 -14
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +18 -14
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +18 -14
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/ScrollTop.d.ts +2 -2
- package/selectbutton/SelectButton.d.ts +2 -2
- package/sidebar/BaseSidebar.vue +9 -0
- package/sidebar/Sidebar.d.ts +2 -2
- package/sidebar/sidebar.cjs.js +9 -0
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +9 -0
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +9 -0
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +2 -2
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.vue +7 -6
- package/slider/slider.cjs.js +7 -6
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +7 -6
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +7 -6
- package/slider/slider.min.js +1 -1
- package/speeddial/SpeedDial.d.ts +2 -2
- package/splitbutton/SplitButton.d.ts +2 -2
- package/splitter/Splitter.d.ts +2 -2
- package/splitterpanel/SplitterPanel.d.ts +2 -2
- package/stepper/Stepper.d.ts +2 -2
- package/stepper/Stepper.vue +4 -3
- package/stepper/stepper.cjs.js +14 -15
- package/stepper/stepper.cjs.min.js +1 -1
- package/stepper/stepper.esm.js +15 -16
- package/stepper/stepper.esm.min.js +1 -1
- package/stepper/stepper.js +14 -15
- package/stepper/stepper.min.js +1 -1
- package/stepperpanel/StepperPanel.d.ts +3 -3
- package/steps/Steps.d.ts +2 -2
- package/tabmenu/TabMenu.d.ts +2 -2
- package/tabpanel/TabPanel.d.ts +2 -2
- package/tabview/TabView.d.ts +2 -2
- package/tag/Tag.d.ts +2 -2
- package/terminal/Terminal.d.ts +2 -2
- package/textarea/Textarea.d.ts +2 -2
- package/tieredmenu/TieredMenu.d.ts +2 -2
- package/tieredmenu/TieredMenu.vue +10 -3
- package/tieredmenu/tieredmenu.cjs.js +13 -3
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +13 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -3
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/Timeline.d.ts +2 -2
- package/toast/Toast.d.ts +2 -2
- package/toast/Toast.vue +4 -9
- package/toast/toast.cjs.js +8 -10
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +8 -10
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +8 -10
- package/toast/toast.min.js +1 -1
- package/togglebutton/ToggleButton.d.ts +2 -2
- package/toolbar/Toolbar.d.ts +2 -2
- package/tree/Tree.d.ts +7 -3
- package/tree/TreeNode.vue +2 -1
- package/tree/tree.cjs.js +6 -4
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +6 -4
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +6 -4
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +2 -2
- package/treetable/TreeTable.d.ts +2 -2
- package/treetable/TreeTable.vue +3 -3
- package/treetable/treetable.cjs.js +3 -3
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +3 -3
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +3 -3
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +2 -2
- package/vetur-attributes.json +3 -3
- package/virtualscroller/VirtualScroller.d.ts +2 -2
- package/web-types.json +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UniqueComponentId as e,DomHandler as t}from"primevue/utils";import s from"primevue/basecomponent";import n from"primevue/scrollpanel/style";import{openBlock as o,createElementBlock as i,mergeProps as r,createElementVNode as a,renderSlot as l}from"vue";var c={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:s,props:{step:{type:Number,default:5}},style:n,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:this.$attrs.id,orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},watch:{"$attrs.id":function(t){this.id=t||e()}},mounted:function(){this.id=this.id||e(),this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var e=getComputedStyle(this.$el),s=getComputedStyle(this.$refs.xBar),n=t.getHeight(this.$el)-parseInt(s.height,10);"none"!==e["max-height"]&&0===n&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(s.height,10)>parseInt(e["max-height"],10)?e["max-height"]:this.$refs.content.offsetHeight+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)+"px")},moveBar:function(){var e=this;if(this.$refs.content){var s=this.$refs.content.scrollWidth,n=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/s;var o=this.$refs.content.scrollHeight,i=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/o,this.frame=this.requestAnimationFrame((function(){e.scrollXRatio>=1?(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.xBar,"p-scrollpanel-hidden")):(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.xBar,"p-scrollpanel-hidden"),e.$refs.xBar.style.cssText="width:"+Math.max(100*e.scrollXRatio,10)+"%; left:"+e.$refs.content.scrollLeft/s*100+"%;bottom:"+n+"px;"),e.scrollYRatio>=1?(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.yBar,"p-scrollpanel-hidden")):(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.yBar,"p-scrollpanel-hidden"),e.$refs.yBar.style.cssText="height:"+Math.max(100*e.scrollYRatio,10)+"%; top: calc("+e.$refs.content.scrollTop/o*100+"% - "+e.$refs.xBar.clientHeight+"px);right:"+i+"px;")}))}},onYBarMouseDown:function(e){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=e.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onXBarMouseDown:function(e){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=e.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var s=this;this.clearTimer(),this.timer=setTimeout((function(){s.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,s=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=s/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,s=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=s/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},computed:{contentId:function(){return this.id+"_content"}}},u=["id"],h=["aria-controls","aria-valuenow"],d=["aria-controls","aria-valuenow"];c.render=function(e,t,s,n,c,p){return o(),i("div",r({class:e.cx("root")},e.ptmi("root")),[a("div",r({class:e.cx("wrapper")},e.ptm("wrapper")),[a("div",r({ref:"content",id:p.contentId,class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return p.onScroll&&p.onScroll.apply(p,arguments)}),onMouseenter:t[1]||(t[1]=function(){return p.moveBar&&p.moveBar.apply(p,arguments)})},e.ptm("content")),[l(e.$slots,"default")],16,u)],16),a("div",r({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-controls":p.contentId,"aria-valuenow":c.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return p.onXBarMouseDown&&p.onXBarMouseDown.apply(p,arguments)}),onKeydown:t[3]||(t[3]=function(e){return p.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return p.onKeyUp&&p.onKeyUp.apply(p,arguments)}),onFocus:t[5]||(t[5]=function(){return p.onFocus&&p.onFocus.apply(p,arguments)}),onBlur:t[6]||(t[6]=function(){return p.onBlur&&p.onBlur.apply(p,arguments)})},e.ptm("barx"),{"data-pc-group-section":"bar"}),null,16,h),a("div",r({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-controls":p.contentId,"aria-valuenow":c.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return p.onYBarMouseDown&&p.onYBarMouseDown.apply(p,arguments)}),onKeydown:t[8]||(t[8]=function(e){return p.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return p.onKeyUp&&p.onKeyUp.apply(p,arguments)}),onFocus:t[10]||(t[10]=function(){return p.onFocus&&p.onFocus.apply(p,arguments)})},e.ptm("bary"),{"data-pc-group-section":"bar"}),null,16,d)],16)};export{c as default};
|
|
1
|
+
import{UniqueComponentId as e,DomHandler as t}from"primevue/utils";import s from"primevue/basecomponent";import n from"primevue/scrollpanel/style";import{openBlock as o,createElementBlock as i,mergeProps as r,createElementVNode as a,renderSlot as l}from"vue";var c={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:s,props:{step:{type:Number,default:5}},style:n,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:this.$attrs.id,orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},watch:{"$attrs.id":function(t){this.id=t||e()}},mounted:function(){this.id=this.id||e(),this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var e=getComputedStyle(this.$el),s=getComputedStyle(this.$refs.xBar),n=t.getHeight(this.$el)-parseInt(s.height,10);"none"!==e["max-height"]&&0===n&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(s.height,10)>parseInt(e["max-height"],10)?e["max-height"]:this.$refs.content.offsetHeight+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)+"px")},moveBar:function(){var e=this;if(this.$refs.content){var s=this.$refs.content.scrollWidth,n=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/s;var o=this.$refs.content.scrollHeight,i=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/o,this.frame=this.requestAnimationFrame((function(){e.$refs.xBar&&(e.scrollXRatio>=1?(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.xBar,"p-scrollpanel-hidden")):(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.xBar,"p-scrollpanel-hidden"),e.$refs.xBar.style.cssText="width:"+Math.max(100*e.scrollXRatio,10)+"%; left:"+e.$refs.content.scrollLeft/s*100+"%;bottom:"+n+"px;")),e.$refs.yBar&&(e.scrollYRatio>=1?(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.yBar,"p-scrollpanel-hidden")):(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.yBar,"p-scrollpanel-hidden"),e.$refs.yBar.style.cssText="height:"+Math.max(100*e.scrollYRatio,10)+"%; top: calc("+e.$refs.content.scrollTop/o*100+"% - "+e.$refs.xBar.clientHeight+"px);right:"+i+"px;"))}))}},onYBarMouseDown:function(e){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=e.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onXBarMouseDown:function(e){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=e.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var s=this;this.clearTimer(),this.timer=setTimeout((function(){s.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,s=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=s/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,s=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=s/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},computed:{contentId:function(){return this.id+"_content"}}},u=["id"],h=["aria-controls","aria-valuenow"],d=["aria-controls","aria-valuenow"];c.render=function(e,t,s,n,c,p){return o(),i("div",r({class:e.cx("root")},e.ptmi("root")),[a("div",r({class:e.cx("wrapper")},e.ptm("wrapper")),[a("div",r({ref:"content",id:p.contentId,class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return p.onScroll&&p.onScroll.apply(p,arguments)}),onMouseenter:t[1]||(t[1]=function(){return p.moveBar&&p.moveBar.apply(p,arguments)})},e.ptm("content")),[l(e.$slots,"default")],16,u)],16),a("div",r({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-controls":p.contentId,"aria-valuenow":c.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return p.onXBarMouseDown&&p.onXBarMouseDown.apply(p,arguments)}),onKeydown:t[3]||(t[3]=function(e){return p.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return p.onKeyUp&&p.onKeyUp.apply(p,arguments)}),onFocus:t[5]||(t[5]=function(){return p.onFocus&&p.onFocus.apply(p,arguments)}),onBlur:t[6]||(t[6]=function(){return p.onBlur&&p.onBlur.apply(p,arguments)})},e.ptm("barx"),{"data-pc-group-section":"bar"}),null,16,h),a("div",r({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-controls":p.contentId,"aria-valuenow":c.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return p.onYBarMouseDown&&p.onYBarMouseDown.apply(p,arguments)}),onKeydown:t[8]||(t[8]=function(e){return p.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return p.onKeyUp&&p.onKeyUp.apply(p,arguments)}),onFocus:t[10]||(t[10]=function(){return p.onFocus&&p.onFocus.apply(p,arguments)})},e.ptm("bary"),{"data-pc-group-section":"bar"}),null,16,d)],16)};export{c as default};
|
|
@@ -104,21 +104,25 @@ this.primevue.scrollpanel = (function (utils, BaseComponent, ScrollPanelStyle, v
|
|
|
104
104
|
var right = (this.$el.clientWidth - this.$refs.yBar.clientWidth) * -1;
|
|
105
105
|
this.scrollYRatio = ownHeight / totalHeight;
|
|
106
106
|
this.frame = this.requestAnimationFrame(function () {
|
|
107
|
-
if (_this.
|
|
108
|
-
_this
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
if (_this.$refs.xBar) {
|
|
108
|
+
if (_this.scrollXRatio >= 1) {
|
|
109
|
+
_this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'true');
|
|
110
|
+
!_this.isUnstyled && utils.DomHandler.addClass(_this.$refs.xBar, 'p-scrollpanel-hidden');
|
|
111
|
+
} else {
|
|
112
|
+
_this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'false');
|
|
113
|
+
!_this.isUnstyled && utils.DomHandler.removeClass(_this.$refs.xBar, 'p-scrollpanel-hidden');
|
|
114
|
+
_this.$refs.xBar.style.cssText = 'width:' + Math.max(_this.scrollXRatio * 100, 10) + '%; left:' + _this.$refs.content.scrollLeft / totalWidth * 100 + '%;bottom:' + bottom + 'px;';
|
|
115
|
+
}
|
|
114
116
|
}
|
|
115
|
-
if (_this.
|
|
116
|
-
_this
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
if (_this.$refs.yBar) {
|
|
118
|
+
if (_this.scrollYRatio >= 1) {
|
|
119
|
+
_this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'true');
|
|
120
|
+
!_this.isUnstyled && utils.DomHandler.addClass(_this.$refs.yBar, 'p-scrollpanel-hidden');
|
|
121
|
+
} else {
|
|
122
|
+
_this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'false');
|
|
123
|
+
!_this.isUnstyled && utils.DomHandler.removeClass(_this.$refs.yBar, 'p-scrollpanel-hidden');
|
|
124
|
+
_this.$refs.yBar.style.cssText = 'height:' + Math.max(_this.scrollYRatio * 100, 10) + '%; top: calc(' + _this.$refs.content.scrollTop / totalHeight * 100 + '% - ' + _this.$refs.xBar.clientHeight + 'px);right:' + right + 'px;';
|
|
125
|
+
}
|
|
122
126
|
}
|
|
123
127
|
});
|
|
124
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.scrollpanel=function(e,t,n,s){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:o(t).default,props:{step:{type:Number,default:5}},style:o(n).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:this.$attrs.id,orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},watch:{"$attrs.id":function(t){this.id=t||e.UniqueComponentId()}},mounted:function(){this.id=this.id||e.UniqueComponentId(),this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var t=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),s=e.DomHandler.getHeight(this.$el)-parseInt(n.height,10);"none"!==t["max-height"]&&0===s&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(t["max-height"],10)?t["max-height"]:this.$refs.content.offsetHeight+parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)+"px")},moveBar:function(){var t=this;if(this.$refs.content){var n=this.$refs.content.scrollWidth,s=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var o=this.$refs.content.scrollHeight,r=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/o,this.frame=this.requestAnimationFrame((function(){t.scrollXRatio>=1?(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.xBar,"p-scrollpanel-hidden")):(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.xBar,"p-scrollpanel-hidden"),t.$refs.xBar.style.cssText="width:"+Math.max(100*t.scrollXRatio,10)+"%; left:"+t.$refs.content.scrollLeft/n*100+"%;bottom:"+s+"px;"),t.scrollYRatio>=1?(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.yBar,"p-scrollpanel-hidden")):(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.yBar,"p-scrollpanel-hidden"),t.$refs.yBar.style.cssText="height:"+Math.max(100*t.scrollYRatio,10)+"%; top: calc("+t.$refs.content.scrollTop/o*100+"% - "+t.$refs.xBar.clientHeight+"px);right:"+r+"px;")}))}},onYBarMouseDown:function(t){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=t.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onXBarMouseDown:function(t){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=t.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},computed:{contentId:function(){return this.id+"_content"}}},i=["id"],a=["aria-controls","aria-valuenow"],l=["aria-controls","aria-valuenow"];return r.render=function(e,t,n,o,r,c){return s.openBlock(),s.createElementBlock("div",s.mergeProps({class:e.cx("root")},e.ptmi("root")),[s.createElementVNode("div",s.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[s.createElementVNode("div",s.mergeProps({ref:"content",id:c.contentId,class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return c.onScroll&&c.onScroll.apply(c,arguments)}),onMouseenter:t[1]||(t[1]=function(){return c.moveBar&&c.moveBar.apply(c,arguments)})},e.ptm("content")),[s.renderSlot(e.$slots,"default")],16,i)],16),s.createElementVNode("div",s.mergeProps({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-controls":c.contentId,"aria-valuenow":r.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return c.onXBarMouseDown&&c.onXBarMouseDown.apply(c,arguments)}),onKeydown:t[3]||(t[3]=function(e){return c.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return c.onKeyUp&&c.onKeyUp.apply(c,arguments)}),onFocus:t[5]||(t[5]=function(){return c.onFocus&&c.onFocus.apply(c,arguments)}),onBlur:t[6]||(t[6]=function(){return c.onBlur&&c.onBlur.apply(c,arguments)})},e.ptm("barx"),{"data-pc-group-section":"bar"}),null,16,a),s.createElementVNode("div",s.mergeProps({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-controls":c.contentId,"aria-valuenow":r.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return c.onYBarMouseDown&&c.onYBarMouseDown.apply(c,arguments)}),onKeydown:t[8]||(t[8]=function(e){return c.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return c.onKeyUp&&c.onKeyUp.apply(c,arguments)}),onFocus:t[10]||(t[10]=function(){return c.onFocus&&c.onFocus.apply(c,arguments)})},e.ptm("bary"),{"data-pc-group-section":"bar"}),null,16,l)],16)},r}(primevue.utils,primevue.basecomponent,primevue.scrollpanel.style,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.scrollpanel=function(e,t,n,s){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:o(t).default,props:{step:{type:Number,default:5}},style:o(n).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:this.$attrs.id,orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},watch:{"$attrs.id":function(t){this.id=t||e.UniqueComponentId()}},mounted:function(){this.id=this.id||e.UniqueComponentId(),this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var t=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),s=e.DomHandler.getHeight(this.$el)-parseInt(n.height,10);"none"!==t["max-height"]&&0===s&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(t["max-height"],10)?t["max-height"]:this.$refs.content.offsetHeight+parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)+"px")},moveBar:function(){var t=this;if(this.$refs.content){var n=this.$refs.content.scrollWidth,s=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var o=this.$refs.content.scrollHeight,r=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/o,this.frame=this.requestAnimationFrame((function(){t.$refs.xBar&&(t.scrollXRatio>=1?(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.xBar,"p-scrollpanel-hidden")):(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.xBar,"p-scrollpanel-hidden"),t.$refs.xBar.style.cssText="width:"+Math.max(100*t.scrollXRatio,10)+"%; left:"+t.$refs.content.scrollLeft/n*100+"%;bottom:"+s+"px;")),t.$refs.yBar&&(t.scrollYRatio>=1?(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.yBar,"p-scrollpanel-hidden")):(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.yBar,"p-scrollpanel-hidden"),t.$refs.yBar.style.cssText="height:"+Math.max(100*t.scrollYRatio,10)+"%; top: calc("+t.$refs.content.scrollTop/o*100+"% - "+t.$refs.xBar.clientHeight+"px);right:"+r+"px;"))}))}},onYBarMouseDown:function(t){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=t.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onXBarMouseDown:function(t){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=t.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},computed:{contentId:function(){return this.id+"_content"}}},i=["id"],a=["aria-controls","aria-valuenow"],l=["aria-controls","aria-valuenow"];return r.render=function(e,t,n,o,r,c){return s.openBlock(),s.createElementBlock("div",s.mergeProps({class:e.cx("root")},e.ptmi("root")),[s.createElementVNode("div",s.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[s.createElementVNode("div",s.mergeProps({ref:"content",id:c.contentId,class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return c.onScroll&&c.onScroll.apply(c,arguments)}),onMouseenter:t[1]||(t[1]=function(){return c.moveBar&&c.moveBar.apply(c,arguments)})},e.ptm("content")),[s.renderSlot(e.$slots,"default")],16,i)],16),s.createElementVNode("div",s.mergeProps({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-controls":c.contentId,"aria-valuenow":r.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return c.onXBarMouseDown&&c.onXBarMouseDown.apply(c,arguments)}),onKeydown:t[3]||(t[3]=function(e){return c.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return c.onKeyUp&&c.onKeyUp.apply(c,arguments)}),onFocus:t[5]||(t[5]=function(){return c.onFocus&&c.onFocus.apply(c,arguments)}),onBlur:t[6]||(t[6]=function(){return c.onBlur&&c.onBlur.apply(c,arguments)})},e.ptm("barx"),{"data-pc-group-section":"bar"}),null,16,a),s.createElementVNode("div",s.mergeProps({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-controls":c.contentId,"aria-valuenow":r.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return c.onYBarMouseDown&&c.onYBarMouseDown.apply(c,arguments)}),onKeydown:t[8]||(t[8]=function(e){return c.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return c.onKeyUp&&c.onKeyUp.apply(c,arguments)}),onFocus:t[10]||(t[10]=function(){return c.onFocus&&c.onFocus.apply(c,arguments)})},e.ptm("bary"),{"data-pc-group-section":"bar"}),null,16,l)],16)},r}(primevue.utils,primevue.basecomponent,primevue.scrollpanel.style,Vue);
|
package/scrolltop/ScrollTop.d.ts
CHANGED
|
@@ -157,8 +157,8 @@ export interface ScrollTopEmits {}
|
|
|
157
157
|
*/
|
|
158
158
|
declare class ScrollTop extends ClassComponent<ScrollTopProps, ScrollTopSlots, ScrollTopEmits> {}
|
|
159
159
|
|
|
160
|
-
declare module '
|
|
161
|
-
interface GlobalComponents {
|
|
160
|
+
declare module 'vue' {
|
|
161
|
+
export interface GlobalComponents {
|
|
162
162
|
ScrollTop: GlobalComponentConstructor<ScrollTop>;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -257,8 +257,8 @@ export interface SelectButtonEmits {
|
|
|
257
257
|
*/
|
|
258
258
|
declare class SelectButton extends ClassComponent<SelectButtonProps, SelectButtonSlots, SelectButtonEmits> {}
|
|
259
259
|
|
|
260
|
-
declare module '
|
|
261
|
-
interface GlobalComponents {
|
|
260
|
+
declare module 'vue' {
|
|
261
|
+
export interface GlobalComponents {
|
|
262
262
|
SelectButton: GlobalComponentConstructor<SelectButton>;
|
|
263
263
|
}
|
|
264
264
|
}
|
package/sidebar/BaseSidebar.vue
CHANGED
package/sidebar/Sidebar.d.ts
CHANGED
|
@@ -255,8 +255,8 @@ export interface SidebarEmits {
|
|
|
255
255
|
*/
|
|
256
256
|
declare class Sidebar extends ClassComponent<SidebarProps, SidebarSlots, SidebarEmits> {}
|
|
257
257
|
|
|
258
|
-
declare module '
|
|
259
|
-
interface GlobalComponents {
|
|
258
|
+
declare module 'vue' {
|
|
259
|
+
export interface GlobalComponents {
|
|
260
260
|
Sidebar: GlobalComponentConstructor<Sidebar>;
|
|
261
261
|
}
|
|
262
262
|
}
|
package/sidebar/sidebar.cjs.js
CHANGED
|
@@ -68,6 +68,15 @@ var script$1 = {
|
|
|
68
68
|
return {
|
|
69
69
|
$parentInstance: this
|
|
70
70
|
};
|
|
71
|
+
},
|
|
72
|
+
watch: {
|
|
73
|
+
dismissable: function dismissable(newValue) {
|
|
74
|
+
if (newValue) {
|
|
75
|
+
this.bindOutsideClickListener();
|
|
76
|
+
} else {
|
|
77
|
+
this.unbindOutsideClickListener();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
71
80
|
}
|
|
72
81
|
};
|
|
73
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/focustrap"),t=require("primevue/icons/times"),n=require("primevue/portal"),
|
|
1
|
+
"use strict";var e=require("primevue/focustrap"),t=require("primevue/icons/times"),n=require("primevue/portal"),i=require("primevue/ripple"),o=require("primevue/utils"),s=require("primevue/basecomponent"),r=require("primevue/sidebar/style"),l=require("vue");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(t),d=c(n),m=c(i),h={name:"Sidebar",extends:{name:"BaseSidebar",extends:c(s).default,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},header:{type:null,default:null},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},style:c(r).default,provide:function(){return{$parentInstance:this}},watch:{dismissable:function(e){e?this.bindOutsideClickListener():this.unbindOutsideClickListener()}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,documentKeydownListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&o.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.bindDocumentKeyDownListener(),this.autoZIndex&&o.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&o.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&o.ZIndexUtils.clear(this.mask),this.unbindDocumentKeyDownListener(),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e&&e.querySelector("[autofocus]")},t=this.$slots.header&&e(this.headerContainer);t||(t=this.$slots.default&&e(this.container))||(t=this.closeButton),t&&o.DomHandler.focus(t)},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&o.DomHandler.blockBodyScroll()},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&o.DomHandler.unblockBodyScroll()},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindDocumentKeyDownListener:function(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeydown,document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener:function(){this.documentKeydownListener&&(document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:a.default,ripple:m.default},components:{Portal:d.default,TimesIcon:u.default}},f=["aria-modal"],p=["aria-label"];h.render=function(e,t,n,i,o,s){var r=l.resolveComponent("Portal"),c=l.resolveDirective("ripple"),a=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(r,null,{default:l.withCtx((function(){return[o.containerVisible?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.maskRef,onMousedown:t[1]||(t[1]=function(){return s.onMaskClick&&s.onMaskClick.apply(s,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[l.createVNode(l.Transition,l.mergeProps({name:"p-sidebar",onEnter:s.onEnter,onAfterEnter:s.onAfterEnter,onBeforeLeave:s.onBeforeLeave,onLeave:s.onLeave,onAfterLeave:s.onAfterLeave,appear:""},e.ptm("transition")),{default:l.withCtx((function(){return[e.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal},e.ptmi("root")),[e.$slots.container?l.renderSlot(e.$slots,"container",{key:0,onClose:s.hide,closeCallback:s.hide}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("div",l.mergeProps({ref:s.headerContainerRef,class:e.cx("header")},e.ptm("header")),[l.renderSlot(e.$slots,"header",{class:l.normalizeClass(e.cx("title"))},(function(){return[e.header?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("title")},e.ptm("title")),l.toDisplayString(e.header),17)):l.createCommentVNode("",!0)]})),e.showCloseIcon?l.withDirectives((l.openBlock(),l.createElementBlock("button",l.mergeProps({key:0,ref:s.closeButtonRef,type:"button",class:e.cx("closeButton"),"aria-label":s.closeAriaLabel,onClick:t[0]||(t[0]=function(){return s.hide&&s.hide.apply(s,arguments)})},e.ptm("closeButton"),{"data-pc-group-section":"iconcontainer"}),[l.renderSlot(e.$slots,"closeicon",{class:l.normalizeClass(e.cx("closeIcon"))},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),l.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,p)),[[c]]):l.createCommentVNode("",!0)],16),l.createElementVNode("div",l.mergeProps({ref:s.contentRef,class:e.cx("content")},e.ptm("content")),[l.renderSlot(e.$slots,"default")],16)],64))],16,f)),[[a]]):l.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):l.createCommentVNode("",!0)]})),_:3})},module.exports=h;
|
package/sidebar/sidebar.esm.js
CHANGED
|
@@ -57,6 +57,15 @@ var script$1 = {
|
|
|
57
57
|
return {
|
|
58
58
|
$parentInstance: this
|
|
59
59
|
};
|
|
60
|
+
},
|
|
61
|
+
watch: {
|
|
62
|
+
dismissable: function dismissable(newValue) {
|
|
63
|
+
if (newValue) {
|
|
64
|
+
this.bindOutsideClickListener();
|
|
65
|
+
} else {
|
|
66
|
+
this.unbindOutsideClickListener();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
60
69
|
}
|
|
61
70
|
};
|
|
62
71
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/focustrap";import t from"primevue/icons/times";import n from"primevue/portal";import i from"primevue/ripple";import{ZIndexUtils as o,DomHandler as s}from"primevue/utils";import r from"primevue/basecomponent";import l from"primevue/sidebar/style";import{resolveComponent as
|
|
1
|
+
import e from"primevue/focustrap";import t from"primevue/icons/times";import n from"primevue/portal";import i from"primevue/ripple";import{ZIndexUtils as o,DomHandler as s}from"primevue/utils";import r from"primevue/basecomponent";import l from"primevue/sidebar/style";import{resolveComponent as c,resolveDirective as a,openBlock as u,createBlock as d,withCtx as f,createElementBlock as h,mergeProps as m,createVNode as p,Transition as k,withDirectives as b,renderSlot as v,Fragment as y,createElementVNode as L,normalizeClass as C,toDisplayString as w,createCommentVNode as x,resolveDynamicComponent as B}from"vue";var I={name:"Sidebar",extends:{name:"BaseSidebar",extends:r,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},header:{type:null,default:null},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},style:l,provide:function(){return{$parentInstance:this}},watch:{dismissable:function(e){e?this.bindOutsideClickListener():this.unbindOutsideClickListener()}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,documentKeydownListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&o.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.bindDocumentKeyDownListener(),this.autoZIndex&&o.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&s.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&o.clear(this.mask),this.unbindDocumentKeyDownListener(),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e&&e.querySelector("[autofocus]")},t=this.$slots.header&&e(this.headerContainer);t||(t=this.$slots.default&&e(this.container))||(t=this.closeButton),t&&s.focus(t)},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&s.blockBodyScroll()},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&s.unblockBodyScroll()},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindDocumentKeyDownListener:function(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeydown,document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener:function(){this.documentKeydownListener&&(document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:e,ripple:i},components:{Portal:n,TimesIcon:t}},S=["aria-modal"],$=["aria-label"];I.render=function(e,t,n,i,o,s){var r=c("Portal"),l=a("ripple"),I=a("focustrap");return u(),d(r,null,{default:f((function(){return[o.containerVisible?(u(),h("div",m({key:0,ref:s.maskRef,onMousedown:t[1]||(t[1]=function(){return s.onMaskClick&&s.onMaskClick.apply(s,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[p(k,m({name:"p-sidebar",onEnter:s.onEnter,onAfterEnter:s.onAfterEnter,onBeforeLeave:s.onBeforeLeave,onLeave:s.onLeave,onAfterLeave:s.onAfterLeave,appear:""},e.ptm("transition")),{default:f((function(){return[e.visible?b((u(),h("div",m({key:0,ref:s.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal},e.ptmi("root")),[e.$slots.container?v(e.$slots,"container",{key:0,onClose:s.hide,closeCallback:s.hide}):(u(),h(y,{key:1},[L("div",m({ref:s.headerContainerRef,class:e.cx("header")},e.ptm("header")),[v(e.$slots,"header",{class:C(e.cx("title"))},(function(){return[e.header?(u(),h("div",m({key:0,class:e.cx("title")},e.ptm("title")),w(e.header),17)):x("",!0)]})),e.showCloseIcon?b((u(),h("button",m({key:0,ref:s.closeButtonRef,type:"button",class:e.cx("closeButton"),"aria-label":s.closeAriaLabel,onClick:t[0]||(t[0]=function(){return s.hide&&s.hide.apply(s,arguments)})},e.ptm("closeButton"),{"data-pc-group-section":"iconcontainer"}),[v(e.$slots,"closeicon",{class:C(e.cx("closeIcon"))},(function(){return[(u(),d(B(e.closeIcon?"span":"TimesIcon"),m({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,$)),[[l]]):x("",!0)],16),L("div",m({ref:s.contentRef,class:e.cx("content")},e.ptm("content")),[v(e.$slots,"default")],16)],64))],16,S)),[[I]]):x("",!0)]})),_:3},16,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):x("",!0)]})),_:3})};export{I as default};
|
package/sidebar/sidebar.js
CHANGED
|
@@ -61,6 +61,15 @@ this.primevue.sidebar = (function (FocusTrap, TimesIcon, Portal, Ripple, utils,
|
|
|
61
61
|
return {
|
|
62
62
|
$parentInstance: this
|
|
63
63
|
};
|
|
64
|
+
},
|
|
65
|
+
watch: {
|
|
66
|
+
dismissable: function dismissable(newValue) {
|
|
67
|
+
if (newValue) {
|
|
68
|
+
this.bindOutsideClickListener();
|
|
69
|
+
} else {
|
|
70
|
+
this.unbindOutsideClickListener();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
64
73
|
}
|
|
65
74
|
};
|
|
66
75
|
|
package/sidebar/sidebar.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.sidebar=function(e,t,n,i,o,s,r,l){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(t),d=c(n),m=c(i),h={name:"Sidebar",extends:{name:"BaseSidebar",extends:c(s).default,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},header:{type:null,default:null},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},style:c(r).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,documentKeydownListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&o.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.bindDocumentKeyDownListener(),this.autoZIndex&&o.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&o.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&o.ZIndexUtils.clear(this.mask),this.unbindDocumentKeyDownListener(),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e&&e.querySelector("[autofocus]")},t=this.$slots.header&&e(this.headerContainer);t||(t=this.$slots.default&&e(this.container))||(t=this.closeButton),t&&o.DomHandler.focus(t)},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&o.DomHandler.blockBodyScroll()},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&o.DomHandler.unblockBodyScroll()},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindDocumentKeyDownListener:function(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeydown,document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener:function(){this.documentKeydownListener&&(document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:a.default,ripple:m.default},components:{Portal:d.default,TimesIcon:u.default}},f=["aria-modal"],p=["aria-label"];return h.render=function(e,t,n,i,o,s){var r=l.resolveComponent("Portal"),c=l.resolveDirective("ripple"),a=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(r,null,{default:l.withCtx((function(){return[o.containerVisible?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.maskRef,onMousedown:t[1]||(t[1]=function(){return s.onMaskClick&&s.onMaskClick.apply(s,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[l.createVNode(l.Transition,l.mergeProps({name:"p-sidebar",onEnter:s.onEnter,onAfterEnter:s.onAfterEnter,onBeforeLeave:s.onBeforeLeave,onLeave:s.onLeave,onAfterLeave:s.onAfterLeave,appear:""},e.ptm("transition")),{default:l.withCtx((function(){return[e.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal},e.ptmi("root")),[e.$slots.container?l.renderSlot(e.$slots,"container",{key:0,onClose:s.hide,closeCallback:s.hide}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("div",l.mergeProps({ref:s.headerContainerRef,class:e.cx("header")},e.ptm("header")),[l.renderSlot(e.$slots,"header",{class:l.normalizeClass(e.cx("title"))},(function(){return[e.header?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("title")},e.ptm("title")),l.toDisplayString(e.header),17)):l.createCommentVNode("",!0)]})),e.showCloseIcon?l.withDirectives((l.openBlock(),l.createElementBlock("button",l.mergeProps({key:0,ref:s.closeButtonRef,type:"button",class:e.cx("closeButton"),"aria-label":s.closeAriaLabel,onClick:t[0]||(t[0]=function(){return s.hide&&s.hide.apply(s,arguments)})},e.ptm("closeButton"),{"data-pc-group-section":"iconcontainer"}),[l.renderSlot(e.$slots,"closeicon",{class:l.normalizeClass(e.cx("closeIcon"))},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),l.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,p)),[[c]]):l.createCommentVNode("",!0)],16),l.createElementVNode("div",l.mergeProps({ref:s.contentRef,class:e.cx("content")},e.ptm("content")),[l.renderSlot(e.$slots,"default")],16)],64))],16,f)),[[a]]):l.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):l.createCommentVNode("",!0)]})),_:3})},h}(primevue.focustrap,primevue.icons.times,primevue.portal,primevue.ripple,primevue.utils,primevue.basecomponent,primevue.sidebar.style,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.sidebar=function(e,t,n,i,o,s,r,l){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(t),d=c(n),m=c(i),h={name:"Sidebar",extends:{name:"BaseSidebar",extends:c(s).default,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},header:{type:null,default:null},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},style:c(r).default,provide:function(){return{$parentInstance:this}},watch:{dismissable:function(e){e?this.bindOutsideClickListener():this.unbindOutsideClickListener()}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,documentKeydownListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&o.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.bindDocumentKeyDownListener(),this.autoZIndex&&o.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&o.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&o.ZIndexUtils.clear(this.mask),this.unbindDocumentKeyDownListener(),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e&&e.querySelector("[autofocus]")},t=this.$slots.header&&e(this.headerContainer);t||(t=this.$slots.default&&e(this.container))||(t=this.closeButton),t&&o.DomHandler.focus(t)},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&o.DomHandler.blockBodyScroll()},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&o.DomHandler.unblockBodyScroll()},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindDocumentKeyDownListener:function(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeydown,document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener:function(){this.documentKeydownListener&&(document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:a.default,ripple:m.default},components:{Portal:d.default,TimesIcon:u.default}},f=["aria-modal"],p=["aria-label"];return h.render=function(e,t,n,i,o,s){var r=l.resolveComponent("Portal"),c=l.resolveDirective("ripple"),a=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(r,null,{default:l.withCtx((function(){return[o.containerVisible?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.maskRef,onMousedown:t[1]||(t[1]=function(){return s.onMaskClick&&s.onMaskClick.apply(s,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[l.createVNode(l.Transition,l.mergeProps({name:"p-sidebar",onEnter:s.onEnter,onAfterEnter:s.onAfterEnter,onBeforeLeave:s.onBeforeLeave,onLeave:s.onLeave,onAfterLeave:s.onAfterLeave,appear:""},e.ptm("transition")),{default:l.withCtx((function(){return[e.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal},e.ptmi("root")),[e.$slots.container?l.renderSlot(e.$slots,"container",{key:0,onClose:s.hide,closeCallback:s.hide}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("div",l.mergeProps({ref:s.headerContainerRef,class:e.cx("header")},e.ptm("header")),[l.renderSlot(e.$slots,"header",{class:l.normalizeClass(e.cx("title"))},(function(){return[e.header?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("title")},e.ptm("title")),l.toDisplayString(e.header),17)):l.createCommentVNode("",!0)]})),e.showCloseIcon?l.withDirectives((l.openBlock(),l.createElementBlock("button",l.mergeProps({key:0,ref:s.closeButtonRef,type:"button",class:e.cx("closeButton"),"aria-label":s.closeAriaLabel,onClick:t[0]||(t[0]=function(){return s.hide&&s.hide.apply(s,arguments)})},e.ptm("closeButton"),{"data-pc-group-section":"iconcontainer"}),[l.renderSlot(e.$slots,"closeicon",{class:l.normalizeClass(e.cx("closeIcon"))},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),l.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,p)),[[c]]):l.createCommentVNode("",!0)],16),l.createElementVNode("div",l.mergeProps({ref:s.contentRef,class:e.cx("content")},e.ptm("content")),[l.renderSlot(e.$slots,"default")],16)],64))],16,f)),[[a]]):l.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):l.createCommentVNode("",!0)]})),_:3})},h}(primevue.focustrap,primevue.icons.times,primevue.portal,primevue.ripple,primevue.utils,primevue.basecomponent,primevue.sidebar.style,Vue);
|
package/skeleton/Skeleton.d.ts
CHANGED
|
@@ -134,8 +134,8 @@ export interface SkeletonEmits {}
|
|
|
134
134
|
*/
|
|
135
135
|
declare class Skeleton extends ClassComponent<SkeletonProps, SkeletonSlots, SkeletonEmits> {}
|
|
136
136
|
|
|
137
|
-
declare module '
|
|
138
|
-
interface GlobalComponents {
|
|
137
|
+
declare module 'vue' {
|
|
138
|
+
export interface GlobalComponents {
|
|
139
139
|
Skeleton: GlobalComponentConstructor<Skeleton>;
|
|
140
140
|
}
|
|
141
141
|
}
|
package/slider/Slider.d.ts
CHANGED
|
@@ -200,8 +200,8 @@ export interface SliderEmits {
|
|
|
200
200
|
*/
|
|
201
201
|
declare class Slider extends ClassComponent<SliderProps, SliderSlots, SliderEmits> {}
|
|
202
202
|
|
|
203
|
-
declare module '
|
|
204
|
-
interface GlobalComponents {
|
|
203
|
+
declare module 'vue' {
|
|
204
|
+
export interface GlobalComponents {
|
|
205
205
|
Slider: GlobalComponentConstructor<Slider>;
|
|
206
206
|
}
|
|
207
207
|
}
|
package/slider/Slider.vue
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
v-if="!range"
|
|
6
6
|
:class="cx('handle')"
|
|
7
7
|
:style="[sx('handle'), handleStyle]"
|
|
8
|
-
@touchstart="onDragStart($event)"
|
|
9
|
-
@touchmove="onDrag($event)"
|
|
8
|
+
@touchstart.passive="onDragStart($event)"
|
|
9
|
+
@touchmove.passive="onDrag($event)"
|
|
10
10
|
@touchend="onDragEnd($event)"
|
|
11
11
|
@mousedown="onMouseDown($event)"
|
|
12
12
|
@keydown="onKeyDown($event)"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
v-if="range"
|
|
25
25
|
:class="cx('handle')"
|
|
26
26
|
:style="[sx('handle'), rangeStartHandleStyle]"
|
|
27
|
-
@touchstart="onDragStart($event, 0)"
|
|
28
|
-
@touchmove="onDrag($event)"
|
|
27
|
+
@touchstart.passive="onDragStart($event, 0)"
|
|
28
|
+
@touchmove.passive="onDrag($event)"
|
|
29
29
|
@touchend="onDragEnd($event)"
|
|
30
30
|
@mousedown="onMouseDown($event, 0)"
|
|
31
31
|
@keydown="onKeyDown($event, 0)"
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
v-if="range"
|
|
44
44
|
:class="cx('handle')"
|
|
45
45
|
:style="[sx('handle'), rangeEndHandleStyle]"
|
|
46
|
-
@touchstart="onDragStart($event, 1)"
|
|
47
|
-
@touchmove="onDrag($event)"
|
|
46
|
+
@touchstart.passive="onDragStart($event, 1)"
|
|
47
|
+
@touchmove.passive="onDrag($event)"
|
|
48
48
|
@touchend="onDragEnd($event)"
|
|
49
49
|
@mousedown="onMouseDown($event, 1)"
|
|
50
50
|
@keydown="onKeyDown($event, 1)"
|
|
@@ -154,6 +154,7 @@ export default {
|
|
|
154
154
|
this.handleIndex = index;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
event.currentTarget.focus();
|
|
157
158
|
event.preventDefault();
|
|
158
159
|
},
|
|
159
160
|
onDrag(event) {
|
package/slider/slider.cjs.js
CHANGED
|
@@ -136,6 +136,7 @@ var script = {
|
|
|
136
136
|
} else {
|
|
137
137
|
this.handleIndex = index;
|
|
138
138
|
}
|
|
139
|
+
event.currentTarget.focus();
|
|
139
140
|
event.preventDefault();
|
|
140
141
|
},
|
|
141
142
|
onDrag: function onDrag(event) {
|
|
@@ -326,10 +327,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
326
327
|
key: 0,
|
|
327
328
|
"class": _ctx.cx('handle'),
|
|
328
329
|
style: [_ctx.sx('handle'), $options.handleStyle],
|
|
329
|
-
|
|
330
|
+
onTouchstartPassive: _cache[0] || (_cache[0] = function ($event) {
|
|
330
331
|
return $options.onDragStart($event);
|
|
331
332
|
}),
|
|
332
|
-
|
|
333
|
+
onTouchmovePassive: _cache[1] || (_cache[1] = function ($event) {
|
|
333
334
|
return $options.onDrag($event);
|
|
334
335
|
}),
|
|
335
336
|
onTouchend: _cache[2] || (_cache[2] = function ($event) {
|
|
@@ -353,10 +354,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
353
354
|
key: 1,
|
|
354
355
|
"class": _ctx.cx('handle'),
|
|
355
356
|
style: [_ctx.sx('handle'), $options.rangeStartHandleStyle],
|
|
356
|
-
|
|
357
|
+
onTouchstartPassive: _cache[5] || (_cache[5] = function ($event) {
|
|
357
358
|
return $options.onDragStart($event, 0);
|
|
358
359
|
}),
|
|
359
|
-
|
|
360
|
+
onTouchmovePassive: _cache[6] || (_cache[6] = function ($event) {
|
|
360
361
|
return $options.onDrag($event);
|
|
361
362
|
}),
|
|
362
363
|
onTouchend: _cache[7] || (_cache[7] = function ($event) {
|
|
@@ -380,10 +381,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
380
381
|
key: 2,
|
|
381
382
|
"class": _ctx.cx('handle'),
|
|
382
383
|
style: [_ctx.sx('handle'), $options.rangeEndHandleStyle],
|
|
383
|
-
|
|
384
|
+
onTouchstartPassive: _cache[10] || (_cache[10] = function ($event) {
|
|
384
385
|
return $options.onDragStart($event, 1);
|
|
385
386
|
}),
|
|
386
|
-
|
|
387
|
+
onTouchmovePassive: _cache[11] || (_cache[11] = function ($event) {
|
|
387
388
|
return $options.onDrag($event);
|
|
388
389
|
}),
|
|
389
390
|
onTouchend: _cache[12] || (_cache[12] = function ($event) {
|
package/slider/slider.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/basecomponent"),n=require("primevue/slider/style"),i=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(){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 o(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e){if(Array.isArray(e))return u(e)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var h={name:"Slider",extends:{name:"BaseSlider",extends:a(t).default,props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:a(n).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue","change","slideend"],dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount:function(){this.unbindDragListeners()},methods:{updateDomData:function(){var t=this.$el.getBoundingClientRect();this.initX=t.left+e.DomHandler.getWindowScrollLeft(),this.initY=t.top+e.DomHandler.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue:function(e){var t=("horizontal"===this.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.max-this.min)+this.min;if(this.step){var n=this.range?this.value[this.handleIndex]:this.value,i=t-n;i<0?t=n+Math.ceil(t/this.step-n/this.step)*this.step:i>0&&(t=n+Math.floor(t/this.step-n/this.step)*this.step)}else t=Math.floor(t);this.updateModel(e,t)},updateModel:function(e,t){var n,i,a=parseFloat(t.toFixed(10));this.range?(n=this.value?l(i=this.value)||s(i)||o(i)||r():[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),n[0]=a):(a>this.max?a=this.max:a<=this.min&&(a=this.min),n[1]=a)):(a<this.min?a=this.min:a>this.max&&(a=this.max),n=a),this.$emit("update:modelValue",n),this.$emit("change",n)},onDragStart:function(e,t){this.disabled||(this.$el.setAttribute("data-p-sliding",!0),this.dragging=!0,this.updateDomData(),this.handleIndex=this.range&&this.value[0]===this.max?0:t,e.preventDefault())},onDrag:function(e){this.dragging&&(this.setValue(e),e.preventDefault())},onDragEnd:function(e){this.dragging&&(this.dragging=!1,this.$el.setAttribute("data-p-sliding",!1),this.$emit("slideend",{originalEvent:e,value:this.value}))},onBarClick:function(t){this.disabled||"handle"!==e.DomHandler.getAttribute(t.target,"data-pc-section")&&(this.updateDomData(),this.setValue(t))},onMouseDown:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)},onKeyDown:function(e,t){switch(this.handleIndex=t,e.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(e,t),e.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(e,t),e.preventDefault();break;case"PageDown":this.decrementValue(e,t,!0),e.preventDefault();break;case"PageUp":this.incrementValue(e,t,!0),e.preventDefault();break;case"Home":this.updateModel(e,this.min),e.preventDefault();break;case"End":this.updateModel(e,this.max),e.preventDefault()}},decrementValue:function(e,t){this.updateModel(e,this.range?this.step?this.value[t]-this.step:this.value[t]-1:this.step?this.value-this.step:!this.step&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?this.value-10:this.value-1),e.preventDefault()},incrementValue:function(e,t){this.updateModel(e,this.range?this.step?this.value[t]+this.step:this.value[t]+1:this.step?this.value+this.step:!this.step&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?this.value+10:this.value+1),e.preventDefault()},bindDragListeners:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},computed:{value:function(){var e,t,n,i,a;return this.range?[null!==(t=null===(n=this.modelValue)||void 0===n?void 0:n[0])&&void 0!==t?t:this.min,null!==(i=null===(a=this.modelValue)||void 0===a?void 0:a[1])&&void 0!==i?i:this.max]:null!==(e=this.modelValue)&&void 0!==e?e:this.min},horizontal:function(){return"horizontal"===this.orientation},vertical:function(){return"vertical"===this.orientation},rangeStyle:function(){if(this.range){var e=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,t=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{left:t+"%",width:e+"%"}:{bottom:t+"%",height:e+"%"}}return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle:function(){return this.horizontal?{left:this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},handlePosition:function(){return this.value<this.min?0:this.value>this.max?100:100*(this.value-this.min)/(this.max-this.min)},rangeStartPosition:function(){return this.value&&this.value[0]?100*(this.value[0]<this.min?0:this.value[0]-this.min)/(this.max-this.min):0},rangeEndPosition:function(){return this.value&&2===this.value.length?100*(this.value[1]>this.max?100:this.value[1]-this.min)/(this.max-this.min):100},rangeStartHandleStyle:function(){return this.horizontal?{left:this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle:function(){return this.horizontal?{left:this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}}},d=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],m=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],c=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"];h.render=function(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",i.mergeProps({class:e.cx("root"),onClick:t[15]||(t[15]=function(){return o.onBarClick&&o.onBarClick.apply(o,arguments)})},e.ptmi("root"),{"data-p-sliding":!1}),[i.createElementVNode("span",i.mergeProps({class:e.cx("range"),style:[e.sx("range"),o.rangeStyle]},e.ptm("range")),null,16),e.range?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:0,class:e.cx("handle"),style:[e.sx("handle"),o.handleStyle],
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/basecomponent"),n=require("primevue/slider/style"),i=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(){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 o(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e){if(Array.isArray(e))return u(e)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var h={name:"Slider",extends:{name:"BaseSlider",extends:a(t).default,props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:a(n).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue","change","slideend"],dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount:function(){this.unbindDragListeners()},methods:{updateDomData:function(){var t=this.$el.getBoundingClientRect();this.initX=t.left+e.DomHandler.getWindowScrollLeft(),this.initY=t.top+e.DomHandler.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue:function(e){var t=("horizontal"===this.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.max-this.min)+this.min;if(this.step){var n=this.range?this.value[this.handleIndex]:this.value,i=t-n;i<0?t=n+Math.ceil(t/this.step-n/this.step)*this.step:i>0&&(t=n+Math.floor(t/this.step-n/this.step)*this.step)}else t=Math.floor(t);this.updateModel(e,t)},updateModel:function(e,t){var n,i,a=parseFloat(t.toFixed(10));this.range?(n=this.value?l(i=this.value)||s(i)||o(i)||r():[],0==this.handleIndex?(a<this.min?a=this.min:a>=this.max&&(a=this.max),n[0]=a):(a>this.max?a=this.max:a<=this.min&&(a=this.min),n[1]=a)):(a<this.min?a=this.min:a>this.max&&(a=this.max),n=a),this.$emit("update:modelValue",n),this.$emit("change",n)},onDragStart:function(e,t){this.disabled||(this.$el.setAttribute("data-p-sliding",!0),this.dragging=!0,this.updateDomData(),this.handleIndex=this.range&&this.value[0]===this.max?0:t,e.currentTarget.focus(),e.preventDefault())},onDrag:function(e){this.dragging&&(this.setValue(e),e.preventDefault())},onDragEnd:function(e){this.dragging&&(this.dragging=!1,this.$el.setAttribute("data-p-sliding",!1),this.$emit("slideend",{originalEvent:e,value:this.value}))},onBarClick:function(t){this.disabled||"handle"!==e.DomHandler.getAttribute(t.target,"data-pc-section")&&(this.updateDomData(),this.setValue(t))},onMouseDown:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)},onKeyDown:function(e,t){switch(this.handleIndex=t,e.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(e,t),e.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(e,t),e.preventDefault();break;case"PageDown":this.decrementValue(e,t,!0),e.preventDefault();break;case"PageUp":this.incrementValue(e,t,!0),e.preventDefault();break;case"Home":this.updateModel(e,this.min),e.preventDefault();break;case"End":this.updateModel(e,this.max),e.preventDefault()}},decrementValue:function(e,t){this.updateModel(e,this.range?this.step?this.value[t]-this.step:this.value[t]-1:this.step?this.value-this.step:!this.step&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?this.value-10:this.value-1),e.preventDefault()},incrementValue:function(e,t){this.updateModel(e,this.range?this.step?this.value[t]+this.step:this.value[t]+1:this.step?this.value+this.step:!this.step&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?this.value+10:this.value+1),e.preventDefault()},bindDragListeners:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},computed:{value:function(){var e,t,n,i,a;return this.range?[null!==(t=null===(n=this.modelValue)||void 0===n?void 0:n[0])&&void 0!==t?t:this.min,null!==(i=null===(a=this.modelValue)||void 0===a?void 0:a[1])&&void 0!==i?i:this.max]:null!==(e=this.modelValue)&&void 0!==e?e:this.min},horizontal:function(){return"horizontal"===this.orientation},vertical:function(){return"vertical"===this.orientation},rangeStyle:function(){if(this.range){var e=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,t=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{left:t+"%",width:e+"%"}:{bottom:t+"%",height:e+"%"}}return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle:function(){return this.horizontal?{left:this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},handlePosition:function(){return this.value<this.min?0:this.value>this.max?100:100*(this.value-this.min)/(this.max-this.min)},rangeStartPosition:function(){return this.value&&this.value[0]?100*(this.value[0]<this.min?0:this.value[0]-this.min)/(this.max-this.min):0},rangeEndPosition:function(){return this.value&&2===this.value.length?100*(this.value[1]>this.max?100:this.value[1]-this.min)/(this.max-this.min):100},rangeStartHandleStyle:function(){return this.horizontal?{left:this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle:function(){return this.horizontal?{left:this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}}},d=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],m=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],c=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"];h.render=function(e,t,n,a,r,o){return i.openBlock(),i.createElementBlock("div",i.mergeProps({class:e.cx("root"),onClick:t[15]||(t[15]=function(){return o.onBarClick&&o.onBarClick.apply(o,arguments)})},e.ptmi("root"),{"data-p-sliding":!1}),[i.createElementVNode("span",i.mergeProps({class:e.cx("range"),style:[e.sx("range"),o.rangeStyle]},e.ptm("range")),null,16),e.range?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:0,class:e.cx("handle"),style:[e.sx("handle"),o.handleStyle],onTouchstartPassive:t[0]||(t[0]=function(e){return o.onDragStart(e)}),onTouchmovePassive:t[1]||(t[1]=function(e){return o.onDrag(e)}),onTouchend:t[2]||(t[2]=function(e){return o.onDragEnd(e)}),onMousedown:t[3]||(t[3]=function(e){return o.onMouseDown(e)}),onKeydown:t[4]||(t[4]=function(e){return o.onKeyDown(e)}),tabindex:e.tabindex,role:"slider","aria-valuemin":e.min,"aria-valuenow":e.modelValue,"aria-valuemax":e.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":e.orientation},e.ptm("handle")),null,16,d)),e.range?(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:1,class:e.cx("handle"),style:[e.sx("handle"),o.rangeStartHandleStyle],onTouchstartPassive:t[5]||(t[5]=function(e){return o.onDragStart(e,0)}),onTouchmovePassive:t[6]||(t[6]=function(e){return o.onDrag(e)}),onTouchend:t[7]||(t[7]=function(e){return o.onDragEnd(e)}),onMousedown:t[8]||(t[8]=function(e){return o.onMouseDown(e,0)}),onKeydown:t[9]||(t[9]=function(e){return o.onKeyDown(e,0)}),tabindex:e.tabindex,role:"slider","aria-valuemin":e.min,"aria-valuenow":e.modelValue?e.modelValue[0]:null,"aria-valuemax":e.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":e.orientation},e.ptm("startHandler")),null,16,m)):i.createCommentVNode("",!0),e.range?(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:2,class:e.cx("handle"),style:[e.sx("handle"),o.rangeEndHandleStyle],onTouchstartPassive:t[10]||(t[10]=function(e){return o.onDragStart(e,1)}),onTouchmovePassive:t[11]||(t[11]=function(e){return o.onDrag(e)}),onTouchend:t[12]||(t[12]=function(e){return o.onDragEnd(e)}),onMousedown:t[13]||(t[13]=function(e){return o.onMouseDown(e,1)}),onKeydown:t[14]||(t[14]=function(e){return o.onKeyDown(e,1)}),tabindex:e.tabindex,role:"slider","aria-valuemin":e.min,"aria-valuenow":e.modelValue?e.modelValue[1]:null,"aria-valuemax":e.max,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-orientation":e.orientation},e.ptm("endHandler")),null,16,c)):i.createCommentVNode("",!0)],16)},module.exports=h;
|
package/slider/slider.esm.js
CHANGED
|
@@ -129,6 +129,7 @@ var script = {
|
|
|
129
129
|
} else {
|
|
130
130
|
this.handleIndex = index;
|
|
131
131
|
}
|
|
132
|
+
event.currentTarget.focus();
|
|
132
133
|
event.preventDefault();
|
|
133
134
|
},
|
|
134
135
|
onDrag: function onDrag(event) {
|
|
@@ -319,10 +320,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
319
320
|
key: 0,
|
|
320
321
|
"class": _ctx.cx('handle'),
|
|
321
322
|
style: [_ctx.sx('handle'), $options.handleStyle],
|
|
322
|
-
|
|
323
|
+
onTouchstartPassive: _cache[0] || (_cache[0] = function ($event) {
|
|
323
324
|
return $options.onDragStart($event);
|
|
324
325
|
}),
|
|
325
|
-
|
|
326
|
+
onTouchmovePassive: _cache[1] || (_cache[1] = function ($event) {
|
|
326
327
|
return $options.onDrag($event);
|
|
327
328
|
}),
|
|
328
329
|
onTouchend: _cache[2] || (_cache[2] = function ($event) {
|
|
@@ -346,10 +347,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
346
347
|
key: 1,
|
|
347
348
|
"class": _ctx.cx('handle'),
|
|
348
349
|
style: [_ctx.sx('handle'), $options.rangeStartHandleStyle],
|
|
349
|
-
|
|
350
|
+
onTouchstartPassive: _cache[5] || (_cache[5] = function ($event) {
|
|
350
351
|
return $options.onDragStart($event, 0);
|
|
351
352
|
}),
|
|
352
|
-
|
|
353
|
+
onTouchmovePassive: _cache[6] || (_cache[6] = function ($event) {
|
|
353
354
|
return $options.onDrag($event);
|
|
354
355
|
}),
|
|
355
356
|
onTouchend: _cache[7] || (_cache[7] = function ($event) {
|
|
@@ -373,10 +374,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
373
374
|
key: 2,
|
|
374
375
|
"class": _ctx.cx('handle'),
|
|
375
376
|
style: [_ctx.sx('handle'), $options.rangeEndHandleStyle],
|
|
376
|
-
|
|
377
|
+
onTouchstartPassive: _cache[10] || (_cache[10] = function ($event) {
|
|
377
378
|
return $options.onDragStart($event, 1);
|
|
378
379
|
}),
|
|
379
|
-
|
|
380
|
+
onTouchmovePassive: _cache[11] || (_cache[11] = function ($event) {
|
|
380
381
|
return $options.onDrag($event);
|
|
381
382
|
}),
|
|
382
383
|
onTouchend: _cache[12] || (_cache[12] = function ($event) {
|