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/button/button.esm.js
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PrimeReactContext } from 'primereact/api';
|
|
5
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
|
-
import { classNames, ObjectUtils, mergeProps, IconUtils } from 'primereact/utils';
|
|
7
|
-
import { SpinnerIcon } from 'primereact/icons/spinner';
|
|
8
|
-
import { Ripple } from 'primereact/ripple';
|
|
9
|
-
import { Tooltip } from 'primereact/tooltip';
|
|
10
|
-
|
|
11
|
-
function _extends() {
|
|
12
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
13
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
14
|
-
var source = arguments[i];
|
|
15
|
-
for (var key in source) {
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17
|
-
target[key] = source[key];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return target;
|
|
22
|
-
};
|
|
23
|
-
return _extends.apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function _typeof(o) {
|
|
27
|
-
"@babel/helpers - typeof";
|
|
28
|
-
|
|
29
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
30
|
-
return typeof o;
|
|
31
|
-
} : function (o) {
|
|
32
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
33
|
-
}, _typeof(o);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _toPrimitive(input, hint) {
|
|
37
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
38
|
-
var prim = input[Symbol.toPrimitive];
|
|
39
|
-
if (prim !== undefined) {
|
|
40
|
-
var res = prim.call(input, hint || "default");
|
|
41
|
-
if (_typeof(res) !== "object") return res;
|
|
42
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
43
|
-
}
|
|
44
|
-
return (hint === "string" ? String : Number)(input);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function _toPropertyKey(arg) {
|
|
48
|
-
var key = _toPrimitive(arg, "string");
|
|
49
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _defineProperty(obj, key, value) {
|
|
53
|
-
key = _toPropertyKey(key);
|
|
54
|
-
if (key in obj) {
|
|
55
|
-
Object.defineProperty(obj, key, {
|
|
56
|
-
value: value,
|
|
57
|
-
enumerable: true,
|
|
58
|
-
configurable: true,
|
|
59
|
-
writable: true
|
|
60
|
-
});
|
|
61
|
-
} else {
|
|
62
|
-
obj[key] = value;
|
|
63
|
-
}
|
|
64
|
-
return obj;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
var classes$1 = {
|
|
68
|
-
root: function root(_ref) {
|
|
69
|
-
var props = _ref.props;
|
|
70
|
-
return classNames('p-badge p-component', _defineProperty({
|
|
71
|
-
'p-badge-no-gutter': ObjectUtils.isNotEmpty(props.value) && String(props.value).length === 1,
|
|
72
|
-
'p-badge-dot': ObjectUtils.isEmpty(props.value),
|
|
73
|
-
'p-badge-lg': props.size === 'large',
|
|
74
|
-
'p-badge-xl': props.size === 'xlarge'
|
|
75
|
-
}, "p-badge-".concat(props.severity), props.severity !== null));
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var styles = "\n@layer primereact {\n .p-badge {\n display: inline-block;\n border-radius: 10px;\n text-align: center;\n padding: 0 .5rem;\n }\n \n .p-overlay-badge {\n position: relative;\n }\n \n .p-overlay-badge .p-badge {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%,-50%);\n transform-origin: 100% 0;\n margin: 0;\n }\n \n .p-badge-dot {\n width: .5rem;\n min-width: .5rem;\n height: .5rem;\n border-radius: 50%;\n padding: 0;\n }\n \n .p-badge-no-gutter {\n padding: 0;\n border-radius: 50%;\n }\n}\n";
|
|
79
|
-
var BadgeBase = ComponentBase.extend({
|
|
80
|
-
defaultProps: {
|
|
81
|
-
__TYPE: 'Badge',
|
|
82
|
-
__parentMetadata: null,
|
|
83
|
-
value: null,
|
|
84
|
-
severity: null,
|
|
85
|
-
size: null,
|
|
86
|
-
style: null,
|
|
87
|
-
className: null,
|
|
88
|
-
children: undefined
|
|
89
|
-
},
|
|
90
|
-
css: {
|
|
91
|
-
classes: classes$1,
|
|
92
|
-
styles: styles
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
97
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
98
|
-
var Badge = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
99
|
-
var context = React.useContext(PrimeReactContext);
|
|
100
|
-
var props = BadgeBase.getProps(inProps, context);
|
|
101
|
-
var _BadgeBase$setMetaDat = BadgeBase.setMetaData(_objectSpread$1({
|
|
102
|
-
props: props
|
|
103
|
-
}, props.__parentMetadata)),
|
|
104
|
-
ptm = _BadgeBase$setMetaDat.ptm,
|
|
105
|
-
cx = _BadgeBase$setMetaDat.cx,
|
|
106
|
-
isUnstyled = _BadgeBase$setMetaDat.isUnstyled;
|
|
107
|
-
useHandleStyle(BadgeBase.css.styles, isUnstyled, {
|
|
108
|
-
name: 'badge'
|
|
109
|
-
});
|
|
110
|
-
var elementRef = React.useRef(null);
|
|
111
|
-
React.useImperativeHandle(ref, function () {
|
|
112
|
-
return {
|
|
113
|
-
props: props,
|
|
114
|
-
getElement: function getElement() {
|
|
115
|
-
return elementRef.current;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
var rootProps = mergeProps({
|
|
120
|
-
ref: elementRef,
|
|
121
|
-
style: props.style,
|
|
122
|
-
className: classNames(props.className, cx('root'))
|
|
123
|
-
}, BadgeBase.getOtherProps(props), ptm('root'));
|
|
124
|
-
return /*#__PURE__*/React.createElement("span", rootProps, props.value);
|
|
125
|
-
}));
|
|
126
|
-
Badge.displayName = 'Badge';
|
|
127
|
-
|
|
128
|
-
var classes = {
|
|
129
|
-
icon: function icon(_ref) {
|
|
130
|
-
var props = _ref.props;
|
|
131
|
-
return classNames('p-button-icon p-c', _defineProperty({}, "p-button-icon-".concat(props.iconPos), props.label));
|
|
132
|
-
},
|
|
133
|
-
loadingIcon: function loadingIcon(_ref2) {
|
|
134
|
-
var props = _ref2.props,
|
|
135
|
-
className = _ref2.className;
|
|
136
|
-
return classNames(className, {
|
|
137
|
-
'p-button-loading-icon': props.loading
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
label: 'p-button-label p-c',
|
|
141
|
-
root: function root(_ref3) {
|
|
142
|
-
var _classNames2;
|
|
143
|
-
var props = _ref3.props,
|
|
144
|
-
size = _ref3.size,
|
|
145
|
-
disabled = _ref3.disabled;
|
|
146
|
-
return classNames('p-button p-component', (_classNames2 = {
|
|
147
|
-
'p-button-icon-only': (props.icon || props.loading) && !props.label && !props.children,
|
|
148
|
-
'p-button-vertical': (props.iconPos === 'top' || props.iconPos === 'bottom') && props.label,
|
|
149
|
-
'p-disabled': disabled,
|
|
150
|
-
'p-button-loading': props.loading,
|
|
151
|
-
'p-button-outlined': props.outlined,
|
|
152
|
-
'p-button-raised': props.raised,
|
|
153
|
-
'p-button-link': props.link,
|
|
154
|
-
'p-button-text': props.text,
|
|
155
|
-
'p-button-rounded': props.rounded,
|
|
156
|
-
'p-button-loading-label-only': props.loading && !props.icon && props.label
|
|
157
|
-
}, _defineProperty(_classNames2, "p-button-loading-".concat(props.iconPos), props.loading && props.label), _defineProperty(_classNames2, "p-button-".concat(size), size), _defineProperty(_classNames2, "p-button-".concat(props.severity), props.severity), _classNames2));
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
var ButtonBase = ComponentBase.extend({
|
|
161
|
-
defaultProps: {
|
|
162
|
-
__TYPE: 'Button',
|
|
163
|
-
__parentMetadata: null,
|
|
164
|
-
badge: null,
|
|
165
|
-
badgeClassName: null,
|
|
166
|
-
className: null,
|
|
167
|
-
children: undefined,
|
|
168
|
-
disabled: false,
|
|
169
|
-
icon: null,
|
|
170
|
-
iconPos: 'left',
|
|
171
|
-
label: null,
|
|
172
|
-
link: false,
|
|
173
|
-
loading: false,
|
|
174
|
-
loadingIcon: null,
|
|
175
|
-
outlined: false,
|
|
176
|
-
raised: false,
|
|
177
|
-
rounded: false,
|
|
178
|
-
severity: null,
|
|
179
|
-
size: null,
|
|
180
|
-
text: false,
|
|
181
|
-
tooltip: null,
|
|
182
|
-
tooltipOptions: null,
|
|
183
|
-
visible: true
|
|
184
|
-
},
|
|
185
|
-
css: {
|
|
186
|
-
classes: classes
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
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; }
|
|
191
|
-
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; }
|
|
192
|
-
var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
193
|
-
var context = React.useContext(PrimeReactContext);
|
|
194
|
-
var props = ButtonBase.getProps(inProps, context);
|
|
195
|
-
var disabled = props.disabled || props.loading;
|
|
196
|
-
var metaData = _objectSpread(_objectSpread({
|
|
197
|
-
props: props
|
|
198
|
-
}, props.__parentMetadata), {}, {
|
|
199
|
-
context: {
|
|
200
|
-
disabled: disabled
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
var _ButtonBase$setMetaDa = ButtonBase.setMetaData(metaData),
|
|
204
|
-
ptm = _ButtonBase$setMetaDa.ptm,
|
|
205
|
-
cx = _ButtonBase$setMetaDa.cx,
|
|
206
|
-
isUnstyled = _ButtonBase$setMetaDa.isUnstyled;
|
|
207
|
-
useHandleStyle(ButtonBase.css.styles, isUnstyled, {
|
|
208
|
-
name: 'button',
|
|
209
|
-
styled: true
|
|
210
|
-
});
|
|
211
|
-
var elementRef = React.useRef(ref);
|
|
212
|
-
React.useEffect(function () {
|
|
213
|
-
ObjectUtils.combinedRefs(elementRef, ref);
|
|
214
|
-
}, [elementRef, ref]);
|
|
215
|
-
if (props.visible === false) {
|
|
216
|
-
return null;
|
|
217
|
-
}
|
|
218
|
-
var createIcon = function createIcon() {
|
|
219
|
-
var className = classNames('p-button-icon p-c', _defineProperty({}, "p-button-icon-".concat(props.iconPos), props.label));
|
|
220
|
-
var iconsProps = mergeProps({
|
|
221
|
-
className: cx('icon')
|
|
222
|
-
}, ptm('icon'));
|
|
223
|
-
className = classNames(className, {
|
|
224
|
-
'p-button-loading-icon': props.loading
|
|
225
|
-
});
|
|
226
|
-
var loadingIconProps = mergeProps({
|
|
227
|
-
className: cx('loadingIcon', {
|
|
228
|
-
className: className
|
|
229
|
-
})
|
|
230
|
-
}, ptm('loadingIcon'));
|
|
231
|
-
var icon = props.loading ? props.loadingIcon || /*#__PURE__*/React.createElement(SpinnerIcon, _extends({}, loadingIconProps, {
|
|
232
|
-
spin: true
|
|
233
|
-
})) : props.icon;
|
|
234
|
-
return IconUtils.getJSXIcon(icon, _objectSpread({}, iconsProps), {
|
|
235
|
-
props: props
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
var createLabel = function createLabel() {
|
|
239
|
-
if (props.label) {
|
|
240
|
-
var labelProps = mergeProps({
|
|
241
|
-
className: cx('label')
|
|
242
|
-
}, ptm('label'));
|
|
243
|
-
return /*#__PURE__*/React.createElement("span", labelProps, props.label);
|
|
244
|
-
}
|
|
245
|
-
return !props.children && !props.label && /*#__PURE__*/React.createElement("span", {
|
|
246
|
-
className: cx('label'),
|
|
247
|
-
dangerouslySetInnerHTML: {
|
|
248
|
-
__html: ' '
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
var createBadge = function createBadge() {
|
|
253
|
-
if (props.badge) {
|
|
254
|
-
var badgeProps = mergeProps({
|
|
255
|
-
className: classNames(props.badgeClassName),
|
|
256
|
-
value: props.badge,
|
|
257
|
-
unstyled: props.unstyled,
|
|
258
|
-
__parentMetadata: {
|
|
259
|
-
parent: metaData
|
|
260
|
-
}
|
|
261
|
-
}, ptm('badge'));
|
|
262
|
-
return /*#__PURE__*/React.createElement(Badge, badgeProps, props.badge);
|
|
263
|
-
}
|
|
264
|
-
return null;
|
|
265
|
-
};
|
|
266
|
-
var showTooltip = !disabled || props.tooltipOptions && props.tooltipOptions.showOnDisabled;
|
|
267
|
-
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip) && showTooltip;
|
|
268
|
-
var sizeMapping = {
|
|
269
|
-
large: 'lg',
|
|
270
|
-
small: 'sm'
|
|
271
|
-
};
|
|
272
|
-
var size = sizeMapping[props.size];
|
|
273
|
-
var icon = createIcon();
|
|
274
|
-
var label = createLabel();
|
|
275
|
-
var badge = createBadge();
|
|
276
|
-
var defaultAriaLabel = props.label ? props.label + (props.badge ? ' ' + props.badge : '') : props['aria-label'];
|
|
277
|
-
var rootProps = mergeProps({
|
|
278
|
-
ref: elementRef,
|
|
279
|
-
'aria-label': defaultAriaLabel,
|
|
280
|
-
className: classNames(props.className, cx('root', {
|
|
281
|
-
size: size,
|
|
282
|
-
disabled: disabled
|
|
283
|
-
})),
|
|
284
|
-
disabled: disabled
|
|
285
|
-
}, ButtonBase.getOtherProps(props), ptm('root'));
|
|
286
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", rootProps, icon, label, props.children, badge, /*#__PURE__*/React.createElement(Ripple, null)), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
287
|
-
target: elementRef,
|
|
288
|
-
content: props.tooltip
|
|
289
|
-
}, props.tooltipOptions, {
|
|
290
|
-
pt: ptm('tooltip')
|
|
291
|
-
})));
|
|
292
|
-
}));
|
|
293
|
-
Button.displayName = 'Button';
|
|
294
|
-
|
|
295
|
-
export { Button };
|
package/button/button.esm.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as r}from"primereact/componentbase";import{classNames as o,ObjectUtils as a,mergeProps as l,IconUtils as i}from"primereact/utils";import{SpinnerIcon as s}from"primereact/icons/spinner";import{Ripple as c}from"primereact/ripple";import{Tooltip as p}from"primereact/tooltip";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function d(e,t){if("object"!==b(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=d(e,"string");return"symbol"===b(t)?t:String(t)}function g(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=n.extend({defaultProps:{__TYPE:"Badge",__parentMetadata:null,value:null,severity:null,size:null,style:null,className:null,children:void 0},css:{classes:{root:function(e){var t=e.props;return o("p-badge p-component",g({"p-badge-no-gutter":a.isNotEmpty(t.value)&&1===String(t.value).length,"p-badge-dot":a.isEmpty(t.value),"p-badge-lg":"large"===t.size,"p-badge-xl":"xlarge"===t.size},"p-badge-".concat(t.severity),null!==t.severity))}},styles:"\n@layer primereact {\n .p-badge {\n display: inline-block;\n border-radius: 10px;\n text-align: center;\n padding: 0 .5rem;\n }\n \n .p-overlay-badge {\n position: relative;\n }\n \n .p-overlay-badge .p-badge {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%,-50%);\n transform-origin: 100% 0;\n margin: 0;\n }\n \n .p-badge-dot {\n width: .5rem;\n min-width: .5rem;\n height: .5rem;\n border-radius: 50%;\n padding: 0;\n }\n \n .p-badge-no-gutter {\n padding: 0;\n border-radius: 50%;\n }\n}\n"}});function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=e.memo(e.forwardRef((function(n,a){var i=e.useContext(t),s=f.getProps(n,i),c=f.setMetaData(v({props:s},s.__parentMetadata)),p=c.ptm,u=c.cx;r(f.css.styles,c.isUnstyled,{name:"badge"});var b=e.useRef(null);e.useImperativeHandle(a,(function(){return{props:s,getElement:function(){return b.current}}}));var d=l({ref:b,style:s.style,className:o(s.className,u("root"))},f.getOtherProps(s),p("root"));return e.createElement("span",d,s.value)})));O.displayName="Badge";var P=n.extend({defaultProps:{__TYPE:"Button",__parentMetadata:null,badge:null,badgeClassName:null,className:null,children:void 0,disabled:!1,icon:null,iconPos:"left",label:null,link:!1,loading:!1,loadingIcon:null,outlined:!1,raised:!1,rounded:!1,severity:null,size:null,text:!1,tooltip:null,tooltipOptions:null,visible:!0},css:{classes:{icon:function(e){var t=e.props;return o("p-button-icon p-c",g({},"p-button-icon-".concat(t.iconPos),t.label))},loadingIcon:function(e){return o(e.className,{"p-button-loading-icon":e.props.loading})},label:"p-button-label p-c",root:function(e){var t,n=e.props,r=e.size;return o("p-button p-component",(g(t={"p-button-icon-only":(n.icon||n.loading)&&!n.label&&!n.children,"p-button-vertical":("top"===n.iconPos||"bottom"===n.iconPos)&&n.label,"p-disabled":e.disabled,"p-button-loading":n.loading,"p-button-outlined":n.outlined,"p-button-raised":n.raised,"p-button-link":n.link,"p-button-text":n.text,"p-button-rounded":n.rounded,"p-button-loading-label-only":n.loading&&!n.icon&&n.label},"p-button-loading-".concat(n.iconPos),n.loading&&n.label),g(t,"p-button-".concat(r),r),g(t,"p-button-".concat(n.severity),n.severity),t))}}}});function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=e.memo(e.forwardRef((function(n,b){var d=e.useContext(t),m=P.getProps(n,d),f=m.disabled||m.loading,y=h(h({props:m},m.__parentMetadata),{},{context:{disabled:f}}),v=P.setMetaData(y),j=v.ptm,w=v.cx;r(P.css.styles,v.isUnstyled,{name:"button",styled:!0});var E=e.useRef(b);if(e.useEffect((function(){a.combinedRefs(E,b)}),[E,b]),!1===m.visible)return null;var N=!f||m.tooltipOptions&&m.tooltipOptions.showOnDisabled,_=a.isNotEmpty(m.tooltip)&&N,x={large:"lg",small:"sm"}[m.size],S=function(){var t=o("p-button-icon p-c",g({},"p-button-icon-".concat(m.iconPos),m.label)),n=l({className:w("icon")},j("icon"));t=o(t,{"p-button-loading-icon":m.loading});var r=l({className:w("loadingIcon",{className:t})},j("loadingIcon")),a=m.loading?m.loadingIcon||e.createElement(s,u({},r,{spin:!0})):m.icon;return i.getJSXIcon(a,h({},n),{props:m})}(),D=function(){if(m.label){var t=l({className:w("label")},j("label"));return e.createElement("span",t,m.label)}return!m.children&&!m.label&&e.createElement("span",{className:w("label"),dangerouslySetInnerHTML:{__html:" "}})}(),I=function(){if(m.badge){var t=l({className:o(m.badgeClassName),value:m.badge,unstyled:m.unstyled,__parentMetadata:{parent:y}},j("badge"));return e.createElement(O,t,m.badge)}return null}(),M=l({ref:E,"aria-label":m.label?m.label+(m.badge?" "+m.badge:""):m["aria-label"],className:o(m.className,w("root",{size:x,disabled:f})),disabled:f},P.getOtherProps(m),j("root"));return e.createElement(e.Fragment,null,e.createElement("button",M,S,D,m.children,I,e.createElement(c,null)),_&&e.createElement(p,u({target:E,content:m.tooltip},m.tooltipOptions,{pt:j("tooltip")})))})));w.displayName="Button";export{w as Button};
|