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/dataview/dataview.esm.js
DELETED
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import PrimeReact, { PrimeReactContext, localeOption } from 'primereact/api';
|
|
5
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
|
-
import { BarsIcon } from 'primereact/icons/bars';
|
|
7
|
-
import { SpinnerIcon } from 'primereact/icons/spinner';
|
|
8
|
-
import { ThLargeIcon } from 'primereact/icons/thlarge';
|
|
9
|
-
import { Paginator } from 'primereact/paginator';
|
|
10
|
-
import { Ripple } from 'primereact/ripple';
|
|
11
|
-
import { classNames, mergeProps, IconUtils, ObjectUtils } from 'primereact/utils';
|
|
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 _arrayLikeToArray$1(arr, len) {
|
|
29
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
30
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
31
|
-
return arr2;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _arrayWithoutHoles(arr) {
|
|
35
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function _iterableToArray(iter) {
|
|
39
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _unsupportedIterableToArray$1(o, minLen) {
|
|
43
|
-
if (!o) return;
|
|
44
|
-
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
45
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
46
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
47
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
48
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function _nonIterableSpread() {
|
|
52
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function _toConsumableArray(arr) {
|
|
56
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function _arrayWithHoles(arr) {
|
|
60
|
-
if (Array.isArray(arr)) return arr;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function _iterableToArrayLimit(r, l) {
|
|
64
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
65
|
-
if (null != t) {
|
|
66
|
-
var e,
|
|
67
|
-
n,
|
|
68
|
-
i,
|
|
69
|
-
u,
|
|
70
|
-
a = [],
|
|
71
|
-
f = !0,
|
|
72
|
-
o = !1;
|
|
73
|
-
try {
|
|
74
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
75
|
-
if (Object(t) !== t) return;
|
|
76
|
-
f = !1;
|
|
77
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
78
|
-
} catch (r) {
|
|
79
|
-
o = !0, n = r;
|
|
80
|
-
} finally {
|
|
81
|
-
try {
|
|
82
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
83
|
-
} finally {
|
|
84
|
-
if (o) throw n;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return a;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function _nonIterableRest() {
|
|
92
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function _slicedToArray(arr, i) {
|
|
96
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function _typeof(o) {
|
|
100
|
-
"@babel/helpers - typeof";
|
|
101
|
-
|
|
102
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
103
|
-
return typeof o;
|
|
104
|
-
} : function (o) {
|
|
105
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
106
|
-
}, _typeof(o);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function _toPrimitive(input, hint) {
|
|
110
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
111
|
-
var prim = input[Symbol.toPrimitive];
|
|
112
|
-
if (prim !== undefined) {
|
|
113
|
-
var res = prim.call(input, hint || "default");
|
|
114
|
-
if (_typeof(res) !== "object") return res;
|
|
115
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
116
|
-
}
|
|
117
|
-
return (hint === "string" ? String : Number)(input);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _toPropertyKey(arg) {
|
|
121
|
-
var key = _toPrimitive(arg, "string");
|
|
122
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function _defineProperty(obj, key, value) {
|
|
126
|
-
key = _toPropertyKey(key);
|
|
127
|
-
if (key in obj) {
|
|
128
|
-
Object.defineProperty(obj, key, {
|
|
129
|
-
value: value,
|
|
130
|
-
enumerable: true,
|
|
131
|
-
configurable: true,
|
|
132
|
-
writable: true
|
|
133
|
-
});
|
|
134
|
-
} else {
|
|
135
|
-
obj[key] = value;
|
|
136
|
-
}
|
|
137
|
-
return obj;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var classes = {
|
|
141
|
-
option: {
|
|
142
|
-
root: 'p-dataview-layout-options p-selectbutton p-buttonset',
|
|
143
|
-
listButton: function listButton(_ref) {
|
|
144
|
-
var props = _ref.props;
|
|
145
|
-
return classNames('p-button p-button-icon-only', {
|
|
146
|
-
'p-highlight': props.layout === 'list'
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
gridButton: function gridButton(_ref2) {
|
|
150
|
-
var props = _ref2.props;
|
|
151
|
-
return classNames('p-button p-button-icon-only', {
|
|
152
|
-
'p-highlight': props.layout === 'grid'
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
loadingIcon: 'p-dataview-loading-icon',
|
|
157
|
-
loadingOverlay: 'p-dataview-loading-overlay p-component-overlay',
|
|
158
|
-
emptyMessage: 'p-col-12 col-12 p-dataview-emptymessage',
|
|
159
|
-
header: 'p-dataview-header',
|
|
160
|
-
footer: 'p-dataview-footer',
|
|
161
|
-
content: 'p-dataview-content',
|
|
162
|
-
grid: function grid(_ref3) {
|
|
163
|
-
var props = _ref3.props;
|
|
164
|
-
return classNames('p-grid grid', {
|
|
165
|
-
'p-nogutter grid-nogutter': !props.gutter
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
root: function root(_ref4) {
|
|
169
|
-
var _classNames;
|
|
170
|
-
var props = _ref4.props;
|
|
171
|
-
return classNames('p-dataview p-component', (_classNames = {}, _defineProperty(_classNames, "p-dataview-".concat(props.layout), !!props.layout), _defineProperty(_classNames, 'p-dataview-loading', props.loading), _classNames));
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
var styles = "\n@layer primereact {\n .p-dataview-loading {\n position: relative;\n min-height: 4rem;\n }\n \n .p-dataview .p-dataview-loading-overlay {\n position: absolute;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n";
|
|
175
|
-
var DataViewBase = ComponentBase.extend({
|
|
176
|
-
defaultProps: {
|
|
177
|
-
__TYPE: 'DataView',
|
|
178
|
-
id: null,
|
|
179
|
-
header: null,
|
|
180
|
-
footer: null,
|
|
181
|
-
value: null,
|
|
182
|
-
layout: 'list',
|
|
183
|
-
dataKey: null,
|
|
184
|
-
rows: null,
|
|
185
|
-
first: 0,
|
|
186
|
-
totalRecords: null,
|
|
187
|
-
paginator: false,
|
|
188
|
-
paginatorPosition: 'bottom',
|
|
189
|
-
alwaysShowPaginator: true,
|
|
190
|
-
paginatorClassName: null,
|
|
191
|
-
paginatorTemplate: 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown',
|
|
192
|
-
paginatorLeft: null,
|
|
193
|
-
paginatorRight: null,
|
|
194
|
-
paginatorDropdownAppendTo: null,
|
|
195
|
-
pageLinkSize: 5,
|
|
196
|
-
rowsPerPageOptions: null,
|
|
197
|
-
currentPageReportTemplate: '({currentPage} of {totalPages})',
|
|
198
|
-
emptyMessage: null,
|
|
199
|
-
sortField: null,
|
|
200
|
-
sortOrder: null,
|
|
201
|
-
style: null,
|
|
202
|
-
className: null,
|
|
203
|
-
lazy: false,
|
|
204
|
-
loading: false,
|
|
205
|
-
loadingIcon: null,
|
|
206
|
-
gutter: false,
|
|
207
|
-
itemTemplate: null,
|
|
208
|
-
onPage: null,
|
|
209
|
-
children: undefined
|
|
210
|
-
},
|
|
211
|
-
css: {
|
|
212
|
-
classes: classes,
|
|
213
|
-
styles: styles
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
var DataViewLayoutOptionsBase = ComponentBase.extend({
|
|
217
|
-
defaultProps: {
|
|
218
|
-
__TYPE: 'DataViewLayoutOptions',
|
|
219
|
-
id: null,
|
|
220
|
-
style: null,
|
|
221
|
-
className: null,
|
|
222
|
-
layout: null,
|
|
223
|
-
listIcon: null,
|
|
224
|
-
gridIcon: null,
|
|
225
|
-
onChange: null,
|
|
226
|
-
children: undefined
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
231
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
232
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
233
|
-
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; }
|
|
234
|
-
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; }
|
|
235
|
-
var DataViewLayoutOptions = /*#__PURE__*/React.memo(function (inProps) {
|
|
236
|
-
var context = React.useContext(PrimeReactContext);
|
|
237
|
-
var props = DataViewLayoutOptionsBase.getProps(inProps, context);
|
|
238
|
-
var _DataViewLayoutOption = DataViewLayoutOptionsBase.setMetaData({
|
|
239
|
-
props: props
|
|
240
|
-
}),
|
|
241
|
-
ptm = _DataViewLayoutOption.ptm,
|
|
242
|
-
cx = _DataViewLayoutOption.cx;
|
|
243
|
-
var changeLayout = function changeLayout(event, layoutMode) {
|
|
244
|
-
props.onChange({
|
|
245
|
-
originalEvent: event,
|
|
246
|
-
value: layoutMode
|
|
247
|
-
});
|
|
248
|
-
event.preventDefault();
|
|
249
|
-
};
|
|
250
|
-
var listIconProps = mergeProps(ptm('list'));
|
|
251
|
-
var gridIconProps = mergeProps(ptm('grid'));
|
|
252
|
-
var listIcon = IconUtils.getJSXIcon(props.listIcon || /*#__PURE__*/React.createElement(BarsIcon, listIconProps), _objectSpread({}, listIconProps), {
|
|
253
|
-
props: props
|
|
254
|
-
});
|
|
255
|
-
var gridIcon = IconUtils.getJSXIcon(props.gridIcon || /*#__PURE__*/React.createElement(ThLargeIcon, gridIconProps), _objectSpread({}, gridIconProps), {
|
|
256
|
-
props: props
|
|
257
|
-
});
|
|
258
|
-
var rootProps = mergeProps({
|
|
259
|
-
id: props.id,
|
|
260
|
-
style: props.style,
|
|
261
|
-
className: classNames(props.className, cx('option.root'))
|
|
262
|
-
}, DataViewLayoutOptionsBase.getOtherProps(props), ptm('root'));
|
|
263
|
-
var listButtonProps = mergeProps({
|
|
264
|
-
type: 'button',
|
|
265
|
-
className: cx('option.listButton'),
|
|
266
|
-
onClick: function onClick(event) {
|
|
267
|
-
return changeLayout(event, 'list');
|
|
268
|
-
}
|
|
269
|
-
}, ptm('listButton'));
|
|
270
|
-
var gridButtonProps = mergeProps({
|
|
271
|
-
type: 'button',
|
|
272
|
-
className: cx('option.gridButton'),
|
|
273
|
-
onClick: function onClick(event) {
|
|
274
|
-
return changeLayout(event, 'grid');
|
|
275
|
-
}
|
|
276
|
-
}, ptm('gridButton'));
|
|
277
|
-
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("button", listButtonProps, listIcon, /*#__PURE__*/React.createElement(Ripple, null)), /*#__PURE__*/React.createElement("button", gridButtonProps, gridIcon, /*#__PURE__*/React.createElement(Ripple, null)));
|
|
278
|
-
});
|
|
279
|
-
var DataViewItem = /*#__PURE__*/React.memo(function (props) {
|
|
280
|
-
return props.template(props.item, props.layout);
|
|
281
|
-
});
|
|
282
|
-
var DataView = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
283
|
-
var context = React.useContext(PrimeReactContext);
|
|
284
|
-
var props = DataViewBase.getProps(inProps, context);
|
|
285
|
-
var _React$useState = React.useState(props.first),
|
|
286
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
287
|
-
firstState = _React$useState2[0],
|
|
288
|
-
setFirstState = _React$useState2[1];
|
|
289
|
-
var _React$useState3 = React.useState(props.rows),
|
|
290
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
291
|
-
rowsState = _React$useState4[0],
|
|
292
|
-
setRowsState = _React$useState4[1];
|
|
293
|
-
var metaData = {
|
|
294
|
-
props: props,
|
|
295
|
-
state: {
|
|
296
|
-
first: firstState,
|
|
297
|
-
rows: rowsState
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
var _DataViewBase$setMeta = DataViewBase.setMetaData(metaData),
|
|
301
|
-
ptm = _DataViewBase$setMeta.ptm,
|
|
302
|
-
cx = _DataViewBase$setMeta.cx,
|
|
303
|
-
isUnstyled = _DataViewBase$setMeta.isUnstyled;
|
|
304
|
-
useHandleStyle(DataViewBase.css.styles, isUnstyled, {
|
|
305
|
-
name: 'dataview'
|
|
306
|
-
});
|
|
307
|
-
var elementRef = React.useRef(null);
|
|
308
|
-
var first = props.onPage ? props.first : firstState;
|
|
309
|
-
var rows = props.onPage ? props.rows : rowsState;
|
|
310
|
-
var getItemRenderKey = function getItemRenderKey(value) {
|
|
311
|
-
return props.dataKey ? ObjectUtils.resolveFieldData(value, props.dataKey) : null;
|
|
312
|
-
};
|
|
313
|
-
var getTotalRecords = function getTotalRecords() {
|
|
314
|
-
return props.totalRecords ? props.totalRecords : props.value ? props.value.length : 0;
|
|
315
|
-
};
|
|
316
|
-
var createPaginator = function createPaginator(position) {
|
|
317
|
-
var className = classNames('p-paginator-' + position, props.paginatorClassName);
|
|
318
|
-
var totalRecords = getTotalRecords();
|
|
319
|
-
return /*#__PURE__*/React.createElement(Paginator, {
|
|
320
|
-
first: first,
|
|
321
|
-
rows: rows,
|
|
322
|
-
pageLinkSize: props.pageLinkSize,
|
|
323
|
-
className: className,
|
|
324
|
-
onPageChange: onPageChange,
|
|
325
|
-
template: props.paginatorTemplate,
|
|
326
|
-
totalRecords: totalRecords,
|
|
327
|
-
rowsPerPageOptions: props.rowsPerPageOptions,
|
|
328
|
-
currentPageReportTemplate: props.currentPageReportTemplate,
|
|
329
|
-
leftContent: props.paginatorLeft,
|
|
330
|
-
rightContent: props.paginatorRight,
|
|
331
|
-
alwaysShow: props.alwaysShowPaginator,
|
|
332
|
-
dropdownAppendTo: props.paginatorDropdownAppendTo,
|
|
333
|
-
ptm: ptm('paginator'),
|
|
334
|
-
unstyled: props.unstyled,
|
|
335
|
-
__parentMetadata: {
|
|
336
|
-
parent: metaData
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
};
|
|
340
|
-
var onPageChange = function onPageChange(event) {
|
|
341
|
-
if (props.onPage) {
|
|
342
|
-
props.onPage(event);
|
|
343
|
-
} else {
|
|
344
|
-
setFirstState(event.first);
|
|
345
|
-
setRowsState(event.rows);
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
var sort = function sort() {
|
|
349
|
-
if (props.value) {
|
|
350
|
-
// performance optimization to prevent resolving field data in each loop
|
|
351
|
-
var lookupMap = new Map();
|
|
352
|
-
var comparator = ObjectUtils.localeComparator(context && context.locale || PrimeReact.locale);
|
|
353
|
-
var value = _toConsumableArray(props.value);
|
|
354
|
-
var _iterator = _createForOfIteratorHelper(value),
|
|
355
|
-
_step;
|
|
356
|
-
try {
|
|
357
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
358
|
-
var item = _step.value;
|
|
359
|
-
lookupMap.set(item, ObjectUtils.resolveFieldData(item, props.sortField));
|
|
360
|
-
}
|
|
361
|
-
} catch (err) {
|
|
362
|
-
_iterator.e(err);
|
|
363
|
-
} finally {
|
|
364
|
-
_iterator.f();
|
|
365
|
-
}
|
|
366
|
-
value.sort(function (data1, data2) {
|
|
367
|
-
var value1 = lookupMap.get(data1);
|
|
368
|
-
var value2 = lookupMap.get(data2);
|
|
369
|
-
return ObjectUtils.sort(value1, value2, props.sortOrder, comparator, context && context.nullSortOrder || PrimeReact.nullSortOrder);
|
|
370
|
-
});
|
|
371
|
-
return value;
|
|
372
|
-
}
|
|
373
|
-
return null;
|
|
374
|
-
};
|
|
375
|
-
var createLoader = function createLoader() {
|
|
376
|
-
if (props.loading) {
|
|
377
|
-
var loadingIconProps = mergeProps({
|
|
378
|
-
className: cx('loadingIcon')
|
|
379
|
-
}, ptm('loadingIcon'));
|
|
380
|
-
var icon = props.loadingIcon || /*#__PURE__*/React.createElement(SpinnerIcon, _extends({}, loadingIconProps, {
|
|
381
|
-
spin: true
|
|
382
|
-
}));
|
|
383
|
-
var loadingIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, loadingIconProps), {
|
|
384
|
-
props: props
|
|
385
|
-
});
|
|
386
|
-
var loadingOverlayProps = mergeProps({
|
|
387
|
-
className: cx('loadingOverlay')
|
|
388
|
-
}, ptm('loadingOverlay'));
|
|
389
|
-
return /*#__PURE__*/React.createElement("div", loadingOverlayProps, loadingIcon);
|
|
390
|
-
}
|
|
391
|
-
return null;
|
|
392
|
-
};
|
|
393
|
-
var createTopPaginator = function createTopPaginator() {
|
|
394
|
-
if (props.paginator && (props.paginatorPosition !== 'bottom' || props.paginatorPosition === 'both')) {
|
|
395
|
-
return createPaginator('top');
|
|
396
|
-
}
|
|
397
|
-
return null;
|
|
398
|
-
};
|
|
399
|
-
var createBottomPaginator = function createBottomPaginator() {
|
|
400
|
-
if (props.paginator && (props.paginatorPosition !== 'top' || props.paginatorPosition === 'both')) {
|
|
401
|
-
return createPaginator('bottom');
|
|
402
|
-
}
|
|
403
|
-
return null;
|
|
404
|
-
};
|
|
405
|
-
var createEmptyMessage = function createEmptyMessage() {
|
|
406
|
-
if (!props.loading) {
|
|
407
|
-
var _content = props.emptyMessage || localeOption('emptyMessage');
|
|
408
|
-
var emptyMessageProps = mergeProps({
|
|
409
|
-
className: cx('emptyMessage')
|
|
410
|
-
}, ptm('emptyMessage'));
|
|
411
|
-
return /*#__PURE__*/React.createElement("div", emptyMessageProps, _content);
|
|
412
|
-
}
|
|
413
|
-
return null;
|
|
414
|
-
};
|
|
415
|
-
var createHeader = function createHeader() {
|
|
416
|
-
if (props.header) {
|
|
417
|
-
var headerProps = mergeProps({
|
|
418
|
-
className: cx('header')
|
|
419
|
-
}, ptm('header'));
|
|
420
|
-
return /*#__PURE__*/React.createElement("div", headerProps, props.header);
|
|
421
|
-
}
|
|
422
|
-
return null;
|
|
423
|
-
};
|
|
424
|
-
var createFooter = function createFooter() {
|
|
425
|
-
if (props.footer) {
|
|
426
|
-
var footerProps = mergeProps({
|
|
427
|
-
className: cx('footer')
|
|
428
|
-
}, ptm('footer'));
|
|
429
|
-
return /*#__PURE__*/React.createElement("div", footerProps, props.footer);
|
|
430
|
-
}
|
|
431
|
-
return null;
|
|
432
|
-
};
|
|
433
|
-
var createItems = function createItems(value) {
|
|
434
|
-
if (ObjectUtils.isNotEmpty(value)) {
|
|
435
|
-
if (props.paginator) {
|
|
436
|
-
var currentFirst = props.lazy ? 0 : first;
|
|
437
|
-
var totalRecords = getTotalRecords();
|
|
438
|
-
var last = Math.min(rows + currentFirst, totalRecords);
|
|
439
|
-
var items = [];
|
|
440
|
-
for (var i = currentFirst; i < last; i++) {
|
|
441
|
-
var val = value[i];
|
|
442
|
-
val && items.push( /*#__PURE__*/React.createElement(DataViewItem, {
|
|
443
|
-
key: getItemRenderKey(value) || i,
|
|
444
|
-
template: props.itemTemplate,
|
|
445
|
-
layout: props.layout,
|
|
446
|
-
item: val
|
|
447
|
-
}));
|
|
448
|
-
}
|
|
449
|
-
return items;
|
|
450
|
-
}
|
|
451
|
-
return value.map(function (item, index) {
|
|
452
|
-
return /*#__PURE__*/React.createElement(DataViewItem, {
|
|
453
|
-
key: getItemRenderKey(item) || index,
|
|
454
|
-
template: props.itemTemplate,
|
|
455
|
-
layout: props.layout,
|
|
456
|
-
item: item
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
return createEmptyMessage();
|
|
461
|
-
};
|
|
462
|
-
var createContent = function createContent(value) {
|
|
463
|
-
var items = createItems(value);
|
|
464
|
-
var gridProps = mergeProps({
|
|
465
|
-
className: cx('grid')
|
|
466
|
-
}, ptm('grid'));
|
|
467
|
-
var contentProps = mergeProps({
|
|
468
|
-
className: cx('content')
|
|
469
|
-
}, ptm('content'));
|
|
470
|
-
return /*#__PURE__*/React.createElement("div", contentProps, /*#__PURE__*/React.createElement("div", gridProps, items));
|
|
471
|
-
};
|
|
472
|
-
var processData = function processData() {
|
|
473
|
-
var data = props.value;
|
|
474
|
-
if (ObjectUtils.isNotEmpty(data) && props.sortField) {
|
|
475
|
-
data = sort();
|
|
476
|
-
}
|
|
477
|
-
return data;
|
|
478
|
-
};
|
|
479
|
-
React.useImperativeHandle(ref, function () {
|
|
480
|
-
return {
|
|
481
|
-
props: props,
|
|
482
|
-
getElement: function getElement() {
|
|
483
|
-
return elementRef.current;
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
});
|
|
487
|
-
var data = processData();
|
|
488
|
-
var loader = createLoader();
|
|
489
|
-
var topPaginator = createTopPaginator();
|
|
490
|
-
var bottomPaginator = createBottomPaginator();
|
|
491
|
-
var header = createHeader();
|
|
492
|
-
var footer = createFooter();
|
|
493
|
-
var content = createContent(data);
|
|
494
|
-
var rootProps = mergeProps({
|
|
495
|
-
id: props.id,
|
|
496
|
-
ref: elementRef,
|
|
497
|
-
style: props.style,
|
|
498
|
-
className: classNames(props.className, cx('root'))
|
|
499
|
-
}, DataViewBase.getOtherProps(props), ptm('root'));
|
|
500
|
-
return /*#__PURE__*/React.createElement("div", rootProps, loader, header, topPaginator, content, bottomPaginator, footer);
|
|
501
|
-
}));
|
|
502
|
-
DataViewLayoutOptions.displayName = 'DataViewLayoutOptions';
|
|
503
|
-
DataViewItem.displayName = 'DataViewItem';
|
|
504
|
-
DataView.displayName = 'DataView';
|
|
505
|
-
|
|
506
|
-
export { DataView, DataViewItem, DataViewLayoutOptions };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"react";import e,{PrimeReactContext as r,localeOption as n}from"primereact/api";import{ComponentBase as o,useHandleStyle as a}from"primereact/componentbase";import{BarsIcon as i}from"primereact/icons/bars";import{SpinnerIcon as l}from"primereact/icons/spinner";import{ThLargeIcon as u}from"primereact/icons/thlarge";import{Paginator as s}from"primereact/paginator";import{Ripple as p}from"primereact/ripple";import{classNames as c,mergeProps as m,IconUtils as f,ObjectUtils as g}from"primereact/utils";function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(this,arguments)}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function v(t){if(Array.isArray(t))return y(t)}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function h(t,e){if(t){if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(t){if(Array.isArray(t))return t}function O(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}function S(){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 E(t,e){return P(t)||O(t,e)||h(t,e)||S()}function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function N(t,e){if("object"!==j(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function I(t){var e=N(t,"string");return"symbol"===j(e)?e:String(e)}function A(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var D=o.extend({defaultProps:{__TYPE:"DataView",id:null,header:null,footer:null,value:null,layout:"list",dataKey:null,rows:null,first:0,totalRecords:null,paginator:!1,paginatorPosition:"bottom",alwaysShowPaginator:!0,paginatorClassName:null,paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown",paginatorLeft:null,paginatorRight:null,paginatorDropdownAppendTo:null,pageLinkSize:5,rowsPerPageOptions:null,currentPageReportTemplate:"({currentPage} of {totalPages})",emptyMessage:null,sortField:null,sortOrder:null,style:null,className:null,lazy:!1,loading:!1,loadingIcon:null,gutter:!1,itemTemplate:null,onPage:null,children:void 0},css:{classes:{option:{root:"p-dataview-layout-options p-selectbutton p-buttonset",listButton:function(t){return c("p-button p-button-icon-only",{"p-highlight":"list"===t.props.layout})},gridButton:function(t){return c("p-button p-button-icon-only",{"p-highlight":"grid"===t.props.layout})}},loadingIcon:"p-dataview-loading-icon",loadingOverlay:"p-dataview-loading-overlay p-component-overlay",emptyMessage:"p-col-12 col-12 p-dataview-emptymessage",header:"p-dataview-header",footer:"p-dataview-footer",content:"p-dataview-content",grid:function(t){return c("p-grid grid",{"p-nogutter grid-nogutter":!t.props.gutter})},root:function(t){var e,r=t.props;return c("p-dataview p-component",(A(e={},"p-dataview-".concat(r.layout),!!r.layout),A(e,"p-dataview-loading",r.loading),e))}},styles:"\n@layer primereact {\n .p-dataview-loading {\n position: relative;\n min-height: 4rem;\n }\n \n .p-dataview .p-dataview-loading-overlay {\n position: absolute;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n"}}),T=o.extend({defaultProps:{__TYPE:"DataViewLayoutOptions",id:null,style:null,className:null,layout:null,listIcon:null,gridIcon:null,onChange:null,children:void 0}});function C(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=k(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function k(t,e){if(t){if("string"==typeof t)return L(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(t,e):void 0}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach((function(e){A(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var R=t.memo((function(e){var n=t.useContext(r),o=T.getProps(e,n),a=T.setMetaData({props:o}),l=a.ptm,s=a.cx,g=function(t,e){o.onChange({originalEvent:t,value:e}),t.preventDefault()},d=m(l("list")),y=m(l("grid")),v=f.getJSXIcon(o.listIcon||t.createElement(i,d),x({},d),{props:o}),b=f.getJSXIcon(o.gridIcon||t.createElement(u,y),x({},y),{props:o}),h=m({id:o.id,style:o.style,className:c(o.className,s("option.root"))},T.getOtherProps(o),l("root")),w=m({type:"button",className:s("option.listButton"),onClick:function(t){return g(t,"list")}},l("listButton")),P=m({type:"button",className:s("option.gridButton"),onClick:function(t){return g(t,"grid")}},l("gridButton"));return t.createElement("div",h,t.createElement("button",w,v,t.createElement(p,null)),t.createElement("button",P,b,t.createElement(p,null)))})),z=t.memo((function(t){return t.template(t.item,t.layout)})),B=t.memo(t.forwardRef((function(o,i){var u=t.useContext(r),p=D.getProps(o,u),y=E(t.useState(p.first),2),P=y[0],O=y[1],S=E(t.useState(p.rows),2),j=S[0],N=S[1],I={props:p,state:{first:P,rows:j}},A=D.setMetaData(I),T=A.ptm,k=A.cx;a(D.css.styles,A.isUnstyled,{name:"dataview"});var L=t.useRef(null),M=p.onPage?p.first:P,R=p.onPage?p.rows:j,B=function(t){return p.dataKey?g.resolveFieldData(t,p.dataKey):null},F=function(){return p.totalRecords?p.totalRecords:p.value?p.value.length:0},_=function(e){var r=c("p-paginator-"+e,p.paginatorClassName),n=F();return t.createElement(s,{first:M,rows:R,pageLinkSize:p.pageLinkSize,className:r,onPageChange:V,template:p.paginatorTemplate,totalRecords:n,rowsPerPageOptions:p.rowsPerPageOptions,currentPageReportTemplate:p.currentPageReportTemplate,leftContent:p.paginatorLeft,rightContent:p.paginatorRight,alwaysShow:p.alwaysShowPaginator,dropdownAppendTo:p.paginatorDropdownAppendTo,ptm:T("paginator"),unstyled:p.unstyled,__parentMetadata:{parent:I}})},V=function(t){p.onPage?p.onPage(t):(O(t.first),N(t.rows))},J=function(){if(p.value){var t,r=new Map,n=g.localeComparator(u&&u.locale||e.locale),o=v(l=p.value)||b(l)||h(l)||w(),a=C(o);try{for(a.s();!(t=a.n()).done;){var i=t.value;r.set(i,g.resolveFieldData(i,p.sortField))}}catch(t){a.e(t)}finally{a.f()}return o.sort((function(t,o){var a=r.get(t),i=r.get(o);return g.sort(a,i,p.sortOrder,n,u&&u.nullSortOrder||e.nullSortOrder)})),o}var l;return null},K=function(){if(!p.loading){var e=p.emptyMessage||n("emptyMessage"),r=m({className:k("emptyMessage")},T("emptyMessage"));return t.createElement("div",r,e)}return null},U=function(e){if(g.isNotEmpty(e)){if(p.paginator){for(var r=p.lazy?0:M,n=F(),o=Math.min(R+r,n),a=[],i=r;i<o;i++){var l=e[i];l&&a.push(t.createElement(z,{key:B(e)||i,template:p.itemTemplate,layout:p.layout,item:l}))}return a}return e.map((function(e,r){return t.createElement(z,{key:B(e)||r,template:p.itemTemplate,layout:p.layout,item:e})}))}return K()};t.useImperativeHandle(i,(function(){return{props:p,getElement:function(){return L.current}}}));var X,Y,$,H=function(){var t=p.value;return g.isNotEmpty(t)&&p.sortField&&(t=J()),t}(),q=function(){if(p.loading){var e=m({className:k("loadingIcon")},T("loadingIcon")),r=p.loadingIcon||t.createElement(l,d({},e,{spin:!0})),n=f.getJSXIcon(r,x({},e),{props:p}),o=m({className:k("loadingOverlay")},T("loadingOverlay"));return t.createElement("div",o,n)}return null}(),G=!p.paginator||"bottom"===p.paginatorPosition&&"both"!==p.paginatorPosition?null:_("top"),Q=!p.paginator||"top"===p.paginatorPosition&&"both"!==p.paginatorPosition?null:_("bottom"),W=function(){if(p.header){var e=m({className:k("header")},T("header"));return t.createElement("div",e,p.header)}return null}(),Z=function(){if(p.footer){var e=m({className:k("footer")},T("footer"));return t.createElement("div",e,p.footer)}return null}(),tt=(X=U(H),Y=m({className:k("grid")},T("grid")),$=m({className:k("content")},T("content")),t.createElement("div",$,t.createElement("div",Y,X))),et=m({id:p.id,ref:L,style:p.style,className:c(p.className,k("root"))},D.getOtherProps(p),T("root"));return t.createElement("div",et,q,W,G,tt,Q,Z)})));R.displayName="DataViewLayoutOptions",z.displayName="DataViewItem",B.displayName="DataView";export{B as DataView,z as DataViewItem,R as DataViewLayoutOptions};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { useEventListener, useMountEffect } from 'primereact/hooks';
|
|
5
|
-
import { ComponentBase } from 'primereact/componentbase';
|
|
6
|
-
import { mergeProps } from 'primereact/utils';
|
|
7
|
-
import { PrimeReactContext } from 'primereact/api';
|
|
8
|
-
|
|
9
|
-
function _arrayWithHoles(arr) {
|
|
10
|
-
if (Array.isArray(arr)) return arr;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function _iterableToArrayLimit(r, l) {
|
|
14
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
15
|
-
if (null != t) {
|
|
16
|
-
var e,
|
|
17
|
-
n,
|
|
18
|
-
i,
|
|
19
|
-
u,
|
|
20
|
-
a = [],
|
|
21
|
-
f = !0,
|
|
22
|
-
o = !1;
|
|
23
|
-
try {
|
|
24
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
25
|
-
if (Object(t) !== t) return;
|
|
26
|
-
f = !1;
|
|
27
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
28
|
-
} catch (r) {
|
|
29
|
-
o = !0, n = r;
|
|
30
|
-
} finally {
|
|
31
|
-
try {
|
|
32
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
33
|
-
} finally {
|
|
34
|
-
if (o) throw n;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return a;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function _arrayLikeToArray(arr, len) {
|
|
42
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
43
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
44
|
-
return arr2;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
48
|
-
if (!o) return;
|
|
49
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
50
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
51
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
52
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
53
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _nonIterableRest() {
|
|
57
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _slicedToArray(arr, i) {
|
|
61
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
var DeferredContentBase = ComponentBase.extend({
|
|
65
|
-
defaultProps: {
|
|
66
|
-
__TYPE: 'DeferredContent',
|
|
67
|
-
onload: null,
|
|
68
|
-
children: undefined
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
var DeferredContent = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
73
|
-
var context = React.useContext(PrimeReactContext);
|
|
74
|
-
var props = DeferredContentBase.getProps(inProps, context);
|
|
75
|
-
var _React$useState = React.useState(false),
|
|
76
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
77
|
-
loadedState = _React$useState2[0],
|
|
78
|
-
setLoadedState = _React$useState2[1];
|
|
79
|
-
var elementRef = React.useRef(null);
|
|
80
|
-
var _useEventListener = useEventListener({
|
|
81
|
-
target: 'window',
|
|
82
|
-
type: 'scroll',
|
|
83
|
-
listener: function listener() {
|
|
84
|
-
if (shouldLoad()) {
|
|
85
|
-
load();
|
|
86
|
-
unbindScrollListener();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
91
|
-
bindScrollListener = _useEventListener2[0],
|
|
92
|
-
unbindScrollListener = _useEventListener2[1];
|
|
93
|
-
var _DeferredContentBase$ = DeferredContentBase.setMetaData({
|
|
94
|
-
props: props,
|
|
95
|
-
state: {
|
|
96
|
-
loaded: loadedState
|
|
97
|
-
}
|
|
98
|
-
}),
|
|
99
|
-
ptm = _DeferredContentBase$.ptm;
|
|
100
|
-
var shouldLoad = function shouldLoad() {
|
|
101
|
-
if (loadedState) {
|
|
102
|
-
return false;
|
|
103
|
-
} else {
|
|
104
|
-
var rect = elementRef.current.getBoundingClientRect();
|
|
105
|
-
var winHeight = document.documentElement.clientHeight;
|
|
106
|
-
return winHeight >= rect.top;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
var load = function load(event) {
|
|
110
|
-
setLoadedState(true);
|
|
111
|
-
props.onLoad && props.onLoad(event);
|
|
112
|
-
};
|
|
113
|
-
React.useImperativeHandle(ref, function () {
|
|
114
|
-
return {
|
|
115
|
-
props: props,
|
|
116
|
-
getElement: function getElement() {
|
|
117
|
-
return elementRef.current;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
});
|
|
121
|
-
useMountEffect(function () {
|
|
122
|
-
if (!loadedState) {
|
|
123
|
-
shouldLoad() ? load() : bindScrollListener();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
var rootProps = mergeProps({
|
|
127
|
-
ref: elementRef
|
|
128
|
-
}, DeferredContentBase.getOtherProps(props), ptm('root'));
|
|
129
|
-
return /*#__PURE__*/React.createElement("div", rootProps, loadedState && props.children);
|
|
130
|
-
});
|
|
131
|
-
DeferredContent.displayName = 'DeferredContent';
|
|
132
|
-
|
|
133
|
-
export { DeferredContent };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"react";import{useEventListener as r,useMountEffect as e}from"primereact/hooks";import{ComponentBase as n}from"primereact/componentbase";import{mergeProps as o}from"primereact/utils";import{PrimeReactContext as i}from"primereact/api";function a(t){if(Array.isArray(t))return t}function u(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;l=!1}else for(;!(l=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function l(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function c(t,r){if(t){if("string"==typeof t)return l(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?l(t,r):void 0}}function f(){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 m(t,r){return a(t)||u(t,r)||c(t,r)||f()}var p=n.extend({defaultProps:{__TYPE:"DeferredContent",onload:null,children:void 0}}),s=t.forwardRef((function(n,a){var u=t.useContext(i),l=p.getProps(n,u),c=m(t.useState(!1),2),f=c[0],s=c[1],d=t.useRef(null),y=m(r({target:"window",type:"scroll",listener:function(){b()&&(w(),h())}}),2),v=y[0],h=y[1],g=p.setMetaData({props:l,state:{loaded:f}}).ptm,b=function(){if(f)return!1;var t=d.current.getBoundingClientRect();return document.documentElement.clientHeight>=t.top},w=function(t){s(!0),l.onLoad&&l.onLoad(t)};t.useImperativeHandle(a,(function(){return{props:l,getElement:function(){return d.current}}})),e((function(){f||(b()?w():v())}));var A=o({ref:d},p.getOtherProps(l),g("root"));return t.createElement("div",A,f&&l.children)}));s.displayName="DeferredContent";export{s as DeferredContent};
|