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
|
@@ -1,645 +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 { CSSTransition } from 'primereact/csstransition';
|
|
7
|
-
import { useMountEffect, useUpdateEffect } from 'primereact/hooks';
|
|
8
|
-
import { ChevronDownIcon } from 'primereact/icons/chevrondown';
|
|
9
|
-
import { ChevronRightIcon } from 'primereact/icons/chevronright';
|
|
10
|
-
import { classNames, mergeProps, IconUtils, ObjectUtils, UniqueComponentId } from 'primereact/utils';
|
|
11
|
-
|
|
12
|
-
function _extends() {
|
|
13
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
14
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
15
|
-
var source = arguments[i];
|
|
16
|
-
for (var key in source) {
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
18
|
-
target[key] = source[key];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return target;
|
|
23
|
-
};
|
|
24
|
-
return _extends.apply(this, arguments);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function _typeof(o) {
|
|
28
|
-
"@babel/helpers - typeof";
|
|
29
|
-
|
|
30
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
31
|
-
return typeof o;
|
|
32
|
-
} : function (o) {
|
|
33
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
34
|
-
}, _typeof(o);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function _toPrimitive(input, hint) {
|
|
38
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
39
|
-
var prim = input[Symbol.toPrimitive];
|
|
40
|
-
if (prim !== undefined) {
|
|
41
|
-
var res = prim.call(input, hint || "default");
|
|
42
|
-
if (_typeof(res) !== "object") return res;
|
|
43
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
44
|
-
}
|
|
45
|
-
return (hint === "string" ? String : Number)(input);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _toPropertyKey(arg) {
|
|
49
|
-
var key = _toPrimitive(arg, "string");
|
|
50
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _defineProperty(obj, key, value) {
|
|
54
|
-
key = _toPropertyKey(key);
|
|
55
|
-
if (key in obj) {
|
|
56
|
-
Object.defineProperty(obj, key, {
|
|
57
|
-
value: value,
|
|
58
|
-
enumerable: true,
|
|
59
|
-
configurable: true,
|
|
60
|
-
writable: true
|
|
61
|
-
});
|
|
62
|
-
} else {
|
|
63
|
-
obj[key] = value;
|
|
64
|
-
}
|
|
65
|
-
return obj;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _arrayLikeToArray(arr, len) {
|
|
69
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
70
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
71
|
-
return arr2;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _arrayWithoutHoles(arr) {
|
|
75
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _iterableToArray(iter) {
|
|
79
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
83
|
-
if (!o) return;
|
|
84
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
85
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
86
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
87
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
88
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function _nonIterableSpread() {
|
|
92
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function _toConsumableArray(arr) {
|
|
96
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function _arrayWithHoles(arr) {
|
|
100
|
-
if (Array.isArray(arr)) return arr;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function _iterableToArrayLimit(r, l) {
|
|
104
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
105
|
-
if (null != t) {
|
|
106
|
-
var e,
|
|
107
|
-
n,
|
|
108
|
-
i,
|
|
109
|
-
u,
|
|
110
|
-
a = [],
|
|
111
|
-
f = !0,
|
|
112
|
-
o = !1;
|
|
113
|
-
try {
|
|
114
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
115
|
-
if (Object(t) !== t) return;
|
|
116
|
-
f = !1;
|
|
117
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
118
|
-
} catch (r) {
|
|
119
|
-
o = !0, n = r;
|
|
120
|
-
} finally {
|
|
121
|
-
try {
|
|
122
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
123
|
-
} finally {
|
|
124
|
-
if (o) throw n;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return a;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function _nonIterableRest() {
|
|
132
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function _slicedToArray(arr, i) {
|
|
136
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
var classes = {
|
|
140
|
-
headerIcon: function headerIcon(_ref) {
|
|
141
|
-
var item = _ref.item;
|
|
142
|
-
return classNames('p-menuitem-icon', item.icon);
|
|
143
|
-
},
|
|
144
|
-
headerSubmenuIcon: 'p-panelmenu-icon',
|
|
145
|
-
headerLabel: 'p-menuitem-text',
|
|
146
|
-
headerAction: 'p-panelmenu-header-link',
|
|
147
|
-
panel: function panel(_ref2) {
|
|
148
|
-
var item = _ref2.item;
|
|
149
|
-
return classNames('p-panelmenu-panel', item.className);
|
|
150
|
-
},
|
|
151
|
-
header: function header(_ref3) {
|
|
152
|
-
var active = _ref3.active,
|
|
153
|
-
item = _ref3.item;
|
|
154
|
-
return classNames('p-component p-panelmenu-header', {
|
|
155
|
-
'p-highlight': active,
|
|
156
|
-
'p-disabled': item.disabled
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
menuContent: 'p-panelmenu-content',
|
|
160
|
-
root: function root(_ref4) {
|
|
161
|
-
var props = _ref4.props;
|
|
162
|
-
return classNames('p-panelmenu p-component', props.className);
|
|
163
|
-
},
|
|
164
|
-
separator: 'p-menu-separator',
|
|
165
|
-
toggleableContent: function toggleableContent(_ref5) {
|
|
166
|
-
var active = _ref5.active;
|
|
167
|
-
return classNames('p-toggleable-content', {
|
|
168
|
-
'p-toggleable-content-collapsed': !active
|
|
169
|
-
});
|
|
170
|
-
},
|
|
171
|
-
icon: function icon(_ref6) {
|
|
172
|
-
var item = _ref6.item;
|
|
173
|
-
return classNames('p-menuitem-icon', item.icon);
|
|
174
|
-
},
|
|
175
|
-
label: 'p-menuitem-text',
|
|
176
|
-
submenuicon: 'p-panelmenu-icon',
|
|
177
|
-
action: function action(_ref7) {
|
|
178
|
-
var item = _ref7.item;
|
|
179
|
-
return classNames('p-menuitem-link', {
|
|
180
|
-
'p-disabled': item.disabled
|
|
181
|
-
});
|
|
182
|
-
},
|
|
183
|
-
menuitem: function menuitem(_ref8) {
|
|
184
|
-
var item = _ref8.item;
|
|
185
|
-
return classNames('p-menuitem', item.className);
|
|
186
|
-
},
|
|
187
|
-
menu: 'p-submenu-list',
|
|
188
|
-
submenu: 'p-submenu-list',
|
|
189
|
-
transition: 'p-toggleable-content'
|
|
190
|
-
};
|
|
191
|
-
var styles = "\n@layer primereact {\n .p-panelmenu .p-panelmenu-header-link {\n display: flex;\n align-items: center;\n user-select: none;\n cursor: pointer;\n position: relative;\n text-decoration: none;\n }\n \n .p-panelmenu .p-panelmenu-header-link:focus {\n z-index: 1;\n }\n \n .p-panelmenu .p-submenu-list {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n \n .p-panelmenu .p-menuitem-link {\n display: flex;\n align-items: center;\n user-select: none;\n cursor: pointer;\n text-decoration: none;\n }\n \n .p-panelmenu .p-menuitem-text {\n line-height: 1;\n }\n}\n";
|
|
192
|
-
var PanelMenuBase = ComponentBase.extend({
|
|
193
|
-
defaultProps: {
|
|
194
|
-
__TYPE: 'Panel',
|
|
195
|
-
id: null,
|
|
196
|
-
model: null,
|
|
197
|
-
style: null,
|
|
198
|
-
submenuIcon: null,
|
|
199
|
-
className: null,
|
|
200
|
-
multiple: false,
|
|
201
|
-
transitionOptions: null,
|
|
202
|
-
children: undefined
|
|
203
|
-
},
|
|
204
|
-
css: {
|
|
205
|
-
classes: classes,
|
|
206
|
-
styles: styles
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
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; }
|
|
211
|
-
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; }
|
|
212
|
-
var PanelMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
213
|
-
var _React$useState = React.useState(null),
|
|
214
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
215
|
-
activeItemState = _React$useState2[0],
|
|
216
|
-
setActiveItemState = _React$useState2[1];
|
|
217
|
-
var ptm = props.ptm,
|
|
218
|
-
cx = props.cx;
|
|
219
|
-
var _ptm = function _ptm(key, options) {
|
|
220
|
-
return ptm(key, _objectSpread$1({
|
|
221
|
-
hostName: props.hostName
|
|
222
|
-
}, options));
|
|
223
|
-
};
|
|
224
|
-
var getPTOptions = function getPTOptions(item, key) {
|
|
225
|
-
return _ptm(key, {
|
|
226
|
-
context: {
|
|
227
|
-
active: isItemActive(item)
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
var findActiveItem = function findActiveItem() {
|
|
232
|
-
if (props.model) {
|
|
233
|
-
if (props.multiple) {
|
|
234
|
-
return props.model.filter(function (item) {
|
|
235
|
-
return item.expanded;
|
|
236
|
-
});
|
|
237
|
-
} else {
|
|
238
|
-
var activeItem = null;
|
|
239
|
-
props.model.forEach(function (item) {
|
|
240
|
-
if (item.expanded) {
|
|
241
|
-
if (!activeItem) activeItem = item;else item.expanded = false;
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
return activeItem;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
return null;
|
|
248
|
-
};
|
|
249
|
-
var onItemClick = function onItemClick(event, item) {
|
|
250
|
-
if (item.disabled) {
|
|
251
|
-
event.preventDefault();
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
if (!item.url) {
|
|
255
|
-
event.preventDefault();
|
|
256
|
-
}
|
|
257
|
-
if (item.command) {
|
|
258
|
-
item.command({
|
|
259
|
-
originalEvent: event,
|
|
260
|
-
item: item
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
var activeItem = activeItemState;
|
|
264
|
-
var active = isItemActive(item);
|
|
265
|
-
if (active) {
|
|
266
|
-
item.expanded = false;
|
|
267
|
-
setActiveItemState(props.multiple ? activeItem.filter(function (a_item) {
|
|
268
|
-
return a_item !== item;
|
|
269
|
-
}) : null);
|
|
270
|
-
} else {
|
|
271
|
-
if (!props.multiple && activeItem) {
|
|
272
|
-
activeItem.expanded = false;
|
|
273
|
-
}
|
|
274
|
-
item.expanded = true;
|
|
275
|
-
setActiveItemState(props.multiple ? [].concat(_toConsumableArray(activeItem || []), [item]) : item);
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
var isItemActive = function isItemActive(item) {
|
|
279
|
-
return activeItemState && (props.multiple ? activeItemState.indexOf(item) > -1 : activeItemState === item);
|
|
280
|
-
};
|
|
281
|
-
useMountEffect(function () {
|
|
282
|
-
setActiveItemState(findActiveItem());
|
|
283
|
-
});
|
|
284
|
-
var createSeparator = function createSeparator(index) {
|
|
285
|
-
var key = props.id + '_sep_' + index;
|
|
286
|
-
var separatorProps = mergeProps({
|
|
287
|
-
id: key,
|
|
288
|
-
key: key,
|
|
289
|
-
className: cx('separator'),
|
|
290
|
-
role: 'separator'
|
|
291
|
-
}, _ptm('separator'));
|
|
292
|
-
return /*#__PURE__*/React.createElement("li", separatorProps);
|
|
293
|
-
};
|
|
294
|
-
var createSubmenu = function createSubmenu(item, active, index) {
|
|
295
|
-
var submenuRef = /*#__PURE__*/React.createRef();
|
|
296
|
-
var toggleableContentProps = mergeProps({
|
|
297
|
-
className: cx('toggleableContent', {
|
|
298
|
-
active: active
|
|
299
|
-
})
|
|
300
|
-
}, _ptm('toggleableContent'));
|
|
301
|
-
if (item.items) {
|
|
302
|
-
var transitionProps = mergeProps({
|
|
303
|
-
classNames: cx('transition'),
|
|
304
|
-
timeout: {
|
|
305
|
-
enter: 1000,
|
|
306
|
-
exit: 450
|
|
307
|
-
},
|
|
308
|
-
"in": active,
|
|
309
|
-
unmountOnExit: true
|
|
310
|
-
}, _ptm('transition'));
|
|
311
|
-
return /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
312
|
-
nodeRef: submenuRef
|
|
313
|
-
}, transitionProps), /*#__PURE__*/React.createElement("div", _extends({
|
|
314
|
-
ref: submenuRef
|
|
315
|
-
}, toggleableContentProps), /*#__PURE__*/React.createElement(PanelMenuSub, {
|
|
316
|
-
id: props.id + '_' + index,
|
|
317
|
-
menuProps: props.menuProps,
|
|
318
|
-
model: item.items,
|
|
319
|
-
multiple: props.multiple,
|
|
320
|
-
submenuIcon: props.submenuIcon,
|
|
321
|
-
ptm: ptm,
|
|
322
|
-
cx: cx
|
|
323
|
-
})));
|
|
324
|
-
}
|
|
325
|
-
return null;
|
|
326
|
-
};
|
|
327
|
-
var createMenuItem = function createMenuItem(item, index) {
|
|
328
|
-
if (item.visible === false) {
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
|
-
var key = item.id || props.id + '_' + index;
|
|
332
|
-
var active = isItemActive(item);
|
|
333
|
-
var linkClassName = classNames('p-menuitem-link', {
|
|
334
|
-
'p-disabled': item.disabled
|
|
335
|
-
});
|
|
336
|
-
var iconClassName = classNames('p-menuitem-icon', item.icon);
|
|
337
|
-
var iconProps = mergeProps({
|
|
338
|
-
className: cx('icon', {
|
|
339
|
-
item: item
|
|
340
|
-
})
|
|
341
|
-
}, getPTOptions(item, 'icon'));
|
|
342
|
-
var icon = IconUtils.getJSXIcon(item.icon, _objectSpread$1({}, iconProps), {
|
|
343
|
-
props: props.menuProps
|
|
344
|
-
});
|
|
345
|
-
var labelProps = mergeProps({
|
|
346
|
-
className: cx('label')
|
|
347
|
-
}, getPTOptions(item, 'label'));
|
|
348
|
-
var label = item.label && /*#__PURE__*/React.createElement("span", labelProps, item.label);
|
|
349
|
-
var submenuIconClassName = 'p-panelmenu-icon';
|
|
350
|
-
var submenuIconProps = mergeProps({
|
|
351
|
-
className: cx('submenuicon')
|
|
352
|
-
}, getPTOptions(item, 'submenuicon'));
|
|
353
|
-
var submenuIcon = item.items && IconUtils.getJSXIcon(active ? props.submenuIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, submenuIconProps) : props.submenuIcon || /*#__PURE__*/React.createElement(ChevronRightIcon, submenuIconProps));
|
|
354
|
-
var submenu = createSubmenu(item, active, index);
|
|
355
|
-
var actionProps = mergeProps({
|
|
356
|
-
href: item.url || '#',
|
|
357
|
-
className: cx('action', {
|
|
358
|
-
item: item
|
|
359
|
-
}),
|
|
360
|
-
target: item.target,
|
|
361
|
-
onClick: function onClick(event) {
|
|
362
|
-
return onItemClick(event, item);
|
|
363
|
-
},
|
|
364
|
-
role: 'menuitem',
|
|
365
|
-
'aria-disabled': item.disabled
|
|
366
|
-
}, getPTOptions(item, 'action'));
|
|
367
|
-
var content = /*#__PURE__*/React.createElement("a", actionProps, submenuIcon, icon, label);
|
|
368
|
-
if (item.template) {
|
|
369
|
-
var defaultContentOptions = {
|
|
370
|
-
onClick: function onClick(event) {
|
|
371
|
-
return onItemClick(event, item);
|
|
372
|
-
},
|
|
373
|
-
className: linkClassName,
|
|
374
|
-
labelClassName: 'p-menuitem-text',
|
|
375
|
-
iconClassName: iconClassName,
|
|
376
|
-
submenuIconClassName: submenuIconClassName,
|
|
377
|
-
element: content,
|
|
378
|
-
props: props,
|
|
379
|
-
leaf: !item.items,
|
|
380
|
-
active: active
|
|
381
|
-
};
|
|
382
|
-
content = ObjectUtils.getJSXElement(item.template, item, defaultContentOptions);
|
|
383
|
-
}
|
|
384
|
-
var menuitemProps = mergeProps({
|
|
385
|
-
key: key,
|
|
386
|
-
id: key,
|
|
387
|
-
className: cx('menuitem', {
|
|
388
|
-
item: item
|
|
389
|
-
}),
|
|
390
|
-
style: item.style,
|
|
391
|
-
role: 'none'
|
|
392
|
-
}, getPTOptions(item, 'menuitem'));
|
|
393
|
-
return /*#__PURE__*/React.createElement("li", menuitemProps, content, submenu);
|
|
394
|
-
};
|
|
395
|
-
var createItem = function createItem(item, index) {
|
|
396
|
-
return item.separator ? createSeparator(index) : createMenuItem(item, index);
|
|
397
|
-
};
|
|
398
|
-
var createMenu = function createMenu() {
|
|
399
|
-
return props.model ? props.model.map(createItem) : null;
|
|
400
|
-
};
|
|
401
|
-
var menu = createMenu();
|
|
402
|
-
var ptKey = props.root ? 'menu' : 'submenu';
|
|
403
|
-
var menuProps = mergeProps({
|
|
404
|
-
className: classNames(cx(ptKey), props.className),
|
|
405
|
-
role: 'tree'
|
|
406
|
-
}, ptm(ptKey));
|
|
407
|
-
return /*#__PURE__*/React.createElement("ul", menuProps, menu);
|
|
408
|
-
});
|
|
409
|
-
PanelMenuSub.displayName = 'PanelMenuSub';
|
|
410
|
-
|
|
411
|
-
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; }
|
|
412
|
-
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; }
|
|
413
|
-
var PanelMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
414
|
-
var context = React.useContext(PrimeReactContext);
|
|
415
|
-
var props = PanelMenuBase.getProps(inProps, context);
|
|
416
|
-
var _React$useState = React.useState(props.id),
|
|
417
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
418
|
-
idState = _React$useState2[0],
|
|
419
|
-
setIdState = _React$useState2[1];
|
|
420
|
-
var _React$useState3 = React.useState(null),
|
|
421
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
422
|
-
activeItemState = _React$useState4[0],
|
|
423
|
-
setActiveItemState = _React$useState4[1];
|
|
424
|
-
var _React$useState5 = React.useState(false),
|
|
425
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
426
|
-
animationDisabled = _React$useState6[0],
|
|
427
|
-
setAnimationDisabled = _React$useState6[1];
|
|
428
|
-
var elementRef = React.useRef(null);
|
|
429
|
-
var headerId = idState + '_header';
|
|
430
|
-
var contentId = idState + '_content';
|
|
431
|
-
var _PanelMenuBase$setMet = PanelMenuBase.setMetaData({
|
|
432
|
-
props: props,
|
|
433
|
-
state: {
|
|
434
|
-
id: idState,
|
|
435
|
-
activeItem: activeItemState,
|
|
436
|
-
animationDisabled: animationDisabled
|
|
437
|
-
}
|
|
438
|
-
}),
|
|
439
|
-
ptm = _PanelMenuBase$setMet.ptm,
|
|
440
|
-
cx = _PanelMenuBase$setMet.cx,
|
|
441
|
-
isUnstyled = _PanelMenuBase$setMet.isUnstyled;
|
|
442
|
-
useHandleStyle(PanelMenuBase.css.styles, isUnstyled, {
|
|
443
|
-
name: 'panelmenu'
|
|
444
|
-
});
|
|
445
|
-
var findActiveItem = function findActiveItem() {
|
|
446
|
-
if (props.model) {
|
|
447
|
-
if (props.multiple) {
|
|
448
|
-
return props.model.filter(function (item) {
|
|
449
|
-
return item.expanded;
|
|
450
|
-
});
|
|
451
|
-
} else {
|
|
452
|
-
var activeItem = null;
|
|
453
|
-
props.model.forEach(function (item) {
|
|
454
|
-
if (item.expanded) {
|
|
455
|
-
if (!activeItem) activeItem = item;else item.expanded = false;
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
return activeItem;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return null;
|
|
462
|
-
};
|
|
463
|
-
var onItemClick = function onItemClick(event, item) {
|
|
464
|
-
if (item.disabled) {
|
|
465
|
-
event.preventDefault();
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
if (!item.url) {
|
|
469
|
-
event.preventDefault();
|
|
470
|
-
}
|
|
471
|
-
if (item.command) {
|
|
472
|
-
item.command({
|
|
473
|
-
originalEvent: event,
|
|
474
|
-
item: item
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
var activeItem = activeItemState;
|
|
478
|
-
var active = isItemActive(item);
|
|
479
|
-
if (active) {
|
|
480
|
-
item.expanded = false;
|
|
481
|
-
setActiveItemState(props.multiple ? activeItem.filter(function (a_item) {
|
|
482
|
-
return a_item !== item;
|
|
483
|
-
}) : null);
|
|
484
|
-
} else {
|
|
485
|
-
if (!props.multiple && activeItem) {
|
|
486
|
-
activeItem.expanded = false;
|
|
487
|
-
}
|
|
488
|
-
item.expanded = true;
|
|
489
|
-
setActiveItemState(props.multiple ? [].concat(_toConsumableArray(activeItem || []), [item]) : item);
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
var isItemActive = function isItemActive(item) {
|
|
493
|
-
return activeItemState && (props.multiple ? activeItemState.indexOf(item) > -1 : activeItemState === item);
|
|
494
|
-
};
|
|
495
|
-
var getPTOptions = function getPTOptions(item, key) {
|
|
496
|
-
return ptm(key, {
|
|
497
|
-
context: {
|
|
498
|
-
active: isItemActive(item)
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
|
-
};
|
|
502
|
-
React.useImperativeHandle(ref, function () {
|
|
503
|
-
return {
|
|
504
|
-
props: props,
|
|
505
|
-
getElement: function getElement() {
|
|
506
|
-
return elementRef.current;
|
|
507
|
-
}
|
|
508
|
-
};
|
|
509
|
-
});
|
|
510
|
-
useMountEffect(function () {
|
|
511
|
-
if (!idState) {
|
|
512
|
-
setIdState(UniqueComponentId());
|
|
513
|
-
}
|
|
514
|
-
setActiveItemState(findActiveItem());
|
|
515
|
-
});
|
|
516
|
-
useUpdateEffect(function () {
|
|
517
|
-
setAnimationDisabled(true);
|
|
518
|
-
setActiveItemState(findActiveItem());
|
|
519
|
-
}, [props.model]);
|
|
520
|
-
var onEnter = function onEnter() {
|
|
521
|
-
setAnimationDisabled(false);
|
|
522
|
-
};
|
|
523
|
-
var createPanel = function createPanel(item, index) {
|
|
524
|
-
if (item.visible === false) {
|
|
525
|
-
return null;
|
|
526
|
-
}
|
|
527
|
-
var key = item.id || idState + '_' + index;
|
|
528
|
-
var active = isItemActive(item);
|
|
529
|
-
var iconClassName = classNames('p-menuitem-icon', item.icon);
|
|
530
|
-
var headerIconProps = mergeProps({
|
|
531
|
-
className: cx('headerIcon', {
|
|
532
|
-
item: item
|
|
533
|
-
})
|
|
534
|
-
}, getPTOptions(item, 'headerIcon'));
|
|
535
|
-
var icon = IconUtils.getJSXIcon(item.icon, _objectSpread({}, headerIconProps), {
|
|
536
|
-
props: props
|
|
537
|
-
});
|
|
538
|
-
var submenuIconClassName = 'p-panelmenu-icon';
|
|
539
|
-
var headerSubmenuIconProps = mergeProps({
|
|
540
|
-
className: cx('headerSubmenuIcon')
|
|
541
|
-
}, getPTOptions(item, 'headerSubmenuIcon'));
|
|
542
|
-
var submenuIcon = item.items && IconUtils.getJSXIcon(active ? props.submenuIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, headerSubmenuIconProps) : props.submenuIcon || /*#__PURE__*/React.createElement(ChevronRightIcon, headerSubmenuIconProps));
|
|
543
|
-
var headerLabelProps = mergeProps({
|
|
544
|
-
className: cx('headerLabel')
|
|
545
|
-
}, getPTOptions(item, 'headerLabel'));
|
|
546
|
-
var label = item.label && /*#__PURE__*/React.createElement("span", headerLabelProps, item.label);
|
|
547
|
-
var menuContentRef = /*#__PURE__*/React.createRef();
|
|
548
|
-
var headerActionProps = mergeProps({
|
|
549
|
-
href: item.url || '#',
|
|
550
|
-
className: cx('headerAction'),
|
|
551
|
-
onClick: function onClick(e) {
|
|
552
|
-
return onItemClick(e, item);
|
|
553
|
-
},
|
|
554
|
-
'aria-expanded': active,
|
|
555
|
-
id: headerId,
|
|
556
|
-
'aria-controls': contentId,
|
|
557
|
-
'aria-disabled': item.disabled
|
|
558
|
-
}, getPTOptions(item, 'headerAction'));
|
|
559
|
-
var content = /*#__PURE__*/React.createElement("a", headerActionProps, submenuIcon, icon, label);
|
|
560
|
-
if (item.template) {
|
|
561
|
-
var defaultContentOptions = {
|
|
562
|
-
onClick: function onClick(event) {
|
|
563
|
-
return onItemClick(event, item);
|
|
564
|
-
},
|
|
565
|
-
className: 'p-panelmenu-header-link',
|
|
566
|
-
labelClassName: 'p-menuitem-text',
|
|
567
|
-
submenuIconClassName: submenuIconClassName,
|
|
568
|
-
iconClassName: iconClassName,
|
|
569
|
-
element: content,
|
|
570
|
-
props: props,
|
|
571
|
-
leaf: !item.items,
|
|
572
|
-
active: active
|
|
573
|
-
};
|
|
574
|
-
content = ObjectUtils.getJSXElement(item.template, item, defaultContentOptions);
|
|
575
|
-
}
|
|
576
|
-
var panelProps = mergeProps({
|
|
577
|
-
key: key,
|
|
578
|
-
className: cx('panel', {
|
|
579
|
-
item: item
|
|
580
|
-
}),
|
|
581
|
-
style: item.style
|
|
582
|
-
}, getPTOptions(item, 'panel'));
|
|
583
|
-
var headerProps = mergeProps({
|
|
584
|
-
className: cx('header', {
|
|
585
|
-
active: active,
|
|
586
|
-
item: item
|
|
587
|
-
}),
|
|
588
|
-
style: item.style
|
|
589
|
-
}, getPTOptions(item, 'header'));
|
|
590
|
-
var menuContentProps = mergeProps({
|
|
591
|
-
className: cx('menuContent')
|
|
592
|
-
}, getPTOptions(item, 'menuContent'));
|
|
593
|
-
var toggleableContentProps = mergeProps({
|
|
594
|
-
className: cx('toggleableContent', {
|
|
595
|
-
active: active
|
|
596
|
-
}),
|
|
597
|
-
role: 'region',
|
|
598
|
-
'aria-labelledby': headerId
|
|
599
|
-
}, getPTOptions(item, 'toggleableContent'));
|
|
600
|
-
var transitionProps = mergeProps({
|
|
601
|
-
classNames: cx('transition'),
|
|
602
|
-
timeout: {
|
|
603
|
-
enter: 1000,
|
|
604
|
-
exit: 450
|
|
605
|
-
},
|
|
606
|
-
onEnter: onEnter,
|
|
607
|
-
disabled: animationDisabled,
|
|
608
|
-
"in": active,
|
|
609
|
-
unmountOnExit: true,
|
|
610
|
-
options: props.transitionOptions
|
|
611
|
-
}, getPTOptions(item, 'transition'));
|
|
612
|
-
return /*#__PURE__*/React.createElement("div", panelProps, /*#__PURE__*/React.createElement("div", headerProps, content), /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
613
|
-
nodeRef: menuContentRef
|
|
614
|
-
}, transitionProps), /*#__PURE__*/React.createElement("div", _extends({
|
|
615
|
-
id: contentId,
|
|
616
|
-
ref: menuContentRef
|
|
617
|
-
}, toggleableContentProps), /*#__PURE__*/React.createElement("div", menuContentProps, /*#__PURE__*/React.createElement(PanelMenuSub, {
|
|
618
|
-
hostName: "PanelMenu",
|
|
619
|
-
id: key,
|
|
620
|
-
menuProps: props,
|
|
621
|
-
model: item.items,
|
|
622
|
-
className: "p-panelmenu-root-submenu",
|
|
623
|
-
multiple: props.multiple,
|
|
624
|
-
submenuIcon: props.submenuIcon,
|
|
625
|
-
root: true,
|
|
626
|
-
ptm: ptm,
|
|
627
|
-
cx: cx
|
|
628
|
-
})))));
|
|
629
|
-
};
|
|
630
|
-
var createPanels = function createPanels() {
|
|
631
|
-
return props.model ? props.model.map(createPanel) : null;
|
|
632
|
-
};
|
|
633
|
-
var panels = createPanels();
|
|
634
|
-
var rootProps = mergeProps({
|
|
635
|
-
className: cx('root'),
|
|
636
|
-
style: props.style
|
|
637
|
-
}, PanelMenuBase.getOtherProps(props), ptm('root'));
|
|
638
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
639
|
-
id: props.id,
|
|
640
|
-
ref: elementRef
|
|
641
|
-
}, rootProps), panels);
|
|
642
|
-
}));
|
|
643
|
-
PanelMenu.displayName = 'PanelMenu';
|
|
644
|
-
|
|
645
|
-
export { PanelMenu };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as n}from"primereact/api";import{ComponentBase as t,useHandleStyle as r}from"primereact/componentbase";import{CSSTransition as a}from"primereact/csstransition";import{useMountEffect as o,useUpdateEffect as i}from"primereact/hooks";import{ChevronDownIcon as l}from"primereact/icons/chevrondown";import{ChevronRightIcon as u}from"primereact/icons/chevronright";import{classNames as c,mergeProps as m,IconUtils as s,ObjectUtils as p,UniqueComponentId as f}from"primereact/utils";function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},d.apply(this,arguments)}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 y(e,n){if("object"!==b(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function v(e){var n=y(e,"string");return"symbol"===b(n)?n:String(n)}function g(e,n,t){return(n=v(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function O(e){if(Array.isArray(e))return h(e)}function x(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function E(e,n){if(e){if("string"==typeof e)return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,n):void 0}}function N(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e){return O(e)||x(e)||E(e)||N()}function S(e){if(Array.isArray(e))return e}function P(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,a,o,i,l=[],u=!0,c=!1;try{if(o=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;u=!1}else for(;!(u=(r=o.call(t)).done)&&(l.push(r.value),l.length!==n);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}function I(){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 w(e,n){return S(e)||P(e,n)||E(e,n)||I()}var C=t.extend({defaultProps:{__TYPE:"Panel",id:null,model:null,style:null,submenuIcon:null,className:null,multiple:!1,transitionOptions:null,children:void 0},css:{classes:{headerIcon:function(e){return c("p-menuitem-icon",e.item.icon)},headerSubmenuIcon:"p-panelmenu-icon",headerLabel:"p-menuitem-text",headerAction:"p-panelmenu-header-link",panel:function(e){return c("p-panelmenu-panel",e.item.className)},header:function(e){return c("p-component p-panelmenu-header",{"p-highlight":e.active,"p-disabled":e.item.disabled})},menuContent:"p-panelmenu-content",root:function(e){return c("p-panelmenu p-component",e.props.className)},separator:"p-menu-separator",toggleableContent:function(e){return c("p-toggleable-content",{"p-toggleable-content-collapsed":!e.active})},icon:function(e){return c("p-menuitem-icon",e.item.icon)},label:"p-menuitem-text",submenuicon:"p-panelmenu-icon",action:function(e){return c("p-menuitem-link",{"p-disabled":e.item.disabled})},menuitem:function(e){return c("p-menuitem",e.item.className)},menu:"p-submenu-list",submenu:"p-submenu-list",transition:"p-toggleable-content"},styles:"\n@layer primereact {\n .p-panelmenu .p-panelmenu-header-link {\n display: flex;\n align-items: center;\n user-select: none;\n cursor: pointer;\n position: relative;\n text-decoration: none;\n }\n \n .p-panelmenu .p-panelmenu-header-link:focus {\n z-index: 1;\n }\n \n .p-panelmenu .p-submenu-list {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n \n .p-panelmenu .p-menuitem-link {\n display: flex;\n align-items: center;\n user-select: none;\n cursor: pointer;\n text-decoration: none;\n }\n \n .p-panelmenu .p-menuitem-text {\n line-height: 1;\n }\n}\n"}});function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function D(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){g(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var A=e.memo((function(n){var t=w(e.useState(null),2),r=t[0],i=t[1],f=n.ptm,b=n.cx,y=function(e,t){return f(e,D({hostName:n.hostName},t))},v=function(e,n){return y(n,{context:{active:O(e)}})},g=function(){if(n.model){if(n.multiple)return n.model.filter((function(e){return e.expanded}));var e=null;return n.model.forEach((function(n){n.expanded&&(e?n.expanded=!1:e=n)})),e}return null},h=function(e,t){if(t.disabled)e.preventDefault();else{t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t});var a=r;O(t)?(t.expanded=!1,i(n.multiple?a.filter((function(e){return e!==t})):null)):(!n.multiple&&a&&(a.expanded=!1),t.expanded=!0,i(n.multiple?[].concat(j(a||[]),[t]):t))}},O=function(e){return r&&(n.multiple?r.indexOf(e)>-1:r===e)};o((function(){i(g())}));var x=function(t){var r=n.id+"_sep_"+t,a=m({id:r,key:r,className:b("separator"),role:"separator"},y("separator"));return e.createElement("li",a)},E=function(t,r,o){var i=e.createRef(),l=m({className:b("toggleableContent",{active:r})},y("toggleableContent"));if(t.items){var u=m({classNames:b("transition"),timeout:{enter:1e3,exit:450},in:r,unmountOnExit:!0},y("transition"));return e.createElement(a,d({nodeRef:i},u),e.createElement("div",d({ref:i},l),e.createElement(A,{id:n.id+"_"+o,menuProps:n.menuProps,model:t.items,multiple:n.multiple,submenuIcon:n.submenuIcon,ptm:f,cx:b})))}return null},N=function(t,r){if(!1===t.visible)return null;var a=t.id||n.id+"_"+r,o=O(t),i=c("p-menuitem-link",{"p-disabled":t.disabled}),f=c("p-menuitem-icon",t.icon),d=m({className:b("icon",{item:t})},v(t,"icon")),y=s.getJSXIcon(t.icon,D({},d),{props:n.menuProps}),g=m({className:b("label")},v(t,"label")),x=t.label&&e.createElement("span",g,t.label),N=m({className:b("submenuicon")},v(t,"submenuicon")),j=t.items&&s.getJSXIcon(o?n.submenuIcon||e.createElement(l,N):n.submenuIcon||e.createElement(u,N)),S=E(t,o,r),P=m({href:t.url||"#",className:b("action",{item:t}),target:t.target,onClick:function(e){return h(e,t)},role:"menuitem","aria-disabled":t.disabled},v(t,"action")),I=e.createElement("a",P,j,y,x);t.template&&(I=p.getJSXElement(t.template,t,{onClick:function(e){return h(e,t)},className:i,labelClassName:"p-menuitem-text",iconClassName:f,submenuIconClassName:"p-panelmenu-icon",element:I,props:n,leaf:!t.items,active:o}));var w=m({key:a,id:a,className:b("menuitem",{item:t}),style:t.style,role:"none"},v(t,"menuitem"));return e.createElement("li",w,I,S)},S=n.model?n.model.map((function(e,n){return e.separator?x(n):N(e,n)})):null,P=n.root?"menu":"submenu",I=m({className:c(b(P),n.className),role:"tree"},f(P));return e.createElement("ul",I,S)}));function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function J(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){g(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}A.displayName="PanelMenuSub";var R=e.memo(e.forwardRef((function(t,b){var y=e.useContext(n),v=C.getProps(t,y),g=w(e.useState(v.id),2),h=g[0],O=g[1],x=w(e.useState(null),2),E=x[0],N=x[1],S=w(e.useState(!1),2),P=S[0],I=S[1],k=e.useRef(null),D=h+"_header",_=h+"_content",R=C.setMetaData({props:v,state:{id:h,activeItem:E,animationDisabled:P}}),X=R.ptm,M=R.cx;r(C.css.styles,R.isUnstyled,{name:"panelmenu"});var T=function(){if(v.model){if(v.multiple)return v.model.filter((function(e){return e.expanded}));var e=null;return v.model.forEach((function(n){n.expanded&&(e?n.expanded=!1:e=n)})),e}return null},L=function(e,n){if(n.disabled)e.preventDefault();else{n.url||e.preventDefault(),n.command&&n.command({originalEvent:e,item:n});var t=E;U(n)?(n.expanded=!1,N(v.multiple?t.filter((function(e){return e!==n})):null)):(!v.multiple&&t&&(t.expanded=!1),n.expanded=!0,N(v.multiple?[].concat(j(t||[]),[n]):n))}},U=function(e){return E&&(v.multiple?E.indexOf(e)>-1:E===e)},z=function(e,n){return X(n,{context:{active:U(e)}})};e.useImperativeHandle(b,(function(){return{props:v,getElement:function(){return k.current}}})),o((function(){h||O(f()),N(T())})),i((function(){I(!0),N(T())}),[v.model]);var H=function(){I(!1)},Y=v.model?v.model.map((function(n,t){if(!1===n.visible)return null;var r=n.id||h+"_"+t,o=U(n),i=c("p-menuitem-icon",n.icon),f=m({className:M("headerIcon",{item:n})},z(n,"headerIcon")),b=s.getJSXIcon(n.icon,J({},f),{props:v}),y=m({className:M("headerSubmenuIcon")},z(n,"headerSubmenuIcon")),g=n.items&&s.getJSXIcon(o?v.submenuIcon||e.createElement(l,y):v.submenuIcon||e.createElement(u,y)),O=m({className:M("headerLabel")},z(n,"headerLabel")),x=n.label&&e.createElement("span",O,n.label),E=e.createRef(),N=m({href:n.url||"#",className:M("headerAction"),onClick:function(e){return L(e,n)},"aria-expanded":o,id:D,"aria-controls":_,"aria-disabled":n.disabled},z(n,"headerAction")),j=e.createElement("a",N,g,b,x);n.template&&(j=p.getJSXElement(n.template,n,{onClick:function(e){return L(e,n)},className:"p-panelmenu-header-link",labelClassName:"p-menuitem-text",submenuIconClassName:"p-panelmenu-icon",iconClassName:i,element:j,props:v,leaf:!n.items,active:o}));var S=m({key:r,className:M("panel",{item:n}),style:n.style},z(n,"panel")),I=m({className:M("header",{active:o,item:n}),style:n.style},z(n,"header")),w=m({className:M("menuContent")},z(n,"menuContent")),C=m({className:M("toggleableContent",{active:o}),role:"region","aria-labelledby":D},z(n,"toggleableContent")),k=m({classNames:M("transition"),timeout:{enter:1e3,exit:450},onEnter:H,disabled:P,in:o,unmountOnExit:!0,options:v.transitionOptions},z(n,"transition"));return e.createElement("div",S,e.createElement("div",I,j),e.createElement(a,d({nodeRef:E},k),e.createElement("div",d({id:_,ref:E},C),e.createElement("div",w,e.createElement(A,{hostName:"PanelMenu",id:r,menuProps:v,model:n.items,className:"p-panelmenu-root-submenu",multiple:v.multiple,submenuIcon:v.submenuIcon,root:!0,ptm:X,cx:M})))))})):null,$=m({className:M("root"),style:v.style},C.getOtherProps(v),X("root"));return e.createElement("div",d({id:v.id,ref:k},$),Y)})));R.displayName="PanelMenu";export{R as PanelMenu};
|