primevue 3.32.0 → 3.32.2
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 +4 -3
- package/autocomplete/AutoComplete.d.ts +17 -7
- package/autocomplete/AutoComplete.vue +2 -2
- package/autocomplete/autocomplete.cjs.js +3 -2
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +3 -2
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +3 -2
- 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/badgedirective/BadgeDirective.d.ts +2 -1
- package/basecomponent/BaseComponent.vue +67 -12
- package/basecomponent/basecomponent.cjs.js +76 -22
- package/basecomponent/basecomponent.cjs.min.js +1 -1
- package/basecomponent/basecomponent.esm.js +76 -22
- package/basecomponent/basecomponent.esm.min.js +1 -1
- package/basecomponent/basecomponent.js +76 -22
- package/basecomponent/basecomponent.min.js +1 -1
- package/basedirective/basedirective.cjs.js +47 -7
- package/basedirective/basedirective.cjs.min.js +1 -1
- package/basedirective/basedirective.esm.js +47 -7
- package/basedirective/basedirective.esm.min.js +1 -1
- package/basedirective/basedirective.js +47 -7
- package/basedirective/basedirective.min.js +1 -1
- package/baseicon/BaseIcon.vue +44 -32
- package/baseicon/baseicon.cjs.js +19 -30
- package/baseicon/baseicon.cjs.min.js +1 -1
- package/baseicon/baseicon.esm.js +19 -30
- package/baseicon/baseicon.esm.min.js +1 -1
- package/baseicon/baseicon.js +20 -32
- package/baseicon/baseicon.min.js +1 -1
- package/blockui/BlockUI.d.ts +2 -2
- package/breadcrumb/Breadcrumb.d.ts +2 -2
- package/button/Button.d.ts +2 -2
- package/button/Button.vue +2 -2
- package/button/button.cjs.js +2 -2
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +2 -2
- package/button/button.esm.min.js +1 -1
- package/button/button.js +2 -2
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +30 -6
- package/calendar/Calendar.vue +9 -8
- package/calendar/calendar.cjs.js +19 -10
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +19 -10
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +19 -10
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +2 -2
- package/carousel/Carousel.d.ts +2 -2
- package/carousel/Carousel.vue +2 -1
- package/carousel/carousel.cjs.js +4 -3
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +4 -3
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +4 -3
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +2 -2
- package/chart/Chart.d.ts +2 -2
- package/checkbox/Checkbox.d.ts +2 -2
- package/chip/Chip.d.ts +6 -4
- package/chips/Chips.d.ts +13 -4
- package/chips/Chips.vue +1 -1
- package/chips/chips.cjs.js +1 -0
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +1 -0
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +1 -0
- package/chips/chips.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +2 -2
- package/colorpicker/ColorPicker.vue +1 -40
- package/colorpicker/colorpicker.cjs.js +8 -47
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +8 -47
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +8 -47
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/Column.d.ts +13 -10
- package/columngroup/ColumnGroup.d.ts +2 -2
- package/config/PrimeVue.d.ts +2 -2
- package/confirmdialog/ConfirmDialog.d.ts +3 -2
- package/confirmpopup/ConfirmPopup.d.ts +3 -2
- package/contextmenu/ContextMenu.d.ts +3 -2
- package/core/core.js +551 -489
- package/core/core.min.js +10 -10
- package/datatable/BodyCell.vue +2 -0
- package/datatable/DataTable.d.ts +4 -2
- package/datatable/DataTable.vue +45 -15
- package/datatable/TableBody.vue +1 -1
- package/datatable/datatable.cjs.js +119 -74
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +119 -74
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +119 -74
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +2 -2
- package/dataview/DataView.vue +2 -1
- package/dataview/dataview.cjs.js +4 -3
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +4 -3
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +4 -3
- package/dataview/dataview.min.js +1 -1
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +2 -2
- package/deferredcontent/DeferredContent.d.ts +2 -2
- package/dialog/Dialog.d.ts +13 -3
- package/dialog/Dialog.vue +10 -7
- package/dialog/dialog.cjs.js +13 -7
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +14 -8
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +13 -7
- package/dialog/dialog.min.js +1 -1
- package/divider/Divider.d.ts +2 -2
- package/dock/Dock.d.ts +2 -2
- package/dropdown/Dropdown.d.ts +21 -10
- package/dropdown/Dropdown.vue +9 -0
- package/dropdown/dropdown.cjs.js +8 -0
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +8 -0
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +8 -0
- package/dropdown/dropdown.min.js +1 -1
- package/editor/BaseEditor.vue +8 -6
- package/editor/Editor.d.ts +2 -2
- package/editor/editor.cjs.js +8 -6
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +8 -6
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +8 -6
- package/editor/editor.min.js +1 -1
- package/fieldset/Fieldset.d.ts +2 -2
- package/fileupload/FileUpload.d.ts +12 -7
- package/fileupload/FileUpload.vue +4 -0
- package/fileupload/fileupload.cjs.js +4 -0
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +4 -0
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +5 -2
- package/fileupload/fileupload.min.js +1 -1
- package/focustrap/FocusTrap.d.ts +2 -1
- package/galleria/Galleria.d.ts +2 -2
- package/galleria/GalleriaItem.vue +2 -2
- package/galleria/GalleriaThumbnails.vue +5 -1
- package/galleria/galleria.cjs.js +16 -7
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +16 -7
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +16 -7
- package/galleria/galleria.min.js +1 -1
- package/image/Image.d.ts +6 -4
- package/image/Image.vue +8 -6
- package/image/image.cjs.js +18 -5
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +19 -6
- package/image/image.esm.min.js +1 -1
- package/image/image.js +18 -5
- package/image/image.min.js +1 -1
- package/inlinemessage/InlineMessage.d.ts +2 -2
- package/inplace/Inplace.d.ts +2 -2
- package/inputmask/InputMask.d.ts +2 -2
- package/inputnumber/InputNumber.d.ts +2 -2
- package/inputnumber/InputNumber.vue +1 -0
- package/inputnumber/inputnumber.cjs.js +1 -0
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +1 -0
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +1 -0
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +2 -2
- package/inputtext/InputText.d.ts +2 -2
- package/knob/Knob.d.ts +2 -2
- package/listbox/Listbox.d.ts +11 -5
- package/megamenu/MegaMenu.d.ts +3 -2
- package/menu/Menu.d.ts +2 -2
- package/menubar/Menubar.d.ts +3 -2
- package/message/BaseMessage.vue +5 -0
- package/message/Message.d.ts +4 -2
- package/message/message.cjs.js +1 -1
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +1 -1
- package/message/message.esm.min.js +1 -1
- package/message/message.js +1 -1
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +16 -6
- package/multiselect/MultiSelect.vue +1 -1
- package/multiselect/multiselect.cjs.js +1 -0
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +1 -0
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +1 -0
- 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 +9 -4
- package/paginator/Paginator.d.ts +2 -2
- package/panel/Panel.d.ts +3 -2
- package/panelmenu/PanelMenu.d.ts +3 -2
- package/passthrough/index.cjs.js +16 -60
- package/passthrough/index.cjs.min.js +1 -1
- package/passthrough/index.d.ts +0 -9
- package/passthrough/index.esm.js +16 -60
- package/passthrough/index.esm.min.js +1 -1
- package/passthrough/index.js +18 -59
- package/passthrough/index.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +365 -359
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.d.ts +1 -2
- package/passthrough/tailwind/index.esm.js +365 -359
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +365 -359
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/Password.d.ts +6 -4
- package/password/Password.vue +1 -0
- package/password/password.cjs.js +2 -1
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -1
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -1
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +2 -2
- package/picklist/PickList.vue +9 -7
- package/picklist/picklist.cjs.js +27 -9
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +27 -9
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +27 -9
- package/picklist/picklist.min.js +1 -1
- 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 +3 -2
- package/resources/themes/arya-blue/theme.css +4 -4
- package/resources/themes/arya-green/theme.css +4 -4
- package/resources/themes/arya-orange/theme.css +4 -4
- package/resources/themes/arya-purple/theme.css +4 -4
- package/resources/themes/bootstrap4-dark-blue/theme.css +8 -11
- package/resources/themes/bootstrap4-dark-purple/theme.css +8 -11
- package/resources/themes/bootstrap4-light-blue/theme.css +8 -11
- package/resources/themes/bootstrap4-light-purple/theme.css +8 -11
- package/resources/themes/fluent-light/theme.css +4 -4
- package/resources/themes/lara-dark-blue/theme.css +4 -4
- package/resources/themes/lara-dark-indigo/theme.css +4 -4
- package/resources/themes/lara-dark-purple/theme.css +4 -4
- package/resources/themes/lara-dark-teal/theme.css +4 -4
- package/resources/themes/lara-light-blue/theme.css +4 -4
- package/resources/themes/lara-light-indigo/theme.css +4 -4
- package/resources/themes/lara-light-purple/theme.css +4 -4
- package/resources/themes/lara-light-teal/theme.css +4 -4
- package/resources/themes/luna-amber/theme.css +4 -4
- package/resources/themes/luna-blue/theme.css +4 -4
- package/resources/themes/luna-green/theme.css +4 -4
- package/resources/themes/luna-pink/theme.css +4 -4
- package/resources/themes/md-dark-deeppurple/theme.css +4 -4
- package/resources/themes/md-dark-indigo/theme.css +4 -4
- package/resources/themes/md-light-deeppurple/theme.css +4 -4
- package/resources/themes/md-light-indigo/theme.css +4 -4
- package/resources/themes/mdc-dark-deeppurple/theme.css +4 -4
- package/resources/themes/mdc-dark-indigo/theme.css +4 -4
- package/resources/themes/mdc-light-deeppurple/theme.css +4 -4
- package/resources/themes/mdc-light-indigo/theme.css +4 -4
- package/resources/themes/mira/theme.css +4 -4
- package/resources/themes/nano/theme.css +4 -4
- package/resources/themes/nova/theme.css +4 -4
- package/resources/themes/nova-accent/theme.css +4 -4
- package/resources/themes/nova-alt/theme.css +4 -4
- package/resources/themes/nova-vue/theme.css +4 -4
- package/resources/themes/rhea/theme.css +4 -4
- package/resources/themes/saga-blue/theme.css +4 -4
- package/resources/themes/saga-green/theme.css +4 -4
- package/resources/themes/saga-orange/theme.css +4 -4
- package/resources/themes/saga-purple/theme.css +4 -4
- package/resources/themes/soho-dark/theme.css +4 -4
- package/resources/themes/soho-light/theme.css +4 -4
- package/resources/themes/tailwind-light/theme.css +4 -4
- package/resources/themes/vela-blue/theme.css +4 -4
- package/resources/themes/vela-green/theme.css +4 -4
- package/resources/themes/vela-orange/theme.css +4 -4
- package/resources/themes/vela-purple/theme.css +4 -4
- package/resources/themes/viva-dark/theme.css +4 -4
- package/resources/themes/viva-light/theme.css +4 -4
- package/ripple/Ripple.d.ts +2 -1
- package/scrollpanel/ScrollPanel.d.ts +2 -2
- package/scrolltop/ScrollTop.d.ts +2 -2
- package/selectbutton/SelectButton.d.ts +6 -2
- package/selectbutton/SelectButton.vue +2 -1
- package/selectbutton/selectbutton.cjs.js +2 -1
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -1
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/Sidebar.d.ts +10 -4
- package/sidebar/Sidebar.vue +2 -2
- package/sidebar/sidebar.cjs.js +4 -2
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +5 -3
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +4 -2
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +2 -2
- package/slider/Slider.d.ts +2 -2
- package/speeddial/SpeedDial.d.ts +9 -7
- package/speeddial/SpeedDial.vue +1 -1
- package/speeddial/speeddial.cjs.js +1 -1
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +1 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +1 -1
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +4 -2
- package/splitter/Splitter.d.ts +2 -2
- package/splitterpanel/SplitterPanel.d.ts +2 -2
- package/steps/Steps.d.ts +2 -2
- package/styleclass/StyleClass.d.ts +2 -1
- 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 +3 -2
- package/timeline/Timeline.d.ts +2 -2
- package/toast/BaseToast.vue +2 -0
- package/toast/Toast.d.ts +16 -4
- package/toast/toast.cjs.js +1 -1
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +1 -1
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +1 -1
- package/toast/toast.min.js +1 -1
- package/togglebutton/ToggleButton.d.ts +3 -2
- package/toolbar/Toolbar.d.ts +2 -2
- package/tooltip/Tooltip.d.ts +2 -1
- package/tree/Tree.d.ts +6 -2
- package/treeselect/TreeSelect.d.ts +3 -2
- package/treetable/TreeTable.d.ts +3 -2
- package/treetable/TreeTable.vue +4 -2
- package/treetable/treetable.cjs.js +6 -5
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +6 -5
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +6 -5
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +5 -2
- package/ts-helpers.d.ts +2 -0
- package/virtualscroller/VirtualScroller.d.ts +8 -6
- package/web-types.json +1 -1
package/image/Image.vue
CHANGED
|
@@ -11,31 +11,31 @@
|
|
|
11
11
|
<Portal>
|
|
12
12
|
<div v-if="maskVisible" :ref="maskRef" v-focustrap role="dialog" :class="cx('mask')" :aria-modal="maskVisible" @click="onMaskClick" @keydown="onMaskKeydown" v-bind="ptm('mask')">
|
|
13
13
|
<div class="p-image-toolbar" v-bind="ptm('toolbar')">
|
|
14
|
-
<button :class="cx('rotateRightButton')" @click="rotateRight" type="button" :aria-label="rightAriaLabel" v-bind="ptm('rotateRightButton')">
|
|
14
|
+
<button :class="cx('rotateRightButton')" @click="rotateRight" type="button" :aria-label="rightAriaLabel" v-bind="ptm('rotateRightButton')" data-pc-group-section="action">
|
|
15
15
|
<slot name="refresh">
|
|
16
16
|
<RefreshIcon v-bind="ptm('rotateRightIcon')" />
|
|
17
17
|
</slot>
|
|
18
18
|
</button>
|
|
19
19
|
|
|
20
|
-
<button :class="cx('rotateLeftButton')" @click="rotateLeft" type="button" :aria-label="leftAriaLabel" v-bind="ptm('rotateLeftButton')">
|
|
20
|
+
<button :class="cx('rotateLeftButton')" @click="rotateLeft" type="button" :aria-label="leftAriaLabel" v-bind="ptm('rotateLeftButton')" data-pc-group-section="action">
|
|
21
21
|
<slot name="undo">
|
|
22
22
|
<UndoIcon v-bind="ptm('rotateLeftIcon')" />
|
|
23
23
|
</slot>
|
|
24
24
|
</button>
|
|
25
25
|
|
|
26
|
-
<button :class="cx('zoomOutButton')" @click="zoomOut" type="button" :disabled="isZoomOutDisabled" :aria-label="zoomOutAriaLabel" v-bind="ptm('zoomOutButton')">
|
|
26
|
+
<button :class="cx('zoomOutButton')" @click="zoomOut" type="button" :disabled="isZoomOutDisabled" :aria-label="zoomOutAriaLabel" v-bind="ptm('zoomOutButton')" data-pc-group-section="action">
|
|
27
27
|
<slot name="zoomout">
|
|
28
28
|
<SearchMinusIcon v-bind="ptm('zoomOutIcon')" />
|
|
29
29
|
</slot>
|
|
30
30
|
</button>
|
|
31
31
|
|
|
32
|
-
<button :class="cx('zoomInButton')" @click="zoomIn" type="button" :disabled="isZoomInDisabled" :aria-label="zoomInAriaLabel" v-bind="ptm('zoomInButton')">
|
|
32
|
+
<button :class="cx('zoomInButton')" @click="zoomIn" type="button" :disabled="isZoomInDisabled" :aria-label="zoomInAriaLabel" v-bind="ptm('zoomInButton')" data-pc-group-section="action">
|
|
33
33
|
<slot name="zoomin">
|
|
34
34
|
<SearchPlusIcon v-bind="ptm('zoomInIcon')" />
|
|
35
35
|
</slot>
|
|
36
36
|
</button>
|
|
37
37
|
|
|
38
|
-
<button :class="cx('closeButton')" type="button" @click="hidePreview" :aria-label="closeAriaLabel" autofocus v-bind="ptm('closeButton')">
|
|
38
|
+
<button :class="cx('closeButton')" type="button" @click="hidePreview" :aria-label="closeAriaLabel" autofocus v-bind="ptm('closeButton')" data-pc-group-section="action">
|
|
39
39
|
<slot name="close">
|
|
40
40
|
<TimesIcon v-bind="ptm('closeIcon')" />
|
|
41
41
|
</slot>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</div>
|
|
44
44
|
<transition name="p-image-preview" @before-enter="onBeforeEnter" @enter="onEnter" @leave="onLeave" @before-leave="onBeforeLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
|
45
45
|
<div v-if="previewVisible" v-bind="ptm('previewContainer')">
|
|
46
|
-
<slot name="preview" :style="imagePreviewStyle" :onClick="onPreviewImageClick">
|
|
46
|
+
<slot name="preview" :class="cx('preview')" :style="imagePreviewStyle" :onClick="onPreviewImageClick">
|
|
47
47
|
<img :src="$attrs.src" :class="cx('preview')" :style="imagePreviewStyle" @click="onPreviewImageClick" v-bind="ptm('preview')" />
|
|
48
48
|
</slot>
|
|
49
49
|
</div>
|
|
@@ -93,6 +93,7 @@ export default {
|
|
|
93
93
|
},
|
|
94
94
|
onImageClick() {
|
|
95
95
|
if (this.preview) {
|
|
96
|
+
DomHandler.addClass(document.body, 'p-overflow-hidden');
|
|
96
97
|
this.maskVisible = true;
|
|
97
98
|
setTimeout(() => {
|
|
98
99
|
this.previewVisible = true;
|
|
@@ -179,6 +180,7 @@ export default {
|
|
|
179
180
|
this.previewVisible = false;
|
|
180
181
|
this.rotate = 0;
|
|
181
182
|
this.scale = 1;
|
|
183
|
+
DomHandler.removeClass(document.body, 'p-overflow-hidden');
|
|
182
184
|
}
|
|
183
185
|
},
|
|
184
186
|
computed: {
|
package/image/image.cjs.js
CHANGED
|
@@ -143,6 +143,7 @@ var script = {
|
|
|
143
143
|
onImageClick: function onImageClick() {
|
|
144
144
|
var _this = this;
|
|
145
145
|
if (this.preview) {
|
|
146
|
+
utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
|
|
146
147
|
this.maskVisible = true;
|
|
147
148
|
setTimeout(function () {
|
|
148
149
|
_this.previewVisible = true;
|
|
@@ -222,6 +223,7 @@ var script = {
|
|
|
222
223
|
this.previewVisible = false;
|
|
223
224
|
this.rotate = 0;
|
|
224
225
|
this.scale = 1;
|
|
226
|
+
utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
|
|
225
227
|
}
|
|
226
228
|
},
|
|
227
229
|
computed: {
|
|
@@ -343,7 +345,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
343
345
|
}),
|
|
344
346
|
type: "button",
|
|
345
347
|
"aria-label": $options.rightAriaLabel
|
|
346
|
-
}, _ctx.ptm('rotateRightButton')
|
|
348
|
+
}, _ctx.ptm('rotateRightButton'), {
|
|
349
|
+
"data-pc-group-section": "action"
|
|
350
|
+
}), [vue.renderSlot(_ctx.$slots, "refresh", {}, function () {
|
|
347
351
|
return [vue.createVNode(_component_RefreshIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('rotateRightIcon'))), null, 16)];
|
|
348
352
|
})], 16, _hoisted_2), vue.createElementVNode("button", vue.mergeProps({
|
|
349
353
|
"class": _ctx.cx('rotateLeftButton'),
|
|
@@ -352,7 +356,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
352
356
|
}),
|
|
353
357
|
type: "button",
|
|
354
358
|
"aria-label": $options.leftAriaLabel
|
|
355
|
-
}, _ctx.ptm('rotateLeftButton')
|
|
359
|
+
}, _ctx.ptm('rotateLeftButton'), {
|
|
360
|
+
"data-pc-group-section": "action"
|
|
361
|
+
}), [vue.renderSlot(_ctx.$slots, "undo", {}, function () {
|
|
356
362
|
return [vue.createVNode(_component_UndoIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('rotateLeftIcon'))), null, 16)];
|
|
357
363
|
})], 16, _hoisted_3), vue.createElementVNode("button", vue.mergeProps({
|
|
358
364
|
"class": _ctx.cx('zoomOutButton'),
|
|
@@ -362,7 +368,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
362
368
|
type: "button",
|
|
363
369
|
disabled: $options.isZoomOutDisabled,
|
|
364
370
|
"aria-label": $options.zoomOutAriaLabel
|
|
365
|
-
}, _ctx.ptm('zoomOutButton')
|
|
371
|
+
}, _ctx.ptm('zoomOutButton'), {
|
|
372
|
+
"data-pc-group-section": "action"
|
|
373
|
+
}), [vue.renderSlot(_ctx.$slots, "zoomout", {}, function () {
|
|
366
374
|
return [vue.createVNode(_component_SearchMinusIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('zoomOutIcon'))), null, 16)];
|
|
367
375
|
})], 16, _hoisted_4), vue.createElementVNode("button", vue.mergeProps({
|
|
368
376
|
"class": _ctx.cx('zoomInButton'),
|
|
@@ -372,7 +380,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
372
380
|
type: "button",
|
|
373
381
|
disabled: $options.isZoomInDisabled,
|
|
374
382
|
"aria-label": $options.zoomInAriaLabel
|
|
375
|
-
}, _ctx.ptm('zoomInButton')
|
|
383
|
+
}, _ctx.ptm('zoomInButton'), {
|
|
384
|
+
"data-pc-group-section": "action"
|
|
385
|
+
}), [vue.renderSlot(_ctx.$slots, "zoomin", {}, function () {
|
|
376
386
|
return [vue.createVNode(_component_SearchPlusIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('zoomInIcon'))), null, 16)];
|
|
377
387
|
})], 16, _hoisted_5), vue.createElementVNode("button", vue.mergeProps({
|
|
378
388
|
"class": _ctx.cx('closeButton'),
|
|
@@ -382,7 +392,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
382
392
|
}),
|
|
383
393
|
"aria-label": $options.closeAriaLabel,
|
|
384
394
|
autofocus: ""
|
|
385
|
-
}, _ctx.ptm('closeButton')
|
|
395
|
+
}, _ctx.ptm('closeButton'), {
|
|
396
|
+
"data-pc-group-section": "action"
|
|
397
|
+
}), [vue.renderSlot(_ctx.$slots, "close", {}, function () {
|
|
386
398
|
return [vue.createVNode(_component_TimesIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('closeIcon'))), null, 16)];
|
|
387
399
|
})], 16, _hoisted_6)], 16), vue.createVNode(vue.Transition, vue.mergeProps({
|
|
388
400
|
name: "p-image-preview",
|
|
@@ -396,6 +408,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
396
408
|
return [$data.previewVisible ? (vue.openBlock(), vue.createElementBlock("div", vue.normalizeProps(vue.mergeProps({
|
|
397
409
|
key: 0
|
|
398
410
|
}, _ctx.ptm('previewContainer'))), [vue.renderSlot(_ctx.$slots, "preview", {
|
|
411
|
+
"class": vue.normalizeClass(_ctx.cx('preview')),
|
|
399
412
|
style: vue.normalizeStyle($options.imagePreviewStyle),
|
|
400
413
|
onClick: $options.onPreviewImageClick
|
|
401
414
|
}, function () {
|
package/image/image.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/focustrap"),t=require("primevue/icons/eye"),n=require("primevue/icons/refresh"),o=require("primevue/icons/searchminus"),i=require("primevue/icons/searchplus"),r=require("primevue/icons/times"),a=require("primevue/icons/undo"),l=require("primevue/portal"),s=require("primevue/utils"),c=require("primevue/basecomponent"),u=require("primevue/usestyle"),p=require("vue");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(e),v=m(t),d=m(n),g=m(o),b=m(i),h=m(r),y=m(a),w=m(l),k=m(c),P=u.useStyle("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n\n.p-image-preview-container > img {\n cursor: pointer;\n}\n\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n",{name:"image",manual:!0}),I={name:"Image",extends:{name:"BaseImage",extends:k.default,props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null},indicatorIcon:{type:String,default:void 0},zoomInDisabled:{type:Boolean,default:!1},zoomOutDisabled:{type:Boolean,default:!1}},css:{classes:{root:function(e){return["p-image p-component",{"p-image-preview-container":e.props.preview}]},image:function(e){return e.props.image},button:"p-image-preview-indicator",icon:"p-image-preview-icon",mask:"p-image-mask p-component-overlay p-component-overlay-enter",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomOutDisabled}]},zoomInButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomInDisabled}]},closeButton:"p-image-action p-link",preview:"p-image-preview"},loadStyle:P.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["show","hide","error"],mask:null,data:function(){return{maskVisible:!1,previewVisible:!1,rotate:0,scale:1}},beforeUnmount:function(){this.mask&&s.ZIndexUtils.clear(this.container)},methods:{maskRef:function(e){this.mask=e},toolbarRef:function(e){this.toolbarRef=e},onImageClick:function(){var e=this;this.preview&&(this.maskVisible=!0,setTimeout((function(){e.previewVisible=!0}),25))},onPreviewImageClick:function(){this.previewClick=!0},onMaskClick:function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||(this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1)},onMaskKeydown:function(e){var t=this;if("Escape"===e.code)this.hidePreview(),setTimeout((function(){s.DomHandler.focus(t.$refs.previewButton)}),200),e.preventDefault()},onError:function(){this.$emit("error")},rotateRight:function(){this.rotate+=90,this.previewClick=!0},rotateLeft:function(){this.rotate-=90,this.previewClick=!0},zoomIn:function(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut:function(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter:function(){s.ZIndexUtils.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter:function(){this.focus(),this.$emit("show")},onBeforeLeave:function(){!this.isUnstyled&&s.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(e){s.ZIndexUtils.clear(e),this.maskVisible=!1},focus:function(){var e=this.mask.querySelector("[autofocus]");e&&e.focus()},hidePreview:function(){this.previewVisible=!1,this.rotate=0,this.scale=1}},computed:{containerClass:function(){return[this.cx("root"),this.class]},rotateClass:function(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle:function(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},isZoomInDisabled:function(){return this.zoomInDisabled||this.scale>=1.5},isZoomOutDisabled:function(){return this.zoomOutDisabled||this.scale<=.5},rightAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:w.default,EyeIcon:v.default,RefreshIcon:d.default,UndoIcon:y.default,SearchMinusIcon:g.default,SearchPlusIcon:b.default,TimesIcon:h.default},directives:{focustrap:f.default}};function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=S(e,"string");return"symbol"===C(t)?t:String(t)}function S(e,t){if("object"!==C(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==C(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=["aria-modal"],V=["aria-label"],x=["aria-label"],$=["disabled","aria-label"],D=["disabled","aria-label"],N=["aria-label"],R=["src"];I.render=function(e,t,n,o,i,r){var a=p.resolveComponent("RefreshIcon"),l=p.resolveComponent("UndoIcon"),s=p.resolveComponent("SearchMinusIcon"),c=p.resolveComponent("SearchPlusIcon"),u=p.resolveComponent("TimesIcon"),m=p.resolveComponent("Portal"),f=p.resolveDirective("focustrap");return p.openBlock(),p.createElementBlock("span",p.mergeProps({class:r.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"image"}),[p.renderSlot(e.$slots,"image",{onError:r.onError},(function(){return[p.createElementVNode("img",p.mergeProps({style:e.imageStyle,class:[e.cx("image"),e.imageClass],onError:t[0]||(t[0]=function(){return r.onError&&r.onError.apply(r,arguments)})},z(z({},e.$attrs),e.ptm("image"))),null,16)]})),e.preview?(p.openBlock(),p.createElementBlock("button",p.mergeProps({key:0,ref:"previewButton",type:"button",class:e.cx("button"),onClick:t[1]||(t[1]=function(){return r.onImageClick&&r.onImageClick.apply(r,arguments)})},z(z({},e.previewButtonProps),e.ptm("button"))),[p.renderSlot(e.$slots,"indicatoricon",{},(function(){return[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(e.indicatorIcon?"i":"EyeIcon"),p.mergeProps({class:e.cx("icon")},e.ptm("icon")),null,16,["class"]))]}))],16)):p.createCommentVNode("",!0),p.createVNode(m,null,{default:p.withCtx((function(){return[i.maskVisible?p.withDirectives((p.openBlock(),p.createElementBlock("div",p.mergeProps({key:0,ref:r.maskRef,role:"dialog",class:e.cx("mask"),"aria-modal":i.maskVisible,onClick:t[8]||(t[8]=function(){return r.onMaskClick&&r.onMaskClick.apply(r,arguments)}),onKeydown:t[9]||(t[9]=function(){return r.onMaskKeydown&&r.onMaskKeydown.apply(r,arguments)})},e.ptm("mask")),[p.createElementVNode("div",p.mergeProps({class:"p-image-toolbar"},e.ptm("toolbar")),[p.createElementVNode("button",p.mergeProps({class:e.cx("rotateRightButton"),onClick:t[2]||(t[2]=function(){return r.rotateRight&&r.rotateRight.apply(r,arguments)}),type:"button","aria-label":r.rightAriaLabel},e.ptm("rotateRightButton")),[p.renderSlot(e.$slots,"refresh",{},(function(){return[p.createVNode(a,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateRightIcon"))),null,16)]}))],16,V),p.createElementVNode("button",p.mergeProps({class:e.cx("rotateLeftButton"),onClick:t[3]||(t[3]=function(){return r.rotateLeft&&r.rotateLeft.apply(r,arguments)}),type:"button","aria-label":r.leftAriaLabel},e.ptm("rotateLeftButton")),[p.renderSlot(e.$slots,"undo",{},(function(){return[p.createVNode(l,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateLeftIcon"))),null,16)]}))],16,x),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomOutButton"),onClick:t[4]||(t[4]=function(){return r.zoomOut&&r.zoomOut.apply(r,arguments)}),type:"button",disabled:r.isZoomOutDisabled,"aria-label":r.zoomOutAriaLabel},e.ptm("zoomOutButton")),[p.renderSlot(e.$slots,"zoomout",{},(function(){return[p.createVNode(s,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomOutIcon"))),null,16)]}))],16,$),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomInButton"),onClick:t[5]||(t[5]=function(){return r.zoomIn&&r.zoomIn.apply(r,arguments)}),type:"button",disabled:r.isZoomInDisabled,"aria-label":r.zoomInAriaLabel},e.ptm("zoomInButton")),[p.renderSlot(e.$slots,"zoomin",{},(function(){return[p.createVNode(c,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomInIcon"))),null,16)]}))],16,D),p.createElementVNode("button",p.mergeProps({class:e.cx("closeButton"),type:"button",onClick:t[6]||(t[6]=function(){return r.hidePreview&&r.hidePreview.apply(r,arguments)}),"aria-label":r.closeAriaLabel,autofocus:""},e.ptm("closeButton")),[p.renderSlot(e.$slots,"close",{},(function(){return[p.createVNode(u,p.normalizeProps(p.guardReactiveProps(e.ptm("closeIcon"))),null,16)]}))],16,N)],16),p.createVNode(p.Transition,p.mergeProps({name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:p.withCtx((function(){return[i.previewVisible?(p.openBlock(),p.createElementBlock("div",p.normalizeProps(p.mergeProps({key:0},e.ptm("previewContainer"))),[p.renderSlot(e.$slots,"preview",{style:p.normalizeStyle(r.imagePreviewStyle),onClick:r.onPreviewImageClick},(function(){return[p.createElementVNode("img",p.mergeProps({src:e.$attrs.src,class:e.cx("preview"),style:r.imagePreviewStyle,onClick:t[7]||(t[7]=function(){return r.onPreviewImageClick&&r.onPreviewImageClick.apply(r,arguments)})},e.ptm("preview")),null,16,R)]}))],16)):p.createCommentVNode("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],16,L)),[[f]]):p.createCommentVNode("",!0)]})),_:3})],16)},module.exports=I;
|
|
1
|
+
"use strict";var e=require("primevue/focustrap"),t=require("primevue/icons/eye"),o=require("primevue/icons/refresh"),n=require("primevue/icons/searchminus"),i=require("primevue/icons/searchplus"),r=require("primevue/icons/times"),a=require("primevue/icons/undo"),l=require("primevue/portal"),s=require("primevue/utils"),c=require("primevue/basecomponent"),u=require("primevue/usestyle"),p=require("vue");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(e),d=m(t),v=m(o),g=m(n),b=m(i),h=m(r),y=m(a),w=m(l),k=m(c),P=u.useStyle("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n\n.p-image-preview-container > img {\n cursor: pointer;\n}\n\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n",{name:"image",manual:!0}),C={name:"Image",extends:{name:"BaseImage",extends:k.default,props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null},indicatorIcon:{type:String,default:void 0},zoomInDisabled:{type:Boolean,default:!1},zoomOutDisabled:{type:Boolean,default:!1}},css:{classes:{root:function(e){return["p-image p-component",{"p-image-preview-container":e.props.preview}]},image:function(e){return e.props.image},button:"p-image-preview-indicator",icon:"p-image-preview-icon",mask:"p-image-mask p-component-overlay p-component-overlay-enter",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomOutDisabled}]},zoomInButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomInDisabled}]},closeButton:"p-image-action p-link",preview:"p-image-preview"},loadStyle:P.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["show","hide","error"],mask:null,data:function(){return{maskVisible:!1,previewVisible:!1,rotate:0,scale:1}},beforeUnmount:function(){this.mask&&s.ZIndexUtils.clear(this.container)},methods:{maskRef:function(e){this.mask=e},toolbarRef:function(e){this.toolbarRef=e},onImageClick:function(){var e=this;this.preview&&(s.DomHandler.addClass(document.body,"p-overflow-hidden"),this.maskVisible=!0,setTimeout((function(){e.previewVisible=!0}),25))},onPreviewImageClick:function(){this.previewClick=!0},onMaskClick:function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||(this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1)},onMaskKeydown:function(e){var t=this;if("Escape"===e.code)this.hidePreview(),setTimeout((function(){s.DomHandler.focus(t.$refs.previewButton)}),200),e.preventDefault()},onError:function(){this.$emit("error")},rotateRight:function(){this.rotate+=90,this.previewClick=!0},rotateLeft:function(){this.rotate-=90,this.previewClick=!0},zoomIn:function(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut:function(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter:function(){s.ZIndexUtils.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter:function(){this.focus(),this.$emit("show")},onBeforeLeave:function(){!this.isUnstyled&&s.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(e){s.ZIndexUtils.clear(e),this.maskVisible=!1},focus:function(){var e=this.mask.querySelector("[autofocus]");e&&e.focus()},hidePreview:function(){this.previewVisible=!1,this.rotate=0,this.scale=1,s.DomHandler.removeClass(document.body,"p-overflow-hidden")}},computed:{containerClass:function(){return[this.cx("root"),this.class]},rotateClass:function(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle:function(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},isZoomInDisabled:function(){return this.zoomInDisabled||this.scale>=1.5},isZoomOutDisabled:function(){return this.zoomOutDisabled||this.scale<=.5},rightAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:w.default,EyeIcon:d.default,RefreshIcon:v.default,UndoIcon:y.default,SearchMinusIcon:g.default,SearchPlusIcon:b.default,TimesIcon:h.default},directives:{focustrap:f.default}};function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function B(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function z(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?B(Object(o),!0).forEach((function(t){O(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):B(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function O(e,t,o){return(t=E(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function E(e){var t=S(e,"string");return"symbol"===I(t)?t:String(t)}function S(e,t){if("object"!==I(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!==I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=["aria-modal"],V=["aria-label"],x=["aria-label"],$=["disabled","aria-label"],D=["disabled","aria-label"],N=["aria-label"],R=["src"];C.render=function(e,t,o,n,i,r){var a=p.resolveComponent("RefreshIcon"),l=p.resolveComponent("UndoIcon"),s=p.resolveComponent("SearchMinusIcon"),c=p.resolveComponent("SearchPlusIcon"),u=p.resolveComponent("TimesIcon"),m=p.resolveComponent("Portal"),f=p.resolveDirective("focustrap");return p.openBlock(),p.createElementBlock("span",p.mergeProps({class:r.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"image"}),[p.renderSlot(e.$slots,"image",{onError:r.onError},(function(){return[p.createElementVNode("img",p.mergeProps({style:e.imageStyle,class:[e.cx("image"),e.imageClass],onError:t[0]||(t[0]=function(){return r.onError&&r.onError.apply(r,arguments)})},z(z({},e.$attrs),e.ptm("image"))),null,16)]})),e.preview?(p.openBlock(),p.createElementBlock("button",p.mergeProps({key:0,ref:"previewButton",type:"button",class:e.cx("button"),onClick:t[1]||(t[1]=function(){return r.onImageClick&&r.onImageClick.apply(r,arguments)})},z(z({},e.previewButtonProps),e.ptm("button"))),[p.renderSlot(e.$slots,"indicatoricon",{},(function(){return[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(e.indicatorIcon?"i":"EyeIcon"),p.mergeProps({class:e.cx("icon")},e.ptm("icon")),null,16,["class"]))]}))],16)):p.createCommentVNode("",!0),p.createVNode(m,null,{default:p.withCtx((function(){return[i.maskVisible?p.withDirectives((p.openBlock(),p.createElementBlock("div",p.mergeProps({key:0,ref:r.maskRef,role:"dialog",class:e.cx("mask"),"aria-modal":i.maskVisible,onClick:t[8]||(t[8]=function(){return r.onMaskClick&&r.onMaskClick.apply(r,arguments)}),onKeydown:t[9]||(t[9]=function(){return r.onMaskKeydown&&r.onMaskKeydown.apply(r,arguments)})},e.ptm("mask")),[p.createElementVNode("div",p.mergeProps({class:"p-image-toolbar"},e.ptm("toolbar")),[p.createElementVNode("button",p.mergeProps({class:e.cx("rotateRightButton"),onClick:t[2]||(t[2]=function(){return r.rotateRight&&r.rotateRight.apply(r,arguments)}),type:"button","aria-label":r.rightAriaLabel},e.ptm("rotateRightButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"refresh",{},(function(){return[p.createVNode(a,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateRightIcon"))),null,16)]}))],16,V),p.createElementVNode("button",p.mergeProps({class:e.cx("rotateLeftButton"),onClick:t[3]||(t[3]=function(){return r.rotateLeft&&r.rotateLeft.apply(r,arguments)}),type:"button","aria-label":r.leftAriaLabel},e.ptm("rotateLeftButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"undo",{},(function(){return[p.createVNode(l,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateLeftIcon"))),null,16)]}))],16,x),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomOutButton"),onClick:t[4]||(t[4]=function(){return r.zoomOut&&r.zoomOut.apply(r,arguments)}),type:"button",disabled:r.isZoomOutDisabled,"aria-label":r.zoomOutAriaLabel},e.ptm("zoomOutButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"zoomout",{},(function(){return[p.createVNode(s,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomOutIcon"))),null,16)]}))],16,$),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomInButton"),onClick:t[5]||(t[5]=function(){return r.zoomIn&&r.zoomIn.apply(r,arguments)}),type:"button",disabled:r.isZoomInDisabled,"aria-label":r.zoomInAriaLabel},e.ptm("zoomInButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"zoomin",{},(function(){return[p.createVNode(c,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomInIcon"))),null,16)]}))],16,D),p.createElementVNode("button",p.mergeProps({class:e.cx("closeButton"),type:"button",onClick:t[6]||(t[6]=function(){return r.hidePreview&&r.hidePreview.apply(r,arguments)}),"aria-label":r.closeAriaLabel,autofocus:""},e.ptm("closeButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"close",{},(function(){return[p.createVNode(u,p.normalizeProps(p.guardReactiveProps(e.ptm("closeIcon"))),null,16)]}))],16,N)],16),p.createVNode(p.Transition,p.mergeProps({name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:p.withCtx((function(){return[i.previewVisible?(p.openBlock(),p.createElementBlock("div",p.normalizeProps(p.mergeProps({key:0},e.ptm("previewContainer"))),[p.renderSlot(e.$slots,"preview",{class:p.normalizeClass(e.cx("preview")),style:p.normalizeStyle(r.imagePreviewStyle),onClick:r.onPreviewImageClick},(function(){return[p.createElementVNode("img",p.mergeProps({src:e.$attrs.src,class:e.cx("preview"),style:r.imagePreviewStyle,onClick:t[7]||(t[7]=function(){return r.onPreviewImageClick&&r.onPreviewImageClick.apply(r,arguments)})},e.ptm("preview")),null,16,R)]}))],16)):p.createCommentVNode("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],16,L)),[[f]]):p.createCommentVNode("",!0)]})),_:3})],16)},module.exports=C;
|
package/image/image.esm.js
CHANGED
|
@@ -9,7 +9,7 @@ import Portal from 'primevue/portal';
|
|
|
9
9
|
import { ZIndexUtils, DomHandler } from 'primevue/utils';
|
|
10
10
|
import BaseComponent from 'primevue/basecomponent';
|
|
11
11
|
import { useStyle } from 'primevue/usestyle';
|
|
12
|
-
import { resolveComponent, resolveDirective, openBlock, createElementBlock, mergeProps, renderSlot, createElementVNode, createBlock, resolveDynamicComponent, createCommentVNode, createVNode, withCtx, withDirectives, normalizeProps, guardReactiveProps, Transition, normalizeStyle } from 'vue';
|
|
12
|
+
import { resolveComponent, resolveDirective, openBlock, createElementBlock, mergeProps, renderSlot, createElementVNode, createBlock, resolveDynamicComponent, createCommentVNode, createVNode, withCtx, withDirectives, normalizeProps, guardReactiveProps, Transition, normalizeClass, normalizeStyle } from 'vue';
|
|
13
13
|
|
|
14
14
|
var styles = "\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n\n.p-image-preview-container > img {\n cursor: pointer;\n}\n\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n";
|
|
15
15
|
var classes = {
|
|
@@ -129,6 +129,7 @@ var script = {
|
|
|
129
129
|
onImageClick: function onImageClick() {
|
|
130
130
|
var _this = this;
|
|
131
131
|
if (this.preview) {
|
|
132
|
+
DomHandler.addClass(document.body, 'p-overflow-hidden');
|
|
132
133
|
this.maskVisible = true;
|
|
133
134
|
setTimeout(function () {
|
|
134
135
|
_this.previewVisible = true;
|
|
@@ -208,6 +209,7 @@ var script = {
|
|
|
208
209
|
this.previewVisible = false;
|
|
209
210
|
this.rotate = 0;
|
|
210
211
|
this.scale = 1;
|
|
212
|
+
DomHandler.removeClass(document.body, 'p-overflow-hidden');
|
|
211
213
|
}
|
|
212
214
|
},
|
|
213
215
|
computed: {
|
|
@@ -329,7 +331,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
329
331
|
}),
|
|
330
332
|
type: "button",
|
|
331
333
|
"aria-label": $options.rightAriaLabel
|
|
332
|
-
}, _ctx.ptm('rotateRightButton')
|
|
334
|
+
}, _ctx.ptm('rotateRightButton'), {
|
|
335
|
+
"data-pc-group-section": "action"
|
|
336
|
+
}), [renderSlot(_ctx.$slots, "refresh", {}, function () {
|
|
333
337
|
return [createVNode(_component_RefreshIcon, normalizeProps(guardReactiveProps(_ctx.ptm('rotateRightIcon'))), null, 16)];
|
|
334
338
|
})], 16, _hoisted_2), createElementVNode("button", mergeProps({
|
|
335
339
|
"class": _ctx.cx('rotateLeftButton'),
|
|
@@ -338,7 +342,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
338
342
|
}),
|
|
339
343
|
type: "button",
|
|
340
344
|
"aria-label": $options.leftAriaLabel
|
|
341
|
-
}, _ctx.ptm('rotateLeftButton')
|
|
345
|
+
}, _ctx.ptm('rotateLeftButton'), {
|
|
346
|
+
"data-pc-group-section": "action"
|
|
347
|
+
}), [renderSlot(_ctx.$slots, "undo", {}, function () {
|
|
342
348
|
return [createVNode(_component_UndoIcon, normalizeProps(guardReactiveProps(_ctx.ptm('rotateLeftIcon'))), null, 16)];
|
|
343
349
|
})], 16, _hoisted_3), createElementVNode("button", mergeProps({
|
|
344
350
|
"class": _ctx.cx('zoomOutButton'),
|
|
@@ -348,7 +354,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
348
354
|
type: "button",
|
|
349
355
|
disabled: $options.isZoomOutDisabled,
|
|
350
356
|
"aria-label": $options.zoomOutAriaLabel
|
|
351
|
-
}, _ctx.ptm('zoomOutButton')
|
|
357
|
+
}, _ctx.ptm('zoomOutButton'), {
|
|
358
|
+
"data-pc-group-section": "action"
|
|
359
|
+
}), [renderSlot(_ctx.$slots, "zoomout", {}, function () {
|
|
352
360
|
return [createVNode(_component_SearchMinusIcon, normalizeProps(guardReactiveProps(_ctx.ptm('zoomOutIcon'))), null, 16)];
|
|
353
361
|
})], 16, _hoisted_4), createElementVNode("button", mergeProps({
|
|
354
362
|
"class": _ctx.cx('zoomInButton'),
|
|
@@ -358,7 +366,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
358
366
|
type: "button",
|
|
359
367
|
disabled: $options.isZoomInDisabled,
|
|
360
368
|
"aria-label": $options.zoomInAriaLabel
|
|
361
|
-
}, _ctx.ptm('zoomInButton')
|
|
369
|
+
}, _ctx.ptm('zoomInButton'), {
|
|
370
|
+
"data-pc-group-section": "action"
|
|
371
|
+
}), [renderSlot(_ctx.$slots, "zoomin", {}, function () {
|
|
362
372
|
return [createVNode(_component_SearchPlusIcon, normalizeProps(guardReactiveProps(_ctx.ptm('zoomInIcon'))), null, 16)];
|
|
363
373
|
})], 16, _hoisted_5), createElementVNode("button", mergeProps({
|
|
364
374
|
"class": _ctx.cx('closeButton'),
|
|
@@ -368,7 +378,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
368
378
|
}),
|
|
369
379
|
"aria-label": $options.closeAriaLabel,
|
|
370
380
|
autofocus: ""
|
|
371
|
-
}, _ctx.ptm('closeButton')
|
|
381
|
+
}, _ctx.ptm('closeButton'), {
|
|
382
|
+
"data-pc-group-section": "action"
|
|
383
|
+
}), [renderSlot(_ctx.$slots, "close", {}, function () {
|
|
372
384
|
return [createVNode(_component_TimesIcon, normalizeProps(guardReactiveProps(_ctx.ptm('closeIcon'))), null, 16)];
|
|
373
385
|
})], 16, _hoisted_6)], 16), createVNode(Transition, mergeProps({
|
|
374
386
|
name: "p-image-preview",
|
|
@@ -382,6 +394,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
382
394
|
return [$data.previewVisible ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({
|
|
383
395
|
key: 0
|
|
384
396
|
}, _ctx.ptm('previewContainer'))), [renderSlot(_ctx.$slots, "preview", {
|
|
397
|
+
"class": normalizeClass(_ctx.cx('preview')),
|
|
385
398
|
style: normalizeStyle($options.imagePreviewStyle),
|
|
386
399
|
onClick: $options.onPreviewImageClick
|
|
387
400
|
}, function () {
|
package/image/image.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/focustrap";import t from"primevue/icons/eye";import n from"primevue/icons/refresh";import i from"primevue/icons/searchminus";import o from"primevue/icons/searchplus";import r from"primevue/icons/times";import a from"primevue/icons/undo";import s from"primevue/portal";import{ZIndexUtils as l,DomHandler as c}from"primevue/utils";import u from"primevue/basecomponent";import{useStyle as p}from"primevue/usestyle";import{resolveComponent as m,resolveDirective as f,openBlock as v,createElementBlock as b,mergeProps as h,renderSlot as g,createElementVNode as d,createBlock as y,resolveDynamicComponent as w,createCommentVNode as k,createVNode as I,withCtx as C,withDirectives as O,normalizeProps as B,guardReactiveProps as L,Transition as z,normalizeStyle as P}from"vue";var $=p("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n\n.p-image-preview-container > img {\n cursor: pointer;\n}\n\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n",{name:"image",manual:!0}),S={name:"Image",extends:{name:"BaseImage",extends:u,props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null},indicatorIcon:{type:String,default:void 0},zoomInDisabled:{type:Boolean,default:!1},zoomOutDisabled:{type:Boolean,default:!1}},css:{classes:{root:function(e){return["p-image p-component",{"p-image-preview-container":e.props.preview}]},image:function(e){return e.props.image},button:"p-image-preview-indicator",icon:"p-image-preview-icon",mask:"p-image-mask p-component-overlay p-component-overlay-enter",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomOutDisabled}]},zoomInButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomInDisabled}]},closeButton:"p-image-action p-link",preview:"p-image-preview"},loadStyle:$.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["show","hide","error"],mask:null,data:function(){return{maskVisible:!1,previewVisible:!1,rotate:0,scale:1}},beforeUnmount:function(){this.mask&&l.clear(this.container)},methods:{maskRef:function(e){this.mask=e},toolbarRef:function(e){this.toolbarRef=e},onImageClick:function(){var e=this;this.preview&&(this.maskVisible=!0,setTimeout((function(){e.previewVisible=!0}),25))},onPreviewImageClick:function(){this.previewClick=!0},onMaskClick:function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||(this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1)},onMaskKeydown:function(e){var t=this;if("Escape"===e.code)this.hidePreview(),setTimeout((function(){c.focus(t.$refs.previewButton)}),200),e.preventDefault()},onError:function(){this.$emit("error")},rotateRight:function(){this.rotate+=90,this.previewClick=!0},rotateLeft:function(){this.rotate-=90,this.previewClick=!0},zoomIn:function(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut:function(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter:function(){l.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter:function(){this.focus(),this.$emit("show")},onBeforeLeave:function(){!this.isUnstyled&&c.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(e){l.clear(e),this.maskVisible=!1},focus:function(){var e=this.mask.querySelector("[autofocus]");e&&e.focus()},hidePreview:function(){this.previewVisible=!1,this.rotate=0,this.scale=1}},computed:{containerClass:function(){return[this.cx("root"),this.class]},rotateClass:function(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle:function(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},isZoomInDisabled:function(){return this.zoomInDisabled||this.scale>=1.5},isZoomOutDisabled:function(){return this.zoomOutDisabled||this.scale<=.5},rightAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:s,EyeIcon:t,RefreshIcon:n,UndoIcon:a,SearchMinusIcon:i,SearchPlusIcon:o,TimesIcon:r},directives:{focustrap:e}};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){A(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(e,t,n){return(t=D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){var t=R(e,"string");return"symbol"===x(t)?t:String(t)}function R(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==x(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var V=["aria-modal"],M=["aria-label"],Z=["aria-label"],T=["disabled","aria-label"],K=["disabled","aria-label"],U=["aria-label"],_=["src"];S.render=function(e,t,n,i,o,r){var a=m("RefreshIcon"),s=m("UndoIcon"),l=m("SearchMinusIcon"),c=m("SearchPlusIcon"),u=m("TimesIcon"),p=m("Portal"),$=f("focustrap");return v(),b("span",h({class:r.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"image"}),[g(e.$slots,"image",{onError:r.onError},(function(){return[d("img",h({style:e.imageStyle,class:[e.cx("image"),e.imageClass],onError:t[0]||(t[0]=function(){return r.onError&&r.onError.apply(r,arguments)})},j(j({},e.$attrs),e.ptm("image"))),null,16)]})),e.preview?(v(),b("button",h({key:0,ref:"previewButton",type:"button",class:e.cx("button"),onClick:t[1]||(t[1]=function(){return r.onImageClick&&r.onImageClick.apply(r,arguments)})},j(j({},e.previewButtonProps),e.ptm("button"))),[g(e.$slots,"indicatoricon",{},(function(){return[(v(),y(w(e.indicatorIcon?"i":"EyeIcon"),h({class:e.cx("icon")},e.ptm("icon")),null,16,["class"]))]}))],16)):k("",!0),I(p,null,{default:C((function(){return[o.maskVisible?O((v(),b("div",h({key:0,ref:r.maskRef,role:"dialog",class:e.cx("mask"),"aria-modal":o.maskVisible,onClick:t[8]||(t[8]=function(){return r.onMaskClick&&r.onMaskClick.apply(r,arguments)}),onKeydown:t[9]||(t[9]=function(){return r.onMaskKeydown&&r.onMaskKeydown.apply(r,arguments)})},e.ptm("mask")),[d("div",h({class:"p-image-toolbar"},e.ptm("toolbar")),[d("button",h({class:e.cx("rotateRightButton"),onClick:t[2]||(t[2]=function(){return r.rotateRight&&r.rotateRight.apply(r,arguments)}),type:"button","aria-label":r.rightAriaLabel},e.ptm("rotateRightButton")),[g(e.$slots,"refresh",{},(function(){return[I(a,B(L(e.ptm("rotateRightIcon"))),null,16)]}))],16,M),d("button",h({class:e.cx("rotateLeftButton"),onClick:t[3]||(t[3]=function(){return r.rotateLeft&&r.rotateLeft.apply(r,arguments)}),type:"button","aria-label":r.leftAriaLabel},e.ptm("rotateLeftButton")),[g(e.$slots,"undo",{},(function(){return[I(s,B(L(e.ptm("rotateLeftIcon"))),null,16)]}))],16,Z),d("button",h({class:e.cx("zoomOutButton"),onClick:t[4]||(t[4]=function(){return r.zoomOut&&r.zoomOut.apply(r,arguments)}),type:"button",disabled:r.isZoomOutDisabled,"aria-label":r.zoomOutAriaLabel},e.ptm("zoomOutButton")),[g(e.$slots,"zoomout",{},(function(){return[I(l,B(L(e.ptm("zoomOutIcon"))),null,16)]}))],16,T),d("button",h({class:e.cx("zoomInButton"),onClick:t[5]||(t[5]=function(){return r.zoomIn&&r.zoomIn.apply(r,arguments)}),type:"button",disabled:r.isZoomInDisabled,"aria-label":r.zoomInAriaLabel},e.ptm("zoomInButton")),[g(e.$slots,"zoomin",{},(function(){return[I(c,B(L(e.ptm("zoomInIcon"))),null,16)]}))],16,K),d("button",h({class:e.cx("closeButton"),type:"button",onClick:t[6]||(t[6]=function(){return r.hidePreview&&r.hidePreview.apply(r,arguments)}),"aria-label":r.closeAriaLabel,autofocus:""},e.ptm("closeButton")),[g(e.$slots,"close",{},(function(){return[I(u,B(L(e.ptm("closeIcon"))),null,16)]}))],16,U)],16),I(z,h({name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:C((function(){return[o.previewVisible?(v(),b("div",B(h({key:0},e.ptm("previewContainer"))),[g(e.$slots,"preview",{style:P(r.imagePreviewStyle),onClick:r.onPreviewImageClick},(function(){return[d("img",h({src:e.$attrs.src,class:e.cx("preview"),style:r.imagePreviewStyle,onClick:t[7]||(t[7]=function(){return r.onPreviewImageClick&&r.onPreviewImageClick.apply(r,arguments)})},e.ptm("preview")),null,16,_)]}))],16)):k("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],16,V)),[[$]]):k("",!0)]})),_:3})],16)};export{S as default};
|
|
1
|
+
import e from"primevue/focustrap";import t from"primevue/icons/eye";import n from"primevue/icons/refresh";import o from"primevue/icons/searchminus";import i from"primevue/icons/searchplus";import r from"primevue/icons/times";import a from"primevue/icons/undo";import s from"primevue/portal";import{ZIndexUtils as l,DomHandler as c}from"primevue/utils";import u from"primevue/basecomponent";import{useStyle as p}from"primevue/usestyle";import{resolveComponent as m,resolveDirective as f,openBlock as v,createElementBlock as d,mergeProps as b,renderSlot as g,createElementVNode as h,createBlock as y,resolveDynamicComponent as w,createCommentVNode as k,createVNode as I,withCtx as C,withDirectives as O,normalizeProps as B,guardReactiveProps as L,Transition as z,normalizeClass as P,normalizeStyle as $}from"vue";var x=p("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n\n.p-image-preview-container > img {\n cursor: pointer;\n}\n\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n",{name:"image",manual:!0}),S={name:"Image",extends:{name:"BaseImage",extends:u,props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null},indicatorIcon:{type:String,default:void 0},zoomInDisabled:{type:Boolean,default:!1},zoomOutDisabled:{type:Boolean,default:!1}},css:{classes:{root:function(e){return["p-image p-component",{"p-image-preview-container":e.props.preview}]},image:function(e){return e.props.image},button:"p-image-preview-indicator",icon:"p-image-preview-icon",mask:"p-image-mask p-component-overlay p-component-overlay-enter",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomOutDisabled}]},zoomInButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomInDisabled}]},closeButton:"p-image-action p-link",preview:"p-image-preview"},loadStyle:x.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["show","hide","error"],mask:null,data:function(){return{maskVisible:!1,previewVisible:!1,rotate:0,scale:1}},beforeUnmount:function(){this.mask&&l.clear(this.container)},methods:{maskRef:function(e){this.mask=e},toolbarRef:function(e){this.toolbarRef=e},onImageClick:function(){var e=this;this.preview&&(c.addClass(document.body,"p-overflow-hidden"),this.maskVisible=!0,setTimeout((function(){e.previewVisible=!0}),25))},onPreviewImageClick:function(){this.previewClick=!0},onMaskClick:function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||(this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1)},onMaskKeydown:function(e){var t=this;if("Escape"===e.code)this.hidePreview(),setTimeout((function(){c.focus(t.$refs.previewButton)}),200),e.preventDefault()},onError:function(){this.$emit("error")},rotateRight:function(){this.rotate+=90,this.previewClick=!0},rotateLeft:function(){this.rotate-=90,this.previewClick=!0},zoomIn:function(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut:function(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter:function(){l.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter:function(){this.focus(),this.$emit("show")},onBeforeLeave:function(){!this.isUnstyled&&c.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(e){l.clear(e),this.maskVisible=!1},focus:function(){var e=this.mask.querySelector("[autofocus]");e&&e.focus()},hidePreview:function(){this.previewVisible=!1,this.rotate=0,this.scale=1,c.removeClass(document.body,"p-overflow-hidden")}},computed:{containerClass:function(){return[this.cx("root"),this.class]},rotateClass:function(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle:function(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},isZoomInDisabled:function(){return this.zoomInDisabled||this.scale>=1.5},isZoomOutDisabled:function(){return this.zoomOutDisabled||this.scale<=.5},rightAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:s,EyeIcon:t,RefreshIcon:n,UndoIcon:a,SearchMinusIcon:o,SearchPlusIcon:i,TimesIcon:r},directives:{focustrap:e}};function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e){var t=V(e,"string");return"symbol"===E(t)?t:String(t)}function V(e,t){if("object"!==E(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==E(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var M=["aria-modal"],Z=["aria-label"],T=["aria-label"],K=["disabled","aria-label"],U=["disabled","aria-label"],_=["aria-label"],q=["src"];S.render=function(e,t,n,o,i,r){var a=m("RefreshIcon"),s=m("UndoIcon"),l=m("SearchMinusIcon"),c=m("SearchPlusIcon"),u=m("TimesIcon"),p=m("Portal"),x=f("focustrap");return v(),d("span",b({class:r.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"image"}),[g(e.$slots,"image",{onError:r.onError},(function(){return[h("img",b({style:e.imageStyle,class:[e.cx("image"),e.imageClass],onError:t[0]||(t[0]=function(){return r.onError&&r.onError.apply(r,arguments)})},A(A({},e.$attrs),e.ptm("image"))),null,16)]})),e.preview?(v(),d("button",b({key:0,ref:"previewButton",type:"button",class:e.cx("button"),onClick:t[1]||(t[1]=function(){return r.onImageClick&&r.onImageClick.apply(r,arguments)})},A(A({},e.previewButtonProps),e.ptm("button"))),[g(e.$slots,"indicatoricon",{},(function(){return[(v(),y(w(e.indicatorIcon?"i":"EyeIcon"),b({class:e.cx("icon")},e.ptm("icon")),null,16,["class"]))]}))],16)):k("",!0),I(p,null,{default:C((function(){return[i.maskVisible?O((v(),d("div",b({key:0,ref:r.maskRef,role:"dialog",class:e.cx("mask"),"aria-modal":i.maskVisible,onClick:t[8]||(t[8]=function(){return r.onMaskClick&&r.onMaskClick.apply(r,arguments)}),onKeydown:t[9]||(t[9]=function(){return r.onMaskKeydown&&r.onMaskKeydown.apply(r,arguments)})},e.ptm("mask")),[h("div",b({class:"p-image-toolbar"},e.ptm("toolbar")),[h("button",b({class:e.cx("rotateRightButton"),onClick:t[2]||(t[2]=function(){return r.rotateRight&&r.rotateRight.apply(r,arguments)}),type:"button","aria-label":r.rightAriaLabel},e.ptm("rotateRightButton"),{"data-pc-group-section":"action"}),[g(e.$slots,"refresh",{},(function(){return[I(a,B(L(e.ptm("rotateRightIcon"))),null,16)]}))],16,Z),h("button",b({class:e.cx("rotateLeftButton"),onClick:t[3]||(t[3]=function(){return r.rotateLeft&&r.rotateLeft.apply(r,arguments)}),type:"button","aria-label":r.leftAriaLabel},e.ptm("rotateLeftButton"),{"data-pc-group-section":"action"}),[g(e.$slots,"undo",{},(function(){return[I(s,B(L(e.ptm("rotateLeftIcon"))),null,16)]}))],16,T),h("button",b({class:e.cx("zoomOutButton"),onClick:t[4]||(t[4]=function(){return r.zoomOut&&r.zoomOut.apply(r,arguments)}),type:"button",disabled:r.isZoomOutDisabled,"aria-label":r.zoomOutAriaLabel},e.ptm("zoomOutButton"),{"data-pc-group-section":"action"}),[g(e.$slots,"zoomout",{},(function(){return[I(l,B(L(e.ptm("zoomOutIcon"))),null,16)]}))],16,K),h("button",b({class:e.cx("zoomInButton"),onClick:t[5]||(t[5]=function(){return r.zoomIn&&r.zoomIn.apply(r,arguments)}),type:"button",disabled:r.isZoomInDisabled,"aria-label":r.zoomInAriaLabel},e.ptm("zoomInButton"),{"data-pc-group-section":"action"}),[g(e.$slots,"zoomin",{},(function(){return[I(c,B(L(e.ptm("zoomInIcon"))),null,16)]}))],16,U),h("button",b({class:e.cx("closeButton"),type:"button",onClick:t[6]||(t[6]=function(){return r.hidePreview&&r.hidePreview.apply(r,arguments)}),"aria-label":r.closeAriaLabel,autofocus:""},e.ptm("closeButton"),{"data-pc-group-section":"action"}),[g(e.$slots,"close",{},(function(){return[I(u,B(L(e.ptm("closeIcon"))),null,16)]}))],16,_)],16),I(z,b({name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:C((function(){return[i.previewVisible?(v(),d("div",B(b({key:0},e.ptm("previewContainer"))),[g(e.$slots,"preview",{class:P(e.cx("preview")),style:$(r.imagePreviewStyle),onClick:r.onPreviewImageClick},(function(){return[h("img",b({src:e.$attrs.src,class:e.cx("preview"),style:r.imagePreviewStyle,onClick:t[7]||(t[7]=function(){return r.onPreviewImageClick&&r.onPreviewImageClick.apply(r,arguments)})},e.ptm("preview")),null,16,q)]}))],16)):k("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],16,M)),[[x]]):k("",!0)]})),_:3})],16)};export{S as default};
|
package/image/image.js
CHANGED
|
@@ -132,6 +132,7 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
132
132
|
onImageClick: function onImageClick() {
|
|
133
133
|
var _this = this;
|
|
134
134
|
if (this.preview) {
|
|
135
|
+
utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
|
|
135
136
|
this.maskVisible = true;
|
|
136
137
|
setTimeout(function () {
|
|
137
138
|
_this.previewVisible = true;
|
|
@@ -211,6 +212,7 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
211
212
|
this.previewVisible = false;
|
|
212
213
|
this.rotate = 0;
|
|
213
214
|
this.scale = 1;
|
|
215
|
+
utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
|
|
214
216
|
}
|
|
215
217
|
},
|
|
216
218
|
computed: {
|
|
@@ -332,7 +334,9 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
332
334
|
}),
|
|
333
335
|
type: "button",
|
|
334
336
|
"aria-label": $options.rightAriaLabel
|
|
335
|
-
}, _ctx.ptm('rotateRightButton')
|
|
337
|
+
}, _ctx.ptm('rotateRightButton'), {
|
|
338
|
+
"data-pc-group-section": "action"
|
|
339
|
+
}), [vue.renderSlot(_ctx.$slots, "refresh", {}, function () {
|
|
336
340
|
return [vue.createVNode(_component_RefreshIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('rotateRightIcon'))), null, 16)];
|
|
337
341
|
})], 16, _hoisted_2), vue.createElementVNode("button", vue.mergeProps({
|
|
338
342
|
"class": _ctx.cx('rotateLeftButton'),
|
|
@@ -341,7 +345,9 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
341
345
|
}),
|
|
342
346
|
type: "button",
|
|
343
347
|
"aria-label": $options.leftAriaLabel
|
|
344
|
-
}, _ctx.ptm('rotateLeftButton')
|
|
348
|
+
}, _ctx.ptm('rotateLeftButton'), {
|
|
349
|
+
"data-pc-group-section": "action"
|
|
350
|
+
}), [vue.renderSlot(_ctx.$slots, "undo", {}, function () {
|
|
345
351
|
return [vue.createVNode(_component_UndoIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('rotateLeftIcon'))), null, 16)];
|
|
346
352
|
})], 16, _hoisted_3), vue.createElementVNode("button", vue.mergeProps({
|
|
347
353
|
"class": _ctx.cx('zoomOutButton'),
|
|
@@ -351,7 +357,9 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
351
357
|
type: "button",
|
|
352
358
|
disabled: $options.isZoomOutDisabled,
|
|
353
359
|
"aria-label": $options.zoomOutAriaLabel
|
|
354
|
-
}, _ctx.ptm('zoomOutButton')
|
|
360
|
+
}, _ctx.ptm('zoomOutButton'), {
|
|
361
|
+
"data-pc-group-section": "action"
|
|
362
|
+
}), [vue.renderSlot(_ctx.$slots, "zoomout", {}, function () {
|
|
355
363
|
return [vue.createVNode(_component_SearchMinusIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('zoomOutIcon'))), null, 16)];
|
|
356
364
|
})], 16, _hoisted_4), vue.createElementVNode("button", vue.mergeProps({
|
|
357
365
|
"class": _ctx.cx('zoomInButton'),
|
|
@@ -361,7 +369,9 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
361
369
|
type: "button",
|
|
362
370
|
disabled: $options.isZoomInDisabled,
|
|
363
371
|
"aria-label": $options.zoomInAriaLabel
|
|
364
|
-
}, _ctx.ptm('zoomInButton')
|
|
372
|
+
}, _ctx.ptm('zoomInButton'), {
|
|
373
|
+
"data-pc-group-section": "action"
|
|
374
|
+
}), [vue.renderSlot(_ctx.$slots, "zoomin", {}, function () {
|
|
365
375
|
return [vue.createVNode(_component_SearchPlusIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('zoomInIcon'))), null, 16)];
|
|
366
376
|
})], 16, _hoisted_5), vue.createElementVNode("button", vue.mergeProps({
|
|
367
377
|
"class": _ctx.cx('closeButton'),
|
|
@@ -371,7 +381,9 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
371
381
|
}),
|
|
372
382
|
"aria-label": $options.closeAriaLabel,
|
|
373
383
|
autofocus: ""
|
|
374
|
-
}, _ctx.ptm('closeButton')
|
|
384
|
+
}, _ctx.ptm('closeButton'), {
|
|
385
|
+
"data-pc-group-section": "action"
|
|
386
|
+
}), [vue.renderSlot(_ctx.$slots, "close", {}, function () {
|
|
375
387
|
return [vue.createVNode(_component_TimesIcon, vue.normalizeProps(vue.guardReactiveProps(_ctx.ptm('closeIcon'))), null, 16)];
|
|
376
388
|
})], 16, _hoisted_6)], 16), vue.createVNode(vue.Transition, vue.mergeProps({
|
|
377
389
|
name: "p-image-preview",
|
|
@@ -385,6 +397,7 @@ this.primevue.image = (function (FocusTrap, EyeIcon, RefreshIcon, SearchMinusIco
|
|
|
385
397
|
return [$data.previewVisible ? (vue.openBlock(), vue.createElementBlock("div", vue.normalizeProps(vue.mergeProps({
|
|
386
398
|
key: 0
|
|
387
399
|
}, _ctx.ptm('previewContainer'))), [vue.renderSlot(_ctx.$slots, "preview", {
|
|
400
|
+
"class": vue.normalizeClass(_ctx.cx('preview')),
|
|
388
401
|
style: vue.normalizeStyle($options.imagePreviewStyle),
|
|
389
402
|
onClick: $options.onPreviewImageClick
|
|
390
403
|
}, function () {
|
package/image/image.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.image=function(e,t,n,o,i,r,a,l,s,c,u,p){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(e),v=m(t),d=m(n),g=m(o),h=m(i),b=m(r),y=m(a),w=m(l),k=m(c),P=u.useStyle("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n\n.p-image-preview-container > img {\n cursor: pointer;\n}\n\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n",{name:"image",manual:!0}),I={name:"Image",extends:{name:"BaseImage",extends:k.default,props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null},indicatorIcon:{type:String,default:void 0},zoomInDisabled:{type:Boolean,default:!1},zoomOutDisabled:{type:Boolean,default:!1}},css:{classes:{root:function(e){return["p-image p-component",{"p-image-preview-container":e.props.preview}]},image:function(e){return e.props.image},button:"p-image-preview-indicator",icon:"p-image-preview-icon",mask:"p-image-mask p-component-overlay p-component-overlay-enter",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomOutDisabled}]},zoomInButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomInDisabled}]},closeButton:"p-image-action p-link",preview:"p-image-preview"},loadStyle:P.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["show","hide","error"],mask:null,data:function(){return{maskVisible:!1,previewVisible:!1,rotate:0,scale:1}},beforeUnmount:function(){this.mask&&s.ZIndexUtils.clear(this.container)},methods:{maskRef:function(e){this.mask=e},toolbarRef:function(e){this.toolbarRef=e},onImageClick:function(){var e=this;this.preview&&(this.maskVisible=!0,setTimeout((function(){e.previewVisible=!0}),25))},onPreviewImageClick:function(){this.previewClick=!0},onMaskClick:function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||(this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1)},onMaskKeydown:function(e){var t=this;if("Escape"===e.code)this.hidePreview(),setTimeout((function(){s.DomHandler.focus(t.$refs.previewButton)}),200),e.preventDefault()},onError:function(){this.$emit("error")},rotateRight:function(){this.rotate+=90,this.previewClick=!0},rotateLeft:function(){this.rotate-=90,this.previewClick=!0},zoomIn:function(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut:function(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter:function(){s.ZIndexUtils.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter:function(){this.focus(),this.$emit("show")},onBeforeLeave:function(){!this.isUnstyled&&s.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(e){s.ZIndexUtils.clear(e),this.maskVisible=!1},focus:function(){var e=this.mask.querySelector("[autofocus]");e&&e.focus()},hidePreview:function(){this.previewVisible=!1,this.rotate=0,this.scale=1}},computed:{containerClass:function(){return[this.cx("root"),this.class]},rotateClass:function(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle:function(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},isZoomInDisabled:function(){return this.zoomInDisabled||this.scale>=1.5},isZoomOutDisabled:function(){return this.zoomOutDisabled||this.scale<=.5},rightAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:w.default,EyeIcon:v.default,RefreshIcon:d.default,UndoIcon:y.default,SearchMinusIcon:g.default,SearchPlusIcon:h.default,TimesIcon:b.default},directives:{focustrap:f.default}};function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=S(e,"string");return"symbol"===C(t)?t:String(t)}function S(e,t){if("object"!==C(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==C(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=["aria-modal"],V=["aria-label"],$=["aria-label"],x=["disabled","aria-label"],D=["disabled","aria-label"],N=["aria-label"],R=["src"];return I.render=function(e,t,n,o,i,r){var a=p.resolveComponent("RefreshIcon"),l=p.resolveComponent("UndoIcon"),s=p.resolveComponent("SearchMinusIcon"),c=p.resolveComponent("SearchPlusIcon"),u=p.resolveComponent("TimesIcon"),m=p.resolveComponent("Portal"),f=p.resolveDirective("focustrap");return p.openBlock(),p.createElementBlock("span",p.mergeProps({class:r.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"image"}),[p.renderSlot(e.$slots,"image",{onError:r.onError},(function(){return[p.createElementVNode("img",p.mergeProps({style:e.imageStyle,class:[e.cx("image"),e.imageClass],onError:t[0]||(t[0]=function(){return r.onError&&r.onError.apply(r,arguments)})},z(z({},e.$attrs),e.ptm("image"))),null,16)]})),e.preview?(p.openBlock(),p.createElementBlock("button",p.mergeProps({key:0,ref:"previewButton",type:"button",class:e.cx("button"),onClick:t[1]||(t[1]=function(){return r.onImageClick&&r.onImageClick.apply(r,arguments)})},z(z({},e.previewButtonProps),e.ptm("button"))),[p.renderSlot(e.$slots,"indicatoricon",{},(function(){return[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(e.indicatorIcon?"i":"EyeIcon"),p.mergeProps({class:e.cx("icon")},e.ptm("icon")),null,16,["class"]))]}))],16)):p.createCommentVNode("",!0),p.createVNode(m,null,{default:p.withCtx((function(){return[i.maskVisible?p.withDirectives((p.openBlock(),p.createElementBlock("div",p.mergeProps({key:0,ref:r.maskRef,role:"dialog",class:e.cx("mask"),"aria-modal":i.maskVisible,onClick:t[8]||(t[8]=function(){return r.onMaskClick&&r.onMaskClick.apply(r,arguments)}),onKeydown:t[9]||(t[9]=function(){return r.onMaskKeydown&&r.onMaskKeydown.apply(r,arguments)})},e.ptm("mask")),[p.createElementVNode("div",p.mergeProps({class:"p-image-toolbar"},e.ptm("toolbar")),[p.createElementVNode("button",p.mergeProps({class:e.cx("rotateRightButton"),onClick:t[2]||(t[2]=function(){return r.rotateRight&&r.rotateRight.apply(r,arguments)}),type:"button","aria-label":r.rightAriaLabel},e.ptm("rotateRightButton")),[p.renderSlot(e.$slots,"refresh",{},(function(){return[p.createVNode(a,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateRightIcon"))),null,16)]}))],16,V),p.createElementVNode("button",p.mergeProps({class:e.cx("rotateLeftButton"),onClick:t[3]||(t[3]=function(){return r.rotateLeft&&r.rotateLeft.apply(r,arguments)}),type:"button","aria-label":r.leftAriaLabel},e.ptm("rotateLeftButton")),[p.renderSlot(e.$slots,"undo",{},(function(){return[p.createVNode(l,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateLeftIcon"))),null,16)]}))],16,$),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomOutButton"),onClick:t[4]||(t[4]=function(){return r.zoomOut&&r.zoomOut.apply(r,arguments)}),type:"button",disabled:r.isZoomOutDisabled,"aria-label":r.zoomOutAriaLabel},e.ptm("zoomOutButton")),[p.renderSlot(e.$slots,"zoomout",{},(function(){return[p.createVNode(s,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomOutIcon"))),null,16)]}))],16,x),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomInButton"),onClick:t[5]||(t[5]=function(){return r.zoomIn&&r.zoomIn.apply(r,arguments)}),type:"button",disabled:r.isZoomInDisabled,"aria-label":r.zoomInAriaLabel},e.ptm("zoomInButton")),[p.renderSlot(e.$slots,"zoomin",{},(function(){return[p.createVNode(c,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomInIcon"))),null,16)]}))],16,D),p.createElementVNode("button",p.mergeProps({class:e.cx("closeButton"),type:"button",onClick:t[6]||(t[6]=function(){return r.hidePreview&&r.hidePreview.apply(r,arguments)}),"aria-label":r.closeAriaLabel,autofocus:""},e.ptm("closeButton")),[p.renderSlot(e.$slots,"close",{},(function(){return[p.createVNode(u,p.normalizeProps(p.guardReactiveProps(e.ptm("closeIcon"))),null,16)]}))],16,N)],16),p.createVNode(p.Transition,p.mergeProps({name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:p.withCtx((function(){return[i.previewVisible?(p.openBlock(),p.createElementBlock("div",p.normalizeProps(p.mergeProps({key:0},e.ptm("previewContainer"))),[p.renderSlot(e.$slots,"preview",{style:p.normalizeStyle(r.imagePreviewStyle),onClick:r.onPreviewImageClick},(function(){return[p.createElementVNode("img",p.mergeProps({src:e.$attrs.src,class:e.cx("preview"),style:r.imagePreviewStyle,onClick:t[7]||(t[7]=function(){return r.onPreviewImageClick&&r.onPreviewImageClick.apply(r,arguments)})},e.ptm("preview")),null,16,R)]}))],16)):p.createCommentVNode("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],16,L)),[[f]]):p.createCommentVNode("",!0)]})),_:3})],16)},I}(primevue.focustrap,primevue.icons.eye,primevue.icons.refresh,primevue.icons.searchminus,primevue.icons.searchplus,primevue.icons.times,primevue.icons.undo,primevue.portal,primevue.utils,primevue.basecomponent,primevue.usestyle,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.image=function(e,t,n,o,i,r,a,l,s,c,u,p){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(e),d=m(t),v=m(n),g=m(o),h=m(i),b=m(r),y=m(a),w=m(l),k=m(c),P=u.useStyle("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n\n.p-image-preview-container > img {\n cursor: pointer;\n}\n\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n",{name:"image",manual:!0}),C={name:"Image",extends:{name:"BaseImage",extends:k.default,props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null},indicatorIcon:{type:String,default:void 0},zoomInDisabled:{type:Boolean,default:!1},zoomOutDisabled:{type:Boolean,default:!1}},css:{classes:{root:function(e){return["p-image p-component",{"p-image-preview-container":e.props.preview}]},image:function(e){return e.props.image},button:"p-image-preview-indicator",icon:"p-image-preview-icon",mask:"p-image-mask p-component-overlay p-component-overlay-enter",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomOutDisabled}]},zoomInButton:function(e){return["p-image-action p-link",{"p-disabled":e.instance.isZoomInDisabled}]},closeButton:"p-image-action p-link",preview:"p-image-preview"},loadStyle:P.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["show","hide","error"],mask:null,data:function(){return{maskVisible:!1,previewVisible:!1,rotate:0,scale:1}},beforeUnmount:function(){this.mask&&s.ZIndexUtils.clear(this.container)},methods:{maskRef:function(e){this.mask=e},toolbarRef:function(e){this.toolbarRef=e},onImageClick:function(){var e=this;this.preview&&(s.DomHandler.addClass(document.body,"p-overflow-hidden"),this.maskVisible=!0,setTimeout((function(){e.previewVisible=!0}),25))},onPreviewImageClick:function(){this.previewClick=!0},onMaskClick:function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||(this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1)},onMaskKeydown:function(e){var t=this;if("Escape"===e.code)this.hidePreview(),setTimeout((function(){s.DomHandler.focus(t.$refs.previewButton)}),200),e.preventDefault()},onError:function(){this.$emit("error")},rotateRight:function(){this.rotate+=90,this.previewClick=!0},rotateLeft:function(){this.rotate-=90,this.previewClick=!0},zoomIn:function(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut:function(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter:function(){s.ZIndexUtils.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter:function(){this.focus(),this.$emit("show")},onBeforeLeave:function(){!this.isUnstyled&&s.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(e){s.ZIndexUtils.clear(e),this.maskVisible=!1},focus:function(){var e=this.mask.querySelector("[autofocus]");e&&e.focus()},hidePreview:function(){this.previewVisible=!1,this.rotate=0,this.scale=1,s.DomHandler.removeClass(document.body,"p-overflow-hidden")}},computed:{containerClass:function(){return[this.cx("root"),this.class]},rotateClass:function(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle:function(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},isZoomInDisabled:function(){return this.zoomInDisabled||this.scale>=1.5},isZoomOutDisabled:function(){return this.zoomOutDisabled||this.scale<=.5},rightAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:w.default,EyeIcon:d.default,RefreshIcon:v.default,UndoIcon:y.default,SearchMinusIcon:g.default,SearchPlusIcon:h.default,TimesIcon:b.default},directives:{focustrap:f.default}};function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=S(e,"string");return"symbol"===I(t)?t:String(t)}function S(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==I(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=["aria-modal"],V=["aria-label"],x=["aria-label"],$=["disabled","aria-label"],D=["disabled","aria-label"],N=["aria-label"],R=["src"];return C.render=function(e,t,n,o,i,r){var a=p.resolveComponent("RefreshIcon"),l=p.resolveComponent("UndoIcon"),s=p.resolveComponent("SearchMinusIcon"),c=p.resolveComponent("SearchPlusIcon"),u=p.resolveComponent("TimesIcon"),m=p.resolveComponent("Portal"),f=p.resolveDirective("focustrap");return p.openBlock(),p.createElementBlock("span",p.mergeProps({class:r.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"image"}),[p.renderSlot(e.$slots,"image",{onError:r.onError},(function(){return[p.createElementVNode("img",p.mergeProps({style:e.imageStyle,class:[e.cx("image"),e.imageClass],onError:t[0]||(t[0]=function(){return r.onError&&r.onError.apply(r,arguments)})},z(z({},e.$attrs),e.ptm("image"))),null,16)]})),e.preview?(p.openBlock(),p.createElementBlock("button",p.mergeProps({key:0,ref:"previewButton",type:"button",class:e.cx("button"),onClick:t[1]||(t[1]=function(){return r.onImageClick&&r.onImageClick.apply(r,arguments)})},z(z({},e.previewButtonProps),e.ptm("button"))),[p.renderSlot(e.$slots,"indicatoricon",{},(function(){return[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(e.indicatorIcon?"i":"EyeIcon"),p.mergeProps({class:e.cx("icon")},e.ptm("icon")),null,16,["class"]))]}))],16)):p.createCommentVNode("",!0),p.createVNode(m,null,{default:p.withCtx((function(){return[i.maskVisible?p.withDirectives((p.openBlock(),p.createElementBlock("div",p.mergeProps({key:0,ref:r.maskRef,role:"dialog",class:e.cx("mask"),"aria-modal":i.maskVisible,onClick:t[8]||(t[8]=function(){return r.onMaskClick&&r.onMaskClick.apply(r,arguments)}),onKeydown:t[9]||(t[9]=function(){return r.onMaskKeydown&&r.onMaskKeydown.apply(r,arguments)})},e.ptm("mask")),[p.createElementVNode("div",p.mergeProps({class:"p-image-toolbar"},e.ptm("toolbar")),[p.createElementVNode("button",p.mergeProps({class:e.cx("rotateRightButton"),onClick:t[2]||(t[2]=function(){return r.rotateRight&&r.rotateRight.apply(r,arguments)}),type:"button","aria-label":r.rightAriaLabel},e.ptm("rotateRightButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"refresh",{},(function(){return[p.createVNode(a,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateRightIcon"))),null,16)]}))],16,V),p.createElementVNode("button",p.mergeProps({class:e.cx("rotateLeftButton"),onClick:t[3]||(t[3]=function(){return r.rotateLeft&&r.rotateLeft.apply(r,arguments)}),type:"button","aria-label":r.leftAriaLabel},e.ptm("rotateLeftButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"undo",{},(function(){return[p.createVNode(l,p.normalizeProps(p.guardReactiveProps(e.ptm("rotateLeftIcon"))),null,16)]}))],16,x),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomOutButton"),onClick:t[4]||(t[4]=function(){return r.zoomOut&&r.zoomOut.apply(r,arguments)}),type:"button",disabled:r.isZoomOutDisabled,"aria-label":r.zoomOutAriaLabel},e.ptm("zoomOutButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"zoomout",{},(function(){return[p.createVNode(s,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomOutIcon"))),null,16)]}))],16,$),p.createElementVNode("button",p.mergeProps({class:e.cx("zoomInButton"),onClick:t[5]||(t[5]=function(){return r.zoomIn&&r.zoomIn.apply(r,arguments)}),type:"button",disabled:r.isZoomInDisabled,"aria-label":r.zoomInAriaLabel},e.ptm("zoomInButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"zoomin",{},(function(){return[p.createVNode(c,p.normalizeProps(p.guardReactiveProps(e.ptm("zoomInIcon"))),null,16)]}))],16,D),p.createElementVNode("button",p.mergeProps({class:e.cx("closeButton"),type:"button",onClick:t[6]||(t[6]=function(){return r.hidePreview&&r.hidePreview.apply(r,arguments)}),"aria-label":r.closeAriaLabel,autofocus:""},e.ptm("closeButton"),{"data-pc-group-section":"action"}),[p.renderSlot(e.$slots,"close",{},(function(){return[p.createVNode(u,p.normalizeProps(p.guardReactiveProps(e.ptm("closeIcon"))),null,16)]}))],16,N)],16),p.createVNode(p.Transition,p.mergeProps({name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:p.withCtx((function(){return[i.previewVisible?(p.openBlock(),p.createElementBlock("div",p.normalizeProps(p.mergeProps({key:0},e.ptm("previewContainer"))),[p.renderSlot(e.$slots,"preview",{class:p.normalizeClass(e.cx("preview")),style:p.normalizeStyle(r.imagePreviewStyle),onClick:r.onPreviewImageClick},(function(){return[p.createElementVNode("img",p.mergeProps({src:e.$attrs.src,class:e.cx("preview"),style:r.imagePreviewStyle,onClick:t[7]||(t[7]=function(){return r.onPreviewImageClick&&r.onPreviewImageClick.apply(r,arguments)})},e.ptm("preview")),null,16,R)]}))],16)):p.createCommentVNode("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],16,L)),[[f]]):p.createCommentVNode("",!0)]})),_:3})],16)},C}(primevue.focustrap,primevue.icons.eye,primevue.icons.refresh,primevue.icons.searchminus,primevue.icons.searchplus,primevue.icons.times,primevue.icons.undo,primevue.portal,primevue.utils,primevue.basecomponent,primevue.usestyle,Vue);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { VNode } from 'vue';
|
|
11
11
|
import { ComponentHooks } from '../basecomponent';
|
|
12
|
-
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
12
|
+
import { ClassComponent, GlobalComponentConstructor, PTOptions } from '../ts-helpers';
|
|
13
13
|
|
|
14
14
|
export declare type InlineMessagePassThroughOptionType = InlineMessagePassThroughAttributes | ((options: InlineMessagePassThroughMethodOptions) => InlineMessagePassThroughAttributes | string) | string | null | undefined;
|
|
15
15
|
|
|
@@ -82,7 +82,7 @@ export interface InlineMessageProps {
|
|
|
82
82
|
* Used to pass attributes to DOM elements inside the component.
|
|
83
83
|
* @type {InlineMessagePassThroughOptions}
|
|
84
84
|
*/
|
|
85
|
-
pt?: InlineMessagePassThroughOptions
|
|
85
|
+
pt?: PTOptions<InlineMessagePassThroughOptions>;
|
|
86
86
|
/**
|
|
87
87
|
* When enabled, it removes component related styles in the core.
|
|
88
88
|
* @defaultValue false
|
package/inplace/Inplace.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { ButtonHTMLAttributes, HTMLAttributes, VNode } from 'vue';
|
|
12
12
|
import { ComponentHooks } from '../basecomponent';
|
|
13
13
|
import { ButtonPassThroughOptions } from '../button';
|
|
14
|
-
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
14
|
+
import { ClassComponent, GlobalComponentConstructor, PTOptions } from '../ts-helpers';
|
|
15
15
|
|
|
16
16
|
export declare type InplacePassThroughOptionType = InplacePassThroughAttributes | ((options: InplacePassThroughMethodOptions) => InplacePassThroughAttributes | string) | string | null | undefined;
|
|
17
17
|
|
|
@@ -107,7 +107,7 @@ export interface InplaceProps {
|
|
|
107
107
|
* Used to pass attributes to DOM elements inside the component.
|
|
108
108
|
* @type {InplacePassThroughOptions}
|
|
109
109
|
*/
|
|
110
|
-
pt?: InplacePassThroughOptions
|
|
110
|
+
pt?: PTOptions<InplacePassThroughOptions>;
|
|
111
111
|
/**
|
|
112
112
|
* When enabled, it removes component related styles in the core.
|
|
113
113
|
* @defaultValue false
|
package/inputmask/InputMask.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
import { ComponentHooks } from '../basecomponent';
|
|
11
|
-
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
11
|
+
import { ClassComponent, GlobalComponentConstructor, PTOptions } from '../ts-helpers';
|
|
12
12
|
|
|
13
13
|
export declare type InputMaskPassThroughOptionType = InputMaskPassThroughAttributes | ((options: InputMaskPassThroughMethodOptions) => InputMaskPassThroughAttributes | string) | string | null | undefined;
|
|
14
14
|
|
|
@@ -96,7 +96,7 @@ export interface InputMaskProps {
|
|
|
96
96
|
* Used to pass attributes to DOM elements inside the component.
|
|
97
97
|
* @type {InputMaskPassThroughOptions}
|
|
98
98
|
*/
|
|
99
|
-
pt?: InputMaskPassThroughOptions
|
|
99
|
+
pt?: PTOptions<InputMaskPassThroughOptions>;
|
|
100
100
|
/**
|
|
101
101
|
* When enabled, it removes component related styles in the core.
|
|
102
102
|
* @defaultValue false
|
|
@@ -11,7 +11,7 @@ import { ButtonHTMLAttributes, InputHTMLAttributes, VNode } from 'vue';
|
|
|
11
11
|
import { ComponentHooks } from '../basecomponent';
|
|
12
12
|
import { ButtonPassThroughOptionType } from '../button';
|
|
13
13
|
import { InputTextPassThroughOptionType } from '../inputtext';
|
|
14
|
-
import { ClassComponent, GlobalComponentConstructor, Nullable } from '../ts-helpers';
|
|
14
|
+
import { ClassComponent, GlobalComponentConstructor, Nullable, PTOptions } from '../ts-helpers';
|
|
15
15
|
|
|
16
16
|
export declare type InputNumberPassThroughOptionType = InputNumberPassThroughAttributes | ((options: InputNumberPassThroughMethodOptions) => InputNumberPassThroughAttributes | string) | string | null | undefined;
|
|
17
17
|
|
|
@@ -273,7 +273,7 @@ export interface InputNumberProps {
|
|
|
273
273
|
* Used to pass attributes to DOM elements inside the component.
|
|
274
274
|
* @type {InputNumberPassThroughOptions}
|
|
275
275
|
*/
|
|
276
|
-
pt?: InputNumberPassThroughOptions
|
|
276
|
+
pt?: PTOptions<InputNumberPassThroughOptions>;
|
|
277
277
|
/**
|
|
278
278
|
* When enabled, it removes component related styles in the core.
|
|
279
279
|
* @defaultValue false
|
|
@@ -436,6 +436,7 @@ export default {
|
|
|
436
436
|
|
|
437
437
|
case 'Tab':
|
|
438
438
|
case 'Enter':
|
|
439
|
+
case 'NumpadEnter':
|
|
439
440
|
newValueStr = this.validateValue(this.parseValue(inputValue));
|
|
440
441
|
this.$refs.input.$el.value = this.formatValue(newValueStr);
|
|
441
442
|
this.$refs.input.$el.setAttribute('aria-valuenow', newValueStr);
|
|
@@ -528,6 +528,7 @@ var script = {
|
|
|
528
528
|
break;
|
|
529
529
|
case 'Tab':
|
|
530
530
|
case 'Enter':
|
|
531
|
+
case 'NumpadEnter':
|
|
531
532
|
newValueStr = this.validateValue(this.parseValue(inputValue));
|
|
532
533
|
this.$refs.input.$el.value = this.formatValue(newValueStr);
|
|
533
534
|
this.$refs.input.$el.setAttribute('aria-valuenow', newValueStr);
|