primereact 9.1.1 → 9.2.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/api/api.cjs.js +16 -0
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +2 -2
- package/api/api.esm.js +16 -0
- package/api/api.esm.min.js +1 -1
- package/api/api.js +16 -0
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +1 -0
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +1 -0
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +1 -0
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +2 -2
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +2 -2
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +2 -2
- package/avatar/avatar.min.js +1 -1
- package/button/button.cjs.js +6 -1
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +2 -2
- package/button/button.esm.js +6 -1
- package/button/button.esm.min.js +1 -1
- package/button/button.js +6 -1
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +2 -2
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +2 -2
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +2 -2
- package/calendar/calendar.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +61 -18
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +9 -0
- package/contextmenu/contextmenu.esm.js +63 -20
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +61 -18
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +254 -129
- package/core/core.min.js +9 -9
- package/datatable/datatable.cjs.js +90 -82
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +2 -11
- package/datatable/datatable.esm.js +91 -83
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +90 -82
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.d.ts +1 -1
- package/dropdown/dropdown.cjs.js +1 -0
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +1 -0
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +1 -0
- package/dropdown/dropdown.min.js +1 -1
- package/hooks/hooks.cjs.js +34 -2
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +17 -3
- package/hooks/hooks.esm.js +34 -3
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +34 -2
- package/hooks/hooks.min.js +1 -1
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputtext/inputtext.min.css +1 -1
- package/listbox/listbox.cjs.js +5 -4
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +5 -4
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +5 -4
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +94 -6
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +9 -0
- package/megamenu/megamenu.esm.js +96 -8
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +94 -6
- package/megamenu/megamenu.min.css +1 -1
- package/megamenu/megamenu.min.js +1 -1
- package/multiselect/multiselect.cjs.js +3 -1
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +27 -1
- package/multiselect/multiselect.esm.js +3 -1
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +3 -1
- package/multiselect/multiselect.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +0 -8
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +0 -8
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +0 -8
- package/paginator/paginator.min.js +1 -1
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +609 -265
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +609 -266
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +609 -265
- package/primereact.all.min.js +1 -1
- package/resources/primereact.css +638 -688
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +134 -6
- package/resources/themes/arya-green/theme.css +134 -6
- package/resources/themes/arya-orange/theme.css +134 -6
- package/resources/themes/arya-purple/theme.css +134 -6
- package/resources/themes/bootstrap4-dark-blue/theme.css +137 -8
- package/resources/themes/bootstrap4-dark-purple/theme.css +137 -8
- package/resources/themes/bootstrap4-light-blue/theme.css +137 -8
- package/resources/themes/bootstrap4-light-purple/theme.css +137 -8
- package/resources/themes/fluent-light/theme.css +133 -4
- package/resources/themes/lara-dark-blue/theme.css +135 -6
- package/resources/themes/lara-dark-indigo/theme.css +135 -6
- package/resources/themes/lara-dark-purple/theme.css +135 -6
- package/resources/themes/lara-dark-teal/theme.css +135 -6
- package/resources/themes/lara-light-blue/theme.css +137 -8
- package/resources/themes/lara-light-indigo/theme.css +137 -8
- package/resources/themes/lara-light-purple/theme.css +137 -8
- package/resources/themes/lara-light-teal/theme.css +137 -8
- package/resources/themes/luna-amber/theme.css +137 -8
- package/resources/themes/luna-blue/theme.css +137 -8
- package/resources/themes/luna-green/theme.css +137 -8
- package/resources/themes/luna-pink/theme.css +137 -8
- package/resources/themes/md-dark-deeppurple/theme.css +137 -8
- package/resources/themes/md-dark-indigo/theme.css +137 -8
- package/resources/themes/md-light-deeppurple/theme.css +137 -8
- package/resources/themes/md-light-indigo/theme.css +137 -8
- package/resources/themes/mdc-dark-deeppurple/theme.css +137 -8
- package/resources/themes/mdc-dark-indigo/theme.css +137 -8
- package/resources/themes/mdc-light-deeppurple/theme.css +137 -8
- package/resources/themes/mdc-light-indigo/theme.css +137 -8
- package/resources/themes/mira/theme.css +137 -8
- package/resources/themes/nano/theme.css +137 -8
- package/resources/themes/nova/theme.css +137 -8
- package/resources/themes/nova-accent/theme.css +137 -8
- package/resources/themes/nova-alt/theme.css +137 -8
- package/resources/themes/rhea/theme.css +137 -8
- package/resources/themes/saga-blue/theme.css +135 -6
- package/resources/themes/saga-green/theme.css +135 -6
- package/resources/themes/saga-orange/theme.css +135 -6
- package/resources/themes/saga-purple/theme.css +135 -6
- package/resources/themes/soho-dark/theme.css +137 -8
- package/resources/themes/soho-light/theme.css +137 -8
- package/resources/themes/tailwind-light/theme.css +137 -8
- package/resources/themes/vela-blue/theme.css +135 -6
- package/resources/themes/vela-green/theme.css +135 -6
- package/resources/themes/vela-orange/theme.css +135 -6
- package/resources/themes/vela-purple/theme.css +135 -6
- package/resources/themes/viva-dark/theme.css +137 -8
- package/resources/themes/viva-light/theme.css +137 -8
- package/splitbutton/splitbutton.cjs.js +57 -3
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +28 -0
- package/splitbutton/splitbutton.esm.js +57 -3
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +57 -3
- package/splitbutton/splitbutton.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +69 -9
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +9 -0
- package/tieredmenu/tieredmenu.esm.js +71 -11
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +69 -9
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.cjs.js +16 -0
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +16 -0
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +16 -0
- package/toast/toast.min.css +1 -1
- package/toast/toast.min.js +1 -1
- package/tooltip/tooltip.cjs.js +5 -4
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +5 -4
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +5 -4
- package/tooltip/tooltip.min.js +1 -1
- package/treetable/treetable.cjs.js +12 -9
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +0 -5
- package/treetable/treetable.esm.js +12 -9
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +12 -9
- package/treetable/treetable.min.css +1 -1
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +15 -10
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +15 -10
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +15 -10
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +177 -104
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.d.ts +20 -0
- package/virtualscroller/virtualscroller.esm.js +177 -104
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +177 -104
- package/virtualscroller/virtualscroller.min.css +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +2 -2
package/primereact.all.esm.js
CHANGED
|
@@ -266,7 +266,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
266
266
|
key: "getOuterWidth",
|
|
267
267
|
value: function getOuterWidth(el, margin) {
|
|
268
268
|
if (el) {
|
|
269
|
-
var width = el.
|
|
269
|
+
var width = el.getBoundingClientRect().width || el.offsetWidth;
|
|
270
270
|
if (margin) {
|
|
271
271
|
var style = getComputedStyle(el);
|
|
272
272
|
width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
@@ -279,7 +279,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
279
279
|
key: "getOuterHeight",
|
|
280
280
|
value: function getOuterHeight(el, margin) {
|
|
281
281
|
if (el) {
|
|
282
|
-
var height = el.
|
|
282
|
+
var height = el.getBoundingClientRect().height || el.offsetHeight;
|
|
283
283
|
if (margin) {
|
|
284
284
|
var style = getComputedStyle(el);
|
|
285
285
|
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
@@ -463,7 +463,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
463
463
|
}, {
|
|
464
464
|
key: "absolutePosition",
|
|
465
465
|
value: function absolutePosition(element, target) {
|
|
466
|
-
if (element) {
|
|
466
|
+
if (element && target) {
|
|
467
467
|
var elementDimensions = element.offsetParent ? {
|
|
468
468
|
width: element.offsetWidth,
|
|
469
469
|
height: element.offsetHeight
|
|
@@ -495,7 +495,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
495
495
|
}, {
|
|
496
496
|
key: "relativePosition",
|
|
497
497
|
value: function relativePosition(element, target) {
|
|
498
|
-
if (element) {
|
|
498
|
+
if (element && target) {
|
|
499
499
|
var elementDimensions = element.offsetParent ? {
|
|
500
500
|
width: element.offsetWidth,
|
|
501
501
|
height: element.offsetHeight
|
|
@@ -725,7 +725,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
725
725
|
_iterator2.f();
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
if (parent.nodeType
|
|
728
|
+
if (parent.nodeType === 1 && overflowCheck(parent)) {
|
|
729
729
|
scrollableParents.push(parent);
|
|
730
730
|
}
|
|
731
731
|
}
|
|
@@ -1930,12 +1930,17 @@ var ObjectUtils = /*#__PURE__*/function () {
|
|
|
1930
1930
|
key: "isValidChild",
|
|
1931
1931
|
value: function isValidChild(child, type, validTypes) {
|
|
1932
1932
|
/* eslint-disable */
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1933
|
+
if (child) {
|
|
1934
|
+
var childType = this.getComponentProp(child, '__TYPE') || (child.type ? child.type.displayName : undefined);
|
|
1935
|
+
var isValid = childType === type;
|
|
1936
|
+
try {
|
|
1937
|
+
var messageTypes; if ("production" !== 'production' && !isValid) ;
|
|
1938
|
+
} catch (error) {
|
|
1939
|
+
// NOOP
|
|
1940
|
+
}
|
|
1941
|
+
return isValid;
|
|
1937
1942
|
}
|
|
1938
|
-
return
|
|
1943
|
+
return false;
|
|
1939
1944
|
/* eslint-enable */
|
|
1940
1945
|
}
|
|
1941
1946
|
}, {
|
|
@@ -2326,6 +2331,22 @@ _defineProperty(PrimeReact$1, "filterMatchModeOptions", {
|
|
|
2326
2331
|
numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],
|
|
2327
2332
|
date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]
|
|
2328
2333
|
});
|
|
2334
|
+
_defineProperty(PrimeReact$1, "changeTheme", function (currentTheme, newTheme, linkElementId, callback) {
|
|
2335
|
+
var _linkElement$parentNo;
|
|
2336
|
+
var linkElement = document.getElementById(linkElementId);
|
|
2337
|
+
var cloneLinkElement = linkElement.cloneNode(true);
|
|
2338
|
+
var newThemeUrl = linkElement.getAttribute('href').replace(currentTheme, newTheme);
|
|
2339
|
+
cloneLinkElement.setAttribute('id', linkElementId + '-clone');
|
|
2340
|
+
cloneLinkElement.setAttribute('href', newThemeUrl);
|
|
2341
|
+
cloneLinkElement.addEventListener('load', function () {
|
|
2342
|
+
linkElement.remove();
|
|
2343
|
+
cloneLinkElement.setAttribute('id', linkElementId);
|
|
2344
|
+
if (callback) {
|
|
2345
|
+
callback();
|
|
2346
|
+
}
|
|
2347
|
+
});
|
|
2348
|
+
(_linkElement$parentNo = linkElement.parentNode) === null || _linkElement$parentNo === void 0 ? void 0 : _linkElement$parentNo.insertBefore(cloneLinkElement, linkElement.nextSibling);
|
|
2349
|
+
});
|
|
2329
2350
|
|
|
2330
2351
|
function ownKeys$A(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2331
2352
|
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$A(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$A(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -2938,6 +2959,34 @@ var useInterval = function useInterval(fn) {
|
|
|
2938
2959
|
};
|
|
2939
2960
|
/* eslint-enable */
|
|
2940
2961
|
|
|
2962
|
+
var useMatchMedia = function useMatchMedia(query) {
|
|
2963
|
+
var when = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2964
|
+
var _React$useState = React.useState(false),
|
|
2965
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2966
|
+
matches = _React$useState2[0],
|
|
2967
|
+
setMatches = _React$useState2[1];
|
|
2968
|
+
var matchMedia = React.useRef(null);
|
|
2969
|
+
var handleChange = function handleChange(e) {
|
|
2970
|
+
return setMatches(e.matches);
|
|
2971
|
+
};
|
|
2972
|
+
var bind = function bind() {
|
|
2973
|
+
return matchMedia.current && matchMedia.current.addEventListener('change', handleChange);
|
|
2974
|
+
};
|
|
2975
|
+
var unbind = function unbind() {
|
|
2976
|
+
return matchMedia.current && matchMedia.current.removeEventListener('change', handleChange) && (matchMedia.current = null);
|
|
2977
|
+
};
|
|
2978
|
+
React.useEffect(function () {
|
|
2979
|
+
if (when) {
|
|
2980
|
+
matchMedia.current = window.matchMedia(query);
|
|
2981
|
+
setMatches(matchMedia.current.matches);
|
|
2982
|
+
bind();
|
|
2983
|
+
}
|
|
2984
|
+
return unbind;
|
|
2985
|
+
}, [query, when]);
|
|
2986
|
+
return matches;
|
|
2987
|
+
};
|
|
2988
|
+
/* eslint-enable */
|
|
2989
|
+
|
|
2941
2990
|
/* eslint-disable */
|
|
2942
2991
|
var useMountEffect = function useMountEffect(fn) {
|
|
2943
2992
|
return React.useEffect(fn, []);
|
|
@@ -3263,11 +3312,14 @@ var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
|
|
|
3263
3312
|
/* eslint-enable */
|
|
3264
3313
|
|
|
3265
3314
|
var useResizeListener = function useResizeListener(_ref) {
|
|
3266
|
-
var listener = _ref.listener
|
|
3315
|
+
var listener = _ref.listener,
|
|
3316
|
+
_ref$when = _ref.when,
|
|
3317
|
+
when = _ref$when === void 0 ? true : _ref$when;
|
|
3267
3318
|
return useEventListener({
|
|
3268
3319
|
target: 'window',
|
|
3269
3320
|
type: 'resize',
|
|
3270
|
-
listener: listener
|
|
3321
|
+
listener: listener,
|
|
3322
|
+
when: when
|
|
3271
3323
|
});
|
|
3272
3324
|
};
|
|
3273
3325
|
|
|
@@ -4200,10 +4252,10 @@ var Tooltip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
4200
4252
|
hideEvents = _getEvents.hideEvents;
|
|
4201
4253
|
var currentTarget = getTarget(target);
|
|
4202
4254
|
showEvents.forEach(function (event) {
|
|
4203
|
-
return currentTarget.addEventListener(event, show);
|
|
4255
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.addEventListener(event, show);
|
|
4204
4256
|
});
|
|
4205
4257
|
hideEvents.forEach(function (event) {
|
|
4206
|
-
return currentTarget.addEventListener(event, hide);
|
|
4258
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.addEventListener(event, hide);
|
|
4207
4259
|
});
|
|
4208
4260
|
}
|
|
4209
4261
|
};
|
|
@@ -4214,10 +4266,10 @@ var Tooltip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
4214
4266
|
hideEvents = _getEvents2.hideEvents;
|
|
4215
4267
|
var currentTarget = getTarget(target);
|
|
4216
4268
|
showEvents.forEach(function (event) {
|
|
4217
|
-
return currentTarget.removeEventListener(event, show);
|
|
4269
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.removeEventListener(event, show);
|
|
4218
4270
|
});
|
|
4219
4271
|
hideEvents.forEach(function (event) {
|
|
4220
|
-
return currentTarget.removeEventListener(event, hide);
|
|
4272
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.removeEventListener(event, hide);
|
|
4221
4273
|
});
|
|
4222
4274
|
}
|
|
4223
4275
|
};
|
|
@@ -4251,6 +4303,7 @@ var Tooltip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
4251
4303
|
if (isShowOnDisabled(target)) {
|
|
4252
4304
|
if (!target.hasWrapper) {
|
|
4253
4305
|
var wrapper = document.createElement('span');
|
|
4306
|
+
DomHandler.addClass(wrapper, 'p-tooltip-target-wrapper');
|
|
4254
4307
|
target.parentNode.insertBefore(wrapper, target);
|
|
4255
4308
|
wrapper.appendChild(target);
|
|
4256
4309
|
target.hasWrapper = true;
|
|
@@ -4473,6 +4526,11 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
|
|
|
4473
4526
|
var showTooltip = !disabled || props.tooltipOptions && props.tooltipOptions.showOnDisabled;
|
|
4474
4527
|
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip) && showTooltip;
|
|
4475
4528
|
var otherProps = ButtonBase.getOtherProps(props);
|
|
4529
|
+
var sizeMapping = {
|
|
4530
|
+
large: 'lg',
|
|
4531
|
+
small: 'sm'
|
|
4532
|
+
};
|
|
4533
|
+
var size = sizeMapping[props.size];
|
|
4476
4534
|
var className = classNames('p-button p-component', props.className, (_classNames2 = {
|
|
4477
4535
|
'p-button-icon-only': (props.icon || props.loading && props.loadingIcon) && !props.label && !props.children,
|
|
4478
4536
|
'p-button-vertical': (props.iconPos === 'top' || props.iconPos === 'bottom') && props.label,
|
|
@@ -4484,7 +4542,7 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
|
|
|
4484
4542
|
'p-button-text': props.text,
|
|
4485
4543
|
'p-button-rounded': props.rounded,
|
|
4486
4544
|
'p-button-loading-label-only': props.loading && !props.icon && props.label
|
|
4487
|
-
}, _defineProperty(_classNames2, "p-button-loading-".concat(props.iconPos), props.loading && props.loadingIcon && props.label), _defineProperty(_classNames2, "p-button-".concat(
|
|
4545
|
+
}, _defineProperty(_classNames2, "p-button-loading-".concat(props.iconPos), props.loading && props.loadingIcon && props.label), _defineProperty(_classNames2, "p-button-".concat(size), size), _defineProperty(_classNames2, "p-button-".concat(props.severity), props.severity), _classNames2));
|
|
4488
4546
|
var icon = createIcon();
|
|
4489
4547
|
var label = createLabel();
|
|
4490
4548
|
var badge = createBadge();
|
|
@@ -4716,14 +4774,18 @@ var VirtualScrollerBase = {
|
|
|
4716
4774
|
id: null,
|
|
4717
4775
|
style: null,
|
|
4718
4776
|
className: null,
|
|
4777
|
+
tabIndex: 0,
|
|
4719
4778
|
items: null,
|
|
4720
4779
|
itemSize: 0,
|
|
4721
4780
|
scrollHeight: null,
|
|
4722
4781
|
scrollWidth: null,
|
|
4723
4782
|
orientation: 'vertical',
|
|
4783
|
+
step: 0,
|
|
4724
4784
|
numToleratedItems: null,
|
|
4725
4785
|
delay: 0,
|
|
4726
4786
|
resizeDelay: 10,
|
|
4787
|
+
appendOnly: false,
|
|
4788
|
+
inline: false,
|
|
4727
4789
|
lazy: false,
|
|
4728
4790
|
disabled: false,
|
|
4729
4791
|
loaderDisabled: false,
|
|
@@ -4753,6 +4815,7 @@ function ownKeys$v(object, enumerableOnly) { var keys = Object.keys(object); if
|
|
|
4753
4815
|
function _objectSpread$v(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$v(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$v(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4754
4816
|
var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
4755
4817
|
var props = VirtualScrollerBase.getProps(inProps);
|
|
4818
|
+
var prevProps = usePrevious(inProps) || {};
|
|
4756
4819
|
var vertical = props.orientation === 'vertical';
|
|
4757
4820
|
var horizontal = props.orientation === 'horizontal';
|
|
4758
4821
|
var both = props.orientation === 'both';
|
|
@@ -4770,25 +4833,29 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
4770
4833
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
4771
4834
|
lastState = _React$useState4[0],
|
|
4772
4835
|
setLastState = _React$useState4[1];
|
|
4773
|
-
var _React$useState5 = React.useState(
|
|
4836
|
+
var _React$useState5 = React.useState(0),
|
|
4837
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
4838
|
+
pageState = _React$useState6[0],
|
|
4839
|
+
setPageState = _React$useState6[1];
|
|
4840
|
+
var _React$useState7 = React.useState(both ? {
|
|
4774
4841
|
rows: 0,
|
|
4775
4842
|
cols: 0
|
|
4776
4843
|
} : 0),
|
|
4777
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
4778
|
-
numItemsInViewportState = _React$useState6[0],
|
|
4779
|
-
setNumItemsInViewportState = _React$useState6[1];
|
|
4780
|
-
var _React$useState7 = React.useState(props.numToleratedItems),
|
|
4781
4844
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
var _React$useState9 = React.useState(props.
|
|
4845
|
+
numItemsInViewportState = _React$useState8[0],
|
|
4846
|
+
setNumItemsInViewportState = _React$useState8[1];
|
|
4847
|
+
var _React$useState9 = React.useState(props.numToleratedItems),
|
|
4785
4848
|
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
var _React$useState11 = React.useState(
|
|
4849
|
+
numToleratedItemsState = _React$useState10[0],
|
|
4850
|
+
setNumToleratedItemsState = _React$useState10[1];
|
|
4851
|
+
var _React$useState11 = React.useState(props.loading || false),
|
|
4789
4852
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
4790
|
-
|
|
4791
|
-
|
|
4853
|
+
loadingState = _React$useState12[0],
|
|
4854
|
+
setLoadingState = _React$useState12[1];
|
|
4855
|
+
var _React$useState13 = React.useState([]),
|
|
4856
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
4857
|
+
loaderArrState = _React$useState14[0],
|
|
4858
|
+
setLoaderArrState = _React$useState14[1];
|
|
4792
4859
|
var elementRef = React.useRef(null);
|
|
4793
4860
|
var _contentRef = React.useRef(null);
|
|
4794
4861
|
var _spacerRef = React.useRef(null);
|
|
@@ -4799,14 +4866,19 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
4799
4866
|
} : 0);
|
|
4800
4867
|
var scrollTimeout = React.useRef(null);
|
|
4801
4868
|
var resizeTimeout = React.useRef(null);
|
|
4869
|
+
var contentStyle = React.useRef({});
|
|
4870
|
+
var spacerStyle = React.useRef({});
|
|
4802
4871
|
var defaultWidth = React.useRef(null);
|
|
4803
4872
|
var defaultHeight = React.useRef(null);
|
|
4804
|
-
var
|
|
4805
|
-
var
|
|
4873
|
+
var defaultContentWidth = React.useRef(null);
|
|
4874
|
+
var defaultContentHeight = React.useRef(null);
|
|
4875
|
+
var isItemRangeChanged = React.useRef(false);
|
|
4876
|
+
var lazyLoadState = React.useRef(null);
|
|
4806
4877
|
var _useResizeListener = useResizeListener({
|
|
4807
4878
|
listener: function listener(event) {
|
|
4808
4879
|
return onResize();
|
|
4809
|
-
}
|
|
4880
|
+
},
|
|
4881
|
+
when: !props.disabled
|
|
4810
4882
|
}),
|
|
4811
4883
|
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
4812
4884
|
bindWindowResizeListener = _useResizeListener2[0];
|
|
@@ -4815,13 +4887,23 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
4815
4887
|
type: 'orientationchange',
|
|
4816
4888
|
listener: function listener(event) {
|
|
4817
4889
|
return onResize();
|
|
4818
|
-
}
|
|
4890
|
+
},
|
|
4891
|
+
when: !props.disabled
|
|
4819
4892
|
}),
|
|
4820
4893
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
4821
4894
|
bindOrientationChangeListener = _useEventListener2[0];
|
|
4822
4895
|
var getElementRef = function getElementRef() {
|
|
4823
4896
|
return elementRef;
|
|
4824
4897
|
};
|
|
4898
|
+
var getPageByFirst = function getPageByFirst(first) {
|
|
4899
|
+
return Math.floor((first + numToleratedItemsState * 4) / (props.step || 1));
|
|
4900
|
+
};
|
|
4901
|
+
var setContentElement = function setContentElement(element) {
|
|
4902
|
+
_contentRef.current = element || _contentRef.current || DomHandler.findSingle(elementRef.current, '.p-virtualscroller-content');
|
|
4903
|
+
};
|
|
4904
|
+
var isPageChanged = function isPageChanged(first) {
|
|
4905
|
+
return props.step ? pageState !== getPageByFirst(first) : true;
|
|
4906
|
+
};
|
|
4825
4907
|
var scrollTo = function scrollTo(options) {
|
|
4826
4908
|
lastScrollPos.current = both ? {
|
|
4827
4909
|
top: 0,
|
|
@@ -4833,13 +4915,14 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
4833
4915
|
var behavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'auto';
|
|
4834
4916
|
var _calculateNumItems = calculateNumItems(),
|
|
4835
4917
|
numToleratedItems = _calculateNumItems.numToleratedItems;
|
|
4918
|
+
var contentPos = getContentPosition();
|
|
4836
4919
|
var calculateFirst = function calculateFirst() {
|
|
4837
4920
|
var _index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
4838
4921
|
var _numT = arguments.length > 1 ? arguments[1] : undefined;
|
|
4839
4922
|
return _index <= _numT ? 0 : _index;
|
|
4840
4923
|
};
|
|
4841
|
-
var calculateCoord = function calculateCoord(_first, _size) {
|
|
4842
|
-
return _first * _size;
|
|
4924
|
+
var calculateCoord = function calculateCoord(_first, _size, _cpos) {
|
|
4925
|
+
return _first * _size + _cpos;
|
|
4843
4926
|
};
|
|
4844
4927
|
var scrollToItem = function scrollToItem() {
|
|
4845
4928
|
var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -4850,20 +4933,25 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
4850
4933
|
behavior: behavior
|
|
4851
4934
|
});
|
|
4852
4935
|
};
|
|
4936
|
+
var newFirst = both ? {
|
|
4937
|
+
rows: 0,
|
|
4938
|
+
cols: 0
|
|
4939
|
+
} : 0;
|
|
4940
|
+
var isRangeChanged = false;
|
|
4853
4941
|
if (both) {
|
|
4854
|
-
|
|
4942
|
+
newFirst = {
|
|
4855
4943
|
rows: calculateFirst(index[0], numToleratedItems[0]),
|
|
4856
4944
|
cols: calculateFirst(index[1], numToleratedItems[1])
|
|
4857
4945
|
};
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
}
|
|
4946
|
+
scrollToItem(calculateCoord(newFirst.cols, props.itemSize[1], contentPos.left), calculateCoord(newFirst.rows, props.itemSize[0], contentPos.top));
|
|
4947
|
+
isRangeChanged = firstState.rows !== newFirst.rows || firstState.cols !== newFirst.cols;
|
|
4861
4948
|
} else {
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
}
|
|
4949
|
+
newFirst = calculateFirst(index, numToleratedItems);
|
|
4950
|
+
horizontal ? scrollToItem(calculateCoord(newFirst, props.itemSize, contentPos.left), 0) : scrollToItem(0, calculateCoord(newFirst, props.itemSize, contentPos.top));
|
|
4951
|
+
isRangeChanged = firstState !== newFirst;
|
|
4866
4952
|
}
|
|
4953
|
+
isItemRangeChanged.current = isRangeChanged;
|
|
4954
|
+
setFirstState(newFirst);
|
|
4867
4955
|
};
|
|
4868
4956
|
var scrollInView = function scrollInView(index, to) {
|
|
4869
4957
|
var behavior = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'auto';
|
|
@@ -4980,7 +5068,8 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
4980
5068
|
var _calculateNumItems2 = calculateNumItems(),
|
|
4981
5069
|
numItemsInViewport = _calculateNumItems2.numItemsInViewport,
|
|
4982
5070
|
numToleratedItems = _calculateNumItems2.numToleratedItems;
|
|
4983
|
-
var calculateLast = function calculateLast(_first, _num, _numT
|
|
5071
|
+
var calculateLast = function calculateLast(_first, _num, _numT) {
|
|
5072
|
+
var _isCols = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
4984
5073
|
return getLast(_first + _num + (_first < _numT ? 2 : 3) * _numT, _isCols);
|
|
4985
5074
|
};
|
|
4986
5075
|
var last = both ? {
|
|
@@ -5002,9 +5091,15 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5002
5091
|
}));
|
|
5003
5092
|
}
|
|
5004
5093
|
if (props.lazy) {
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5094
|
+
Promise.resolve().then(function () {
|
|
5095
|
+
lazyLoadState.current = {
|
|
5096
|
+
first: props.step ? both ? {
|
|
5097
|
+
rows: 0,
|
|
5098
|
+
cols: firstState.cols
|
|
5099
|
+
} : 0 : firstState,
|
|
5100
|
+
last: Math.min(props.step ? props.step : last, props.items.length)
|
|
5101
|
+
};
|
|
5102
|
+
props.onLazyLoad && props.onLazyLoad(lazyLoadState.current);
|
|
5008
5103
|
});
|
|
5009
5104
|
}
|
|
5010
5105
|
};
|
|
@@ -5013,12 +5108,21 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5013
5108
|
Promise.resolve().then(function () {
|
|
5014
5109
|
if (_contentRef.current) {
|
|
5015
5110
|
_contentRef.current.style.minHeight = _contentRef.current.style.minWidth = 'auto';
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5111
|
+
_contentRef.current.style.position = 'relative';
|
|
5112
|
+
elementRef.current.style.contain = 'none';
|
|
5113
|
+
|
|
5114
|
+
/*const [contentWidth, contentHeight] = [DomHandler.getWidth(contentRef.current), DomHandler.getHeight(contentRef.current)];
|
|
5115
|
+
contentWidth !== defaultContentWidth.current && (elementRef.current.style.width = '');
|
|
5116
|
+
contentHeight !== defaultContentHeight.current && (elementRef.current.style.height = '');*/
|
|
5117
|
+
|
|
5118
|
+
var _ref = [DomHandler.getWidth(elementRef.current), DomHandler.getHeight(elementRef.current)],
|
|
5119
|
+
width = _ref[0],
|
|
5120
|
+
height = _ref[1];
|
|
5121
|
+
(both || horizontal) && (elementRef.current.style.width = (width < defaultWidth.current ? width : props.scrollWidth || defaultWidth.current) + 'px');
|
|
5122
|
+
(both || vertical) && (elementRef.current.style.height = (height < defaultHeight.current ? height : props.scrollHeight || defaultHeight.current) + 'px');
|
|
5021
5123
|
_contentRef.current.style.minHeight = _contentRef.current.style.minWidth = '';
|
|
5124
|
+
_contentRef.current.style.position = '';
|
|
5125
|
+
elementRef.current.style.contain = '';
|
|
5022
5126
|
}
|
|
5023
5127
|
});
|
|
5024
5128
|
}
|
|
@@ -5031,10 +5135,10 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5031
5135
|
var getContentPosition = function getContentPosition() {
|
|
5032
5136
|
if (_contentRef.current) {
|
|
5033
5137
|
var style = getComputedStyle(_contentRef.current);
|
|
5034
|
-
var left =
|
|
5035
|
-
var right =
|
|
5036
|
-
var top =
|
|
5037
|
-
var bottom =
|
|
5138
|
+
var left = parseFloat(style.paddingLeft) + Math.max(parseFloat(style.left) || 0, 0);
|
|
5139
|
+
var right = parseFloat(style.paddingRight) + Math.max(parseFloat(style.right) || 0, 0);
|
|
5140
|
+
var top = parseFloat(style.paddingTop) + Math.max(parseFloat(style.top) || 0, 0);
|
|
5141
|
+
var bottom = parseFloat(style.paddingBottom) + Math.max(parseFloat(style.bottom) || 0, 0);
|
|
5038
5142
|
return {
|
|
5039
5143
|
left: left,
|
|
5040
5144
|
right: right,
|
|
@@ -5071,11 +5175,11 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5071
5175
|
};
|
|
5072
5176
|
var setSpacerSize = function setSpacerSize() {
|
|
5073
5177
|
var items = props.items;
|
|
5074
|
-
if (
|
|
5178
|
+
if (items) {
|
|
5075
5179
|
var contentPos = getContentPosition();
|
|
5076
5180
|
var setProp = function setProp(_name, _value, _size) {
|
|
5077
5181
|
var _cpos = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5078
|
-
return
|
|
5182
|
+
return spacerStyle.current = _objectSpread$v(_objectSpread$v({}, spacerStyle.current), _defineProperty({}, "".concat(_name), (_value || []).length * _size + _cpos + 'px'));
|
|
5079
5183
|
};
|
|
5080
5184
|
if (both) {
|
|
5081
5185
|
setProp('height', items, props.itemSize[0], contentPos.y);
|
|
@@ -5086,7 +5190,7 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5086
5190
|
}
|
|
5087
5191
|
};
|
|
5088
5192
|
var setContentPosition = function setContentPosition(pos) {
|
|
5089
|
-
if (_contentRef.current) {
|
|
5193
|
+
if (_contentRef.current && !props.appendOnly) {
|
|
5090
5194
|
var first = pos ? pos.first : firstState;
|
|
5091
5195
|
var calculateTranslateVal = function calculateTranslateVal(_first, _size) {
|
|
5092
5196
|
return _first * _size;
|
|
@@ -5095,7 +5199,9 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5095
5199
|
var _x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
5096
5200
|
var _y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
5097
5201
|
_stickyRef.current && (_stickyRef.current.style.top = "-".concat(_y, "px"));
|
|
5098
|
-
|
|
5202
|
+
contentStyle.current = _objectSpread$v(_objectSpread$v({}, contentStyle.current), {
|
|
5203
|
+
transform: "translate3d(".concat(_x, "px, ").concat(_y, "px, 0)")
|
|
5204
|
+
});
|
|
5099
5205
|
};
|
|
5100
5206
|
if (both) {
|
|
5101
5207
|
setTransform(calculateTranslateVal(first.cols, props.itemSize[1]), calculateTranslateVal(first.rows, props.itemSize[0]));
|
|
@@ -5139,36 +5245,40 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5139
5245
|
if (both) {
|
|
5140
5246
|
var isScrollDown = lastScrollPos.current.top <= scrollTop;
|
|
5141
5247
|
var isScrollRight = lastScrollPos.current.left <= scrollLeft;
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5248
|
+
if (!props.appendOnly || props.appendOnly && (isScrollDown || isScrollRight)) {
|
|
5249
|
+
var currentIndex = {
|
|
5250
|
+
rows: calculateCurrentIndex(scrollTop, props.itemSize[0]),
|
|
5251
|
+
cols: calculateCurrentIndex(scrollLeft, props.itemSize[1])
|
|
5252
|
+
};
|
|
5253
|
+
var triggerIndex = {
|
|
5254
|
+
rows: calculateTriggerIndex(currentIndex.rows, firstState.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0], isScrollDown),
|
|
5255
|
+
cols: calculateTriggerIndex(currentIndex.cols, firstState.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], isScrollRight)
|
|
5256
|
+
};
|
|
5257
|
+
newFirst = {
|
|
5258
|
+
rows: calculateFirst(currentIndex.rows, triggerIndex.rows, firstState.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0], isScrollDown),
|
|
5259
|
+
cols: calculateFirst(currentIndex.cols, triggerIndex.cols, firstState.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], isScrollRight)
|
|
5260
|
+
};
|
|
5261
|
+
newLast = {
|
|
5262
|
+
rows: calculateLast(currentIndex.rows, newFirst.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0]),
|
|
5263
|
+
cols: calculateLast(currentIndex.cols, newFirst.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], true)
|
|
5264
|
+
};
|
|
5265
|
+
isRangeChanged = newFirst.rows !== firstState.rows || newLast.rows !== lastState.rows || newFirst.cols !== firstState.cols || newLast.cols !== lastState.cols || isItemRangeChanged.current;
|
|
5266
|
+
newScrollPos = {
|
|
5267
|
+
top: scrollTop,
|
|
5268
|
+
left: scrollLeft
|
|
5269
|
+
};
|
|
5270
|
+
}
|
|
5163
5271
|
} else {
|
|
5164
5272
|
var scrollPos = horizontal ? scrollLeft : scrollTop;
|
|
5165
5273
|
var isScrollDownOrRight = lastScrollPos.current <= scrollPos;
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5274
|
+
if (!props.appendOnly || props.appendOnly && isScrollDownOrRight) {
|
|
5275
|
+
var _currentIndex2 = calculateCurrentIndex(scrollPos, props.itemSize);
|
|
5276
|
+
var _triggerIndex2 = calculateTriggerIndex(_currentIndex2, firstState, lastState, numItemsInViewportState, numToleratedItemsState, isScrollDownOrRight);
|
|
5277
|
+
newFirst = calculateFirst(_currentIndex2, _triggerIndex2, firstState, lastState, numItemsInViewportState, numToleratedItemsState, isScrollDownOrRight);
|
|
5278
|
+
newLast = calculateLast(_currentIndex2, newFirst, lastState, numItemsInViewportState, numToleratedItemsState);
|
|
5279
|
+
isRangeChanged = newFirst !== firstState || newLast !== lastState || isItemRangeChanged.current;
|
|
5280
|
+
newScrollPos = scrollPos;
|
|
5281
|
+
}
|
|
5172
5282
|
}
|
|
5173
5283
|
return {
|
|
5174
5284
|
first: newFirst,
|
|
@@ -5193,8 +5303,14 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5193
5303
|
setLastState(last);
|
|
5194
5304
|
lastScrollPos.current = scrollPos;
|
|
5195
5305
|
props.onScrollIndexChange && props.onScrollIndexChange(newState);
|
|
5196
|
-
if (props.lazy) {
|
|
5197
|
-
|
|
5306
|
+
if (props.lazy && isPageChanged(first)) {
|
|
5307
|
+
var newLazyLoadState = {
|
|
5308
|
+
first: props.step ? Math.min(getPageByFirst(first) * props.step, props.items.length - props.step) : first,
|
|
5309
|
+
last: Math.min(props.step ? (getPageByFirst(first) + 1) * props.step : last, props.items.length)
|
|
5310
|
+
};
|
|
5311
|
+
var isLazyStateChanged = !lazyLoadState.current || lazyLoadState.current.first !== newLazyLoadState.first || lazyLoadState.current.last !== newLazyLoadState.last;
|
|
5312
|
+
isLazyStateChanged && props.onLazyLoad && props.onLazyLoad(newLazyLoadState);
|
|
5313
|
+
lazyLoadState.current = newLazyLoadState;
|
|
5198
5314
|
}
|
|
5199
5315
|
}
|
|
5200
5316
|
};
|
|
@@ -5204,17 +5320,21 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5204
5320
|
if (scrollTimeout.current) {
|
|
5205
5321
|
clearTimeout(scrollTimeout.current);
|
|
5206
5322
|
}
|
|
5207
|
-
if (
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5323
|
+
if (isPageChanged(firstState)) {
|
|
5324
|
+
if (!loadingState && props.showLoader) {
|
|
5325
|
+
var _onScrollPositionChan2 = onScrollPositionChange(event),
|
|
5326
|
+
isRangeChanged = _onScrollPositionChan2.isRangeChanged;
|
|
5327
|
+
var changed = isRangeChanged || (props.step ? isPageChanged(firstState) : false);
|
|
5328
|
+
changed && setLoadingState(true);
|
|
5329
|
+
}
|
|
5330
|
+
scrollTimeout.current = setTimeout(function () {
|
|
5331
|
+
onScrollChange(event);
|
|
5332
|
+
if (loadingState && props.showLoader && (!props.lazy || props.loading === undefined)) {
|
|
5333
|
+
setLoadingState(false);
|
|
5334
|
+
setPageState(getPageByFirst(firstState));
|
|
5335
|
+
}
|
|
5336
|
+
}, props.delay);
|
|
5211
5337
|
}
|
|
5212
|
-
scrollTimeout.current = setTimeout(function () {
|
|
5213
|
-
onScrollChange(event);
|
|
5214
|
-
if (loadingState && props.showLoader && (!props.lazy || props.loading === undefined)) {
|
|
5215
|
-
setLoadingState(false);
|
|
5216
|
-
}
|
|
5217
|
-
}, props.delay);
|
|
5218
5338
|
} else {
|
|
5219
5339
|
onScrollChange(event);
|
|
5220
5340
|
}
|
|
@@ -5225,9 +5345,9 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5225
5345
|
}
|
|
5226
5346
|
resizeTimeout.current = setTimeout(function () {
|
|
5227
5347
|
if (elementRef.current) {
|
|
5228
|
-
var
|
|
5229
|
-
width =
|
|
5230
|
-
height =
|
|
5348
|
+
var _ref2 = [DomHandler.getWidth(elementRef.current), DomHandler.getHeight(elementRef.current)],
|
|
5349
|
+
width = _ref2[0],
|
|
5350
|
+
height = _ref2[1];
|
|
5231
5351
|
var isDiffWidth = width !== defaultWidth.current,
|
|
5232
5352
|
isDiffHeight = height !== defaultHeight.current;
|
|
5233
5353
|
var reinit = both ? isDiffWidth || isDiffHeight : horizontal ? isDiffWidth : vertical ? isDiffHeight : false;
|
|
@@ -5235,6 +5355,8 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5235
5355
|
setNumToleratedItemsState(props.numToleratedItems);
|
|
5236
5356
|
defaultWidth.current = width;
|
|
5237
5357
|
defaultHeight.current = height;
|
|
5358
|
+
defaultContentWidth.current = DomHandler.getWidth(_contentRef.current);
|
|
5359
|
+
defaultContentHeight.current = DomHandler.getHeight(_contentRef.current);
|
|
5238
5360
|
}
|
|
5239
5361
|
}
|
|
5240
5362
|
}, props.resizeDelay);
|
|
@@ -5267,12 +5389,24 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5267
5389
|
var loadedItems = function loadedItems() {
|
|
5268
5390
|
var items = props.items;
|
|
5269
5391
|
if (items && !loadingState) {
|
|
5270
|
-
if (both) return items.slice(firstState.rows, lastState.rows).map(function (item) {
|
|
5271
|
-
return props.columns ? item : item.slice(firstState.cols, lastState.cols);
|
|
5272
|
-
});else if (horizontal && props.columns) return items;else return items.slice(firstState, lastState);
|
|
5392
|
+
if (both) return items.slice(props.appendOnly ? 0 : firstState.rows, lastState.rows).map(function (item) {
|
|
5393
|
+
return props.columns ? item : item.slice(props.appendOnly ? 0 : firstState.cols, lastState.cols);
|
|
5394
|
+
});else if (horizontal && props.columns) return items;else return items.slice(props.appendOnly ? 0 : firstState, lastState);
|
|
5273
5395
|
}
|
|
5274
5396
|
return [];
|
|
5275
5397
|
};
|
|
5398
|
+
var viewInit = function viewInit() {
|
|
5399
|
+
if (elementRef.current && DomHandler.isVisible(elementRef.current)) {
|
|
5400
|
+
setContentElement(_contentRef.current);
|
|
5401
|
+
init();
|
|
5402
|
+
bindWindowResizeListener();
|
|
5403
|
+
bindOrientationChangeListener();
|
|
5404
|
+
defaultWidth.current = DomHandler.getWidth(elementRef.current);
|
|
5405
|
+
defaultHeight.current = DomHandler.getHeight(elementRef.current);
|
|
5406
|
+
defaultContentWidth.current = DomHandler.getWidth(_contentRef.current);
|
|
5407
|
+
defaultContentHeight.current = DomHandler.getHeight(_contentRef.current);
|
|
5408
|
+
}
|
|
5409
|
+
};
|
|
5276
5410
|
var init = function init() {
|
|
5277
5411
|
if (!props.disabled) {
|
|
5278
5412
|
setSize();
|
|
@@ -5281,17 +5415,11 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5281
5415
|
}
|
|
5282
5416
|
};
|
|
5283
5417
|
useMountEffect(function () {
|
|
5284
|
-
|
|
5285
|
-
init();
|
|
5286
|
-
bindWindowResizeListener();
|
|
5287
|
-
bindOrientationChangeListener();
|
|
5288
|
-
defaultWidth.current = DomHandler.getWidth(elementRef.current);
|
|
5289
|
-
defaultHeight.current = DomHandler.getHeight(elementRef.current);
|
|
5290
|
-
}
|
|
5418
|
+
viewInit();
|
|
5291
5419
|
});
|
|
5292
5420
|
useUpdateEffect(function () {
|
|
5293
5421
|
init();
|
|
5294
|
-
}, [props.itemSize, props.scrollHeight]);
|
|
5422
|
+
}, [props.itemSize, props.scrollHeight, props.scrollWidth]);
|
|
5295
5423
|
useUpdateEffect(function () {
|
|
5296
5424
|
if (props.numToleratedItems !== numToleratedItemsState) {
|
|
5297
5425
|
setNumToleratedItemsState(props.numToleratedItems);
|
|
@@ -5303,11 +5431,11 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5303
5431
|
}
|
|
5304
5432
|
}, [numToleratedItemsState]);
|
|
5305
5433
|
useUpdateEffect(function () {
|
|
5306
|
-
if (!
|
|
5434
|
+
if (!prevProps.items || prevProps.items.length !== (props.items || []).length) {
|
|
5307
5435
|
init();
|
|
5308
5436
|
}
|
|
5309
5437
|
var loading = loadingState;
|
|
5310
|
-
if (props.lazy &&
|
|
5438
|
+
if (props.lazy && prevProps.loading !== props.loading && props.loading !== loadingState) {
|
|
5311
5439
|
setLoadingState(props.loading);
|
|
5312
5440
|
loading = props.loading;
|
|
5313
5441
|
}
|
|
@@ -5369,6 +5497,7 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5369
5497
|
if (props.showSpacer) {
|
|
5370
5498
|
return /*#__PURE__*/React.createElement("div", {
|
|
5371
5499
|
ref: _spacerRef,
|
|
5500
|
+
style: spacerStyle.current,
|
|
5372
5501
|
className: "p-virtualscroller-spacer"
|
|
5373
5502
|
});
|
|
5374
5503
|
}
|
|
@@ -5392,11 +5521,14 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5392
5521
|
});
|
|
5393
5522
|
var content = /*#__PURE__*/React.createElement("div", {
|
|
5394
5523
|
ref: _contentRef,
|
|
5524
|
+
style: contentStyle.current,
|
|
5395
5525
|
className: className
|
|
5396
5526
|
}, items);
|
|
5397
5527
|
if (props.contentTemplate) {
|
|
5398
5528
|
var defaultOptions = {
|
|
5529
|
+
style: contentStyle.current,
|
|
5399
5530
|
className: className,
|
|
5531
|
+
spacerStyle: spacerStyle.current,
|
|
5400
5532
|
contentRef: function contentRef(el) {
|
|
5401
5533
|
return _contentRef.current = ObjectUtils.getRefElement(el);
|
|
5402
5534
|
},
|
|
@@ -5439,10 +5571,9 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5439
5571
|
} else {
|
|
5440
5572
|
var otherProps = VirtualScrollerBase.getOtherProps(props);
|
|
5441
5573
|
var className = classNames('p-virtualscroller', {
|
|
5442
|
-
'p-
|
|
5443
|
-
'p-virtualscroller-both': both,
|
|
5444
|
-
'p-virtualscroller-horizontal': horizontal
|
|
5445
|
-
'p-horizontal-scroll': horizontal
|
|
5574
|
+
'p-virtualscroller-inline': props.inline,
|
|
5575
|
+
'p-virtualscroller-both p-both-scroll': both,
|
|
5576
|
+
'p-virtualscroller-horizontal p-horizontal-scroll': horizontal
|
|
5446
5577
|
}, props.className);
|
|
5447
5578
|
var loader = createLoader();
|
|
5448
5579
|
var _content = createContent();
|
|
@@ -5450,7 +5581,7 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
5450
5581
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
5451
5582
|
ref: elementRef,
|
|
5452
5583
|
className: className,
|
|
5453
|
-
tabIndex:
|
|
5584
|
+
tabIndex: props.tabIndex,
|
|
5454
5585
|
style: props.style
|
|
5455
5586
|
}, otherProps, {
|
|
5456
5587
|
onScroll: onScroll
|
|
@@ -5546,6 +5677,7 @@ var AutoCompletePanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(f
|
|
|
5546
5677
|
var className = classNames('p-autocomplete-items', options.className);
|
|
5547
5678
|
return /*#__PURE__*/React.createElement("ul", {
|
|
5548
5679
|
ref: options.contentRef,
|
|
5680
|
+
style: options.style,
|
|
5549
5681
|
className: className,
|
|
5550
5682
|
role: "listbox",
|
|
5551
5683
|
id: props.listId
|
|
@@ -6217,7 +6349,7 @@ var Avatar = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
6217
6349
|
imageFailed = _React$useState2[0],
|
|
6218
6350
|
setImageFailed = _React$useState2[1];
|
|
6219
6351
|
var createContent = function createContent() {
|
|
6220
|
-
if (props.image && !imageFailed) {
|
|
6352
|
+
if (ObjectUtils.isNotEmpty(props.image) && !imageFailed) {
|
|
6221
6353
|
return /*#__PURE__*/React.createElement("img", {
|
|
6222
6354
|
src: props.image,
|
|
6223
6355
|
alt: props.imageAlt,
|
|
@@ -6259,7 +6391,7 @@ var Avatar = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
6259
6391
|
});
|
|
6260
6392
|
var otherProps = AvatarBase.getOtherProps(props);
|
|
6261
6393
|
var containerClassName = classNames('p-avatar p-component', {
|
|
6262
|
-
'p-avatar-image': props.image
|
|
6394
|
+
'p-avatar-image': ObjectUtils.isNotEmpty(props.image) && !imageFailed,
|
|
6263
6395
|
'p-avatar-circle': props.shape === 'circle',
|
|
6264
6396
|
'p-avatar-lg': props.size === 'large',
|
|
6265
6397
|
'p-avatar-xl': props.size === 'xlarge',
|
|
@@ -8832,7 +8964,7 @@ var Calendar = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
8832
8964
|
setValue(props.value);
|
|
8833
8965
|
}
|
|
8834
8966
|
return function () {
|
|
8835
|
-
props.mask && unbindMaskEvents();
|
|
8967
|
+
props.mask && unbindMaskEvents && unbindMaskEvents();
|
|
8836
8968
|
};
|
|
8837
8969
|
});
|
|
8838
8970
|
useUpdateEffect(function () {
|
|
@@ -9056,7 +9188,7 @@ var Calendar = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
9056
9188
|
}
|
|
9057
9189
|
return _content2;
|
|
9058
9190
|
}
|
|
9059
|
-
var displayYear = props.
|
|
9191
|
+
var displayYear = props.numberOfMonths > 1 ? metaYear : currentYear;
|
|
9060
9192
|
return currentView !== 'year' && /*#__PURE__*/React.createElement("button", {
|
|
9061
9193
|
className: "p-datepicker-year p-link",
|
|
9062
9194
|
onClick: switchToYearView,
|
|
@@ -13140,6 +13272,8 @@ var ContextMenuBase = {
|
|
|
13140
13272
|
global: false,
|
|
13141
13273
|
autoZIndex: true,
|
|
13142
13274
|
baseZIndex: 0,
|
|
13275
|
+
breakpoint: undefined,
|
|
13276
|
+
scrollHeight: '400px',
|
|
13143
13277
|
appendTo: null,
|
|
13144
13278
|
transitionOptions: null,
|
|
13145
13279
|
onShow: null,
|
|
@@ -13165,7 +13299,7 @@ var ContextMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
13165
13299
|
setActiveItemState(null);
|
|
13166
13300
|
}
|
|
13167
13301
|
var onItemMouseEnter = function onItemMouseEnter(event, item) {
|
|
13168
|
-
if (item.disabled) {
|
|
13302
|
+
if (item.disabled || props.isMobileMode) {
|
|
13169
13303
|
event.preventDefault();
|
|
13170
13304
|
return;
|
|
13171
13305
|
}
|
|
@@ -13185,26 +13319,31 @@ var ContextMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
13185
13319
|
item: item
|
|
13186
13320
|
});
|
|
13187
13321
|
}
|
|
13322
|
+
if (props.isMobileMode && item.items) {
|
|
13323
|
+
if (activeItemState && item === activeItemState) setActiveItemState(null);else setActiveItemState(item);
|
|
13324
|
+
}
|
|
13188
13325
|
if (!item.items) {
|
|
13189
13326
|
props.onLeafClick(event);
|
|
13190
13327
|
}
|
|
13191
13328
|
};
|
|
13192
13329
|
var position = function position() {
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13330
|
+
if (!props.isMobileMode) {
|
|
13331
|
+
var parentItem = submenuRef.current.parentElement;
|
|
13332
|
+
var containerOffset = DomHandler.getOffset(parentItem);
|
|
13333
|
+
var viewport = DomHandler.getViewport();
|
|
13334
|
+
var sublistWidth = submenuRef.current.offsetParent ? submenuRef.current.offsetWidth : DomHandler.getHiddenElementOuterWidth(submenuRef.current);
|
|
13335
|
+
var itemOuterWidth = DomHandler.getOuterWidth(parentItem.children[0]);
|
|
13336
|
+
var top = parseInt(containerOffset.top, 10) + submenuRef.current.offsetHeight - DomHandler.getWindowScrollTop();
|
|
13337
|
+
if (top > viewport.height) {
|
|
13338
|
+
submenuRef.current.style.top = viewport.height - top + 'px';
|
|
13339
|
+
} else {
|
|
13340
|
+
submenuRef.current.style.top = '0px';
|
|
13341
|
+
}
|
|
13342
|
+
if (parseInt(containerOffset.left, 10) + itemOuterWidth + sublistWidth > viewport.width - DomHandler.calculateScrollbarWidth()) {
|
|
13343
|
+
submenuRef.current.style.left = -1 * sublistWidth + 'px';
|
|
13344
|
+
} else {
|
|
13345
|
+
submenuRef.current.style.left = itemOuterWidth + 'px';
|
|
13346
|
+
}
|
|
13208
13347
|
}
|
|
13209
13348
|
};
|
|
13210
13349
|
var onEnter = function onEnter() {
|
|
@@ -13226,7 +13365,8 @@ var ContextMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
13226
13365
|
menuProps: props.menuProps,
|
|
13227
13366
|
model: item.items,
|
|
13228
13367
|
resetMenu: item !== activeItemState,
|
|
13229
|
-
onLeafClick: props.onLeafClick
|
|
13368
|
+
onLeafClick: props.onLeafClick,
|
|
13369
|
+
isMobileMode: props.isMobileMode
|
|
13230
13370
|
});
|
|
13231
13371
|
}
|
|
13232
13372
|
return null;
|
|
@@ -13335,8 +13475,14 @@ var ContextMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
13335
13475
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
13336
13476
|
resetMenuState = _React$useState6[0],
|
|
13337
13477
|
setResetMenuState = _React$useState6[1];
|
|
13478
|
+
var _React$useState7 = React.useState(null),
|
|
13479
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
13480
|
+
attributeSelectorState = _React$useState8[0],
|
|
13481
|
+
setAttributeSelectorState = _React$useState8[1];
|
|
13338
13482
|
var menuRef = React.useRef(null);
|
|
13339
13483
|
var currentEvent = React.useRef(null);
|
|
13484
|
+
var styleElementRef = React.useRef(null);
|
|
13485
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
13340
13486
|
var _useEventListener = useEventListener({
|
|
13341
13487
|
type: 'click',
|
|
13342
13488
|
listener: function listener(event) {
|
|
@@ -13367,6 +13513,17 @@ var ContextMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
13367
13513
|
_useResizeListener2 = _slicedToArray(_useResizeListener, 2),
|
|
13368
13514
|
bindDocumentResizeListener = _useResizeListener2[0],
|
|
13369
13515
|
unbindDocumentResizeListener = _useResizeListener2[1];
|
|
13516
|
+
var createStyle = function createStyle() {
|
|
13517
|
+
if (!styleElementRef.current) {
|
|
13518
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
13519
|
+
var selector = "".concat(attributeSelectorState);
|
|
13520
|
+
var innerHTML = "\n@media screen and (max-width: ".concat(props.breakpoint, ") {\n .p-contextmenu[").concat(selector, "] > ul {\n max-height: ").concat(props.scrollHeight, ";\n overflow: ").concat(props.scrollHeight ? 'auto' : '', ";\n }\n\n .p-contextmenu[").concat(selector, "] .p-submenu-list {\n position: relative;\n }\n\n .p-contextmenu[").concat(selector, "] .p-menuitem-active > .p-submenu-list {\n left: 0 !important;\n box-shadow: none;\n border-radius: 0;\n padding: 0 0 0 calc(var(--inline-spacing) * 2); /* @todo */\n }\n\n .p-contextmenu[").concat(selector, "] .p-menuitem-active > .p-menuitem-link > .p-submenu-icon {\n transform: rotate(-180deg);\n }\n\n .p-contextmenu[").concat(selector, "] .p-submenu-icon:before {\n content: \"\\e930\";\n }\n}\n");
|
|
13521
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
13522
|
+
}
|
|
13523
|
+
};
|
|
13524
|
+
var destroyStyle = function destroyStyle() {
|
|
13525
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
13526
|
+
};
|
|
13370
13527
|
var onMenuClick = function onMenuClick() {
|
|
13371
13528
|
setResetMenuState(false);
|
|
13372
13529
|
};
|
|
@@ -13395,6 +13552,10 @@ var ContextMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
13395
13552
|
ZIndexUtils.set('menu', menuRef.current, PrimeReact.autoZIndex, props.baseZIndex || PrimeReact.zIndex['menu']);
|
|
13396
13553
|
}
|
|
13397
13554
|
position(currentEvent.current);
|
|
13555
|
+
if (attributeSelectorState && props.breakpoint) {
|
|
13556
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
13557
|
+
createStyle();
|
|
13558
|
+
}
|
|
13398
13559
|
};
|
|
13399
13560
|
var onEntered = function onEntered() {
|
|
13400
13561
|
bindDocumentListeners();
|
|
@@ -13405,6 +13566,7 @@ var ContextMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
13405
13566
|
};
|
|
13406
13567
|
var onExited = function onExited() {
|
|
13407
13568
|
ZIndexUtils.clear(menuRef.current);
|
|
13569
|
+
destroyStyle();
|
|
13408
13570
|
};
|
|
13409
13571
|
var position = function position(event) {
|
|
13410
13572
|
if (event) {
|
|
@@ -13457,7 +13619,19 @@ var ContextMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
13457
13619
|
if (props.global) {
|
|
13458
13620
|
bindDocumentContextMenuListener();
|
|
13459
13621
|
}
|
|
13622
|
+
if (props.breakpoint) {
|
|
13623
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
13624
|
+
}
|
|
13460
13625
|
});
|
|
13626
|
+
useUpdateEffect(function () {
|
|
13627
|
+
if (attributeSelectorState && menuRef.current) {
|
|
13628
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
13629
|
+
createStyle();
|
|
13630
|
+
}
|
|
13631
|
+
return function () {
|
|
13632
|
+
destroyStyle();
|
|
13633
|
+
};
|
|
13634
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
13461
13635
|
useUpdateEffect(function () {
|
|
13462
13636
|
if (visibleState) {
|
|
13463
13637
|
setVisibleState(false);
|
|
@@ -13513,7 +13687,8 @@ var ContextMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
13513
13687
|
model: props.model,
|
|
13514
13688
|
root: true,
|
|
13515
13689
|
resetMenu: resetMenuState,
|
|
13516
|
-
onLeafClick: onLeafClick
|
|
13690
|
+
onLeafClick: onLeafClick,
|
|
13691
|
+
isMobileMode: isMobileMode
|
|
13517
13692
|
})));
|
|
13518
13693
|
};
|
|
13519
13694
|
var element = createContextMenu();
|
|
@@ -15474,6 +15649,7 @@ var DropdownPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(funct
|
|
|
15474
15649
|
var content = isEmptyFilter ? createEmptyMessage() : options.children;
|
|
15475
15650
|
return /*#__PURE__*/React.createElement("ul", {
|
|
15476
15651
|
ref: options.contentRef,
|
|
15652
|
+
style: options.style,
|
|
15477
15653
|
className: className,
|
|
15478
15654
|
role: "listbox"
|
|
15479
15655
|
}, content);
|
|
@@ -16291,7 +16467,6 @@ RowsPerPageDropdown.displayName = 'RowsPerPageDropdown';
|
|
|
16291
16467
|
var Paginator = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
16292
16468
|
var props = PaginatorBase.getProps(inProps);
|
|
16293
16469
|
var elementRef = React.useRef(null);
|
|
16294
|
-
var rppChanged = React.useRef(false);
|
|
16295
16470
|
var page = Math.floor(props.first / props.rows);
|
|
16296
16471
|
var pageCount = Math.ceil(props.totalRecords / props.rows);
|
|
16297
16472
|
var isFirstPage = page === 0;
|
|
@@ -16356,7 +16531,6 @@ var Paginator = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
16356
16531
|
};
|
|
16357
16532
|
var onRowsChange = function onRowsChange(event) {
|
|
16358
16533
|
var rows = event.value;
|
|
16359
|
-
rppChanged.current = rows !== props.rows;
|
|
16360
16534
|
changePage(0, rows);
|
|
16361
16535
|
};
|
|
16362
16536
|
React.useImperativeHandle(ref, function () {
|
|
@@ -16367,12 +16541,6 @@ var Paginator = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
16367
16541
|
}
|
|
16368
16542
|
};
|
|
16369
16543
|
});
|
|
16370
|
-
useUpdateEffect(function () {
|
|
16371
|
-
if (!rppChanged.current) {
|
|
16372
|
-
changePage(props.first, props.rows);
|
|
16373
|
-
}
|
|
16374
|
-
rppChanged.current = false;
|
|
16375
|
-
}, [props.rows]);
|
|
16376
16544
|
useUpdateEffect(function () {
|
|
16377
16545
|
if (page > 0 && props.first >= props.totalRecords) {
|
|
16378
16546
|
changePage((pageCount - 1) * props.rows, props.rows);
|
|
@@ -16514,7 +16682,6 @@ var DataTableBase = {
|
|
|
16514
16682
|
defaultProps: {
|
|
16515
16683
|
__TYPE: 'DataTable',
|
|
16516
16684
|
alwaysShowPaginator: true,
|
|
16517
|
-
autoLayout: false,
|
|
16518
16685
|
breakpoint: '960px',
|
|
16519
16686
|
cellClassName: null,
|
|
16520
16687
|
cellSelection: false,
|
|
@@ -16606,7 +16773,7 @@ var DataTableBase = {
|
|
|
16606
16773
|
reorderableColumns: false,
|
|
16607
16774
|
reorderableRows: false,
|
|
16608
16775
|
resizableColumns: false,
|
|
16609
|
-
responsiveLayout: '
|
|
16776
|
+
responsiveLayout: 'scroll',
|
|
16610
16777
|
rowClassName: null,
|
|
16611
16778
|
rowEditValidator: null,
|
|
16612
16779
|
rowExpansionTemplate: null,
|
|
@@ -16616,7 +16783,6 @@ var DataTableBase = {
|
|
|
16616
16783
|
rowHover: false,
|
|
16617
16784
|
rows: null,
|
|
16618
16785
|
rowsPerPageOptions: null,
|
|
16619
|
-
scrollDirection: 'vertical',
|
|
16620
16786
|
scrollHeight: null,
|
|
16621
16787
|
scrollable: false,
|
|
16622
16788
|
selectAll: false,
|
|
@@ -17470,7 +17636,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17470
17636
|
return props.compareSelectionBy === 'equals' ? data1 === data2 : ObjectUtils.equals(data1, data2, props.dataKey);
|
|
17471
17637
|
};
|
|
17472
17638
|
var getTabIndex = function getTabIndex() {
|
|
17473
|
-
return isFocusable() && !props.allowCellSelection ? props.
|
|
17639
|
+
return isFocusable() && !props.allowCellSelection ? props.rowIndex === 0 ? props.tabIndex : -1 : null;
|
|
17474
17640
|
};
|
|
17475
17641
|
var findIndex = function findIndex(collection, rowData) {
|
|
17476
17642
|
return (collection || []).findIndex(function (data) {
|
|
@@ -17527,35 +17693,35 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17527
17693
|
props.onRowClick({
|
|
17528
17694
|
originalEvent: event,
|
|
17529
17695
|
data: props.rowData,
|
|
17530
|
-
index: props.
|
|
17696
|
+
index: props.rowIndex
|
|
17531
17697
|
});
|
|
17532
17698
|
};
|
|
17533
17699
|
var onDoubleClick = function onDoubleClick(event) {
|
|
17534
17700
|
props.onRowDoubleClick({
|
|
17535
17701
|
originalEvent: event,
|
|
17536
17702
|
data: props.rowData,
|
|
17537
|
-
index: props.
|
|
17703
|
+
index: props.rowIndex
|
|
17538
17704
|
});
|
|
17539
17705
|
};
|
|
17540
17706
|
var onRightClick = function onRightClick(event) {
|
|
17541
17707
|
props.onRowRightClick({
|
|
17542
17708
|
originalEvent: event,
|
|
17543
17709
|
data: props.rowData,
|
|
17544
|
-
index: props.
|
|
17710
|
+
index: props.rowIndex
|
|
17545
17711
|
});
|
|
17546
17712
|
};
|
|
17547
17713
|
var onMouseEnter = function onMouseEnter(event) {
|
|
17548
17714
|
props.onRowMouseEnter({
|
|
17549
17715
|
originalEvent: event,
|
|
17550
17716
|
data: props.rowData,
|
|
17551
|
-
index: props.
|
|
17717
|
+
index: props.rowIndex
|
|
17552
17718
|
});
|
|
17553
17719
|
};
|
|
17554
17720
|
var onMouseLeave = function onMouseLeave(event) {
|
|
17555
17721
|
props.onRowMouseLeave({
|
|
17556
17722
|
originalEvent: event,
|
|
17557
17723
|
data: props.rowData,
|
|
17558
|
-
index: props.
|
|
17724
|
+
index: props.rowIndex
|
|
17559
17725
|
});
|
|
17560
17726
|
};
|
|
17561
17727
|
var onTouchEnd = function onTouchEnd(event) {
|
|
@@ -17609,49 +17775,49 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17609
17775
|
props.onRowMouseDown({
|
|
17610
17776
|
originalEvent: event,
|
|
17611
17777
|
data: props.rowData,
|
|
17612
|
-
index: props.
|
|
17778
|
+
index: props.rowIndex
|
|
17613
17779
|
});
|
|
17614
17780
|
};
|
|
17615
17781
|
var onMouseUp = function onMouseUp(event) {
|
|
17616
17782
|
props.onRowMouseUp({
|
|
17617
17783
|
originalEvent: event,
|
|
17618
17784
|
data: props.rowData,
|
|
17619
|
-
index: props.
|
|
17785
|
+
index: props.rowIndex
|
|
17620
17786
|
});
|
|
17621
17787
|
};
|
|
17622
17788
|
var onDragStart = function onDragStart(event) {
|
|
17623
17789
|
props.onRowDragStart({
|
|
17624
17790
|
originalEvent: event,
|
|
17625
17791
|
data: props.rowData,
|
|
17626
|
-
index: props.
|
|
17792
|
+
index: props.rowIndex
|
|
17627
17793
|
});
|
|
17628
17794
|
};
|
|
17629
17795
|
var onDragOver = function onDragOver(event) {
|
|
17630
17796
|
props.onRowDragOver({
|
|
17631
17797
|
originalEvent: event,
|
|
17632
17798
|
data: props.rowData,
|
|
17633
|
-
index: props.
|
|
17799
|
+
index: props.rowIndex
|
|
17634
17800
|
});
|
|
17635
17801
|
};
|
|
17636
17802
|
var onDragLeave = function onDragLeave(event) {
|
|
17637
17803
|
props.onRowDragLeave({
|
|
17638
17804
|
originalEvent: event,
|
|
17639
17805
|
data: props.rowData,
|
|
17640
|
-
index: props.
|
|
17806
|
+
index: props.rowIndex
|
|
17641
17807
|
});
|
|
17642
17808
|
};
|
|
17643
17809
|
var onDragEnd = function onDragEnd(event) {
|
|
17644
17810
|
props.onRowDragEnd({
|
|
17645
17811
|
originalEvent: event,
|
|
17646
17812
|
data: props.rowData,
|
|
17647
|
-
index: props.
|
|
17813
|
+
index: props.rowIndex
|
|
17648
17814
|
});
|
|
17649
17815
|
};
|
|
17650
17816
|
var onDrop = function onDrop(event) {
|
|
17651
17817
|
props.onRowDrop({
|
|
17652
17818
|
originalEvent: event,
|
|
17653
17819
|
data: props.rowData,
|
|
17654
|
-
index: props.
|
|
17820
|
+
index: props.rowIndex
|
|
17655
17821
|
});
|
|
17656
17822
|
};
|
|
17657
17823
|
var onEditChange = function onEditChange(e, isEditing) {
|
|
@@ -17695,7 +17861,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17695
17861
|
props.onRowEditInit({
|
|
17696
17862
|
originalEvent: event,
|
|
17697
17863
|
data: props.rowData,
|
|
17698
|
-
index: props.
|
|
17864
|
+
index: props.rowIndex
|
|
17699
17865
|
});
|
|
17700
17866
|
}
|
|
17701
17867
|
onEditChange(e, true);
|
|
@@ -17711,7 +17877,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17711
17877
|
props.onRowEditSave({
|
|
17712
17878
|
originalEvent: event,
|
|
17713
17879
|
data: props.rowData,
|
|
17714
|
-
index: props.
|
|
17880
|
+
index: props.rowIndex,
|
|
17715
17881
|
valid: valid
|
|
17716
17882
|
});
|
|
17717
17883
|
}
|
|
@@ -17729,7 +17895,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17729
17895
|
props.onRowEditCancel({
|
|
17730
17896
|
originalEvent: event,
|
|
17731
17897
|
data: props.rowData,
|
|
17732
|
-
index: props.
|
|
17898
|
+
index: props.rowIndex
|
|
17733
17899
|
});
|
|
17734
17900
|
}
|
|
17735
17901
|
onEditChange(e, false);
|
|
@@ -17747,7 +17913,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17747
17913
|
tableSelector: props.tableSelector,
|
|
17748
17914
|
column: col,
|
|
17749
17915
|
rowData: props.rowData,
|
|
17750
|
-
rowIndex: props.
|
|
17916
|
+
rowIndex: props.rowIndex,
|
|
17751
17917
|
index: i,
|
|
17752
17918
|
rowSpan: rowSpan,
|
|
17753
17919
|
dataKey: props.dataKey,
|
|
@@ -17794,9 +17960,9 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
17794
17960
|
'p-highlight-contextmenu': props.contextMenuSelected,
|
|
17795
17961
|
'p-selectable-row': props.allowRowSelection && props.isSelectable({
|
|
17796
17962
|
data: props.rowData,
|
|
17797
|
-
index: props.
|
|
17963
|
+
index: props.rowIndex
|
|
17798
17964
|
}),
|
|
17799
|
-
'p-row-odd': props.
|
|
17965
|
+
'p-row-odd': props.rowIndex % 2 !== 0
|
|
17800
17966
|
});
|
|
17801
17967
|
var style = {
|
|
17802
17968
|
height: props.virtualScrollerOptions ? props.virtualScrollerOptions.itemSize : undefined
|
|
@@ -17871,7 +18037,6 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
17871
18037
|
var rowDragging = React.useRef(false);
|
|
17872
18038
|
var draggedRowIndex = React.useRef(null);
|
|
17873
18039
|
var droppedRowIndex = React.useRef(null);
|
|
17874
|
-
var prevVirtualScrollerOptions = usePrevious(props.virtualScrollerOptions);
|
|
17875
18040
|
var isSubheaderGrouping = props.rowGroupMode && props.rowGroupMode === 'subheader';
|
|
17876
18041
|
var isRadioSelectionMode = props.selectionMode === 'radiobutton';
|
|
17877
18042
|
var isCheckboxSelectionMode = props.selectionMode === 'checkbox';
|
|
@@ -18021,10 +18186,6 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18021
18186
|
});
|
|
18022
18187
|
}
|
|
18023
18188
|
};
|
|
18024
|
-
var updateVirtualScrollerPosition = function updateVirtualScrollerPosition() {
|
|
18025
|
-
var tableHeaderHeight = DomHandler.getOuterHeight(elementRef.current.previousElementSibling);
|
|
18026
|
-
elementRef.current.style.top = (elementRef.current.style.top || 0) + tableHeaderHeight + 'px';
|
|
18027
|
-
};
|
|
18028
18189
|
var onSingleSelection = function onSingleSelection(_ref) {
|
|
18029
18190
|
var originalEvent = _ref.originalEvent,
|
|
18030
18191
|
data = _ref.data,
|
|
@@ -18578,16 +18739,6 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18578
18739
|
updateFrozenRowGroupHeaderStickyPosition();
|
|
18579
18740
|
}
|
|
18580
18741
|
});
|
|
18581
|
-
useMountEffect(function () {
|
|
18582
|
-
if (!props.isVirtualScrollerDisabled && getVirtualScrollerOption('vertical')) {
|
|
18583
|
-
updateVirtualScrollerPosition();
|
|
18584
|
-
}
|
|
18585
|
-
});
|
|
18586
|
-
useUpdateEffect(function () {
|
|
18587
|
-
if (!props.isVirtualScrollerDisabled && getVirtualScrollerOption('vertical') && getVirtualScrollerOption('itemSize', prevVirtualScrollerOptions) !== getVirtualScrollerOption('itemSize')) {
|
|
18588
|
-
updateVirtualScrollerPosition();
|
|
18589
|
-
}
|
|
18590
|
-
}, [props.virtualScrollerOptions]);
|
|
18591
18742
|
useUpdateEffect(function () {
|
|
18592
18743
|
if (props.paginator && isMultipleSelection()) {
|
|
18593
18744
|
anchorRowIndex.current = null;
|
|
@@ -18615,9 +18766,8 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18615
18766
|
}
|
|
18616
18767
|
return null;
|
|
18617
18768
|
};
|
|
18618
|
-
var createGroupHeader = function createGroupHeader(rowData,
|
|
18619
|
-
if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData,
|
|
18620
|
-
var _options;
|
|
18769
|
+
var createGroupHeader = function createGroupHeader(rowData, rowIndex, expanded, colSpan) {
|
|
18770
|
+
if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData, rowIndex - props.first)) {
|
|
18621
18771
|
var style = rowGroupHeaderStyle();
|
|
18622
18772
|
var toggler = props.expandableRowGroups && /*#__PURE__*/React.createElement(RowTogglerButton, {
|
|
18623
18773
|
onClick: onRowToggle,
|
|
@@ -18626,9 +18776,11 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18626
18776
|
expandedRowIcon: props.expandedRowIcon,
|
|
18627
18777
|
collapsedRowIcon: props.collapsedRowIcon
|
|
18628
18778
|
});
|
|
18629
|
-
var options =
|
|
18630
|
-
index:
|
|
18631
|
-
|
|
18779
|
+
var options = {
|
|
18780
|
+
index: rowIndex,
|
|
18781
|
+
props: props.tableProps,
|
|
18782
|
+
customRendering: false
|
|
18783
|
+
};
|
|
18632
18784
|
var _content2 = ObjectUtils.getJSXElement(props.rowGroupHeaderTemplate, rowData, options);
|
|
18633
18785
|
|
|
18634
18786
|
// check if the user wants complete control of the rendering
|
|
@@ -18647,7 +18799,7 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18647
18799
|
}
|
|
18648
18800
|
return null;
|
|
18649
18801
|
};
|
|
18650
|
-
var createRow = function createRow(rowData, index, expanded) {
|
|
18802
|
+
var createRow = function createRow(rowData, rowIndex, index, expanded) {
|
|
18651
18803
|
if (!props.expandableRowGroups || expanded) {
|
|
18652
18804
|
var selected = isSelectionEnabled() ? isSelected(rowData) : false;
|
|
18653
18805
|
var contextMenuSelected = isContextMenuSelected(rowData);
|
|
@@ -18660,6 +18812,7 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18660
18812
|
value: props.value,
|
|
18661
18813
|
columns: props.columns,
|
|
18662
18814
|
rowData: rowData,
|
|
18815
|
+
rowIndex: rowIndex,
|
|
18663
18816
|
index: index,
|
|
18664
18817
|
selected: selected,
|
|
18665
18818
|
contextMenuSelected: contextMenuSelected,
|
|
@@ -18718,11 +18871,11 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18718
18871
|
});
|
|
18719
18872
|
}
|
|
18720
18873
|
};
|
|
18721
|
-
var createExpansion = function createExpansion(rowData,
|
|
18874
|
+
var createExpansion = function createExpansion(rowData, rowIndex, expanded, colSpan) {
|
|
18722
18875
|
if (expanded && !(isSubheaderGrouping && props.expandableRowGroups)) {
|
|
18723
|
-
var id = "".concat(props.tableSelector, "_content_").concat(
|
|
18876
|
+
var id = "".concat(props.tableSelector, "_content_").concat(rowIndex, "_expanded");
|
|
18724
18877
|
var options = {
|
|
18725
|
-
index:
|
|
18878
|
+
index: rowIndex,
|
|
18726
18879
|
customRendering: false
|
|
18727
18880
|
};
|
|
18728
18881
|
var _content3 = ObjectUtils.getJSXElement(props.rowExpansionTemplate, rowData, options);
|
|
@@ -18742,10 +18895,10 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18742
18895
|
}
|
|
18743
18896
|
return null;
|
|
18744
18897
|
};
|
|
18745
|
-
var createGroupFooter = function createGroupFooter(rowData,
|
|
18746
|
-
if (isSubheaderGrouping && shouldRenderRowGroupFooter(props.value, rowData,
|
|
18898
|
+
var createGroupFooter = function createGroupFooter(rowData, rowIndex, expanded, colSpan) {
|
|
18899
|
+
if (isSubheaderGrouping && shouldRenderRowGroupFooter(props.value, rowData, rowIndex - props.first, expanded)) {
|
|
18747
18900
|
var _content4 = ObjectUtils.getJSXElement(props.rowGroupFooterTemplate, rowData, {
|
|
18748
|
-
index:
|
|
18901
|
+
index: rowIndex,
|
|
18749
18902
|
colSpan: colSpan,
|
|
18750
18903
|
props: props.tableProps
|
|
18751
18904
|
});
|
|
@@ -18757,25 +18910,25 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
18757
18910
|
return null;
|
|
18758
18911
|
};
|
|
18759
18912
|
var createContent = function createContent() {
|
|
18760
|
-
return props.value.map(function (rowData,
|
|
18761
|
-
var
|
|
18762
|
-
var key = getRowKey(rowData,
|
|
18913
|
+
return props.value && props.value.map(function (rowData, index) {
|
|
18914
|
+
var rowIndex = getVirtualScrollerOption('getItemOptions') ? getVirtualScrollerOption('getItemOptions')(index).index : props.first + index;
|
|
18915
|
+
var key = getRowKey(rowData, rowIndex);
|
|
18763
18916
|
var expanded = isRowExpanded(rowData);
|
|
18764
18917
|
var colSpan = getColumnsLength();
|
|
18765
|
-
var groupHeader = createGroupHeader(rowData,
|
|
18766
|
-
var row = createRow(rowData, index, expanded);
|
|
18767
|
-
var expansion = createExpansion(rowData,
|
|
18768
|
-
var groupFooter = createGroupFooter(rowData,
|
|
18918
|
+
var groupHeader = createGroupHeader(rowData, rowIndex, expanded, colSpan);
|
|
18919
|
+
var row = createRow(rowData, rowIndex, index, expanded);
|
|
18920
|
+
var expansion = createExpansion(rowData, rowIndex, expanded, colSpan);
|
|
18921
|
+
var groupFooter = createGroupFooter(rowData, rowIndex, expanded, colSpan);
|
|
18769
18922
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
18770
18923
|
key: key
|
|
18771
18924
|
}, groupHeader, row, expansion, groupFooter);
|
|
18772
18925
|
});
|
|
18773
18926
|
};
|
|
18774
|
-
var className = classNames('p-datatable-tbody', props.className);
|
|
18775
18927
|
var content = props.empty ? createEmptyContent() : createContent();
|
|
18776
18928
|
return /*#__PURE__*/React.createElement("tbody", {
|
|
18777
18929
|
ref: refCallback,
|
|
18778
|
-
|
|
18930
|
+
style: props.style,
|
|
18931
|
+
className: props.className
|
|
18779
18932
|
}, content);
|
|
18780
18933
|
}));
|
|
18781
18934
|
TableBody.displayName = 'TableBody';
|
|
@@ -20466,9 +20619,10 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
20466
20619
|
if (ObjectUtils.isNotEmpty(widths)) {
|
|
20467
20620
|
createStyleElement();
|
|
20468
20621
|
var innerHTML = '';
|
|
20622
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > .p-datatable-wrapper ").concat(isVirtualScrollerDisabled() ? '' : '> .p-virtualscroller', " > .p-datatable-table");
|
|
20469
20623
|
widths.forEach(function (width, index) {
|
|
20470
|
-
var style =
|
|
20471
|
-
innerHTML += "\n
|
|
20624
|
+
var style = "width: ".concat(width, "px !important; max-width: ").concat(width, "px !important");
|
|
20625
|
+
innerHTML += "\n ".concat(selector, " > .p-datatable-thead > tr > th:nth-child(").concat(index + 1, "),\n ").concat(selector, " > .p-datatable-tbody > tr > td:nth-child(").concat(index + 1, "),\n ").concat(selector, " > .p-datatable-tfoot > tr > td:nth-child(").concat(index + 1, ") {\n ").concat(style, "\n }\n ");
|
|
20472
20626
|
});
|
|
20473
20627
|
styleElement.current.innerHTML = innerHTML;
|
|
20474
20628
|
}
|
|
@@ -20636,10 +20790,11 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
20636
20790
|
destroyStyleElement();
|
|
20637
20791
|
createStyleElement();
|
|
20638
20792
|
var innerHTML = '';
|
|
20793
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > .p-datatable-wrapper ").concat(isVirtualScrollerDisabled() ? '' : '> .p-virtualscroller', " > .p-datatable-table");
|
|
20639
20794
|
widths.forEach(function (width, index) {
|
|
20640
20795
|
var colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;
|
|
20641
|
-
var style =
|
|
20642
|
-
innerHTML += "\n
|
|
20796
|
+
var style = "width: ".concat(colWidth, "px !important; max-width: ").concat(colWidth, "px !important");
|
|
20797
|
+
innerHTML += "\n ".concat(selector, " > .p-datatable-thead > tr > th:nth-child(").concat(index + 1, "),\n ").concat(selector, " > .p-datatable-tbody > tr > td:nth-child(").concat(index + 1, "),\n ").concat(selector, " > .p-datatable-tfoot > tr > td:nth-child(").concat(index + 1, ") {\n ").concat(style, "\n }\n ");
|
|
20643
20798
|
});
|
|
20644
20799
|
styleElement.current.innerHTML = innerHTML;
|
|
20645
20800
|
};
|
|
@@ -20802,7 +20957,10 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
20802
20957
|
var createResponsiveStyle = function createResponsiveStyle() {
|
|
20803
20958
|
if (!responsiveStyleElement.current) {
|
|
20804
20959
|
responsiveStyleElement.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
20805
|
-
var
|
|
20960
|
+
var tableSelector = ".p-datatable-wrapper ".concat(isVirtualScrollerDisabled() ? '' : '> .p-virtualscroller', " > .p-datatable-table");
|
|
20961
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > ").concat(tableSelector);
|
|
20962
|
+
var gridLinesSelector = ".p-datatable[".concat(attributeSelectorState, "].p-datatable-gridlines > ").concat(tableSelector);
|
|
20963
|
+
var innerHTML = "\n@media screen and (max-width: ".concat(props.breakpoint, ") {\n ").concat(selector, " > .p-datatable-thead > tr > th,\n ").concat(selector, " > .p-datatable-tfoot > tr > td {\n display: none !important;\n }\n\n ").concat(selector, " > .p-datatable-tbody > tr > td {\n display: flex;\n width: 100% !important;\n align-items: center;\n justify-content: space-between;\n }\n\n ").concat(selector, " > .p-datatable-tbody > tr > td:not(:last-child) {\n border: 0 none;\n }\n\n ").concat(gridLinesSelector, " > .p-datatable-tbody > tr > td:last-child {\n border-top: 0;\n border-right: 0;\n border-left: 0;\n }\n\n ").concat(selector, " > .p-datatable-tbody > tr > td > .p-column-title {\n display: block;\n }\n}\n");
|
|
20806
20964
|
responsiveStyleElement.current.innerHTML = innerHTML;
|
|
20807
20965
|
}
|
|
20808
20966
|
};
|
|
@@ -21279,7 +21437,7 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21279
21437
|
return data;
|
|
21280
21438
|
};
|
|
21281
21439
|
useMountEffect(function () {
|
|
21282
|
-
setAttributeSelectorState(UniqueComponentId());
|
|
21440
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
21283
21441
|
setFiltersState(cloneFilters(props.filters));
|
|
21284
21442
|
setD_filtersState(cloneFilters(props.filters));
|
|
21285
21443
|
if (isStateful()) {
|
|
@@ -21290,11 +21448,16 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21290
21448
|
}
|
|
21291
21449
|
});
|
|
21292
21450
|
useUpdateEffect(function () {
|
|
21293
|
-
|
|
21294
|
-
|
|
21295
|
-
|
|
21451
|
+
if (attributeSelectorState) {
|
|
21452
|
+
elementRef.current.setAttribute(attributeSelectorState, '');
|
|
21453
|
+
if (props.responsiveLayout === 'stack' && !props.scrollable) {
|
|
21454
|
+
createResponsiveStyle();
|
|
21455
|
+
}
|
|
21296
21456
|
}
|
|
21297
|
-
|
|
21457
|
+
return function () {
|
|
21458
|
+
destroyResponsiveStyle();
|
|
21459
|
+
};
|
|
21460
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
21298
21461
|
useUpdateEffect(function () {
|
|
21299
21462
|
var filters = cloneFilters(props.filters);
|
|
21300
21463
|
setFiltersState(filters);
|
|
@@ -21376,7 +21539,7 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21376
21539
|
}
|
|
21377
21540
|
return null;
|
|
21378
21541
|
};
|
|
21379
|
-
var createTableHeader = function createTableHeader(options, empty) {
|
|
21542
|
+
var createTableHeader = function createTableHeader(options, empty, _isVirtualScrollerDisabled) {
|
|
21380
21543
|
var sortField = getSortField();
|
|
21381
21544
|
var sortOrder = getSortOrder();
|
|
21382
21545
|
var multiSortMeta = _toConsumableArray(getMultiSortMeta());
|
|
@@ -21384,9 +21547,11 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21384
21547
|
var filters = d_filtersState;
|
|
21385
21548
|
var filtersStore = !props.onFilter && props.filters || getFilters();
|
|
21386
21549
|
var processedData = options.items,
|
|
21550
|
+
virtualScrollerProps = options.props,
|
|
21387
21551
|
columns = options.columns;
|
|
21552
|
+
var data = _isVirtualScrollerDisabled || virtualScrollerProps.lazy ? processedData : virtualScrollerProps.items;
|
|
21388
21553
|
return /*#__PURE__*/React.createElement(TableHeader, {
|
|
21389
|
-
value:
|
|
21554
|
+
value: data,
|
|
21390
21555
|
tableProps: props,
|
|
21391
21556
|
columns: columns,
|
|
21392
21557
|
tabIndex: props.tabIndex,
|
|
@@ -21425,12 +21590,14 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21425
21590
|
var rows = options.rows,
|
|
21426
21591
|
columns = options.columns,
|
|
21427
21592
|
contentRef = options.contentRef,
|
|
21428
|
-
|
|
21429
|
-
options.
|
|
21593
|
+
style = options.style,
|
|
21594
|
+
className = options.className,
|
|
21595
|
+
spacerStyle = options.spacerStyle,
|
|
21596
|
+
itemSize = options.itemSize;
|
|
21430
21597
|
var frozenBody = ObjectUtils.isNotEmpty(props.frozenValue) && /*#__PURE__*/React.createElement(TableBody, {
|
|
21431
21598
|
ref: frozenBodyRef,
|
|
21432
21599
|
value: props.frozenValue,
|
|
21433
|
-
className: "p-datatable-frozen-tbody",
|
|
21600
|
+
className: "p-datatable-tbody p-datatable-frozen-tbody",
|
|
21434
21601
|
frozenRow: true,
|
|
21435
21602
|
tableProps: props,
|
|
21436
21603
|
tableSelector: attributeSelectorState,
|
|
@@ -21501,7 +21668,8 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21501
21668
|
var body = /*#__PURE__*/React.createElement(TableBody, {
|
|
21502
21669
|
ref: bodyRef,
|
|
21503
21670
|
value: dataToRender(rows),
|
|
21504
|
-
|
|
21671
|
+
style: style,
|
|
21672
|
+
className: classNames('p-datatable-tbody', className),
|
|
21505
21673
|
empty: empty,
|
|
21506
21674
|
frozenRow: false,
|
|
21507
21675
|
tableProps: props,
|
|
@@ -21571,7 +21739,13 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21571
21739
|
virtualScrollerOptions: options,
|
|
21572
21740
|
isVirtualScrollerDisabled: isVirtualScrollerDisabled
|
|
21573
21741
|
});
|
|
21574
|
-
|
|
21742
|
+
var spacerBody = ObjectUtils.isNotEmpty(spacerStyle) ? /*#__PURE__*/React.createElement(TableBody, {
|
|
21743
|
+
style: {
|
|
21744
|
+
height: "calc(".concat(spacerStyle.height, " - ").concat(rows.length * itemSize, "px)")
|
|
21745
|
+
},
|
|
21746
|
+
className: "p-datatable-virtualscroller-spacer"
|
|
21747
|
+
}) : null;
|
|
21748
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, frozenBody, body, spacerBody);
|
|
21575
21749
|
};
|
|
21576
21750
|
var createTableFooter = function createTableFooter(options) {
|
|
21577
21751
|
var columns = options.columns;
|
|
@@ -21602,14 +21776,20 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21602
21776
|
scrollHeight: props.scrollHeight !== 'flex' ? undefined : '100%',
|
|
21603
21777
|
disabled: _isVirtualScrollerDisabled,
|
|
21604
21778
|
loaderDisabled: true,
|
|
21779
|
+
inline: true,
|
|
21780
|
+
autoSize: true,
|
|
21605
21781
|
showSpacer: false,
|
|
21606
21782
|
contentTemplate: function contentTemplate(options) {
|
|
21607
21783
|
var ref = function ref(el) {
|
|
21608
21784
|
tableRef.current = el;
|
|
21609
21785
|
options.spacerRef && options.spacerRef(el);
|
|
21610
21786
|
};
|
|
21611
|
-
var tableClassName = classNames('p-datatable-table',
|
|
21612
|
-
|
|
21787
|
+
var tableClassName = classNames('p-datatable-table', {
|
|
21788
|
+
'p-datatable-scrollable-table': props.scrollable,
|
|
21789
|
+
'p-datatable-resizable-table': props.resizableColumns,
|
|
21790
|
+
'p-datatable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
21791
|
+
}, props.tableClassName);
|
|
21792
|
+
var tableHeader = createTableHeader(options, empty, _isVirtualScrollerDisabled);
|
|
21613
21793
|
var tableBody = createTableBody(options, selectionModeInColumn, empty, _isVirtualScrollerDisabled);
|
|
21614
21794
|
var tableFooter = createTableFooter(options);
|
|
21615
21795
|
return /*#__PURE__*/React.createElement("table", {
|
|
@@ -21703,13 +21883,9 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
21703
21883
|
'p-datatable-hoverable-rows': props.rowHover,
|
|
21704
21884
|
'p-datatable-selectable': selectable && !props.cellSelection,
|
|
21705
21885
|
'p-datatable-selectable-cell': selectable && props.cellSelection,
|
|
21706
|
-
'p-datatable-auto-layout': props.autoLayout,
|
|
21707
21886
|
'p-datatable-resizable': props.resizableColumns,
|
|
21708
21887
|
'p-datatable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
21709
21888
|
'p-datatable-scrollable': props.scrollable,
|
|
21710
|
-
'p-datatable-scrollable-vertical': props.scrollable && props.scrollDirection === 'vertical',
|
|
21711
|
-
'p-datatable-scrollable-horizontal': props.scrollable && props.scrollDirection === 'horizontal',
|
|
21712
|
-
'p-datatable-scrollable-both': props.scrollable && props.scrollDirection === 'both',
|
|
21713
21889
|
'p-datatable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',
|
|
21714
21890
|
'p-datatable-responsive-stack': props.responsiveLayout === 'stack',
|
|
21715
21891
|
'p-datatable-responsive-scroll': props.responsiveLayout === 'scroll',
|
|
@@ -26313,14 +26489,15 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
26313
26489
|
itemTemplate: function itemTemplate(item, options) {
|
|
26314
26490
|
return item && createItem(item, options.index, options);
|
|
26315
26491
|
},
|
|
26316
|
-
contentTemplate: function contentTemplate(
|
|
26317
|
-
var className = classNames('p-listbox-list',
|
|
26492
|
+
contentTemplate: function contentTemplate(options) {
|
|
26493
|
+
var className = classNames('p-listbox-list', options.className);
|
|
26318
26494
|
return /*#__PURE__*/React.createElement("ul", _extends({
|
|
26319
|
-
ref:
|
|
26495
|
+
ref: options.contentRef,
|
|
26496
|
+
style: options.style,
|
|
26320
26497
|
className: className,
|
|
26321
26498
|
role: "listbox",
|
|
26322
26499
|
"aria-multiselectable": props.multiple
|
|
26323
|
-
}, ariaProps),
|
|
26500
|
+
}, ariaProps), options.children);
|
|
26324
26501
|
}
|
|
26325
26502
|
});
|
|
26326
26503
|
return /*#__PURE__*/React.createElement(VirtualScroller, _extends({
|
|
@@ -26368,6 +26545,8 @@ var MegaMenuBase = {
|
|
|
26368
26545
|
style: null,
|
|
26369
26546
|
className: null,
|
|
26370
26547
|
orientation: 'horizontal',
|
|
26548
|
+
breakpoint: undefined,
|
|
26549
|
+
scrollHeight: '400px',
|
|
26371
26550
|
start: null,
|
|
26372
26551
|
end: null,
|
|
26373
26552
|
children: undefined
|
|
@@ -26386,17 +26565,41 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26386
26565
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26387
26566
|
activeItemState = _React$useState2[0],
|
|
26388
26567
|
setActiveItemState = _React$useState2[1];
|
|
26568
|
+
var _React$useState3 = React.useState(null),
|
|
26569
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
26570
|
+
attributeSelectorState = _React$useState4[0],
|
|
26571
|
+
setAttributeSelectorState = _React$useState4[1];
|
|
26572
|
+
var _React$useState5 = React.useState(false),
|
|
26573
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
26574
|
+
mobileActiveState = _React$useState6[0],
|
|
26575
|
+
setMobileActiveState = _React$useState6[1];
|
|
26389
26576
|
var elementRef = React.useRef(null);
|
|
26577
|
+
var styleElementRef = React.useRef(null);
|
|
26578
|
+
var menuButtonRef = React.useRef(null);
|
|
26390
26579
|
var horizontal = props.orientation === 'horizontal';
|
|
26391
26580
|
var vertical = props.orientation === 'vertical';
|
|
26581
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
26392
26582
|
var _useEventListener = useEventListener({
|
|
26393
26583
|
type: 'click',
|
|
26394
26584
|
listener: function listener(event) {
|
|
26395
|
-
|
|
26585
|
+
if ((!isMobileMode || mobileActiveState) && isOutsideClicked(event)) {
|
|
26586
|
+
setActiveItemState(null);
|
|
26587
|
+
setMobileActiveState(false);
|
|
26588
|
+
}
|
|
26396
26589
|
}
|
|
26397
26590
|
}),
|
|
26398
26591
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
26399
26592
|
bindDocumentClickListener = _useEventListener2[0];
|
|
26593
|
+
var _useResizeListener = useResizeListener({
|
|
26594
|
+
listener: function listener() {
|
|
26595
|
+
if (!isMobileMode || mobileActiveState) {
|
|
26596
|
+
setActiveItemState(null);
|
|
26597
|
+
setMobileActiveState(false);
|
|
26598
|
+
}
|
|
26599
|
+
}
|
|
26600
|
+
}),
|
|
26601
|
+
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
26602
|
+
bindDocumentResizeListener = _useResizeListener2[0];
|
|
26400
26603
|
var onLeafClick = function onLeafClick(event, item) {
|
|
26401
26604
|
if (item.disabled) {
|
|
26402
26605
|
event.preventDefault();
|
|
@@ -26412,9 +26615,10 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26412
26615
|
});
|
|
26413
26616
|
}
|
|
26414
26617
|
setActiveItemState(null);
|
|
26618
|
+
setMobileActiveState(false);
|
|
26415
26619
|
};
|
|
26416
26620
|
var onCategoryMouseEnter = function onCategoryMouseEnter(event, item) {
|
|
26417
|
-
if (item.disabled) {
|
|
26621
|
+
if (item.disabled || isMobileMode) {
|
|
26418
26622
|
event.preventDefault();
|
|
26419
26623
|
return;
|
|
26420
26624
|
}
|
|
@@ -26477,6 +26681,13 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26477
26681
|
var collapseMenu = function collapseMenu(item) {
|
|
26478
26682
|
setActiveItemState(null);
|
|
26479
26683
|
};
|
|
26684
|
+
var toggle = function toggle(event) {
|
|
26685
|
+
event.preventDefault();
|
|
26686
|
+
setMobileActiveState(function (prevMobileActive) {
|
|
26687
|
+
return !prevMobileActive;
|
|
26688
|
+
});
|
|
26689
|
+
setActiveItemState(null);
|
|
26690
|
+
};
|
|
26480
26691
|
var findNextItem = function findNextItem(item) {
|
|
26481
26692
|
var nextItem = item.nextElementSibling;
|
|
26482
26693
|
return nextItem ? DomHandler.hasClass(nextItem, 'p-disabled') || !DomHandler.hasClass(nextItem, 'p-menuitem') ? findNextItem(nextItem) : nextItem : null;
|
|
@@ -26494,7 +26705,7 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26494
26705
|
prevItem && prevItem.children[0].focus();
|
|
26495
26706
|
};
|
|
26496
26707
|
var isOutsideClicked = function isOutsideClicked(event) {
|
|
26497
|
-
return elementRef.current && !(elementRef.current.isSameNode(event.target) || elementRef.current.contains(event.target));
|
|
26708
|
+
return elementRef.current && !(elementRef.current.isSameNode(event.target) || elementRef.current.contains(event.target) || menuButtonRef.current && menuButtonRef.current.contains(event.target));
|
|
26498
26709
|
};
|
|
26499
26710
|
var getColumnClassName = function getColumnClassName(category) {
|
|
26500
26711
|
var length = category.items ? category.items.length : 0;
|
|
@@ -26527,13 +26738,23 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26527
26738
|
};
|
|
26528
26739
|
});
|
|
26529
26740
|
useMountEffect(function () {
|
|
26741
|
+
if (props.breakpoint) {
|
|
26742
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
26743
|
+
}
|
|
26530
26744
|
bindDocumentClickListener();
|
|
26745
|
+
bindDocumentResizeListener();
|
|
26531
26746
|
});
|
|
26532
26747
|
useUpdateEffect(function () {
|
|
26533
26748
|
var currentPanel = DomHandler.findSingle(elementRef.current, '.p-menuitem-active > .p-megamenu-panel');
|
|
26534
|
-
if (activeItemState) {
|
|
26749
|
+
if (activeItemState && !isMobileMode) {
|
|
26535
26750
|
ZIndexUtils.set('menu', currentPanel, PrimeReact.autoZIndex, PrimeReact.zIndex['menu']);
|
|
26536
26751
|
}
|
|
26752
|
+
if (isMobileMode) {
|
|
26753
|
+
currentPanel && currentPanel.previousElementSibling.scrollIntoView({
|
|
26754
|
+
block: 'nearest',
|
|
26755
|
+
inline: 'nearest'
|
|
26756
|
+
});
|
|
26757
|
+
}
|
|
26537
26758
|
return function () {
|
|
26538
26759
|
ZIndexUtils.clear(currentPanel);
|
|
26539
26760
|
};
|
|
@@ -26612,6 +26833,9 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26612
26833
|
}
|
|
26613
26834
|
};
|
|
26614
26835
|
var createSubmenu = function createSubmenu(submenu) {
|
|
26836
|
+
if (submenu.visible === false) {
|
|
26837
|
+
return null;
|
|
26838
|
+
}
|
|
26615
26839
|
var className = classNames('p-megamenu-submenu-header', {
|
|
26616
26840
|
'p-disabled': submenu.disabled
|
|
26617
26841
|
}, submenu.className);
|
|
@@ -26659,6 +26883,26 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26659
26883
|
}
|
|
26660
26884
|
return null;
|
|
26661
26885
|
};
|
|
26886
|
+
var createStyle = function createStyle() {
|
|
26887
|
+
if (!styleElementRef.current) {
|
|
26888
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
26889
|
+
var selector = "".concat(attributeSelectorState);
|
|
26890
|
+
var innerHTML = "\n@media screen and (max-width: ".concat(props.breakpoint, ") {\n .p-megamenu[").concat(selector, "] > .p-megamenu-root-list .p-menuitem-active .p-megamenu-panel {\n position: relative;\n left: 0 !important;\n box-shadow: none;\n border-radius: 0;\n background: inherit;\n }\n\n .p-megamenu[").concat(selector, "] .p-menuitem-active > .p-menuitem-link > .p-submenu-icon {\n transform: rotate(-180deg);\n }\n\n .p-megamenu[").concat(selector, "] .p-megamenu-grid {\n flex-wrap: wrap;\n }\n\n ").concat(horizontal ? "\n.p-megamenu[".concat(selector, "] .p-megamenu-button {\n display: flex;\n}\n\n.p-megamenu[").concat(selector, "].p-megamenu-horizontal {\n position: relative;\n}\n\n.p-megamenu[").concat(selector, "].p-megamenu-horizontal .p-megamenu-root-list {\n display: none;\n}\n\n.p-megamenu-horizontal[").concat(selector, "] div[class*=\"p-megamenu-col-\"] {\n width: auto;\n flex: 1;\n padding: 0;\n}\n\n.p-megamenu[").concat(selector, "].p-megamenu-mobile-active .p-megamenu-root-list {\n display: flex;\n flex-direction: column;\n position: absolute;\n width: 100%;\n top: 100%;\n left: 0;\n z-index: 1;\n}\n ") : '', "\n\n ").concat(vertical ? "\n.p-megamenu-vertical[".concat(selector, "] {\n width: 100%;\n}\n\n.p-megamenu-vertical[").concat(selector, "] .p-megamenu-root-list {\n max-height: ").concat(props.scrollHeight, ";\n overflow: ").concat(props.scrollHeight ? 'auto' : '', ";\n}\n.p-megamenu-vertical[").concat(selector, "] div[class*=\"p-megamenu-col-\"] {\n width: 100%;\n padding: 0;\n}\n\n.p-megamenu-vertical[").concat(selector, "] .p-megamenu-submenu {\n width: 100%;\n}\n\n.p-megamenu-vertical[").concat(selector, "] div[class*=\"p-megamenu-col-\"] .p-megamenu-submenu-header {\n background: inherit;\n}\n\n.p-megamenu-vertical[").concat(selector, "] .p-submenu-icon:before {\n content: \"\\e930\";\n}\n ") : '', "\n}\n");
|
|
26891
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
26892
|
+
}
|
|
26893
|
+
};
|
|
26894
|
+
var destroyStyle = function destroyStyle() {
|
|
26895
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
26896
|
+
};
|
|
26897
|
+
useUpdateEffect(function () {
|
|
26898
|
+
if (attributeSelectorState && elementRef.current) {
|
|
26899
|
+
elementRef.current.setAttribute(attributeSelectorState, '');
|
|
26900
|
+
createStyle();
|
|
26901
|
+
}
|
|
26902
|
+
return function () {
|
|
26903
|
+
destroyStyle();
|
|
26904
|
+
};
|
|
26905
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
26662
26906
|
var createCategory = function createCategory(category, index) {
|
|
26663
26907
|
var className = classNames('p-menuitem', {
|
|
26664
26908
|
'p-menuitem-active': category === activeItemState
|
|
@@ -26729,20 +26973,41 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
26729
26973
|
}
|
|
26730
26974
|
return null;
|
|
26731
26975
|
};
|
|
26976
|
+
var createMenuButton = function createMenuButton() {
|
|
26977
|
+
if (props.orientation === 'vertical' || props.model && props.model.length < 1) {
|
|
26978
|
+
return null;
|
|
26979
|
+
}
|
|
26980
|
+
/* eslint-disable */
|
|
26981
|
+
var button = /*#__PURE__*/React.createElement("a", {
|
|
26982
|
+
ref: menuButtonRef,
|
|
26983
|
+
href: '#',
|
|
26984
|
+
role: "button",
|
|
26985
|
+
tabIndex: 0,
|
|
26986
|
+
className: "p-megamenu-button",
|
|
26987
|
+
onClick: toggle
|
|
26988
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
26989
|
+
className: "pi pi-bars"
|
|
26990
|
+
}));
|
|
26991
|
+
/* eslint-enable */
|
|
26992
|
+
|
|
26993
|
+
return button;
|
|
26994
|
+
};
|
|
26732
26995
|
var otherProps = MegaMenuBase.getOtherProps(props);
|
|
26733
26996
|
var className = classNames('p-megamenu p-component', {
|
|
26734
26997
|
'p-megamenu-horizontal': props.orientation === 'horizontal',
|
|
26735
|
-
'p-megamenu-vertical': props.orientation === 'vertical'
|
|
26998
|
+
'p-megamenu-vertical': props.orientation === 'vertical',
|
|
26999
|
+
'p-megamenu-mobile-active': mobileActiveState
|
|
26736
27000
|
}, props.className);
|
|
26737
27001
|
var menu = createMenu();
|
|
26738
27002
|
var start = createStartContent();
|
|
26739
27003
|
var end = createEndContent();
|
|
27004
|
+
var menuButton = createMenuButton();
|
|
26740
27005
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
26741
27006
|
ref: elementRef,
|
|
26742
27007
|
id: props.id,
|
|
26743
27008
|
className: className,
|
|
26744
27009
|
style: props.style
|
|
26745
|
-
}, otherProps), start, menu, end);
|
|
27010
|
+
}, otherProps), start, menuButton, menu, end);
|
|
26746
27011
|
}));
|
|
26747
27012
|
MegaMenu.displayName = 'MegaMenu';
|
|
26748
27013
|
|
|
@@ -28171,7 +28436,8 @@ var MultiSelectPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
28171
28436
|
showSelectAll: props.showSelectAll,
|
|
28172
28437
|
selectAll: props.isAllSelected(),
|
|
28173
28438
|
onSelectAll: props.onSelectAll,
|
|
28174
|
-
template: props.panelHeaderTemplate
|
|
28439
|
+
template: props.panelHeaderTemplate,
|
|
28440
|
+
resetFilter: props.resetFilter
|
|
28175
28441
|
});
|
|
28176
28442
|
};
|
|
28177
28443
|
var createFooter = function createFooter() {
|
|
@@ -28278,6 +28544,7 @@ var MultiSelectPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
28278
28544
|
var content = isEmptyFilter() ? createEmptyFilter() : options.children;
|
|
28279
28545
|
return /*#__PURE__*/React.createElement("ul", {
|
|
28280
28546
|
ref: options.contentRef,
|
|
28547
|
+
style: options.style,
|
|
28281
28548
|
className: className,
|
|
28282
28549
|
role: "listbox",
|
|
28283
28550
|
"aria-multiselectable": true
|
|
@@ -34017,6 +34284,12 @@ var SplitButtonBase = {
|
|
|
34017
34284
|
buttonProps: null,
|
|
34018
34285
|
menuButtonProps: null,
|
|
34019
34286
|
tabIndex: null,
|
|
34287
|
+
severity: null,
|
|
34288
|
+
rounded: false,
|
|
34289
|
+
raised: false,
|
|
34290
|
+
outlined: false,
|
|
34291
|
+
text: false,
|
|
34292
|
+
size: null,
|
|
34020
34293
|
appendTo: null,
|
|
34021
34294
|
tooltip: null,
|
|
34022
34295
|
tooltipOptions: null,
|
|
@@ -34148,6 +34421,7 @@ var SplitButtonPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
34148
34421
|
SplitButtonPanel.displayName = 'SplitButtonPanel';
|
|
34149
34422
|
|
|
34150
34423
|
var SplitButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
34424
|
+
var _classNames;
|
|
34151
34425
|
var props = SplitButtonBase.getProps(inProps);
|
|
34152
34426
|
var _React$useState = React.useState(props.id),
|
|
34153
34427
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -34244,9 +34518,15 @@ var SplitButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
34244
34518
|
}
|
|
34245
34519
|
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
34246
34520
|
var otherProps = SplitButtonBase.getOtherProps(props);
|
|
34247
|
-
var
|
|
34248
|
-
'
|
|
34249
|
-
|
|
34521
|
+
var sizeMapping = {
|
|
34522
|
+
large: 'lg',
|
|
34523
|
+
small: 'sm'
|
|
34524
|
+
};
|
|
34525
|
+
var size = sizeMapping[props.size];
|
|
34526
|
+
var className = classNames('p-splitbutton p-component', props.className, (_classNames = {
|
|
34527
|
+
'p-disabled': props.disabled,
|
|
34528
|
+
'p-button-loading-label-only': props.loading && !props.icon && props.label
|
|
34529
|
+
}, _defineProperty(_classNames, "p-button-".concat(props.severity), props.severity), _defineProperty(_classNames, 'p-button-raised', props.raised), _defineProperty(_classNames, 'p-button-rounded', props.rounded), _defineProperty(_classNames, 'p-button-text', props.text), _defineProperty(_classNames, 'p-button-outlined', props.outlined), _defineProperty(_classNames, "p-button-".concat(size), size), _classNames));
|
|
34250
34530
|
var buttonClassName = classNames('p-splitbutton-defaultbutton', props.buttonClassName);
|
|
34251
34531
|
var menuButtonClassName = classNames('p-splitbutton-menubutton', props.menuButtonClassName);
|
|
34252
34532
|
var buttonContent = props.buttonTemplate ? ObjectUtils.getJSXElement(props.buttonTemplate, props) : null;
|
|
@@ -35727,6 +36007,8 @@ var TieredMenuBase = {
|
|
|
35727
36007
|
className: null,
|
|
35728
36008
|
autoZIndex: true,
|
|
35729
36009
|
baseZIndex: 0,
|
|
36010
|
+
breakpoint: undefined,
|
|
36011
|
+
scrollHeight: '400px',
|
|
35730
36012
|
appendTo: null,
|
|
35731
36013
|
transitionOptions: null,
|
|
35732
36014
|
onShow: null,
|
|
@@ -35750,13 +36032,20 @@ var TieredMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
35750
36032
|
var _useEventListener = useEventListener({
|
|
35751
36033
|
type: 'click',
|
|
35752
36034
|
listener: function listener(event) {
|
|
35753
|
-
if (elementRef.current && !elementRef.current.contains(event.target)) {
|
|
36035
|
+
if (!props.isMobileMode && elementRef.current && !elementRef.current.contains(event.target)) {
|
|
35754
36036
|
setActiveItemState(null);
|
|
35755
36037
|
}
|
|
35756
36038
|
}
|
|
35757
36039
|
}),
|
|
35758
36040
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
35759
36041
|
bindDocumentClickListener = _useEventListener2[0];
|
|
36042
|
+
var _useResizeListener = useResizeListener({
|
|
36043
|
+
listener: function listener() {
|
|
36044
|
+
!props.isMobileMode && setActiveItemState(null);
|
|
36045
|
+
}
|
|
36046
|
+
}),
|
|
36047
|
+
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
36048
|
+
bindDocumentResizeListener = _useResizeListener2[0];
|
|
35760
36049
|
var position = function position() {
|
|
35761
36050
|
if (elementRef.current) {
|
|
35762
36051
|
var parentItem = elementRef.current.parentElement;
|
|
@@ -35776,7 +36065,7 @@ var TieredMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
35776
36065
|
}
|
|
35777
36066
|
};
|
|
35778
36067
|
var onItemMouseEnter = function onItemMouseEnter(event, item) {
|
|
35779
|
-
if (item.disabled) {
|
|
36068
|
+
if (item.disabled || props.isMobileMode) {
|
|
35780
36069
|
event.preventDefault();
|
|
35781
36070
|
return;
|
|
35782
36071
|
}
|
|
@@ -35802,7 +36091,7 @@ var TieredMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
35802
36091
|
item: item
|
|
35803
36092
|
});
|
|
35804
36093
|
}
|
|
35805
|
-
if (props.root) {
|
|
36094
|
+
if (props.root || props.isMobileMode) {
|
|
35806
36095
|
if (item.items) {
|
|
35807
36096
|
if (activeItemState && item === activeItemState) setActiveItemState(null);else setActiveItemState(item);
|
|
35808
36097
|
}
|
|
@@ -35857,21 +36146,27 @@ var TieredMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
35857
36146
|
return prevItem ? DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? findPrevItem(prevItem) : prevItem : null;
|
|
35858
36147
|
};
|
|
35859
36148
|
var onLeafClick = function onLeafClick(event) {
|
|
35860
|
-
|
|
35861
|
-
|
|
35862
|
-
|
|
36149
|
+
if (!props.isMobileMode || props.popup) {
|
|
36150
|
+
setActiveItemState(null);
|
|
36151
|
+
props.onLeafClick && props.onLeafClick(event);
|
|
36152
|
+
props.onHide && props.onHide(event);
|
|
36153
|
+
}
|
|
35863
36154
|
};
|
|
35864
36155
|
useMountEffect(function () {
|
|
35865
36156
|
bindDocumentClickListener();
|
|
36157
|
+
bindDocumentResizeListener();
|
|
35866
36158
|
});
|
|
35867
36159
|
useUpdateEffect(function () {
|
|
35868
36160
|
if (!props.parentActive) {
|
|
35869
36161
|
setActiveItemState(null);
|
|
35870
36162
|
}
|
|
35871
|
-
if (!props.root && props.parentActive) {
|
|
36163
|
+
if (!props.root && props.parentActive && !props.isMobileMode) {
|
|
35872
36164
|
position();
|
|
35873
36165
|
}
|
|
35874
36166
|
}, [props.parentActive]);
|
|
36167
|
+
useUpdateEffect(function () {
|
|
36168
|
+
props.onItemToggle && props.onItemToggle();
|
|
36169
|
+
}, [activeItemState]);
|
|
35875
36170
|
var createSeparator = function createSeparator(index) {
|
|
35876
36171
|
var key = 'separator_' + index;
|
|
35877
36172
|
return /*#__PURE__*/React.createElement("li", {
|
|
@@ -35888,7 +36183,9 @@ var TieredMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
35888
36183
|
onLeafClick: onLeafClick,
|
|
35889
36184
|
popup: props.popup,
|
|
35890
36185
|
onKeyDown: onChildItemKeyDown,
|
|
35891
|
-
parentActive: item === activeItemState
|
|
36186
|
+
parentActive: item === activeItemState,
|
|
36187
|
+
isMobileMode: props.isMobileMode,
|
|
36188
|
+
onItemToggle: props.onItemToggle
|
|
35892
36189
|
});
|
|
35893
36190
|
}
|
|
35894
36191
|
return null;
|
|
@@ -35998,8 +36295,14 @@ var TieredMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
35998
36295
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
35999
36296
|
visibleState = _React$useState2[0],
|
|
36000
36297
|
setVisibleState = _React$useState2[1];
|
|
36298
|
+
var _React$useState3 = React.useState(null),
|
|
36299
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
36300
|
+
attributeSelectorState = _React$useState4[0],
|
|
36301
|
+
setAttributeSelectorState = _React$useState4[1];
|
|
36001
36302
|
var menuRef = React.useRef(null);
|
|
36002
36303
|
var targetRef = React.useRef(null);
|
|
36304
|
+
var styleElementRef = React.useRef(null);
|
|
36305
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
36003
36306
|
var _useOverlayListener = useOverlayListener({
|
|
36004
36307
|
target: targetRef,
|
|
36005
36308
|
overlay: menuRef,
|
|
@@ -36037,11 +36340,31 @@ var TieredMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
36037
36340
|
props.onHide && props.onHide(event);
|
|
36038
36341
|
}
|
|
36039
36342
|
};
|
|
36343
|
+
var onItemToggle = function onItemToggle() {
|
|
36344
|
+
if (props.popup && isMobileMode) {
|
|
36345
|
+
DomHandler.absolutePosition(menuRef.current, targetRef.current);
|
|
36346
|
+
}
|
|
36347
|
+
};
|
|
36348
|
+
var createStyle = function createStyle() {
|
|
36349
|
+
if (!styleElementRef.current) {
|
|
36350
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
36351
|
+
var selector = "".concat(attributeSelectorState);
|
|
36352
|
+
var innerHTML = "\n@media screen and (max-width: ".concat(props.breakpoint, ") {\n .p-tieredmenu[").concat(selector, "] > ul {\n max-height: ").concat(props.scrollHeight, ";\n overflow: ").concat(props.scrollHeight ? 'auto' : '', ";\n }\n\n .p-tieredmenu[").concat(selector, "] .p-submenu-list {\n position: relative;\n }\n\n .p-tieredmenu[").concat(selector, "] .p-menuitem-active > .p-submenu-list {\n left: 0 !important;\n box-shadow: none;\n border-radius: 0;\n padding: 0 0 0 calc(var(--inline-spacing) * 2); /* @todo */\n }\n\n .p-tieredmenu[").concat(selector, "] .p-menuitem-active > .p-menuitem-link > .p-submenu-icon {\n transform: rotate(-180deg);\n }\n\n .p-tieredmenu[").concat(selector, "] .p-submenu-icon:before {\n content: \"\\e930\";\n }\n\n ").concat(!props.popup ? ".p-tieredmenu[".concat(selector, "] { width: 100%; }") : '', "\n}\n");
|
|
36353
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
36354
|
+
}
|
|
36355
|
+
};
|
|
36356
|
+
var destroyStyle = function destroyStyle() {
|
|
36357
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
36358
|
+
};
|
|
36040
36359
|
var onEnter = function onEnter() {
|
|
36041
36360
|
if (props.autoZIndex) {
|
|
36042
36361
|
ZIndexUtils.set('menu', menuRef.current, PrimeReact.autoZIndex, props.baseZIndex || PrimeReact.zIndex['menu']);
|
|
36043
36362
|
}
|
|
36044
36363
|
DomHandler.absolutePosition(menuRef.current, targetRef.current);
|
|
36364
|
+
if (attributeSelectorState && props.breakpoint) {
|
|
36365
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
36366
|
+
createStyle();
|
|
36367
|
+
}
|
|
36045
36368
|
};
|
|
36046
36369
|
var onEntered = function onEntered() {
|
|
36047
36370
|
bindOverlayListener();
|
|
@@ -36052,7 +36375,22 @@ var TieredMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
36052
36375
|
};
|
|
36053
36376
|
var onExited = function onExited() {
|
|
36054
36377
|
ZIndexUtils.clear(menuRef.current);
|
|
36378
|
+
destroyStyle();
|
|
36055
36379
|
};
|
|
36380
|
+
useMountEffect(function () {
|
|
36381
|
+
if (props.breakpoint) {
|
|
36382
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
36383
|
+
}
|
|
36384
|
+
});
|
|
36385
|
+
useUpdateEffect(function () {
|
|
36386
|
+
if (attributeSelectorState && menuRef.current) {
|
|
36387
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
36388
|
+
createStyle();
|
|
36389
|
+
}
|
|
36390
|
+
return function () {
|
|
36391
|
+
destroyStyle();
|
|
36392
|
+
};
|
|
36393
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
36056
36394
|
useUnmountEffect(function () {
|
|
36057
36395
|
ZIndexUtils.clear(menuRef.current);
|
|
36058
36396
|
});
|
|
@@ -36100,7 +36438,9 @@ var TieredMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
36100
36438
|
model: props.model,
|
|
36101
36439
|
root: true,
|
|
36102
36440
|
popup: props.popup,
|
|
36103
|
-
onHide: hide
|
|
36441
|
+
onHide: hide,
|
|
36442
|
+
isMobileMode: isMobileMode,
|
|
36443
|
+
onItemToggle: onItemToggle
|
|
36104
36444
|
})));
|
|
36105
36445
|
};
|
|
36106
36446
|
var element = createElement();
|
|
@@ -38392,7 +38732,6 @@ var TreeTableBase = {
|
|
|
38392
38732
|
defaultProps: {
|
|
38393
38733
|
__TYPE: 'TreeTable',
|
|
38394
38734
|
alwaysShowPaginator: true,
|
|
38395
|
-
autoLayout: false,
|
|
38396
38735
|
className: null,
|
|
38397
38736
|
columnResizeMode: 'fit',
|
|
38398
38737
|
contextMenuSelectionKey: null,
|
|
@@ -38907,14 +39246,14 @@ var TreeTableRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
38907
39246
|
return null;
|
|
38908
39247
|
}
|
|
38909
39248
|
};
|
|
38910
|
-
var createCell = function createCell(column) {
|
|
39249
|
+
var createCell = function createCell(column, index) {
|
|
38911
39250
|
var toggler, checkbox;
|
|
38912
39251
|
if (getColumnProp(column, 'expander')) {
|
|
38913
39252
|
toggler = createToggler();
|
|
38914
39253
|
checkbox = createCheckbox();
|
|
38915
39254
|
}
|
|
38916
39255
|
return /*#__PURE__*/React.createElement(TreeTableBodyCell, _extends({
|
|
38917
|
-
key: getColumnProp(column, 'columnKey') || getColumnProp(column, 'field')
|
|
39256
|
+
key: "".concat(getColumnProp(column, 'columnKey') || getColumnProp(column, 'field'), "_").concat(index)
|
|
38918
39257
|
}, ColumnBase.getCProps(column), {
|
|
38919
39258
|
column: column,
|
|
38920
39259
|
selectOnEdit: props.selectOnEdit,
|
|
@@ -38927,7 +39266,7 @@ var TreeTableRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
38927
39266
|
if (expanded && props.node.children) {
|
|
38928
39267
|
return props.node.children.map(function (childNode, index) {
|
|
38929
39268
|
return /*#__PURE__*/React.createElement(TreeTableRow, {
|
|
38930
|
-
key: childNode.key || JSON.stringify(childNode.data),
|
|
39269
|
+
key: "".concat(childNode.key || JSON.stringify(childNode.data), "_").concat(index),
|
|
38931
39270
|
level: props.level + 1,
|
|
38932
39271
|
rowIndex: props.rowIndex + '_' + index,
|
|
38933
39272
|
node: childNode,
|
|
@@ -39132,7 +39471,7 @@ var TreeTableBody = /*#__PURE__*/React.memo(function (props) {
|
|
|
39132
39471
|
};
|
|
39133
39472
|
var createRow = function createRow(node, index) {
|
|
39134
39473
|
return /*#__PURE__*/React.createElement(TreeTableRow, {
|
|
39135
|
-
key: node.key || JSON.stringify(node.data),
|
|
39474
|
+
key: "".concat(node.key || JSON.stringify(node.data), "_").concat(index),
|
|
39136
39475
|
level: 0,
|
|
39137
39476
|
rowIndex: index,
|
|
39138
39477
|
selectOnEdit: props.selectOnEdit,
|
|
@@ -40532,7 +40871,7 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
40532
40871
|
}
|
|
40533
40872
|
scrollableView = createScrollableView(value, scrollableColumns, false, props.headerColumnGroup, props.footerColumnGroup);
|
|
40534
40873
|
return /*#__PURE__*/React.createElement("div", {
|
|
40535
|
-
className: "p-treetable-scrollable-wrapper"
|
|
40874
|
+
className: "p-treetable-wrapper p-treetable-scrollable-wrapper"
|
|
40536
40875
|
}, frozenView, scrollableView);
|
|
40537
40876
|
};
|
|
40538
40877
|
var createRegularTable = function createRegularTable(value) {
|
|
@@ -40540,12 +40879,17 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
40540
40879
|
var header = createTableHeader(columns, props.headerColumnGroup);
|
|
40541
40880
|
var footer = createTableFooter(columns, props.footerColumnGroup);
|
|
40542
40881
|
var body = createTableBody(value, columns);
|
|
40882
|
+
var tableClassName = classNames('p-treetable-table', {
|
|
40883
|
+
'p-treetable-scrollable-table': props.scrollable,
|
|
40884
|
+
'p-treetable-resizable-table': props.resizableColumns,
|
|
40885
|
+
'p-treetable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
40886
|
+
}, props.tableClassName);
|
|
40543
40887
|
return /*#__PURE__*/React.createElement("div", {
|
|
40544
40888
|
className: "p-treetable-wrapper"
|
|
40545
40889
|
}, /*#__PURE__*/React.createElement("table", {
|
|
40546
40890
|
ref: tableRef,
|
|
40547
40891
|
style: props.tableStyle,
|
|
40548
|
-
className:
|
|
40892
|
+
className: tableClassName
|
|
40549
40893
|
}, header, footer, body));
|
|
40550
40894
|
};
|
|
40551
40895
|
var createTable = function createTable(value) {
|
|
@@ -40571,7 +40915,6 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
40571
40915
|
'p-treetable-selectable': isRowSelectionMode(),
|
|
40572
40916
|
'p-treetable-resizable': props.resizableColumns,
|
|
40573
40917
|
'p-treetable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
40574
|
-
'p-treetable-auto-layout': props.autoLayout,
|
|
40575
40918
|
'p-treetable-striped': props.stripedRows,
|
|
40576
40919
|
'p-treetable-gridlines': props.showGridlines
|
|
40577
40920
|
}, props.className);
|
|
@@ -40614,7 +40957,7 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
40614
40957
|
id: props.id,
|
|
40615
40958
|
className: className,
|
|
40616
40959
|
style: props.style,
|
|
40617
|
-
"data-scrollselectors": ".p-treetable-
|
|
40960
|
+
"data-scrollselectors": ".p-treetable-wrapper"
|
|
40618
40961
|
}, otherProps), loader, headerFacet, paginatorTop, table, paginatorBottom, footerFacet, resizeHelper, reorderIndicatorUp, reorderIndicatorDown);
|
|
40619
40962
|
});
|
|
40620
40963
|
TreeTable.displayName = 'TreeTable';
|
|
@@ -40738,4 +41081,4 @@ var TriStateCheckbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
40738
41081
|
}));
|
|
40739
41082
|
TriStateCheckbox.displayName = 'TriStateCheckbox';
|
|
40740
41083
|
|
|
40741
|
-
export { Accordion, AccordionTab, AutoComplete, Avatar, AvatarGroup, Badge, BlockUI, BreadCrumb, Button, CSSTransition, Calendar, Card, Carousel, CascadeSelect, PrimeReactChart as Chart, Checkbox, Chip, Chips, ColorPicker, Column, ColumnGroup, ConfirmDialog, ConfirmPopup, ConnectedOverlayScrollHandler, ContextMenu, DataScroller, DataTable, DataView, DataViewItem, DataViewLayoutOptions, DeferredContent, Dialog, Divider, Dock, DomHandler, Dropdown, Editor, EventBus, Fieldset, FileUpload, FilterMatchMode, FilterOperator, FilterService, Galleria, IconUtils, Image, Inplace, InplaceContent, InplaceDisplay, InputMask, InputNumber, InputSwitch, InputText, InputTextarea, KeyFilter, Knob, ListBox, MegaMenu, Mention, Menu, Menubar, Message, MessageSeverity, Messages, MultiSelect, MultiStateCheckbox, ObjectUtils, OrderList, OrganizationChart, OverlayPanel, OverlayService, Paginator, Panel, PanelMenu, Password, PickList, Portal, PrimeIcons, ProgressBar, ProgressSpinner, RadioButton, Rating, Ripple, Row, ScrollPanel, ScrollTop, SelectButton, Sidebar, Skeleton, SlideMenu, Slider, SortOrder, SpeedDial, SplitButton, Splitter, SplitterPanel, Steps, StyleClass, TabMenu, TabPanel, TabView, Tag, Terminal, TerminalService, TieredMenu, Timeline, Toast, ToggleButton, Toolbar, Tooltip, Tree, TreeSelect, TreeTable, TriStateCheckbox, UniqueComponentId, VirtualScroller, ZIndexUtils, addLocale, ariaLabel, classNames, confirmDialog, confirmPopup, PrimeReact as default, locale, localeOption, localeOptions, mask, updateLocaleOption, updateLocaleOptions, useClickOutside, useCounter, useDebounce, useEventListener, useFavicon, useIntersectionObserver, useInterval, useLocalStorage, useMountEffect, useMouse, useMove, useOverlayListener, useOverlayScrollListener, usePrevious, useResizeListener, useSessionStorage, useStorage, useTimeout, useUnmountEffect, useUpdateEffect };
|
|
41084
|
+
export { Accordion, AccordionTab, AutoComplete, Avatar, AvatarGroup, Badge, BlockUI, BreadCrumb, Button, CSSTransition, Calendar, Card, Carousel, CascadeSelect, PrimeReactChart as Chart, Checkbox, Chip, Chips, ColorPicker, Column, ColumnGroup, ConfirmDialog, ConfirmPopup, ConnectedOverlayScrollHandler, ContextMenu, DataScroller, DataTable, DataView, DataViewItem, DataViewLayoutOptions, DeferredContent, Dialog, Divider, Dock, DomHandler, Dropdown, Editor, EventBus, Fieldset, FileUpload, FilterMatchMode, FilterOperator, FilterService, Galleria, IconUtils, Image, Inplace, InplaceContent, InplaceDisplay, InputMask, InputNumber, InputSwitch, InputText, InputTextarea, KeyFilter, Knob, ListBox, MegaMenu, Mention, Menu, Menubar, Message, MessageSeverity, Messages, MultiSelect, MultiStateCheckbox, ObjectUtils, OrderList, OrganizationChart, OverlayPanel, OverlayService, Paginator, Panel, PanelMenu, Password, PickList, Portal, PrimeIcons, ProgressBar, ProgressSpinner, RadioButton, Rating, Ripple, Row, ScrollPanel, ScrollTop, SelectButton, Sidebar, Skeleton, SlideMenu, Slider, SortOrder, SpeedDial, SplitButton, Splitter, SplitterPanel, Steps, StyleClass, TabMenu, TabPanel, TabView, Tag, Terminal, TerminalService, TieredMenu, Timeline, Toast, ToggleButton, Toolbar, Tooltip, Tree, TreeSelect, TreeTable, TriStateCheckbox, UniqueComponentId, VirtualScroller, ZIndexUtils, addLocale, ariaLabel, classNames, confirmDialog, confirmPopup, PrimeReact as default, locale, localeOption, localeOptions, mask, updateLocaleOption, updateLocaleOptions, useClickOutside, useCounter, useDebounce, useEventListener, useFavicon, useIntersectionObserver, useInterval, useLocalStorage, useMatchMedia, useMountEffect, useMouse, useMove, useOverlayListener, useOverlayScrollListener, usePrevious, useResizeListener, useSessionStorage, useStorage, useTimeout, useUnmountEffect, useUpdateEffect };
|