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/tabmenu/tabmenu.esm.js
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PrimeReactContext } from 'primereact/api';
|
|
5
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
|
-
import { useMountEffect } from 'primereact/hooks';
|
|
7
|
-
import { Ripple } from 'primereact/ripple';
|
|
8
|
-
import { classNames, UniqueComponentId, mergeProps, DomHandler, IconUtils, ObjectUtils } from 'primereact/utils';
|
|
9
|
-
|
|
10
|
-
function _typeof(o) {
|
|
11
|
-
"@babel/helpers - typeof";
|
|
12
|
-
|
|
13
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
14
|
-
return typeof o;
|
|
15
|
-
} : function (o) {
|
|
16
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
17
|
-
}, _typeof(o);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function _toPrimitive(input, hint) {
|
|
21
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
22
|
-
var prim = input[Symbol.toPrimitive];
|
|
23
|
-
if (prim !== undefined) {
|
|
24
|
-
var res = prim.call(input, hint || "default");
|
|
25
|
-
if (_typeof(res) !== "object") return res;
|
|
26
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
27
|
-
}
|
|
28
|
-
return (hint === "string" ? String : Number)(input);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function _toPropertyKey(arg) {
|
|
32
|
-
var key = _toPrimitive(arg, "string");
|
|
33
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _defineProperty(obj, key, value) {
|
|
37
|
-
key = _toPropertyKey(key);
|
|
38
|
-
if (key in obj) {
|
|
39
|
-
Object.defineProperty(obj, key, {
|
|
40
|
-
value: value,
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true
|
|
44
|
-
});
|
|
45
|
-
} else {
|
|
46
|
-
obj[key] = value;
|
|
47
|
-
}
|
|
48
|
-
return obj;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function _arrayWithHoles(arr) {
|
|
52
|
-
if (Array.isArray(arr)) return arr;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function _iterableToArrayLimit(r, l) {
|
|
56
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
57
|
-
if (null != t) {
|
|
58
|
-
var e,
|
|
59
|
-
n,
|
|
60
|
-
i,
|
|
61
|
-
u,
|
|
62
|
-
a = [],
|
|
63
|
-
f = !0,
|
|
64
|
-
o = !1;
|
|
65
|
-
try {
|
|
66
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
67
|
-
if (Object(t) !== t) return;
|
|
68
|
-
f = !1;
|
|
69
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
70
|
-
} catch (r) {
|
|
71
|
-
o = !0, n = r;
|
|
72
|
-
} finally {
|
|
73
|
-
try {
|
|
74
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
75
|
-
} finally {
|
|
76
|
-
if (o) throw n;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return a;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function _arrayLikeToArray(arr, len) {
|
|
84
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
85
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
86
|
-
return arr2;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
90
|
-
if (!o) return;
|
|
91
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
92
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
93
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
94
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
95
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function _nonIterableRest() {
|
|
99
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _slicedToArray(arr, i) {
|
|
103
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
var classes = {
|
|
107
|
-
icon: function icon(_ref) {
|
|
108
|
-
var _icon = _ref._icon;
|
|
109
|
-
return classNames('p-menuitem-icon', _icon);
|
|
110
|
-
},
|
|
111
|
-
label: 'p-menuitem-text',
|
|
112
|
-
action: 'p-menuitem-link',
|
|
113
|
-
menuitem: function menuitem(_ref2) {
|
|
114
|
-
var _className = _ref2._className,
|
|
115
|
-
active = _ref2.active,
|
|
116
|
-
disabled = _ref2.disabled;
|
|
117
|
-
return classNames('p-tabmenuitem', {
|
|
118
|
-
'p-highlight': active,
|
|
119
|
-
'p-disabled': disabled
|
|
120
|
-
}, _className);
|
|
121
|
-
},
|
|
122
|
-
inkbar: 'p-tabmenu-ink-bar',
|
|
123
|
-
menu: 'p-tabmenu-nav p-reset',
|
|
124
|
-
root: function root(_ref3) {
|
|
125
|
-
var props = _ref3.props;
|
|
126
|
-
return classNames('p-tabmenu p-component', props.className);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
var styles = "\n@layer primereact {\n .p-tabmenu {\n overflow-x: auto;\n }\n \n .p-tabmenu-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex-wrap: nowrap;\n }\n \n .p-tabmenu-nav a {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n text-decoration: none;\n overflow: hidden;\n }\n \n .p-tabmenu-nav a:focus {\n z-index: 1;\n }\n \n .p-tabmenu-nav .p-menuitem-text {\n line-height: 1;\n }\n \n .p-tabmenu-ink-bar {\n display: none;\n z-index: 1;\n }\n \n .p-tabmenu::-webkit-scrollbar {\n display: none;\n }\n}\n";
|
|
130
|
-
var TabMenuBase = ComponentBase.extend({
|
|
131
|
-
defaultProps: {
|
|
132
|
-
__TYPE: 'TabMenu',
|
|
133
|
-
id: null,
|
|
134
|
-
model: null,
|
|
135
|
-
activeIndex: 0,
|
|
136
|
-
style: null,
|
|
137
|
-
className: null,
|
|
138
|
-
onTabChange: null,
|
|
139
|
-
children: undefined
|
|
140
|
-
},
|
|
141
|
-
css: {
|
|
142
|
-
classes: classes,
|
|
143
|
-
styles: styles
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
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; }
|
|
148
|
-
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; }
|
|
149
|
-
var TabMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
150
|
-
var context = React.useContext(PrimeReactContext);
|
|
151
|
-
var props = TabMenuBase.getProps(inProps, context);
|
|
152
|
-
var _React$useState = React.useState(props.id),
|
|
153
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
154
|
-
idState = _React$useState2[0],
|
|
155
|
-
setIdState = _React$useState2[1];
|
|
156
|
-
var _React$useState3 = React.useState(props.activeIndex),
|
|
157
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
158
|
-
activeIndexState = _React$useState4[0],
|
|
159
|
-
setActiveIndexState = _React$useState4[1];
|
|
160
|
-
var elementRef = React.useRef(null);
|
|
161
|
-
var inkbarRef = React.useRef(null);
|
|
162
|
-
var navRef = React.useRef(null);
|
|
163
|
-
var tabsRef = React.useRef({});
|
|
164
|
-
var activeIndex = props.onTabChange ? props.activeIndex : activeIndexState;
|
|
165
|
-
var _TabMenuBase$setMetaD = TabMenuBase.setMetaData({
|
|
166
|
-
props: props,
|
|
167
|
-
state: {
|
|
168
|
-
id: idState,
|
|
169
|
-
activeIndex: activeIndexState
|
|
170
|
-
}
|
|
171
|
-
}),
|
|
172
|
-
ptm = _TabMenuBase$setMetaD.ptm,
|
|
173
|
-
cx = _TabMenuBase$setMetaD.cx,
|
|
174
|
-
isUnstyled = _TabMenuBase$setMetaD.isUnstyled;
|
|
175
|
-
var getPTOptions = function getPTOptions(key, item, index) {
|
|
176
|
-
return ptm(key, {
|
|
177
|
-
context: {
|
|
178
|
-
item: item,
|
|
179
|
-
index: index
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
};
|
|
183
|
-
useHandleStyle(TabMenuBase.css.styles, isUnstyled, {
|
|
184
|
-
name: 'tabmenu'
|
|
185
|
-
});
|
|
186
|
-
var itemClick = function itemClick(event, item, index) {
|
|
187
|
-
if (item.disabled) {
|
|
188
|
-
event.preventDefault();
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (!item.url) {
|
|
192
|
-
event.preventDefault();
|
|
193
|
-
}
|
|
194
|
-
if (item.command) {
|
|
195
|
-
item.command({
|
|
196
|
-
originalEvent: event,
|
|
197
|
-
item: item
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
if (props.onTabChange) {
|
|
201
|
-
props.onTabChange({
|
|
202
|
-
originalEvent: event,
|
|
203
|
-
value: item,
|
|
204
|
-
index: index
|
|
205
|
-
});
|
|
206
|
-
} else {
|
|
207
|
-
setActiveIndexState(index);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
var isSelected = function isSelected(index) {
|
|
211
|
-
return index === (activeIndex || 0);
|
|
212
|
-
};
|
|
213
|
-
var updateInkBar = function updateInkBar() {
|
|
214
|
-
if (props.model) {
|
|
215
|
-
var tabHeader = tabsRef.current["tab_".concat(activeIndex)];
|
|
216
|
-
inkbarRef.current.style.width = DomHandler.getWidth(tabHeader) + 'px';
|
|
217
|
-
inkbarRef.current.style.left = DomHandler.getOffset(tabHeader).left - DomHandler.getOffset(navRef.current).left + 'px';
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
useMountEffect(function () {
|
|
221
|
-
if (!idState) {
|
|
222
|
-
setIdState(UniqueComponentId());
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
React.useImperativeHandle(ref, function () {
|
|
226
|
-
return {
|
|
227
|
-
props: props,
|
|
228
|
-
getElement: function getElement() {
|
|
229
|
-
return elementRef.current;
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
});
|
|
233
|
-
React.useEffect(function () {
|
|
234
|
-
updateInkBar();
|
|
235
|
-
});
|
|
236
|
-
var createMenuItem = function createMenuItem(item, index) {
|
|
237
|
-
if (item.visible === false) {
|
|
238
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
var _className = item.className,
|
|
241
|
-
style = item.style,
|
|
242
|
-
disabled = item.disabled,
|
|
243
|
-
_icon = item.icon,
|
|
244
|
-
_label = item.label,
|
|
245
|
-
template = item.template,
|
|
246
|
-
url = item.url,
|
|
247
|
-
target = item.target;
|
|
248
|
-
var key = item.id || idState + '_' + index;
|
|
249
|
-
var active = isSelected(index);
|
|
250
|
-
var iconClassName = classNames('p-menuitem-icon', _icon);
|
|
251
|
-
var iconProps = mergeProps({
|
|
252
|
-
className: cx('icon', {
|
|
253
|
-
_icon: _icon
|
|
254
|
-
})
|
|
255
|
-
}, getPTOptions('icon', item, index));
|
|
256
|
-
var icon = IconUtils.getJSXIcon(_icon, _objectSpread({}, iconProps), {
|
|
257
|
-
props: props
|
|
258
|
-
});
|
|
259
|
-
var labelProps = mergeProps({
|
|
260
|
-
className: cx('label')
|
|
261
|
-
}, getPTOptions('label', item, index));
|
|
262
|
-
var label = _label && /*#__PURE__*/React.createElement("span", labelProps, _label);
|
|
263
|
-
var actionProps = mergeProps({
|
|
264
|
-
href: url || '#',
|
|
265
|
-
className: cx('action'),
|
|
266
|
-
target: target,
|
|
267
|
-
onClick: function onClick(event) {
|
|
268
|
-
return itemClick(event, item, index);
|
|
269
|
-
},
|
|
270
|
-
role: 'presentation'
|
|
271
|
-
}, getPTOptions('action', item, index));
|
|
272
|
-
var content = /*#__PURE__*/React.createElement("a", actionProps, icon, label, /*#__PURE__*/React.createElement(Ripple, null));
|
|
273
|
-
if (template) {
|
|
274
|
-
var defaultContentOptions = {
|
|
275
|
-
onClick: function onClick(event) {
|
|
276
|
-
return itemClick(event, item, index);
|
|
277
|
-
},
|
|
278
|
-
className: 'p-menuitem-link',
|
|
279
|
-
labelClassName: 'p-menuitem-text',
|
|
280
|
-
iconClassName: iconClassName,
|
|
281
|
-
element: content,
|
|
282
|
-
props: props,
|
|
283
|
-
active: active,
|
|
284
|
-
index: index,
|
|
285
|
-
disabled: disabled
|
|
286
|
-
};
|
|
287
|
-
content = ObjectUtils.getJSXElement(template, item, defaultContentOptions);
|
|
288
|
-
}
|
|
289
|
-
var menuItemProps = mergeProps({
|
|
290
|
-
ref: tabsRef.current["tab_".concat(index)],
|
|
291
|
-
id: key,
|
|
292
|
-
key: key,
|
|
293
|
-
className: cx('menuitem', {
|
|
294
|
-
_className: _className,
|
|
295
|
-
active: active,
|
|
296
|
-
disabled: disabled
|
|
297
|
-
}),
|
|
298
|
-
style: style,
|
|
299
|
-
role: 'tab',
|
|
300
|
-
'aria-selected': active,
|
|
301
|
-
'aria-expanded': active,
|
|
302
|
-
'aria-disabled': disabled
|
|
303
|
-
}, getPTOptions('menuitem', item, index));
|
|
304
|
-
return /*#__PURE__*/React.createElement("li", menuItemProps, content);
|
|
305
|
-
};
|
|
306
|
-
var createItems = function createItems() {
|
|
307
|
-
return props.model.map(createMenuItem);
|
|
308
|
-
};
|
|
309
|
-
if (props.model) {
|
|
310
|
-
var items = createItems();
|
|
311
|
-
var inkbarProps = mergeProps({
|
|
312
|
-
ref: inkbarRef,
|
|
313
|
-
className: cx('inkbar')
|
|
314
|
-
}, ptm('inkbar'));
|
|
315
|
-
var menuProps = mergeProps({
|
|
316
|
-
ref: navRef,
|
|
317
|
-
className: cx('menu'),
|
|
318
|
-
role: 'tablist'
|
|
319
|
-
}, ptm('menu'));
|
|
320
|
-
var rootProps = mergeProps({
|
|
321
|
-
id: props.id,
|
|
322
|
-
ref: elementRef,
|
|
323
|
-
className: cx('root'),
|
|
324
|
-
style: props.style
|
|
325
|
-
}, TabMenuBase.getOtherProps(props), ptm('root'));
|
|
326
|
-
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("ul", menuProps, items, /*#__PURE__*/React.createElement("li", inkbarProps)));
|
|
327
|
-
}
|
|
328
|
-
return null;
|
|
329
|
-
}));
|
|
330
|
-
TabMenu.displayName = 'TabMenu';
|
|
331
|
-
|
|
332
|
-
export { TabMenu };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as r}from"primereact/componentbase";import{useMountEffect as a}from"primereact/hooks";import{Ripple as i}from"primereact/ripple";import{classNames as o,UniqueComponentId as l,mergeProps as u,DomHandler as c,IconUtils as s,ObjectUtils as m}from"primereact/utils";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 f(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function b(e){var t=f(e,"string");return"symbol"===p(t)?t:String(t)}function d(e){if(Array.isArray(e))return e}function y(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(e,t){return d(e)||y(e,t)||g(e,t)||h()}var O=n.extend({defaultProps:{__TYPE:"TabMenu",id:null,model:null,activeIndex:0,style:null,className:null,onTabChange:null,children:void 0},css:{classes:{icon:function(e){return o("p-menuitem-icon",e._icon)},label:"p-menuitem-text",action:"p-menuitem-link",menuitem:function(e){return o("p-tabmenuitem",{"p-highlight":e.active,"p-disabled":e.disabled},e._className)},inkbar:"p-tabmenu-ink-bar",menu:"p-tabmenu-nav p-reset",root:function(e){return o("p-tabmenu p-component",e.props.className)}},styles:"\n@layer primereact {\n .p-tabmenu {\n overflow-x: auto;\n }\n \n .p-tabmenu-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex-wrap: nowrap;\n }\n \n .p-tabmenu-nav a {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n text-decoration: none;\n overflow: hidden;\n }\n \n .p-tabmenu-nav a:focus {\n z-index: 1;\n }\n \n .p-tabmenu-nav .p-menuitem-text {\n line-height: 1;\n }\n \n .p-tabmenu-ink-bar {\n display: none;\n z-index: 1;\n }\n \n .p-tabmenu::-webkit-scrollbar {\n display: none;\n }\n}\n"}});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 j(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){var r,a,i;r=e,i=n[t],(a=b(a=t))in r?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var S=e.memo(e.forwardRef((function(n,p){var f=e.useContext(t),b=O.getProps(n,f),d=x(e.useState(b.id),2),y=d[0],v=d[1],g=x(e.useState(b.activeIndex),2),h=g[0],w=g[1],S=e.useRef(null),E=e.useRef(null),N=e.useRef(null),P=e.useRef({}),k=b.onTabChange?b.activeIndex:h,C=O.setMetaData({props:b,state:{id:y,activeIndex:h}}),I=C.ptm,T=C.cx,_=function(e,t,n){return I(e,{context:{item:t,index:n}})};r(O.css.styles,C.isUnstyled,{name:"tabmenu"});var D=function(e,t,n){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),b.onTabChange?b.onTabChange({originalEvent:e,value:t,index:n}):w(n))},A=function(e){return e===(k||0)},R=function(){if(b.model){var e=P.current["tab_".concat(k)];E.current.style.width=c.getWidth(e)+"px",E.current.style.left=c.getOffset(e).left-c.getOffset(N.current).left+"px"}};a((function(){y||v(l())})),e.useImperativeHandle(p,(function(){return{props:b,getElement:function(){return S.current}}})),e.useEffect((function(){R()}));var M=function(t,n){if(!1===t.visible)return null;var r=t.className,a=t.style,l=t.disabled,c=t.icon,p=t.label,f=t.template,d=t.url,v=t.target,g=t.id||y+"_"+n,h=A(n),x=o("p-menuitem-icon",c),O=u({className:T("icon",{_icon:c})},_("icon",t,n)),w=s.getJSXIcon(c,j({},O),{props:b}),S=u({className:T("label")},_("label",t,n)),E=p&&e.createElement("span",S,p),N=u({href:d||"#",className:T("action"),target:v,onClick:function(e){return D(e,t,n)},role:"presentation"},_("action",t,n)),k=e.createElement("a",N,w,E,e.createElement(i,null));f&&(k=m.getJSXElement(f,t,{onClick:function(e){return D(e,t,n)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:x,element:k,props:b,active:h,index:n,disabled:l}));var C=u({ref:P.current["tab_".concat(n)],id:g,key:g,className:T("menuitem",{_className:r,active:h,disabled:l}),style:a,role:"tab","aria-selected":h,"aria-expanded":h,"aria-disabled":l},_("menuitem",t,n));return e.createElement("li",C,k)};if(b.model){var z=b.model.map(M),J=u({ref:E,className:T("inkbar")},I("inkbar")),U=u({ref:N,className:T("menu"),role:"tablist"},I("menu")),X=u({id:b.id,ref:S,className:T("root"),style:b.style},O.getOtherProps(b),I("root"));return e.createElement("div",X,e.createElement("ul",U,z,e.createElement("li",J)))}return null})));S.displayName="TabMenu";export{S as TabMenu};
|