primereact 10.0.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/componentbase/componentbase.cjs.js +12 -7
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.min.mjs +1 -1
- package/componentbase/componentbase.esm.mjs +12 -7
- package/componentbase/componentbase.js +12 -7
- package/componentbase/componentbase.min.js +1 -1
- package/core/core.js +12 -7
- package/core/core.min.js +1 -1
- package/package.json +1 -1
- package/primereact.all.cjs.js +12 -7
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.min.mjs +1 -1
- package/primereact.all.esm.mjs +12 -7
- package/primereact.all.js +12 -7
- package/primereact.all.min.js +1 -1
- package/web-types.json +1 -1
- package/accordion/accordion.esm.js +0 -421
- package/accordion/accordion.esm.min.js +0 -1
- package/api/api.esm.js +0 -944
- package/api/api.esm.min.js +0 -1
- package/autocomplete/autocomplete.esm.js +0 -1127
- package/autocomplete/autocomplete.esm.min.js +0 -1
- package/avatar/avatar.esm.js +0 -245
- package/avatar/avatar.esm.min.js +0 -1
- package/avatargroup/avatargroup.esm.js +0 -55
- package/avatargroup/avatargroup.esm.min.js +0 -1
- package/badge/badge.esm.js +0 -110
- package/badge/badge.esm.min.js +0 -1
- package/blockui/blockui.esm.js +0 -265
- package/blockui/blockui.esm.min.js +0 -1
- package/breadcrumb/breadcrumb.esm.js +0 -351
- package/breadcrumb/breadcrumb.esm.min.js +0 -1
- package/button/button.esm.js +0 -295
- package/button/button.esm.min.js +0 -1
- package/calendar/calendar.esm.js +0 -3473
- package/calendar/calendar.esm.min.js +0 -1
- package/card/card.esm.js +0 -98
- package/card/card.esm.min.js +0 -1
- package/carousel/carousel.esm.js +0 -801
- package/carousel/carousel.esm.min.js +0 -1
- package/cascadeselect/cascadeselect.esm.js +0 -819
- package/cascadeselect/cascadeselect.esm.min.js +0 -1
- package/chart/chart.esm.js +0 -155
- package/chart/chart.esm.min.js +0 -1
- package/checkbox/checkbox.esm.js +0 -357
- package/checkbox/checkbox.esm.min.js +0 -1
- package/chip/chip.esm.js +0 -248
- package/chip/chip.esm.min.js +0 -1
- package/chips/chips.esm.js +0 -501
- package/chips/chips.esm.min.js +0 -1
- package/colorpicker/colorpicker.esm.js +0 -788
- package/colorpicker/colorpicker.esm.min.js +0 -1
- package/column/column.esm.js +0 -8
- package/column/column.esm.min.js +0 -1
- package/columngroup/columngroup.esm.js +0 -6
- package/columngroup/columngroup.esm.min.js +0 -1
- package/componentbase/componentbase.esm.js +0 -323
- package/componentbase/componentbase.esm.min.js +0 -1
- package/confirmdialog/confirmdialog.esm.js +0 -376
- package/confirmdialog/confirmdialog.esm.min.js +0 -1
- package/confirmpopup/confirmpopup.esm.js +0 -610
- package/confirmpopup/confirmpopup.esm.min.js +0 -1
- package/contextmenu/contextmenu.esm.js +0 -664
- package/contextmenu/contextmenu.esm.min.js +0 -1
- package/csstransition/csstransition.esm.js +0 -138
- package/csstransition/csstransition.esm.min.js +0 -1
- package/datascroller/datascroller.esm.js +0 -320
- package/datascroller/datascroller.esm.min.js +0 -1
- package/datatable/datatable.esm.js +0 -6636
- package/datatable/datatable.esm.min.js +0 -1
- package/dataview/dataview.esm.js +0 -506
- package/dataview/dataview.esm.min.js +0 -1
- package/deferredcontent/deferredcontent.esm.js +0 -133
- package/deferredcontent/deferredcontent.esm.min.js +0 -1
- package/dialog/dialog.esm.js +0 -983
- package/dialog/dialog.esm.min.js +0 -1
- package/divider/divider.esm.js +0 -79
- package/divider/divider.esm.min.js +0 -1
- package/dock/dock.esm.js +0 -348
- package/dock/dock.esm.min.js +0 -1
- package/dropdown/dropdown.esm.js +0 -1380
- package/dropdown/dropdown.esm.min.js +0 -1
- package/editor/editor.esm.js +0 -338
- package/editor/editor.esm.min.js +0 -1
- package/fieldset/fieldset.esm.js +0 -270
- package/fieldset/fieldset.esm.min.js +0 -1
- package/fileupload/fileupload.esm.js +0 -1005
- package/fileupload/fileupload.esm.min.js +0 -1
- package/galleria/galleria.esm.js +0 -1090
- package/galleria/galleria.esm.min.js +0 -1
- package/hooks/hooks.esm.js +0 -1042
- package/hooks/hooks.esm.min.js +0 -1
- package/iconbase/iconbase.esm.js +0 -33
- package/iconbase/iconbase.esm.min.js +0 -1
- package/icons/angledoubledown/index.esm.js +0 -39
- package/icons/angledoubledown/index.esm.min.js +0 -1
- package/icons/angledoubleleft/index.esm.js +0 -39
- package/icons/angledoubleleft/index.esm.min.js +0 -1
- package/icons/angledoubleright/index.esm.js +0 -39
- package/icons/angledoubleright/index.esm.min.js +0 -1
- package/icons/angledoubleup/index.esm.js +0 -39
- package/icons/angledoubleup/index.esm.min.js +0 -1
- package/icons/angledown/index.esm.js +0 -37
- package/icons/angledown/index.esm.min.js +0 -1
- package/icons/angleleft/index.esm.js +0 -37
- package/icons/angleleft/index.esm.min.js +0 -1
- package/icons/angleright/index.esm.js +0 -37
- package/icons/angleright/index.esm.min.js +0 -1
- package/icons/angleup/index.esm.js +0 -37
- package/icons/angleup/index.esm.min.js +0 -1
- package/icons/arrowdown/index.esm.js +0 -661
- package/icons/arrowdown/index.esm.min.js +0 -1
- package/icons/arrowup/index.esm.js +0 -661
- package/icons/arrowup/index.esm.min.js +0 -1
- package/icons/ban/index.esm.js +0 -659
- package/icons/ban/index.esm.min.js +0 -1
- package/icons/bars/index.esm.js +0 -39
- package/icons/bars/index.esm.min.js +0 -1
- package/icons/calendar/index.esm.js +0 -37
- package/icons/calendar/index.esm.min.js +0 -1
- package/icons/check/index.esm.js +0 -37
- package/icons/check/index.esm.min.js +0 -1
- package/icons/chevrondown/index.esm.js +0 -37
- package/icons/chevrondown/index.esm.min.js +0 -1
- package/icons/chevronleft/index.esm.js +0 -37
- package/icons/chevronleft/index.esm.min.js +0 -1
- package/icons/chevronright/index.esm.js +0 -37
- package/icons/chevronright/index.esm.min.js +0 -1
- package/icons/chevronup/index.esm.js +0 -37
- package/icons/chevronup/index.esm.min.js +0 -1
- package/icons/download/index.esm.js +0 -661
- package/icons/download/index.esm.min.js +0 -1
- package/icons/exclamationtriangle/index.esm.js +0 -665
- package/icons/exclamationtriangle/index.esm.min.js +0 -1
- package/icons/eye/index.esm.js +0 -39
- package/icons/eye/index.esm.min.js +0 -1
- package/icons/eyeslash/index.esm.js +0 -661
- package/icons/eyeslash/index.esm.min.js +0 -1
- package/icons/filter/index.esm.js +0 -659
- package/icons/filter/index.esm.min.js +0 -1
- package/icons/filterslash/index.esm.js +0 -661
- package/icons/filterslash/index.esm.min.js +0 -1
- package/icons/infocircle/index.esm.js +0 -661
- package/icons/infocircle/index.esm.min.js +0 -1
- package/icons/minus/index.esm.js +0 -37
- package/icons/minus/index.esm.min.js +0 -1
- package/icons/pencil/index.esm.js +0 -659
- package/icons/pencil/index.esm.min.js +0 -1
- package/icons/plus/index.esm.js +0 -659
- package/icons/plus/index.esm.min.js +0 -1
- package/icons/refresh/index.esm.js +0 -661
- package/icons/refresh/index.esm.min.js +0 -1
- package/icons/search/index.esm.js +0 -661
- package/icons/search/index.esm.min.js +0 -1
- package/icons/searchminus/index.esm.js +0 -661
- package/icons/searchminus/index.esm.min.js +0 -1
- package/icons/searchplus/index.esm.js +0 -661
- package/icons/searchplus/index.esm.min.js +0 -1
- package/icons/sortalt/index.esm.js +0 -668
- package/icons/sortalt/index.esm.min.js +0 -1
- package/icons/sortamountdown/index.esm.js +0 -674
- package/icons/sortamountdown/index.esm.min.js +0 -1
- package/icons/sortamountupalt/index.esm.js +0 -674
- package/icons/sortamountupalt/index.esm.min.js +0 -1
- package/icons/spinner/index.esm.js +0 -659
- package/icons/spinner/index.esm.min.js +0 -1
- package/icons/star/index.esm.js +0 -659
- package/icons/star/index.esm.min.js +0 -1
- package/icons/starfill/index.esm.js +0 -659
- package/icons/starfill/index.esm.min.js +0 -1
- package/icons/thlarge/index.esm.js +0 -661
- package/icons/thlarge/index.esm.min.js +0 -1
- package/icons/times/index.esm.js +0 -37
- package/icons/times/index.esm.min.js +0 -1
- package/icons/timescircle/index.esm.js +0 -661
- package/icons/timescircle/index.esm.min.js +0 -1
- package/icons/trash/index.esm.js +0 -661
- package/icons/trash/index.esm.min.js +0 -1
- package/icons/undo/index.esm.js +0 -661
- package/icons/undo/index.esm.min.js +0 -1
- package/icons/upload/index.esm.js +0 -661
- package/icons/upload/index.esm.min.js +0 -1
- package/icons/windowmaximize/index.esm.js +0 -661
- package/icons/windowmaximize/index.esm.min.js +0 -1
- package/icons/windowminimize/index.esm.js +0 -661
- package/icons/windowminimize/index.esm.min.js +0 -1
- package/image/image.esm.js +0 -1162
- package/image/image.esm.min.js +0 -1
- package/inplace/inplace.esm.js +0 -243
- package/inplace/inplace.esm.min.js +0 -1
- package/inputmask/inputmask.esm.js +0 -560
- package/inputmask/inputmask.esm.min.js +0 -1
- package/inputnumber/inputnumber.esm.js +0 -1209
- package/inputnumber/inputnumber.esm.min.js +0 -1
- package/inputswitch/inputswitch.esm.js +0 -291
- package/inputswitch/inputswitch.esm.min.js +0 -1
- package/inputtext/inputtext.esm.js +0 -171
- package/inputtext/inputtext.esm.min.js +0 -1
- package/inputtextarea/inputtextarea.esm.js +0 -220
- package/inputtextarea/inputtextarea.esm.min.js +0 -1
- package/keyfilter/keyfilter.esm.js +0 -108
- package/keyfilter/keyfilter.esm.min.js +0 -1
- package/knob/knob.esm.js +0 -318
- package/knob/knob.esm.min.js +0 -1
- package/listbox/listbox.esm.js +0 -810
- package/listbox/listbox.esm.min.js +0 -1
- package/megamenu/megamenu.esm.js +0 -716
- package/megamenu/megamenu.esm.min.js +0 -1
- package/mention/mention.esm.js +0 -771
- package/mention/mention.esm.min.js +0 -1
- package/menu/menu.esm.js +0 -485
- package/menu/menu.esm.min.js +0 -1
- package/menubar/menubar.esm.js +0 -584
- package/menubar/menubar.esm.min.js +0 -1
- package/message/message.esm.js +0 -169
- package/message/message.esm.min.js +0 -1
- package/messages/messages.esm.js +0 -439
- package/messages/messages.esm.min.js +0 -1
- package/multiselect/multiselect.esm.js +0 -1724
- package/multiselect/multiselect.esm.min.js +0 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +0 -352
- package/multistatecheckbox/multistatecheckbox.esm.min.js +0 -1
- package/orderlist/orderlist.esm.js +0 -816
- package/orderlist/orderlist.esm.min.js +0 -1
- package/organizationchart/organizationchart.esm.js +0 -480
- package/organizationchart/organizationchart.esm.min.js +0 -1
- package/overlaypanel/overlaypanel.esm.js +0 -516
- package/overlaypanel/overlaypanel.esm.min.js +0 -1
- package/overlayservice/overlayservice.esm.js +0 -7
- package/overlayservice/overlayservice.esm.min.js +0 -1
- package/paginator/paginator.esm.js +0 -933
- package/paginator/paginator.esm.min.js +0 -1
- package/panel/panel.esm.js +0 -316
- package/panel/panel.esm.min.js +0 -1
- package/panelmenu/panelmenu.esm.js +0 -645
- package/panelmenu/panelmenu.esm.min.js +0 -1
- package/passthrough/index.esm.js +0 -71
- package/passthrough/index.esm.min.js +0 -1
- package/passthrough/tailwind/index.esm.js +0 -3509
- package/passthrough/tailwind/index.esm.min.js +0 -1
- package/password/password.esm.js +0 -567
- package/password/password.esm.min.js +0 -1
- package/picklist/picklist.esm.js +0 -1119
- package/picklist/picklist.esm.min.js +0 -1
- package/portal/portal.esm.js +0 -110
- package/portal/portal.esm.min.js +0 -1
- package/primereact.all.esm.js +0 -51646
- package/primereact.all.esm.min.js +0 -1
- package/progressbar/progressbar.esm.js +0 -190
- package/progressbar/progressbar.esm.min.js +0 -1
- package/progressspinner/progressspinner.esm.js +0 -88
- package/progressspinner/progressspinner.esm.min.js +0 -1
- package/radiobutton/radiobutton.esm.js +0 -329
- package/radiobutton/radiobutton.esm.min.js +0 -1
- package/rating/rating.esm.js +0 -273
- package/rating/rating.esm.min.js +0 -1
- package/ripple/ripple.esm.js +0 -100
- package/ripple/ripple.esm.min.js +0 -1
- package/row/row.esm.js +0 -36
- package/row/row.esm.min.js +0 -1
- package/scrollpanel/scrollpanel.esm.js +0 -210
- package/scrollpanel/scrollpanel.esm.min.js +0 -1
- package/scrolltop/scrolltop.esm.js +0 -269
- package/scrolltop/scrolltop.esm.min.js +0 -1
- package/selectbutton/selectbutton.esm.js +0 -327
- package/selectbutton/selectbutton.esm.min.js +0 -1
- package/sidebar/sidebar.esm.js +0 -543
- package/sidebar/sidebar.esm.min.js +0 -1
- package/skeleton/skeleton.esm.js +0 -125
- package/skeleton/skeleton.esm.min.js +0 -1
- package/slidemenu/slidemenu.esm.js +0 -689
- package/slidemenu/slidemenu.esm.min.js +0 -1
- package/slider/slider.esm.js +0 -478
- package/slider/slider.esm.min.js +0 -1
- package/speeddial/speeddial.esm.js +0 -521
- package/speeddial/speeddial.esm.min.js +0 -1
- package/splitbutton/splitbutton.esm.js +0 -545
- package/splitbutton/splitbutton.esm.min.js +0 -1
- package/splitter/splitter.esm.js +0 -466
- package/splitter/splitter.esm.min.js +0 -1
- package/steps/steps.esm.js +0 -294
- package/steps/steps.esm.min.js +0 -1
- package/styleclass/styleclass.esm.js +0 -269
- package/styleclass/styleclass.esm.min.js +0 -1
- package/tabmenu/tabmenu.esm.js +0 -332
- package/tabmenu/tabmenu.esm.min.js +0 -1
- package/tabview/tabview.esm.js +0 -678
- package/tabview/tabview.esm.min.js +0 -1
- package/tag/tag.esm.js +0 -117
- package/tag/tag.esm.min.js +0 -1
- package/terminal/terminal.esm.js +0 -280
- package/terminal/terminal.esm.min.js +0 -1
- package/terminalservice/terminalservice.esm.js +0 -7
- package/terminalservice/terminalservice.esm.min.js +0 -1
- package/tieredmenu/tieredmenu.esm.js +0 -699
- package/tieredmenu/tieredmenu.esm.min.js +0 -1
- package/timeline/timeline.esm.js +0 -164
- package/timeline/timeline.esm.min.js +0 -1
- package/toast/toast.esm.js +0 -739
- package/toast/toast.esm.min.js +0 -1
- package/togglebutton/togglebutton.esm.js +0 -217
- package/togglebutton/togglebutton.esm.min.js +0 -1
- package/toolbar/toolbar.esm.js +0 -79
- package/toolbar/toolbar.esm.min.js +0 -1
- package/tooltip/tooltip.esm.js +0 -696
- package/tooltip/tooltip.esm.min.js +0 -1
- package/tree/tree.esm.js +0 -1403
- package/tree/tree.esm.min.js +0 -1
- package/treeselect/treeselect.esm.js +0 -930
- package/treeselect/treeselect.esm.min.js +0 -1
- package/treetable/treetable.esm.js +0 -3094
- package/treetable/treetable.esm.min.js +0 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +0 -292
- package/tristatecheckbox/tristatecheckbox.esm.min.js +0 -1
- package/utils/utils.esm.js +0 -2383
- package/utils/utils.esm.min.js +0 -1
- package/virtualscroller/virtualscroller.esm.js +0 -972
- package/virtualscroller/virtualscroller.esm.min.js +0 -1
package/toast/toast.esm.js
DELETED
|
@@ -1,739 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { TransitionGroup } from 'react-transition-group';
|
|
5
|
-
import PrimeReact$1, { PrimeReactContext } from 'primereact/api';
|
|
6
|
-
import { CSSTransition } from 'primereact/csstransition';
|
|
7
|
-
import { useTimeout, useUpdateEffect, useUnmountEffect } from 'primereact/hooks';
|
|
8
|
-
import { Portal } from 'primereact/portal';
|
|
9
|
-
import { classNames, mergeProps, DomHandler, IconUtils, ObjectUtils, ZIndexUtils } from 'primereact/utils';
|
|
10
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
11
|
-
import { CheckIcon } from 'primereact/icons/check';
|
|
12
|
-
import { ExclamationTriangleIcon } from 'primereact/icons/exclamationtriangle';
|
|
13
|
-
import { InfoCircleIcon } from 'primereact/icons/infocircle';
|
|
14
|
-
import { TimesIcon } from 'primereact/icons/times';
|
|
15
|
-
import { TimesCircleIcon } from 'primereact/icons/timescircle';
|
|
16
|
-
import { Ripple } from 'primereact/ripple';
|
|
17
|
-
|
|
18
|
-
function _extends() {
|
|
19
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
20
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
21
|
-
var source = arguments[i];
|
|
22
|
-
for (var key in source) {
|
|
23
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
24
|
-
target[key] = source[key];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
};
|
|
30
|
-
return _extends.apply(this, arguments);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _arrayLikeToArray(arr, len) {
|
|
34
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
35
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
36
|
-
return arr2;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function _arrayWithoutHoles(arr) {
|
|
40
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _iterableToArray(iter) {
|
|
44
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
48
|
-
if (!o) return;
|
|
49
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
50
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
51
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
52
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
53
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _nonIterableSpread() {
|
|
57
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _toConsumableArray(arr) {
|
|
61
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _arrayWithHoles(arr) {
|
|
65
|
-
if (Array.isArray(arr)) return arr;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _iterableToArrayLimit(r, l) {
|
|
69
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
70
|
-
if (null != t) {
|
|
71
|
-
var e,
|
|
72
|
-
n,
|
|
73
|
-
i,
|
|
74
|
-
u,
|
|
75
|
-
a = [],
|
|
76
|
-
f = !0,
|
|
77
|
-
o = !1;
|
|
78
|
-
try {
|
|
79
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
80
|
-
if (Object(t) !== t) return;
|
|
81
|
-
f = !1;
|
|
82
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
83
|
-
} catch (r) {
|
|
84
|
-
o = !0, n = r;
|
|
85
|
-
} finally {
|
|
86
|
-
try {
|
|
87
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
88
|
-
} finally {
|
|
89
|
-
if (o) throw n;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return a;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function _nonIterableRest() {
|
|
97
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function _slicedToArray(arr, i) {
|
|
101
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _typeof(o) {
|
|
105
|
-
"@babel/helpers - typeof";
|
|
106
|
-
|
|
107
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
108
|
-
return typeof o;
|
|
109
|
-
} : function (o) {
|
|
110
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
111
|
-
}, _typeof(o);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function _toPrimitive(input, hint) {
|
|
115
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
116
|
-
var prim = input[Symbol.toPrimitive];
|
|
117
|
-
if (prim !== undefined) {
|
|
118
|
-
var res = prim.call(input, hint || "default");
|
|
119
|
-
if (_typeof(res) !== "object") return res;
|
|
120
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
121
|
-
}
|
|
122
|
-
return (hint === "string" ? String : Number)(input);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function _toPropertyKey(arg) {
|
|
126
|
-
var key = _toPrimitive(arg, "string");
|
|
127
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function _defineProperty(obj, key, value) {
|
|
131
|
-
key = _toPropertyKey(key);
|
|
132
|
-
if (key in obj) {
|
|
133
|
-
Object.defineProperty(obj, key, {
|
|
134
|
-
value: value,
|
|
135
|
-
enumerable: true,
|
|
136
|
-
configurable: true,
|
|
137
|
-
writable: true
|
|
138
|
-
});
|
|
139
|
-
} else {
|
|
140
|
-
obj[key] = value;
|
|
141
|
-
}
|
|
142
|
-
return obj;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
var styles = "\n@layer primereact {\n .p-toast {\n width: calc(100% - var(--toast-indent, 0px));\n max-width: 25rem;\n }\n \n .p-toast-message-icon {\n flex-shrink: 0;\n }\n \n .p-toast-message-content {\n display: flex;\n align-items: flex-start;\n }\n \n .p-toast-message-text {\n flex: 1 1 auto;\n }\n \n .p-toast-summary {\n overflow-wrap: anywhere;\n }\n \n .p-toast-detail {\n overflow-wrap: anywhere;\n }\n \n .p-toast-top-center {\n transform: translateX(-50%);\n }\n \n .p-toast-bottom-center {\n transform: translateX(-50%);\n }\n \n .p-toast-center {\n min-width: 20vw;\n transform: translate(-50%, -50%);\n }\n \n .p-toast-icon-close {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-toast-icon-close.p-link {\n cursor: pointer;\n }\n \n /* Animations */\n .p-toast-message-enter {\n opacity: 0;\n transform: translateY(50%);\n }\n \n .p-toast-message-enter-active {\n opacity: 1;\n transform: translateY(0);\n transition: transform 0.3s, opacity 0.3s;\n }\n \n .p-toast-message-enter-done {\n transform: none;\n }\n \n .p-toast-message-exit {\n opacity: 1;\n max-height: 1000px;\n }\n \n .p-toast .p-toast-message.p-toast-message-exit-active {\n opacity: 0;\n max-height: 0;\n margin-bottom: 0;\n overflow: hidden;\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;\n }\n}\n";
|
|
146
|
-
var classes = {
|
|
147
|
-
root: function root(_ref) {
|
|
148
|
-
var props = _ref.props,
|
|
149
|
-
context = _ref.context;
|
|
150
|
-
return classNames('p-toast p-component p-toast-' + props.position, props.className, {
|
|
151
|
-
'p-input-filled': context && context.inputStyle === 'filled' || PrimeReact$1.inputStyle === 'filled',
|
|
152
|
-
'p-ripple-disabled': context && context.ripple === false || PrimeReact$1.ripple === false
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
message: {
|
|
156
|
-
message: function message(_ref2) {
|
|
157
|
-
var severity = _ref2.severity;
|
|
158
|
-
return classNames('p-toast-message', _defineProperty({}, "p-toast-message-".concat(severity), severity));
|
|
159
|
-
},
|
|
160
|
-
content: 'p-toast-message-content',
|
|
161
|
-
buttonicon: 'p-toast-icon-close-icon',
|
|
162
|
-
closeButton: 'p-toast-icon-close p-link',
|
|
163
|
-
icon: 'p-toast-message-icon',
|
|
164
|
-
text: 'p-toast-message-text',
|
|
165
|
-
summary: 'p-toast-summary',
|
|
166
|
-
detail: 'p-toast-detail'
|
|
167
|
-
},
|
|
168
|
-
transition: 'p-toast-message'
|
|
169
|
-
};
|
|
170
|
-
var inlineStyles = {
|
|
171
|
-
root: function root(_ref3) {
|
|
172
|
-
var props = _ref3.props;
|
|
173
|
-
return {
|
|
174
|
-
position: 'fixed',
|
|
175
|
-
top: props.position === 'top-right' || props.position === 'top-left' || props.position === 'top-center' ? '20px' : props.position === 'center' ? '50%' : null,
|
|
176
|
-
right: (props.position === 'top-right' || props.position === 'bottom-right') && '20px',
|
|
177
|
-
bottom: (props.position === 'bottom-left' || props.position === 'bottom-right' || props.position === 'bottom-center') && '20px',
|
|
178
|
-
left: props.position === 'top-left' || props.position === 'bottom-left' ? '20px' : props.position === 'center' || props.position === 'top-center' || props.position === 'bottom-center' ? '50%' : null
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
var ToastBase = ComponentBase.extend({
|
|
183
|
-
defaultProps: {
|
|
184
|
-
__TYPE: 'Toast',
|
|
185
|
-
id: null,
|
|
186
|
-
className: null,
|
|
187
|
-
style: null,
|
|
188
|
-
baseZIndex: 0,
|
|
189
|
-
position: 'top-right',
|
|
190
|
-
transitionOptions: null,
|
|
191
|
-
appendTo: 'self',
|
|
192
|
-
onClick: null,
|
|
193
|
-
onRemove: null,
|
|
194
|
-
onShow: null,
|
|
195
|
-
onHide: null,
|
|
196
|
-
onMouseEnter: null,
|
|
197
|
-
onMouseLeave: null,
|
|
198
|
-
children: undefined
|
|
199
|
-
},
|
|
200
|
-
css: {
|
|
201
|
-
classes: classes,
|
|
202
|
-
styles: styles,
|
|
203
|
-
inlineStyles: inlineStyles
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
function _defineProperties(target, props) {
|
|
208
|
-
for (var i = 0; i < props.length; i++) {
|
|
209
|
-
var descriptor = props[i];
|
|
210
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
211
|
-
descriptor.configurable = true;
|
|
212
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
213
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
217
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
218
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
219
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
220
|
-
writable: false
|
|
221
|
-
});
|
|
222
|
-
return Constructor;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function _classCallCheck(instance, Constructor) {
|
|
226
|
-
if (!(instance instanceof Constructor)) {
|
|
227
|
-
throw new TypeError("Cannot call a class as a function");
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
var FilterMatchMode = Object.freeze({
|
|
232
|
-
STARTS_WITH: 'startsWith',
|
|
233
|
-
CONTAINS: 'contains',
|
|
234
|
-
NOT_CONTAINS: 'notContains',
|
|
235
|
-
ENDS_WITH: 'endsWith',
|
|
236
|
-
EQUALS: 'equals',
|
|
237
|
-
NOT_EQUALS: 'notEquals',
|
|
238
|
-
IN: 'in',
|
|
239
|
-
LESS_THAN: 'lt',
|
|
240
|
-
LESS_THAN_OR_EQUAL_TO: 'lte',
|
|
241
|
-
GREATER_THAN: 'gt',
|
|
242
|
-
GREATER_THAN_OR_EQUAL_TO: 'gte',
|
|
243
|
-
BETWEEN: 'between',
|
|
244
|
-
DATE_IS: 'dateIs',
|
|
245
|
-
DATE_IS_NOT: 'dateIsNot',
|
|
246
|
-
DATE_BEFORE: 'dateBefore',
|
|
247
|
-
DATE_AFTER: 'dateAfter',
|
|
248
|
-
CUSTOM: 'custom'
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
var PrimeReact = /*#__PURE__*/_createClass(function PrimeReact() {
|
|
252
|
-
_classCallCheck(this, PrimeReact);
|
|
253
|
-
});
|
|
254
|
-
_defineProperty(PrimeReact, "ripple", false);
|
|
255
|
-
_defineProperty(PrimeReact, "inputStyle", 'outlined');
|
|
256
|
-
_defineProperty(PrimeReact, "locale", 'en');
|
|
257
|
-
_defineProperty(PrimeReact, "appendTo", null);
|
|
258
|
-
_defineProperty(PrimeReact, "cssTransition", true);
|
|
259
|
-
_defineProperty(PrimeReact, "autoZIndex", true);
|
|
260
|
-
_defineProperty(PrimeReact, "hideOverlaysOnDocumentScrolling", false);
|
|
261
|
-
_defineProperty(PrimeReact, "nonce", null);
|
|
262
|
-
_defineProperty(PrimeReact, "nullSortOrder", 1);
|
|
263
|
-
_defineProperty(PrimeReact, "zIndex", {
|
|
264
|
-
modal: 1100,
|
|
265
|
-
overlay: 1000,
|
|
266
|
-
menu: 1000,
|
|
267
|
-
tooltip: 1100,
|
|
268
|
-
toast: 1200
|
|
269
|
-
});
|
|
270
|
-
_defineProperty(PrimeReact, "pt", undefined);
|
|
271
|
-
_defineProperty(PrimeReact, "filterMatchModeOptions", {
|
|
272
|
-
text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],
|
|
273
|
-
numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],
|
|
274
|
-
date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]
|
|
275
|
-
});
|
|
276
|
-
_defineProperty(PrimeReact, "changeTheme", function (currentTheme, newTheme, linkElementId, callback) {
|
|
277
|
-
var _linkElement$parentNo;
|
|
278
|
-
var linkElement = document.getElementById(linkElementId);
|
|
279
|
-
var cloneLinkElement = linkElement.cloneNode(true);
|
|
280
|
-
var newThemeUrl = linkElement.getAttribute('href').replace(currentTheme, newTheme);
|
|
281
|
-
cloneLinkElement.setAttribute('id', linkElementId + '-clone');
|
|
282
|
-
cloneLinkElement.setAttribute('href', newThemeUrl);
|
|
283
|
-
cloneLinkElement.addEventListener('load', function () {
|
|
284
|
-
linkElement.remove();
|
|
285
|
-
cloneLinkElement.setAttribute('id', linkElementId);
|
|
286
|
-
if (callback) {
|
|
287
|
-
callback();
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
(_linkElement$parentNo = linkElement.parentNode) === null || _linkElement$parentNo === void 0 || _linkElement$parentNo.insertBefore(cloneLinkElement, linkElement.nextSibling);
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
var locales = {
|
|
294
|
-
en: {
|
|
295
|
-
startsWith: 'Starts with',
|
|
296
|
-
contains: 'Contains',
|
|
297
|
-
notContains: 'Not contains',
|
|
298
|
-
endsWith: 'Ends with',
|
|
299
|
-
equals: 'Equals',
|
|
300
|
-
notEquals: 'Not equals',
|
|
301
|
-
noFilter: 'No Filter',
|
|
302
|
-
filter: 'Filter',
|
|
303
|
-
lt: 'Less than',
|
|
304
|
-
lte: 'Less than or equal to',
|
|
305
|
-
gt: 'Greater than',
|
|
306
|
-
gte: 'Greater than or equal to',
|
|
307
|
-
dateIs: 'Date is',
|
|
308
|
-
dateIsNot: 'Date is not',
|
|
309
|
-
dateBefore: 'Date is before',
|
|
310
|
-
dateAfter: 'Date is after',
|
|
311
|
-
custom: 'Custom',
|
|
312
|
-
clear: 'Clear',
|
|
313
|
-
close: 'Close',
|
|
314
|
-
apply: 'Apply',
|
|
315
|
-
matchAll: 'Match All',
|
|
316
|
-
matchAny: 'Match Any',
|
|
317
|
-
addRule: 'Add Rule',
|
|
318
|
-
removeRule: 'Remove Rule',
|
|
319
|
-
accept: 'Yes',
|
|
320
|
-
reject: 'No',
|
|
321
|
-
choose: 'Choose',
|
|
322
|
-
upload: 'Upload',
|
|
323
|
-
cancel: 'Cancel',
|
|
324
|
-
pending: 'Pending',
|
|
325
|
-
fileSizeTypes: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
|
326
|
-
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
327
|
-
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
328
|
-
dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
329
|
-
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
330
|
-
monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
331
|
-
today: 'Today',
|
|
332
|
-
weekHeader: 'Wk',
|
|
333
|
-
firstDayOfWeek: 0,
|
|
334
|
-
showMonthAfterYear: false,
|
|
335
|
-
dateFormat: 'mm/dd/yy',
|
|
336
|
-
weak: 'Weak',
|
|
337
|
-
medium: 'Medium',
|
|
338
|
-
strong: 'Strong',
|
|
339
|
-
passwordPrompt: 'Enter a password',
|
|
340
|
-
emptyFilterMessage: 'No available options',
|
|
341
|
-
emptyMessage: 'No results found',
|
|
342
|
-
aria: {
|
|
343
|
-
trueLabel: 'True',
|
|
344
|
-
falseLabel: 'False',
|
|
345
|
-
nullLabel: 'Not Selected',
|
|
346
|
-
star: '1 star',
|
|
347
|
-
stars: '{star} stars',
|
|
348
|
-
selectAll: 'All items selected',
|
|
349
|
-
unselectAll: 'All items unselected',
|
|
350
|
-
close: 'Close',
|
|
351
|
-
previous: 'Previous',
|
|
352
|
-
next: 'Next',
|
|
353
|
-
navigation: 'Navigation',
|
|
354
|
-
scrollTop: 'Scroll Top',
|
|
355
|
-
moveTop: 'Move Top',
|
|
356
|
-
moveUp: 'Move Up',
|
|
357
|
-
moveDown: 'Move Down',
|
|
358
|
-
moveBottom: 'Move Bottom',
|
|
359
|
-
moveToTarget: 'Move to Target',
|
|
360
|
-
moveToSource: 'Move to Source',
|
|
361
|
-
moveAllToTarget: 'Move All to Target',
|
|
362
|
-
moveAllToSource: 'Move All to Source',
|
|
363
|
-
pageLabel: 'Page {page}',
|
|
364
|
-
firstPageLabel: 'First Page',
|
|
365
|
-
lastPageLabel: 'Last Page',
|
|
366
|
-
nextPageLabel: 'Next Page',
|
|
367
|
-
previousPageLabel: 'Previous Page',
|
|
368
|
-
rowsPerPageLabel: 'Rows per page',
|
|
369
|
-
jumpToPageDropdownLabel: 'Jump to Page Dropdown',
|
|
370
|
-
jumpToPageInputLabel: 'Jump to Page Input',
|
|
371
|
-
selectRow: 'Row Selected',
|
|
372
|
-
unselectRow: 'Row Unselected',
|
|
373
|
-
expandRow: 'Row Expanded',
|
|
374
|
-
collapseRow: 'Row Collapsed',
|
|
375
|
-
showFilterMenu: 'Show Filter Menu',
|
|
376
|
-
hideFilterMenu: 'Hide Filter Menu',
|
|
377
|
-
filterOperator: 'Filter Operator',
|
|
378
|
-
filterConstraint: 'Filter Constraint',
|
|
379
|
-
editRow: 'Row Edit',
|
|
380
|
-
saveEdit: 'Save Edit',
|
|
381
|
-
cancelEdit: 'Cancel Edit',
|
|
382
|
-
listView: 'List View',
|
|
383
|
-
gridView: 'Grid View',
|
|
384
|
-
slide: 'Slide',
|
|
385
|
-
slideNumber: '{slideNumber}',
|
|
386
|
-
zoomImage: 'Zoom Image',
|
|
387
|
-
zoomIn: 'Zoom In',
|
|
388
|
-
zoomOut: 'Zoom Out',
|
|
389
|
-
rotateRight: 'Rotate Right',
|
|
390
|
-
rotateLeft: 'Rotate Left',
|
|
391
|
-
selectLabel: 'Select',
|
|
392
|
-
unselectLabel: 'Unselect',
|
|
393
|
-
expandLabel: 'Expand',
|
|
394
|
-
collapseLabel: 'Collapse'
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
function localeOption(key, locale) {
|
|
399
|
-
var _locale = locale || PrimeReact.locale;
|
|
400
|
-
try {
|
|
401
|
-
return localeOptions(_locale)[key];
|
|
402
|
-
} catch (error) {
|
|
403
|
-
throw new Error("The ".concat(key, " option is not found in the current locale('").concat(_locale, "')."));
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
function localeOptions(locale) {
|
|
407
|
-
var _locale = locale || PrimeReact.locale;
|
|
408
|
-
return locales[_locale];
|
|
409
|
-
}
|
|
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 ToastMessage = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
414
|
-
var messageInfo = props.messageInfo,
|
|
415
|
-
parentMetaData = props.metaData,
|
|
416
|
-
_props$ptCallbacks = props.ptCallbacks,
|
|
417
|
-
ptm = _props$ptCallbacks.ptm,
|
|
418
|
-
ptmo = _props$ptCallbacks.ptmo,
|
|
419
|
-
cx = _props$ptCallbacks.cx,
|
|
420
|
-
index = props.index;
|
|
421
|
-
var _messageInfo$message = messageInfo.message,
|
|
422
|
-
severity = _messageInfo$message.severity,
|
|
423
|
-
content = _messageInfo$message.content,
|
|
424
|
-
summary = _messageInfo$message.summary,
|
|
425
|
-
detail = _messageInfo$message.detail,
|
|
426
|
-
closable = _messageInfo$message.closable,
|
|
427
|
-
life = _messageInfo$message.life,
|
|
428
|
-
sticky = _messageInfo$message.sticky,
|
|
429
|
-
_className = _messageInfo$message.className,
|
|
430
|
-
style = _messageInfo$message.style,
|
|
431
|
-
_contentClassName = _messageInfo$message.contentClassName,
|
|
432
|
-
contentStyle = _messageInfo$message.contentStyle,
|
|
433
|
-
_icon = _messageInfo$message.icon,
|
|
434
|
-
_closeIcon = _messageInfo$message.closeIcon,
|
|
435
|
-
pt = _messageInfo$message.pt;
|
|
436
|
-
var params = {
|
|
437
|
-
index: index
|
|
438
|
-
};
|
|
439
|
-
var parentParams = _objectSpread(_objectSpread({}, parentMetaData), params);
|
|
440
|
-
var _React$useState = React.useState(false),
|
|
441
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
442
|
-
focused = _React$useState2[0],
|
|
443
|
-
setFocused = _React$useState2[1];
|
|
444
|
-
var _useTimeout = useTimeout(function () {
|
|
445
|
-
onClose();
|
|
446
|
-
}, life || 3000, !sticky && !focused),
|
|
447
|
-
_useTimeout2 = _slicedToArray(_useTimeout, 1),
|
|
448
|
-
clearTimer = _useTimeout2[0];
|
|
449
|
-
var getPTOptions = function getPTOptions(key, options) {
|
|
450
|
-
return ptm(key, _objectSpread({
|
|
451
|
-
hostName: props.hostName
|
|
452
|
-
}, options));
|
|
453
|
-
};
|
|
454
|
-
var onClose = function onClose() {
|
|
455
|
-
clearTimer();
|
|
456
|
-
props.onClose && props.onClose(messageInfo);
|
|
457
|
-
};
|
|
458
|
-
var onClick = function onClick(event) {
|
|
459
|
-
if (props.onClick && !(DomHandler.hasClass(event.target, 'p-toast-icon-close') || DomHandler.hasClass(event.target, 'p-toast-icon-close-icon'))) {
|
|
460
|
-
props.onClick(messageInfo.message);
|
|
461
|
-
}
|
|
462
|
-
};
|
|
463
|
-
var onMouseEnter = function onMouseEnter(event) {
|
|
464
|
-
props.onMouseEnter && props.onMouseEnter(event);
|
|
465
|
-
|
|
466
|
-
// do not continue if the user has canceled the event
|
|
467
|
-
if (event.defaultPrevented) {
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
// stop timer while user has focused message
|
|
472
|
-
if (!sticky) {
|
|
473
|
-
clearTimer();
|
|
474
|
-
setFocused(true);
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
var onMouseLeave = function onMouseLeave(event) {
|
|
478
|
-
props.onMouseLeave && props.onMouseLeave(event);
|
|
479
|
-
|
|
480
|
-
// do not continue if the user has canceled the event
|
|
481
|
-
if (event.defaultPrevented) {
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
// restart timer when user has left message
|
|
486
|
-
if (!sticky) {
|
|
487
|
-
setFocused(false);
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
var createCloseIcon = function createCloseIcon() {
|
|
491
|
-
var buttonIconProps = mergeProps({
|
|
492
|
-
className: cx('message.buttonicon')
|
|
493
|
-
}, getPTOptions('buttonicon', parentParams), ptmo(pt, 'buttonicon', _objectSpread(_objectSpread({}, params), {}, {
|
|
494
|
-
hostName: props.hostName
|
|
495
|
-
})));
|
|
496
|
-
var icon = _closeIcon || /*#__PURE__*/React.createElement(TimesIcon, buttonIconProps);
|
|
497
|
-
var closeIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, buttonIconProps), {
|
|
498
|
-
props: props
|
|
499
|
-
});
|
|
500
|
-
var ariaLabel = props.ariaCloseLabel || localeOption('close');
|
|
501
|
-
var closeButtonProps = mergeProps({
|
|
502
|
-
type: 'button',
|
|
503
|
-
className: cx('message.closeButton'),
|
|
504
|
-
onClick: onClose,
|
|
505
|
-
'aria-label': ariaLabel
|
|
506
|
-
}, getPTOptions('closeButton', parentParams), ptmo(pt, 'closeButton', _objectSpread(_objectSpread({}, params), {}, {
|
|
507
|
-
hostName: props.hostName
|
|
508
|
-
})));
|
|
509
|
-
if (closable !== false) {
|
|
510
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", closeButtonProps, closeIcon, /*#__PURE__*/React.createElement(Ripple, null)));
|
|
511
|
-
}
|
|
512
|
-
return null;
|
|
513
|
-
};
|
|
514
|
-
var createMessage = function createMessage() {
|
|
515
|
-
if (messageInfo) {
|
|
516
|
-
var contentEl = ObjectUtils.getJSXElement(content, {
|
|
517
|
-
message: messageInfo.message,
|
|
518
|
-
onClick: onClick,
|
|
519
|
-
onClose: onClose
|
|
520
|
-
});
|
|
521
|
-
var iconProps = mergeProps({
|
|
522
|
-
className: cx('message.icon')
|
|
523
|
-
}, getPTOptions('icon', parentParams), ptmo(pt, 'icon', _objectSpread(_objectSpread({}, params), {}, {
|
|
524
|
-
hostName: props.hostName
|
|
525
|
-
})));
|
|
526
|
-
var icon = _icon;
|
|
527
|
-
if (!_icon) {
|
|
528
|
-
switch (severity) {
|
|
529
|
-
case 'info':
|
|
530
|
-
icon = /*#__PURE__*/React.createElement(InfoCircleIcon, iconProps);
|
|
531
|
-
break;
|
|
532
|
-
case 'warn':
|
|
533
|
-
icon = /*#__PURE__*/React.createElement(ExclamationTriangleIcon, iconProps);
|
|
534
|
-
break;
|
|
535
|
-
case 'error':
|
|
536
|
-
icon = /*#__PURE__*/React.createElement(TimesCircleIcon, iconProps);
|
|
537
|
-
break;
|
|
538
|
-
case 'success':
|
|
539
|
-
icon = /*#__PURE__*/React.createElement(CheckIcon, iconProps);
|
|
540
|
-
break;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
var messageIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, iconProps), {
|
|
544
|
-
props: props
|
|
545
|
-
});
|
|
546
|
-
var textProps = mergeProps({
|
|
547
|
-
className: cx('message.text')
|
|
548
|
-
}, getPTOptions('text', parentParams), ptmo(pt, 'text', _objectSpread(_objectSpread({}, params), {}, {
|
|
549
|
-
hostName: props.hostName
|
|
550
|
-
})));
|
|
551
|
-
var summaryProps = mergeProps({
|
|
552
|
-
className: cx('message.summary')
|
|
553
|
-
}, getPTOptions('summary', parentParams), ptmo(pt, 'summary', _objectSpread(_objectSpread({}, params), {}, {
|
|
554
|
-
hostName: props.hostName
|
|
555
|
-
})));
|
|
556
|
-
var detailProps = mergeProps({
|
|
557
|
-
className: cx('message.detail')
|
|
558
|
-
}, getPTOptions('detail', parentParams), ptmo(pt, 'detail', _objectSpread(_objectSpread({}, params), {}, {
|
|
559
|
-
hostName: props.hostName
|
|
560
|
-
})));
|
|
561
|
-
return contentEl || /*#__PURE__*/React.createElement(React.Fragment, null, messageIcon, /*#__PURE__*/React.createElement("div", textProps, /*#__PURE__*/React.createElement("span", summaryProps, summary), detail && /*#__PURE__*/React.createElement("div", detailProps, detail)));
|
|
562
|
-
}
|
|
563
|
-
return null;
|
|
564
|
-
};
|
|
565
|
-
var message = createMessage();
|
|
566
|
-
var closeIcon = createCloseIcon();
|
|
567
|
-
var messageProps = mergeProps({
|
|
568
|
-
ref: ref,
|
|
569
|
-
className: classNames(_className, cx('message.message', {
|
|
570
|
-
severity: severity
|
|
571
|
-
})),
|
|
572
|
-
style: style,
|
|
573
|
-
role: 'alert',
|
|
574
|
-
'aria-live': 'assertive',
|
|
575
|
-
'aria-atomic': 'true',
|
|
576
|
-
onClick: onClick,
|
|
577
|
-
onMouseEnter: onMouseEnter,
|
|
578
|
-
onMouseLeave: onMouseLeave
|
|
579
|
-
}, getPTOptions('message', parentParams), ptmo(pt, 'root', _objectSpread(_objectSpread({}, params), {}, {
|
|
580
|
-
hostName: props.hostName
|
|
581
|
-
})));
|
|
582
|
-
var contentProps = mergeProps({
|
|
583
|
-
className: classNames(_contentClassName, cx('message.content')),
|
|
584
|
-
style: contentStyle
|
|
585
|
-
}, getPTOptions('content', parentParams), ptmo(pt, 'content', _objectSpread(_objectSpread({}, params), {}, {
|
|
586
|
-
hostName: props.hostName
|
|
587
|
-
})));
|
|
588
|
-
return /*#__PURE__*/React.createElement("div", messageProps, /*#__PURE__*/React.createElement("div", contentProps, message, closeIcon));
|
|
589
|
-
}));
|
|
590
|
-
ToastMessage.displayName = 'ToastMessage';
|
|
591
|
-
|
|
592
|
-
var messageIdx = 0;
|
|
593
|
-
var Toast = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
594
|
-
var context = React.useContext(PrimeReactContext);
|
|
595
|
-
var props = ToastBase.getProps(inProps, context);
|
|
596
|
-
var _React$useState = React.useState([]),
|
|
597
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
598
|
-
messagesState = _React$useState2[0],
|
|
599
|
-
setMessagesState = _React$useState2[1];
|
|
600
|
-
var containerRef = React.useRef(null);
|
|
601
|
-
var metaData = {
|
|
602
|
-
props: props,
|
|
603
|
-
state: {
|
|
604
|
-
messages: messagesState
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
var ptCallbacks = ToastBase.setMetaData(metaData);
|
|
608
|
-
useHandleStyle(ToastBase.css.styles, ptCallbacks.isUnstyled, {
|
|
609
|
-
name: 'toast'
|
|
610
|
-
});
|
|
611
|
-
var show = function show(messageInfo) {
|
|
612
|
-
if (messageInfo) {
|
|
613
|
-
setMessagesState(function (prev) {
|
|
614
|
-
return assignIdentifiers(prev, messageInfo, true);
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
};
|
|
618
|
-
var assignIdentifiers = function assignIdentifiers(currentState, messageInfo, copy) {
|
|
619
|
-
var messages;
|
|
620
|
-
if (Array.isArray(messageInfo)) {
|
|
621
|
-
var multipleMessages = messageInfo.reduce(function (acc, message) {
|
|
622
|
-
acc.push({
|
|
623
|
-
_pId: messageIdx++,
|
|
624
|
-
message: message
|
|
625
|
-
});
|
|
626
|
-
return acc;
|
|
627
|
-
}, []);
|
|
628
|
-
if (copy) {
|
|
629
|
-
messages = currentState ? [].concat(_toConsumableArray(currentState), _toConsumableArray(multipleMessages)) : multipleMessages;
|
|
630
|
-
} else {
|
|
631
|
-
messages = multipleMessages;
|
|
632
|
-
}
|
|
633
|
-
} else {
|
|
634
|
-
var message = {
|
|
635
|
-
_pId: messageIdx++,
|
|
636
|
-
message: messageInfo
|
|
637
|
-
};
|
|
638
|
-
if (copy) {
|
|
639
|
-
messages = currentState ? [].concat(_toConsumableArray(currentState), [message]) : [message];
|
|
640
|
-
} else {
|
|
641
|
-
messages = [message];
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
return messages;
|
|
645
|
-
};
|
|
646
|
-
var clear = function clear() {
|
|
647
|
-
ZIndexUtils.clear(containerRef.current);
|
|
648
|
-
setMessagesState([]);
|
|
649
|
-
};
|
|
650
|
-
var replace = function replace(messageInfo) {
|
|
651
|
-
setMessagesState(function (previousMessagesState) {
|
|
652
|
-
return assignIdentifiers(previousMessagesState, messageInfo, false);
|
|
653
|
-
});
|
|
654
|
-
};
|
|
655
|
-
var remove = function remove(messageInfo) {
|
|
656
|
-
setMessagesState(function (m) {
|
|
657
|
-
return m.filter(function (msg) {
|
|
658
|
-
return msg._pId !== messageInfo._pId;
|
|
659
|
-
});
|
|
660
|
-
});
|
|
661
|
-
props.onRemove && props.onRemove(messageInfo.message);
|
|
662
|
-
};
|
|
663
|
-
var onClose = function onClose(messageInfo) {
|
|
664
|
-
remove(messageInfo);
|
|
665
|
-
};
|
|
666
|
-
var onEntered = function onEntered() {
|
|
667
|
-
props.onShow && props.onShow();
|
|
668
|
-
};
|
|
669
|
-
var onExited = function onExited() {
|
|
670
|
-
messagesState.length === 1 && ZIndexUtils.clear(containerRef.current);
|
|
671
|
-
props.onHide && props.onHide();
|
|
672
|
-
};
|
|
673
|
-
useUpdateEffect(function () {
|
|
674
|
-
ZIndexUtils.set('toast', containerRef.current, context && context.autoZIndex || PrimeReact$1.autoZIndex, props.baseZIndex || context && context.zIndex['toast'] || PrimeReact$1.zIndex['toast']);
|
|
675
|
-
}, [messagesState, props.baseZIndex]);
|
|
676
|
-
useUnmountEffect(function () {
|
|
677
|
-
ZIndexUtils.clear(containerRef.current);
|
|
678
|
-
});
|
|
679
|
-
React.useImperativeHandle(ref, function () {
|
|
680
|
-
return {
|
|
681
|
-
props: props,
|
|
682
|
-
show: show,
|
|
683
|
-
replace: replace,
|
|
684
|
-
remove: remove,
|
|
685
|
-
clear: clear,
|
|
686
|
-
getElement: function getElement() {
|
|
687
|
-
return containerRef.current;
|
|
688
|
-
}
|
|
689
|
-
};
|
|
690
|
-
});
|
|
691
|
-
var createElement = function createElement() {
|
|
692
|
-
var rootProps = mergeProps({
|
|
693
|
-
ref: containerRef,
|
|
694
|
-
id: props.id,
|
|
695
|
-
className: ptCallbacks.cx('root', {
|
|
696
|
-
context: context
|
|
697
|
-
}),
|
|
698
|
-
style: ptCallbacks.sx('root')
|
|
699
|
-
}, ToastBase.getOtherProps(props), ptCallbacks.ptm('root'));
|
|
700
|
-
var transitionProps = mergeProps({
|
|
701
|
-
classNames: ptCallbacks.cx('transition'),
|
|
702
|
-
timeout: {
|
|
703
|
-
enter: 300,
|
|
704
|
-
exit: 300
|
|
705
|
-
},
|
|
706
|
-
options: props.transitionOptions,
|
|
707
|
-
unmountOnExit: true,
|
|
708
|
-
onEntered: onEntered,
|
|
709
|
-
onExited: onExited
|
|
710
|
-
}, ptCallbacks.ptm('transition'));
|
|
711
|
-
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement(TransitionGroup, null, messagesState && messagesState.map(function (messageInfo, index) {
|
|
712
|
-
var messageRef = /*#__PURE__*/React.createRef();
|
|
713
|
-
return /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
714
|
-
nodeRef: messageRef,
|
|
715
|
-
key: messageInfo._pId
|
|
716
|
-
}, transitionProps), /*#__PURE__*/React.createElement(ToastMessage, {
|
|
717
|
-
hostName: "Toast",
|
|
718
|
-
ref: messageRef,
|
|
719
|
-
messageInfo: messageInfo,
|
|
720
|
-
index: index,
|
|
721
|
-
onClick: props.onClick,
|
|
722
|
-
onClose: onClose,
|
|
723
|
-
onMouseEnter: props.onMouseEnter,
|
|
724
|
-
onMouseLeave: props.onMouseLeave,
|
|
725
|
-
closeIcon: props.closeIcon,
|
|
726
|
-
ptCallbacks: ptCallbacks,
|
|
727
|
-
metaData: metaData
|
|
728
|
-
}));
|
|
729
|
-
})));
|
|
730
|
-
};
|
|
731
|
-
var element = createElement();
|
|
732
|
-
return /*#__PURE__*/React.createElement(Portal, {
|
|
733
|
-
element: element,
|
|
734
|
-
appendTo: props.appendTo
|
|
735
|
-
});
|
|
736
|
-
}));
|
|
737
|
-
Toast.displayName = 'Toast';
|
|
738
|
-
|
|
739
|
-
export { Toast };
|