primevue 3.30.2 → 3.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/breadcrumb/Breadcrumb.d.ts +15 -0
- package/breadcrumb/BreadcrumbItem.vue +18 -8
- package/breadcrumb/breadcrumb.cjs.js +18 -8
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +18 -8
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +18 -8
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/cascadeselect/CascadeSelect.vue +1 -0
- package/cascadeselect/CascadeSelectSub.vue +1 -0
- package/cascadeselect/cascadeselect.cjs.js +6 -4
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +6 -4
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +6 -4
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/config/PrimeVue.d.ts +14 -0
- package/contextmenu/ContextMenu.d.ts +8 -0
- package/contextmenu/ContextMenuSub.vue +13 -11
- package/contextmenu/contextmenu.cjs.js +13 -11
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +13 -11
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +13 -11
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +3417 -18
- package/core/core.min.js +5 -3
- package/dock/Dock.d.ts +4 -0
- package/dock/DockSub.vue +8 -7
- package/dock/dock.cjs.js +8 -7
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +8 -7
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +8 -7
- package/dock/dock.min.js +1 -1
- package/dropdown/BaseDropdown.vue +5 -5
- package/dropdown/dropdown.cjs.js +5 -5
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +5 -5
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +5 -5
- package/dropdown/dropdown.min.js +1 -1
- package/image/Image.vue +2 -2
- package/image/image.cjs.js +2 -2
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +2 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +2 -2
- package/image/image.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +2 -2
- package/megamenu/MegaMenu.d.ts +8 -0
- package/megamenu/MegaMenuSub.vue +13 -11
- package/megamenu/megamenu.cjs.js +13 -11
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +13 -11
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +13 -11
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +8 -0
- package/menu/Menu.vue +1 -1
- package/menu/Menuitem.vue +4 -1
- package/menu/menu.cjs.js +6 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +6 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +6 -2
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +8 -0
- package/menubar/MenubarSub.vue +12 -10
- package/menubar/menubar.cjs.js +12 -10
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +12 -10
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +12 -10
- package/menubar/menubar.min.js +1 -1
- package/package.json +1 -1
- package/panelmenu/PanelMenu.d.ts +8 -0
- package/panelmenu/PanelMenu.vue +12 -11
- package/panelmenu/PanelMenuSub.vue +13 -11
- package/panelmenu/panelmenu.cjs.js +25 -22
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +25 -22
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +25 -22
- package/panelmenu/panelmenu.min.js +1 -1
- package/resources/themes/bootstrap4-dark-blue/theme.css +0 -7
- package/resources/themes/bootstrap4-dark-purple/theme.css +0 -7
- package/resources/themes/bootstrap4-light-blue/theme.css +0 -7
- package/resources/themes/bootstrap4-light-purple/theme.css +0 -7
- package/splitterpanel/SplitterPanel.d.ts +11 -0
- package/splitterpanel/SplitterPanel.vue +7 -0
- package/splitterpanel/splitterpanel.cjs.js +7 -0
- package/splitterpanel/splitterpanel.cjs.min.js +1 -1
- package/splitterpanel/splitterpanel.esm.js +7 -0
- package/splitterpanel/splitterpanel.esm.min.js +1 -1
- package/splitterpanel/splitterpanel.js +7 -0
- package/splitterpanel/splitterpanel.min.js +1 -1
- package/steps/BaseSteps.vue +1 -1
- package/steps/Steps.d.ts +25 -0
- package/steps/Steps.vue +17 -7
- package/steps/steps.cjs.js +19 -9
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +19 -9
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +19 -9
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.d.ts +6 -2
- package/tabmenu/TabMenu.vue +11 -10
- package/tabmenu/tabmenu.cjs.js +11 -10
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +11 -10
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +11 -10
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/TabView.vue +1 -0
- package/tabview/tabview.cjs.js +2 -1
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +2 -1
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +2 -1
- package/tabview/tabview.min.js +1 -1
- package/tailwind/Tailwind.d.ts +5 -0
- package/tailwind/package.json +6 -0
- package/tailwind/tailwind.cjs.js +3388 -0
- package/tailwind/tailwind.cjs.min.js +1 -0
- package/tailwind/tailwind.esm.js +3386 -0
- package/tailwind/tailwind.esm.min.js +1 -0
- package/tailwind/tailwind.js +3392 -0
- package/tailwind/tailwind.min.js +1 -0
- package/tieredmenu/TieredMenu.d.ts +8 -0
- package/tieredmenu/TieredMenuSub.vue +13 -11
- package/tieredmenu/tieredmenu.cjs.js +13 -11
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +13 -11
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -11
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/web-types.json +1 -1
package/dock/Dock.d.ts
CHANGED
package/dock/DockSub.vue
CHANGED
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
:aria-disabled="disabled(processedItem)"
|
|
26
26
|
@click="onItemClick($event, processedItem)"
|
|
27
27
|
@mouseenter="onItemMouseEnter(index)"
|
|
28
|
-
v-bind="getPTOptions('menuitem', index)"
|
|
28
|
+
v-bind="getPTOptions('menuitem', processedItem, index)"
|
|
29
29
|
:data-p-focused="isItemActive(getItemId(index))"
|
|
30
30
|
:data-p-disabled="disabled(processedItem) || false"
|
|
31
31
|
>
|
|
32
|
-
<div :class="cx('content')" v-bind="getPTOptions('content', index)">
|
|
32
|
+
<div :class="cx('content')" v-bind="getPTOptions('content', processedItem, index)">
|
|
33
33
|
<template v-if="!templates['item']">
|
|
34
34
|
<router-link v-if="processedItem.to && !disabled(processedItem)" v-slot="{ navigate, href, isActive, isExactActive }" :to="processedItem.to" custom>
|
|
35
35
|
<a
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
tabindex="-1"
|
|
41
41
|
aria-hidden="true"
|
|
42
42
|
@click="onItemActionClick($event, processedItem, navigate)"
|
|
43
|
-
v-bind="getPTOptions('action', index)"
|
|
43
|
+
v-bind="getPTOptions('action', processedItem, index)"
|
|
44
44
|
>
|
|
45
45
|
<template v-if="!templates['icon']">
|
|
46
|
-
<span v-ripple :class="[cx('icon'), processedItem.icon]" v-bind="getPTOptions('icon', index)"></span>
|
|
46
|
+
<span v-ripple :class="[cx('icon'), processedItem.icon]" v-bind="getPTOptions('icon', processedItem, index)"></span>
|
|
47
47
|
</template>
|
|
48
48
|
<component v-else :is="templates['icon']" :item="processedItem" :class="cx('icon')"></component>
|
|
49
49
|
</a>
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
:target="processedItem.target"
|
|
57
57
|
tabindex="-1"
|
|
58
58
|
aria-hidden="true"
|
|
59
|
-
v-bind="getPTOptions('action', index)"
|
|
59
|
+
v-bind="getPTOptions('action', processedItem, index)"
|
|
60
60
|
>
|
|
61
61
|
<template v-if="!templates['icon']">
|
|
62
|
-
<span v-ripple :class="[cx('icon'), processedItem.icon]" v-bind="getPTOptions('icon', index)"></span>
|
|
62
|
+
<span v-ripple :class="[cx('icon'), processedItem.icon]" v-bind="getPTOptions('icon', processedItem, index)"></span>
|
|
63
63
|
</template>
|
|
64
64
|
<component v-else :is="templates['icon']" :item="processedItem" :class="cx('icon')"></component>
|
|
65
65
|
</a>
|
|
@@ -141,10 +141,11 @@ export default {
|
|
|
141
141
|
getItemProp(processedItem, name) {
|
|
142
142
|
return processedItem && processedItem.item ? ObjectUtils.getItemValue(processedItem.item[name]) : undefined;
|
|
143
143
|
},
|
|
144
|
-
getPTOptions(key, index) {
|
|
144
|
+
getPTOptions(key, item, index) {
|
|
145
145
|
return this.ptm(key, {
|
|
146
146
|
context: {
|
|
147
147
|
index,
|
|
148
|
+
item,
|
|
148
149
|
active: this.isItemActive(this.getItemId(index))
|
|
149
150
|
}
|
|
150
151
|
});
|
package/dock/dock.cjs.js
CHANGED
|
@@ -166,10 +166,11 @@ var script$1 = {
|
|
|
166
166
|
getItemProp: function getItemProp(processedItem, name) {
|
|
167
167
|
return processedItem && processedItem.item ? utils.ObjectUtils.getItemValue(processedItem.item[name]) : undefined;
|
|
168
168
|
},
|
|
169
|
-
getPTOptions: function getPTOptions(key, index) {
|
|
169
|
+
getPTOptions: function getPTOptions(key, item, index) {
|
|
170
170
|
return this.ptm(key, {
|
|
171
171
|
context: {
|
|
172
172
|
index: index,
|
|
173
|
+
item: item,
|
|
173
174
|
active: this.isItemActive(this.getItemId(index))
|
|
174
175
|
}
|
|
175
176
|
});
|
|
@@ -358,12 +359,12 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
358
359
|
onMouseenter: function onMouseenter($event) {
|
|
359
360
|
return $options.onItemMouseEnter(index);
|
|
360
361
|
}
|
|
361
|
-
}, $options.getPTOptions('menuitem', index), {
|
|
362
|
+
}, $options.getPTOptions('menuitem', processedItem, index), {
|
|
362
363
|
"data-p-focused": $options.isItemActive($options.getItemId(index)),
|
|
363
364
|
"data-p-disabled": $options.disabled(processedItem) || false
|
|
364
365
|
}), [vue.createElementVNode("div", vue.mergeProps({
|
|
365
366
|
"class": _ctx.cx('content')
|
|
366
|
-
}, $options.getPTOptions('content', index)), [!$props.templates['item'] ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
367
|
+
}, $options.getPTOptions('content', processedItem, index)), [!$props.templates['item'] ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
367
368
|
key: 0
|
|
368
369
|
}, [processedItem.to && !$options.disabled(processedItem) ? (vue.openBlock(), vue.createBlock(_component_router_link, {
|
|
369
370
|
key: 0,
|
|
@@ -387,10 +388,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
387
388
|
onClick: function onClick($event) {
|
|
388
389
|
return $options.onItemActionClick($event, processedItem, navigate);
|
|
389
390
|
}
|
|
390
|
-
}, $options.getPTOptions('action', index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
391
|
+
}, $options.getPTOptions('action', processedItem, index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
391
392
|
key: 0,
|
|
392
393
|
"class": [_ctx.cx('icon'), processedItem.icon]
|
|
393
|
-
}, $options.getPTOptions('icon', index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
394
|
+
}, $options.getPTOptions('icon', processedItem, index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
394
395
|
key: 1,
|
|
395
396
|
item: processedItem,
|
|
396
397
|
"class": vue.normalizeClass(_ctx.cx('icon'))
|
|
@@ -407,10 +408,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
407
408
|
target: processedItem.target,
|
|
408
409
|
tabindex: "-1",
|
|
409
410
|
"aria-hidden": "true"
|
|
410
|
-
}, $options.getPTOptions('action', index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
411
|
+
}, $options.getPTOptions('action', processedItem, index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
411
412
|
key: 0,
|
|
412
413
|
"class": [_ctx.cx('icon'), processedItem.icon]
|
|
413
|
-
}, $options.getPTOptions('icon', index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
414
|
+
}, $options.getPTOptions('icon', processedItem, index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
414
415
|
key: 1,
|
|
415
416
|
item: processedItem,
|
|
416
417
|
"class": vue.normalizeClass(_ctx.cx('icon'))
|
package/dock/dock.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/usestyle"),n=require("primevue/ripple"),o=require("primevue/tooltip"),i=require("primevue/utils"),r=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(n),s=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),u={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){var t=e.props;return["p-dock p-component","p-dock-".concat(t.position),t.class]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function p(e){return h(e)||k(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function k(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var v={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t){return this.ptm(e,{context:{index:t,active:this.isItemActive(this.getItemId(t))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}},x=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],g=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],y=["href","target","onClick"],I=["href","target"];v.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),l=r.resolveDirective("ripple"),s=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o},null,8,["item","index"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,u=i.isActive,p=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:u,isExactActive:p}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",o)),null,16)),[[l]])],16,y)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",o)),null,16)),[[l]])],16,I)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,g)})),128))],16,x)],16)};var O={name:"Dock",extends:u,components:{DockSub:v}};O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("root"),style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt"])],16)},module.exports=O;
|
|
1
|
+
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/usestyle"),n=require("primevue/ripple"),o=require("primevue/tooltip"),i=require("primevue/utils"),r=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(n),s=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),u={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){var t=e.props;return["p-dock p-component","p-dock-".concat(t.position),t.class]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function p(e){return h(e)||k(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function k(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var v={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t,n){return this.ptm(e,{context:{index:n,item:t,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}},x=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],g=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],y=["href","target","onClick"],I=["href","target"];v.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),l=r.resolveDirective("ripple"),s=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",t,o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",t,o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o},null,8,["item","index"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,u=i.isActive,p=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:u,isExactActive:p}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,y)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,I)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,g)})),128))],16,x)],16)};var O={name:"Dock",extends:u,components:{DockSub:v}};O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("root"),style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt"])],16)},module.exports=O;
|
package/dock/dock.esm.js
CHANGED
|
@@ -158,10 +158,11 @@ var script$1 = {
|
|
|
158
158
|
getItemProp: function getItemProp(processedItem, name) {
|
|
159
159
|
return processedItem && processedItem.item ? ObjectUtils.getItemValue(processedItem.item[name]) : undefined;
|
|
160
160
|
},
|
|
161
|
-
getPTOptions: function getPTOptions(key, index) {
|
|
161
|
+
getPTOptions: function getPTOptions(key, item, index) {
|
|
162
162
|
return this.ptm(key, {
|
|
163
163
|
context: {
|
|
164
164
|
index: index,
|
|
165
|
+
item: item,
|
|
165
166
|
active: this.isItemActive(this.getItemId(index))
|
|
166
167
|
}
|
|
167
168
|
});
|
|
@@ -350,12 +351,12 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
350
351
|
onMouseenter: function onMouseenter($event) {
|
|
351
352
|
return $options.onItemMouseEnter(index);
|
|
352
353
|
}
|
|
353
|
-
}, $options.getPTOptions('menuitem', index), {
|
|
354
|
+
}, $options.getPTOptions('menuitem', processedItem, index), {
|
|
354
355
|
"data-p-focused": $options.isItemActive($options.getItemId(index)),
|
|
355
356
|
"data-p-disabled": $options.disabled(processedItem) || false
|
|
356
357
|
}), [createElementVNode("div", mergeProps({
|
|
357
358
|
"class": _ctx.cx('content')
|
|
358
|
-
}, $options.getPTOptions('content', index)), [!$props.templates['item'] ? (openBlock(), createElementBlock(Fragment, {
|
|
359
|
+
}, $options.getPTOptions('content', processedItem, index)), [!$props.templates['item'] ? (openBlock(), createElementBlock(Fragment, {
|
|
359
360
|
key: 0
|
|
360
361
|
}, [processedItem.to && !$options.disabled(processedItem) ? (openBlock(), createBlock(_component_router_link, {
|
|
361
362
|
key: 0,
|
|
@@ -379,10 +380,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
379
380
|
onClick: function onClick($event) {
|
|
380
381
|
return $options.onItemActionClick($event, processedItem, navigate);
|
|
381
382
|
}
|
|
382
|
-
}, $options.getPTOptions('action', index)), [!$props.templates['icon'] ? withDirectives((openBlock(), createElementBlock("span", mergeProps({
|
|
383
|
+
}, $options.getPTOptions('action', processedItem, index)), [!$props.templates['icon'] ? withDirectives((openBlock(), createElementBlock("span", mergeProps({
|
|
383
384
|
key: 0,
|
|
384
385
|
"class": [_ctx.cx('icon'), processedItem.icon]
|
|
385
|
-
}, $options.getPTOptions('icon', index)), null, 16)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates['icon']), {
|
|
386
|
+
}, $options.getPTOptions('icon', processedItem, index)), null, 16)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates['icon']), {
|
|
386
387
|
key: 1,
|
|
387
388
|
item: processedItem,
|
|
388
389
|
"class": normalizeClass(_ctx.cx('icon'))
|
|
@@ -399,10 +400,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
399
400
|
target: processedItem.target,
|
|
400
401
|
tabindex: "-1",
|
|
401
402
|
"aria-hidden": "true"
|
|
402
|
-
}, $options.getPTOptions('action', index)), [!$props.templates['icon'] ? withDirectives((openBlock(), createElementBlock("span", mergeProps({
|
|
403
|
+
}, $options.getPTOptions('action', processedItem, index)), [!$props.templates['icon'] ? withDirectives((openBlock(), createElementBlock("span", mergeProps({
|
|
403
404
|
key: 0,
|
|
404
405
|
"class": [_ctx.cx('icon'), processedItem.icon]
|
|
405
|
-
}, $options.getPTOptions('icon', index)), null, 16)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates['icon']), {
|
|
406
|
+
}, $options.getPTOptions('icon', processedItem, index)), null, 16)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates['icon']), {
|
|
406
407
|
key: 1,
|
|
407
408
|
item: processedItem,
|
|
408
409
|
"class": normalizeClass(_ctx.cx('icon'))
|
package/dock/dock.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"primevue/basecomponent";import{useStyle as e}from"primevue/usestyle";import n from"primevue/ripple";import i from"primevue/tooltip";import{UniqueComponentId as o,ObjectUtils as r,DomHandler as a}from"primevue/utils";import{resolveComponent as c,resolveDirective as s,openBlock as l,createElementBlock as d,mergeProps as u,createElementVNode as p,Fragment as m,renderList as f,createBlock as b,withCtx as h,withDirectives as x,resolveDynamicComponent as y,normalizeClass as k,createVNode as g}from"vue";var v=e("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),I={name:"BaseDock",extends:t,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(t){var e=t.props;return["p-dock p-component","p-dock-".concat(e.position),e.class]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(t){var e=t.instance,n=t.processedItem,i=t.index;return["p-dock-item",{"p-focus":e.isItemActive(t.id),"p-disabled":e.disabled(n),"p-dock-item-second-prev":e.currentIndex-2===i,"p-dock-item-prev":e.currentIndex-1===i,"p-dock-item-current":e.currentIndex===i,"p-dock-item-next":e.currentIndex+1===i,"p-dock-item-second-next":e.currentIndex+2===i}]},content:"p-menuitem-content",action:function(t){return["p-dock-link",{"router-link-active":t.isActive,"router-link-active-exact":t.props.exact&&t.isExactActive}]},icon:"p-dock-icon"},loadStyle:v.load},provide:function(){return{$parentInstance:this}}};function O(t){return D(t)||S(t)||w(t)||A()}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}function S(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function D(t){if(Array.isArray(t))return L(t)}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var K={name:"DockSub",hostName:"Dock",extends:t,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(t){this.id=t||o()}},mounted:function(){this.id=this.id||o()},methods:{getItemId:function(t){return"".concat(this.id,"_").concat(t)},getItemProp:function(t,e){return t&&t.item?r.getItemValue(t.item[e]):void 0},getPTOptions:function(t,e){return this.ptm(t,{context:{index:e,active:this.isItemActive(this.getItemId(e))}})},isSameMenuItem:function(t){return t.currentTarget&&(t.currentTarget.isSameNode(t.target)||t.currentTarget.isSameNode(t.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(t){return t===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(t){this.currentIndex=t},onItemActionClick:function(t,e){e&&e(t)},onItemClick:function(t,e){if(this.isSameMenuItem(t)){var n=this.getItemProp(e,"command");n&&n({originalEvent:t,item:e.item})}},onListFocus:function(t){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",t)},onListBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onListKeyDown:function(t){switch(t.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(t),t.preventDefault()}},onArrowDownKey:function(){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onArrowUpKey:function(){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var t=a.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),e=t&&a.findSingle(t,'[data-pc-section="action"]');e?e.click():t&&t.click()},findNextOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e+1:0},findPrevOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e-1:0},changeFocusedOptionIndex:function(t){var e=a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=e[t>=e.length?e.length-1:t<0?0:t].getAttribute("id")},disabled:function(t){return"function"==typeof t.disabled?t.disabled():t.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:n,tooltip:i}},P=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],E=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],M=["href","target","onClick"],T=["href","target"];K.render=function(t,e,n,i,o,r){var a=c("router-link"),g=s("ripple"),v=s("tooltip");return l(),d("div",u({class:t.cx("container")},t.ptm("container")),[p("ul",u({ref:"list",id:o.id,class:t.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onFocus:e[0]||(e[0]=function(){return r.onListFocus&&r.onListFocus.apply(r,arguments)}),onBlur:e[1]||(e[1]=function(){return r.onListBlur&&r.onListBlur.apply(r,arguments)}),onKeydown:e[2]||(e[2]=function(){return r.onListKeyDown&&r.onListKeyDown.apply(r,arguments)}),onMouseleave:e[3]||(e[3]=function(){return r.onListMouseLeave&&r.onListMouseLeave.apply(r,arguments)})},t.ptm("menu")),[(l(!0),d(m,null,f(n.model,(function(e,i){return l(),d("li",u({key:i,id:r.getItemId(i),class:t.cx("menuitem",{processedItem:e,index:i,id:r.getItemId(i)}),role:"menuitem","aria-label":e.label,"aria-disabled":r.disabled(e),onClick:function(t){return r.onItemClick(t,e)},onMouseenter:function(t){return r.onItemMouseEnter(i)}},r.getPTOptions("menuitem",i),{"data-p-focused":r.isItemActive(r.getItemId(i)),"data-p-disabled":r.disabled(e)||!1}),[p("div",u({class:t.cx("content")},r.getPTOptions("content",i)),[n.templates.item?(l(),b(y(n.templates.item),{key:1,item:e,index:i},null,8,["item","index"])):(l(),d(m,{key:0},[e.to&&!r.disabled(e)?(l(),b(a,{key:0,to:e.to,custom:""},{default:h((function(o){var a=o.navigate,c=o.href,s=o.isActive,p=o.isExactActive;return[x((l(),d("a",u({href:c,class:t.cx("action",{isActive:s,isExactActive:p}),target:e.target,tabindex:"-1","aria-hidden":"true",onClick:function(t){return r.onItemActionClick(t,e,a)}},r.getPTOptions("action",i)),[n.templates.icon?(l(),b(y(n.templates.icon),{key:1,item:e,class:k(t.cx("icon"))},null,8,["item","class"])):x((l(),d("span",u({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",i)),null,16)),[[g]])],16,M)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):x((l(),d("a",u({key:1,href:e.url,class:t.cx("action"),target:e.target,tabindex:"-1","aria-hidden":"true"},r.getPTOptions("action",i)),[n.templates.icon?(l(),b(y(n.templates.icon),{key:1,item:e,class:k(t.cx("icon"))},null,8,["item","class"])):x((l(),d("span",u({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",i)),null,16)),[[g]])],16,T)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,E)})),128))],16,P)],16)};var F={name:"Dock",extends:I,components:{DockSub:K}};F.render=function(t,e,n,i,o,r){var a=c("DockSub");return l(),d("div",u({class:t.cx("root"),style:t.style},t.ptm("root"),{"data-pc-name":"dock"}),[g(a,{model:t.model,templates:t.$slots,exact:t.exact,tooltipOptions:t.tooltipOptions,position:t.position,menuId:t.menuId,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,tabindex:t.tabindex,pt:t.pt},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt"])],16)};export{F as default};
|
|
1
|
+
import t from"primevue/basecomponent";import{useStyle as e}from"primevue/usestyle";import n from"primevue/ripple";import i from"primevue/tooltip";import{UniqueComponentId as o,ObjectUtils as r,DomHandler as a}from"primevue/utils";import{resolveComponent as c,resolveDirective as s,openBlock as l,createElementBlock as d,mergeProps as u,createElementVNode as p,Fragment as m,renderList as f,createBlock as b,withCtx as h,withDirectives as x,resolveDynamicComponent as y,normalizeClass as k,createVNode as g}from"vue";var v=e("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),I={name:"BaseDock",extends:t,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(t){var e=t.props;return["p-dock p-component","p-dock-".concat(e.position),e.class]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(t){var e=t.instance,n=t.processedItem,i=t.index;return["p-dock-item",{"p-focus":e.isItemActive(t.id),"p-disabled":e.disabled(n),"p-dock-item-second-prev":e.currentIndex-2===i,"p-dock-item-prev":e.currentIndex-1===i,"p-dock-item-current":e.currentIndex===i,"p-dock-item-next":e.currentIndex+1===i,"p-dock-item-second-next":e.currentIndex+2===i}]},content:"p-menuitem-content",action:function(t){return["p-dock-link",{"router-link-active":t.isActive,"router-link-active-exact":t.props.exact&&t.isExactActive}]},icon:"p-dock-icon"},loadStyle:v.load},provide:function(){return{$parentInstance:this}}};function O(t){return D(t)||S(t)||w(t)||A()}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}function S(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function D(t){if(Array.isArray(t))return L(t)}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var K={name:"DockSub",hostName:"Dock",extends:t,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(t){this.id=t||o()}},mounted:function(){this.id=this.id||o()},methods:{getItemId:function(t){return"".concat(this.id,"_").concat(t)},getItemProp:function(t,e){return t&&t.item?r.getItemValue(t.item[e]):void 0},getPTOptions:function(t,e,n){return this.ptm(t,{context:{index:n,item:e,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(t){return t.currentTarget&&(t.currentTarget.isSameNode(t.target)||t.currentTarget.isSameNode(t.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(t){return t===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(t){this.currentIndex=t},onItemActionClick:function(t,e){e&&e(t)},onItemClick:function(t,e){if(this.isSameMenuItem(t)){var n=this.getItemProp(e,"command");n&&n({originalEvent:t,item:e.item})}},onListFocus:function(t){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",t)},onListBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onListKeyDown:function(t){switch(t.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(t),t.preventDefault()}},onArrowDownKey:function(){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onArrowUpKey:function(){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var t=a.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),e=t&&a.findSingle(t,'[data-pc-section="action"]');e?e.click():t&&t.click()},findNextOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e+1:0},findPrevOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e-1:0},changeFocusedOptionIndex:function(t){var e=a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=e[t>=e.length?e.length-1:t<0?0:t].getAttribute("id")},disabled:function(t){return"function"==typeof t.disabled?t.disabled():t.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:n,tooltip:i}},P=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],E=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],M=["href","target","onClick"],T=["href","target"];K.render=function(t,e,n,i,o,r){var a=c("router-link"),g=s("ripple"),v=s("tooltip");return l(),d("div",u({class:t.cx("container")},t.ptm("container")),[p("ul",u({ref:"list",id:o.id,class:t.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onFocus:e[0]||(e[0]=function(){return r.onListFocus&&r.onListFocus.apply(r,arguments)}),onBlur:e[1]||(e[1]=function(){return r.onListBlur&&r.onListBlur.apply(r,arguments)}),onKeydown:e[2]||(e[2]=function(){return r.onListKeyDown&&r.onListKeyDown.apply(r,arguments)}),onMouseleave:e[3]||(e[3]=function(){return r.onListMouseLeave&&r.onListMouseLeave.apply(r,arguments)})},t.ptm("menu")),[(l(!0),d(m,null,f(n.model,(function(e,i){return l(),d("li",u({key:i,id:r.getItemId(i),class:t.cx("menuitem",{processedItem:e,index:i,id:r.getItemId(i)}),role:"menuitem","aria-label":e.label,"aria-disabled":r.disabled(e),onClick:function(t){return r.onItemClick(t,e)},onMouseenter:function(t){return r.onItemMouseEnter(i)}},r.getPTOptions("menuitem",e,i),{"data-p-focused":r.isItemActive(r.getItemId(i)),"data-p-disabled":r.disabled(e)||!1}),[p("div",u({class:t.cx("content")},r.getPTOptions("content",e,i)),[n.templates.item?(l(),b(y(n.templates.item),{key:1,item:e,index:i},null,8,["item","index"])):(l(),d(m,{key:0},[e.to&&!r.disabled(e)?(l(),b(a,{key:0,to:e.to,custom:""},{default:h((function(o){var a=o.navigate,c=o.href,s=o.isActive,p=o.isExactActive;return[x((l(),d("a",u({href:c,class:t.cx("action",{isActive:s,isExactActive:p}),target:e.target,tabindex:"-1","aria-hidden":"true",onClick:function(t){return r.onItemActionClick(t,e,a)}},r.getPTOptions("action",e,i)),[n.templates.icon?(l(),b(y(n.templates.icon),{key:1,item:e,class:k(t.cx("icon"))},null,8,["item","class"])):x((l(),d("span",u({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",e,i)),null,16)),[[g]])],16,M)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):x((l(),d("a",u({key:1,href:e.url,class:t.cx("action"),target:e.target,tabindex:"-1","aria-hidden":"true"},r.getPTOptions("action",e,i)),[n.templates.icon?(l(),b(y(n.templates.icon),{key:1,item:e,class:k(t.cx("icon"))},null,8,["item","class"])):x((l(),d("span",u({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",e,i)),null,16)),[[g]])],16,T)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,E)})),128))],16,P)],16)};var F={name:"Dock",extends:I,components:{DockSub:K}};F.render=function(t,e,n,i,o,r){var a=c("DockSub");return l(),d("div",u({class:t.cx("root"),style:t.style},t.ptm("root"),{"data-pc-name":"dock"}),[g(a,{model:t.model,templates:t.$slots,exact:t.exact,tooltipOptions:t.tooltipOptions,position:t.position,menuId:t.menuId,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,tabindex:t.tabindex,pt:t.pt},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt"])],16)};export{F as default};
|
package/dock/dock.js
CHANGED
|
@@ -161,10 +161,11 @@ this.primevue.dock = (function (BaseComponent, usestyle, Ripple, Tooltip, utils,
|
|
|
161
161
|
getItemProp: function getItemProp(processedItem, name) {
|
|
162
162
|
return processedItem && processedItem.item ? utils.ObjectUtils.getItemValue(processedItem.item[name]) : undefined;
|
|
163
163
|
},
|
|
164
|
-
getPTOptions: function getPTOptions(key, index) {
|
|
164
|
+
getPTOptions: function getPTOptions(key, item, index) {
|
|
165
165
|
return this.ptm(key, {
|
|
166
166
|
context: {
|
|
167
167
|
index: index,
|
|
168
|
+
item: item,
|
|
168
169
|
active: this.isItemActive(this.getItemId(index))
|
|
169
170
|
}
|
|
170
171
|
});
|
|
@@ -353,12 +354,12 @@ this.primevue.dock = (function (BaseComponent, usestyle, Ripple, Tooltip, utils,
|
|
|
353
354
|
onMouseenter: function onMouseenter($event) {
|
|
354
355
|
return $options.onItemMouseEnter(index);
|
|
355
356
|
}
|
|
356
|
-
}, $options.getPTOptions('menuitem', index), {
|
|
357
|
+
}, $options.getPTOptions('menuitem', processedItem, index), {
|
|
357
358
|
"data-p-focused": $options.isItemActive($options.getItemId(index)),
|
|
358
359
|
"data-p-disabled": $options.disabled(processedItem) || false
|
|
359
360
|
}), [vue.createElementVNode("div", vue.mergeProps({
|
|
360
361
|
"class": _ctx.cx('content')
|
|
361
|
-
}, $options.getPTOptions('content', index)), [!$props.templates['item'] ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
362
|
+
}, $options.getPTOptions('content', processedItem, index)), [!$props.templates['item'] ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
362
363
|
key: 0
|
|
363
364
|
}, [processedItem.to && !$options.disabled(processedItem) ? (vue.openBlock(), vue.createBlock(_component_router_link, {
|
|
364
365
|
key: 0,
|
|
@@ -382,10 +383,10 @@ this.primevue.dock = (function (BaseComponent, usestyle, Ripple, Tooltip, utils,
|
|
|
382
383
|
onClick: function onClick($event) {
|
|
383
384
|
return $options.onItemActionClick($event, processedItem, navigate);
|
|
384
385
|
}
|
|
385
|
-
}, $options.getPTOptions('action', index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
386
|
+
}, $options.getPTOptions('action', processedItem, index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
386
387
|
key: 0,
|
|
387
388
|
"class": [_ctx.cx('icon'), processedItem.icon]
|
|
388
|
-
}, $options.getPTOptions('icon', index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
389
|
+
}, $options.getPTOptions('icon', processedItem, index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
389
390
|
key: 1,
|
|
390
391
|
item: processedItem,
|
|
391
392
|
"class": vue.normalizeClass(_ctx.cx('icon'))
|
|
@@ -402,10 +403,10 @@ this.primevue.dock = (function (BaseComponent, usestyle, Ripple, Tooltip, utils,
|
|
|
402
403
|
target: processedItem.target,
|
|
403
404
|
tabindex: "-1",
|
|
404
405
|
"aria-hidden": "true"
|
|
405
|
-
}, $options.getPTOptions('action', index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
406
|
+
}, $options.getPTOptions('action', processedItem, index)), [!$props.templates['icon'] ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
406
407
|
key: 0,
|
|
407
408
|
"class": [_ctx.cx('icon'), processedItem.icon]
|
|
408
|
-
}, $options.getPTOptions('icon', index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
409
|
+
}, $options.getPTOptions('icon', processedItem, index)), null, 16)), [[_directive_ripple]]) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['icon']), {
|
|
409
410
|
key: 1,
|
|
410
411
|
item: processedItem,
|
|
411
412
|
"class": vue.normalizeClass(_ctx.cx('icon'))
|
package/dock/dock.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.dock=function(e,t,n,o,i,r){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(n),s=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),p={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){var t=e.props;return["p-dock p-component","p-dock-".concat(t.position),t.class]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function u(e){return k(e)||h(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var v={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t){return this.ptm(e,{context:{index:t,active:this.isItemActive(this.getItemId(t))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=u(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=u(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}},g=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],x=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],y=["href","target","onClick"],I=["href","target"];v.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),l=r.resolveDirective("ripple"),s=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o},null,8,["item","index"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,p=i.isActive,u=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:p,isExactActive:u}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",o)),null,16)),[[l]])],16,y)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",o)),null,16)),[[l]])],16,I)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,x)})),128))],16,g)],16)};var O={name:"Dock",extends:p,components:{DockSub:v}};return O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("root"),style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt"])],16)},O}(primevue.basecomponent,primevue.usestyle,primevue.ripple,primevue.tooltip,primevue.utils,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.dock=function(e,t,n,o,i,r){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(n),s=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),p={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){var t=e.props;return["p-dock p-component","p-dock-".concat(t.position),t.class]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function u(e){return k(e)||h(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var v={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t,n){return this.ptm(e,{context:{index:n,item:t,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=u(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=u(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}},g=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],x=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],y=["href","target","onClick"],I=["href","target"];v.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),l=r.resolveDirective("ripple"),s=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",t,o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",t,o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o},null,8,["item","index"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,p=i.isActive,u=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:p,isExactActive:u}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,y)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,I)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,x)})),128))],16,g)],16)};var O={name:"Dock",extends:p,components:{DockSub:v}};return O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("root"),style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt"])],16)},O}(primevue.basecomponent,primevue.usestyle,primevue.ripple,primevue.tooltip,primevue.utils,Vue);
|
|
@@ -153,11 +153,11 @@ export default {
|
|
|
153
153
|
props: {
|
|
154
154
|
modelValue: null,
|
|
155
155
|
options: Array,
|
|
156
|
-
optionLabel:
|
|
157
|
-
optionValue:
|
|
158
|
-
optionDisabled:
|
|
159
|
-
optionGroupLabel:
|
|
160
|
-
optionGroupChildren:
|
|
156
|
+
optionLabel: String || Function,
|
|
157
|
+
optionValue: String || Function,
|
|
158
|
+
optionDisabled: String || Function,
|
|
159
|
+
optionGroupLabel: String || Function,
|
|
160
|
+
optionGroupChildren: String || Function,
|
|
161
161
|
scrollHeight: {
|
|
162
162
|
type: String,
|
|
163
163
|
default: '200px'
|
package/dropdown/dropdown.cjs.js
CHANGED
|
@@ -91,11 +91,11 @@ var script$1 = {
|
|
|
91
91
|
props: {
|
|
92
92
|
modelValue: null,
|
|
93
93
|
options: Array,
|
|
94
|
-
optionLabel:
|
|
95
|
-
optionValue:
|
|
96
|
-
optionDisabled:
|
|
97
|
-
optionGroupLabel:
|
|
98
|
-
optionGroupChildren:
|
|
94
|
+
optionLabel: String || Function,
|
|
95
|
+
optionValue: String || Function,
|
|
96
|
+
optionDisabled: String || Function,
|
|
97
|
+
optionGroupLabel: String || Function,
|
|
98
|
+
optionGroupChildren: String || Function,
|
|
99
99
|
scrollHeight: {
|
|
100
100
|
type: String,
|
|
101
101
|
"default": '200px'
|