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,376 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PrimeReactContext, localeOption } from 'primereact/api';
|
|
5
|
-
import { Button } from 'primereact/button';
|
|
6
|
-
import { Dialog } from 'primereact/dialog';
|
|
7
|
-
import { useUpdateEffect, useUnmountEffect } from 'primereact/hooks';
|
|
8
|
-
import { OverlayService } from 'primereact/overlayservice';
|
|
9
|
-
import { Portal } from 'primereact/portal';
|
|
10
|
-
import { classNames, DomHandler, ObjectUtils, mergeProps, IconUtils } from 'primereact/utils';
|
|
11
|
-
import { ComponentBase } from 'primereact/componentbase';
|
|
12
|
-
|
|
13
|
-
function _extends() {
|
|
14
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
15
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
16
|
-
var source = arguments[i];
|
|
17
|
-
for (var key in source) {
|
|
18
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
19
|
-
target[key] = source[key];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return target;
|
|
24
|
-
};
|
|
25
|
-
return _extends.apply(this, arguments);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function _arrayWithHoles(arr) {
|
|
29
|
-
if (Array.isArray(arr)) return arr;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function _iterableToArrayLimit(r, l) {
|
|
33
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
34
|
-
if (null != t) {
|
|
35
|
-
var e,
|
|
36
|
-
n,
|
|
37
|
-
i,
|
|
38
|
-
u,
|
|
39
|
-
a = [],
|
|
40
|
-
f = !0,
|
|
41
|
-
o = !1;
|
|
42
|
-
try {
|
|
43
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
44
|
-
if (Object(t) !== t) return;
|
|
45
|
-
f = !1;
|
|
46
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
47
|
-
} catch (r) {
|
|
48
|
-
o = !0, n = r;
|
|
49
|
-
} finally {
|
|
50
|
-
try {
|
|
51
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
52
|
-
} finally {
|
|
53
|
-
if (o) throw n;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return a;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _arrayLikeToArray(arr, len) {
|
|
61
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
62
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
63
|
-
return arr2;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
67
|
-
if (!o) return;
|
|
68
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
69
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
70
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
71
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
72
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function _nonIterableRest() {
|
|
76
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function _slicedToArray(arr, i) {
|
|
80
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function _typeof(o) {
|
|
84
|
-
"@babel/helpers - typeof";
|
|
85
|
-
|
|
86
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
87
|
-
return typeof o;
|
|
88
|
-
} : function (o) {
|
|
89
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
90
|
-
}, _typeof(o);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function _toPrimitive(input, hint) {
|
|
94
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
95
|
-
var prim = input[Symbol.toPrimitive];
|
|
96
|
-
if (prim !== undefined) {
|
|
97
|
-
var res = prim.call(input, hint || "default");
|
|
98
|
-
if (_typeof(res) !== "object") return res;
|
|
99
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
100
|
-
}
|
|
101
|
-
return (hint === "string" ? String : Number)(input);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _toPropertyKey(arg) {
|
|
105
|
-
var key = _toPrimitive(arg, "string");
|
|
106
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function _defineProperty(obj, key, value) {
|
|
110
|
-
key = _toPropertyKey(key);
|
|
111
|
-
if (key in obj) {
|
|
112
|
-
Object.defineProperty(obj, key, {
|
|
113
|
-
value: value,
|
|
114
|
-
enumerable: true,
|
|
115
|
-
configurable: true,
|
|
116
|
-
writable: true
|
|
117
|
-
});
|
|
118
|
-
} else {
|
|
119
|
-
obj[key] = value;
|
|
120
|
-
}
|
|
121
|
-
return obj;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
var classes = {
|
|
125
|
-
root: 'p-confirm-dialog',
|
|
126
|
-
message: 'p-confirm-dialog-message',
|
|
127
|
-
icon: 'p-confirm-dialog-icon',
|
|
128
|
-
acceptButton: 'p-confirm-dialog-accept',
|
|
129
|
-
rejectButton: function rejectButton(_ref) {
|
|
130
|
-
var getPropValue = _ref.getPropValue;
|
|
131
|
-
return classNames('p-confirm-dialog-reject', {
|
|
132
|
-
'p-button-text': !getPropValue('rejectClassName')
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
var ConfirmDialogBase = ComponentBase.extend({
|
|
137
|
-
defaultProps: {
|
|
138
|
-
__TYPE: 'ConfirmDialog',
|
|
139
|
-
tagKey: undefined,
|
|
140
|
-
visible: undefined,
|
|
141
|
-
message: null,
|
|
142
|
-
rejectLabel: null,
|
|
143
|
-
acceptLabel: null,
|
|
144
|
-
icon: null,
|
|
145
|
-
rejectIcon: null,
|
|
146
|
-
acceptIcon: null,
|
|
147
|
-
rejectClassName: null,
|
|
148
|
-
acceptClassName: null,
|
|
149
|
-
className: null,
|
|
150
|
-
appendTo: null,
|
|
151
|
-
footer: null,
|
|
152
|
-
breakpoints: null,
|
|
153
|
-
onHide: null,
|
|
154
|
-
accept: null,
|
|
155
|
-
reject: null,
|
|
156
|
-
children: undefined
|
|
157
|
-
},
|
|
158
|
-
css: {
|
|
159
|
-
classes: classes
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
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; }
|
|
164
|
-
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; }
|
|
165
|
-
var confirmDialog = function confirmDialog() {
|
|
166
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
167
|
-
props = _objectSpread(_objectSpread({}, props), {
|
|
168
|
-
visible: props.visible === undefined ? true : props.visible
|
|
169
|
-
});
|
|
170
|
-
props.visible && OverlayService.emit('confirm-dialog', props);
|
|
171
|
-
var show = function show() {
|
|
172
|
-
var updatedProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
173
|
-
OverlayService.emit('confirm-dialog', _objectSpread(_objectSpread(_objectSpread({}, props), updatedProps), {
|
|
174
|
-
visible: true
|
|
175
|
-
}));
|
|
176
|
-
};
|
|
177
|
-
var hide = function hide() {
|
|
178
|
-
OverlayService.emit('confirm-dialog', {
|
|
179
|
-
visible: false
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
return {
|
|
183
|
-
show: show,
|
|
184
|
-
hide: hide
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
var ConfirmDialog = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
188
|
-
var context = React.useContext(PrimeReactContext);
|
|
189
|
-
var props = ConfirmDialogBase.getProps(inProps, context);
|
|
190
|
-
var _React$useState = React.useState(props.visible),
|
|
191
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
192
|
-
visibleState = _React$useState2[0],
|
|
193
|
-
setVisibleState = _React$useState2[1];
|
|
194
|
-
var _React$useState3 = React.useState(false),
|
|
195
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
196
|
-
reshowState = _React$useState4[0],
|
|
197
|
-
setReshowState = _React$useState4[1];
|
|
198
|
-
var confirmProps = React.useRef(null);
|
|
199
|
-
var isCallbackExecuting = React.useRef(false);
|
|
200
|
-
var focusElementOnHide = React.useRef(null);
|
|
201
|
-
var getCurrentProps = function getCurrentProps() {
|
|
202
|
-
return confirmProps.current || props;
|
|
203
|
-
};
|
|
204
|
-
var getPropValue = function getPropValue(key) {
|
|
205
|
-
return (confirmProps.current || props)[key];
|
|
206
|
-
};
|
|
207
|
-
var callbackFromProp = function callbackFromProp(key) {
|
|
208
|
-
for (var _len = arguments.length, param = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
209
|
-
param[_key - 1] = arguments[_key];
|
|
210
|
-
}
|
|
211
|
-
return ObjectUtils.getPropValue(getPropValue(key), param);
|
|
212
|
-
};
|
|
213
|
-
var acceptLabel = getPropValue('acceptLabel') || localeOption('accept');
|
|
214
|
-
var rejectLabel = getPropValue('rejectLabel') || localeOption('reject');
|
|
215
|
-
var metaData = {
|
|
216
|
-
props: props,
|
|
217
|
-
state: {
|
|
218
|
-
visible: visibleState
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
var _ConfirmDialogBase$se = ConfirmDialogBase.setMetaData(metaData),
|
|
222
|
-
ptm = _ConfirmDialogBase$se.ptm,
|
|
223
|
-
cx = _ConfirmDialogBase$se.cx;
|
|
224
|
-
var accept = function accept() {
|
|
225
|
-
if (!isCallbackExecuting.current) {
|
|
226
|
-
isCallbackExecuting.current = true;
|
|
227
|
-
callbackFromProp('accept');
|
|
228
|
-
hide('accept');
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
var reject = function reject() {
|
|
232
|
-
if (!isCallbackExecuting.current) {
|
|
233
|
-
isCallbackExecuting.current = true;
|
|
234
|
-
callbackFromProp('reject');
|
|
235
|
-
hide('reject');
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
var show = function show() {
|
|
239
|
-
setVisibleState(true);
|
|
240
|
-
isCallbackExecuting.current = false;
|
|
241
|
-
|
|
242
|
-
// Remember the focused element before we opened the dialog
|
|
243
|
-
// so we can return focus to it once we close the dialog.
|
|
244
|
-
focusElementOnHide.current = document.activeElement;
|
|
245
|
-
};
|
|
246
|
-
var hide = function hide() {
|
|
247
|
-
var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cancel';
|
|
248
|
-
setVisibleState(false);
|
|
249
|
-
callbackFromProp('onHide', {
|
|
250
|
-
result: result
|
|
251
|
-
});
|
|
252
|
-
DomHandler.focus(focusElementOnHide.current);
|
|
253
|
-
focusElementOnHide.current = null;
|
|
254
|
-
};
|
|
255
|
-
var confirm = function confirm(updatedProps) {
|
|
256
|
-
if (updatedProps.tagKey === props.tagKey) {
|
|
257
|
-
var isVisibleChanged = visibleState !== updatedProps.visible;
|
|
258
|
-
var targetChanged = getPropValue('target') !== updatedProps.target;
|
|
259
|
-
if (targetChanged && !props.target) {
|
|
260
|
-
hide();
|
|
261
|
-
confirmProps.current = updatedProps;
|
|
262
|
-
setReshowState(true);
|
|
263
|
-
} else if (isVisibleChanged) {
|
|
264
|
-
confirmProps.current = updatedProps;
|
|
265
|
-
updatedProps.visible ? show() : hide();
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
React.useEffect(function () {
|
|
270
|
-
props.visible ? show() : hide();
|
|
271
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
272
|
-
}, [props.visible]);
|
|
273
|
-
React.useEffect(function () {
|
|
274
|
-
if (!props.target && !props.message) {
|
|
275
|
-
OverlayService.on('confirm-dialog', confirm);
|
|
276
|
-
}
|
|
277
|
-
return function () {
|
|
278
|
-
OverlayService.off('confirm-dialog', confirm);
|
|
279
|
-
};
|
|
280
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
|
-
}, [props.target]);
|
|
282
|
-
useUpdateEffect(function () {
|
|
283
|
-
reshowState && show();
|
|
284
|
-
}, [reshowState]);
|
|
285
|
-
useUnmountEffect(function () {
|
|
286
|
-
OverlayService.off('confirm-dialog', confirm);
|
|
287
|
-
});
|
|
288
|
-
React.useImperativeHandle(ref, function () {
|
|
289
|
-
return {
|
|
290
|
-
props: props,
|
|
291
|
-
confirm: confirm
|
|
292
|
-
};
|
|
293
|
-
});
|
|
294
|
-
var createFooter = function createFooter() {
|
|
295
|
-
var acceptClassName = classNames('p-confirm-dialog-accept', getPropValue('acceptClassName'));
|
|
296
|
-
var rejectClassName = classNames('p-confirm-dialog-reject', {
|
|
297
|
-
'p-button-text': !getPropValue('rejectClassName')
|
|
298
|
-
}, getPropValue('rejectClassName'));
|
|
299
|
-
var rejectButtonProps = {
|
|
300
|
-
label: rejectLabel,
|
|
301
|
-
icon: getPropValue('rejectIcon'),
|
|
302
|
-
className: classNames(getPropValue('rejectClassName'), cx('rejectButton', {
|
|
303
|
-
getPropValue: getPropValue
|
|
304
|
-
})),
|
|
305
|
-
onClick: reject,
|
|
306
|
-
pt: ptm('rejectButton'),
|
|
307
|
-
unstyled: props.unstyled,
|
|
308
|
-
__parentMetadata: {
|
|
309
|
-
parent: metaData
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
var acceptButtonProps = mergeProps({
|
|
313
|
-
label: acceptLabel,
|
|
314
|
-
icon: getPropValue('acceptIcon'),
|
|
315
|
-
className: classNames(getPropValue('acceptClassName'), cx('acceptButton')),
|
|
316
|
-
onClick: accept,
|
|
317
|
-
unstyled: props.unstyled,
|
|
318
|
-
__parentMetadata: {
|
|
319
|
-
parent: metaData
|
|
320
|
-
}
|
|
321
|
-
}, ptm('acceptButton'));
|
|
322
|
-
var content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, rejectButtonProps), /*#__PURE__*/React.createElement(Button, _extends({}, acceptButtonProps, {
|
|
323
|
-
autoFocus: true
|
|
324
|
-
})));
|
|
325
|
-
if (getPropValue('footer')) {
|
|
326
|
-
var defaultContentOptions = {
|
|
327
|
-
accept: accept,
|
|
328
|
-
reject: reject,
|
|
329
|
-
acceptClassName: acceptClassName,
|
|
330
|
-
rejectClassName: rejectClassName,
|
|
331
|
-
acceptLabel: acceptLabel,
|
|
332
|
-
rejectLabel: rejectLabel,
|
|
333
|
-
element: content,
|
|
334
|
-
props: getCurrentProps()
|
|
335
|
-
};
|
|
336
|
-
return ObjectUtils.getJSXElement(getPropValue('footer'), defaultContentOptions);
|
|
337
|
-
}
|
|
338
|
-
return content;
|
|
339
|
-
};
|
|
340
|
-
var createElement = function createElement() {
|
|
341
|
-
var currentProps = getCurrentProps();
|
|
342
|
-
var message = ObjectUtils.getJSXElement(getPropValue('message'), currentProps);
|
|
343
|
-
var iconProps = mergeProps({
|
|
344
|
-
className: cx('icon')
|
|
345
|
-
}, ptm('icon'));
|
|
346
|
-
var icon = IconUtils.getJSXIcon(getPropValue('icon'), _objectSpread({}, iconProps), {
|
|
347
|
-
props: currentProps
|
|
348
|
-
});
|
|
349
|
-
var footer = createFooter();
|
|
350
|
-
var messageProps = mergeProps({
|
|
351
|
-
className: cx('message')
|
|
352
|
-
}, ptm('message'));
|
|
353
|
-
var rootProps = mergeProps({
|
|
354
|
-
visible: visibleState,
|
|
355
|
-
className: classNames(getPropValue('className'), cx('root')),
|
|
356
|
-
footer: footer,
|
|
357
|
-
onHide: hide,
|
|
358
|
-
breakpoints: getPropValue('breakpoints'),
|
|
359
|
-
pt: currentProps.pt,
|
|
360
|
-
unstyled: props.unstyled,
|
|
361
|
-
appendTo: getPropValue('appendTo'),
|
|
362
|
-
__parentMetadata: {
|
|
363
|
-
parent: metaData
|
|
364
|
-
}
|
|
365
|
-
}, ConfirmDialogBase.getOtherProps(currentProps));
|
|
366
|
-
return /*#__PURE__*/React.createElement(Dialog, rootProps, icon, /*#__PURE__*/React.createElement("span", messageProps, message));
|
|
367
|
-
};
|
|
368
|
-
var element = createElement();
|
|
369
|
-
return /*#__PURE__*/React.createElement(Portal, {
|
|
370
|
-
element: element,
|
|
371
|
-
appendTo: getPropValue('appendTo')
|
|
372
|
-
});
|
|
373
|
-
}));
|
|
374
|
-
ConfirmDialog.displayName = 'ConfirmDialog';
|
|
375
|
-
|
|
376
|
-
export { ConfirmDialog, confirmDialog };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as t,localeOption as r}from"primereact/api";import{Button as n}from"primereact/button";import{Dialog as o}from"primereact/dialog";import{useUpdateEffect as a,useUnmountEffect as c}from"primereact/hooks";import{OverlayService as i}from"primereact/overlayservice";import{Portal as l}from"primereact/portal";import{classNames as u,DomHandler as s,ObjectUtils as p,mergeProps as f,IconUtils as m}from"primereact/utils";import{ComponentBase as b}from"primereact/componentbase";function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function d(e){if(Array.isArray(e))return e}function v(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,c,i=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw o}}return i}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t){if(e){if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}function O(){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 h(e,t){return d(e)||v(e,t)||j(e,t)||O()}function S(e){return S="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},S(e)}function N(e,t){if("object"!==S(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=N(e,"string");return"symbol"===S(t)?t:String(t)}var w=b.extend({defaultProps:{__TYPE:"ConfirmDialog",tagKey:void 0,visible:void 0,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,appendTo:null,footer:null,breakpoints:null,onHide:null,accept:null,reject:null,children:void 0},css:{classes:{root:"p-confirm-dialog",message:"p-confirm-dialog-message",icon:"p-confirm-dialog-icon",acceptButton:"p-confirm-dialog-accept",rejectButton:function(e){return u("p-confirm-dialog-reject",{"p-button-text":!(0,e.getPropValue)("rejectClassName")})}}}});function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){var n,o,a;n=e,a=r[t],(o=P(o=t))in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=E(E({},e),{visible:void 0===e.visible||e.visible})).visible&&i.emit("confirm-dialog",e);return{show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.emit("confirm-dialog",E(E(E({},e),t),{visible:!0}))},hide:function(){i.emit("confirm-dialog",{visible:!1})}}},T=e.memo(e.forwardRef((function(b,d){var v=e.useContext(t),y=w.getProps(b,v),j=h(e.useState(y.visible),2),O=j[0],S=j[1],N=h(e.useState(!1),2),P=N[0],C=N[1],I=e.useRef(null),T=e.useRef(!1),_=e.useRef(null),k=function(){return I.current||y},x=function(e){return(I.current||y)[e]},A=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return p.getPropValue(x(e),r)},D=x("acceptLabel")||r("accept"),B=x("rejectLabel")||r("reject"),L={props:y,state:{visible:O}},M=w.setMetaData(L),H=M.ptm,R=M.cx,J=function(){T.current||(T.current=!0,A("accept"),X("accept"))},K=function(){T.current||(T.current=!0,A("reject"),X("reject"))},V=function(){S(!0),T.current=!1,_.current=document.activeElement},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cancel";S(!1),A("onHide",{result:e}),s.focus(_.current),_.current=null},F=function(e){if(e.tagKey===y.tagKey){var t=O!==e.visible;x("target")!==e.target&&!y.target?(X(),I.current=e,C(!0)):t&&(I.current=e,e.visible?V():X())}};e.useEffect((function(){y.visible?V():X()}),[y.visible]),e.useEffect((function(){return y.target||y.message||i.on("confirm-dialog",F),function(){i.off("confirm-dialog",F)}}),[y.target]),a((function(){P&&V()}),[P]),c((function(){i.off("confirm-dialog",F)})),e.useImperativeHandle(d,(function(){return{props:y,confirm:F}}));var U,Y,$,q,z,G,Q,W=function(){var t=u("p-confirm-dialog-accept",x("acceptClassName")),r=u("p-confirm-dialog-reject",{"p-button-text":!x("rejectClassName")},x("rejectClassName")),o={label:B,icon:x("rejectIcon"),className:u(x("rejectClassName"),R("rejectButton",{getPropValue:x})),onClick:K,pt:H("rejectButton"),unstyled:y.unstyled,__parentMetadata:{parent:L}},a=f({label:D,icon:x("acceptIcon"),className:u(x("acceptClassName"),R("acceptButton")),onClick:J,unstyled:y.unstyled,__parentMetadata:{parent:L}},H("acceptButton")),c=e.createElement(e.Fragment,null,e.createElement(n,o),e.createElement(n,g({},a,{autoFocus:!0})));if(x("footer")){var i={accept:J,reject:K,acceptClassName:t,rejectClassName:r,acceptLabel:D,rejectLabel:B,element:c,props:k()};return p.getJSXElement(x("footer"),i)}return c},Z=(U=k(),Y=p.getJSXElement(x("message"),U),$=f({className:R("icon")},H("icon")),q=m.getJSXIcon(x("icon"),E({},$),{props:U}),z=W(),G=f({className:R("message")},H("message")),Q=f({visible:O,className:u(x("className"),R("root")),footer:z,onHide:X,breakpoints:x("breakpoints"),pt:U.pt,unstyled:y.unstyled,appendTo:x("appendTo"),__parentMetadata:{parent:L}},w.getOtherProps(U)),e.createElement(o,Q,q,e.createElement("span",G,Y)));return e.createElement(l,{element:Z,appendTo:x("appendTo")})})));T.displayName="ConfirmDialog";export{T as ConfirmDialog,I as confirmDialog};
|