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/rating/rating.esm.js
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PrimeReactContext } from 'primereact/api';
|
|
5
|
-
import { BanIcon } from 'primereact/icons/ban';
|
|
6
|
-
import { StarIcon } from 'primereact/icons/star';
|
|
7
|
-
import { StarFillIcon } from 'primereact/icons/starfill';
|
|
8
|
-
import { Tooltip } from 'primereact/tooltip';
|
|
9
|
-
import { classNames, ObjectUtils, mergeProps, IconUtils } from 'primereact/utils';
|
|
10
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
11
|
-
|
|
12
|
-
function _extends() {
|
|
13
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
14
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
15
|
-
var source = arguments[i];
|
|
16
|
-
for (var key in source) {
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
18
|
-
target[key] = source[key];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return target;
|
|
23
|
-
};
|
|
24
|
-
return _extends.apply(this, arguments);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function _typeof(o) {
|
|
28
|
-
"@babel/helpers - typeof";
|
|
29
|
-
|
|
30
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
31
|
-
return typeof o;
|
|
32
|
-
} : function (o) {
|
|
33
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
34
|
-
}, _typeof(o);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function _toPrimitive(input, hint) {
|
|
38
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
39
|
-
var prim = input[Symbol.toPrimitive];
|
|
40
|
-
if (prim !== undefined) {
|
|
41
|
-
var res = prim.call(input, hint || "default");
|
|
42
|
-
if (_typeof(res) !== "object") return res;
|
|
43
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
44
|
-
}
|
|
45
|
-
return (hint === "string" ? String : Number)(input);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _toPropertyKey(arg) {
|
|
49
|
-
var key = _toPrimitive(arg, "string");
|
|
50
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _defineProperty(obj, key, value) {
|
|
54
|
-
key = _toPropertyKey(key);
|
|
55
|
-
if (key in obj) {
|
|
56
|
-
Object.defineProperty(obj, key, {
|
|
57
|
-
value: value,
|
|
58
|
-
enumerable: true,
|
|
59
|
-
configurable: true,
|
|
60
|
-
writable: true
|
|
61
|
-
});
|
|
62
|
-
} else {
|
|
63
|
-
obj[key] = value;
|
|
64
|
-
}
|
|
65
|
-
return obj;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
var classes = {
|
|
69
|
-
onIcon: 'p-rating-icon',
|
|
70
|
-
item: function item(_ref) {
|
|
71
|
-
var active = _ref.active;
|
|
72
|
-
return classNames('p-rating-item', {
|
|
73
|
-
'p-rating-item-active': active
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
cancelIcon: 'p-rating-icon p-rating-cancel',
|
|
77
|
-
cancelItem: 'p-rating-item p-rating-cancel-item',
|
|
78
|
-
root: function root(_ref2) {
|
|
79
|
-
var props = _ref2.props;
|
|
80
|
-
return classNames('p-rating', {
|
|
81
|
-
'p-disabled': props.disabled,
|
|
82
|
-
'p-readonly': props.readOnly
|
|
83
|
-
}, props.className);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var styles = "\n@layer primereact {\n .p-rating {\n display: flex;\n align-items: center;\n }\n \n .p-rating-item {\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n }\n \n .p-rating.p-readonly .p-rating-item {\n cursor: default;\n }\n}\n";
|
|
87
|
-
var RatingBase = ComponentBase.extend({
|
|
88
|
-
defaultProps: {
|
|
89
|
-
__TYPE: 'Rating',
|
|
90
|
-
id: null,
|
|
91
|
-
value: null,
|
|
92
|
-
disabled: false,
|
|
93
|
-
readOnly: false,
|
|
94
|
-
stars: 5,
|
|
95
|
-
cancel: true,
|
|
96
|
-
style: null,
|
|
97
|
-
className: null,
|
|
98
|
-
tooltip: null,
|
|
99
|
-
tooltipOptions: null,
|
|
100
|
-
onChange: null,
|
|
101
|
-
onIcon: null,
|
|
102
|
-
offIcon: null,
|
|
103
|
-
cancelIcon: null,
|
|
104
|
-
cancelIconProps: null,
|
|
105
|
-
onIconProps: null,
|
|
106
|
-
offIconProps: null,
|
|
107
|
-
children: undefined
|
|
108
|
-
},
|
|
109
|
-
css: {
|
|
110
|
-
classes: classes,
|
|
111
|
-
styles: styles
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
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; }
|
|
116
|
-
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; }
|
|
117
|
-
var Rating = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
118
|
-
var context = React.useContext(PrimeReactContext);
|
|
119
|
-
var props = RatingBase.getProps(inProps, context);
|
|
120
|
-
var elementRef = React.useRef(null);
|
|
121
|
-
var _RatingBase$setMetaDa = RatingBase.setMetaData({
|
|
122
|
-
props: props
|
|
123
|
-
}),
|
|
124
|
-
ptm = _RatingBase$setMetaDa.ptm,
|
|
125
|
-
cx = _RatingBase$setMetaDa.cx,
|
|
126
|
-
isUnstyled = _RatingBase$setMetaDa.isUnstyled;
|
|
127
|
-
useHandleStyle(RatingBase.css.styles, isUnstyled, {
|
|
128
|
-
name: 'rating'
|
|
129
|
-
});
|
|
130
|
-
var getPTOptions = function getPTOptions(value, key) {
|
|
131
|
-
return ptm(key, {
|
|
132
|
-
context: {
|
|
133
|
-
active: value <= props.value
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
var enabled = !props.disabled && !props.readOnly;
|
|
138
|
-
var tabIndex = enabled ? 0 : null;
|
|
139
|
-
var rate = function rate(event, i) {
|
|
140
|
-
if (enabled && props.onChange) {
|
|
141
|
-
props.onChange({
|
|
142
|
-
originalEvent: event,
|
|
143
|
-
value: i,
|
|
144
|
-
stopPropagation: function stopPropagation() {
|
|
145
|
-
event.stopPropagation();
|
|
146
|
-
},
|
|
147
|
-
preventDefault: function preventDefault() {
|
|
148
|
-
event.preventDefault();
|
|
149
|
-
},
|
|
150
|
-
target: {
|
|
151
|
-
name: props.name,
|
|
152
|
-
id: props.id,
|
|
153
|
-
value: i
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
event.preventDefault();
|
|
158
|
-
};
|
|
159
|
-
var clear = function clear(event) {
|
|
160
|
-
if (enabled && props.onChange) {
|
|
161
|
-
props.onChange({
|
|
162
|
-
originalEvent: event,
|
|
163
|
-
value: null,
|
|
164
|
-
stopPropagation: function stopPropagation() {
|
|
165
|
-
event.stopPropagation();
|
|
166
|
-
},
|
|
167
|
-
preventDefault: function preventDefault() {
|
|
168
|
-
event.preventDefault();
|
|
169
|
-
},
|
|
170
|
-
target: {
|
|
171
|
-
name: props.name,
|
|
172
|
-
id: props.id,
|
|
173
|
-
value: null
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
event.preventDefault();
|
|
178
|
-
};
|
|
179
|
-
var onStarKeyDown = function onStarKeyDown(event, value) {
|
|
180
|
-
if (event.key === 'Enter') {
|
|
181
|
-
rate(event, value);
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
var onCancelKeyDown = function onCancelKeyDown(event) {
|
|
185
|
-
if (event.key === 'Enter') {
|
|
186
|
-
clear(event);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
var createIcons = function createIcons() {
|
|
190
|
-
return Array.from({
|
|
191
|
-
length: props.stars
|
|
192
|
-
}, function (_, i) {
|
|
193
|
-
return i + 1;
|
|
194
|
-
}).map(function (value) {
|
|
195
|
-
var active = value <= props.value;
|
|
196
|
-
var onIconProps = mergeProps({
|
|
197
|
-
className: cx('onIcon')
|
|
198
|
-
}, getPTOptions(props.value, 'onIcon'));
|
|
199
|
-
var offIconProps = mergeProps({
|
|
200
|
-
className: cx('onIcon')
|
|
201
|
-
}, getPTOptions(props.value, 'offIcon'));
|
|
202
|
-
var icon = active ? {
|
|
203
|
-
type: props.onIcon || /*#__PURE__*/React.createElement(StarFillIcon, onIconProps)
|
|
204
|
-
} : {
|
|
205
|
-
type: props.offIcon || /*#__PURE__*/React.createElement(StarIcon, offIconProps)
|
|
206
|
-
};
|
|
207
|
-
var content = IconUtils.getJSXIcon(icon.type, active ? _objectSpread({}, onIconProps) : _objectSpread({}, offIconProps), {
|
|
208
|
-
props: props
|
|
209
|
-
});
|
|
210
|
-
var itemProps = mergeProps({
|
|
211
|
-
key: value,
|
|
212
|
-
className: cx('item', {
|
|
213
|
-
active: active
|
|
214
|
-
}),
|
|
215
|
-
tabIndex: tabIndex,
|
|
216
|
-
onClick: function onClick(e) {
|
|
217
|
-
return rate(e, value);
|
|
218
|
-
},
|
|
219
|
-
onKeyDown: function onKeyDown(e) {
|
|
220
|
-
return onStarKeyDown(e, value);
|
|
221
|
-
}
|
|
222
|
-
}, getPTOptions(props.value, 'item'));
|
|
223
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
224
|
-
key: value
|
|
225
|
-
}, itemProps), content);
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
var createCancelIcon = function createCancelIcon() {
|
|
229
|
-
if (props.cancel) {
|
|
230
|
-
var cancelIconProps = mergeProps({
|
|
231
|
-
className: cx('cancelIcon')
|
|
232
|
-
}, ptm('cancelIcon'));
|
|
233
|
-
var icon = props.cancelIcon || /*#__PURE__*/React.createElement(BanIcon, cancelIconProps);
|
|
234
|
-
var content = IconUtils.getJSXIcon(icon, _objectSpread(_objectSpread({}, cancelIconProps), props.cancelIconProps), {
|
|
235
|
-
props: props
|
|
236
|
-
});
|
|
237
|
-
var cancelItemProps = mergeProps({
|
|
238
|
-
className: cx('cancelItem'),
|
|
239
|
-
onClick: clear,
|
|
240
|
-
tabIndex: tabIndex,
|
|
241
|
-
onKeyDown: onCancelKeyDown
|
|
242
|
-
}, ptm('cancelItem'));
|
|
243
|
-
return /*#__PURE__*/React.createElement("div", cancelItemProps, content);
|
|
244
|
-
}
|
|
245
|
-
return null;
|
|
246
|
-
};
|
|
247
|
-
React.useImperativeHandle(ref, function () {
|
|
248
|
-
return {
|
|
249
|
-
props: props,
|
|
250
|
-
getElement: function getElement() {
|
|
251
|
-
return elementRef.current;
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
});
|
|
255
|
-
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
256
|
-
var rootProps = mergeProps({
|
|
257
|
-
ref: elementRef,
|
|
258
|
-
id: props.id,
|
|
259
|
-
className: cx('root'),
|
|
260
|
-
style: props.style
|
|
261
|
-
}, RatingBase.getOtherProps(props), ptm('root'));
|
|
262
|
-
var cancelIcon = createCancelIcon();
|
|
263
|
-
var icons = createIcons();
|
|
264
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", rootProps, cancelIcon, icons), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
265
|
-
target: elementRef,
|
|
266
|
-
content: props.tooltip
|
|
267
|
-
}, props.tooltipOptions, {
|
|
268
|
-
pt: ptm('tooltip')
|
|
269
|
-
})));
|
|
270
|
-
}));
|
|
271
|
-
Rating.displayName = 'Rating';
|
|
272
|
-
|
|
273
|
-
export { Rating };
|
package/rating/rating.esm.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as n}from"primereact/api";import{BanIcon as t}from"primereact/icons/ban";import{StarIcon as r}from"primereact/icons/star";import{StarFillIcon as o}from"primereact/icons/starfill";import{Tooltip as a}from"primereact/tooltip";import{classNames as i,ObjectUtils as l,mergeProps as c,IconUtils as p}from"primereact/utils";import{ComponentBase as u,useHandleStyle as s}from"primereact/componentbase";function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},m.apply(this,arguments)}function f(e){return f="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},f(e)}function y(e,n){if("object"!==f(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function g(e){var n=y(e,"string");return"symbol"===f(n)?n:String(n)}var v=u.extend({defaultProps:{__TYPE:"Rating",id:null,value:null,disabled:!1,readOnly:!1,stars:5,cancel:!0,style:null,className:null,tooltip:null,tooltipOptions:null,onChange:null,onIcon:null,offIcon:null,cancelIcon:null,cancelIconProps:null,onIconProps:null,offIconProps:null,children:void 0},css:{classes:{onIcon:"p-rating-icon",item:function(e){return i("p-rating-item",{"p-rating-item-active":e.active})},cancelIcon:"p-rating-icon p-rating-cancel",cancelItem:"p-rating-item p-rating-cancel-item",root:function(e){var n=e.props;return i("p-rating",{"p-disabled":n.disabled,"p-readonly":n.readOnly},n.className)}},styles:"\n@layer primereact {\n .p-rating {\n display: flex;\n align-items: center;\n }\n \n .p-rating-item {\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n }\n \n .p-rating.p-readonly .p-rating-item {\n cursor: default;\n }\n}\n"}});function b(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?b(Object(t),!0).forEach((function(n){var r,o,a;r=e,a=t[n],(o=g(o=n))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var O=e.memo(e.forwardRef((function(i,u){var f=e.useContext(n),y=v.getProps(i,f),g=e.useRef(null),b=v.setMetaData({props:y}),O=b.ptm,I=b.cx;s(v.css.styles,b.isUnstyled,{name:"rating"});var P=function(e,n){return O(n,{context:{active:e<=y.value}})},E=!y.disabled&&!y.readOnly,j=E?0:null,h=function(e,n){E&&y.onChange&&y.onChange({originalEvent:e,value:n,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{name:y.name,id:y.id,value:n}}),e.preventDefault()},w=function(e){E&&y.onChange&&y.onChange({originalEvent:e,value:null,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{name:y.name,id:y.id,value:null}}),e.preventDefault()},D=function(e,n){"Enter"===e.key&&h(e,n)},S=function(e){"Enter"===e.key&&w(e)};e.useImperativeHandle(u,(function(){return{props:y,getElement:function(){return g.current}}}));var N=l.isNotEmpty(y.tooltip),x=c({ref:g,id:y.id,className:I("root"),style:y.style},v.getOtherProps(y),O("root")),C=function(){if(y.cancel){var n=c({className:I("cancelIcon")},O("cancelIcon")),r=p.getJSXIcon(y.cancelIcon||e.createElement(t,n),d(d({},n),y.cancelIconProps),{props:y}),o=c({className:I("cancelItem"),onClick:w,tabIndex:j,onKeyDown:S},O("cancelItem"));return e.createElement("div",o,r)}return null}(),k=Array.from({length:y.stars},(function(e,n){return n+1})).map((function(n){var t=n<=y.value,a=c({className:I("onIcon")},P(y.value,"onIcon")),i=c({className:I("onIcon")},P(y.value,"offIcon")),l=p.getJSXIcon((t?{type:y.onIcon||e.createElement(o,a)}:{type:y.offIcon||e.createElement(r,i)}).type,d({},t?a:i),{props:y}),u=c({key:n,className:I("item",{active:t}),tabIndex:j,onClick:function(e){return h(e,n)},onKeyDown:function(e){return D(e,n)}},P(y.value,"item"));return e.createElement("div",m({key:n},u),l)}));return e.createElement(e.Fragment,null,e.createElement("div",x,C,k),N&&e.createElement(a,m({target:g,content:y.tooltip},y.tooltipOptions,{pt:O("tooltip")})))})));O.displayName="Rating";export{O as Rating};
|
package/ripple/ripple.esm.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import PrimeReact, { PrimeReactContext } from 'primereact/api';
|
|
5
|
-
import { useStyle, useMountEffect, useUpdateEffect, useUnmountEffect } from 'primereact/hooks';
|
|
6
|
-
import { ObjectUtils, DomHandler } from 'primereact/utils';
|
|
7
|
-
|
|
8
|
-
var styles = "\n@layer primereact {\n .p-ripple {\n overflow: hidden;\n position: relative;\n }\n \n .p-ink {\n display: block;\n position: absolute;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 100%;\n transform: scale(0);\n }\n \n .p-ink-active {\n animation: ripple 0.4s linear;\n }\n \n .p-ripple-disabled .p-ink {\n display: none !important;\n }\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n\n";
|
|
9
|
-
var RippleBase = {
|
|
10
|
-
defaultProps: {
|
|
11
|
-
__TYPE: 'Ripple',
|
|
12
|
-
children: undefined
|
|
13
|
-
},
|
|
14
|
-
css: {
|
|
15
|
-
styles: styles
|
|
16
|
-
},
|
|
17
|
-
getProps: function getProps(props) {
|
|
18
|
-
return ObjectUtils.getMergedProps(props, RippleBase.defaultProps);
|
|
19
|
-
},
|
|
20
|
-
getOtherProps: function getOtherProps(props) {
|
|
21
|
-
return ObjectUtils.getDiffProps(props, RippleBase.defaultProps);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var Ripple = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function () {
|
|
26
|
-
var inkRef = React.useRef(null);
|
|
27
|
-
var targetRef = React.useRef(null);
|
|
28
|
-
var context = React.useContext(PrimeReactContext);
|
|
29
|
-
useStyle(RippleBase.css.styles, {
|
|
30
|
-
name: 'ripple'
|
|
31
|
-
});
|
|
32
|
-
var getTarget = function getTarget() {
|
|
33
|
-
return inkRef.current && inkRef.current.parentElement;
|
|
34
|
-
};
|
|
35
|
-
var bindEvents = function bindEvents() {
|
|
36
|
-
if (targetRef.current) {
|
|
37
|
-
targetRef.current.addEventListener('pointerdown', onPointerDown);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var unbindEvents = function unbindEvents() {
|
|
41
|
-
if (targetRef.current) {
|
|
42
|
-
targetRef.current.removeEventListener('pointerdown', onPointerDown);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var onPointerDown = function onPointerDown(event) {
|
|
46
|
-
var offset = DomHandler.getOffset(targetRef.current);
|
|
47
|
-
var offsetX = event.pageX - offset.left + document.body.scrollTop - DomHandler.getWidth(inkRef.current) / 2;
|
|
48
|
-
var offsetY = event.pageY - offset.top + document.body.scrollLeft - DomHandler.getHeight(inkRef.current) / 2;
|
|
49
|
-
activateRipple(offsetX, offsetY);
|
|
50
|
-
};
|
|
51
|
-
var activateRipple = function activateRipple(offsetX, offsetY) {
|
|
52
|
-
if (!inkRef.current || getComputedStyle(inkRef.current, null).display === 'none') {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
DomHandler.removeClass(inkRef.current, 'p-ink-active');
|
|
56
|
-
setDimensions();
|
|
57
|
-
inkRef.current.style.top = offsetY + 'px';
|
|
58
|
-
inkRef.current.style.left = offsetX + 'px';
|
|
59
|
-
DomHandler.addClass(inkRef.current, 'p-ink-active');
|
|
60
|
-
};
|
|
61
|
-
var onAnimationEnd = function onAnimationEnd(event) {
|
|
62
|
-
DomHandler.removeClass(event.currentTarget, 'p-ink-active');
|
|
63
|
-
};
|
|
64
|
-
var setDimensions = function setDimensions() {
|
|
65
|
-
if (inkRef.current && !DomHandler.getHeight(inkRef.current) && !DomHandler.getWidth(inkRef.current)) {
|
|
66
|
-
var d = Math.max(DomHandler.getOuterWidth(targetRef.current), DomHandler.getOuterHeight(targetRef.current));
|
|
67
|
-
inkRef.current.style.height = d + 'px';
|
|
68
|
-
inkRef.current.style.width = d + 'px';
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
useMountEffect(function () {
|
|
72
|
-
if (inkRef.current) {
|
|
73
|
-
targetRef.current = getTarget();
|
|
74
|
-
setDimensions();
|
|
75
|
-
bindEvents();
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
useUpdateEffect(function () {
|
|
79
|
-
if (inkRef.current && !targetRef.current) {
|
|
80
|
-
targetRef.current = getTarget();
|
|
81
|
-
setDimensions();
|
|
82
|
-
bindEvents();
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
useUnmountEffect(function () {
|
|
86
|
-
if (inkRef.current) {
|
|
87
|
-
targetRef.current = null;
|
|
88
|
-
unbindEvents();
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
return context && context.ripple || PrimeReact.ripple ? /*#__PURE__*/React.createElement("span", {
|
|
92
|
-
role: "presentation",
|
|
93
|
-
ref: inkRef,
|
|
94
|
-
className: "p-ink",
|
|
95
|
-
onAnimationEnd: onAnimationEnd
|
|
96
|
-
}) : null;
|
|
97
|
-
}));
|
|
98
|
-
Ripple.displayName = 'Ripple';
|
|
99
|
-
|
|
100
|
-
export { Ripple };
|
package/ripple/ripple.esm.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import r,{PrimeReactContext as n}from"primereact/api";import{useStyle as t,useMountEffect as i,useUpdateEffect as o,useUnmountEffect as p}from"primereact/hooks";import{ObjectUtils as u,DomHandler as c}from"primereact/utils";var a={defaultProps:{__TYPE:"Ripple",children:void 0},css:{styles:"\n@layer primereact {\n .p-ripple {\n overflow: hidden;\n position: relative;\n }\n \n .p-ink {\n display: block;\n position: absolute;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 100%;\n transform: scale(0);\n }\n \n .p-ink-active {\n animation: ripple 0.4s linear;\n }\n \n .p-ripple-disabled .p-ink {\n display: none !important;\n }\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n\n"},getProps:function(e){return u.getMergedProps(e,a.defaultProps)},getOtherProps:function(e){return u.getDiffProps(e,a.defaultProps)}},l=e.memo(e.forwardRef((function(){var u=e.useRef(null),l=e.useRef(null),s=e.useContext(n);t(a.css.styles,{name:"ripple"});var f=function(){return u.current&&u.current.parentElement},d=function(){l.current&&l.current.addEventListener("pointerdown",m)},m=function(e){var r=c.getOffset(l.current),n=e.pageX-r.left+document.body.scrollTop-c.getWidth(u.current)/2,t=e.pageY-r.top+document.body.scrollLeft-c.getHeight(u.current)/2;g(n,t)},g=function(e,r){u.current&&"none"!==getComputedStyle(u.current,null).display&&(c.removeClass(u.current,"p-ink-active"),v(),u.current.style.top=r+"px",u.current.style.left=e+"px",c.addClass(u.current,"p-ink-active"))},v=function(){if(u.current&&!c.getHeight(u.current)&&!c.getWidth(u.current)){var e=Math.max(c.getOuterWidth(l.current),c.getOuterHeight(l.current));u.current.style.height=e+"px",u.current.style.width=e+"px"}};return i((function(){u.current&&(l.current=f(),v(),d())})),o((function(){u.current&&!l.current&&(l.current=f(),v(),d())})),p((function(){u.current&&(l.current=null,l.current&&l.current.removeEventListener("pointerdown",m))})),s&&s.ripple||r.ripple?e.createElement("span",{role:"presentation",ref:u,className:"p-ink",onAnimationEnd:function(e){c.removeClass(e.currentTarget,"p-ink-active")}}):null})));l.displayName="Ripple";export{l as Ripple};
|
package/row/row.esm.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { ComponentBase } from 'primereact/componentbase';
|
|
5
|
-
import { ObjectUtils, mergeProps } from 'primereact/utils';
|
|
6
|
-
import { PrimeReactContext } from 'primereact/api';
|
|
7
|
-
|
|
8
|
-
var RowBase = ComponentBase.extend({
|
|
9
|
-
defaultProps: {
|
|
10
|
-
__TYPE: 'Row',
|
|
11
|
-
style: null,
|
|
12
|
-
className: null,
|
|
13
|
-
children: undefined
|
|
14
|
-
},
|
|
15
|
-
getCProp: function getCProp(row, name) {
|
|
16
|
-
return ObjectUtils.getComponentProp(row, name, RowBase.defaultProps);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var Row = function Row(inProps) {
|
|
21
|
-
var context = React.useContext(PrimeReactContext);
|
|
22
|
-
var props = RowBase.getProps(inProps, context);
|
|
23
|
-
//@todo Pass Parent MetaData
|
|
24
|
-
var _RowBase$setMetaData = RowBase.setMetaData({
|
|
25
|
-
props: props
|
|
26
|
-
}),
|
|
27
|
-
ptm = _RowBase$setMetaData.ptm;
|
|
28
|
-
var rootProps = mergeProps({
|
|
29
|
-
className: props.className,
|
|
30
|
-
style: props.style
|
|
31
|
-
}, RowBase.getOtherProps(props), ptm('root'));
|
|
32
|
-
return /*#__PURE__*/React.createElement("tr", rootProps, props.children);
|
|
33
|
-
};
|
|
34
|
-
Row.displayName = 'Row';
|
|
35
|
-
|
|
36
|
-
export { Row };
|
package/row/row.esm.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{ComponentBase as t}from"primereact/componentbase";import{ObjectUtils as r,mergeProps as o}from"primereact/utils";import{PrimeReactContext as a}from"primereact/api";var p=t.extend({defaultProps:{__TYPE:"Row",style:null,className:null,children:void 0},getCProp:function(e,t){return r.getComponentProp(e,t,p.defaultProps)}}),s=function(t){var r=e.useContext(a),s=p.getProps(t,r),m=p.setMetaData({props:s}).ptm,l=o({className:s.className,style:s.style},p.getOtherProps(s),m("root"));return e.createElement("tr",l,s.children)};s.displayName="Row";export{s as Row};
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PrimeReactContext } from 'primereact/api';
|
|
5
|
-
import { useMountEffect, useUnmountEffect } from 'primereact/hooks';
|
|
6
|
-
import { classNames, mergeProps, DomHandler } from 'primereact/utils';
|
|
7
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
8
|
-
|
|
9
|
-
var ScrollPanelBase = ComponentBase.extend({
|
|
10
|
-
defaultProps: {
|
|
11
|
-
__TYPE: 'ScrollPanel',
|
|
12
|
-
id: null,
|
|
13
|
-
style: null,
|
|
14
|
-
className: null,
|
|
15
|
-
children: undefined
|
|
16
|
-
},
|
|
17
|
-
css: {
|
|
18
|
-
classes: {
|
|
19
|
-
root: function root(_ref) {
|
|
20
|
-
var props = _ref.props;
|
|
21
|
-
return classNames('p-scrollpanel p-component', props.className);
|
|
22
|
-
},
|
|
23
|
-
wrapper: 'p-scrollpanel-wrapper',
|
|
24
|
-
content: 'p-scrollpanel-content',
|
|
25
|
-
barx: 'p-scrollpanel-bar p-scrollpanel-bar-x',
|
|
26
|
-
bary: 'p-scrollpanel-bar p-scrollpanel-bar-y'
|
|
27
|
-
},
|
|
28
|
-
styles: "\n @layer primereact {\n .p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n }\n \n .p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: hidden;\n box-sizing: border-box;\n }\n \n .p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n }\n \n .p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n }\n \n .p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n }\n \n .p-scrollpanel-hidden {\n visibility: hidden;\n }\n \n .p-scrollpanel:hover .p-scrollpanel-bar,\n .p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n }\n \n .p-scrollpanel-grabbed {\n user-select: none;\n }\n }\n "
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
var ScrollPanel = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
33
|
-
var context = React.useContext(PrimeReactContext);
|
|
34
|
-
var props = ScrollPanelBase.getProps(inProps, context);
|
|
35
|
-
var _ScrollPanelBase$setM = ScrollPanelBase.setMetaData({
|
|
36
|
-
props: props
|
|
37
|
-
}),
|
|
38
|
-
ptm = _ScrollPanelBase$setM.ptm,
|
|
39
|
-
cx = _ScrollPanelBase$setM.cx,
|
|
40
|
-
isUnstyled = _ScrollPanelBase$setM.isUnstyled;
|
|
41
|
-
useHandleStyle(ScrollPanelBase.css.styles, isUnstyled, {
|
|
42
|
-
name: 'scrollpanel'
|
|
43
|
-
});
|
|
44
|
-
var containerRef = React.useRef(null);
|
|
45
|
-
var contentRef = React.useRef(null);
|
|
46
|
-
var xBarRef = React.useRef(null);
|
|
47
|
-
var yBarRef = React.useRef(null);
|
|
48
|
-
var isXBarClicked = React.useRef(false);
|
|
49
|
-
var isYBarClicked = React.useRef(false);
|
|
50
|
-
var lastPageX = React.useRef(null);
|
|
51
|
-
var lastPageY = React.useRef(null);
|
|
52
|
-
var scrollXRatio = React.useRef(null);
|
|
53
|
-
var scrollYRatio = React.useRef(null);
|
|
54
|
-
var frame = React.useRef(null);
|
|
55
|
-
var initialized = React.useRef(false);
|
|
56
|
-
var calculateContainerHeight = function calculateContainerHeight() {
|
|
57
|
-
var containerStyles = getComputedStyle(containerRef.current);
|
|
58
|
-
var xBarStyles = getComputedStyle(xBarRef.current);
|
|
59
|
-
var pureContainerHeight = DomHandler.getHeight(containerRef.current) - parseInt(xBarStyles['height'], 10);
|
|
60
|
-
if (containerStyles['max-height'] !== 'none' && pureContainerHeight === 0) {
|
|
61
|
-
if (contentRef.current.offsetHeight + parseInt(xBarStyles['height'], 10) > parseInt(containerStyles['max-height'], 10)) {
|
|
62
|
-
containerRef.current.style.height = containerStyles['max-height'];
|
|
63
|
-
} else {
|
|
64
|
-
containerRef.current.style.height = contentRef.current.offsetHeight + parseFloat(containerStyles.paddingTop) + parseFloat(containerStyles.paddingBottom) + parseFloat(containerStyles.borderTopWidth) + parseFloat(containerStyles.borderBottomWidth) + 'px';
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var moveBar = function moveBar() {
|
|
69
|
-
// horizontal scroll
|
|
70
|
-
var totalWidth = contentRef.current.scrollWidth;
|
|
71
|
-
var ownWidth = contentRef.current.clientWidth;
|
|
72
|
-
var bottom = (containerRef.current.clientHeight - xBarRef.current.clientHeight) * -1;
|
|
73
|
-
scrollXRatio.current = ownWidth / totalWidth;
|
|
74
|
-
|
|
75
|
-
// vertical scroll
|
|
76
|
-
var totalHeight = contentRef.current.scrollHeight;
|
|
77
|
-
var ownHeight = contentRef.current.clientHeight;
|
|
78
|
-
var right = (containerRef.current.clientWidth - yBarRef.current.clientWidth) * -1;
|
|
79
|
-
scrollYRatio.current = ownHeight / totalHeight;
|
|
80
|
-
frame.current = window.requestAnimationFrame(function () {
|
|
81
|
-
if (scrollXRatio.current >= 1) {
|
|
82
|
-
DomHandler.addClass(xBarRef.current, 'p-scrollpanel-hidden');
|
|
83
|
-
} else {
|
|
84
|
-
DomHandler.removeClass(xBarRef.current, 'p-scrollpanel-hidden');
|
|
85
|
-
xBarRef.current.style.cssText = 'width:' + Math.max(scrollXRatio.current * 100, 10) + '%; left:' + contentRef.current.scrollLeft / totalWidth * 100 + '%;bottom:' + bottom + 'px;';
|
|
86
|
-
}
|
|
87
|
-
if (scrollYRatio.current >= 1) {
|
|
88
|
-
DomHandler.addClass(yBarRef.current, 'p-scrollpanel-hidden');
|
|
89
|
-
} else {
|
|
90
|
-
DomHandler.removeClass(yBarRef.current, 'p-scrollpanel-hidden');
|
|
91
|
-
yBarRef.current.style.cssText = 'height:' + Math.max(scrollYRatio.current * 100, 10) + '%; top: calc(' + contentRef.current.scrollTop / totalHeight * 100 + '% - ' + xBarRef.current.clientHeight + 'px);right:' + right + 'px;';
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
var onYBarMouseDown = function onYBarMouseDown(event) {
|
|
96
|
-
isYBarClicked.current = true;
|
|
97
|
-
lastPageY.current = event.pageY;
|
|
98
|
-
DomHandler.addClass(yBarRef.current, 'p-scrollpanel-grabbed');
|
|
99
|
-
DomHandler.addClass(document.body, 'p-scrollpanel-grabbed');
|
|
100
|
-
document.addEventListener('mousemove', onDocumentMouseMove);
|
|
101
|
-
document.addEventListener('mouseup', onDocumentMouseUp);
|
|
102
|
-
event.preventDefault();
|
|
103
|
-
};
|
|
104
|
-
var onXBarMouseDown = function onXBarMouseDown(event) {
|
|
105
|
-
isXBarClicked.current = true;
|
|
106
|
-
lastPageX.current = event.pageX;
|
|
107
|
-
DomHandler.addClass(xBarRef.current, 'p-scrollpanel-grabbed');
|
|
108
|
-
DomHandler.addClass(document.body, 'p-scrollpanel-grabbed');
|
|
109
|
-
document.addEventListener('mousemove', onDocumentMouseMove);
|
|
110
|
-
document.addEventListener('mouseup', onDocumentMouseUp);
|
|
111
|
-
event.preventDefault();
|
|
112
|
-
};
|
|
113
|
-
var onDocumentMouseMove = function onDocumentMouseMove(event) {
|
|
114
|
-
if (isXBarClicked.current) {
|
|
115
|
-
onMouseMoveForXBar(event);
|
|
116
|
-
} else if (isYBarClicked.current) {
|
|
117
|
-
onMouseMoveForYBar(event);
|
|
118
|
-
} else {
|
|
119
|
-
onMouseMoveForXBar(event);
|
|
120
|
-
onMouseMoveForYBar(event);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
var onMouseMoveForXBar = function onMouseMoveForXBar(event) {
|
|
124
|
-
var deltaX = event.pageX - lastPageX.current;
|
|
125
|
-
lastPageX.current = event.pageX;
|
|
126
|
-
frame.current = window.requestAnimationFrame(function () {
|
|
127
|
-
contentRef.current.scrollLeft += deltaX / scrollXRatio.current;
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
var onMouseMoveForYBar = function onMouseMoveForYBar(event) {
|
|
131
|
-
var deltaY = event.pageY - lastPageY.current;
|
|
132
|
-
lastPageY.current = event.pageY;
|
|
133
|
-
frame.current = window.requestAnimationFrame(function () {
|
|
134
|
-
contentRef.current.scrollTop += deltaY / scrollYRatio.current;
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
var onDocumentMouseUp = function onDocumentMouseUp(event) {
|
|
138
|
-
DomHandler.removeClass(yBarRef.current, 'p-scrollpanel-grabbed');
|
|
139
|
-
DomHandler.removeClass(xBarRef.current, 'p-scrollpanel-grabbed');
|
|
140
|
-
DomHandler.removeClass(document.body, 'p-scrollpanel-grabbed');
|
|
141
|
-
document.removeEventListener('mousemove', onDocumentMouseMove);
|
|
142
|
-
document.removeEventListener('mouseup', onDocumentMouseUp);
|
|
143
|
-
isXBarClicked.current = false;
|
|
144
|
-
isYBarClicked.current = false;
|
|
145
|
-
};
|
|
146
|
-
var refresh = function refresh() {
|
|
147
|
-
moveBar();
|
|
148
|
-
};
|
|
149
|
-
useMountEffect(function () {
|
|
150
|
-
moveBar();
|
|
151
|
-
window.addEventListener('resize', moveBar);
|
|
152
|
-
calculateContainerHeight();
|
|
153
|
-
initialized.current = true;
|
|
154
|
-
});
|
|
155
|
-
useUnmountEffect(function () {
|
|
156
|
-
if (initialized.current) {
|
|
157
|
-
window.removeEventListener('resize', moveBar);
|
|
158
|
-
}
|
|
159
|
-
if (frame.current) {
|
|
160
|
-
window.cancelAnimationFrame(frame.current);
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
React.useImperativeHandle(ref, function () {
|
|
164
|
-
return {
|
|
165
|
-
props: props,
|
|
166
|
-
refresh: refresh,
|
|
167
|
-
getElement: function getElement() {
|
|
168
|
-
return containerRef.current;
|
|
169
|
-
},
|
|
170
|
-
getContent: function getContent() {
|
|
171
|
-
return contentRef.current;
|
|
172
|
-
},
|
|
173
|
-
getXBar: function getXBar() {
|
|
174
|
-
return xBarRef.current;
|
|
175
|
-
},
|
|
176
|
-
getYBar: function getYBar() {
|
|
177
|
-
return yBarRef.current;
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
});
|
|
181
|
-
var rootProps = mergeProps({
|
|
182
|
-
id: props.id,
|
|
183
|
-
ref: containerRef,
|
|
184
|
-
style: props.style,
|
|
185
|
-
className: cx('root')
|
|
186
|
-
}, ScrollPanelBase.getOtherProps(props), ptm('root'));
|
|
187
|
-
var wrapperProps = mergeProps({
|
|
188
|
-
className: cx('wrapper')
|
|
189
|
-
}, ptm('wrapper'));
|
|
190
|
-
var contentProps = mergeProps({
|
|
191
|
-
className: cx('content'),
|
|
192
|
-
ref: contentRef,
|
|
193
|
-
onScroll: moveBar,
|
|
194
|
-
onMouseEnter: moveBar
|
|
195
|
-
}, ptm('content'));
|
|
196
|
-
var barXProps = mergeProps({
|
|
197
|
-
ref: xBarRef,
|
|
198
|
-
className: cx('barx'),
|
|
199
|
-
onMouseDown: onXBarMouseDown
|
|
200
|
-
}, ptm('barx'));
|
|
201
|
-
var barYProps = mergeProps({
|
|
202
|
-
ref: yBarRef,
|
|
203
|
-
className: cx('bary'),
|
|
204
|
-
onMouseDown: onYBarMouseDown
|
|
205
|
-
}, ptm('bary'));
|
|
206
|
-
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("div", wrapperProps, /*#__PURE__*/React.createElement("div", contentProps, props.children)), /*#__PURE__*/React.createElement("div", barXProps), /*#__PURE__*/React.createElement("div", barYProps));
|
|
207
|
-
});
|
|
208
|
-
ScrollPanel.displayName = 'ScrollPanel';
|
|
209
|
-
|
|
210
|
-
export { ScrollPanel };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as r}from"primereact/api";import{useMountEffect as n,useUnmountEffect as t}from"primereact/hooks";import{classNames as l,mergeProps as o,DomHandler as a}from"primereact/utils";import{ComponentBase as c,useHandleStyle as s}from"primereact/componentbase";var u=c.extend({defaultProps:{__TYPE:"ScrollPanel",id:null,style:null,className:null,children:void 0},css:{classes:{root:function(e){return l("p-scrollpanel p-component",e.props.className)},wrapper:"p-scrollpanel-wrapper",content:"p-scrollpanel-content",barx:"p-scrollpanel-bar p-scrollpanel-bar-x",bary:"p-scrollpanel-bar p-scrollpanel-bar-y"},styles:"\n @layer primereact {\n .p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n }\n \n .p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: hidden;\n box-sizing: border-box;\n }\n \n .p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n }\n \n .p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n }\n \n .p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n }\n \n .p-scrollpanel-hidden {\n visibility: hidden;\n }\n \n .p-scrollpanel:hover .p-scrollpanel-bar,\n .p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n }\n \n .p-scrollpanel-grabbed {\n user-select: none;\n }\n }\n "}}),i=e.forwardRef((function(l,c){var i=e.useContext(r),p=u.getProps(l,i),d=u.setMetaData({props:p}),m=d.ptm,f=d.cx;s(u.css.styles,d.isUnstyled,{name:"scrollpanel"});var h=e.useRef(null),g=e.useRef(null),b=e.useRef(null),v=e.useRef(null),x=e.useRef(!1),w=e.useRef(!1),y=e.useRef(null),E=e.useRef(null),C=e.useRef(null),R=e.useRef(null),L=e.useRef(null),H=e.useRef(!1),F=function(){var e=g.current.scrollWidth,r=-1*(h.current.clientHeight-b.current.clientHeight);C.current=g.current.clientWidth/e;var n=g.current.scrollHeight,t=-1*(h.current.clientWidth-v.current.clientWidth);R.current=g.current.clientHeight/n,L.current=window.requestAnimationFrame((function(){C.current>=1?a.addClass(b.current,"p-scrollpanel-hidden"):(a.removeClass(b.current,"p-scrollpanel-hidden"),b.current.style.cssText="width:"+Math.max(100*C.current,10)+"%; left:"+g.current.scrollLeft/e*100+"%;bottom:"+r+"px;"),R.current>=1?a.addClass(v.current,"p-scrollpanel-hidden"):(a.removeClass(v.current,"p-scrollpanel-hidden"),v.current.style.cssText="height:"+Math.max(100*R.current,10)+"%; top: calc("+g.current.scrollTop/n*100+"% - "+b.current.clientHeight+"px);right:"+t+"px;")}))},N=function(e){x.current?T(e):(w.current||T(e),M(e))},T=function(e){var r=e.pageX-y.current;y.current=e.pageX,L.current=window.requestAnimationFrame((function(){g.current.scrollLeft+=r/C.current}))},M=function(e){var r=e.pageY-E.current;E.current=e.pageY,L.current=window.requestAnimationFrame((function(){g.current.scrollTop+=r/R.current}))},P=function e(r){a.removeClass(v.current,"p-scrollpanel-grabbed"),a.removeClass(b.current,"p-scrollpanel-grabbed"),a.removeClass(document.body,"p-scrollpanel-grabbed"),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",e),x.current=!1,w.current=!1},W=function(){F()};n((function(){var e,r,n;F(),window.addEventListener("resize",F),e=getComputedStyle(h.current),r=getComputedStyle(b.current),n=a.getHeight(h.current)-parseInt(r.height,10),"none"!==e["max-height"]&&0===n&&(h.current.style.height=g.current.offsetHeight+parseInt(r.height,10)>parseInt(e["max-height"],10)?e["max-height"]:g.current.offsetHeight+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)+"px"),H.current=!0})),t((function(){H.current&&window.removeEventListener("resize",F),L.current&&window.cancelAnimationFrame(L.current)})),e.useImperativeHandle(c,(function(){return{props:p,refresh:W,getElement:function(){return h.current},getContent:function(){return g.current},getXBar:function(){return b.current},getYBar:function(){return v.current}}}));var z=o({id:p.id,ref:h,style:p.style,className:f("root")},u.getOtherProps(p),m("root")),D=o({className:f("wrapper")},m("wrapper")),S=o({className:f("content"),ref:g,onScroll:F,onMouseEnter:F},m("content")),Y=o({ref:b,className:f("barx"),onMouseDown:function(e){x.current=!0,y.current=e.pageX,a.addClass(b.current,"p-scrollpanel-grabbed"),a.addClass(document.body,"p-scrollpanel-grabbed"),document.addEventListener("mousemove",N),document.addEventListener("mouseup",P),e.preventDefault()}},m("barx")),A=o({ref:v,className:f("bary"),onMouseDown:function(e){w.current=!0,E.current=e.pageY,a.addClass(v.current,"p-scrollpanel-grabbed"),a.addClass(document.body,"p-scrollpanel-grabbed"),document.addEventListener("mousemove",N),document.addEventListener("mouseup",P),e.preventDefault()}},m("bary"));return e.createElement("div",z,e.createElement("div",D,e.createElement("div",S,p.children)),e.createElement("div",Y),e.createElement("div",A))}));i.displayName="ScrollPanel";export{i as ScrollPanel};
|