primereact 10.0.0 → 10.0.1
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 +1 -1
- package/componentbase/componentbase.cjs.js +12 -7
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.min.mjs +1 -1
- package/componentbase/componentbase.esm.mjs +12 -7
- package/componentbase/componentbase.js +12 -7
- package/componentbase/componentbase.min.js +1 -1
- package/core/core.js +12 -7
- package/core/core.min.js +1 -1
- package/package.json +1 -1
- package/primereact.all.cjs.js +12 -7
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.min.mjs +1 -1
- package/primereact.all.esm.mjs +12 -7
- package/primereact.all.js +12 -7
- package/primereact.all.min.js +1 -1
- package/web-types.json +1 -1
- package/accordion/accordion.esm.js +0 -421
- package/accordion/accordion.esm.min.js +0 -1
- package/api/api.esm.js +0 -944
- package/api/api.esm.min.js +0 -1
- package/autocomplete/autocomplete.esm.js +0 -1127
- package/autocomplete/autocomplete.esm.min.js +0 -1
- package/avatar/avatar.esm.js +0 -245
- package/avatar/avatar.esm.min.js +0 -1
- package/avatargroup/avatargroup.esm.js +0 -55
- package/avatargroup/avatargroup.esm.min.js +0 -1
- package/badge/badge.esm.js +0 -110
- package/badge/badge.esm.min.js +0 -1
- package/blockui/blockui.esm.js +0 -265
- package/blockui/blockui.esm.min.js +0 -1
- package/breadcrumb/breadcrumb.esm.js +0 -351
- package/breadcrumb/breadcrumb.esm.min.js +0 -1
- package/button/button.esm.js +0 -295
- package/button/button.esm.min.js +0 -1
- package/calendar/calendar.esm.js +0 -3473
- package/calendar/calendar.esm.min.js +0 -1
- package/card/card.esm.js +0 -98
- package/card/card.esm.min.js +0 -1
- package/carousel/carousel.esm.js +0 -801
- package/carousel/carousel.esm.min.js +0 -1
- package/cascadeselect/cascadeselect.esm.js +0 -819
- package/cascadeselect/cascadeselect.esm.min.js +0 -1
- package/chart/chart.esm.js +0 -155
- package/chart/chart.esm.min.js +0 -1
- package/checkbox/checkbox.esm.js +0 -357
- package/checkbox/checkbox.esm.min.js +0 -1
- package/chip/chip.esm.js +0 -248
- package/chip/chip.esm.min.js +0 -1
- package/chips/chips.esm.js +0 -501
- package/chips/chips.esm.min.js +0 -1
- package/colorpicker/colorpicker.esm.js +0 -788
- package/colorpicker/colorpicker.esm.min.js +0 -1
- package/column/column.esm.js +0 -8
- package/column/column.esm.min.js +0 -1
- package/columngroup/columngroup.esm.js +0 -6
- package/columngroup/columngroup.esm.min.js +0 -1
- package/componentbase/componentbase.esm.js +0 -323
- package/componentbase/componentbase.esm.min.js +0 -1
- package/confirmdialog/confirmdialog.esm.js +0 -376
- package/confirmdialog/confirmdialog.esm.min.js +0 -1
- package/confirmpopup/confirmpopup.esm.js +0 -610
- package/confirmpopup/confirmpopup.esm.min.js +0 -1
- package/contextmenu/contextmenu.esm.js +0 -664
- package/contextmenu/contextmenu.esm.min.js +0 -1
- package/csstransition/csstransition.esm.js +0 -138
- package/csstransition/csstransition.esm.min.js +0 -1
- package/datascroller/datascroller.esm.js +0 -320
- package/datascroller/datascroller.esm.min.js +0 -1
- package/datatable/datatable.esm.js +0 -6636
- package/datatable/datatable.esm.min.js +0 -1
- package/dataview/dataview.esm.js +0 -506
- package/dataview/dataview.esm.min.js +0 -1
- package/deferredcontent/deferredcontent.esm.js +0 -133
- package/deferredcontent/deferredcontent.esm.min.js +0 -1
- package/dialog/dialog.esm.js +0 -983
- package/dialog/dialog.esm.min.js +0 -1
- package/divider/divider.esm.js +0 -79
- package/divider/divider.esm.min.js +0 -1
- package/dock/dock.esm.js +0 -348
- package/dock/dock.esm.min.js +0 -1
- package/dropdown/dropdown.esm.js +0 -1380
- package/dropdown/dropdown.esm.min.js +0 -1
- package/editor/editor.esm.js +0 -338
- package/editor/editor.esm.min.js +0 -1
- package/fieldset/fieldset.esm.js +0 -270
- package/fieldset/fieldset.esm.min.js +0 -1
- package/fileupload/fileupload.esm.js +0 -1005
- package/fileupload/fileupload.esm.min.js +0 -1
- package/galleria/galleria.esm.js +0 -1090
- package/galleria/galleria.esm.min.js +0 -1
- package/hooks/hooks.esm.js +0 -1042
- package/hooks/hooks.esm.min.js +0 -1
- package/iconbase/iconbase.esm.js +0 -33
- package/iconbase/iconbase.esm.min.js +0 -1
- package/icons/angledoubledown/index.esm.js +0 -39
- package/icons/angledoubledown/index.esm.min.js +0 -1
- package/icons/angledoubleleft/index.esm.js +0 -39
- package/icons/angledoubleleft/index.esm.min.js +0 -1
- package/icons/angledoubleright/index.esm.js +0 -39
- package/icons/angledoubleright/index.esm.min.js +0 -1
- package/icons/angledoubleup/index.esm.js +0 -39
- package/icons/angledoubleup/index.esm.min.js +0 -1
- package/icons/angledown/index.esm.js +0 -37
- package/icons/angledown/index.esm.min.js +0 -1
- package/icons/angleleft/index.esm.js +0 -37
- package/icons/angleleft/index.esm.min.js +0 -1
- package/icons/angleright/index.esm.js +0 -37
- package/icons/angleright/index.esm.min.js +0 -1
- package/icons/angleup/index.esm.js +0 -37
- package/icons/angleup/index.esm.min.js +0 -1
- package/icons/arrowdown/index.esm.js +0 -661
- package/icons/arrowdown/index.esm.min.js +0 -1
- package/icons/arrowup/index.esm.js +0 -661
- package/icons/arrowup/index.esm.min.js +0 -1
- package/icons/ban/index.esm.js +0 -659
- package/icons/ban/index.esm.min.js +0 -1
- package/icons/bars/index.esm.js +0 -39
- package/icons/bars/index.esm.min.js +0 -1
- package/icons/calendar/index.esm.js +0 -37
- package/icons/calendar/index.esm.min.js +0 -1
- package/icons/check/index.esm.js +0 -37
- package/icons/check/index.esm.min.js +0 -1
- package/icons/chevrondown/index.esm.js +0 -37
- package/icons/chevrondown/index.esm.min.js +0 -1
- package/icons/chevronleft/index.esm.js +0 -37
- package/icons/chevronleft/index.esm.min.js +0 -1
- package/icons/chevronright/index.esm.js +0 -37
- package/icons/chevronright/index.esm.min.js +0 -1
- package/icons/chevronup/index.esm.js +0 -37
- package/icons/chevronup/index.esm.min.js +0 -1
- package/icons/download/index.esm.js +0 -661
- package/icons/download/index.esm.min.js +0 -1
- package/icons/exclamationtriangle/index.esm.js +0 -665
- package/icons/exclamationtriangle/index.esm.min.js +0 -1
- package/icons/eye/index.esm.js +0 -39
- package/icons/eye/index.esm.min.js +0 -1
- package/icons/eyeslash/index.esm.js +0 -661
- package/icons/eyeslash/index.esm.min.js +0 -1
- package/icons/filter/index.esm.js +0 -659
- package/icons/filter/index.esm.min.js +0 -1
- package/icons/filterslash/index.esm.js +0 -661
- package/icons/filterslash/index.esm.min.js +0 -1
- package/icons/infocircle/index.esm.js +0 -661
- package/icons/infocircle/index.esm.min.js +0 -1
- package/icons/minus/index.esm.js +0 -37
- package/icons/minus/index.esm.min.js +0 -1
- package/icons/pencil/index.esm.js +0 -659
- package/icons/pencil/index.esm.min.js +0 -1
- package/icons/plus/index.esm.js +0 -659
- package/icons/plus/index.esm.min.js +0 -1
- package/icons/refresh/index.esm.js +0 -661
- package/icons/refresh/index.esm.min.js +0 -1
- package/icons/search/index.esm.js +0 -661
- package/icons/search/index.esm.min.js +0 -1
- package/icons/searchminus/index.esm.js +0 -661
- package/icons/searchminus/index.esm.min.js +0 -1
- package/icons/searchplus/index.esm.js +0 -661
- package/icons/searchplus/index.esm.min.js +0 -1
- package/icons/sortalt/index.esm.js +0 -668
- package/icons/sortalt/index.esm.min.js +0 -1
- package/icons/sortamountdown/index.esm.js +0 -674
- package/icons/sortamountdown/index.esm.min.js +0 -1
- package/icons/sortamountupalt/index.esm.js +0 -674
- package/icons/sortamountupalt/index.esm.min.js +0 -1
- package/icons/spinner/index.esm.js +0 -659
- package/icons/spinner/index.esm.min.js +0 -1
- package/icons/star/index.esm.js +0 -659
- package/icons/star/index.esm.min.js +0 -1
- package/icons/starfill/index.esm.js +0 -659
- package/icons/starfill/index.esm.min.js +0 -1
- package/icons/thlarge/index.esm.js +0 -661
- package/icons/thlarge/index.esm.min.js +0 -1
- package/icons/times/index.esm.js +0 -37
- package/icons/times/index.esm.min.js +0 -1
- package/icons/timescircle/index.esm.js +0 -661
- package/icons/timescircle/index.esm.min.js +0 -1
- package/icons/trash/index.esm.js +0 -661
- package/icons/trash/index.esm.min.js +0 -1
- package/icons/undo/index.esm.js +0 -661
- package/icons/undo/index.esm.min.js +0 -1
- package/icons/upload/index.esm.js +0 -661
- package/icons/upload/index.esm.min.js +0 -1
- package/icons/windowmaximize/index.esm.js +0 -661
- package/icons/windowmaximize/index.esm.min.js +0 -1
- package/icons/windowminimize/index.esm.js +0 -661
- package/icons/windowminimize/index.esm.min.js +0 -1
- package/image/image.esm.js +0 -1162
- package/image/image.esm.min.js +0 -1
- package/inplace/inplace.esm.js +0 -243
- package/inplace/inplace.esm.min.js +0 -1
- package/inputmask/inputmask.esm.js +0 -560
- package/inputmask/inputmask.esm.min.js +0 -1
- package/inputnumber/inputnumber.esm.js +0 -1209
- package/inputnumber/inputnumber.esm.min.js +0 -1
- package/inputswitch/inputswitch.esm.js +0 -291
- package/inputswitch/inputswitch.esm.min.js +0 -1
- package/inputtext/inputtext.esm.js +0 -171
- package/inputtext/inputtext.esm.min.js +0 -1
- package/inputtextarea/inputtextarea.esm.js +0 -220
- package/inputtextarea/inputtextarea.esm.min.js +0 -1
- package/keyfilter/keyfilter.esm.js +0 -108
- package/keyfilter/keyfilter.esm.min.js +0 -1
- package/knob/knob.esm.js +0 -318
- package/knob/knob.esm.min.js +0 -1
- package/listbox/listbox.esm.js +0 -810
- package/listbox/listbox.esm.min.js +0 -1
- package/megamenu/megamenu.esm.js +0 -716
- package/megamenu/megamenu.esm.min.js +0 -1
- package/mention/mention.esm.js +0 -771
- package/mention/mention.esm.min.js +0 -1
- package/menu/menu.esm.js +0 -485
- package/menu/menu.esm.min.js +0 -1
- package/menubar/menubar.esm.js +0 -584
- package/menubar/menubar.esm.min.js +0 -1
- package/message/message.esm.js +0 -169
- package/message/message.esm.min.js +0 -1
- package/messages/messages.esm.js +0 -439
- package/messages/messages.esm.min.js +0 -1
- package/multiselect/multiselect.esm.js +0 -1724
- package/multiselect/multiselect.esm.min.js +0 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +0 -352
- package/multistatecheckbox/multistatecheckbox.esm.min.js +0 -1
- package/orderlist/orderlist.esm.js +0 -816
- package/orderlist/orderlist.esm.min.js +0 -1
- package/organizationchart/organizationchart.esm.js +0 -480
- package/organizationchart/organizationchart.esm.min.js +0 -1
- package/overlaypanel/overlaypanel.esm.js +0 -516
- package/overlaypanel/overlaypanel.esm.min.js +0 -1
- package/overlayservice/overlayservice.esm.js +0 -7
- package/overlayservice/overlayservice.esm.min.js +0 -1
- package/paginator/paginator.esm.js +0 -933
- package/paginator/paginator.esm.min.js +0 -1
- package/panel/panel.esm.js +0 -316
- package/panel/panel.esm.min.js +0 -1
- package/panelmenu/panelmenu.esm.js +0 -645
- package/panelmenu/panelmenu.esm.min.js +0 -1
- package/passthrough/index.esm.js +0 -71
- package/passthrough/index.esm.min.js +0 -1
- package/passthrough/tailwind/index.esm.js +0 -3509
- package/passthrough/tailwind/index.esm.min.js +0 -1
- package/password/password.esm.js +0 -567
- package/password/password.esm.min.js +0 -1
- package/picklist/picklist.esm.js +0 -1119
- package/picklist/picklist.esm.min.js +0 -1
- package/portal/portal.esm.js +0 -110
- package/portal/portal.esm.min.js +0 -1
- package/primereact.all.esm.js +0 -51646
- package/primereact.all.esm.min.js +0 -1
- package/progressbar/progressbar.esm.js +0 -190
- package/progressbar/progressbar.esm.min.js +0 -1
- package/progressspinner/progressspinner.esm.js +0 -88
- package/progressspinner/progressspinner.esm.min.js +0 -1
- package/radiobutton/radiobutton.esm.js +0 -329
- package/radiobutton/radiobutton.esm.min.js +0 -1
- package/rating/rating.esm.js +0 -273
- package/rating/rating.esm.min.js +0 -1
- package/ripple/ripple.esm.js +0 -100
- package/ripple/ripple.esm.min.js +0 -1
- package/row/row.esm.js +0 -36
- package/row/row.esm.min.js +0 -1
- package/scrollpanel/scrollpanel.esm.js +0 -210
- package/scrollpanel/scrollpanel.esm.min.js +0 -1
- package/scrolltop/scrolltop.esm.js +0 -269
- package/scrolltop/scrolltop.esm.min.js +0 -1
- package/selectbutton/selectbutton.esm.js +0 -327
- package/selectbutton/selectbutton.esm.min.js +0 -1
- package/sidebar/sidebar.esm.js +0 -543
- package/sidebar/sidebar.esm.min.js +0 -1
- package/skeleton/skeleton.esm.js +0 -125
- package/skeleton/skeleton.esm.min.js +0 -1
- package/slidemenu/slidemenu.esm.js +0 -689
- package/slidemenu/slidemenu.esm.min.js +0 -1
- package/slider/slider.esm.js +0 -478
- package/slider/slider.esm.min.js +0 -1
- package/speeddial/speeddial.esm.js +0 -521
- package/speeddial/speeddial.esm.min.js +0 -1
- package/splitbutton/splitbutton.esm.js +0 -545
- package/splitbutton/splitbutton.esm.min.js +0 -1
- package/splitter/splitter.esm.js +0 -466
- package/splitter/splitter.esm.min.js +0 -1
- package/steps/steps.esm.js +0 -294
- package/steps/steps.esm.min.js +0 -1
- package/styleclass/styleclass.esm.js +0 -269
- package/styleclass/styleclass.esm.min.js +0 -1
- package/tabmenu/tabmenu.esm.js +0 -332
- package/tabmenu/tabmenu.esm.min.js +0 -1
- package/tabview/tabview.esm.js +0 -678
- package/tabview/tabview.esm.min.js +0 -1
- package/tag/tag.esm.js +0 -117
- package/tag/tag.esm.min.js +0 -1
- package/terminal/terminal.esm.js +0 -280
- package/terminal/terminal.esm.min.js +0 -1
- package/terminalservice/terminalservice.esm.js +0 -7
- package/terminalservice/terminalservice.esm.min.js +0 -1
- package/tieredmenu/tieredmenu.esm.js +0 -699
- package/tieredmenu/tieredmenu.esm.min.js +0 -1
- package/timeline/timeline.esm.js +0 -164
- package/timeline/timeline.esm.min.js +0 -1
- package/toast/toast.esm.js +0 -739
- package/toast/toast.esm.min.js +0 -1
- package/togglebutton/togglebutton.esm.js +0 -217
- package/togglebutton/togglebutton.esm.min.js +0 -1
- package/toolbar/toolbar.esm.js +0 -79
- package/toolbar/toolbar.esm.min.js +0 -1
- package/tooltip/tooltip.esm.js +0 -696
- package/tooltip/tooltip.esm.min.js +0 -1
- package/tree/tree.esm.js +0 -1403
- package/tree/tree.esm.min.js +0 -1
- package/treeselect/treeselect.esm.js +0 -930
- package/treeselect/treeselect.esm.min.js +0 -1
- package/treetable/treetable.esm.js +0 -3094
- package/treetable/treetable.esm.min.js +0 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +0 -292
- package/tristatecheckbox/tristatecheckbox.esm.min.js +0 -1
- package/utils/utils.esm.js +0 -2383
- package/utils/utils.esm.min.js +0 -1
- package/virtualscroller/virtualscroller.esm.js +0 -972
- package/virtualscroller/virtualscroller.esm.min.js +0 -1
package/tabview/tabview.esm.js
DELETED
|
@@ -1,678 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PrimeReactContext, ariaLabel } from 'primereact/api';
|
|
5
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
|
-
import { useMountEffect, useUpdateEffect } from 'primereact/hooks';
|
|
7
|
-
import { ChevronLeftIcon } from 'primereact/icons/chevronleft';
|
|
8
|
-
import { ChevronRightIcon } from 'primereact/icons/chevronright';
|
|
9
|
-
import { TimesIcon } from 'primereact/icons/times';
|
|
10
|
-
import { Ripple } from 'primereact/ripple';
|
|
11
|
-
import { ObjectUtils, classNames, UniqueComponentId, mergeProps, DomHandler, IconUtils } from 'primereact/utils';
|
|
12
|
-
|
|
13
|
-
function _arrayLikeToArray(arr, len) {
|
|
14
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
15
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
16
|
-
return arr2;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function _arrayWithoutHoles(arr) {
|
|
20
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function _iterableToArray(iter) {
|
|
24
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
28
|
-
if (!o) return;
|
|
29
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
30
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
31
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
32
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
33
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _nonIterableSpread() {
|
|
37
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function _toConsumableArray(arr) {
|
|
41
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _typeof(o) {
|
|
45
|
-
"@babel/helpers - typeof";
|
|
46
|
-
|
|
47
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
48
|
-
return typeof o;
|
|
49
|
-
} : function (o) {
|
|
50
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
51
|
-
}, _typeof(o);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _toPrimitive(input, hint) {
|
|
55
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
56
|
-
var prim = input[Symbol.toPrimitive];
|
|
57
|
-
if (prim !== undefined) {
|
|
58
|
-
var res = prim.call(input, hint || "default");
|
|
59
|
-
if (_typeof(res) !== "object") return res;
|
|
60
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
61
|
-
}
|
|
62
|
-
return (hint === "string" ? String : Number)(input);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function _toPropertyKey(arg) {
|
|
66
|
-
var key = _toPrimitive(arg, "string");
|
|
67
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function _defineProperty(obj, key, value) {
|
|
71
|
-
key = _toPropertyKey(key);
|
|
72
|
-
if (key in obj) {
|
|
73
|
-
Object.defineProperty(obj, key, {
|
|
74
|
-
value: value,
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true,
|
|
77
|
-
writable: true
|
|
78
|
-
});
|
|
79
|
-
} else {
|
|
80
|
-
obj[key] = value;
|
|
81
|
-
}
|
|
82
|
-
return obj;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function _arrayWithHoles(arr) {
|
|
86
|
-
if (Array.isArray(arr)) return arr;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function _iterableToArrayLimit(r, l) {
|
|
90
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
91
|
-
if (null != t) {
|
|
92
|
-
var e,
|
|
93
|
-
n,
|
|
94
|
-
i,
|
|
95
|
-
u,
|
|
96
|
-
a = [],
|
|
97
|
-
f = !0,
|
|
98
|
-
o = !1;
|
|
99
|
-
try {
|
|
100
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
101
|
-
if (Object(t) !== t) return;
|
|
102
|
-
f = !1;
|
|
103
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
104
|
-
} catch (r) {
|
|
105
|
-
o = !0, n = r;
|
|
106
|
-
} finally {
|
|
107
|
-
try {
|
|
108
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
109
|
-
} finally {
|
|
110
|
-
if (o) throw n;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return a;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function _nonIterableRest() {
|
|
118
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function _slicedToArray(arr, i) {
|
|
122
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
126
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
127
|
-
var classes = {
|
|
128
|
-
navcontent: 'p-tabview-nav-content',
|
|
129
|
-
nav: 'p-tabview-nav',
|
|
130
|
-
inkbar: 'p-tabview-ink-bar',
|
|
131
|
-
panelcontainer: function panelcontainer(_ref) {
|
|
132
|
-
var props = _ref.props;
|
|
133
|
-
return classNames('p-tabview-panels', props.panelContainerClassName);
|
|
134
|
-
},
|
|
135
|
-
prevbutton: 'p-tabview-nav-prev p-tabview-nav-btn p-link',
|
|
136
|
-
nextbutton: 'p-tabview-nav-next p-tabview-nav-btn p-link',
|
|
137
|
-
root: function root(_ref2) {
|
|
138
|
-
var props = _ref2.props;
|
|
139
|
-
return classNames('p-tabview p-component', {
|
|
140
|
-
'p-tabview-scrollable': props.scrollable
|
|
141
|
-
}, props.className);
|
|
142
|
-
},
|
|
143
|
-
navcontainer: 'p-tabview-nav-container',
|
|
144
|
-
tab: {
|
|
145
|
-
header: function header(_ref3) {
|
|
146
|
-
var selected = _ref3.selected,
|
|
147
|
-
disabled = _ref3.disabled,
|
|
148
|
-
headerClassName = _ref3.headerClassName,
|
|
149
|
-
_className = _ref3._className;
|
|
150
|
-
return classNames('p-unselectable-text', {
|
|
151
|
-
'p-tabview-selected p-highlight': selected,
|
|
152
|
-
'p-disabled': disabled
|
|
153
|
-
}, headerClassName, _className);
|
|
154
|
-
},
|
|
155
|
-
headertitle: 'p-tabview-title',
|
|
156
|
-
headeraction: 'p-tabview-nav-link',
|
|
157
|
-
content: function content(_ref4) {
|
|
158
|
-
var props = _ref4.props,
|
|
159
|
-
selected = _ref4.selected,
|
|
160
|
-
getTabProp = _ref4.getTabProp,
|
|
161
|
-
tab = _ref4.tab,
|
|
162
|
-
isSelected = _ref4.isSelected,
|
|
163
|
-
shouldUseTab = _ref4.shouldUseTab,
|
|
164
|
-
index = _ref4.index;
|
|
165
|
-
return shouldUseTab(tab, index) && (!props.renderActiveOnly || isSelected(index)) ? classNames(getTabProp(tab, 'contentClassName'), getTabProp(tab, 'className'), 'p-tabview-panel', {
|
|
166
|
-
'p-hidden': !selected
|
|
167
|
-
}) : undefined;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var styles = "\n@layer primereact {\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 position: relative;\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-nav-link {\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-nav-link:focus {\n z-index: 1;\n }\n \n .p-tabview-close {\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}\n";
|
|
172
|
-
var inlineStyles = {
|
|
173
|
-
tab: {
|
|
174
|
-
header: function header(_ref5) {
|
|
175
|
-
var headerStyle = _ref5.headerStyle,
|
|
176
|
-
_style = _ref5._style;
|
|
177
|
-
return _objectSpread$1(_objectSpread$1({}, headerStyle || {}), _style || {});
|
|
178
|
-
},
|
|
179
|
-
content: function content(_ref6) {
|
|
180
|
-
var props = _ref6.props,
|
|
181
|
-
getTabProp = _ref6.getTabProp,
|
|
182
|
-
tab = _ref6.tab,
|
|
183
|
-
isSelected = _ref6.isSelected,
|
|
184
|
-
shouldUseTab = _ref6.shouldUseTab,
|
|
185
|
-
index = _ref6.index;
|
|
186
|
-
return shouldUseTab(tab, index) && (!props.renderActiveOnly || isSelected(index)) ? _objectSpread$1(_objectSpread$1({}, getTabProp(tab, 'contentStyle') || {}), getTabProp(tab, 'style') || {}) : undefined;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
var TabViewBase = ComponentBase.extend({
|
|
191
|
-
defaultProps: {
|
|
192
|
-
__TYPE: 'TabView',
|
|
193
|
-
id: null,
|
|
194
|
-
activeIndex: 0,
|
|
195
|
-
className: null,
|
|
196
|
-
onBeforeTabChange: null,
|
|
197
|
-
onBeforeTabClose: null,
|
|
198
|
-
onTabChange: null,
|
|
199
|
-
onTabClose: null,
|
|
200
|
-
panelContainerClassName: null,
|
|
201
|
-
panelContainerStyle: null,
|
|
202
|
-
renderActiveOnly: true,
|
|
203
|
-
scrollable: false,
|
|
204
|
-
style: null,
|
|
205
|
-
children: undefined
|
|
206
|
-
},
|
|
207
|
-
css: {
|
|
208
|
-
classes: classes,
|
|
209
|
-
styles: styles,
|
|
210
|
-
inlineStyles: inlineStyles
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
var TabPanelBase = ComponentBase.extend({
|
|
214
|
-
defaultProps: {
|
|
215
|
-
__TYPE: 'TabPanel',
|
|
216
|
-
className: null,
|
|
217
|
-
closable: false,
|
|
218
|
-
contentClassName: null,
|
|
219
|
-
contentStyle: null,
|
|
220
|
-
disabled: false,
|
|
221
|
-
header: null,
|
|
222
|
-
headerClassName: null,
|
|
223
|
-
headerStyle: null,
|
|
224
|
-
headerTemplate: null,
|
|
225
|
-
leftIcon: null,
|
|
226
|
-
rightIcon: null,
|
|
227
|
-
prevButton: null,
|
|
228
|
-
nextButton: null,
|
|
229
|
-
closeIcon: null,
|
|
230
|
-
style: null,
|
|
231
|
-
children: undefined
|
|
232
|
-
},
|
|
233
|
-
getCProp: function getCProp(tab, name) {
|
|
234
|
-
return ObjectUtils.getComponentProp(tab, name, TabPanelBase.defaultProps);
|
|
235
|
-
},
|
|
236
|
-
getCProps: function getCProps(tab) {
|
|
237
|
-
return ObjectUtils.getComponentProps(tab, TabPanelBase.defaultProps);
|
|
238
|
-
},
|
|
239
|
-
getCOtherProps: function getCOtherProps(tab) {
|
|
240
|
-
return ObjectUtils.getComponentDiffProps(tab, TabPanelBase.defaultProps);
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
245
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
246
|
-
var TabPanel = function TabPanel() {};
|
|
247
|
-
var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
248
|
-
var context = React.useContext(PrimeReactContext);
|
|
249
|
-
var props = TabViewBase.getProps(inProps, context);
|
|
250
|
-
var _React$useState = React.useState(props.id),
|
|
251
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
252
|
-
idState = _React$useState2[0],
|
|
253
|
-
setIdState = _React$useState2[1];
|
|
254
|
-
var _React$useState3 = React.useState(true),
|
|
255
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
256
|
-
backwardIsDisabledState = _React$useState4[0],
|
|
257
|
-
setBackwardIsDisabledState = _React$useState4[1];
|
|
258
|
-
var _React$useState5 = React.useState(false),
|
|
259
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
260
|
-
forwardIsDisabledState = _React$useState6[0],
|
|
261
|
-
setForwardIsDisabledState = _React$useState6[1];
|
|
262
|
-
var _React$useState7 = React.useState([]),
|
|
263
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
264
|
-
hiddenTabsState = _React$useState8[0],
|
|
265
|
-
setHiddenTabsState = _React$useState8[1];
|
|
266
|
-
var _React$useState9 = React.useState(props.activeIndex),
|
|
267
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
268
|
-
activeIndexState = _React$useState10[0],
|
|
269
|
-
setActiveIndexState = _React$useState10[1];
|
|
270
|
-
var elementRef = React.useRef(null);
|
|
271
|
-
var contentRef = React.useRef(null);
|
|
272
|
-
var navRef = React.useRef(null);
|
|
273
|
-
var inkbarRef = React.useRef(null);
|
|
274
|
-
var prevBtnRef = React.useRef(null);
|
|
275
|
-
var nextBtnRef = React.useRef(null);
|
|
276
|
-
var tabsRef = React.useRef({});
|
|
277
|
-
var activeIndex = props.onTabChange ? props.activeIndex : activeIndexState;
|
|
278
|
-
var metaData = {
|
|
279
|
-
props: props,
|
|
280
|
-
state: {
|
|
281
|
-
id: idState,
|
|
282
|
-
isPrevButtonDisabled: backwardIsDisabledState,
|
|
283
|
-
isNextButtonDisabled: forwardIsDisabledState,
|
|
284
|
-
hiddenTabsState: hiddenTabsState,
|
|
285
|
-
activeIndex: activeIndexState
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
var _TabViewBase$setMetaD = TabViewBase.setMetaData(_objectSpread({}, metaData)),
|
|
289
|
-
ptm = _TabViewBase$setMetaD.ptm,
|
|
290
|
-
ptmo = _TabViewBase$setMetaD.ptmo,
|
|
291
|
-
cx = _TabViewBase$setMetaD.cx,
|
|
292
|
-
sx = _TabViewBase$setMetaD.sx,
|
|
293
|
-
isUnstyled = _TabViewBase$setMetaD.isUnstyled;
|
|
294
|
-
useHandleStyle(TabViewBase.css.styles, isUnstyled, {
|
|
295
|
-
name: 'tabview'
|
|
296
|
-
});
|
|
297
|
-
var getTabPT = function getTabPT(tab, key) {
|
|
298
|
-
return ptmo(getTabProp(tab, 'pt'), key, {
|
|
299
|
-
props: tab.props,
|
|
300
|
-
parent: metaData
|
|
301
|
-
});
|
|
302
|
-
};
|
|
303
|
-
var isSelected = function isSelected(index) {
|
|
304
|
-
return index === activeIndex;
|
|
305
|
-
};
|
|
306
|
-
var getTabProp = function getTabProp(tab, name) {
|
|
307
|
-
return TabPanelBase.getCProp(tab, name);
|
|
308
|
-
};
|
|
309
|
-
var shouldUseTab = function shouldUseTab(tab, index) {
|
|
310
|
-
return tab && ObjectUtils.isValidChild(tab, 'TabPanel') && hiddenTabsState.every(function (_i) {
|
|
311
|
-
return _i !== index;
|
|
312
|
-
});
|
|
313
|
-
};
|
|
314
|
-
var findVisibleActiveTab = function findVisibleActiveTab(i) {
|
|
315
|
-
var tabsInfo = React.Children.map(props.children, function (tab, index) {
|
|
316
|
-
if (shouldUseTab(tab, index)) {
|
|
317
|
-
return {
|
|
318
|
-
tab: tab,
|
|
319
|
-
index: index
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
return tabsInfo.find(function (_ref) {
|
|
324
|
-
var tab = _ref.tab,
|
|
325
|
-
index = _ref.index;
|
|
326
|
-
return !getTabProp(tab, 'disabled') && index >= i;
|
|
327
|
-
}) || tabsInfo.reverse().find(function (_ref2) {
|
|
328
|
-
var tab = _ref2.tab,
|
|
329
|
-
index = _ref2.index;
|
|
330
|
-
return !getTabProp(tab, 'disabled') && i > index;
|
|
331
|
-
});
|
|
332
|
-
};
|
|
333
|
-
var onTabHeaderClose = function onTabHeaderClose(event, index) {
|
|
334
|
-
event.preventDefault();
|
|
335
|
-
|
|
336
|
-
// give caller a chance to stop the selection
|
|
337
|
-
if (props.onBeforeTabClose && props.onBeforeTabClose({
|
|
338
|
-
originalEvent: event,
|
|
339
|
-
index: index
|
|
340
|
-
}) === false) {
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
setHiddenTabsState([].concat(_toConsumableArray(hiddenTabsState), [index]));
|
|
344
|
-
if (props.onTabClose) {
|
|
345
|
-
props.onTabClose({
|
|
346
|
-
originalEvent: event,
|
|
347
|
-
index: index
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
var onTabHeaderClick = function onTabHeaderClick(event, tab, index) {
|
|
352
|
-
if (event) {
|
|
353
|
-
event.preventDefault();
|
|
354
|
-
}
|
|
355
|
-
if (!getTabProp(tab, 'disabled')) {
|
|
356
|
-
// give caller a chance to stop the selection
|
|
357
|
-
if (props.onBeforeTabChange && props.onBeforeTabChange({
|
|
358
|
-
originalEvent: event,
|
|
359
|
-
index: index
|
|
360
|
-
}) === false) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
if (props.onTabChange) props.onTabChange({
|
|
364
|
-
originalEvent: event,
|
|
365
|
-
index: index
|
|
366
|
-
});else setActiveIndexState(index);
|
|
367
|
-
}
|
|
368
|
-
updateScrollBar(index);
|
|
369
|
-
};
|
|
370
|
-
var _onKeyDown = function onKeyDown(event, tab, index) {
|
|
371
|
-
if (event.key === 'Enter') {
|
|
372
|
-
onTabHeaderClick(event, tab, index);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
var updateInkBar = function updateInkBar() {
|
|
376
|
-
var tabHeader = tabsRef.current["tab_".concat(activeIndex)];
|
|
377
|
-
inkbarRef.current.style.width = DomHandler.getWidth(tabHeader) + 'px';
|
|
378
|
-
inkbarRef.current.style.left = DomHandler.getOffset(tabHeader).left - DomHandler.getOffset(navRef.current).left + 'px';
|
|
379
|
-
};
|
|
380
|
-
var updateScrollBar = function updateScrollBar(index) {
|
|
381
|
-
var tabHeader = tabsRef.current["tab_".concat(index)];
|
|
382
|
-
if (tabHeader && tabHeader.scrollIntoView) {
|
|
383
|
-
tabHeader.scrollIntoView({
|
|
384
|
-
block: 'nearest'
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
var updateButtonState = function updateButtonState() {
|
|
389
|
-
var _contentRef$current = contentRef.current,
|
|
390
|
-
scrollLeft = _contentRef$current.scrollLeft,
|
|
391
|
-
scrollWidth = _contentRef$current.scrollWidth;
|
|
392
|
-
var width = DomHandler.getWidth(contentRef.current);
|
|
393
|
-
setBackwardIsDisabledState(scrollLeft === 0);
|
|
394
|
-
setForwardIsDisabledState(scrollLeft === scrollWidth - width);
|
|
395
|
-
};
|
|
396
|
-
var onScroll = function onScroll(event) {
|
|
397
|
-
props.scrollable && updateButtonState();
|
|
398
|
-
event.preventDefault();
|
|
399
|
-
};
|
|
400
|
-
var getVisibleButtonWidths = function getVisibleButtonWidths() {
|
|
401
|
-
return [prevBtnRef.current, nextBtnRef.current].reduce(function (acc, el) {
|
|
402
|
-
return el ? acc + DomHandler.getWidth(el) : acc;
|
|
403
|
-
}, 0);
|
|
404
|
-
};
|
|
405
|
-
var navBackward = function navBackward() {
|
|
406
|
-
var width = DomHandler.getWidth(contentRef.current) - getVisibleButtonWidths();
|
|
407
|
-
var pos = contentRef.current.scrollLeft - width;
|
|
408
|
-
contentRef.current.scrollLeft = pos <= 0 ? 0 : pos;
|
|
409
|
-
};
|
|
410
|
-
var navForward = function navForward() {
|
|
411
|
-
var width = DomHandler.getWidth(contentRef.current) - getVisibleButtonWidths();
|
|
412
|
-
var pos = contentRef.current.scrollLeft + width;
|
|
413
|
-
var lastPos = contentRef.current.scrollWidth - width;
|
|
414
|
-
contentRef.current.scrollLeft = pos >= lastPos ? lastPos : pos;
|
|
415
|
-
};
|
|
416
|
-
var reset = function reset() {
|
|
417
|
-
setBackwardIsDisabledState(true);
|
|
418
|
-
setForwardIsDisabledState(false);
|
|
419
|
-
setHiddenTabsState([]);
|
|
420
|
-
if (props.onTabChange) props.onTabChange({
|
|
421
|
-
index: activeIndex
|
|
422
|
-
});else setActiveIndexState(props.activeIndex);
|
|
423
|
-
};
|
|
424
|
-
React.useEffect(function () {
|
|
425
|
-
updateInkBar();
|
|
426
|
-
});
|
|
427
|
-
useMountEffect(function () {
|
|
428
|
-
if (!idState) {
|
|
429
|
-
setIdState(UniqueComponentId());
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
useUpdateEffect(function () {
|
|
433
|
-
if (ObjectUtils.isNotEmpty(hiddenTabsState)) {
|
|
434
|
-
var tabInfo = findVisibleActiveTab(hiddenTabsState[hiddenTabsState.length - 1]);
|
|
435
|
-
tabInfo && onTabHeaderClick(null, tabInfo.tab, tabInfo.index);
|
|
436
|
-
}
|
|
437
|
-
}, [hiddenTabsState]);
|
|
438
|
-
useUpdateEffect(function () {
|
|
439
|
-
if (props.activeIndex !== activeIndexState) {
|
|
440
|
-
updateScrollBar(props.activeIndex);
|
|
441
|
-
}
|
|
442
|
-
}, [props.activeIndex]);
|
|
443
|
-
React.useImperativeHandle(ref, function () {
|
|
444
|
-
return {
|
|
445
|
-
props: props,
|
|
446
|
-
reset: reset,
|
|
447
|
-
getElement: function getElement() {
|
|
448
|
-
return elementRef.current;
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
});
|
|
452
|
-
var createTabHeader = function createTabHeader(tab, index) {
|
|
453
|
-
var selected = isSelected(index);
|
|
454
|
-
var _TabPanelBase$getCPro = TabPanelBase.getCProps(tab),
|
|
455
|
-
headerStyle = _TabPanelBase$getCPro.headerStyle,
|
|
456
|
-
headerClassName = _TabPanelBase$getCPro.headerClassName,
|
|
457
|
-
_style = _TabPanelBase$getCPro.style,
|
|
458
|
-
_className = _TabPanelBase$getCPro.className,
|
|
459
|
-
disabled = _TabPanelBase$getCPro.disabled,
|
|
460
|
-
leftIcon = _TabPanelBase$getCPro.leftIcon,
|
|
461
|
-
rightIcon = _TabPanelBase$getCPro.rightIcon,
|
|
462
|
-
header = _TabPanelBase$getCPro.header,
|
|
463
|
-
headerTemplate = _TabPanelBase$getCPro.headerTemplate,
|
|
464
|
-
closable = _TabPanelBase$getCPro.closable,
|
|
465
|
-
closeIcon = _TabPanelBase$getCPro.closeIcon;
|
|
466
|
-
var headerId = idState + '_header_' + index;
|
|
467
|
-
var ariaControls = idState + '_content_' + index;
|
|
468
|
-
var tabIndex = disabled ? null : 0;
|
|
469
|
-
var leftIconElement = leftIcon && IconUtils.getJSXIcon(leftIcon, undefined, {
|
|
470
|
-
props: props
|
|
471
|
-
});
|
|
472
|
-
var headerTitleProps = mergeProps({
|
|
473
|
-
className: cx('tab.headertitle')
|
|
474
|
-
}, getTabPT(tab, 'headertitle'));
|
|
475
|
-
var titleElement = /*#__PURE__*/React.createElement("span", headerTitleProps, header);
|
|
476
|
-
var rightIconElement = rightIcon && IconUtils.getJSXIcon(rightIcon, undefined, {
|
|
477
|
-
props: props
|
|
478
|
-
});
|
|
479
|
-
var iconClassName = 'p-tabview-close';
|
|
480
|
-
var icon = closeIcon || /*#__PURE__*/React.createElement(TimesIcon, {
|
|
481
|
-
className: iconClassName,
|
|
482
|
-
onClick: function onClick(e) {
|
|
483
|
-
return onTabHeaderClose(e, index);
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
var closableIconElement = closable ? IconUtils.getJSXIcon(icon, {
|
|
487
|
-
className: iconClassName,
|
|
488
|
-
onClick: function onClick(e) {
|
|
489
|
-
return onTabHeaderClose(e, index);
|
|
490
|
-
}
|
|
491
|
-
}, {
|
|
492
|
-
props: props
|
|
493
|
-
}) : null;
|
|
494
|
-
var headerActionProps = mergeProps({
|
|
495
|
-
id: headerId,
|
|
496
|
-
role: 'tab',
|
|
497
|
-
className: cx('tab.headeraction'),
|
|
498
|
-
tabIndex: tabIndex,
|
|
499
|
-
'aria-controls': ariaControls,
|
|
500
|
-
'aria-selected': selected,
|
|
501
|
-
onClick: function onClick(e) {
|
|
502
|
-
return onTabHeaderClick(e, tab, index);
|
|
503
|
-
},
|
|
504
|
-
onKeyDown: function onKeyDown(e) {
|
|
505
|
-
return _onKeyDown(e, tab, index);
|
|
506
|
-
}
|
|
507
|
-
}, getTabPT(tab, 'headeraction'));
|
|
508
|
-
var content =
|
|
509
|
-
/*#__PURE__*/
|
|
510
|
-
// eslint-disable /
|
|
511
|
-
React.createElement("a", headerActionProps, leftIconElement, titleElement, rightIconElement, closableIconElement, /*#__PURE__*/React.createElement(Ripple, null))
|
|
512
|
-
// eslint-enable /
|
|
513
|
-
;
|
|
514
|
-
|
|
515
|
-
if (headerTemplate) {
|
|
516
|
-
var defaultContentOptions = {
|
|
517
|
-
className: 'p-tabview-nav-link',
|
|
518
|
-
titleClassName: 'p-tabview-title',
|
|
519
|
-
onClick: function onClick(e) {
|
|
520
|
-
return onTabHeaderClick(e, tab, index);
|
|
521
|
-
},
|
|
522
|
-
onKeyDown: function onKeyDown(e) {
|
|
523
|
-
return _onKeyDown(e, tab, index);
|
|
524
|
-
},
|
|
525
|
-
leftIconElement: leftIconElement,
|
|
526
|
-
titleElement: titleElement,
|
|
527
|
-
rightIconElement: rightIconElement,
|
|
528
|
-
element: content,
|
|
529
|
-
props: props,
|
|
530
|
-
index: index,
|
|
531
|
-
selected: selected,
|
|
532
|
-
ariaControls: ariaControls
|
|
533
|
-
};
|
|
534
|
-
content = ObjectUtils.getJSXElement(headerTemplate, defaultContentOptions);
|
|
535
|
-
}
|
|
536
|
-
var headerProps = mergeProps({
|
|
537
|
-
ref: function ref(el) {
|
|
538
|
-
return tabsRef.current["tab_".concat(index)] = el;
|
|
539
|
-
},
|
|
540
|
-
className: cx('tab.header', {
|
|
541
|
-
selected: selected,
|
|
542
|
-
disabled: disabled,
|
|
543
|
-
headerClassName: headerClassName,
|
|
544
|
-
_className: _className
|
|
545
|
-
}),
|
|
546
|
-
style: sx('tab.header', {
|
|
547
|
-
headerStyle: headerStyle,
|
|
548
|
-
_style: _style
|
|
549
|
-
}),
|
|
550
|
-
role: 'presentation'
|
|
551
|
-
}, getTabPT(tab, 'root'), getTabPT(tab, 'header'));
|
|
552
|
-
return /*#__PURE__*/React.createElement("li", headerProps, content);
|
|
553
|
-
};
|
|
554
|
-
var createTabHeaders = function createTabHeaders() {
|
|
555
|
-
return React.Children.map(props.children, function (tab, index) {
|
|
556
|
-
if (shouldUseTab(tab, index)) {
|
|
557
|
-
return createTabHeader(tab, index);
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
};
|
|
561
|
-
var createNavigator = function createNavigator() {
|
|
562
|
-
var headers = createTabHeaders();
|
|
563
|
-
var navContentProps = mergeProps({
|
|
564
|
-
id: idState,
|
|
565
|
-
ref: contentRef,
|
|
566
|
-
className: cx('navcontent'),
|
|
567
|
-
style: props.style,
|
|
568
|
-
onScroll: onScroll
|
|
569
|
-
}, ptm('navcontent'));
|
|
570
|
-
var navProps = mergeProps({
|
|
571
|
-
ref: navRef,
|
|
572
|
-
className: cx('nav'),
|
|
573
|
-
role: 'tablist'
|
|
574
|
-
}, ptm('nav'));
|
|
575
|
-
var inkbarProps = mergeProps({
|
|
576
|
-
ref: inkbarRef,
|
|
577
|
-
className: cx('inkbar')
|
|
578
|
-
}, ptm('inkbar'));
|
|
579
|
-
return /*#__PURE__*/React.createElement("div", navContentProps, /*#__PURE__*/React.createElement("ul", navProps, headers, /*#__PURE__*/React.createElement("li", inkbarProps)));
|
|
580
|
-
};
|
|
581
|
-
var createContent = function createContent() {
|
|
582
|
-
var panelContainerProps = mergeProps({
|
|
583
|
-
className: cx('panelcontainer'),
|
|
584
|
-
style: props.panelContainerStyle
|
|
585
|
-
}, ptm('panelcontainer'));
|
|
586
|
-
var contents = React.Children.map(props.children, function (tab, index) {
|
|
587
|
-
if (shouldUseTab(tab, index) && (!props.renderActiveOnly || isSelected(index))) {
|
|
588
|
-
var selected = isSelected(index);
|
|
589
|
-
var contentId = idState + '_content_' + index;
|
|
590
|
-
var ariaLabelledBy = idState + '_header_' + index;
|
|
591
|
-
var contentProps = mergeProps({
|
|
592
|
-
id: contentId,
|
|
593
|
-
className: cx('tab.content', {
|
|
594
|
-
props: props,
|
|
595
|
-
selected: selected,
|
|
596
|
-
getTabProp: getTabProp,
|
|
597
|
-
tab: tab,
|
|
598
|
-
isSelected: isSelected,
|
|
599
|
-
shouldUseTab: shouldUseTab,
|
|
600
|
-
index: index
|
|
601
|
-
}),
|
|
602
|
-
style: sx('tab.content', {
|
|
603
|
-
props: props,
|
|
604
|
-
getTabProp: getTabProp,
|
|
605
|
-
tab: tab,
|
|
606
|
-
isSelected: isSelected,
|
|
607
|
-
shouldUseTab: shouldUseTab,
|
|
608
|
-
index: index
|
|
609
|
-
}),
|
|
610
|
-
role: 'tabpanel',
|
|
611
|
-
'aria-labelledby': ariaLabelledBy,
|
|
612
|
-
'aria-hidden': !selected
|
|
613
|
-
}, TabPanelBase.getCOtherProps(tab), getTabPT(tab, 'root'), getTabPT(tab, 'content'));
|
|
614
|
-
return /*#__PURE__*/React.createElement("div", contentProps, !props.renderActiveOnly ? getTabProp(tab, 'children') : selected && getTabProp(tab, 'children'));
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
return /*#__PURE__*/React.createElement("div", panelContainerProps, contents);
|
|
618
|
-
};
|
|
619
|
-
var createPrevButton = function createPrevButton() {
|
|
620
|
-
var prevIconProps = mergeProps(ptm('previcon'));
|
|
621
|
-
var icon = props.prevButton || /*#__PURE__*/React.createElement(ChevronLeftIcon, prevIconProps);
|
|
622
|
-
var leftIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, prevIconProps), {
|
|
623
|
-
props: props
|
|
624
|
-
});
|
|
625
|
-
var prevButtonProps = mergeProps({
|
|
626
|
-
ref: prevBtnRef,
|
|
627
|
-
type: 'button',
|
|
628
|
-
className: cx('prevbutton'),
|
|
629
|
-
'aria-label': ariaLabel('previousPageLabel'),
|
|
630
|
-
onClick: function onClick(e) {
|
|
631
|
-
return navBackward();
|
|
632
|
-
}
|
|
633
|
-
}, ptm('prevbutton'));
|
|
634
|
-
if (props.scrollable && !backwardIsDisabledState) {
|
|
635
|
-
return /*#__PURE__*/React.createElement("button", prevButtonProps, leftIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
636
|
-
}
|
|
637
|
-
return null;
|
|
638
|
-
};
|
|
639
|
-
var createNextButton = function createNextButton() {
|
|
640
|
-
var nextIconProps = mergeProps({
|
|
641
|
-
'aria-hidden': 'true'
|
|
642
|
-
}, ptm('nexticon'));
|
|
643
|
-
var icon = props.nextButton || /*#__PURE__*/React.createElement(ChevronRightIcon, nextIconProps);
|
|
644
|
-
var rightIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, nextIconProps), {
|
|
645
|
-
props: props
|
|
646
|
-
});
|
|
647
|
-
var nextButtonProps = mergeProps({
|
|
648
|
-
ref: nextBtnRef,
|
|
649
|
-
type: 'button',
|
|
650
|
-
className: cx('nextbutton'),
|
|
651
|
-
'aria-label': ariaLabel('nextPageLabel'),
|
|
652
|
-
onClick: function onClick(e) {
|
|
653
|
-
return navForward();
|
|
654
|
-
}
|
|
655
|
-
}, ptm('nextbutton'));
|
|
656
|
-
if (props.scrollable && !forwardIsDisabledState) {
|
|
657
|
-
return /*#__PURE__*/React.createElement("button", nextButtonProps, rightIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
var rootProps = mergeProps({
|
|
661
|
-
id: idState,
|
|
662
|
-
ref: elementRef,
|
|
663
|
-
style: props.style,
|
|
664
|
-
className: cx('root')
|
|
665
|
-
}, TabViewBase.getOtherProps(props), ptm('root'));
|
|
666
|
-
var navContainerProps = mergeProps({
|
|
667
|
-
className: cx('navcontainer')
|
|
668
|
-
}, ptm('navcontainer'));
|
|
669
|
-
var navigator = createNavigator();
|
|
670
|
-
var content = createContent();
|
|
671
|
-
var prevButton = createPrevButton();
|
|
672
|
-
var nextButton = createNextButton();
|
|
673
|
-
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("div", navContainerProps, prevButton, navigator, nextButton), content);
|
|
674
|
-
});
|
|
675
|
-
TabPanel.displayName = 'TabPanel';
|
|
676
|
-
TabView.displayName = 'TabView';
|
|
677
|
-
|
|
678
|
-
export { TabPanel, TabView };
|