primevue 3.30.0 → 3.30.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/README.md +4 -2
- package/accordion/Accordion.d.ts +6 -1
- package/accordion/Accordion.vue +2 -1
- package/accordion/accordion.cjs.js +5 -9
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +5 -9
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +6 -10
- package/accordion/accordion.min.js +1 -1
- package/accordiontab/AccordionTab.d.ts +1 -1
- package/autocomplete/AutoComplete.d.ts +1 -1
- package/avatar/Avatar.d.ts +1 -1
- package/badge/Badge.d.ts +1 -1
- package/basecomponent/BaseComponent.vue +12 -16
- package/basecomponent/basecomponent.cjs.js +18 -6
- package/basecomponent/basecomponent.cjs.min.js +1 -1
- package/basecomponent/basecomponent.esm.js +18 -6
- package/basecomponent/basecomponent.esm.min.js +1 -1
- package/basecomponent/basecomponent.js +18 -6
- package/basecomponent/basecomponent.min.js +1 -1
- package/basedirective/basedirective.cjs.js +8 -2
- package/basedirective/basedirective.cjs.min.js +1 -1
- package/basedirective/basedirective.esm.js +8 -2
- package/basedirective/basedirective.esm.min.js +1 -1
- package/basedirective/basedirective.js +8 -2
- package/basedirective/basedirective.min.js +1 -1
- package/blockui/BlockUI.d.ts +1 -1
- package/breadcrumb/Breadcrumb.d.ts +1 -1
- package/button/Button.d.ts +1 -1
- package/calendar/Calendar.d.ts +1 -1
- package/carousel/Carousel.d.ts +1 -1
- package/cascadeselect/CascadeSelect.d.ts +1 -1
- package/chart/Chart.d.ts +1 -1
- package/checkbox/Checkbox.d.ts +1 -1
- package/chip/Chip.d.ts +1 -1
- package/chips/Chips.d.ts +1 -1
- package/colorpicker/ColorPicker.d.ts +1 -1
- package/column/Column.d.ts +49 -1
- package/columngroup/ColumnGroup.d.ts +6 -1
- package/config/PrimeVue.d.ts +13 -6
- package/confirmdialog/ConfirmDialog.d.ts +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +1 -1
- package/contextmenu/ContextMenu.d.ts +1 -1
- package/core/core.js +144 -103
- package/core/core.min.js +10 -10
- package/datatable/BaseDataTable.vue +7 -1
- package/datatable/BodyCell.vue +7 -4
- package/datatable/ColumnFilter.vue +43 -8
- package/datatable/DataTable.d.ts +31 -1
- package/datatable/FooterCell.vue +5 -2
- package/datatable/HeaderCell.vue +8 -3
- package/datatable/HeaderCheckbox.vue +5 -2
- package/datatable/RowCheckbox.vue +5 -2
- package/datatable/RowRadioButton.vue +5 -2
- package/datatable/TableBody.vue +33 -13
- package/datatable/TableFooter.vue +13 -4
- package/datatable/TableHeader.vue +16 -5
- package/datatable/datatable.cjs.js +221 -145
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +221 -145
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +222 -146
- package/datatable/datatable.min.js +1 -1
- package/dataview/BaseDataView.vue +1 -2
- package/dataview/DataView.d.ts +1 -1
- package/dataview/DataView.vue +3 -3
- package/dataview/dataview.cjs.js +5 -13
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +5 -13
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +5 -13
- package/dataview/dataview.min.js +1 -1
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +6 -1
- package/deferredcontent/DeferredContent.d.ts +1 -1
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.vue +13 -1
- package/dialog/dialog.cjs.js +6 -2
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +6 -2
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +6 -2
- package/dialog/dialog.min.js +1 -1
- package/divider/Divider.d.ts +1 -1
- package/dock/Dock.d.ts +5 -1
- package/dock/DockSub.vue +9 -8
- package/dock/dock.cjs.js +9 -8
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +9 -8
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +9 -8
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.d.ts +1 -1
- package/editor/Editor.d.ts +1 -1
- package/fieldset/Fieldset.d.ts +1 -1
- package/fileupload/FileUpload.d.ts +1 -1
- package/galleria/Galleria.d.ts +5 -1
- package/galleria/GalleriaContent.vue +16 -6
- package/galleria/GalleriaItem.vue +2 -1
- package/galleria/GalleriaThumbnails.vue +1 -0
- package/galleria/galleria.cjs.js +34 -17
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +35 -18
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +34 -17
- package/galleria/galleria.min.js +1 -1
- package/image/Image.d.ts +1 -1
- package/inlinemessage/InlineMessage.d.ts +1 -1
- package/inplace/Inplace.d.ts +1 -1
- package/inputnumber/InputNumber.d.ts +1 -1
- package/inputswitch/InputSwitch.d.ts +1 -1
- package/inputtext/InputText.d.ts +26 -1
- package/inputtext/InputText.vue +2 -1
- package/inputtext/inputtext.cjs.js +2 -1
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +2 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +2 -1
- package/inputtext/inputtext.min.js +1 -1
- package/knob/Knob.d.ts +1 -1
- package/listbox/Listbox.d.ts +1 -1
- package/megamenu/MegaMenu.d.ts +1 -1
- package/menu/Menu.d.ts +1 -1
- package/menubar/Menubar.d.ts +1 -1
- package/message/BaseMessage.vue +2 -2
- package/message/Message.d.ts +11 -1
- package/message/Message.vue +3 -3
- package/message/message.cjs.js +8 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +8 -8
- package/message/message.esm.min.js +1 -1
- package/message/message.js +8 -8
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +1 -1
- package/multiselect/MultiSelect.vue +3 -2
- package/multiselect/multiselect.cjs.js +5 -5
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +6 -6
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +5 -5
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.d.ts +18 -1
- package/orderlist/OrderList.vue +7 -7
- package/orderlist/orderlist.cjs.js +19 -15
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +19 -15
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +19 -15
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/OrganizationChart.d.ts +1 -1
- package/overlaypanel/OverlayPanel.d.ts +1 -1
- package/overlaypanel/OverlayPanel.vue +4 -2
- package/overlaypanel/overlaypanel.cjs.js +4 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +4 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +4 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/JumpToPageDropdown.vue +1 -1
- package/paginator/Paginator.d.ts +1 -26
- package/paginator/paginator.cjs.js +1 -1
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +1 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +1 -1
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +2 -2
- package/panelmenu/PanelMenu.d.ts +1 -1
- package/password/Password.d.ts +1 -1
- package/picklist/BasePickList.vue +4 -4
- package/picklist/PickList.d.ts +22 -1
- package/picklist/PickList.vue +19 -19
- package/picklist/picklist.cjs.js +59 -47
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +59 -47
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +59 -47
- package/picklist/picklist.min.js +1 -1
- package/progressbar/ProgressBar.d.ts +1 -1
- package/progressspinner/ProgressSpinner.d.ts +1 -1
- package/radiobutton/RadioButton.d.ts +1 -1
- package/rating/Rating.d.ts +1 -1
- package/row/Row.d.ts +1 -1
- package/scrollpanel/ScrollPanel.d.ts +1 -1
- package/scrollpanel/ScrollPanel.vue +2 -0
- package/scrollpanel/scrollpanel.cjs.js +6 -2
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +6 -2
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +6 -2
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/ScrollTop.d.ts +1 -1
- package/selectbutton/SelectButton.d.ts +1 -1
- package/sidebar/Sidebar.d.ts +1 -1
- package/sidebar/Sidebar.vue +1 -1
- package/sidebar/sidebar.cjs.js +3 -1
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +3 -1
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +3 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +1 -1
- package/slider/Slider.d.ts +1 -1
- package/speeddial/SpeedDial.d.ts +1 -1
- package/splitbutton/SplitButton.d.ts +1 -1
- package/splitbutton/SplitButton.vue +2 -1
- package/splitbutton/splitbutton.cjs.js +4 -2
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +4 -2
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +4 -2
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.d.ts +1 -1
- package/splitterpanel/SplitterPanel.d.ts +1 -1
- package/steps/Steps.d.ts +1 -1
- package/tabmenu/TabMenu.d.ts +1 -1
- package/tabmenu/TabMenu.vue +71 -72
- package/tabmenu/tabmenu.cjs.js +67 -75
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +67 -75
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +67 -75
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabpanel/TabPanel.d.ts +17 -1
- package/tabview/TabView.d.ts +6 -1
- package/tabview/TabView.vue +12 -4
- package/tabview/tabview.cjs.js +23 -16
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +23 -16
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +24 -17
- package/tabview/tabview.min.js +1 -1
- package/tag/Tag.d.ts +1 -1
- package/terminal/Terminal.d.ts +1 -1
- package/textarea/Textarea.d.ts +18 -1
- package/textarea/Textarea.vue +8 -1
- package/textarea/textarea.cjs.js +8 -1
- package/textarea/textarea.cjs.min.js +1 -1
- package/textarea/textarea.esm.js +8 -1
- package/textarea/textarea.esm.min.js +1 -1
- package/textarea/textarea.js +8 -1
- package/textarea/textarea.min.js +1 -1
- package/tieredmenu/TieredMenu.d.ts +1 -1
- package/timeline/Timeline.d.ts +20 -1
- package/timeline/Timeline.vue +14 -6
- package/timeline/timeline.cjs.js +17 -7
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +17 -7
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +17 -7
- package/timeline/timeline.min.js +1 -1
- package/toast/BaseToast.vue +2 -2
- package/toast/Toast.d.ts +11 -1
- package/toast/ToastMessage.vue +3 -2
- package/toast/toast.cjs.js +7 -6
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +7 -6
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +7 -6
- package/toast/toast.min.js +1 -1
- package/togglebutton/ToggleButton.d.ts +1 -1
- package/toolbar/Toolbar.d.ts +1 -1
- package/tree/Tree.d.ts +10 -1
- package/tree/TreeNode.vue +3 -1
- package/tree/tree.cjs.js +3 -1
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +3 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +3 -1
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +1 -1
- package/treetable/BaseTreeTable.vue +9 -3
- package/treetable/BodyCell.vue +16 -5
- package/treetable/FooterCell.vue +5 -2
- package/treetable/HeaderCell.vue +11 -3
- package/treetable/TreeTable.d.ts +31 -9
- package/treetable/TreeTable.vue +13 -5
- package/treetable/TreeTableRow.vue +11 -2
- package/treetable/treetable.cjs.js +84 -55
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +85 -56
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +84 -55
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +1 -1
- package/usestyle/UseStyle.d.ts +1 -0
- package/usestyle/usestyle.cjs.js +12 -10
- package/usestyle/usestyle.cjs.min.js +1 -1
- package/usestyle/usestyle.esm.js +12 -10
- package/usestyle/usestyle.esm.min.js +1 -1
- package/usestyle/usestyle.js +12 -10
- package/usestyle/usestyle.min.js +1 -1
- package/utils/Utils.d.ts +4 -3
- package/utils/utils.cjs.js +19 -5
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +19 -5
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +19 -5
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +8 -0
- package/vetur-tags.json +2 -0
- package/virtualscroller/VirtualScroller.d.ts +1 -1
- package/web-types.json +21 -1
package/tabview/TabView.vue
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:aria-label="prevButtonAriaLabel"
|
|
12
12
|
@click="onPrevButtonClick"
|
|
13
13
|
v-bind="{ ...previousButtonProps, ...ptm('previousButton') }"
|
|
14
|
+
data-pc-group-section="navbutton"
|
|
14
15
|
>
|
|
15
16
|
<slot name="previcon">
|
|
16
17
|
<component :is="prevIcon ? 'span' : 'ChevronLeftIcon'" aria-hidden="true" :class="prevIcon" v-bind="ptm('previousIcon')" />
|
|
@@ -24,12 +25,12 @@
|
|
|
24
25
|
:style="getTabProp(tab, 'headerStyle')"
|
|
25
26
|
:class="cx('tab.header', { tab, index })"
|
|
26
27
|
role="presentation"
|
|
28
|
+
v-bind="{ ...getTabProp(tab, 'headerProps'), ...getTabPT(tab, 'root', index), ...getTabPT(tab, 'header', index) }"
|
|
27
29
|
data-pc-name="tabpanel"
|
|
28
30
|
:data-p-highlight="d_activeIndex === index"
|
|
29
31
|
:data-p-disabled="getTabProp(tab, 'disabled')"
|
|
30
32
|
:data-pc-index="index"
|
|
31
33
|
:data-p-active="d_activeIndex === index"
|
|
32
|
-
v-bind="{ ...getTabProp(tab, 'headerProps'), ...getTabPT(tab, 'root', index), ...getTabPT(tab, 'header', index) }"
|
|
33
34
|
>
|
|
34
35
|
<a
|
|
35
36
|
:id="getTabHeaderActionId(index)"
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
:aria-label="nextButtonAriaLabel"
|
|
62
63
|
@click="onNextButtonClick"
|
|
63
64
|
v-bind="{ ...nextButtonProps, ...ptm('nextButton') }"
|
|
65
|
+
data-pc-group-section="navbutton"
|
|
64
66
|
>
|
|
65
67
|
<slot name="nexticon">
|
|
66
68
|
<component :is="nextIcon ? 'span' : 'ChevronRightIcon'" aria-hidden="true" :class="nextIcon" v-bind="ptm('nextIcon')" />
|
|
@@ -76,10 +78,10 @@
|
|
|
76
78
|
:class="cx('tab.content', { tab })"
|
|
77
79
|
role="tabpanel"
|
|
78
80
|
:aria-labelledby="getTabHeaderActionId(index)"
|
|
81
|
+
v-bind="{ ...getTabProp(tab, 'contentProps'), ...getTabPT(tab, 'root', index), ...getTabPT(tab, 'content', index) }"
|
|
79
82
|
data-pc-name="tabpanel"
|
|
80
83
|
:data-pc-index="index"
|
|
81
84
|
:data-p-active="d_activeIndex === index"
|
|
82
|
-
v-bind="{ ...getTabProp(tab, 'contentProps'), ...getTabPT(tab, 'root', index), ...getTabPT(tab, 'content', index) }"
|
|
83
85
|
>
|
|
84
86
|
<component :is="tab"></component>
|
|
85
87
|
</div>
|
|
@@ -93,6 +95,7 @@ import ChevronLeftIcon from 'primevue/icons/chevronleft';
|
|
|
93
95
|
import ChevronRightIcon from 'primevue/icons/chevronright';
|
|
94
96
|
import Ripple from 'primevue/ripple';
|
|
95
97
|
import { DomHandler, UniqueComponentId } from 'primevue/utils';
|
|
98
|
+
import { mergeProps } from 'vue';
|
|
96
99
|
import BaseTabView from './BaseTabView.vue';
|
|
97
100
|
|
|
98
101
|
export default {
|
|
@@ -146,6 +149,7 @@ export default {
|
|
|
146
149
|
return `${this.id}_${index}_content`;
|
|
147
150
|
},
|
|
148
151
|
getTabPT(tab, key, index) {
|
|
152
|
+
const count = this.tabs.length;
|
|
149
153
|
const tabMetaData = {
|
|
150
154
|
props: tab.props,
|
|
151
155
|
parent: {
|
|
@@ -153,11 +157,15 @@ export default {
|
|
|
153
157
|
state: this.$data
|
|
154
158
|
},
|
|
155
159
|
context: {
|
|
156
|
-
index
|
|
160
|
+
index,
|
|
161
|
+
count,
|
|
162
|
+
first: index === 0,
|
|
163
|
+
last: index === count - 1,
|
|
164
|
+
active: this.isTabActive(index)
|
|
157
165
|
}
|
|
158
166
|
};
|
|
159
167
|
|
|
160
|
-
return
|
|
168
|
+
return mergeProps(this.ptm(`tab.${key}`, { tab: tabMetaData }), this.ptm(`tabpanel.${key}`, { tabpanel: tabMetaData }), this.ptm(`tabpanel.${key}`, tabMetaData), this.ptmo(this.getTabProp(tab, 'pt'), key, tabMetaData));
|
|
161
169
|
},
|
|
162
170
|
onScroll(event) {
|
|
163
171
|
this.scrollable && this.updateButtonState();
|
package/tabview/tabview.cjs.js
CHANGED
|
@@ -4,9 +4,9 @@ var ChevronLeftIcon = require('primevue/icons/chevronleft');
|
|
|
4
4
|
var ChevronRightIcon = require('primevue/icons/chevronright');
|
|
5
5
|
var Ripple = require('primevue/ripple');
|
|
6
6
|
var utils = require('primevue/utils');
|
|
7
|
+
var vue = require('vue');
|
|
7
8
|
var BaseComponent = require('primevue/basecomponent');
|
|
8
9
|
var usestyle = require('primevue/usestyle');
|
|
9
|
-
var vue = require('vue');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
@@ -106,12 +106,6 @@ var script$1 = {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
|
|
110
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
111
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
112
|
-
function _defineProperty$1(obj, key, value) { key = _toPropertyKey$1(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
113
|
-
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
114
|
-
function _toPrimitive$1(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
115
109
|
var script = {
|
|
116
110
|
name: 'TabView',
|
|
117
111
|
"extends": script$1,
|
|
@@ -163,6 +157,7 @@ var script = {
|
|
|
163
157
|
return "".concat(this.id, "_").concat(index, "_content");
|
|
164
158
|
},
|
|
165
159
|
getTabPT: function getTabPT(tab, key, index) {
|
|
160
|
+
var count = this.tabs.length;
|
|
166
161
|
var tabMetaData = {
|
|
167
162
|
props: tab.props,
|
|
168
163
|
parent: {
|
|
@@ -170,12 +165,18 @@ var script = {
|
|
|
170
165
|
state: this.$data
|
|
171
166
|
},
|
|
172
167
|
context: {
|
|
173
|
-
index: index
|
|
168
|
+
index: index,
|
|
169
|
+
count: count,
|
|
170
|
+
first: index === 0,
|
|
171
|
+
last: index === count - 1,
|
|
172
|
+
active: this.isTabActive(index)
|
|
174
173
|
}
|
|
175
174
|
};
|
|
176
|
-
return
|
|
175
|
+
return vue.mergeProps(this.ptm("tab.".concat(key), {
|
|
177
176
|
tab: tabMetaData
|
|
178
|
-
})
|
|
177
|
+
}), this.ptm("tabpanel.".concat(key), {
|
|
178
|
+
tabpanel: tabMetaData
|
|
179
|
+
}), this.ptm("tabpanel.".concat(key), tabMetaData), this.ptmo(this.getTabProp(tab, 'pt'), key, tabMetaData));
|
|
179
180
|
},
|
|
180
181
|
onScroll: function onScroll(event) {
|
|
181
182
|
this.scrollable && this.updateButtonState();
|
|
@@ -399,7 +400,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
399
400
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
400
401
|
return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments);
|
|
401
402
|
})
|
|
402
|
-
}, _objectSpread(_objectSpread({}, _ctx.previousButtonProps), _ctx.ptm('previousButton'))
|
|
403
|
+
}, _objectSpread(_objectSpread({}, _ctx.previousButtonProps), _ctx.ptm('previousButton')), {
|
|
404
|
+
"data-pc-group-section": "navbutton"
|
|
405
|
+
}), [vue.renderSlot(_ctx.$slots, "previcon", {}, function () {
|
|
403
406
|
return [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prevIcon ? 'span' : 'ChevronLeftIcon'), vue.mergeProps({
|
|
404
407
|
"aria-hidden": "true",
|
|
405
408
|
"class": _ctx.prevIcon
|
|
@@ -422,13 +425,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
422
425
|
tab: tab,
|
|
423
426
|
index: index
|
|
424
427
|
}),
|
|
425
|
-
role: "presentation"
|
|
428
|
+
role: "presentation"
|
|
429
|
+
}, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'headerProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'header', index)), {
|
|
426
430
|
"data-pc-name": "tabpanel",
|
|
427
431
|
"data-p-highlight": $data.d_activeIndex === index,
|
|
428
432
|
"data-p-disabled": $options.getTabProp(tab, 'disabled'),
|
|
429
433
|
"data-pc-index": index,
|
|
430
434
|
"data-p-active": $data.d_activeIndex === index
|
|
431
|
-
}
|
|
435
|
+
}), [vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({
|
|
432
436
|
id: $options.getTabHeaderActionId(index),
|
|
433
437
|
"class": _ctx.cx('tab.headerAction'),
|
|
434
438
|
tabindex: $options.getTabProp(tab, 'disabled') || !$options.isTabActive(index) ? -1 : _ctx.tabindex,
|
|
@@ -463,7 +467,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
463
467
|
onClick: _cache[2] || (_cache[2] = function () {
|
|
464
468
|
return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments);
|
|
465
469
|
})
|
|
466
|
-
}, _objectSpread(_objectSpread({}, _ctx.nextButtonProps), _ctx.ptm('nextButton'))
|
|
470
|
+
}, _objectSpread(_objectSpread({}, _ctx.nextButtonProps), _ctx.ptm('nextButton')), {
|
|
471
|
+
"data-pc-group-section": "navbutton"
|
|
472
|
+
}), [vue.renderSlot(_ctx.$slots, "nexticon", {}, function () {
|
|
467
473
|
return [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.nextIcon ? 'span' : 'ChevronRightIcon'), vue.mergeProps({
|
|
468
474
|
"aria-hidden": "true",
|
|
469
475
|
"class": _ctx.nextIcon
|
|
@@ -480,11 +486,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
480
486
|
tab: tab
|
|
481
487
|
}),
|
|
482
488
|
role: "tabpanel",
|
|
483
|
-
"aria-labelledby": $options.getTabHeaderActionId(index)
|
|
489
|
+
"aria-labelledby": $options.getTabHeaderActionId(index)
|
|
490
|
+
}, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'contentProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'content', index)), {
|
|
484
491
|
"data-pc-name": "tabpanel",
|
|
485
492
|
"data-pc-index": index,
|
|
486
493
|
"data-p-active": $data.d_activeIndex === index
|
|
487
|
-
}
|
|
494
|
+
}), [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tab)))], 16, _hoisted_5)), [[vue.vShow, _ctx.lazy ? true : $options.isTabActive(index)]]) : vue.createCommentVNode("", true)], 64);
|
|
488
495
|
}), 128))], 16)], 16);
|
|
489
496
|
}
|
|
490
497
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/icons/chevronleft"),t=require("primevue/icons/chevronright"),n=require("primevue/ripple"),r=require("primevue/utils"),a=require("primevue/basecomponent"),i=require("primevue/usestyle"),o=require("vue");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),s=c(t),d=c(n),p=c(a),u=i.useStyle("\n.p-tabview-nav-container {\n position: relative;\n}\n\n.p-tabview-scrollable .p-tabview-nav-container {\n overflow: hidden;\n}\n\n.p-tabview-nav-content {\n overflow-x: auto;\n overflow-y: hidden;\n scroll-behavior: smooth;\n scrollbar-width: none;\n overscroll-behavior: contain auto;\n}\n\n.p-tabview-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex: 1 1 auto;\n}\n\n.p-tabview-header-action {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n overflow: hidden;\n}\n\n.p-tabview-ink-bar {\n display: none;\n z-index: 1;\n}\n\n.p-tabview-header-action:focus {\n z-index: 1;\n}\n\n.p-tabview-title {\n line-height: 1;\n white-space: nowrap;\n}\n\n.p-tabview-nav-btn {\n position: absolute;\n top: 0;\n z-index: 2;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-tabview-nav-prev {\n left: 0;\n}\n\n.p-tabview-nav-next {\n right: 0;\n}\n\n.p-tabview-nav-content::-webkit-scrollbar {\n display: none;\n}\n",{name:"tabview",manual:!0});function b(e){return b="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},b(e)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){var t=g(e,"string");return"symbol"===b(t)?t:String(t)}function g(e,t){if("object"!==b(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var y={name:"TabView",extends:{name:"BaseTabView",extends:p.default,props:{activeIndex:{type:Number,default:0},lazy:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},tabindex:{type:Number,default:0},selectOnFocus:{type:Boolean,default:!1},previousButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null},prevIcon:{type:String,default:void 0},nextIcon:{type:String,default:void 0}},css:{classes:{root:function(e){return["p-tabview p-component",{"p-tabview-scrollable":e.props.scrollable}]},navContainer:"p-tabview-nav-container",previousButton:"p-tabview-nav-prev p-tabview-nav-btn p-link",navContent:"p-tabview-nav-content",nav:"p-tabview-nav",tab:{header:function(e){var t=e.instance,n=e.tab,r=e.index;return["p-tabview-header",t.getTabProp(n,"headerClass"),{"p-highlight":t.d_activeIndex===r,"p-disabled":t.getTabProp(n,"disabled")}]},headerAction:"p-tabview-nav-link p-tabview-header-action",headerTitle:"p-tabview-title",content:function(e){return["p-tabview-panel",e.instance.getTabProp(e.tab,"contentClass")]}},inkbar:"p-tabview-ink-bar",nextButton:"p-tabview-nav-next p-tabview-nav-btn p-link",panelContainer:"p-tabview-panels"},loadStyle:u.load},provide:function(){return{$parentInstance:this}}},emits:["update:activeIndex","tab-change","tab-click"],data:function(){return{id:this.$attrs.id,d_activeIndex:this.activeIndex,isPrevButtonDisabled:!0,isNextButtonDisabled:!1}},watch:{"$attrs.id":function(e){this.id=e||r.UniqueComponentId()},activeIndex:function(e){this.d_activeIndex=e,this.scrollInView({index:e})}},mounted:function(){this.id=this.id||r.UniqueComponentId(),this.updateInkBar(),this.scrollable&&this.updateButtonState()},updated:function(){this.updateInkBar()},methods:{isTabPanel:function(e){return"TabPanel"===e.type.name},isTabActive:function(e){return this.d_activeIndex===e},getTabProp:function(e,t){return e.props?e.props[t]:void 0},getKey:function(e,t){return this.getTabProp(e,"header")||t},getTabHeaderActionId:function(e){return"".concat(this.id,"_").concat(e,"_header_action")},getTabContentId:function(e){return"".concat(this.id,"_").concat(e,"_content")},getTabPT:function(e,t,n){var r={props:e.props,parent:{props:this.$props,state:this.$data},context:{index:n}};return f(f({},this.ptm("tab.".concat(t),{tab:r})),this.ptmo(this.getTabProp(e,"pt"),t,r))},onScroll:function(e){this.scrollable&&this.updateButtonState(),e.preventDefault()},onPrevButtonClick:function(){var e=this.$refs.content,t=r.DomHandler.getWidth(e),n=e.scrollLeft-t;e.scrollLeft=n<=0?0:n},onNextButtonClick:function(){var e=this.$refs.content,t=r.DomHandler.getWidth(e)-this.getVisibleButtonWidths(),n=e.scrollLeft+t,a=e.scrollWidth-t;e.scrollLeft=n>=a?a:n},onTabClick:function(e,t,n){this.changeActiveIndex(e,t,n),this.$emit("tab-click",{originalEvent:e,index:n})},onTabKeyDown:function(e,t,n){switch(e.code){case"ArrowLeft":this.onTabArrowLeftKey(e);break;case"ArrowRight":this.onTabArrowRightKey(e);break;case"Home":this.onTabHomeKey(e);break;case"End":this.onTabEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onTabEnterKey(e,t,n)}},onTabArrowRightKey:function(e){var t=this.findNextHeaderAction(e.target.parentElement);t?this.changeFocusedTab(e,t):this.onTabHomeKey(e),e.preventDefault()},onTabArrowLeftKey:function(e){var t=this.findPrevHeaderAction(e.target.parentElement);t?this.changeFocusedTab(e,t):this.onTabEndKey(e),e.preventDefault()},onTabHomeKey:function(e){var t=this.findFirstHeaderAction();this.changeFocusedTab(e,t),e.preventDefault()},onTabEndKey:function(e){var t=this.findLastHeaderAction();this.changeFocusedTab(e,t),e.preventDefault()},onPageDownKey:function(e){this.scrollInView({index:this.$refs.nav.children.length-2}),e.preventDefault()},onPageUpKey:function(e){this.scrollInView({index:0}),e.preventDefault()},onTabEnterKey:function(e,t,n){this.changeActiveIndex(e,t,n),e.preventDefault()},findNextHeaderAction:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:e.nextElementSibling;return t?r.DomHandler.getAttribute(t,"data-p-disabled")||"inkbar"===r.DomHandler.getAttribute(t,"data-pc-section")?this.findNextHeaderAction(t):r.DomHandler.findSingle(t,'[data-pc-section="headeraction"]'):null},findPrevHeaderAction:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:e.previousElementSibling;return t?r.DomHandler.getAttribute(t,"data-p-disabled")||"inkbar"===r.DomHandler.getAttribute(t,"data-pc-section")?this.findPrevHeaderAction(t):r.DomHandler.findSingle(t,'[data-pc-section="headeraction"]'):null},findFirstHeaderAction:function(){return this.findNextHeaderAction(this.$refs.nav.firstElementChild,!0)},findLastHeaderAction:function(){return this.findPrevHeaderAction(this.$refs.nav.lastElementChild,!0)},changeActiveIndex:function(e,t,n){this.getTabProp(t,"disabled")||this.d_activeIndex===n||(this.d_activeIndex=n,this.$emit("update:activeIndex",n),this.$emit("tab-change",{originalEvent:e,index:n}),this.scrollInView({index:n}))},changeFocusedTab:function(e,t){if(t&&(r.DomHandler.focus(t),this.scrollInView({element:t}),this.selectOnFocus)){var n=parseInt(t.parentElement.dataset.index,10);this.changeActiveIndex(e,this.tabs[n],n)}},scrollInView:function(e){var t=e.index,n=e.element||this.$refs.nav.children[void 0===t?-1:t];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})},updateInkBar:function(){var e=this.$refs.nav.children[this.d_activeIndex];this.$refs.inkbar.style.width=r.DomHandler.getWidth(e)+"px",this.$refs.inkbar.style.left=r.DomHandler.getOffset(e).left-r.DomHandler.getOffset(this.$refs.nav).left+"px"},updateButtonState:function(){var e=this.$refs.content,t=e.scrollLeft,n=e.scrollWidth,a=r.DomHandler.getWidth(e);this.isPrevButtonDisabled=0===t,this.isNextButtonDisabled=parseInt(t)===n-a},getVisibleButtonWidths:function(){var e=this.$refs;return[e.prevBtn,e.nextBtn].reduce((function(e,t){return t?e+r.DomHandler.getWidth(t):e}),0)}},computed:{tabs:function(){var e=this;return this.$slots.default().reduce((function(t,n){return e.isTabPanel(n)?t.push(n):n.children&&n.children instanceof Array&&n.children.forEach((function(n){e.isTabPanel(n)&&t.push(n)})),t}),[])},prevButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.previous:void 0},nextButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.next:void 0}},directives:{ripple:d.default},components:{ChevronLeftIcon:l.default,ChevronRightIcon:s.default}};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){var t=B(e,"string");return"symbol"===x(t)?t:String(t)}function B(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var I=["tabindex","aria-label"],D=["data-p-highlight","data-p-disabled","data-pc-index","data-p-active"],A=["id","tabindex","aria-disabled","aria-selected","aria-controls","onClick","onKeydown"],C=["tabindex","aria-label"],S=["aria-labelledby","data-pc-index","data-p-active"];y.render=function(e,t,n,r,a,i){var c=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("div",o.mergeProps({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"tabview"}),[o.createElementVNode("div",o.mergeProps({class:e.cx("navContainer")},e.ptm("navContainer")),[e.scrollable&&!a.isPrevButtonDisabled?o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({key:0,ref:"prevBtn",type:"button",class:e.cx("previousButton"),tabindex:e.tabindex,"aria-label":i.prevButtonAriaLabel,onClick:t[0]||(t[0]=function(){return i.onPrevButtonClick&&i.onPrevButtonClick.apply(i,arguments)})},P(P({},e.previousButtonProps),e.ptm("previousButton"))),[o.renderSlot(e.$slots,"previcon",{},(function(){return[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.prevIcon?"span":"ChevronLeftIcon"),o.mergeProps({"aria-hidden":"true",class:e.prevIcon},e.ptm("previousIcon")),null,16,["class"]))]}))],16,I)),[[c]]):o.createCommentVNode("",!0),o.createElementVNode("div",o.mergeProps({ref:"content",class:e.cx("navContent"),onScroll:t[1]||(t[1]=function(){return i.onScroll&&i.onScroll.apply(i,arguments)})},e.ptm("navContent")),[o.createElementVNode("ul",o.mergeProps({ref:"nav",class:e.cx("nav"),role:"tablist"},e.ptm("nav")),[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tabs,(function(t,n){return o.openBlock(),o.createElementBlock("li",o.mergeProps({key:i.getKey(t,n),style:i.getTabProp(t,"headerStyle"),class:e.cx("tab.header",{tab:t,index:n}),role:"presentation","data-pc-name":"tabpanel","data-p-highlight":a.d_activeIndex===n,"data-p-disabled":i.getTabProp(t,"disabled"),"data-pc-index":n,"data-p-active":a.d_activeIndex===n},P(P(P({},i.getTabProp(t,"headerProps")),i.getTabPT(t,"root",n)),i.getTabPT(t,"header",n))),[o.withDirectives((o.openBlock(),o.createElementBlock("a",o.mergeProps({id:i.getTabHeaderActionId(n),class:e.cx("tab.headerAction"),tabindex:i.getTabProp(t,"disabled")||!i.isTabActive(n)?-1:e.tabindex,role:"tab","aria-disabled":i.getTabProp(t,"disabled"),"aria-selected":i.isTabActive(n),"aria-controls":i.getTabContentId(n),onClick:function(e){return i.onTabClick(e,t,n)},onKeydown:function(e){return i.onTabKeyDown(e,t,n)}},P(P({},i.getTabProp(t,"headerActionProps")),i.getTabPT(t,"headerAction",n))),[t.props&&t.props.header?(o.openBlock(),o.createElementBlock("span",o.mergeProps({key:0,class:e.cx("tab.headerTitle")},i.getTabPT(t,"headerTitle",n)),o.toDisplayString(t.props.header),17)):o.createCommentVNode("",!0),t.children&&t.children.header?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.children.header),{key:1})):o.createCommentVNode("",!0)],16,A)),[[c]])],16,D)})),128)),o.createElementVNode("li",o.mergeProps({ref:"inkbar",class:e.cx("inkbar"),role:"presentation","aria-hidden":"true"},e.ptm("inkbar")),null,16)],16)],16),e.scrollable&&!a.isNextButtonDisabled?o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({key:1,ref:"nextBtn",type:"button",class:e.cx("nextButton"),tabindex:e.tabindex,"aria-label":i.nextButtonAriaLabel,onClick:t[2]||(t[2]=function(){return i.onNextButtonClick&&i.onNextButtonClick.apply(i,arguments)})},P(P({},e.nextButtonProps),e.ptm("nextButton"))),[o.renderSlot(e.$slots,"nexticon",{},(function(){return[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.nextIcon?"span":"ChevronRightIcon"),o.mergeProps({"aria-hidden":"true",class:e.nextIcon},e.ptm("nextIcon")),null,16,["class"]))]}))],16,C)),[[c]]):o.createCommentVNode("",!0)],16),o.createElementVNode("div",o.mergeProps({class:e.cx("panelContainer")},e.ptm("panelContainer")),[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tabs,(function(t,n){return o.openBlock(),o.createElementBlock(o.Fragment,{key:i.getKey(t,n)},[!e.lazy||i.isTabActive(n)?o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,style:i.getTabProp(t,"contentStyle"),class:e.cx("tab.content",{tab:t}),role:"tabpanel","aria-labelledby":i.getTabHeaderActionId(n),"data-pc-name":"tabpanel","data-pc-index":n,"data-p-active":a.d_activeIndex===n},P(P(P({},i.getTabProp(t,"contentProps")),i.getTabPT(t,"root",n)),i.getTabPT(t,"content",n))),[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t)))],16,S)),[[o.vShow,!!e.lazy||i.isTabActive(n)]]):o.createCommentVNode("",!0)],64)})),128))],16)],16)},module.exports=y;
|
|
1
|
+
"use strict";var e=require("primevue/icons/chevronleft"),t=require("primevue/icons/chevronright"),n=require("primevue/ripple"),a=require("primevue/utils"),i=require("vue"),r=require("primevue/basecomponent"),o=require("primevue/usestyle");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),s=c(t),d=c(n),p=c(r),u=o.useStyle("\n.p-tabview-nav-container {\n position: relative;\n}\n\n.p-tabview-scrollable .p-tabview-nav-container {\n overflow: hidden;\n}\n\n.p-tabview-nav-content {\n overflow-x: auto;\n overflow-y: hidden;\n scroll-behavior: smooth;\n scrollbar-width: none;\n overscroll-behavior: contain auto;\n}\n\n.p-tabview-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex: 1 1 auto;\n}\n\n.p-tabview-header-action {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n overflow: hidden;\n}\n\n.p-tabview-ink-bar {\n display: none;\n z-index: 1;\n}\n\n.p-tabview-header-action:focus {\n z-index: 1;\n}\n\n.p-tabview-title {\n line-height: 1;\n white-space: nowrap;\n}\n\n.p-tabview-nav-btn {\n position: absolute;\n top: 0;\n z-index: 2;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-tabview-nav-prev {\n left: 0;\n}\n\n.p-tabview-nav-next {\n right: 0;\n}\n\n.p-tabview-nav-content::-webkit-scrollbar {\n display: none;\n}\n",{name:"tabview",manual:!0}),b={name:"TabView",extends:{name:"BaseTabView",extends:p.default,props:{activeIndex:{type:Number,default:0},lazy:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},tabindex:{type:Number,default:0},selectOnFocus:{type:Boolean,default:!1},previousButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null},prevIcon:{type:String,default:void 0},nextIcon:{type:String,default:void 0}},css:{classes:{root:function(e){return["p-tabview p-component",{"p-tabview-scrollable":e.props.scrollable}]},navContainer:"p-tabview-nav-container",previousButton:"p-tabview-nav-prev p-tabview-nav-btn p-link",navContent:"p-tabview-nav-content",nav:"p-tabview-nav",tab:{header:function(e){var t=e.instance,n=e.tab,a=e.index;return["p-tabview-header",t.getTabProp(n,"headerClass"),{"p-highlight":t.d_activeIndex===a,"p-disabled":t.getTabProp(n,"disabled")}]},headerAction:"p-tabview-nav-link p-tabview-header-action",headerTitle:"p-tabview-title",content:function(e){return["p-tabview-panel",e.instance.getTabProp(e.tab,"contentClass")]}},inkbar:"p-tabview-ink-bar",nextButton:"p-tabview-nav-next p-tabview-nav-btn p-link",panelContainer:"p-tabview-panels"},loadStyle:u.load},provide:function(){return{$parentInstance:this}}},emits:["update:activeIndex","tab-change","tab-click"],data:function(){return{id:this.$attrs.id,d_activeIndex:this.activeIndex,isPrevButtonDisabled:!0,isNextButtonDisabled:!1}},watch:{"$attrs.id":function(e){this.id=e||a.UniqueComponentId()},activeIndex:function(e){this.d_activeIndex=e,this.scrollInView({index:e})}},mounted:function(){this.id=this.id||a.UniqueComponentId(),this.updateInkBar(),this.scrollable&&this.updateButtonState()},updated:function(){this.updateInkBar()},methods:{isTabPanel:function(e){return"TabPanel"===e.type.name},isTabActive:function(e){return this.d_activeIndex===e},getTabProp:function(e,t){return e.props?e.props[t]:void 0},getKey:function(e,t){return this.getTabProp(e,"header")||t},getTabHeaderActionId:function(e){return"".concat(this.id,"_").concat(e,"_header_action")},getTabContentId:function(e){return"".concat(this.id,"_").concat(e,"_content")},getTabPT:function(e,t,n){var a=this.tabs.length,r={props:e.props,parent:{props:this.$props,state:this.$data},context:{index:n,count:a,first:0===n,last:n===a-1,active:this.isTabActive(n)}};return i.mergeProps(this.ptm("tab.".concat(t),{tab:r}),this.ptm("tabpanel.".concat(t),{tabpanel:r}),this.ptm("tabpanel.".concat(t),r),this.ptmo(this.getTabProp(e,"pt"),t,r))},onScroll:function(e){this.scrollable&&this.updateButtonState(),e.preventDefault()},onPrevButtonClick:function(){var e=this.$refs.content,t=a.DomHandler.getWidth(e),n=e.scrollLeft-t;e.scrollLeft=n<=0?0:n},onNextButtonClick:function(){var e=this.$refs.content,t=a.DomHandler.getWidth(e)-this.getVisibleButtonWidths(),n=e.scrollLeft+t,i=e.scrollWidth-t;e.scrollLeft=n>=i?i:n},onTabClick:function(e,t,n){this.changeActiveIndex(e,t,n),this.$emit("tab-click",{originalEvent:e,index:n})},onTabKeyDown:function(e,t,n){switch(e.code){case"ArrowLeft":this.onTabArrowLeftKey(e);break;case"ArrowRight":this.onTabArrowRightKey(e);break;case"Home":this.onTabHomeKey(e);break;case"End":this.onTabEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onTabEnterKey(e,t,n)}},onTabArrowRightKey:function(e){var t=this.findNextHeaderAction(e.target.parentElement);t?this.changeFocusedTab(e,t):this.onTabHomeKey(e),e.preventDefault()},onTabArrowLeftKey:function(e){var t=this.findPrevHeaderAction(e.target.parentElement);t?this.changeFocusedTab(e,t):this.onTabEndKey(e),e.preventDefault()},onTabHomeKey:function(e){var t=this.findFirstHeaderAction();this.changeFocusedTab(e,t),e.preventDefault()},onTabEndKey:function(e){var t=this.findLastHeaderAction();this.changeFocusedTab(e,t),e.preventDefault()},onPageDownKey:function(e){this.scrollInView({index:this.$refs.nav.children.length-2}),e.preventDefault()},onPageUpKey:function(e){this.scrollInView({index:0}),e.preventDefault()},onTabEnterKey:function(e,t,n){this.changeActiveIndex(e,t,n),e.preventDefault()},findNextHeaderAction:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:e.nextElementSibling;return t?a.DomHandler.getAttribute(t,"data-p-disabled")||"inkbar"===a.DomHandler.getAttribute(t,"data-pc-section")?this.findNextHeaderAction(t):a.DomHandler.findSingle(t,'[data-pc-section="headeraction"]'):null},findPrevHeaderAction:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:e.previousElementSibling;return t?a.DomHandler.getAttribute(t,"data-p-disabled")||"inkbar"===a.DomHandler.getAttribute(t,"data-pc-section")?this.findPrevHeaderAction(t):a.DomHandler.findSingle(t,'[data-pc-section="headeraction"]'):null},findFirstHeaderAction:function(){return this.findNextHeaderAction(this.$refs.nav.firstElementChild,!0)},findLastHeaderAction:function(){return this.findPrevHeaderAction(this.$refs.nav.lastElementChild,!0)},changeActiveIndex:function(e,t,n){this.getTabProp(t,"disabled")||this.d_activeIndex===n||(this.d_activeIndex=n,this.$emit("update:activeIndex",n),this.$emit("tab-change",{originalEvent:e,index:n}),this.scrollInView({index:n}))},changeFocusedTab:function(e,t){if(t&&(a.DomHandler.focus(t),this.scrollInView({element:t}),this.selectOnFocus)){var n=parseInt(t.parentElement.dataset.index,10);this.changeActiveIndex(e,this.tabs[n],n)}},scrollInView:function(e){var t=e.index,n=e.element||this.$refs.nav.children[void 0===t?-1:t];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})},updateInkBar:function(){var e=this.$refs.nav.children[this.d_activeIndex];this.$refs.inkbar.style.width=a.DomHandler.getWidth(e)+"px",this.$refs.inkbar.style.left=a.DomHandler.getOffset(e).left-a.DomHandler.getOffset(this.$refs.nav).left+"px"},updateButtonState:function(){var e=this.$refs.content,t=e.scrollLeft,n=e.scrollWidth,i=a.DomHandler.getWidth(e);this.isPrevButtonDisabled=0===t,this.isNextButtonDisabled=parseInt(t)===n-i},getVisibleButtonWidths:function(){var e=this.$refs;return[e.prevBtn,e.nextBtn].reduce((function(e,t){return t?e+a.DomHandler.getWidth(t):e}),0)}},computed:{tabs:function(){var e=this;return this.$slots.default().reduce((function(t,n){return e.isTabPanel(n)?t.push(n):n.children&&n.children instanceof Array&&n.children.forEach((function(n){e.isTabPanel(n)&&t.push(n)})),t}),[])},prevButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.previous:void 0},nextButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.next:void 0}},directives:{ripple:d.default},components:{ChevronLeftIcon:l.default,ChevronRightIcon:s.default}};function v(e){return v="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},v(e)}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=y(e,"string");return"symbol"===v(t)?t:String(t)}function y(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!==v(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var x=["tabindex","aria-label"],w=["data-p-highlight","data-p-disabled","data-pc-index","data-p-active"],P=["id","tabindex","aria-disabled","aria-selected","aria-controls","onClick","onKeydown"],k=["tabindex","aria-label"],T=["aria-labelledby","data-pc-index","data-p-active"];b.render=function(e,t,n,a,r,o){var c=i.resolveDirective("ripple");return i.openBlock(),i.createElementBlock("div",i.mergeProps({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"tabview"}),[i.createElementVNode("div",i.mergeProps({class:e.cx("navContainer")},e.ptm("navContainer")),[e.scrollable&&!r.isPrevButtonDisabled?i.withDirectives((i.openBlock(),i.createElementBlock("button",i.mergeProps({key:0,ref:"prevBtn",type:"button",class:e.cx("previousButton"),tabindex:e.tabindex,"aria-label":o.prevButtonAriaLabel,onClick:t[0]||(t[0]=function(){return o.onPrevButtonClick&&o.onPrevButtonClick.apply(o,arguments)})},f(f({},e.previousButtonProps),e.ptm("previousButton")),{"data-pc-group-section":"navbutton"}),[i.renderSlot(e.$slots,"previcon",{},(function(){return[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.prevIcon?"span":"ChevronLeftIcon"),i.mergeProps({"aria-hidden":"true",class:e.prevIcon},e.ptm("previousIcon")),null,16,["class"]))]}))],16,x)),[[c]]):i.createCommentVNode("",!0),i.createElementVNode("div",i.mergeProps({ref:"content",class:e.cx("navContent"),onScroll:t[1]||(t[1]=function(){return o.onScroll&&o.onScroll.apply(o,arguments)})},e.ptm("navContent")),[i.createElementVNode("ul",i.mergeProps({ref:"nav",class:e.cx("nav"),role:"tablist"},e.ptm("nav")),[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.tabs,(function(t,n){return i.openBlock(),i.createElementBlock("li",i.mergeProps({key:o.getKey(t,n),style:o.getTabProp(t,"headerStyle"),class:e.cx("tab.header",{tab:t,index:n}),role:"presentation"},f(f(f({},o.getTabProp(t,"headerProps")),o.getTabPT(t,"root",n)),o.getTabPT(t,"header",n)),{"data-pc-name":"tabpanel","data-p-highlight":r.d_activeIndex===n,"data-p-disabled":o.getTabProp(t,"disabled"),"data-pc-index":n,"data-p-active":r.d_activeIndex===n}),[i.withDirectives((i.openBlock(),i.createElementBlock("a",i.mergeProps({id:o.getTabHeaderActionId(n),class:e.cx("tab.headerAction"),tabindex:o.getTabProp(t,"disabled")||!o.isTabActive(n)?-1:e.tabindex,role:"tab","aria-disabled":o.getTabProp(t,"disabled"),"aria-selected":o.isTabActive(n),"aria-controls":o.getTabContentId(n),onClick:function(e){return o.onTabClick(e,t,n)},onKeydown:function(e){return o.onTabKeyDown(e,t,n)}},f(f({},o.getTabProp(t,"headerActionProps")),o.getTabPT(t,"headerAction",n))),[t.props&&t.props.header?(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:0,class:e.cx("tab.headerTitle")},o.getTabPT(t,"headerTitle",n)),i.toDisplayString(t.props.header),17)):i.createCommentVNode("",!0),t.children&&t.children.header?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.children.header),{key:1})):i.createCommentVNode("",!0)],16,P)),[[c]])],16,w)})),128)),i.createElementVNode("li",i.mergeProps({ref:"inkbar",class:e.cx("inkbar"),role:"presentation","aria-hidden":"true"},e.ptm("inkbar")),null,16)],16)],16),e.scrollable&&!r.isNextButtonDisabled?i.withDirectives((i.openBlock(),i.createElementBlock("button",i.mergeProps({key:1,ref:"nextBtn",type:"button",class:e.cx("nextButton"),tabindex:e.tabindex,"aria-label":o.nextButtonAriaLabel,onClick:t[2]||(t[2]=function(){return o.onNextButtonClick&&o.onNextButtonClick.apply(o,arguments)})},f(f({},e.nextButtonProps),e.ptm("nextButton")),{"data-pc-group-section":"navbutton"}),[i.renderSlot(e.$slots,"nexticon",{},(function(){return[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.nextIcon?"span":"ChevronRightIcon"),i.mergeProps({"aria-hidden":"true",class:e.nextIcon},e.ptm("nextIcon")),null,16,["class"]))]}))],16,k)),[[c]]):i.createCommentVNode("",!0)],16),i.createElementVNode("div",i.mergeProps({class:e.cx("panelContainer")},e.ptm("panelContainer")),[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.tabs,(function(t,n){return i.openBlock(),i.createElementBlock(i.Fragment,{key:o.getKey(t,n)},[!e.lazy||o.isTabActive(n)?i.withDirectives((i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,style:o.getTabProp(t,"contentStyle"),class:e.cx("tab.content",{tab:t}),role:"tabpanel","aria-labelledby":o.getTabHeaderActionId(n)},f(f(f({},o.getTabProp(t,"contentProps")),o.getTabPT(t,"root",n)),o.getTabPT(t,"content",n)),{"data-pc-name":"tabpanel","data-pc-index":n,"data-p-active":r.d_activeIndex===n}),[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t)))],16,T)),[[i.vShow,!!e.lazy||o.isTabActive(n)]]):i.createCommentVNode("",!0)],64)})),128))],16)],16)},module.exports=b;
|
package/tabview/tabview.esm.js
CHANGED
|
@@ -2,9 +2,9 @@ import ChevronLeftIcon from 'primevue/icons/chevronleft';
|
|
|
2
2
|
import ChevronRightIcon from 'primevue/icons/chevronright';
|
|
3
3
|
import Ripple from 'primevue/ripple';
|
|
4
4
|
import { UniqueComponentId, DomHandler } from 'primevue/utils';
|
|
5
|
+
import { mergeProps, resolveDirective, openBlock, createElementBlock, createElementVNode, withDirectives, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, toDisplayString, vShow } from 'vue';
|
|
5
6
|
import BaseComponent from 'primevue/basecomponent';
|
|
6
7
|
import { useStyle } from 'primevue/usestyle';
|
|
7
|
-
import { resolveDirective, openBlock, createElementBlock, mergeProps, createElementVNode, withDirectives, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, toDisplayString, vShow } from 'vue';
|
|
8
8
|
|
|
9
9
|
var styles = "\n.p-tabview-nav-container {\n position: relative;\n}\n\n.p-tabview-scrollable .p-tabview-nav-container {\n overflow: hidden;\n}\n\n.p-tabview-nav-content {\n overflow-x: auto;\n overflow-y: hidden;\n scroll-behavior: smooth;\n scrollbar-width: none;\n overscroll-behavior: contain auto;\n}\n\n.p-tabview-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex: 1 1 auto;\n}\n\n.p-tabview-header-action {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n overflow: hidden;\n}\n\n.p-tabview-ink-bar {\n display: none;\n z-index: 1;\n}\n\n.p-tabview-header-action:focus {\n z-index: 1;\n}\n\n.p-tabview-title {\n line-height: 1;\n white-space: nowrap;\n}\n\n.p-tabview-nav-btn {\n position: absolute;\n top: 0;\n z-index: 2;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-tabview-nav-prev {\n left: 0;\n}\n\n.p-tabview-nav-next {\n right: 0;\n}\n\n.p-tabview-nav-content::-webkit-scrollbar {\n display: none;\n}\n";
|
|
10
10
|
var classes = {
|
|
@@ -97,12 +97,6 @@ var script$1 = {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
|
|
101
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
102
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
103
|
-
function _defineProperty$1(obj, key, value) { key = _toPropertyKey$1(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
104
|
-
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
105
|
-
function _toPrimitive$1(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
106
100
|
var script = {
|
|
107
101
|
name: 'TabView',
|
|
108
102
|
"extends": script$1,
|
|
@@ -154,6 +148,7 @@ var script = {
|
|
|
154
148
|
return "".concat(this.id, "_").concat(index, "_content");
|
|
155
149
|
},
|
|
156
150
|
getTabPT: function getTabPT(tab, key, index) {
|
|
151
|
+
var count = this.tabs.length;
|
|
157
152
|
var tabMetaData = {
|
|
158
153
|
props: tab.props,
|
|
159
154
|
parent: {
|
|
@@ -161,12 +156,18 @@ var script = {
|
|
|
161
156
|
state: this.$data
|
|
162
157
|
},
|
|
163
158
|
context: {
|
|
164
|
-
index: index
|
|
159
|
+
index: index,
|
|
160
|
+
count: count,
|
|
161
|
+
first: index === 0,
|
|
162
|
+
last: index === count - 1,
|
|
163
|
+
active: this.isTabActive(index)
|
|
165
164
|
}
|
|
166
165
|
};
|
|
167
|
-
return
|
|
166
|
+
return mergeProps(this.ptm("tab.".concat(key), {
|
|
168
167
|
tab: tabMetaData
|
|
169
|
-
})
|
|
168
|
+
}), this.ptm("tabpanel.".concat(key), {
|
|
169
|
+
tabpanel: tabMetaData
|
|
170
|
+
}), this.ptm("tabpanel.".concat(key), tabMetaData), this.ptmo(this.getTabProp(tab, 'pt'), key, tabMetaData));
|
|
170
171
|
},
|
|
171
172
|
onScroll: function onScroll(event) {
|
|
172
173
|
this.scrollable && this.updateButtonState();
|
|
@@ -390,7 +391,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
390
391
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
391
392
|
return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments);
|
|
392
393
|
})
|
|
393
|
-
}, _objectSpread(_objectSpread({}, _ctx.previousButtonProps), _ctx.ptm('previousButton'))
|
|
394
|
+
}, _objectSpread(_objectSpread({}, _ctx.previousButtonProps), _ctx.ptm('previousButton')), {
|
|
395
|
+
"data-pc-group-section": "navbutton"
|
|
396
|
+
}), [renderSlot(_ctx.$slots, "previcon", {}, function () {
|
|
394
397
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon ? 'span' : 'ChevronLeftIcon'), mergeProps({
|
|
395
398
|
"aria-hidden": "true",
|
|
396
399
|
"class": _ctx.prevIcon
|
|
@@ -413,13 +416,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
413
416
|
tab: tab,
|
|
414
417
|
index: index
|
|
415
418
|
}),
|
|
416
|
-
role: "presentation"
|
|
419
|
+
role: "presentation"
|
|
420
|
+
}, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'headerProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'header', index)), {
|
|
417
421
|
"data-pc-name": "tabpanel",
|
|
418
422
|
"data-p-highlight": $data.d_activeIndex === index,
|
|
419
423
|
"data-p-disabled": $options.getTabProp(tab, 'disabled'),
|
|
420
424
|
"data-pc-index": index,
|
|
421
425
|
"data-p-active": $data.d_activeIndex === index
|
|
422
|
-
}
|
|
426
|
+
}), [withDirectives((openBlock(), createElementBlock("a", mergeProps({
|
|
423
427
|
id: $options.getTabHeaderActionId(index),
|
|
424
428
|
"class": _ctx.cx('tab.headerAction'),
|
|
425
429
|
tabindex: $options.getTabProp(tab, 'disabled') || !$options.isTabActive(index) ? -1 : _ctx.tabindex,
|
|
@@ -454,7 +458,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
454
458
|
onClick: _cache[2] || (_cache[2] = function () {
|
|
455
459
|
return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments);
|
|
456
460
|
})
|
|
457
|
-
}, _objectSpread(_objectSpread({}, _ctx.nextButtonProps), _ctx.ptm('nextButton'))
|
|
461
|
+
}, _objectSpread(_objectSpread({}, _ctx.nextButtonProps), _ctx.ptm('nextButton')), {
|
|
462
|
+
"data-pc-group-section": "navbutton"
|
|
463
|
+
}), [renderSlot(_ctx.$slots, "nexticon", {}, function () {
|
|
458
464
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon ? 'span' : 'ChevronRightIcon'), mergeProps({
|
|
459
465
|
"aria-hidden": "true",
|
|
460
466
|
"class": _ctx.nextIcon
|
|
@@ -471,11 +477,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
471
477
|
tab: tab
|
|
472
478
|
}),
|
|
473
479
|
role: "tabpanel",
|
|
474
|
-
"aria-labelledby": $options.getTabHeaderActionId(index)
|
|
480
|
+
"aria-labelledby": $options.getTabHeaderActionId(index)
|
|
481
|
+
}, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'contentProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'content', index)), {
|
|
475
482
|
"data-pc-name": "tabpanel",
|
|
476
483
|
"data-pc-index": index,
|
|
477
484
|
"data-p-active": $data.d_activeIndex === index
|
|
478
|
-
}
|
|
485
|
+
}), [(openBlock(), createBlock(resolveDynamicComponent(tab)))], 16, _hoisted_5)), [[vShow, _ctx.lazy ? true : $options.isTabActive(index)]]) : createCommentVNode("", true)], 64);
|
|
479
486
|
}), 128))], 16)], 16);
|
|
480
487
|
}
|
|
481
488
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/icons/chevronleft";import t from"primevue/icons/chevronright";import n from"primevue/ripple";import{UniqueComponentId as i,DomHandler as a}from"primevue/utils";import r from"primevue/basecomponent";import{useStyle as o}from"primevue/usestyle";import{resolveDirective as c,openBlock as l,createElementBlock as s,mergeProps as d,createElementVNode as u,withDirectives as p,renderSlot as b,createBlock as v,resolveDynamicComponent as f,createCommentVNode as h,Fragment as y,renderList as g,toDisplayString as m,vShow as x}from"vue";var w=o("\n.p-tabview-nav-container {\n position: relative;\n}\n\n.p-tabview-scrollable .p-tabview-nav-container {\n overflow: hidden;\n}\n\n.p-tabview-nav-content {\n overflow-x: auto;\n overflow-y: hidden;\n scroll-behavior: smooth;\n scrollbar-width: none;\n overscroll-behavior: contain auto;\n}\n\n.p-tabview-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex: 1 1 auto;\n}\n\n.p-tabview-header-action {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n overflow: hidden;\n}\n\n.p-tabview-ink-bar {\n display: none;\n z-index: 1;\n}\n\n.p-tabview-header-action:focus {\n z-index: 1;\n}\n\n.p-tabview-title {\n line-height: 1;\n white-space: nowrap;\n}\n\n.p-tabview-nav-btn {\n position: absolute;\n top: 0;\n z-index: 2;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-tabview-nav-prev {\n left: 0;\n}\n\n.p-tabview-nav-next {\n right: 0;\n}\n\n.p-tabview-nav-content::-webkit-scrollbar {\n display: none;\n}\n",{name:"tabview",manual:!0});function P(e){return P="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},P(e)}function T(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 I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(e,t,n){return(t=A(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){var t=B(e,"string");return"symbol"===P(t)?t:String(t)}function B(e,t){if("object"!==P(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==P(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var O={name:"TabView",extends:{name:"BaseTabView",extends:r,props:{activeIndex:{type:Number,default:0},lazy:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},tabindex:{type:Number,default:0},selectOnFocus:{type:Boolean,default:!1},previousButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null},prevIcon:{type:String,default:void 0},nextIcon:{type:String,default:void 0}},css:{classes:{root:function(e){return["p-tabview p-component",{"p-tabview-scrollable":e.props.scrollable}]},navContainer:"p-tabview-nav-container",previousButton:"p-tabview-nav-prev p-tabview-nav-btn p-link",navContent:"p-tabview-nav-content",nav:"p-tabview-nav",tab:{header:function(e){var t=e.instance,n=e.tab,i=e.index;return["p-tabview-header",t.getTabProp(n,"headerClass"),{"p-highlight":t.d_activeIndex===i,"p-disabled":t.getTabProp(n,"disabled")}]},headerAction:"p-tabview-nav-link p-tabview-header-action",headerTitle:"p-tabview-title",content:function(e){return["p-tabview-panel",e.instance.getTabProp(e.tab,"contentClass")]}},inkbar:"p-tabview-ink-bar",nextButton:"p-tabview-nav-next p-tabview-nav-btn p-link",panelContainer:"p-tabview-panels"},loadStyle:w.load},provide:function(){return{$parentInstance:this}}},emits:["update:activeIndex","tab-change","tab-click"],data:function(){return{id:this.$attrs.id,d_activeIndex:this.activeIndex,isPrevButtonDisabled:!0,isNextButtonDisabled:!1}},watch:{"$attrs.id":function(e){this.id=e||i()},activeIndex:function(e){this.d_activeIndex=e,this.scrollInView({index:e})}},mounted:function(){this.id=this.id||i(),this.updateInkBar(),this.scrollable&&this.updateButtonState()},updated:function(){this.updateInkBar()},methods:{isTabPanel:function(e){return"TabPanel"===e.type.name},isTabActive:function(e){return this.d_activeIndex===e},getTabProp:function(e,t){return e.props?e.props[t]:void 0},getKey:function(e,t){return this.getTabProp(e,"header")||t},getTabHeaderActionId:function(e){return"".concat(this.id,"_").concat(e,"_header_action")},getTabContentId:function(e){return"".concat(this.id,"_").concat(e,"_content")},getTabPT:function(e,t,n){var i={props:e.props,parent:{props:this.$props,state:this.$data},context:{index:n}};return I(I({},this.ptm("tab.".concat(t),{tab:i})),this.ptmo(this.getTabProp(e,"pt"),t,i))},onScroll:function(e){this.scrollable&&this.updateButtonState(),e.preventDefault()},onPrevButtonClick:function(){var e=this.$refs.content,t=a.getWidth(e),n=e.scrollLeft-t;e.scrollLeft=n<=0?0:n},onNextButtonClick:function(){var e=this.$refs.content,t=a.getWidth(e)-this.getVisibleButtonWidths(),n=e.scrollLeft+t,i=e.scrollWidth-t;e.scrollLeft=n>=i?i:n},onTabClick:function(e,t,n){this.changeActiveIndex(e,t,n),this.$emit("tab-click",{originalEvent:e,index:n})},onTabKeyDown:function(e,t,n){switch(e.code){case"ArrowLeft":this.onTabArrowLeftKey(e);break;case"ArrowRight":this.onTabArrowRightKey(e);break;case"Home":this.onTabHomeKey(e);break;case"End":this.onTabEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onTabEnterKey(e,t,n)}},onTabArrowRightKey:function(e){var t=this.findNextHeaderAction(e.target.parentElement);t?this.changeFocusedTab(e,t):this.onTabHomeKey(e),e.preventDefault()},onTabArrowLeftKey:function(e){var t=this.findPrevHeaderAction(e.target.parentElement);t?this.changeFocusedTab(e,t):this.onTabEndKey(e),e.preventDefault()},onTabHomeKey:function(e){var t=this.findFirstHeaderAction();this.changeFocusedTab(e,t),e.preventDefault()},onTabEndKey:function(e){var t=this.findLastHeaderAction();this.changeFocusedTab(e,t),e.preventDefault()},onPageDownKey:function(e){this.scrollInView({index:this.$refs.nav.children.length-2}),e.preventDefault()},onPageUpKey:function(e){this.scrollInView({index:0}),e.preventDefault()},onTabEnterKey:function(e,t,n){this.changeActiveIndex(e,t,n),e.preventDefault()},findNextHeaderAction:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:e.nextElementSibling;return t?a.getAttribute(t,"data-p-disabled")||"inkbar"===a.getAttribute(t,"data-pc-section")?this.findNextHeaderAction(t):a.findSingle(t,'[data-pc-section="headeraction"]'):null},findPrevHeaderAction:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:e.previousElementSibling;return t?a.getAttribute(t,"data-p-disabled")||"inkbar"===a.getAttribute(t,"data-pc-section")?this.findPrevHeaderAction(t):a.findSingle(t,'[data-pc-section="headeraction"]'):null},findFirstHeaderAction:function(){return this.findNextHeaderAction(this.$refs.nav.firstElementChild,!0)},findLastHeaderAction:function(){return this.findPrevHeaderAction(this.$refs.nav.lastElementChild,!0)},changeActiveIndex:function(e,t,n){this.getTabProp(t,"disabled")||this.d_activeIndex===n||(this.d_activeIndex=n,this.$emit("update:activeIndex",n),this.$emit("tab-change",{originalEvent:e,index:n}),this.scrollInView({index:n}))},changeFocusedTab:function(e,t){if(t&&(a.focus(t),this.scrollInView({element:t}),this.selectOnFocus)){var n=parseInt(t.parentElement.dataset.index,10);this.changeActiveIndex(e,this.tabs[n],n)}},scrollInView:function(e){var t=e.index,n=e.element||this.$refs.nav.children[void 0===t?-1:t];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})},updateInkBar:function(){var e=this.$refs.nav.children[this.d_activeIndex];this.$refs.inkbar.style.width=a.getWidth(e)+"px",this.$refs.inkbar.style.left=a.getOffset(e).left-a.getOffset(this.$refs.nav).left+"px"},updateButtonState:function(){var e=this.$refs.content,t=e.scrollLeft,n=e.scrollWidth,i=a.getWidth(e);this.isPrevButtonDisabled=0===t,this.isNextButtonDisabled=parseInt(t)===n-i},getVisibleButtonWidths:function(){var e=this.$refs;return[e.prevBtn,e.nextBtn].reduce((function(e,t){return t?e+a.getWidth(t):e}),0)}},computed:{tabs:function(){var e=this;return this.$slots.default().reduce((function(t,n){return e.isTabPanel(n)?t.push(n):n.children&&n.children instanceof Array&&n.children.forEach((function(n){e.isTabPanel(n)&&t.push(n)})),t}),[])},prevButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.previous:void 0},nextButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.next:void 0}},directives:{ripple:n},components:{ChevronLeftIcon:e,ChevronRightIcon:t}};function S(e){return S="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},S(e)}function C(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?C(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t,n){return(t=$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(e){var t=E(e,"string");return"symbol"===S(t)?t:String(t)}function E(e,t){if("object"!==S(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==S(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var K=["tabindex","aria-label"],H=["data-p-highlight","data-p-disabled","data-pc-index","data-p-active"],L=["id","tabindex","aria-disabled","aria-selected","aria-controls","onClick","onKeydown"],_=["tabindex","aria-label"],N=["aria-labelledby","data-pc-index","data-p-active"];O.render=function(e,t,n,i,a,r){var o=c("ripple");return l(),s("div",d({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"tabview"}),[u("div",d({class:e.cx("navContainer")},e.ptm("navContainer")),[e.scrollable&&!a.isPrevButtonDisabled?p((l(),s("button",d({key:0,ref:"prevBtn",type:"button",class:e.cx("previousButton"),tabindex:e.tabindex,"aria-label":r.prevButtonAriaLabel,onClick:t[0]||(t[0]=function(){return r.onPrevButtonClick&&r.onPrevButtonClick.apply(r,arguments)})},j(j({},e.previousButtonProps),e.ptm("previousButton"))),[b(e.$slots,"previcon",{},(function(){return[(l(),v(f(e.prevIcon?"span":"ChevronLeftIcon"),d({"aria-hidden":"true",class:e.prevIcon},e.ptm("previousIcon")),null,16,["class"]))]}))],16,K)),[[o]]):h("",!0),u("div",d({ref:"content",class:e.cx("navContent"),onScroll:t[1]||(t[1]=function(){return r.onScroll&&r.onScroll.apply(r,arguments)})},e.ptm("navContent")),[u("ul",d({ref:"nav",class:e.cx("nav"),role:"tablist"},e.ptm("nav")),[(l(!0),s(y,null,g(r.tabs,(function(t,n){return l(),s("li",d({key:r.getKey(t,n),style:r.getTabProp(t,"headerStyle"),class:e.cx("tab.header",{tab:t,index:n}),role:"presentation","data-pc-name":"tabpanel","data-p-highlight":a.d_activeIndex===n,"data-p-disabled":r.getTabProp(t,"disabled"),"data-pc-index":n,"data-p-active":a.d_activeIndex===n},j(j(j({},r.getTabProp(t,"headerProps")),r.getTabPT(t,"root",n)),r.getTabPT(t,"header",n))),[p((l(),s("a",d({id:r.getTabHeaderActionId(n),class:e.cx("tab.headerAction"),tabindex:r.getTabProp(t,"disabled")||!r.isTabActive(n)?-1:e.tabindex,role:"tab","aria-disabled":r.getTabProp(t,"disabled"),"aria-selected":r.isTabActive(n),"aria-controls":r.getTabContentId(n),onClick:function(e){return r.onTabClick(e,t,n)},onKeydown:function(e){return r.onTabKeyDown(e,t,n)}},j(j({},r.getTabProp(t,"headerActionProps")),r.getTabPT(t,"headerAction",n))),[t.props&&t.props.header?(l(),s("span",d({key:0,class:e.cx("tab.headerTitle")},r.getTabPT(t,"headerTitle",n)),m(t.props.header),17)):h("",!0),t.children&&t.children.header?(l(),v(f(t.children.header),{key:1})):h("",!0)],16,L)),[[o]])],16,H)})),128)),u("li",d({ref:"inkbar",class:e.cx("inkbar"),role:"presentation","aria-hidden":"true"},e.ptm("inkbar")),null,16)],16)],16),e.scrollable&&!a.isNextButtonDisabled?p((l(),s("button",d({key:1,ref:"nextBtn",type:"button",class:e.cx("nextButton"),tabindex:e.tabindex,"aria-label":r.nextButtonAriaLabel,onClick:t[2]||(t[2]=function(){return r.onNextButtonClick&&r.onNextButtonClick.apply(r,arguments)})},j(j({},e.nextButtonProps),e.ptm("nextButton"))),[b(e.$slots,"nexticon",{},(function(){return[(l(),v(f(e.nextIcon?"span":"ChevronRightIcon"),d({"aria-hidden":"true",class:e.nextIcon},e.ptm("nextIcon")),null,16,["class"]))]}))],16,_)),[[o]]):h("",!0)],16),u("div",d({class:e.cx("panelContainer")},e.ptm("panelContainer")),[(l(!0),s(y,null,g(r.tabs,(function(t,n){return l(),s(y,{key:r.getKey(t,n)},[!e.lazy||r.isTabActive(n)?p((l(),s("div",d({key:0,style:r.getTabProp(t,"contentStyle"),class:e.cx("tab.content",{tab:t}),role:"tabpanel","aria-labelledby":r.getTabHeaderActionId(n),"data-pc-name":"tabpanel","data-pc-index":n,"data-p-active":a.d_activeIndex===n},j(j(j({},r.getTabProp(t,"contentProps")),r.getTabPT(t,"root",n)),r.getTabPT(t,"content",n))),[(l(),v(f(t)))],16,N)),[[x,!!e.lazy||r.isTabActive(n)]]):h("",!0)],64)})),128))],16)],16)};export{O as default};
|
|
1
|
+
import t from"primevue/icons/chevronleft";import e from"primevue/icons/chevronright";import n from"primevue/ripple";import{UniqueComponentId as a,DomHandler as i}from"primevue/utils";import{mergeProps as r,resolveDirective as o,openBlock as c,createElementBlock as s,createElementVNode as l,withDirectives as d,renderSlot as p,createBlock as u,resolveDynamicComponent as b,createCommentVNode as v,Fragment as h,renderList as f,toDisplayString as g,vShow as x}from"vue";import y from"primevue/basecomponent";import{useStyle as m}from"primevue/usestyle";var w=m("\n.p-tabview-nav-container {\n position: relative;\n}\n\n.p-tabview-scrollable .p-tabview-nav-container {\n overflow: hidden;\n}\n\n.p-tabview-nav-content {\n overflow-x: auto;\n overflow-y: hidden;\n scroll-behavior: smooth;\n scrollbar-width: none;\n overscroll-behavior: contain auto;\n}\n\n.p-tabview-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex: 1 1 auto;\n}\n\n.p-tabview-header-action {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n overflow: hidden;\n}\n\n.p-tabview-ink-bar {\n display: none;\n z-index: 1;\n}\n\n.p-tabview-header-action:focus {\n z-index: 1;\n}\n\n.p-tabview-title {\n line-height: 1;\n white-space: nowrap;\n}\n\n.p-tabview-nav-btn {\n position: absolute;\n top: 0;\n z-index: 2;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-tabview-nav-prev {\n left: 0;\n}\n\n.p-tabview-nav-next {\n right: 0;\n}\n\n.p-tabview-nav-content::-webkit-scrollbar {\n display: none;\n}\n",{name:"tabview",manual:!0}),T={name:"TabView",extends:{name:"BaseTabView",extends:y,props:{activeIndex:{type:Number,default:0},lazy:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},tabindex:{type:Number,default:0},selectOnFocus:{type:Boolean,default:!1},previousButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null},prevIcon:{type:String,default:void 0},nextIcon:{type:String,default:void 0}},css:{classes:{root:function(t){return["p-tabview p-component",{"p-tabview-scrollable":t.props.scrollable}]},navContainer:"p-tabview-nav-container",previousButton:"p-tabview-nav-prev p-tabview-nav-btn p-link",navContent:"p-tabview-nav-content",nav:"p-tabview-nav",tab:{header:function(t){var e=t.instance,n=t.tab,a=t.index;return["p-tabview-header",e.getTabProp(n,"headerClass"),{"p-highlight":e.d_activeIndex===a,"p-disabled":e.getTabProp(n,"disabled")}]},headerAction:"p-tabview-nav-link p-tabview-header-action",headerTitle:"p-tabview-title",content:function(t){return["p-tabview-panel",t.instance.getTabProp(t.tab,"contentClass")]}},inkbar:"p-tabview-ink-bar",nextButton:"p-tabview-nav-next p-tabview-nav-btn p-link",panelContainer:"p-tabview-panels"},loadStyle:w.load},provide:function(){return{$parentInstance:this}}},emits:["update:activeIndex","tab-change","tab-click"],data:function(){return{id:this.$attrs.id,d_activeIndex:this.activeIndex,isPrevButtonDisabled:!0,isNextButtonDisabled:!1}},watch:{"$attrs.id":function(t){this.id=t||a()},activeIndex:function(t){this.d_activeIndex=t,this.scrollInView({index:t})}},mounted:function(){this.id=this.id||a(),this.updateInkBar(),this.scrollable&&this.updateButtonState()},updated:function(){this.updateInkBar()},methods:{isTabPanel:function(t){return"TabPanel"===t.type.name},isTabActive:function(t){return this.d_activeIndex===t},getTabProp:function(t,e){return t.props?t.props[e]:void 0},getKey:function(t,e){return this.getTabProp(t,"header")||e},getTabHeaderActionId:function(t){return"".concat(this.id,"_").concat(t,"_header_action")},getTabContentId:function(t){return"".concat(this.id,"_").concat(t,"_content")},getTabPT:function(t,e,n){var a=this.tabs.length,i={props:t.props,parent:{props:this.$props,state:this.$data},context:{index:n,count:a,first:0===n,last:n===a-1,active:this.isTabActive(n)}};return r(this.ptm("tab.".concat(e),{tab:i}),this.ptm("tabpanel.".concat(e),{tabpanel:i}),this.ptm("tabpanel.".concat(e),i),this.ptmo(this.getTabProp(t,"pt"),e,i))},onScroll:function(t){this.scrollable&&this.updateButtonState(),t.preventDefault()},onPrevButtonClick:function(){var t=this.$refs.content,e=i.getWidth(t),n=t.scrollLeft-e;t.scrollLeft=n<=0?0:n},onNextButtonClick:function(){var t=this.$refs.content,e=i.getWidth(t)-this.getVisibleButtonWidths(),n=t.scrollLeft+e,a=t.scrollWidth-e;t.scrollLeft=n>=a?a:n},onTabClick:function(t,e,n){this.changeActiveIndex(t,e,n),this.$emit("tab-click",{originalEvent:t,index:n})},onTabKeyDown:function(t,e,n){switch(t.code){case"ArrowLeft":this.onTabArrowLeftKey(t);break;case"ArrowRight":this.onTabArrowRightKey(t);break;case"Home":this.onTabHomeKey(t);break;case"End":this.onTabEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onTabEnterKey(t,e,n)}},onTabArrowRightKey:function(t){var e=this.findNextHeaderAction(t.target.parentElement);e?this.changeFocusedTab(t,e):this.onTabHomeKey(t),t.preventDefault()},onTabArrowLeftKey:function(t){var e=this.findPrevHeaderAction(t.target.parentElement);e?this.changeFocusedTab(t,e):this.onTabEndKey(t),t.preventDefault()},onTabHomeKey:function(t){var e=this.findFirstHeaderAction();this.changeFocusedTab(t,e),t.preventDefault()},onTabEndKey:function(t){var e=this.findLastHeaderAction();this.changeFocusedTab(t,e),t.preventDefault()},onPageDownKey:function(t){this.scrollInView({index:this.$refs.nav.children.length-2}),t.preventDefault()},onPageUpKey:function(t){this.scrollInView({index:0}),t.preventDefault()},onTabEnterKey:function(t,e,n){this.changeActiveIndex(t,e,n),t.preventDefault()},findNextHeaderAction:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t:t.nextElementSibling;return e?i.getAttribute(e,"data-p-disabled")||"inkbar"===i.getAttribute(e,"data-pc-section")?this.findNextHeaderAction(e):i.findSingle(e,'[data-pc-section="headeraction"]'):null},findPrevHeaderAction:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t:t.previousElementSibling;return e?i.getAttribute(e,"data-p-disabled")||"inkbar"===i.getAttribute(e,"data-pc-section")?this.findPrevHeaderAction(e):i.findSingle(e,'[data-pc-section="headeraction"]'):null},findFirstHeaderAction:function(){return this.findNextHeaderAction(this.$refs.nav.firstElementChild,!0)},findLastHeaderAction:function(){return this.findPrevHeaderAction(this.$refs.nav.lastElementChild,!0)},changeActiveIndex:function(t,e,n){this.getTabProp(e,"disabled")||this.d_activeIndex===n||(this.d_activeIndex=n,this.$emit("update:activeIndex",n),this.$emit("tab-change",{originalEvent:t,index:n}),this.scrollInView({index:n}))},changeFocusedTab:function(t,e){if(e&&(i.focus(e),this.scrollInView({element:e}),this.selectOnFocus)){var n=parseInt(e.parentElement.dataset.index,10);this.changeActiveIndex(t,this.tabs[n],n)}},scrollInView:function(t){var e=t.index,n=t.element||this.$refs.nav.children[void 0===e?-1:e];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})},updateInkBar:function(){var t=this.$refs.nav.children[this.d_activeIndex];this.$refs.inkbar.style.width=i.getWidth(t)+"px",this.$refs.inkbar.style.left=i.getOffset(t).left-i.getOffset(this.$refs.nav).left+"px"},updateButtonState:function(){var t=this.$refs.content,e=t.scrollLeft,n=t.scrollWidth,a=i.getWidth(t);this.isPrevButtonDisabled=0===e,this.isNextButtonDisabled=parseInt(e)===n-a},getVisibleButtonWidths:function(){var t=this.$refs;return[t.prevBtn,t.nextBtn].reduce((function(t,e){return e?t+i.getWidth(e):t}),0)}},computed:{tabs:function(){var t=this;return this.$slots.default().reduce((function(e,n){return t.isTabPanel(n)?e.push(n):n.children&&n.children instanceof Array&&n.children.forEach((function(n){t.isTabPanel(n)&&e.push(n)})),e}),[])},prevButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.previous:void 0},nextButtonAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.next:void 0}},directives:{ripple:n},components:{ChevronLeftIcon:t,ChevronRightIcon:e}};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){A(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function A(t,e,n){return(e=B(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B(t){var e=C(t,"string");return"symbol"===P(e)?e:String(e)}function C(t,e){if("object"!==P(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!==P(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var S=["tabindex","aria-label"],$=["data-p-highlight","data-p-disabled","data-pc-index","data-p-active"],D=["id","tabindex","aria-disabled","aria-selected","aria-controls","onClick","onKeydown"],K=["tabindex","aria-label"],O=["aria-labelledby","data-pc-index","data-p-active"];T.render=function(t,e,n,a,i,y){var m=o("ripple");return c(),s("div",r({class:t.cx("root")},t.ptm("root"),{"data-pc-name":"tabview"}),[l("div",r({class:t.cx("navContainer")},t.ptm("navContainer")),[t.scrollable&&!i.isPrevButtonDisabled?d((c(),s("button",r({key:0,ref:"prevBtn",type:"button",class:t.cx("previousButton"),tabindex:t.tabindex,"aria-label":y.prevButtonAriaLabel,onClick:e[0]||(e[0]=function(){return y.onPrevButtonClick&&y.onPrevButtonClick.apply(y,arguments)})},k(k({},t.previousButtonProps),t.ptm("previousButton")),{"data-pc-group-section":"navbutton"}),[p(t.$slots,"previcon",{},(function(){return[(c(),u(b(t.prevIcon?"span":"ChevronLeftIcon"),r({"aria-hidden":"true",class:t.prevIcon},t.ptm("previousIcon")),null,16,["class"]))]}))],16,S)),[[m]]):v("",!0),l("div",r({ref:"content",class:t.cx("navContent"),onScroll:e[1]||(e[1]=function(){return y.onScroll&&y.onScroll.apply(y,arguments)})},t.ptm("navContent")),[l("ul",r({ref:"nav",class:t.cx("nav"),role:"tablist"},t.ptm("nav")),[(c(!0),s(h,null,f(y.tabs,(function(e,n){return c(),s("li",r({key:y.getKey(e,n),style:y.getTabProp(e,"headerStyle"),class:t.cx("tab.header",{tab:e,index:n}),role:"presentation"},k(k(k({},y.getTabProp(e,"headerProps")),y.getTabPT(e,"root",n)),y.getTabPT(e,"header",n)),{"data-pc-name":"tabpanel","data-p-highlight":i.d_activeIndex===n,"data-p-disabled":y.getTabProp(e,"disabled"),"data-pc-index":n,"data-p-active":i.d_activeIndex===n}),[d((c(),s("a",r({id:y.getTabHeaderActionId(n),class:t.cx("tab.headerAction"),tabindex:y.getTabProp(e,"disabled")||!y.isTabActive(n)?-1:t.tabindex,role:"tab","aria-disabled":y.getTabProp(e,"disabled"),"aria-selected":y.isTabActive(n),"aria-controls":y.getTabContentId(n),onClick:function(t){return y.onTabClick(t,e,n)},onKeydown:function(t){return y.onTabKeyDown(t,e,n)}},k(k({},y.getTabProp(e,"headerActionProps")),y.getTabPT(e,"headerAction",n))),[e.props&&e.props.header?(c(),s("span",r({key:0,class:t.cx("tab.headerTitle")},y.getTabPT(e,"headerTitle",n)),g(e.props.header),17)):v("",!0),e.children&&e.children.header?(c(),u(b(e.children.header),{key:1})):v("",!0)],16,D)),[[m]])],16,$)})),128)),l("li",r({ref:"inkbar",class:t.cx("inkbar"),role:"presentation","aria-hidden":"true"},t.ptm("inkbar")),null,16)],16)],16),t.scrollable&&!i.isNextButtonDisabled?d((c(),s("button",r({key:1,ref:"nextBtn",type:"button",class:t.cx("nextButton"),tabindex:t.tabindex,"aria-label":y.nextButtonAriaLabel,onClick:e[2]||(e[2]=function(){return y.onNextButtonClick&&y.onNextButtonClick.apply(y,arguments)})},k(k({},t.nextButtonProps),t.ptm("nextButton")),{"data-pc-group-section":"navbutton"}),[p(t.$slots,"nexticon",{},(function(){return[(c(),u(b(t.nextIcon?"span":"ChevronRightIcon"),r({"aria-hidden":"true",class:t.nextIcon},t.ptm("nextIcon")),null,16,["class"]))]}))],16,K)),[[m]]):v("",!0)],16),l("div",r({class:t.cx("panelContainer")},t.ptm("panelContainer")),[(c(!0),s(h,null,f(y.tabs,(function(e,n){return c(),s(h,{key:y.getKey(e,n)},[!t.lazy||y.isTabActive(n)?d((c(),s("div",r({key:0,style:y.getTabProp(e,"contentStyle"),class:t.cx("tab.content",{tab:e}),role:"tabpanel","aria-labelledby":y.getTabHeaderActionId(n)},k(k(k({},y.getTabProp(e,"contentProps")),y.getTabPT(e,"root",n)),y.getTabPT(e,"content",n)),{"data-pc-name":"tabpanel","data-pc-index":n,"data-p-active":i.d_activeIndex===n}),[(c(),u(b(e)))],16,O)),[[x,!!t.lazy||y.isTabActive(n)]]):v("",!0)],64)})),128))],16)],16)};export{T as default};
|
package/tabview/tabview.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
this.primevue = this.primevue || {};
|
|
2
|
-
this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, utils, BaseComponent, usestyle
|
|
2
|
+
this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, utils, vue, BaseComponent, usestyle) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -100,12 +100,6 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
|
|
104
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
105
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
106
|
-
function _defineProperty$1(obj, key, value) { key = _toPropertyKey$1(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
107
|
-
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
|
|
108
|
-
function _toPrimitive$1(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
109
103
|
var script = {
|
|
110
104
|
name: 'TabView',
|
|
111
105
|
"extends": script$1,
|
|
@@ -157,6 +151,7 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
157
151
|
return "".concat(this.id, "_").concat(index, "_content");
|
|
158
152
|
},
|
|
159
153
|
getTabPT: function getTabPT(tab, key, index) {
|
|
154
|
+
var count = this.tabs.length;
|
|
160
155
|
var tabMetaData = {
|
|
161
156
|
props: tab.props,
|
|
162
157
|
parent: {
|
|
@@ -164,12 +159,18 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
164
159
|
state: this.$data
|
|
165
160
|
},
|
|
166
161
|
context: {
|
|
167
|
-
index: index
|
|
162
|
+
index: index,
|
|
163
|
+
count: count,
|
|
164
|
+
first: index === 0,
|
|
165
|
+
last: index === count - 1,
|
|
166
|
+
active: this.isTabActive(index)
|
|
168
167
|
}
|
|
169
168
|
};
|
|
170
|
-
return
|
|
169
|
+
return vue.mergeProps(this.ptm("tab.".concat(key), {
|
|
171
170
|
tab: tabMetaData
|
|
172
|
-
})
|
|
171
|
+
}), this.ptm("tabpanel.".concat(key), {
|
|
172
|
+
tabpanel: tabMetaData
|
|
173
|
+
}), this.ptm("tabpanel.".concat(key), tabMetaData), this.ptmo(this.getTabProp(tab, 'pt'), key, tabMetaData));
|
|
173
174
|
},
|
|
174
175
|
onScroll: function onScroll(event) {
|
|
175
176
|
this.scrollable && this.updateButtonState();
|
|
@@ -393,7 +394,9 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
393
394
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
394
395
|
return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments);
|
|
395
396
|
})
|
|
396
|
-
}, _objectSpread(_objectSpread({}, _ctx.previousButtonProps), _ctx.ptm('previousButton'))
|
|
397
|
+
}, _objectSpread(_objectSpread({}, _ctx.previousButtonProps), _ctx.ptm('previousButton')), {
|
|
398
|
+
"data-pc-group-section": "navbutton"
|
|
399
|
+
}), [vue.renderSlot(_ctx.$slots, "previcon", {}, function () {
|
|
397
400
|
return [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prevIcon ? 'span' : 'ChevronLeftIcon'), vue.mergeProps({
|
|
398
401
|
"aria-hidden": "true",
|
|
399
402
|
"class": _ctx.prevIcon
|
|
@@ -416,13 +419,14 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
416
419
|
tab: tab,
|
|
417
420
|
index: index
|
|
418
421
|
}),
|
|
419
|
-
role: "presentation"
|
|
422
|
+
role: "presentation"
|
|
423
|
+
}, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'headerProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'header', index)), {
|
|
420
424
|
"data-pc-name": "tabpanel",
|
|
421
425
|
"data-p-highlight": $data.d_activeIndex === index,
|
|
422
426
|
"data-p-disabled": $options.getTabProp(tab, 'disabled'),
|
|
423
427
|
"data-pc-index": index,
|
|
424
428
|
"data-p-active": $data.d_activeIndex === index
|
|
425
|
-
}
|
|
429
|
+
}), [vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({
|
|
426
430
|
id: $options.getTabHeaderActionId(index),
|
|
427
431
|
"class": _ctx.cx('tab.headerAction'),
|
|
428
432
|
tabindex: $options.getTabProp(tab, 'disabled') || !$options.isTabActive(index) ? -1 : _ctx.tabindex,
|
|
@@ -457,7 +461,9 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
457
461
|
onClick: _cache[2] || (_cache[2] = function () {
|
|
458
462
|
return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments);
|
|
459
463
|
})
|
|
460
|
-
}, _objectSpread(_objectSpread({}, _ctx.nextButtonProps), _ctx.ptm('nextButton'))
|
|
464
|
+
}, _objectSpread(_objectSpread({}, _ctx.nextButtonProps), _ctx.ptm('nextButton')), {
|
|
465
|
+
"data-pc-group-section": "navbutton"
|
|
466
|
+
}), [vue.renderSlot(_ctx.$slots, "nexticon", {}, function () {
|
|
461
467
|
return [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.nextIcon ? 'span' : 'ChevronRightIcon'), vue.mergeProps({
|
|
462
468
|
"aria-hidden": "true",
|
|
463
469
|
"class": _ctx.nextIcon
|
|
@@ -474,11 +480,12 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
474
480
|
tab: tab
|
|
475
481
|
}),
|
|
476
482
|
role: "tabpanel",
|
|
477
|
-
"aria-labelledby": $options.getTabHeaderActionId(index)
|
|
483
|
+
"aria-labelledby": $options.getTabHeaderActionId(index)
|
|
484
|
+
}, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'contentProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'content', index)), {
|
|
478
485
|
"data-pc-name": "tabpanel",
|
|
479
486
|
"data-pc-index": index,
|
|
480
487
|
"data-p-active": $data.d_activeIndex === index
|
|
481
|
-
}
|
|
488
|
+
}), [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tab)))], 16, _hoisted_5)), [[vue.vShow, _ctx.lazy ? true : $options.isTabActive(index)]]) : vue.createCommentVNode("", true)], 64);
|
|
482
489
|
}), 128))], 16)], 16);
|
|
483
490
|
}
|
|
484
491
|
|
|
@@ -486,4 +493,4 @@ this.primevue.tabview = (function (ChevronLeftIcon, ChevronRightIcon, Ripple, ut
|
|
|
486
493
|
|
|
487
494
|
return script;
|
|
488
495
|
|
|
489
|
-
})(primevue.icons.chevronleft, primevue.icons.chevronright, primevue.ripple, primevue.utils, primevue.basecomponent, primevue.usestyle
|
|
496
|
+
})(primevue.icons.chevronleft, primevue.icons.chevronright, primevue.ripple, primevue.utils, Vue, primevue.basecomponent, primevue.usestyle);
|