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,516 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { DomHandler, ObjectUtils, classNames, UniqueComponentId, ZIndexUtils, mergeProps, IconUtils } from 'primereact/utils';
|
|
5
|
-
import PrimeReact, { PrimeReactContext, localeOption } from 'primereact/api';
|
|
6
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
7
|
-
import { CSSTransition } from 'primereact/csstransition';
|
|
8
|
-
import { useOverlayListener, useMountEffect, useUnmountEffect as useUnmountEffect$1 } from 'primereact/hooks';
|
|
9
|
-
import { TimesIcon } from 'primereact/icons/times';
|
|
10
|
-
import { OverlayService } from 'primereact/overlayservice';
|
|
11
|
-
import { Portal } from 'primereact/portal';
|
|
12
|
-
import { Ripple } from 'primereact/ripple';
|
|
13
|
-
|
|
14
|
-
function _extends() {
|
|
15
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
16
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
17
|
-
var source = arguments[i];
|
|
18
|
-
for (var key in source) {
|
|
19
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
20
|
-
target[key] = source[key];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return target;
|
|
25
|
-
};
|
|
26
|
-
return _extends.apply(this, arguments);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function _typeof(o) {
|
|
30
|
-
"@babel/helpers - typeof";
|
|
31
|
-
|
|
32
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
33
|
-
return typeof o;
|
|
34
|
-
} : function (o) {
|
|
35
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
36
|
-
}, _typeof(o);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function _toPrimitive(input, hint) {
|
|
40
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
41
|
-
var prim = input[Symbol.toPrimitive];
|
|
42
|
-
if (prim !== undefined) {
|
|
43
|
-
var res = prim.call(input, hint || "default");
|
|
44
|
-
if (_typeof(res) !== "object") return res;
|
|
45
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
46
|
-
}
|
|
47
|
-
return (hint === "string" ? String : Number)(input);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function _toPropertyKey(arg) {
|
|
51
|
-
var key = _toPrimitive(arg, "string");
|
|
52
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function _defineProperty(obj, key, value) {
|
|
56
|
-
key = _toPropertyKey(key);
|
|
57
|
-
if (key in obj) {
|
|
58
|
-
Object.defineProperty(obj, key, {
|
|
59
|
-
value: value,
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true,
|
|
62
|
-
writable: true
|
|
63
|
-
});
|
|
64
|
-
} else {
|
|
65
|
-
obj[key] = value;
|
|
66
|
-
}
|
|
67
|
-
return obj;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function _arrayWithHoles(arr) {
|
|
71
|
-
if (Array.isArray(arr)) return arr;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _iterableToArrayLimit(r, l) {
|
|
75
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
76
|
-
if (null != t) {
|
|
77
|
-
var e,
|
|
78
|
-
n,
|
|
79
|
-
i,
|
|
80
|
-
u,
|
|
81
|
-
a = [],
|
|
82
|
-
f = !0,
|
|
83
|
-
o = !1;
|
|
84
|
-
try {
|
|
85
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
86
|
-
if (Object(t) !== t) return;
|
|
87
|
-
f = !1;
|
|
88
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
89
|
-
} catch (r) {
|
|
90
|
-
o = !0, n = r;
|
|
91
|
-
} finally {
|
|
92
|
-
try {
|
|
93
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
94
|
-
} finally {
|
|
95
|
-
if (o) throw n;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return a;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _arrayLikeToArray(arr, len) {
|
|
103
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
104
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
105
|
-
return arr2;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
109
|
-
if (!o) return;
|
|
110
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
111
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
112
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
113
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
114
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
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
|
-
var usePrevious = function usePrevious(newValue) {
|
|
126
|
-
var ref = React.useRef(undefined);
|
|
127
|
-
React.useEffect(function () {
|
|
128
|
-
ref.current = newValue;
|
|
129
|
-
});
|
|
130
|
-
return ref.current;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/* eslint-disable */
|
|
134
|
-
var useUnmountEffect = function useUnmountEffect(fn) {
|
|
135
|
-
return React.useEffect(function () {
|
|
136
|
-
return fn;
|
|
137
|
-
}, []);
|
|
138
|
-
};
|
|
139
|
-
/* eslint-enable */
|
|
140
|
-
|
|
141
|
-
/* eslint-disable */
|
|
142
|
-
var useEventListener = function useEventListener(_ref) {
|
|
143
|
-
var _ref$target = _ref.target,
|
|
144
|
-
target = _ref$target === void 0 ? 'document' : _ref$target,
|
|
145
|
-
type = _ref.type,
|
|
146
|
-
listener = _ref.listener,
|
|
147
|
-
options = _ref.options,
|
|
148
|
-
_ref$when = _ref.when,
|
|
149
|
-
when = _ref$when === void 0 ? true : _ref$when;
|
|
150
|
-
var targetRef = React.useRef(null);
|
|
151
|
-
var listenerRef = React.useRef(null);
|
|
152
|
-
var prevListener = usePrevious(listener);
|
|
153
|
-
var prevOptions = usePrevious(options);
|
|
154
|
-
var bind = function bind() {
|
|
155
|
-
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
156
|
-
if (ObjectUtils.isNotEmpty(bindOptions.target)) {
|
|
157
|
-
unbind();
|
|
158
|
-
(bindOptions.when || when) && (targetRef.current = DomHandler.getTargetElement(bindOptions.target));
|
|
159
|
-
}
|
|
160
|
-
if (!listenerRef.current && targetRef.current) {
|
|
161
|
-
listenerRef.current = function (event) {
|
|
162
|
-
return listener && listener(event);
|
|
163
|
-
};
|
|
164
|
-
targetRef.current.addEventListener(type, listenerRef.current, options);
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
var unbind = function unbind() {
|
|
168
|
-
if (listenerRef.current) {
|
|
169
|
-
targetRef.current.removeEventListener(type, listenerRef.current, options);
|
|
170
|
-
listenerRef.current = null;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
React.useEffect(function () {
|
|
174
|
-
if (when) {
|
|
175
|
-
targetRef.current = DomHandler.getTargetElement(target);
|
|
176
|
-
} else {
|
|
177
|
-
unbind();
|
|
178
|
-
targetRef.current = null;
|
|
179
|
-
}
|
|
180
|
-
}, [target, when]);
|
|
181
|
-
React.useEffect(function () {
|
|
182
|
-
// to properly compare functions we can implicitly converting the function to it's body's text as a String
|
|
183
|
-
if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
|
|
184
|
-
unbind();
|
|
185
|
-
when && bind();
|
|
186
|
-
}
|
|
187
|
-
}, [listener, options, when]);
|
|
188
|
-
useUnmountEffect(function () {
|
|
189
|
-
unbind();
|
|
190
|
-
});
|
|
191
|
-
return [bind, unbind];
|
|
192
|
-
};
|
|
193
|
-
/* eslint-enable */
|
|
194
|
-
|
|
195
|
-
var useOnEscapeKey = function useOnEscapeKey(ref, condition, callback) {
|
|
196
|
-
var handleEsc = function handleEsc(event) {
|
|
197
|
-
if (event.key === 'Esc' || event.key === 'Escape') {
|
|
198
|
-
event.stopImmediatePropagation();
|
|
199
|
-
callback(event);
|
|
200
|
-
}
|
|
201
|
-
return;
|
|
202
|
-
};
|
|
203
|
-
var _useEventListener = useEventListener({
|
|
204
|
-
type: 'keydown',
|
|
205
|
-
listener: handleEsc
|
|
206
|
-
}),
|
|
207
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
208
|
-
bindKeyDownListener = _useEventListener2[0],
|
|
209
|
-
unbindKeyDownListener = _useEventListener2[1];
|
|
210
|
-
React.useEffect(function () {
|
|
211
|
-
if (!condition) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
if (!ref.current) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
bindKeyDownListener();
|
|
218
|
-
return function () {
|
|
219
|
-
unbindKeyDownListener();
|
|
220
|
-
};
|
|
221
|
-
});
|
|
222
|
-
return [ref, callback];
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
var classes = {
|
|
226
|
-
root: function root(_ref) {
|
|
227
|
-
var props = _ref.props,
|
|
228
|
-
context = _ref.context;
|
|
229
|
-
return classNames('p-overlaypanel p-component', props.className, {
|
|
230
|
-
'p-input-filled': context && context.inputStyle === 'filled' || PrimeReact.inputStyle === 'filled',
|
|
231
|
-
'p-ripple-disabled': context && context.ripple === false || PrimeReact.ripple === false
|
|
232
|
-
});
|
|
233
|
-
},
|
|
234
|
-
closeIcon: 'p-overlaypanel-close-icon',
|
|
235
|
-
closeButton: 'p-overlaypanel-close p-link',
|
|
236
|
-
content: 'p-overlaypanel-content',
|
|
237
|
-
transition: 'p-overlaypanel'
|
|
238
|
-
};
|
|
239
|
-
var styles = "\n@layer primereact {\n .p-overlaypanel {\n position: absolute;\n margin-top: 10px;\n /* Github #3122: Prevent animation flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-overlaypanel-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n }\n \n .p-overlaypanel-close {\n display: flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n }\n \n /* Animation */\n .p-overlaypanel-enter {\n opacity: 0;\n transform: scaleY(0.8);\n }\n \n .p-overlaypanel-enter-active {\n opacity: 1;\n transform: scaleY(1);\n transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-overlaypanel-enter-done {\n transform: none;\n }\n \n .p-overlaypanel-exit {\n opacity: 1;\n }\n \n .p-overlaypanel-exit-active {\n opacity: 0;\n transition: opacity .1s linear;\n }\n \n .p-overlaypanel:after, .p-overlaypanel:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: \" \";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n }\n \n .p-overlaypanel:after {\n border-width: 8px;\n margin-left: -8px;\n }\n \n .p-overlaypanel:before {\n border-width: 10px;\n margin-left: -10px;\n }\n \n .p-overlaypanel-flipped:after, .p-overlaypanel-flipped:before {\n bottom: auto;\n top: 100%;\n }\n \n .p-overlaypanel.p-overlaypanel-flipped:after {\n border-bottom-color: transparent;\n }\n \n .p-overlaypanel.p-overlaypanel-flipped:before {\n border-bottom-color: transparent\n }\n}\n";
|
|
240
|
-
var OverlayPanelBase = ComponentBase.extend({
|
|
241
|
-
defaultProps: {
|
|
242
|
-
__TYPE: 'OverlayPanel',
|
|
243
|
-
id: null,
|
|
244
|
-
dismissable: true,
|
|
245
|
-
showCloseIcon: false,
|
|
246
|
-
closeIcon: null,
|
|
247
|
-
style: null,
|
|
248
|
-
className: null,
|
|
249
|
-
appendTo: null,
|
|
250
|
-
breakpoints: null,
|
|
251
|
-
ariaCloseLabel: null,
|
|
252
|
-
transitionOptions: null,
|
|
253
|
-
onShow: null,
|
|
254
|
-
onHide: null,
|
|
255
|
-
children: undefined,
|
|
256
|
-
closeOnEscape: true
|
|
257
|
-
},
|
|
258
|
-
css: {
|
|
259
|
-
classes: classes,
|
|
260
|
-
styles: styles
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
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; }
|
|
265
|
-
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; }
|
|
266
|
-
var OverlayPanel = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
267
|
-
var context = React.useContext(PrimeReactContext);
|
|
268
|
-
var props = OverlayPanelBase.getProps(inProps, context);
|
|
269
|
-
var _React$useState = React.useState(false),
|
|
270
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
271
|
-
visibleState = _React$useState2[0],
|
|
272
|
-
setVisibleState = _React$useState2[1];
|
|
273
|
-
var _OverlayPanelBase$set = OverlayPanelBase.setMetaData({
|
|
274
|
-
props: props,
|
|
275
|
-
state: {
|
|
276
|
-
visible: visibleState
|
|
277
|
-
}
|
|
278
|
-
}),
|
|
279
|
-
ptm = _OverlayPanelBase$set.ptm,
|
|
280
|
-
cx = _OverlayPanelBase$set.cx;
|
|
281
|
-
_OverlayPanelBase$set.sx;
|
|
282
|
-
var isUnstyled = _OverlayPanelBase$set.isUnstyled;
|
|
283
|
-
useHandleStyle(OverlayPanelBase.css.styles, isUnstyled, {
|
|
284
|
-
name: 'overlaypanel'
|
|
285
|
-
});
|
|
286
|
-
var attributeSelector = React.useRef('');
|
|
287
|
-
var overlayRef = React.useRef(null);
|
|
288
|
-
var currentTargetRef = React.useRef(null);
|
|
289
|
-
var isPanelClicked = React.useRef(false);
|
|
290
|
-
var styleElement = React.useRef(null);
|
|
291
|
-
var overlayEventListener = React.useRef(null);
|
|
292
|
-
var _useOverlayListener = useOverlayListener({
|
|
293
|
-
target: currentTargetRef,
|
|
294
|
-
overlay: overlayRef,
|
|
295
|
-
listener: function listener(event, _ref) {
|
|
296
|
-
var type = _ref.type,
|
|
297
|
-
valid = _ref.valid;
|
|
298
|
-
if (valid) {
|
|
299
|
-
switch (type) {
|
|
300
|
-
case 'outside':
|
|
301
|
-
props.dismissable && !isPanelClicked.current && hide();
|
|
302
|
-
break;
|
|
303
|
-
case 'resize':
|
|
304
|
-
case 'scroll':
|
|
305
|
-
case 'orientationchange':
|
|
306
|
-
align();
|
|
307
|
-
break;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
isPanelClicked.current = false;
|
|
311
|
-
},
|
|
312
|
-
when: visibleState
|
|
313
|
-
}),
|
|
314
|
-
_useOverlayListener2 = _slicedToArray(_useOverlayListener, 2),
|
|
315
|
-
bindOverlayListener = _useOverlayListener2[0],
|
|
316
|
-
unbindOverlayListener = _useOverlayListener2[1];
|
|
317
|
-
useOnEscapeKey(overlayEventListener, props.closeOnEscape, function () {
|
|
318
|
-
hide();
|
|
319
|
-
});
|
|
320
|
-
var isOutsideClicked = function isOutsideClicked(target) {
|
|
321
|
-
return overlayRef && overlayRef.current && !(overlayRef.current.isSameNode(target) || overlayRef.current.contains(target));
|
|
322
|
-
};
|
|
323
|
-
var hasTargetChanged = function hasTargetChanged(event, target) {
|
|
324
|
-
return currentTargetRef.current != null && currentTargetRef.current !== (target || event.currentTarget || event.target);
|
|
325
|
-
};
|
|
326
|
-
var onCloseClick = function onCloseClick(event) {
|
|
327
|
-
hide();
|
|
328
|
-
event.preventDefault();
|
|
329
|
-
};
|
|
330
|
-
var onPanelClick = function onPanelClick(event) {
|
|
331
|
-
isPanelClicked.current = true;
|
|
332
|
-
OverlayService.emit('overlay-click', {
|
|
333
|
-
originalEvent: event,
|
|
334
|
-
target: currentTargetRef.current
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
var onContentClick = function onContentClick() {
|
|
338
|
-
isPanelClicked.current = true;
|
|
339
|
-
};
|
|
340
|
-
var toggle = function toggle(event, target) {
|
|
341
|
-
if (visibleState) {
|
|
342
|
-
hide();
|
|
343
|
-
if (hasTargetChanged(event, target)) {
|
|
344
|
-
currentTargetRef.current = target || event.currentTarget || event.target;
|
|
345
|
-
setTimeout(function () {
|
|
346
|
-
show(event, currentTargetRef.current);
|
|
347
|
-
}, 200);
|
|
348
|
-
}
|
|
349
|
-
} else {
|
|
350
|
-
show(event, target);
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
var show = function show(event, target) {
|
|
354
|
-
currentTargetRef.current = target || event.currentTarget || event.target;
|
|
355
|
-
if (visibleState) {
|
|
356
|
-
align();
|
|
357
|
-
} else {
|
|
358
|
-
setVisibleState(true);
|
|
359
|
-
overlayEventListener.current = function (e) {
|
|
360
|
-
!isOutsideClicked(e.target) && (isPanelClicked.current = true);
|
|
361
|
-
};
|
|
362
|
-
OverlayService.on('overlay-click', overlayEventListener.current);
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
var hide = function hide() {
|
|
366
|
-
setVisibleState(false);
|
|
367
|
-
OverlayService.off('overlay-click', overlayEventListener.current);
|
|
368
|
-
overlayEventListener.current = null;
|
|
369
|
-
};
|
|
370
|
-
var onEnter = function onEnter() {
|
|
371
|
-
overlayRef.current.setAttribute(attributeSelector.current, '');
|
|
372
|
-
ZIndexUtils.set('overlay', overlayRef.current, context && context.autoZIndex || PrimeReact.autoZIndex, context && context.zIndex['overlay'] || PrimeReact.zIndex['overlay']);
|
|
373
|
-
DomHandler.addStyles(overlayRef.current, {
|
|
374
|
-
position: 'absolute',
|
|
375
|
-
top: '0',
|
|
376
|
-
left: '0'
|
|
377
|
-
});
|
|
378
|
-
align();
|
|
379
|
-
};
|
|
380
|
-
var onEntered = function onEntered() {
|
|
381
|
-
bindOverlayListener();
|
|
382
|
-
props.onShow && props.onShow();
|
|
383
|
-
};
|
|
384
|
-
var onExit = function onExit() {
|
|
385
|
-
unbindOverlayListener();
|
|
386
|
-
};
|
|
387
|
-
var onExited = function onExited() {
|
|
388
|
-
ZIndexUtils.clear(overlayRef.current);
|
|
389
|
-
props.onHide && props.onHide();
|
|
390
|
-
};
|
|
391
|
-
var align = function align() {
|
|
392
|
-
if (currentTargetRef.current && overlayRef.current) {
|
|
393
|
-
DomHandler.absolutePosition(overlayRef.current, currentTargetRef.current);
|
|
394
|
-
var containerOffset = DomHandler.getOffset(overlayRef.current);
|
|
395
|
-
var targetOffset = DomHandler.getOffset(currentTargetRef.current);
|
|
396
|
-
var arrowLeft = 0;
|
|
397
|
-
if (containerOffset.left < targetOffset.left) {
|
|
398
|
-
arrowLeft = targetOffset.left - containerOffset.left;
|
|
399
|
-
}
|
|
400
|
-
overlayRef.current.style.setProperty('--overlayArrowLeft', "".concat(arrowLeft, "px"));
|
|
401
|
-
if (containerOffset.top < targetOffset.top) {
|
|
402
|
-
overlayRef.current.setAttribute('data-p-overlaypanel-flipped', 'true');
|
|
403
|
-
isUnstyled && DomHandler.addClass(overlayRef.current, 'p-overlaypanel-flipped');
|
|
404
|
-
} else {
|
|
405
|
-
overlayRef.current.setAttribute('data-p-overlaypanel-flipped', 'false');
|
|
406
|
-
isUnstyled && DomHandler.removeClass(overlayRef.current, 'p-overlaypanel-flipped');
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
var createStyle = function createStyle() {
|
|
411
|
-
if (!styleElement.current) {
|
|
412
|
-
styleElement.current = DomHandler.createInlineStyle(context && context.nonce || PrimeReact.nonce);
|
|
413
|
-
var innerHTML = '';
|
|
414
|
-
for (var breakpoint in props.breakpoints) {
|
|
415
|
-
innerHTML += "\n @media screen and (max-width: ".concat(breakpoint, ") {\n .p-overlaypanel[").concat(attributeSelector.current, "] {\n width: ").concat(props.breakpoints[breakpoint], " !important;\n }\n }\n ");
|
|
416
|
-
}
|
|
417
|
-
styleElement.current.innerHTML = innerHTML;
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
useMountEffect(function () {
|
|
421
|
-
attributeSelector.current = UniqueComponentId();
|
|
422
|
-
if (props.breakpoints) {
|
|
423
|
-
createStyle();
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
useUnmountEffect$1(function () {
|
|
427
|
-
styleElement.current = DomHandler.removeInlineStyle(styleElement.current);
|
|
428
|
-
if (overlayEventListener.current) {
|
|
429
|
-
OverlayService.off('overlay-click', overlayEventListener.current);
|
|
430
|
-
overlayEventListener.current = null;
|
|
431
|
-
}
|
|
432
|
-
ZIndexUtils.clear(overlayRef.current);
|
|
433
|
-
});
|
|
434
|
-
React.useImperativeHandle(ref, function () {
|
|
435
|
-
return {
|
|
436
|
-
props: props,
|
|
437
|
-
toggle: toggle,
|
|
438
|
-
show: show,
|
|
439
|
-
hide: hide,
|
|
440
|
-
align: align,
|
|
441
|
-
getElement: function getElement() {
|
|
442
|
-
return overlayRef.current;
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
});
|
|
446
|
-
var createCloseIcon = function createCloseIcon() {
|
|
447
|
-
var closeIconProps = mergeProps({
|
|
448
|
-
className: cx('closeIcon'),
|
|
449
|
-
'aria-hidden': true
|
|
450
|
-
}, ptm('closeIcon'));
|
|
451
|
-
var icon = props.closeIcon || /*#__PURE__*/React.createElement(TimesIcon, closeIconProps);
|
|
452
|
-
var closeIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, closeIconProps), {
|
|
453
|
-
props: props
|
|
454
|
-
});
|
|
455
|
-
var ariaLabel = props.ariaCloseLabel || localeOption('close');
|
|
456
|
-
var closeButtonProps = mergeProps({
|
|
457
|
-
type: 'button',
|
|
458
|
-
className: cx('closeButton'),
|
|
459
|
-
onClick: function onClick(e) {
|
|
460
|
-
return onCloseClick(e);
|
|
461
|
-
},
|
|
462
|
-
'aria-label': ariaLabel
|
|
463
|
-
}, ptm('closeButton'));
|
|
464
|
-
if (props.showCloseIcon) {
|
|
465
|
-
return /*#__PURE__*/React.createElement("button", closeButtonProps, closeIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
466
|
-
}
|
|
467
|
-
return null;
|
|
468
|
-
};
|
|
469
|
-
var createElement = function createElement() {
|
|
470
|
-
var closeIcon = createCloseIcon();
|
|
471
|
-
var rootProps = mergeProps({
|
|
472
|
-
id: props.id,
|
|
473
|
-
className: cx('root', {
|
|
474
|
-
context: context
|
|
475
|
-
}),
|
|
476
|
-
style: props.style,
|
|
477
|
-
onClick: function onClick(e) {
|
|
478
|
-
return onPanelClick(e);
|
|
479
|
-
}
|
|
480
|
-
}, OverlayPanelBase.getOtherProps(props), ptm('root'));
|
|
481
|
-
var contentProps = mergeProps({
|
|
482
|
-
className: cx('content'),
|
|
483
|
-
onClick: function onClick(e) {
|
|
484
|
-
return onContentClick();
|
|
485
|
-
},
|
|
486
|
-
onMouseDown: onContentClick
|
|
487
|
-
}, OverlayPanelBase.getOtherProps(props), ptm('content'));
|
|
488
|
-
var transitionProps = mergeProps({
|
|
489
|
-
classNames: cx('transition'),
|
|
490
|
-
"in": visibleState,
|
|
491
|
-
timeout: {
|
|
492
|
-
enter: 120,
|
|
493
|
-
exit: 100
|
|
494
|
-
},
|
|
495
|
-
options: props.transitionOptions,
|
|
496
|
-
unmountOnExit: true,
|
|
497
|
-
onEnter: onEnter,
|
|
498
|
-
onEntered: onEntered,
|
|
499
|
-
onExit: onExit,
|
|
500
|
-
onExited: onExited
|
|
501
|
-
}, ptm('transition'));
|
|
502
|
-
return /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
503
|
-
nodeRef: overlayRef
|
|
504
|
-
}, transitionProps), /*#__PURE__*/React.createElement("div", _extends({
|
|
505
|
-
ref: overlayRef
|
|
506
|
-
}, rootProps), /*#__PURE__*/React.createElement("div", contentProps, props.children), closeIcon));
|
|
507
|
-
};
|
|
508
|
-
var element = createElement();
|
|
509
|
-
return /*#__PURE__*/React.createElement(Portal, {
|
|
510
|
-
element: element,
|
|
511
|
-
appendTo: props.appendTo
|
|
512
|
-
});
|
|
513
|
-
});
|
|
514
|
-
OverlayPanel.displayName = 'OverlayPanel';
|
|
515
|
-
|
|
516
|
-
export { OverlayPanel };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{DomHandler as n,ObjectUtils as t,classNames as r,UniqueComponentId as o,ZIndexUtils as a,mergeProps as i,IconUtils as l}from"primereact/utils";import c,{PrimeReactContext as u,localeOption as p}from"primereact/api";import{ComponentBase as s,useHandleStyle as f}from"primereact/componentbase";import{CSSTransition as y}from"primereact/csstransition";import{useOverlayListener as m,useMountEffect as v,useUnmountEffect as d}from"primereact/hooks";import{TimesIcon as b}from"primereact/icons/times";import{OverlayService as g}from"primereact/overlayservice";import{Portal as h}from"primereact/portal";import{Ripple as O}from"primereact/ripple";function w(){return w=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},w.apply(this,arguments)}function E(e){return E="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},E(e)}function x(e,n){if("object"!==E(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function S(e){var n=x(e,"string");return"symbol"===E(n)?n:String(n)}function j(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,o,a,i,l=[],c=!0,u=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==n);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(u)throw o}}return l}}function k(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 I(e,n){if(e){if("string"==typeof e)return k(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)?k(e,n):void 0}}function T(){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 A(e,n){return j(e)||P(e,n)||I(e,n)||T()}var C=function(n){var t=e.useRef(void 0);return e.useEffect((function(){t.current=n})),t.current},N=function(r,o,a){var i,l,c,u,p,s,f,y,m,v,d,b,g,h,O,w=(u=void 0===(c=(i={type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),a(e))}}).target)?"document":c,p=i.type,s=i.listener,f=i.options,m=void 0===(y=i.when)||y,v=e.useRef(null),d=e.useRef(null),b=C(s),g=C(f),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.isNotEmpty(e.target)&&(O(),(e.when||m)&&(v.current=n.getTargetElement(e.target))),!d.current&&v.current&&(d.current=function(e){return s&&s(e)},v.current.addEventListener(p,d.current,f))},O=function(){d.current&&(v.current.removeEventListener(p,d.current,f),d.current=null)},e.useEffect((function(){m?v.current=n.getTargetElement(u):(O(),v.current=null)}),[u,m]),e.useEffect((function(){!d.current||""+b==""+s&&g===f||(O(),m&&h())}),[s,f,m]),l=function(){O()},e.useEffect((function(){return l}),[]),[h,O]),E=A(w,2),x=E[0],S=E[1];return e.useEffect((function(){if(o&&r.current)return x(),function(){S()}})),[r,a]},R=s.extend({defaultProps:{__TYPE:"OverlayPanel",id:null,dismissable:!0,showCloseIcon:!1,closeIcon:null,style:null,className:null,appendTo:null,breakpoints:null,ariaCloseLabel:null,transitionOptions:null,onShow:null,onHide:null,children:void 0,closeOnEscape:!0},css:{classes:{root:function(e){var n=e.context;return r("p-overlaypanel p-component",e.props.className,{"p-input-filled":n&&"filled"===n.inputStyle||"filled"===c.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===c.ripple})},closeIcon:"p-overlaypanel-close-icon",closeButton:"p-overlaypanel-close p-link",content:"p-overlaypanel-content",transition:"p-overlaypanel"},styles:'\n@layer primereact {\n .p-overlaypanel {\n position: absolute;\n margin-top: 10px;\n /* Github #3122: Prevent animation flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-overlaypanel-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n }\n \n .p-overlaypanel-close {\n display: flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n }\n \n /* Animation */\n .p-overlaypanel-enter {\n opacity: 0;\n transform: scaleY(0.8);\n }\n \n .p-overlaypanel-enter-active {\n opacity: 1;\n transform: scaleY(1);\n transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-overlaypanel-enter-done {\n transform: none;\n }\n \n .p-overlaypanel-exit {\n opacity: 1;\n }\n \n .p-overlaypanel-exit-active {\n opacity: 0;\n transition: opacity .1s linear;\n }\n \n .p-overlaypanel:after, .p-overlaypanel:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n }\n \n .p-overlaypanel:after {\n border-width: 8px;\n margin-left: -8px;\n }\n \n .p-overlaypanel:before {\n border-width: 10px;\n margin-left: -10px;\n }\n \n .p-overlaypanel-flipped:after, .p-overlaypanel-flipped:before {\n bottom: auto;\n top: 100%;\n }\n \n .p-overlaypanel.p-overlaypanel-flipped:after {\n border-bottom-color: transparent;\n }\n \n .p-overlaypanel.p-overlaypanel-flipped:before {\n border-bottom-color: transparent\n }\n}\n'}});function D(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 L(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?D(Object(t),!0).forEach((function(n){var r,o,a;r=e,a=t[n],(o=S(o=n))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var z=e.forwardRef((function(t,r){var s=e.useContext(u),E=R.getProps(t,s),x=A(e.useState(!1),2),S=x[0],j=x[1],P=R.setMetaData({props:E,state:{visible:S}}),k=P.ptm,I=P.cx,T=P.isUnstyled;f(R.css.styles,T,{name:"overlaypanel"});var C=e.useRef(""),D=e.useRef(null),z=e.useRef(null),H=e.useRef(!1),M=e.useRef(null),B=e.useRef(null),U=A(m({target:z,overlay:D,listener:function(e,n){if(n.valid)switch(n.type){case"outside":E.dismissable&&!H.current&&q();break;case"resize":case"scroll":case"orientationchange":W()}H.current=!1},when:S}),2),Y=U[0],Z=U[1];N(B,E.closeOnEscape,(function(){q()}));var _=function(e){return D&&D.current&&!(D.current.isSameNode(e)||D.current.contains(e))},G=function(e,n){return null!=z.current&&z.current!==(n||e.currentTarget||e.target)},J=function(){H.current=!0},X=function(e,n){S?(q(),G(e,n)&&(z.current=n||e.currentTarget||e.target,setTimeout((function(){$(e,z.current)}),200))):$(e,n)},$=function(e,n){z.current=n||e.currentTarget||e.target,S?W():(j(!0),B.current=function(e){!_(e.target)&&(H.current=!0)},g.on("overlay-click",B.current))},q=function(){j(!1),g.off("overlay-click",B.current),B.current=null},F=function(){D.current.setAttribute(C.current,""),a.set("overlay",D.current,s&&s.autoZIndex||c.autoZIndex,s&&s.zIndex.overlay||c.zIndex.overlay),n.addStyles(D.current,{position:"absolute",top:"0",left:"0"}),W()},K=function(){Y(),E.onShow&&E.onShow()},Q=function(){Z()},V=function(){a.clear(D.current),E.onHide&&E.onHide()},W=function(){if(z.current&&D.current){n.absolutePosition(D.current,z.current);var e=n.getOffset(D.current),t=n.getOffset(z.current),r=0;e.left<t.left&&(r=t.left-e.left),D.current.style.setProperty("--overlayArrowLeft","".concat(r,"px")),e.top<t.top?(D.current.setAttribute("data-p-overlaypanel-flipped","true"),T&&n.addClass(D.current,"p-overlaypanel-flipped")):(D.current.setAttribute("data-p-overlaypanel-flipped","false"),T&&n.removeClass(D.current,"p-overlaypanel-flipped"))}},ee=function(){if(!M.current){M.current=n.createInlineStyle(s&&s.nonce||c.nonce);var e="";for(var t in E.breakpoints)e+="\n @media screen and (max-width: ".concat(t,") {\n .p-overlaypanel[").concat(C.current,"] {\n width: ").concat(E.breakpoints[t]," !important;\n }\n }\n ");M.current.innerHTML=e}};v((function(){C.current=o(),E.breakpoints&&ee()})),d((function(){M.current=n.removeInlineStyle(M.current),B.current&&(g.off("overlay-click",B.current),B.current=null),a.clear(D.current)})),e.useImperativeHandle(r,(function(){return{props:E,toggle:X,show:$,hide:q,align:W,getElement:function(){return D.current}}}));var ne,te,re,oe,ae=function(){var n=i({className:I("closeIcon"),"aria-hidden":!0},k("closeIcon")),t=l.getJSXIcon(E.closeIcon||e.createElement(b,n),L({},n),{props:E}),r=E.ariaCloseLabel||p("close"),o=i({type:"button",className:I("closeButton"),onClick:function(e){return n=e,q(),void n.preventDefault();var n},"aria-label":r},k("closeButton"));return E.showCloseIcon?e.createElement("button",o,t,e.createElement(O,null)):null},ie=(ne=ae(),te=i({id:E.id,className:I("root",{context:s}),style:E.style,onClick:function(e){return n=e,H.current=!0,void g.emit("overlay-click",{originalEvent:n,target:z.current});var n}},R.getOtherProps(E),k("root")),re=i({className:I("content"),onClick:function(e){return J()},onMouseDown:J},R.getOtherProps(E),k("content")),oe=i({classNames:I("transition"),in:S,timeout:{enter:120,exit:100},options:E.transitionOptions,unmountOnExit:!0,onEnter:F,onEntered:K,onExit:Q,onExited:V},k("transition")),e.createElement(y,w({nodeRef:D},oe),e.createElement("div",w({ref:D},te),e.createElement("div",re,E.children),ne)));return e.createElement(h,{element:ie,appendTo:E.appendTo})}));z.displayName="OverlayPanel";export{z as OverlayPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{EventBus as r}from"primereact/utils";var t=r();export{t as OverlayService};
|