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.cjs.js
CHANGED
|
@@ -293,7 +293,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
293
293
|
key: "getOuterWidth",
|
|
294
294
|
value: function getOuterWidth(el, margin) {
|
|
295
295
|
if (el) {
|
|
296
|
-
var width = el.
|
|
296
|
+
var width = el.getBoundingClientRect().width || el.offsetWidth;
|
|
297
297
|
if (margin) {
|
|
298
298
|
var style = getComputedStyle(el);
|
|
299
299
|
width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
@@ -306,7 +306,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
306
306
|
key: "getOuterHeight",
|
|
307
307
|
value: function getOuterHeight(el, margin) {
|
|
308
308
|
if (el) {
|
|
309
|
-
var height = el.
|
|
309
|
+
var height = el.getBoundingClientRect().height || el.offsetHeight;
|
|
310
310
|
if (margin) {
|
|
311
311
|
var style = getComputedStyle(el);
|
|
312
312
|
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
@@ -490,7 +490,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
490
490
|
}, {
|
|
491
491
|
key: "absolutePosition",
|
|
492
492
|
value: function absolutePosition(element, target) {
|
|
493
|
-
if (element) {
|
|
493
|
+
if (element && target) {
|
|
494
494
|
var elementDimensions = element.offsetParent ? {
|
|
495
495
|
width: element.offsetWidth,
|
|
496
496
|
height: element.offsetHeight
|
|
@@ -522,7 +522,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
522
522
|
}, {
|
|
523
523
|
key: "relativePosition",
|
|
524
524
|
value: function relativePosition(element, target) {
|
|
525
|
-
if (element) {
|
|
525
|
+
if (element && target) {
|
|
526
526
|
var elementDimensions = element.offsetParent ? {
|
|
527
527
|
width: element.offsetWidth,
|
|
528
528
|
height: element.offsetHeight
|
|
@@ -752,7 +752,7 @@ var DomHandler = /*#__PURE__*/function () {
|
|
|
752
752
|
_iterator2.f();
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
|
-
if (parent.nodeType
|
|
755
|
+
if (parent.nodeType === 1 && overflowCheck(parent)) {
|
|
756
756
|
scrollableParents.push(parent);
|
|
757
757
|
}
|
|
758
758
|
}
|
|
@@ -1957,12 +1957,17 @@ var ObjectUtils = /*#__PURE__*/function () {
|
|
|
1957
1957
|
key: "isValidChild",
|
|
1958
1958
|
value: function isValidChild(child, type, validTypes) {
|
|
1959
1959
|
/* eslint-disable */
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1960
|
+
if (child) {
|
|
1961
|
+
var childType = this.getComponentProp(child, '__TYPE') || (child.type ? child.type.displayName : undefined);
|
|
1962
|
+
var isValid = childType === type;
|
|
1963
|
+
try {
|
|
1964
|
+
var messageTypes; if ("production" !== 'production' && !isValid) ;
|
|
1965
|
+
} catch (error) {
|
|
1966
|
+
// NOOP
|
|
1967
|
+
}
|
|
1968
|
+
return isValid;
|
|
1964
1969
|
}
|
|
1965
|
-
return
|
|
1970
|
+
return false;
|
|
1966
1971
|
/* eslint-enable */
|
|
1967
1972
|
}
|
|
1968
1973
|
}, {
|
|
@@ -2353,6 +2358,22 @@ _defineProperty(PrimeReact$1, "filterMatchModeOptions", {
|
|
|
2353
2358
|
numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],
|
|
2354
2359
|
date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]
|
|
2355
2360
|
});
|
|
2361
|
+
_defineProperty(PrimeReact$1, "changeTheme", function (currentTheme, newTheme, linkElementId, callback) {
|
|
2362
|
+
var _linkElement$parentNo;
|
|
2363
|
+
var linkElement = document.getElementById(linkElementId);
|
|
2364
|
+
var cloneLinkElement = linkElement.cloneNode(true);
|
|
2365
|
+
var newThemeUrl = linkElement.getAttribute('href').replace(currentTheme, newTheme);
|
|
2366
|
+
cloneLinkElement.setAttribute('id', linkElementId + '-clone');
|
|
2367
|
+
cloneLinkElement.setAttribute('href', newThemeUrl);
|
|
2368
|
+
cloneLinkElement.addEventListener('load', function () {
|
|
2369
|
+
linkElement.remove();
|
|
2370
|
+
cloneLinkElement.setAttribute('id', linkElementId);
|
|
2371
|
+
if (callback) {
|
|
2372
|
+
callback();
|
|
2373
|
+
}
|
|
2374
|
+
});
|
|
2375
|
+
(_linkElement$parentNo = linkElement.parentNode) === null || _linkElement$parentNo === void 0 ? void 0 : _linkElement$parentNo.insertBefore(cloneLinkElement, linkElement.nextSibling);
|
|
2376
|
+
});
|
|
2356
2377
|
|
|
2357
2378
|
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; }
|
|
2358
2379
|
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; }
|
|
@@ -2965,6 +2986,34 @@ var useInterval = function useInterval(fn) {
|
|
|
2965
2986
|
};
|
|
2966
2987
|
/* eslint-enable */
|
|
2967
2988
|
|
|
2989
|
+
var useMatchMedia = function useMatchMedia(query) {
|
|
2990
|
+
var when = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2991
|
+
var _React$useState = React__namespace.useState(false),
|
|
2992
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2993
|
+
matches = _React$useState2[0],
|
|
2994
|
+
setMatches = _React$useState2[1];
|
|
2995
|
+
var matchMedia = React__namespace.useRef(null);
|
|
2996
|
+
var handleChange = function handleChange(e) {
|
|
2997
|
+
return setMatches(e.matches);
|
|
2998
|
+
};
|
|
2999
|
+
var bind = function bind() {
|
|
3000
|
+
return matchMedia.current && matchMedia.current.addEventListener('change', handleChange);
|
|
3001
|
+
};
|
|
3002
|
+
var unbind = function unbind() {
|
|
3003
|
+
return matchMedia.current && matchMedia.current.removeEventListener('change', handleChange) && (matchMedia.current = null);
|
|
3004
|
+
};
|
|
3005
|
+
React__namespace.useEffect(function () {
|
|
3006
|
+
if (when) {
|
|
3007
|
+
matchMedia.current = window.matchMedia(query);
|
|
3008
|
+
setMatches(matchMedia.current.matches);
|
|
3009
|
+
bind();
|
|
3010
|
+
}
|
|
3011
|
+
return unbind;
|
|
3012
|
+
}, [query, when]);
|
|
3013
|
+
return matches;
|
|
3014
|
+
};
|
|
3015
|
+
/* eslint-enable */
|
|
3016
|
+
|
|
2968
3017
|
/* eslint-disable */
|
|
2969
3018
|
var useMountEffect = function useMountEffect(fn) {
|
|
2970
3019
|
return React__namespace.useEffect(fn, []);
|
|
@@ -3290,11 +3339,14 @@ var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
|
|
|
3290
3339
|
/* eslint-enable */
|
|
3291
3340
|
|
|
3292
3341
|
var useResizeListener = function useResizeListener(_ref) {
|
|
3293
|
-
var listener = _ref.listener
|
|
3342
|
+
var listener = _ref.listener,
|
|
3343
|
+
_ref$when = _ref.when,
|
|
3344
|
+
when = _ref$when === void 0 ? true : _ref$when;
|
|
3294
3345
|
return useEventListener({
|
|
3295
3346
|
target: 'window',
|
|
3296
3347
|
type: 'resize',
|
|
3297
|
-
listener: listener
|
|
3348
|
+
listener: listener,
|
|
3349
|
+
when: when
|
|
3298
3350
|
});
|
|
3299
3351
|
};
|
|
3300
3352
|
|
|
@@ -4227,10 +4279,10 @@ var Tooltip = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
4227
4279
|
hideEvents = _getEvents.hideEvents;
|
|
4228
4280
|
var currentTarget = getTarget(target);
|
|
4229
4281
|
showEvents.forEach(function (event) {
|
|
4230
|
-
return currentTarget.addEventListener(event, show);
|
|
4282
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.addEventListener(event, show);
|
|
4231
4283
|
});
|
|
4232
4284
|
hideEvents.forEach(function (event) {
|
|
4233
|
-
return currentTarget.addEventListener(event, hide);
|
|
4285
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.addEventListener(event, hide);
|
|
4234
4286
|
});
|
|
4235
4287
|
}
|
|
4236
4288
|
};
|
|
@@ -4241,10 +4293,10 @@ var Tooltip = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
4241
4293
|
hideEvents = _getEvents2.hideEvents;
|
|
4242
4294
|
var currentTarget = getTarget(target);
|
|
4243
4295
|
showEvents.forEach(function (event) {
|
|
4244
|
-
return currentTarget.removeEventListener(event, show);
|
|
4296
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.removeEventListener(event, show);
|
|
4245
4297
|
});
|
|
4246
4298
|
hideEvents.forEach(function (event) {
|
|
4247
|
-
return currentTarget.removeEventListener(event, hide);
|
|
4299
|
+
return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.removeEventListener(event, hide);
|
|
4248
4300
|
});
|
|
4249
4301
|
}
|
|
4250
4302
|
};
|
|
@@ -4278,6 +4330,7 @@ var Tooltip = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
4278
4330
|
if (isShowOnDisabled(target)) {
|
|
4279
4331
|
if (!target.hasWrapper) {
|
|
4280
4332
|
var wrapper = document.createElement('span');
|
|
4333
|
+
DomHandler.addClass(wrapper, 'p-tooltip-target-wrapper');
|
|
4281
4334
|
target.parentNode.insertBefore(wrapper, target);
|
|
4282
4335
|
wrapper.appendChild(target);
|
|
4283
4336
|
target.hasWrapper = true;
|
|
@@ -4500,6 +4553,11 @@ var Button = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.f
|
|
|
4500
4553
|
var showTooltip = !disabled || props.tooltipOptions && props.tooltipOptions.showOnDisabled;
|
|
4501
4554
|
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip) && showTooltip;
|
|
4502
4555
|
var otherProps = ButtonBase.getOtherProps(props);
|
|
4556
|
+
var sizeMapping = {
|
|
4557
|
+
large: 'lg',
|
|
4558
|
+
small: 'sm'
|
|
4559
|
+
};
|
|
4560
|
+
var size = sizeMapping[props.size];
|
|
4503
4561
|
var className = classNames('p-button p-component', props.className, (_classNames2 = {
|
|
4504
4562
|
'p-button-icon-only': (props.icon || props.loading && props.loadingIcon) && !props.label && !props.children,
|
|
4505
4563
|
'p-button-vertical': (props.iconPos === 'top' || props.iconPos === 'bottom') && props.label,
|
|
@@ -4511,7 +4569,7 @@ var Button = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.f
|
|
|
4511
4569
|
'p-button-text': props.text,
|
|
4512
4570
|
'p-button-rounded': props.rounded,
|
|
4513
4571
|
'p-button-loading-label-only': props.loading && !props.icon && props.label
|
|
4514
|
-
}, _defineProperty(_classNames2, "p-button-loading-".concat(props.iconPos), props.loading && props.loadingIcon && props.label), _defineProperty(_classNames2, "p-button-".concat(
|
|
4572
|
+
}, _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));
|
|
4515
4573
|
var icon = createIcon();
|
|
4516
4574
|
var label = createLabel();
|
|
4517
4575
|
var badge = createBadge();
|
|
@@ -4743,14 +4801,18 @@ var VirtualScrollerBase = {
|
|
|
4743
4801
|
id: null,
|
|
4744
4802
|
style: null,
|
|
4745
4803
|
className: null,
|
|
4804
|
+
tabIndex: 0,
|
|
4746
4805
|
items: null,
|
|
4747
4806
|
itemSize: 0,
|
|
4748
4807
|
scrollHeight: null,
|
|
4749
4808
|
scrollWidth: null,
|
|
4750
4809
|
orientation: 'vertical',
|
|
4810
|
+
step: 0,
|
|
4751
4811
|
numToleratedItems: null,
|
|
4752
4812
|
delay: 0,
|
|
4753
4813
|
resizeDelay: 10,
|
|
4814
|
+
appendOnly: false,
|
|
4815
|
+
inline: false,
|
|
4754
4816
|
lazy: false,
|
|
4755
4817
|
disabled: false,
|
|
4756
4818
|
loaderDisabled: false,
|
|
@@ -4780,6 +4842,7 @@ function ownKeys$v(object, enumerableOnly) { var keys = Object.keys(object); if
|
|
|
4780
4842
|
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; }
|
|
4781
4843
|
var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
4782
4844
|
var props = VirtualScrollerBase.getProps(inProps);
|
|
4845
|
+
var prevProps = usePrevious(inProps) || {};
|
|
4783
4846
|
var vertical = props.orientation === 'vertical';
|
|
4784
4847
|
var horizontal = props.orientation === 'horizontal';
|
|
4785
4848
|
var both = props.orientation === 'both';
|
|
@@ -4797,25 +4860,29 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4797
4860
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
4798
4861
|
lastState = _React$useState4[0],
|
|
4799
4862
|
setLastState = _React$useState4[1];
|
|
4800
|
-
var _React$useState5 = React__namespace.useState(
|
|
4863
|
+
var _React$useState5 = React__namespace.useState(0),
|
|
4864
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
4865
|
+
pageState = _React$useState6[0],
|
|
4866
|
+
setPageState = _React$useState6[1];
|
|
4867
|
+
var _React$useState7 = React__namespace.useState(both ? {
|
|
4801
4868
|
rows: 0,
|
|
4802
4869
|
cols: 0
|
|
4803
4870
|
} : 0),
|
|
4804
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
4805
|
-
numItemsInViewportState = _React$useState6[0],
|
|
4806
|
-
setNumItemsInViewportState = _React$useState6[1];
|
|
4807
|
-
var _React$useState7 = React__namespace.useState(props.numToleratedItems),
|
|
4808
4871
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
var _React$useState9 = React__namespace.useState(props.
|
|
4872
|
+
numItemsInViewportState = _React$useState8[0],
|
|
4873
|
+
setNumItemsInViewportState = _React$useState8[1];
|
|
4874
|
+
var _React$useState9 = React__namespace.useState(props.numToleratedItems),
|
|
4812
4875
|
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
var _React$useState11 = React__namespace.useState(
|
|
4876
|
+
numToleratedItemsState = _React$useState10[0],
|
|
4877
|
+
setNumToleratedItemsState = _React$useState10[1];
|
|
4878
|
+
var _React$useState11 = React__namespace.useState(props.loading || false),
|
|
4816
4879
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
4817
|
-
|
|
4818
|
-
|
|
4880
|
+
loadingState = _React$useState12[0],
|
|
4881
|
+
setLoadingState = _React$useState12[1];
|
|
4882
|
+
var _React$useState13 = React__namespace.useState([]),
|
|
4883
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
4884
|
+
loaderArrState = _React$useState14[0],
|
|
4885
|
+
setLoaderArrState = _React$useState14[1];
|
|
4819
4886
|
var elementRef = React__namespace.useRef(null);
|
|
4820
4887
|
var _contentRef = React__namespace.useRef(null);
|
|
4821
4888
|
var _spacerRef = React__namespace.useRef(null);
|
|
@@ -4826,14 +4893,19 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4826
4893
|
} : 0);
|
|
4827
4894
|
var scrollTimeout = React__namespace.useRef(null);
|
|
4828
4895
|
var resizeTimeout = React__namespace.useRef(null);
|
|
4896
|
+
var contentStyle = React__namespace.useRef({});
|
|
4897
|
+
var spacerStyle = React__namespace.useRef({});
|
|
4829
4898
|
var defaultWidth = React__namespace.useRef(null);
|
|
4830
4899
|
var defaultHeight = React__namespace.useRef(null);
|
|
4831
|
-
var
|
|
4832
|
-
var
|
|
4900
|
+
var defaultContentWidth = React__namespace.useRef(null);
|
|
4901
|
+
var defaultContentHeight = React__namespace.useRef(null);
|
|
4902
|
+
var isItemRangeChanged = React__namespace.useRef(false);
|
|
4903
|
+
var lazyLoadState = React__namespace.useRef(null);
|
|
4833
4904
|
var _useResizeListener = useResizeListener({
|
|
4834
4905
|
listener: function listener(event) {
|
|
4835
4906
|
return onResize();
|
|
4836
|
-
}
|
|
4907
|
+
},
|
|
4908
|
+
when: !props.disabled
|
|
4837
4909
|
}),
|
|
4838
4910
|
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
4839
4911
|
bindWindowResizeListener = _useResizeListener2[0];
|
|
@@ -4842,13 +4914,23 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4842
4914
|
type: 'orientationchange',
|
|
4843
4915
|
listener: function listener(event) {
|
|
4844
4916
|
return onResize();
|
|
4845
|
-
}
|
|
4917
|
+
},
|
|
4918
|
+
when: !props.disabled
|
|
4846
4919
|
}),
|
|
4847
4920
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
4848
4921
|
bindOrientationChangeListener = _useEventListener2[0];
|
|
4849
4922
|
var getElementRef = function getElementRef() {
|
|
4850
4923
|
return elementRef;
|
|
4851
4924
|
};
|
|
4925
|
+
var getPageByFirst = function getPageByFirst(first) {
|
|
4926
|
+
return Math.floor((first + numToleratedItemsState * 4) / (props.step || 1));
|
|
4927
|
+
};
|
|
4928
|
+
var setContentElement = function setContentElement(element) {
|
|
4929
|
+
_contentRef.current = element || _contentRef.current || DomHandler.findSingle(elementRef.current, '.p-virtualscroller-content');
|
|
4930
|
+
};
|
|
4931
|
+
var isPageChanged = function isPageChanged(first) {
|
|
4932
|
+
return props.step ? pageState !== getPageByFirst(first) : true;
|
|
4933
|
+
};
|
|
4852
4934
|
var scrollTo = function scrollTo(options) {
|
|
4853
4935
|
lastScrollPos.current = both ? {
|
|
4854
4936
|
top: 0,
|
|
@@ -4860,13 +4942,14 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4860
4942
|
var behavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'auto';
|
|
4861
4943
|
var _calculateNumItems = calculateNumItems(),
|
|
4862
4944
|
numToleratedItems = _calculateNumItems.numToleratedItems;
|
|
4945
|
+
var contentPos = getContentPosition();
|
|
4863
4946
|
var calculateFirst = function calculateFirst() {
|
|
4864
4947
|
var _index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
4865
4948
|
var _numT = arguments.length > 1 ? arguments[1] : undefined;
|
|
4866
4949
|
return _index <= _numT ? 0 : _index;
|
|
4867
4950
|
};
|
|
4868
|
-
var calculateCoord = function calculateCoord(_first, _size) {
|
|
4869
|
-
return _first * _size;
|
|
4951
|
+
var calculateCoord = function calculateCoord(_first, _size, _cpos) {
|
|
4952
|
+
return _first * _size + _cpos;
|
|
4870
4953
|
};
|
|
4871
4954
|
var scrollToItem = function scrollToItem() {
|
|
4872
4955
|
var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -4877,20 +4960,25 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4877
4960
|
behavior: behavior
|
|
4878
4961
|
});
|
|
4879
4962
|
};
|
|
4963
|
+
var newFirst = both ? {
|
|
4964
|
+
rows: 0,
|
|
4965
|
+
cols: 0
|
|
4966
|
+
} : 0;
|
|
4967
|
+
var isRangeChanged = false;
|
|
4880
4968
|
if (both) {
|
|
4881
|
-
|
|
4969
|
+
newFirst = {
|
|
4882
4970
|
rows: calculateFirst(index[0], numToleratedItems[0]),
|
|
4883
4971
|
cols: calculateFirst(index[1], numToleratedItems[1])
|
|
4884
4972
|
};
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
}
|
|
4973
|
+
scrollToItem(calculateCoord(newFirst.cols, props.itemSize[1], contentPos.left), calculateCoord(newFirst.rows, props.itemSize[0], contentPos.top));
|
|
4974
|
+
isRangeChanged = firstState.rows !== newFirst.rows || firstState.cols !== newFirst.cols;
|
|
4888
4975
|
} else {
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
}
|
|
4976
|
+
newFirst = calculateFirst(index, numToleratedItems);
|
|
4977
|
+
horizontal ? scrollToItem(calculateCoord(newFirst, props.itemSize, contentPos.left), 0) : scrollToItem(0, calculateCoord(newFirst, props.itemSize, contentPos.top));
|
|
4978
|
+
isRangeChanged = firstState !== newFirst;
|
|
4893
4979
|
}
|
|
4980
|
+
isItemRangeChanged.current = isRangeChanged;
|
|
4981
|
+
setFirstState(newFirst);
|
|
4894
4982
|
};
|
|
4895
4983
|
var scrollInView = function scrollInView(index, to) {
|
|
4896
4984
|
var behavior = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'auto';
|
|
@@ -5007,7 +5095,8 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5007
5095
|
var _calculateNumItems2 = calculateNumItems(),
|
|
5008
5096
|
numItemsInViewport = _calculateNumItems2.numItemsInViewport,
|
|
5009
5097
|
numToleratedItems = _calculateNumItems2.numToleratedItems;
|
|
5010
|
-
var calculateLast = function calculateLast(_first, _num, _numT
|
|
5098
|
+
var calculateLast = function calculateLast(_first, _num, _numT) {
|
|
5099
|
+
var _isCols = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
5011
5100
|
return getLast(_first + _num + (_first < _numT ? 2 : 3) * _numT, _isCols);
|
|
5012
5101
|
};
|
|
5013
5102
|
var last = both ? {
|
|
@@ -5029,9 +5118,15 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5029
5118
|
}));
|
|
5030
5119
|
}
|
|
5031
5120
|
if (props.lazy) {
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5121
|
+
Promise.resolve().then(function () {
|
|
5122
|
+
lazyLoadState.current = {
|
|
5123
|
+
first: props.step ? both ? {
|
|
5124
|
+
rows: 0,
|
|
5125
|
+
cols: firstState.cols
|
|
5126
|
+
} : 0 : firstState,
|
|
5127
|
+
last: Math.min(props.step ? props.step : last, props.items.length)
|
|
5128
|
+
};
|
|
5129
|
+
props.onLazyLoad && props.onLazyLoad(lazyLoadState.current);
|
|
5035
5130
|
});
|
|
5036
5131
|
}
|
|
5037
5132
|
};
|
|
@@ -5040,12 +5135,21 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5040
5135
|
Promise.resolve().then(function () {
|
|
5041
5136
|
if (_contentRef.current) {
|
|
5042
5137
|
_contentRef.current.style.minHeight = _contentRef.current.style.minWidth = 'auto';
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5138
|
+
_contentRef.current.style.position = 'relative';
|
|
5139
|
+
elementRef.current.style.contain = 'none';
|
|
5140
|
+
|
|
5141
|
+
/*const [contentWidth, contentHeight] = [DomHandler.getWidth(contentRef.current), DomHandler.getHeight(contentRef.current)];
|
|
5142
|
+
contentWidth !== defaultContentWidth.current && (elementRef.current.style.width = '');
|
|
5143
|
+
contentHeight !== defaultContentHeight.current && (elementRef.current.style.height = '');*/
|
|
5144
|
+
|
|
5145
|
+
var _ref = [DomHandler.getWidth(elementRef.current), DomHandler.getHeight(elementRef.current)],
|
|
5146
|
+
width = _ref[0],
|
|
5147
|
+
height = _ref[1];
|
|
5148
|
+
(both || horizontal) && (elementRef.current.style.width = (width < defaultWidth.current ? width : props.scrollWidth || defaultWidth.current) + 'px');
|
|
5149
|
+
(both || vertical) && (elementRef.current.style.height = (height < defaultHeight.current ? height : props.scrollHeight || defaultHeight.current) + 'px');
|
|
5048
5150
|
_contentRef.current.style.minHeight = _contentRef.current.style.minWidth = '';
|
|
5151
|
+
_contentRef.current.style.position = '';
|
|
5152
|
+
elementRef.current.style.contain = '';
|
|
5049
5153
|
}
|
|
5050
5154
|
});
|
|
5051
5155
|
}
|
|
@@ -5058,10 +5162,10 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5058
5162
|
var getContentPosition = function getContentPosition() {
|
|
5059
5163
|
if (_contentRef.current) {
|
|
5060
5164
|
var style = getComputedStyle(_contentRef.current);
|
|
5061
|
-
var left =
|
|
5062
|
-
var right =
|
|
5063
|
-
var top =
|
|
5064
|
-
var bottom =
|
|
5165
|
+
var left = parseFloat(style.paddingLeft) + Math.max(parseFloat(style.left) || 0, 0);
|
|
5166
|
+
var right = parseFloat(style.paddingRight) + Math.max(parseFloat(style.right) || 0, 0);
|
|
5167
|
+
var top = parseFloat(style.paddingTop) + Math.max(parseFloat(style.top) || 0, 0);
|
|
5168
|
+
var bottom = parseFloat(style.paddingBottom) + Math.max(parseFloat(style.bottom) || 0, 0);
|
|
5065
5169
|
return {
|
|
5066
5170
|
left: left,
|
|
5067
5171
|
right: right,
|
|
@@ -5098,11 +5202,11 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5098
5202
|
};
|
|
5099
5203
|
var setSpacerSize = function setSpacerSize() {
|
|
5100
5204
|
var items = props.items;
|
|
5101
|
-
if (
|
|
5205
|
+
if (items) {
|
|
5102
5206
|
var contentPos = getContentPosition();
|
|
5103
5207
|
var setProp = function setProp(_name, _value, _size) {
|
|
5104
5208
|
var _cpos = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5105
|
-
return
|
|
5209
|
+
return spacerStyle.current = _objectSpread$v(_objectSpread$v({}, spacerStyle.current), _defineProperty({}, "".concat(_name), (_value || []).length * _size + _cpos + 'px'));
|
|
5106
5210
|
};
|
|
5107
5211
|
if (both) {
|
|
5108
5212
|
setProp('height', items, props.itemSize[0], contentPos.y);
|
|
@@ -5113,7 +5217,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5113
5217
|
}
|
|
5114
5218
|
};
|
|
5115
5219
|
var setContentPosition = function setContentPosition(pos) {
|
|
5116
|
-
if (_contentRef.current) {
|
|
5220
|
+
if (_contentRef.current && !props.appendOnly) {
|
|
5117
5221
|
var first = pos ? pos.first : firstState;
|
|
5118
5222
|
var calculateTranslateVal = function calculateTranslateVal(_first, _size) {
|
|
5119
5223
|
return _first * _size;
|
|
@@ -5122,7 +5226,9 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5122
5226
|
var _x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
5123
5227
|
var _y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
5124
5228
|
_stickyRef.current && (_stickyRef.current.style.top = "-".concat(_y, "px"));
|
|
5125
|
-
|
|
5229
|
+
contentStyle.current = _objectSpread$v(_objectSpread$v({}, contentStyle.current), {
|
|
5230
|
+
transform: "translate3d(".concat(_x, "px, ").concat(_y, "px, 0)")
|
|
5231
|
+
});
|
|
5126
5232
|
};
|
|
5127
5233
|
if (both) {
|
|
5128
5234
|
setTransform(calculateTranslateVal(first.cols, props.itemSize[1]), calculateTranslateVal(first.rows, props.itemSize[0]));
|
|
@@ -5166,36 +5272,40 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5166
5272
|
if (both) {
|
|
5167
5273
|
var isScrollDown = lastScrollPos.current.top <= scrollTop;
|
|
5168
5274
|
var isScrollRight = lastScrollPos.current.left <= scrollLeft;
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5275
|
+
if (!props.appendOnly || props.appendOnly && (isScrollDown || isScrollRight)) {
|
|
5276
|
+
var currentIndex = {
|
|
5277
|
+
rows: calculateCurrentIndex(scrollTop, props.itemSize[0]),
|
|
5278
|
+
cols: calculateCurrentIndex(scrollLeft, props.itemSize[1])
|
|
5279
|
+
};
|
|
5280
|
+
var triggerIndex = {
|
|
5281
|
+
rows: calculateTriggerIndex(currentIndex.rows, firstState.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0], isScrollDown),
|
|
5282
|
+
cols: calculateTriggerIndex(currentIndex.cols, firstState.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], isScrollRight)
|
|
5283
|
+
};
|
|
5284
|
+
newFirst = {
|
|
5285
|
+
rows: calculateFirst(currentIndex.rows, triggerIndex.rows, firstState.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0], isScrollDown),
|
|
5286
|
+
cols: calculateFirst(currentIndex.cols, triggerIndex.cols, firstState.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], isScrollRight)
|
|
5287
|
+
};
|
|
5288
|
+
newLast = {
|
|
5289
|
+
rows: calculateLast(currentIndex.rows, newFirst.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0]),
|
|
5290
|
+
cols: calculateLast(currentIndex.cols, newFirst.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], true)
|
|
5291
|
+
};
|
|
5292
|
+
isRangeChanged = newFirst.rows !== firstState.rows || newLast.rows !== lastState.rows || newFirst.cols !== firstState.cols || newLast.cols !== lastState.cols || isItemRangeChanged.current;
|
|
5293
|
+
newScrollPos = {
|
|
5294
|
+
top: scrollTop,
|
|
5295
|
+
left: scrollLeft
|
|
5296
|
+
};
|
|
5297
|
+
}
|
|
5190
5298
|
} else {
|
|
5191
5299
|
var scrollPos = horizontal ? scrollLeft : scrollTop;
|
|
5192
5300
|
var isScrollDownOrRight = lastScrollPos.current <= scrollPos;
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5301
|
+
if (!props.appendOnly || props.appendOnly && isScrollDownOrRight) {
|
|
5302
|
+
var _currentIndex2 = calculateCurrentIndex(scrollPos, props.itemSize);
|
|
5303
|
+
var _triggerIndex2 = calculateTriggerIndex(_currentIndex2, firstState, lastState, numItemsInViewportState, numToleratedItemsState, isScrollDownOrRight);
|
|
5304
|
+
newFirst = calculateFirst(_currentIndex2, _triggerIndex2, firstState, lastState, numItemsInViewportState, numToleratedItemsState, isScrollDownOrRight);
|
|
5305
|
+
newLast = calculateLast(_currentIndex2, newFirst, lastState, numItemsInViewportState, numToleratedItemsState);
|
|
5306
|
+
isRangeChanged = newFirst !== firstState || newLast !== lastState || isItemRangeChanged.current;
|
|
5307
|
+
newScrollPos = scrollPos;
|
|
5308
|
+
}
|
|
5199
5309
|
}
|
|
5200
5310
|
return {
|
|
5201
5311
|
first: newFirst,
|
|
@@ -5220,8 +5330,14 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5220
5330
|
setLastState(last);
|
|
5221
5331
|
lastScrollPos.current = scrollPos;
|
|
5222
5332
|
props.onScrollIndexChange && props.onScrollIndexChange(newState);
|
|
5223
|
-
if (props.lazy) {
|
|
5224
|
-
|
|
5333
|
+
if (props.lazy && isPageChanged(first)) {
|
|
5334
|
+
var newLazyLoadState = {
|
|
5335
|
+
first: props.step ? Math.min(getPageByFirst(first) * props.step, props.items.length - props.step) : first,
|
|
5336
|
+
last: Math.min(props.step ? (getPageByFirst(first) + 1) * props.step : last, props.items.length)
|
|
5337
|
+
};
|
|
5338
|
+
var isLazyStateChanged = !lazyLoadState.current || lazyLoadState.current.first !== newLazyLoadState.first || lazyLoadState.current.last !== newLazyLoadState.last;
|
|
5339
|
+
isLazyStateChanged && props.onLazyLoad && props.onLazyLoad(newLazyLoadState);
|
|
5340
|
+
lazyLoadState.current = newLazyLoadState;
|
|
5225
5341
|
}
|
|
5226
5342
|
}
|
|
5227
5343
|
};
|
|
@@ -5231,17 +5347,21 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5231
5347
|
if (scrollTimeout.current) {
|
|
5232
5348
|
clearTimeout(scrollTimeout.current);
|
|
5233
5349
|
}
|
|
5234
|
-
if (
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5350
|
+
if (isPageChanged(firstState)) {
|
|
5351
|
+
if (!loadingState && props.showLoader) {
|
|
5352
|
+
var _onScrollPositionChan2 = onScrollPositionChange(event),
|
|
5353
|
+
isRangeChanged = _onScrollPositionChan2.isRangeChanged;
|
|
5354
|
+
var changed = isRangeChanged || (props.step ? isPageChanged(firstState) : false);
|
|
5355
|
+
changed && setLoadingState(true);
|
|
5356
|
+
}
|
|
5357
|
+
scrollTimeout.current = setTimeout(function () {
|
|
5358
|
+
onScrollChange(event);
|
|
5359
|
+
if (loadingState && props.showLoader && (!props.lazy || props.loading === undefined)) {
|
|
5360
|
+
setLoadingState(false);
|
|
5361
|
+
setPageState(getPageByFirst(firstState));
|
|
5362
|
+
}
|
|
5363
|
+
}, props.delay);
|
|
5238
5364
|
}
|
|
5239
|
-
scrollTimeout.current = setTimeout(function () {
|
|
5240
|
-
onScrollChange(event);
|
|
5241
|
-
if (loadingState && props.showLoader && (!props.lazy || props.loading === undefined)) {
|
|
5242
|
-
setLoadingState(false);
|
|
5243
|
-
}
|
|
5244
|
-
}, props.delay);
|
|
5245
5365
|
} else {
|
|
5246
5366
|
onScrollChange(event);
|
|
5247
5367
|
}
|
|
@@ -5252,9 +5372,9 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5252
5372
|
}
|
|
5253
5373
|
resizeTimeout.current = setTimeout(function () {
|
|
5254
5374
|
if (elementRef.current) {
|
|
5255
|
-
var
|
|
5256
|
-
width =
|
|
5257
|
-
height =
|
|
5375
|
+
var _ref2 = [DomHandler.getWidth(elementRef.current), DomHandler.getHeight(elementRef.current)],
|
|
5376
|
+
width = _ref2[0],
|
|
5377
|
+
height = _ref2[1];
|
|
5258
5378
|
var isDiffWidth = width !== defaultWidth.current,
|
|
5259
5379
|
isDiffHeight = height !== defaultHeight.current;
|
|
5260
5380
|
var reinit = both ? isDiffWidth || isDiffHeight : horizontal ? isDiffWidth : vertical ? isDiffHeight : false;
|
|
@@ -5262,6 +5382,8 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5262
5382
|
setNumToleratedItemsState(props.numToleratedItems);
|
|
5263
5383
|
defaultWidth.current = width;
|
|
5264
5384
|
defaultHeight.current = height;
|
|
5385
|
+
defaultContentWidth.current = DomHandler.getWidth(_contentRef.current);
|
|
5386
|
+
defaultContentHeight.current = DomHandler.getHeight(_contentRef.current);
|
|
5265
5387
|
}
|
|
5266
5388
|
}
|
|
5267
5389
|
}, props.resizeDelay);
|
|
@@ -5294,12 +5416,24 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5294
5416
|
var loadedItems = function loadedItems() {
|
|
5295
5417
|
var items = props.items;
|
|
5296
5418
|
if (items && !loadingState) {
|
|
5297
|
-
if (both) return items.slice(firstState.rows, lastState.rows).map(function (item) {
|
|
5298
|
-
return props.columns ? item : item.slice(firstState.cols, lastState.cols);
|
|
5299
|
-
});else if (horizontal && props.columns) return items;else return items.slice(firstState, lastState);
|
|
5419
|
+
if (both) return items.slice(props.appendOnly ? 0 : firstState.rows, lastState.rows).map(function (item) {
|
|
5420
|
+
return props.columns ? item : item.slice(props.appendOnly ? 0 : firstState.cols, lastState.cols);
|
|
5421
|
+
});else if (horizontal && props.columns) return items;else return items.slice(props.appendOnly ? 0 : firstState, lastState);
|
|
5300
5422
|
}
|
|
5301
5423
|
return [];
|
|
5302
5424
|
};
|
|
5425
|
+
var viewInit = function viewInit() {
|
|
5426
|
+
if (elementRef.current && DomHandler.isVisible(elementRef.current)) {
|
|
5427
|
+
setContentElement(_contentRef.current);
|
|
5428
|
+
init();
|
|
5429
|
+
bindWindowResizeListener();
|
|
5430
|
+
bindOrientationChangeListener();
|
|
5431
|
+
defaultWidth.current = DomHandler.getWidth(elementRef.current);
|
|
5432
|
+
defaultHeight.current = DomHandler.getHeight(elementRef.current);
|
|
5433
|
+
defaultContentWidth.current = DomHandler.getWidth(_contentRef.current);
|
|
5434
|
+
defaultContentHeight.current = DomHandler.getHeight(_contentRef.current);
|
|
5435
|
+
}
|
|
5436
|
+
};
|
|
5303
5437
|
var init = function init() {
|
|
5304
5438
|
if (!props.disabled) {
|
|
5305
5439
|
setSize();
|
|
@@ -5308,17 +5442,11 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5308
5442
|
}
|
|
5309
5443
|
};
|
|
5310
5444
|
useMountEffect(function () {
|
|
5311
|
-
|
|
5312
|
-
init();
|
|
5313
|
-
bindWindowResizeListener();
|
|
5314
|
-
bindOrientationChangeListener();
|
|
5315
|
-
defaultWidth.current = DomHandler.getWidth(elementRef.current);
|
|
5316
|
-
defaultHeight.current = DomHandler.getHeight(elementRef.current);
|
|
5317
|
-
}
|
|
5445
|
+
viewInit();
|
|
5318
5446
|
});
|
|
5319
5447
|
useUpdateEffect(function () {
|
|
5320
5448
|
init();
|
|
5321
|
-
}, [props.itemSize, props.scrollHeight]);
|
|
5449
|
+
}, [props.itemSize, props.scrollHeight, props.scrollWidth]);
|
|
5322
5450
|
useUpdateEffect(function () {
|
|
5323
5451
|
if (props.numToleratedItems !== numToleratedItemsState) {
|
|
5324
5452
|
setNumToleratedItemsState(props.numToleratedItems);
|
|
@@ -5330,11 +5458,11 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5330
5458
|
}
|
|
5331
5459
|
}, [numToleratedItemsState]);
|
|
5332
5460
|
useUpdateEffect(function () {
|
|
5333
|
-
if (!
|
|
5461
|
+
if (!prevProps.items || prevProps.items.length !== (props.items || []).length) {
|
|
5334
5462
|
init();
|
|
5335
5463
|
}
|
|
5336
5464
|
var loading = loadingState;
|
|
5337
|
-
if (props.lazy &&
|
|
5465
|
+
if (props.lazy && prevProps.loading !== props.loading && props.loading !== loadingState) {
|
|
5338
5466
|
setLoadingState(props.loading);
|
|
5339
5467
|
loading = props.loading;
|
|
5340
5468
|
}
|
|
@@ -5396,6 +5524,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5396
5524
|
if (props.showSpacer) {
|
|
5397
5525
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
5398
5526
|
ref: _spacerRef,
|
|
5527
|
+
style: spacerStyle.current,
|
|
5399
5528
|
className: "p-virtualscroller-spacer"
|
|
5400
5529
|
});
|
|
5401
5530
|
}
|
|
@@ -5419,11 +5548,14 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5419
5548
|
});
|
|
5420
5549
|
var content = /*#__PURE__*/React__namespace.createElement("div", {
|
|
5421
5550
|
ref: _contentRef,
|
|
5551
|
+
style: contentStyle.current,
|
|
5422
5552
|
className: className
|
|
5423
5553
|
}, items);
|
|
5424
5554
|
if (props.contentTemplate) {
|
|
5425
5555
|
var defaultOptions = {
|
|
5556
|
+
style: contentStyle.current,
|
|
5426
5557
|
className: className,
|
|
5558
|
+
spacerStyle: spacerStyle.current,
|
|
5427
5559
|
contentRef: function contentRef(el) {
|
|
5428
5560
|
return _contentRef.current = ObjectUtils.getRefElement(el);
|
|
5429
5561
|
},
|
|
@@ -5466,10 +5598,9 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5466
5598
|
} else {
|
|
5467
5599
|
var otherProps = VirtualScrollerBase.getOtherProps(props);
|
|
5468
5600
|
var className = classNames('p-virtualscroller', {
|
|
5469
|
-
'p-
|
|
5470
|
-
'p-virtualscroller-both': both,
|
|
5471
|
-
'p-virtualscroller-horizontal': horizontal
|
|
5472
|
-
'p-horizontal-scroll': horizontal
|
|
5601
|
+
'p-virtualscroller-inline': props.inline,
|
|
5602
|
+
'p-virtualscroller-both p-both-scroll': both,
|
|
5603
|
+
'p-virtualscroller-horizontal p-horizontal-scroll': horizontal
|
|
5473
5604
|
}, props.className);
|
|
5474
5605
|
var loader = createLoader();
|
|
5475
5606
|
var _content = createContent();
|
|
@@ -5477,7 +5608,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5477
5608
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
5478
5609
|
ref: elementRef,
|
|
5479
5610
|
className: className,
|
|
5480
|
-
tabIndex:
|
|
5611
|
+
tabIndex: props.tabIndex,
|
|
5481
5612
|
style: props.style
|
|
5482
5613
|
}, otherProps, {
|
|
5483
5614
|
onScroll: onScroll
|
|
@@ -5573,6 +5704,7 @@ var AutoCompletePanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__
|
|
|
5573
5704
|
var className = classNames('p-autocomplete-items', options.className);
|
|
5574
5705
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
5575
5706
|
ref: options.contentRef,
|
|
5707
|
+
style: options.style,
|
|
5576
5708
|
className: className,
|
|
5577
5709
|
role: "listbox",
|
|
5578
5710
|
id: props.listId
|
|
@@ -6244,7 +6376,7 @@ var Avatar = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
|
6244
6376
|
imageFailed = _React$useState2[0],
|
|
6245
6377
|
setImageFailed = _React$useState2[1];
|
|
6246
6378
|
var createContent = function createContent() {
|
|
6247
|
-
if (props.image && !imageFailed) {
|
|
6379
|
+
if (ObjectUtils.isNotEmpty(props.image) && !imageFailed) {
|
|
6248
6380
|
return /*#__PURE__*/React__namespace.createElement("img", {
|
|
6249
6381
|
src: props.image,
|
|
6250
6382
|
alt: props.imageAlt,
|
|
@@ -6286,7 +6418,7 @@ var Avatar = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
|
6286
6418
|
});
|
|
6287
6419
|
var otherProps = AvatarBase.getOtherProps(props);
|
|
6288
6420
|
var containerClassName = classNames('p-avatar p-component', {
|
|
6289
|
-
'p-avatar-image': props.image
|
|
6421
|
+
'p-avatar-image': ObjectUtils.isNotEmpty(props.image) && !imageFailed,
|
|
6290
6422
|
'p-avatar-circle': props.shape === 'circle',
|
|
6291
6423
|
'p-avatar-lg': props.size === 'large',
|
|
6292
6424
|
'p-avatar-xl': props.size === 'xlarge',
|
|
@@ -8859,7 +8991,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
8859
8991
|
setValue(props.value);
|
|
8860
8992
|
}
|
|
8861
8993
|
return function () {
|
|
8862
|
-
props.mask && unbindMaskEvents();
|
|
8994
|
+
props.mask && unbindMaskEvents && unbindMaskEvents();
|
|
8863
8995
|
};
|
|
8864
8996
|
});
|
|
8865
8997
|
useUpdateEffect(function () {
|
|
@@ -9083,7 +9215,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
9083
9215
|
}
|
|
9084
9216
|
return _content2;
|
|
9085
9217
|
}
|
|
9086
|
-
var displayYear = props.
|
|
9218
|
+
var displayYear = props.numberOfMonths > 1 ? metaYear : currentYear;
|
|
9087
9219
|
return currentView !== 'year' && /*#__PURE__*/React__namespace.createElement("button", {
|
|
9088
9220
|
className: "p-datepicker-year p-link",
|
|
9089
9221
|
onClick: switchToYearView,
|
|
@@ -13167,6 +13299,8 @@ var ContextMenuBase = {
|
|
|
13167
13299
|
global: false,
|
|
13168
13300
|
autoZIndex: true,
|
|
13169
13301
|
baseZIndex: 0,
|
|
13302
|
+
breakpoint: undefined,
|
|
13303
|
+
scrollHeight: '400px',
|
|
13170
13304
|
appendTo: null,
|
|
13171
13305
|
transitionOptions: null,
|
|
13172
13306
|
onShow: null,
|
|
@@ -13192,7 +13326,7 @@ var ContextMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
13192
13326
|
setActiveItemState(null);
|
|
13193
13327
|
}
|
|
13194
13328
|
var onItemMouseEnter = function onItemMouseEnter(event, item) {
|
|
13195
|
-
if (item.disabled) {
|
|
13329
|
+
if (item.disabled || props.isMobileMode) {
|
|
13196
13330
|
event.preventDefault();
|
|
13197
13331
|
return;
|
|
13198
13332
|
}
|
|
@@ -13212,26 +13346,31 @@ var ContextMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
13212
13346
|
item: item
|
|
13213
13347
|
});
|
|
13214
13348
|
}
|
|
13349
|
+
if (props.isMobileMode && item.items) {
|
|
13350
|
+
if (activeItemState && item === activeItemState) setActiveItemState(null);else setActiveItemState(item);
|
|
13351
|
+
}
|
|
13215
13352
|
if (!item.items) {
|
|
13216
13353
|
props.onLeafClick(event);
|
|
13217
13354
|
}
|
|
13218
13355
|
};
|
|
13219
13356
|
var position = function position() {
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13357
|
+
if (!props.isMobileMode) {
|
|
13358
|
+
var parentItem = submenuRef.current.parentElement;
|
|
13359
|
+
var containerOffset = DomHandler.getOffset(parentItem);
|
|
13360
|
+
var viewport = DomHandler.getViewport();
|
|
13361
|
+
var sublistWidth = submenuRef.current.offsetParent ? submenuRef.current.offsetWidth : DomHandler.getHiddenElementOuterWidth(submenuRef.current);
|
|
13362
|
+
var itemOuterWidth = DomHandler.getOuterWidth(parentItem.children[0]);
|
|
13363
|
+
var top = parseInt(containerOffset.top, 10) + submenuRef.current.offsetHeight - DomHandler.getWindowScrollTop();
|
|
13364
|
+
if (top > viewport.height) {
|
|
13365
|
+
submenuRef.current.style.top = viewport.height - top + 'px';
|
|
13366
|
+
} else {
|
|
13367
|
+
submenuRef.current.style.top = '0px';
|
|
13368
|
+
}
|
|
13369
|
+
if (parseInt(containerOffset.left, 10) + itemOuterWidth + sublistWidth > viewport.width - DomHandler.calculateScrollbarWidth()) {
|
|
13370
|
+
submenuRef.current.style.left = -1 * sublistWidth + 'px';
|
|
13371
|
+
} else {
|
|
13372
|
+
submenuRef.current.style.left = itemOuterWidth + 'px';
|
|
13373
|
+
}
|
|
13235
13374
|
}
|
|
13236
13375
|
};
|
|
13237
13376
|
var onEnter = function onEnter() {
|
|
@@ -13253,7 +13392,8 @@ var ContextMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
13253
13392
|
menuProps: props.menuProps,
|
|
13254
13393
|
model: item.items,
|
|
13255
13394
|
resetMenu: item !== activeItemState,
|
|
13256
|
-
onLeafClick: props.onLeafClick
|
|
13395
|
+
onLeafClick: props.onLeafClick,
|
|
13396
|
+
isMobileMode: props.isMobileMode
|
|
13257
13397
|
});
|
|
13258
13398
|
}
|
|
13259
13399
|
return null;
|
|
@@ -13362,8 +13502,14 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13362
13502
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
13363
13503
|
resetMenuState = _React$useState6[0],
|
|
13364
13504
|
setResetMenuState = _React$useState6[1];
|
|
13505
|
+
var _React$useState7 = React__namespace.useState(null),
|
|
13506
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
13507
|
+
attributeSelectorState = _React$useState8[0],
|
|
13508
|
+
setAttributeSelectorState = _React$useState8[1];
|
|
13365
13509
|
var menuRef = React__namespace.useRef(null);
|
|
13366
13510
|
var currentEvent = React__namespace.useRef(null);
|
|
13511
|
+
var styleElementRef = React__namespace.useRef(null);
|
|
13512
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
13367
13513
|
var _useEventListener = useEventListener({
|
|
13368
13514
|
type: 'click',
|
|
13369
13515
|
listener: function listener(event) {
|
|
@@ -13394,6 +13540,17 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13394
13540
|
_useResizeListener2 = _slicedToArray(_useResizeListener, 2),
|
|
13395
13541
|
bindDocumentResizeListener = _useResizeListener2[0],
|
|
13396
13542
|
unbindDocumentResizeListener = _useResizeListener2[1];
|
|
13543
|
+
var createStyle = function createStyle() {
|
|
13544
|
+
if (!styleElementRef.current) {
|
|
13545
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
13546
|
+
var selector = "".concat(attributeSelectorState);
|
|
13547
|
+
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");
|
|
13548
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
13549
|
+
}
|
|
13550
|
+
};
|
|
13551
|
+
var destroyStyle = function destroyStyle() {
|
|
13552
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
13553
|
+
};
|
|
13397
13554
|
var onMenuClick = function onMenuClick() {
|
|
13398
13555
|
setResetMenuState(false);
|
|
13399
13556
|
};
|
|
@@ -13422,6 +13579,10 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13422
13579
|
ZIndexUtils.set('menu', menuRef.current, PrimeReact.autoZIndex, props.baseZIndex || PrimeReact.zIndex['menu']);
|
|
13423
13580
|
}
|
|
13424
13581
|
position(currentEvent.current);
|
|
13582
|
+
if (attributeSelectorState && props.breakpoint) {
|
|
13583
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
13584
|
+
createStyle();
|
|
13585
|
+
}
|
|
13425
13586
|
};
|
|
13426
13587
|
var onEntered = function onEntered() {
|
|
13427
13588
|
bindDocumentListeners();
|
|
@@ -13432,6 +13593,7 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13432
13593
|
};
|
|
13433
13594
|
var onExited = function onExited() {
|
|
13434
13595
|
ZIndexUtils.clear(menuRef.current);
|
|
13596
|
+
destroyStyle();
|
|
13435
13597
|
};
|
|
13436
13598
|
var position = function position(event) {
|
|
13437
13599
|
if (event) {
|
|
@@ -13484,7 +13646,19 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13484
13646
|
if (props.global) {
|
|
13485
13647
|
bindDocumentContextMenuListener();
|
|
13486
13648
|
}
|
|
13649
|
+
if (props.breakpoint) {
|
|
13650
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
13651
|
+
}
|
|
13487
13652
|
});
|
|
13653
|
+
useUpdateEffect(function () {
|
|
13654
|
+
if (attributeSelectorState && menuRef.current) {
|
|
13655
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
13656
|
+
createStyle();
|
|
13657
|
+
}
|
|
13658
|
+
return function () {
|
|
13659
|
+
destroyStyle();
|
|
13660
|
+
};
|
|
13661
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
13488
13662
|
useUpdateEffect(function () {
|
|
13489
13663
|
if (visibleState) {
|
|
13490
13664
|
setVisibleState(false);
|
|
@@ -13540,7 +13714,8 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13540
13714
|
model: props.model,
|
|
13541
13715
|
root: true,
|
|
13542
13716
|
resetMenu: resetMenuState,
|
|
13543
|
-
onLeafClick: onLeafClick
|
|
13717
|
+
onLeafClick: onLeafClick,
|
|
13718
|
+
isMobileMode: isMobileMode
|
|
13544
13719
|
})));
|
|
13545
13720
|
};
|
|
13546
13721
|
var element = createContextMenu();
|
|
@@ -15501,6 +15676,7 @@ var DropdownPanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__name
|
|
|
15501
15676
|
var content = isEmptyFilter ? createEmptyMessage() : options.children;
|
|
15502
15677
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
15503
15678
|
ref: options.contentRef,
|
|
15679
|
+
style: options.style,
|
|
15504
15680
|
className: className,
|
|
15505
15681
|
role: "listbox"
|
|
15506
15682
|
}, content);
|
|
@@ -16318,7 +16494,6 @@ RowsPerPageDropdown.displayName = 'RowsPerPageDropdown';
|
|
|
16318
16494
|
var Paginator = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
16319
16495
|
var props = PaginatorBase.getProps(inProps);
|
|
16320
16496
|
var elementRef = React__namespace.useRef(null);
|
|
16321
|
-
var rppChanged = React__namespace.useRef(false);
|
|
16322
16497
|
var page = Math.floor(props.first / props.rows);
|
|
16323
16498
|
var pageCount = Math.ceil(props.totalRecords / props.rows);
|
|
16324
16499
|
var isFirstPage = page === 0;
|
|
@@ -16383,7 +16558,6 @@ var Paginator = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
16383
16558
|
};
|
|
16384
16559
|
var onRowsChange = function onRowsChange(event) {
|
|
16385
16560
|
var rows = event.value;
|
|
16386
|
-
rppChanged.current = rows !== props.rows;
|
|
16387
16561
|
changePage(0, rows);
|
|
16388
16562
|
};
|
|
16389
16563
|
React__namespace.useImperativeHandle(ref, function () {
|
|
@@ -16394,12 +16568,6 @@ var Paginator = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
16394
16568
|
}
|
|
16395
16569
|
};
|
|
16396
16570
|
});
|
|
16397
|
-
useUpdateEffect(function () {
|
|
16398
|
-
if (!rppChanged.current) {
|
|
16399
|
-
changePage(props.first, props.rows);
|
|
16400
|
-
}
|
|
16401
|
-
rppChanged.current = false;
|
|
16402
|
-
}, [props.rows]);
|
|
16403
16571
|
useUpdateEffect(function () {
|
|
16404
16572
|
if (page > 0 && props.first >= props.totalRecords) {
|
|
16405
16573
|
changePage((pageCount - 1) * props.rows, props.rows);
|
|
@@ -16541,7 +16709,6 @@ var DataTableBase = {
|
|
|
16541
16709
|
defaultProps: {
|
|
16542
16710
|
__TYPE: 'DataTable',
|
|
16543
16711
|
alwaysShowPaginator: true,
|
|
16544
|
-
autoLayout: false,
|
|
16545
16712
|
breakpoint: '960px',
|
|
16546
16713
|
cellClassName: null,
|
|
16547
16714
|
cellSelection: false,
|
|
@@ -16633,7 +16800,7 @@ var DataTableBase = {
|
|
|
16633
16800
|
reorderableColumns: false,
|
|
16634
16801
|
reorderableRows: false,
|
|
16635
16802
|
resizableColumns: false,
|
|
16636
|
-
responsiveLayout: '
|
|
16803
|
+
responsiveLayout: 'scroll',
|
|
16637
16804
|
rowClassName: null,
|
|
16638
16805
|
rowEditValidator: null,
|
|
16639
16806
|
rowExpansionTemplate: null,
|
|
@@ -16643,7 +16810,6 @@ var DataTableBase = {
|
|
|
16643
16810
|
rowHover: false,
|
|
16644
16811
|
rows: null,
|
|
16645
16812
|
rowsPerPageOptions: null,
|
|
16646
|
-
scrollDirection: 'vertical',
|
|
16647
16813
|
scrollHeight: null,
|
|
16648
16814
|
scrollable: false,
|
|
16649
16815
|
selectAll: false,
|
|
@@ -17497,7 +17663,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17497
17663
|
return props.compareSelectionBy === 'equals' ? data1 === data2 : ObjectUtils.equals(data1, data2, props.dataKey);
|
|
17498
17664
|
};
|
|
17499
17665
|
var getTabIndex = function getTabIndex() {
|
|
17500
|
-
return isFocusable() && !props.allowCellSelection ? props.
|
|
17666
|
+
return isFocusable() && !props.allowCellSelection ? props.rowIndex === 0 ? props.tabIndex : -1 : null;
|
|
17501
17667
|
};
|
|
17502
17668
|
var findIndex = function findIndex(collection, rowData) {
|
|
17503
17669
|
return (collection || []).findIndex(function (data) {
|
|
@@ -17554,35 +17720,35 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17554
17720
|
props.onRowClick({
|
|
17555
17721
|
originalEvent: event,
|
|
17556
17722
|
data: props.rowData,
|
|
17557
|
-
index: props.
|
|
17723
|
+
index: props.rowIndex
|
|
17558
17724
|
});
|
|
17559
17725
|
};
|
|
17560
17726
|
var onDoubleClick = function onDoubleClick(event) {
|
|
17561
17727
|
props.onRowDoubleClick({
|
|
17562
17728
|
originalEvent: event,
|
|
17563
17729
|
data: props.rowData,
|
|
17564
|
-
index: props.
|
|
17730
|
+
index: props.rowIndex
|
|
17565
17731
|
});
|
|
17566
17732
|
};
|
|
17567
17733
|
var onRightClick = function onRightClick(event) {
|
|
17568
17734
|
props.onRowRightClick({
|
|
17569
17735
|
originalEvent: event,
|
|
17570
17736
|
data: props.rowData,
|
|
17571
|
-
index: props.
|
|
17737
|
+
index: props.rowIndex
|
|
17572
17738
|
});
|
|
17573
17739
|
};
|
|
17574
17740
|
var onMouseEnter = function onMouseEnter(event) {
|
|
17575
17741
|
props.onRowMouseEnter({
|
|
17576
17742
|
originalEvent: event,
|
|
17577
17743
|
data: props.rowData,
|
|
17578
|
-
index: props.
|
|
17744
|
+
index: props.rowIndex
|
|
17579
17745
|
});
|
|
17580
17746
|
};
|
|
17581
17747
|
var onMouseLeave = function onMouseLeave(event) {
|
|
17582
17748
|
props.onRowMouseLeave({
|
|
17583
17749
|
originalEvent: event,
|
|
17584
17750
|
data: props.rowData,
|
|
17585
|
-
index: props.
|
|
17751
|
+
index: props.rowIndex
|
|
17586
17752
|
});
|
|
17587
17753
|
};
|
|
17588
17754
|
var onTouchEnd = function onTouchEnd(event) {
|
|
@@ -17636,49 +17802,49 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17636
17802
|
props.onRowMouseDown({
|
|
17637
17803
|
originalEvent: event,
|
|
17638
17804
|
data: props.rowData,
|
|
17639
|
-
index: props.
|
|
17805
|
+
index: props.rowIndex
|
|
17640
17806
|
});
|
|
17641
17807
|
};
|
|
17642
17808
|
var onMouseUp = function onMouseUp(event) {
|
|
17643
17809
|
props.onRowMouseUp({
|
|
17644
17810
|
originalEvent: event,
|
|
17645
17811
|
data: props.rowData,
|
|
17646
|
-
index: props.
|
|
17812
|
+
index: props.rowIndex
|
|
17647
17813
|
});
|
|
17648
17814
|
};
|
|
17649
17815
|
var onDragStart = function onDragStart(event) {
|
|
17650
17816
|
props.onRowDragStart({
|
|
17651
17817
|
originalEvent: event,
|
|
17652
17818
|
data: props.rowData,
|
|
17653
|
-
index: props.
|
|
17819
|
+
index: props.rowIndex
|
|
17654
17820
|
});
|
|
17655
17821
|
};
|
|
17656
17822
|
var onDragOver = function onDragOver(event) {
|
|
17657
17823
|
props.onRowDragOver({
|
|
17658
17824
|
originalEvent: event,
|
|
17659
17825
|
data: props.rowData,
|
|
17660
|
-
index: props.
|
|
17826
|
+
index: props.rowIndex
|
|
17661
17827
|
});
|
|
17662
17828
|
};
|
|
17663
17829
|
var onDragLeave = function onDragLeave(event) {
|
|
17664
17830
|
props.onRowDragLeave({
|
|
17665
17831
|
originalEvent: event,
|
|
17666
17832
|
data: props.rowData,
|
|
17667
|
-
index: props.
|
|
17833
|
+
index: props.rowIndex
|
|
17668
17834
|
});
|
|
17669
17835
|
};
|
|
17670
17836
|
var onDragEnd = function onDragEnd(event) {
|
|
17671
17837
|
props.onRowDragEnd({
|
|
17672
17838
|
originalEvent: event,
|
|
17673
17839
|
data: props.rowData,
|
|
17674
|
-
index: props.
|
|
17840
|
+
index: props.rowIndex
|
|
17675
17841
|
});
|
|
17676
17842
|
};
|
|
17677
17843
|
var onDrop = function onDrop(event) {
|
|
17678
17844
|
props.onRowDrop({
|
|
17679
17845
|
originalEvent: event,
|
|
17680
17846
|
data: props.rowData,
|
|
17681
|
-
index: props.
|
|
17847
|
+
index: props.rowIndex
|
|
17682
17848
|
});
|
|
17683
17849
|
};
|
|
17684
17850
|
var onEditChange = function onEditChange(e, isEditing) {
|
|
@@ -17722,7 +17888,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17722
17888
|
props.onRowEditInit({
|
|
17723
17889
|
originalEvent: event,
|
|
17724
17890
|
data: props.rowData,
|
|
17725
|
-
index: props.
|
|
17891
|
+
index: props.rowIndex
|
|
17726
17892
|
});
|
|
17727
17893
|
}
|
|
17728
17894
|
onEditChange(e, true);
|
|
@@ -17738,7 +17904,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17738
17904
|
props.onRowEditSave({
|
|
17739
17905
|
originalEvent: event,
|
|
17740
17906
|
data: props.rowData,
|
|
17741
|
-
index: props.
|
|
17907
|
+
index: props.rowIndex,
|
|
17742
17908
|
valid: valid
|
|
17743
17909
|
});
|
|
17744
17910
|
}
|
|
@@ -17756,7 +17922,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17756
17922
|
props.onRowEditCancel({
|
|
17757
17923
|
originalEvent: event,
|
|
17758
17924
|
data: props.rowData,
|
|
17759
|
-
index: props.
|
|
17925
|
+
index: props.rowIndex
|
|
17760
17926
|
});
|
|
17761
17927
|
}
|
|
17762
17928
|
onEditChange(e, false);
|
|
@@ -17774,7 +17940,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17774
17940
|
tableSelector: props.tableSelector,
|
|
17775
17941
|
column: col,
|
|
17776
17942
|
rowData: props.rowData,
|
|
17777
|
-
rowIndex: props.
|
|
17943
|
+
rowIndex: props.rowIndex,
|
|
17778
17944
|
index: i,
|
|
17779
17945
|
rowSpan: rowSpan,
|
|
17780
17946
|
dataKey: props.dataKey,
|
|
@@ -17821,9 +17987,9 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17821
17987
|
'p-highlight-contextmenu': props.contextMenuSelected,
|
|
17822
17988
|
'p-selectable-row': props.allowRowSelection && props.isSelectable({
|
|
17823
17989
|
data: props.rowData,
|
|
17824
|
-
index: props.
|
|
17990
|
+
index: props.rowIndex
|
|
17825
17991
|
}),
|
|
17826
|
-
'p-row-odd': props.
|
|
17992
|
+
'p-row-odd': props.rowIndex % 2 !== 0
|
|
17827
17993
|
});
|
|
17828
17994
|
var style = {
|
|
17829
17995
|
height: props.virtualScrollerOptions ? props.virtualScrollerOptions.itemSize : undefined
|
|
@@ -17898,7 +18064,6 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
17898
18064
|
var rowDragging = React__namespace.useRef(false);
|
|
17899
18065
|
var draggedRowIndex = React__namespace.useRef(null);
|
|
17900
18066
|
var droppedRowIndex = React__namespace.useRef(null);
|
|
17901
|
-
var prevVirtualScrollerOptions = usePrevious(props.virtualScrollerOptions);
|
|
17902
18067
|
var isSubheaderGrouping = props.rowGroupMode && props.rowGroupMode === 'subheader';
|
|
17903
18068
|
var isRadioSelectionMode = props.selectionMode === 'radiobutton';
|
|
17904
18069
|
var isCheckboxSelectionMode = props.selectionMode === 'checkbox';
|
|
@@ -18048,10 +18213,6 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18048
18213
|
});
|
|
18049
18214
|
}
|
|
18050
18215
|
};
|
|
18051
|
-
var updateVirtualScrollerPosition = function updateVirtualScrollerPosition() {
|
|
18052
|
-
var tableHeaderHeight = DomHandler.getOuterHeight(elementRef.current.previousElementSibling);
|
|
18053
|
-
elementRef.current.style.top = (elementRef.current.style.top || 0) + tableHeaderHeight + 'px';
|
|
18054
|
-
};
|
|
18055
18216
|
var onSingleSelection = function onSingleSelection(_ref) {
|
|
18056
18217
|
var originalEvent = _ref.originalEvent,
|
|
18057
18218
|
data = _ref.data,
|
|
@@ -18605,16 +18766,6 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18605
18766
|
updateFrozenRowGroupHeaderStickyPosition();
|
|
18606
18767
|
}
|
|
18607
18768
|
});
|
|
18608
|
-
useMountEffect(function () {
|
|
18609
|
-
if (!props.isVirtualScrollerDisabled && getVirtualScrollerOption('vertical')) {
|
|
18610
|
-
updateVirtualScrollerPosition();
|
|
18611
|
-
}
|
|
18612
|
-
});
|
|
18613
|
-
useUpdateEffect(function () {
|
|
18614
|
-
if (!props.isVirtualScrollerDisabled && getVirtualScrollerOption('vertical') && getVirtualScrollerOption('itemSize', prevVirtualScrollerOptions) !== getVirtualScrollerOption('itemSize')) {
|
|
18615
|
-
updateVirtualScrollerPosition();
|
|
18616
|
-
}
|
|
18617
|
-
}, [props.virtualScrollerOptions]);
|
|
18618
18769
|
useUpdateEffect(function () {
|
|
18619
18770
|
if (props.paginator && isMultipleSelection()) {
|
|
18620
18771
|
anchorRowIndex.current = null;
|
|
@@ -18642,9 +18793,8 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18642
18793
|
}
|
|
18643
18794
|
return null;
|
|
18644
18795
|
};
|
|
18645
|
-
var createGroupHeader = function createGroupHeader(rowData,
|
|
18646
|
-
if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData,
|
|
18647
|
-
var _options;
|
|
18796
|
+
var createGroupHeader = function createGroupHeader(rowData, rowIndex, expanded, colSpan) {
|
|
18797
|
+
if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData, rowIndex - props.first)) {
|
|
18648
18798
|
var style = rowGroupHeaderStyle();
|
|
18649
18799
|
var toggler = props.expandableRowGroups && /*#__PURE__*/React__namespace.createElement(RowTogglerButton, {
|
|
18650
18800
|
onClick: onRowToggle,
|
|
@@ -18653,9 +18803,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18653
18803
|
expandedRowIcon: props.expandedRowIcon,
|
|
18654
18804
|
collapsedRowIcon: props.collapsedRowIcon
|
|
18655
18805
|
});
|
|
18656
|
-
var options =
|
|
18657
|
-
index:
|
|
18658
|
-
|
|
18806
|
+
var options = {
|
|
18807
|
+
index: rowIndex,
|
|
18808
|
+
props: props.tableProps,
|
|
18809
|
+
customRendering: false
|
|
18810
|
+
};
|
|
18659
18811
|
var _content2 = ObjectUtils.getJSXElement(props.rowGroupHeaderTemplate, rowData, options);
|
|
18660
18812
|
|
|
18661
18813
|
// check if the user wants complete control of the rendering
|
|
@@ -18674,7 +18826,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18674
18826
|
}
|
|
18675
18827
|
return null;
|
|
18676
18828
|
};
|
|
18677
|
-
var createRow = function createRow(rowData, index, expanded) {
|
|
18829
|
+
var createRow = function createRow(rowData, rowIndex, index, expanded) {
|
|
18678
18830
|
if (!props.expandableRowGroups || expanded) {
|
|
18679
18831
|
var selected = isSelectionEnabled() ? isSelected(rowData) : false;
|
|
18680
18832
|
var contextMenuSelected = isContextMenuSelected(rowData);
|
|
@@ -18687,6 +18839,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18687
18839
|
value: props.value,
|
|
18688
18840
|
columns: props.columns,
|
|
18689
18841
|
rowData: rowData,
|
|
18842
|
+
rowIndex: rowIndex,
|
|
18690
18843
|
index: index,
|
|
18691
18844
|
selected: selected,
|
|
18692
18845
|
contextMenuSelected: contextMenuSelected,
|
|
@@ -18745,11 +18898,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18745
18898
|
});
|
|
18746
18899
|
}
|
|
18747
18900
|
};
|
|
18748
|
-
var createExpansion = function createExpansion(rowData,
|
|
18901
|
+
var createExpansion = function createExpansion(rowData, rowIndex, expanded, colSpan) {
|
|
18749
18902
|
if (expanded && !(isSubheaderGrouping && props.expandableRowGroups)) {
|
|
18750
|
-
var id = "".concat(props.tableSelector, "_content_").concat(
|
|
18903
|
+
var id = "".concat(props.tableSelector, "_content_").concat(rowIndex, "_expanded");
|
|
18751
18904
|
var options = {
|
|
18752
|
-
index:
|
|
18905
|
+
index: rowIndex,
|
|
18753
18906
|
customRendering: false
|
|
18754
18907
|
};
|
|
18755
18908
|
var _content3 = ObjectUtils.getJSXElement(props.rowExpansionTemplate, rowData, options);
|
|
@@ -18769,10 +18922,10 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18769
18922
|
}
|
|
18770
18923
|
return null;
|
|
18771
18924
|
};
|
|
18772
|
-
var createGroupFooter = function createGroupFooter(rowData,
|
|
18773
|
-
if (isSubheaderGrouping && shouldRenderRowGroupFooter(props.value, rowData,
|
|
18925
|
+
var createGroupFooter = function createGroupFooter(rowData, rowIndex, expanded, colSpan) {
|
|
18926
|
+
if (isSubheaderGrouping && shouldRenderRowGroupFooter(props.value, rowData, rowIndex - props.first, expanded)) {
|
|
18774
18927
|
var _content4 = ObjectUtils.getJSXElement(props.rowGroupFooterTemplate, rowData, {
|
|
18775
|
-
index:
|
|
18928
|
+
index: rowIndex,
|
|
18776
18929
|
colSpan: colSpan,
|
|
18777
18930
|
props: props.tableProps
|
|
18778
18931
|
});
|
|
@@ -18784,25 +18937,25 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18784
18937
|
return null;
|
|
18785
18938
|
};
|
|
18786
18939
|
var createContent = function createContent() {
|
|
18787
|
-
return props.value.map(function (rowData,
|
|
18788
|
-
var
|
|
18789
|
-
var key = getRowKey(rowData,
|
|
18940
|
+
return props.value && props.value.map(function (rowData, index) {
|
|
18941
|
+
var rowIndex = getVirtualScrollerOption('getItemOptions') ? getVirtualScrollerOption('getItemOptions')(index).index : props.first + index;
|
|
18942
|
+
var key = getRowKey(rowData, rowIndex);
|
|
18790
18943
|
var expanded = isRowExpanded(rowData);
|
|
18791
18944
|
var colSpan = getColumnsLength();
|
|
18792
|
-
var groupHeader = createGroupHeader(rowData,
|
|
18793
|
-
var row = createRow(rowData, index, expanded);
|
|
18794
|
-
var expansion = createExpansion(rowData,
|
|
18795
|
-
var groupFooter = createGroupFooter(rowData,
|
|
18945
|
+
var groupHeader = createGroupHeader(rowData, rowIndex, expanded, colSpan);
|
|
18946
|
+
var row = createRow(rowData, rowIndex, index, expanded);
|
|
18947
|
+
var expansion = createExpansion(rowData, rowIndex, expanded, colSpan);
|
|
18948
|
+
var groupFooter = createGroupFooter(rowData, rowIndex, expanded, colSpan);
|
|
18796
18949
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, {
|
|
18797
18950
|
key: key
|
|
18798
18951
|
}, groupHeader, row, expansion, groupFooter);
|
|
18799
18952
|
});
|
|
18800
18953
|
};
|
|
18801
|
-
var className = classNames('p-datatable-tbody', props.className);
|
|
18802
18954
|
var content = props.empty ? createEmptyContent() : createContent();
|
|
18803
18955
|
return /*#__PURE__*/React__namespace.createElement("tbody", {
|
|
18804
18956
|
ref: refCallback,
|
|
18805
|
-
|
|
18957
|
+
style: props.style,
|
|
18958
|
+
className: props.className
|
|
18806
18959
|
}, content);
|
|
18807
18960
|
}));
|
|
18808
18961
|
TableBody.displayName = 'TableBody';
|
|
@@ -20493,9 +20646,10 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
20493
20646
|
if (ObjectUtils.isNotEmpty(widths)) {
|
|
20494
20647
|
createStyleElement();
|
|
20495
20648
|
var innerHTML = '';
|
|
20649
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > .p-datatable-wrapper ").concat(isVirtualScrollerDisabled() ? '' : '> .p-virtualscroller', " > .p-datatable-table");
|
|
20496
20650
|
widths.forEach(function (width, index) {
|
|
20497
|
-
var style =
|
|
20498
|
-
innerHTML += "\n
|
|
20651
|
+
var style = "width: ".concat(width, "px !important; max-width: ").concat(width, "px !important");
|
|
20652
|
+
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 ");
|
|
20499
20653
|
});
|
|
20500
20654
|
styleElement.current.innerHTML = innerHTML;
|
|
20501
20655
|
}
|
|
@@ -20663,10 +20817,11 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
20663
20817
|
destroyStyleElement();
|
|
20664
20818
|
createStyleElement();
|
|
20665
20819
|
var innerHTML = '';
|
|
20820
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > .p-datatable-wrapper ").concat(isVirtualScrollerDisabled() ? '' : '> .p-virtualscroller', " > .p-datatable-table");
|
|
20666
20821
|
widths.forEach(function (width, index) {
|
|
20667
20822
|
var colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;
|
|
20668
|
-
var style =
|
|
20669
|
-
innerHTML += "\n
|
|
20823
|
+
var style = "width: ".concat(colWidth, "px !important; max-width: ").concat(colWidth, "px !important");
|
|
20824
|
+
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 ");
|
|
20670
20825
|
});
|
|
20671
20826
|
styleElement.current.innerHTML = innerHTML;
|
|
20672
20827
|
};
|
|
@@ -20829,7 +20984,10 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
20829
20984
|
var createResponsiveStyle = function createResponsiveStyle() {
|
|
20830
20985
|
if (!responsiveStyleElement.current) {
|
|
20831
20986
|
responsiveStyleElement.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
20832
|
-
var
|
|
20987
|
+
var tableSelector = ".p-datatable-wrapper ".concat(isVirtualScrollerDisabled() ? '' : '> .p-virtualscroller', " > .p-datatable-table");
|
|
20988
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > ").concat(tableSelector);
|
|
20989
|
+
var gridLinesSelector = ".p-datatable[".concat(attributeSelectorState, "].p-datatable-gridlines > ").concat(tableSelector);
|
|
20990
|
+
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");
|
|
20833
20991
|
responsiveStyleElement.current.innerHTML = innerHTML;
|
|
20834
20992
|
}
|
|
20835
20993
|
};
|
|
@@ -21306,7 +21464,7 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21306
21464
|
return data;
|
|
21307
21465
|
};
|
|
21308
21466
|
useMountEffect(function () {
|
|
21309
|
-
setAttributeSelectorState(UniqueComponentId());
|
|
21467
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
21310
21468
|
setFiltersState(cloneFilters(props.filters));
|
|
21311
21469
|
setD_filtersState(cloneFilters(props.filters));
|
|
21312
21470
|
if (isStateful()) {
|
|
@@ -21317,11 +21475,16 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21317
21475
|
}
|
|
21318
21476
|
});
|
|
21319
21477
|
useUpdateEffect(function () {
|
|
21320
|
-
|
|
21321
|
-
|
|
21322
|
-
|
|
21478
|
+
if (attributeSelectorState) {
|
|
21479
|
+
elementRef.current.setAttribute(attributeSelectorState, '');
|
|
21480
|
+
if (props.responsiveLayout === 'stack' && !props.scrollable) {
|
|
21481
|
+
createResponsiveStyle();
|
|
21482
|
+
}
|
|
21323
21483
|
}
|
|
21324
|
-
|
|
21484
|
+
return function () {
|
|
21485
|
+
destroyResponsiveStyle();
|
|
21486
|
+
};
|
|
21487
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
21325
21488
|
useUpdateEffect(function () {
|
|
21326
21489
|
var filters = cloneFilters(props.filters);
|
|
21327
21490
|
setFiltersState(filters);
|
|
@@ -21403,7 +21566,7 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21403
21566
|
}
|
|
21404
21567
|
return null;
|
|
21405
21568
|
};
|
|
21406
|
-
var createTableHeader = function createTableHeader(options, empty) {
|
|
21569
|
+
var createTableHeader = function createTableHeader(options, empty, _isVirtualScrollerDisabled) {
|
|
21407
21570
|
var sortField = getSortField();
|
|
21408
21571
|
var sortOrder = getSortOrder();
|
|
21409
21572
|
var multiSortMeta = _toConsumableArray(getMultiSortMeta());
|
|
@@ -21411,9 +21574,11 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21411
21574
|
var filters = d_filtersState;
|
|
21412
21575
|
var filtersStore = !props.onFilter && props.filters || getFilters();
|
|
21413
21576
|
var processedData = options.items,
|
|
21577
|
+
virtualScrollerProps = options.props,
|
|
21414
21578
|
columns = options.columns;
|
|
21579
|
+
var data = _isVirtualScrollerDisabled || virtualScrollerProps.lazy ? processedData : virtualScrollerProps.items;
|
|
21415
21580
|
return /*#__PURE__*/React__namespace.createElement(TableHeader, {
|
|
21416
|
-
value:
|
|
21581
|
+
value: data,
|
|
21417
21582
|
tableProps: props,
|
|
21418
21583
|
columns: columns,
|
|
21419
21584
|
tabIndex: props.tabIndex,
|
|
@@ -21452,12 +21617,14 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21452
21617
|
var rows = options.rows,
|
|
21453
21618
|
columns = options.columns,
|
|
21454
21619
|
contentRef = options.contentRef,
|
|
21455
|
-
|
|
21456
|
-
options.
|
|
21620
|
+
style = options.style,
|
|
21621
|
+
className = options.className,
|
|
21622
|
+
spacerStyle = options.spacerStyle,
|
|
21623
|
+
itemSize = options.itemSize;
|
|
21457
21624
|
var frozenBody = ObjectUtils.isNotEmpty(props.frozenValue) && /*#__PURE__*/React__namespace.createElement(TableBody, {
|
|
21458
21625
|
ref: frozenBodyRef,
|
|
21459
21626
|
value: props.frozenValue,
|
|
21460
|
-
className: "p-datatable-frozen-tbody",
|
|
21627
|
+
className: "p-datatable-tbody p-datatable-frozen-tbody",
|
|
21461
21628
|
frozenRow: true,
|
|
21462
21629
|
tableProps: props,
|
|
21463
21630
|
tableSelector: attributeSelectorState,
|
|
@@ -21528,7 +21695,8 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21528
21695
|
var body = /*#__PURE__*/React__namespace.createElement(TableBody, {
|
|
21529
21696
|
ref: bodyRef,
|
|
21530
21697
|
value: dataToRender(rows),
|
|
21531
|
-
|
|
21698
|
+
style: style,
|
|
21699
|
+
className: classNames('p-datatable-tbody', className),
|
|
21532
21700
|
empty: empty,
|
|
21533
21701
|
frozenRow: false,
|
|
21534
21702
|
tableProps: props,
|
|
@@ -21598,7 +21766,13 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21598
21766
|
virtualScrollerOptions: options,
|
|
21599
21767
|
isVirtualScrollerDisabled: isVirtualScrollerDisabled
|
|
21600
21768
|
});
|
|
21601
|
-
|
|
21769
|
+
var spacerBody = ObjectUtils.isNotEmpty(spacerStyle) ? /*#__PURE__*/React__namespace.createElement(TableBody, {
|
|
21770
|
+
style: {
|
|
21771
|
+
height: "calc(".concat(spacerStyle.height, " - ").concat(rows.length * itemSize, "px)")
|
|
21772
|
+
},
|
|
21773
|
+
className: "p-datatable-virtualscroller-spacer"
|
|
21774
|
+
}) : null;
|
|
21775
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, frozenBody, body, spacerBody);
|
|
21602
21776
|
};
|
|
21603
21777
|
var createTableFooter = function createTableFooter(options) {
|
|
21604
21778
|
var columns = options.columns;
|
|
@@ -21629,14 +21803,20 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21629
21803
|
scrollHeight: props.scrollHeight !== 'flex' ? undefined : '100%',
|
|
21630
21804
|
disabled: _isVirtualScrollerDisabled,
|
|
21631
21805
|
loaderDisabled: true,
|
|
21806
|
+
inline: true,
|
|
21807
|
+
autoSize: true,
|
|
21632
21808
|
showSpacer: false,
|
|
21633
21809
|
contentTemplate: function contentTemplate(options) {
|
|
21634
21810
|
var ref = function ref(el) {
|
|
21635
21811
|
tableRef.current = el;
|
|
21636
21812
|
options.spacerRef && options.spacerRef(el);
|
|
21637
21813
|
};
|
|
21638
|
-
var tableClassName = classNames('p-datatable-table',
|
|
21639
|
-
|
|
21814
|
+
var tableClassName = classNames('p-datatable-table', {
|
|
21815
|
+
'p-datatable-scrollable-table': props.scrollable,
|
|
21816
|
+
'p-datatable-resizable-table': props.resizableColumns,
|
|
21817
|
+
'p-datatable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
21818
|
+
}, props.tableClassName);
|
|
21819
|
+
var tableHeader = createTableHeader(options, empty, _isVirtualScrollerDisabled);
|
|
21640
21820
|
var tableBody = createTableBody(options, selectionModeInColumn, empty, _isVirtualScrollerDisabled);
|
|
21641
21821
|
var tableFooter = createTableFooter(options);
|
|
21642
21822
|
return /*#__PURE__*/React__namespace.createElement("table", {
|
|
@@ -21730,13 +21910,9 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21730
21910
|
'p-datatable-hoverable-rows': props.rowHover,
|
|
21731
21911
|
'p-datatable-selectable': selectable && !props.cellSelection,
|
|
21732
21912
|
'p-datatable-selectable-cell': selectable && props.cellSelection,
|
|
21733
|
-
'p-datatable-auto-layout': props.autoLayout,
|
|
21734
21913
|
'p-datatable-resizable': props.resizableColumns,
|
|
21735
21914
|
'p-datatable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
21736
21915
|
'p-datatable-scrollable': props.scrollable,
|
|
21737
|
-
'p-datatable-scrollable-vertical': props.scrollable && props.scrollDirection === 'vertical',
|
|
21738
|
-
'p-datatable-scrollable-horizontal': props.scrollable && props.scrollDirection === 'horizontal',
|
|
21739
|
-
'p-datatable-scrollable-both': props.scrollable && props.scrollDirection === 'both',
|
|
21740
21916
|
'p-datatable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',
|
|
21741
21917
|
'p-datatable-responsive-stack': props.responsiveLayout === 'stack',
|
|
21742
21918
|
'p-datatable-responsive-scroll': props.responsiveLayout === 'scroll',
|
|
@@ -26340,14 +26516,15 @@ var ListBox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
26340
26516
|
itemTemplate: function itemTemplate(item, options) {
|
|
26341
26517
|
return item && createItem(item, options.index, options);
|
|
26342
26518
|
},
|
|
26343
|
-
contentTemplate: function contentTemplate(
|
|
26344
|
-
var className = classNames('p-listbox-list',
|
|
26519
|
+
contentTemplate: function contentTemplate(options) {
|
|
26520
|
+
var className = classNames('p-listbox-list', options.className);
|
|
26345
26521
|
return /*#__PURE__*/React__namespace.createElement("ul", _extends({
|
|
26346
|
-
ref:
|
|
26522
|
+
ref: options.contentRef,
|
|
26523
|
+
style: options.style,
|
|
26347
26524
|
className: className,
|
|
26348
26525
|
role: "listbox",
|
|
26349
26526
|
"aria-multiselectable": props.multiple
|
|
26350
|
-
}, ariaProps),
|
|
26527
|
+
}, ariaProps), options.children);
|
|
26351
26528
|
}
|
|
26352
26529
|
});
|
|
26353
26530
|
return /*#__PURE__*/React__namespace.createElement(VirtualScroller, _extends({
|
|
@@ -26395,6 +26572,8 @@ var MegaMenuBase = {
|
|
|
26395
26572
|
style: null,
|
|
26396
26573
|
className: null,
|
|
26397
26574
|
orientation: 'horizontal',
|
|
26575
|
+
breakpoint: undefined,
|
|
26576
|
+
scrollHeight: '400px',
|
|
26398
26577
|
start: null,
|
|
26399
26578
|
end: null,
|
|
26400
26579
|
children: undefined
|
|
@@ -26413,17 +26592,41 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26413
26592
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26414
26593
|
activeItemState = _React$useState2[0],
|
|
26415
26594
|
setActiveItemState = _React$useState2[1];
|
|
26595
|
+
var _React$useState3 = React__namespace.useState(null),
|
|
26596
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
26597
|
+
attributeSelectorState = _React$useState4[0],
|
|
26598
|
+
setAttributeSelectorState = _React$useState4[1];
|
|
26599
|
+
var _React$useState5 = React__namespace.useState(false),
|
|
26600
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
26601
|
+
mobileActiveState = _React$useState6[0],
|
|
26602
|
+
setMobileActiveState = _React$useState6[1];
|
|
26416
26603
|
var elementRef = React__namespace.useRef(null);
|
|
26604
|
+
var styleElementRef = React__namespace.useRef(null);
|
|
26605
|
+
var menuButtonRef = React__namespace.useRef(null);
|
|
26417
26606
|
var horizontal = props.orientation === 'horizontal';
|
|
26418
26607
|
var vertical = props.orientation === 'vertical';
|
|
26608
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
26419
26609
|
var _useEventListener = useEventListener({
|
|
26420
26610
|
type: 'click',
|
|
26421
26611
|
listener: function listener(event) {
|
|
26422
|
-
|
|
26612
|
+
if ((!isMobileMode || mobileActiveState) && isOutsideClicked(event)) {
|
|
26613
|
+
setActiveItemState(null);
|
|
26614
|
+
setMobileActiveState(false);
|
|
26615
|
+
}
|
|
26423
26616
|
}
|
|
26424
26617
|
}),
|
|
26425
26618
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
26426
26619
|
bindDocumentClickListener = _useEventListener2[0];
|
|
26620
|
+
var _useResizeListener = useResizeListener({
|
|
26621
|
+
listener: function listener() {
|
|
26622
|
+
if (!isMobileMode || mobileActiveState) {
|
|
26623
|
+
setActiveItemState(null);
|
|
26624
|
+
setMobileActiveState(false);
|
|
26625
|
+
}
|
|
26626
|
+
}
|
|
26627
|
+
}),
|
|
26628
|
+
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
26629
|
+
bindDocumentResizeListener = _useResizeListener2[0];
|
|
26427
26630
|
var onLeafClick = function onLeafClick(event, item) {
|
|
26428
26631
|
if (item.disabled) {
|
|
26429
26632
|
event.preventDefault();
|
|
@@ -26439,9 +26642,10 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26439
26642
|
});
|
|
26440
26643
|
}
|
|
26441
26644
|
setActiveItemState(null);
|
|
26645
|
+
setMobileActiveState(false);
|
|
26442
26646
|
};
|
|
26443
26647
|
var onCategoryMouseEnter = function onCategoryMouseEnter(event, item) {
|
|
26444
|
-
if (item.disabled) {
|
|
26648
|
+
if (item.disabled || isMobileMode) {
|
|
26445
26649
|
event.preventDefault();
|
|
26446
26650
|
return;
|
|
26447
26651
|
}
|
|
@@ -26504,6 +26708,13 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26504
26708
|
var collapseMenu = function collapseMenu(item) {
|
|
26505
26709
|
setActiveItemState(null);
|
|
26506
26710
|
};
|
|
26711
|
+
var toggle = function toggle(event) {
|
|
26712
|
+
event.preventDefault();
|
|
26713
|
+
setMobileActiveState(function (prevMobileActive) {
|
|
26714
|
+
return !prevMobileActive;
|
|
26715
|
+
});
|
|
26716
|
+
setActiveItemState(null);
|
|
26717
|
+
};
|
|
26507
26718
|
var findNextItem = function findNextItem(item) {
|
|
26508
26719
|
var nextItem = item.nextElementSibling;
|
|
26509
26720
|
return nextItem ? DomHandler.hasClass(nextItem, 'p-disabled') || !DomHandler.hasClass(nextItem, 'p-menuitem') ? findNextItem(nextItem) : nextItem : null;
|
|
@@ -26521,7 +26732,7 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26521
26732
|
prevItem && prevItem.children[0].focus();
|
|
26522
26733
|
};
|
|
26523
26734
|
var isOutsideClicked = function isOutsideClicked(event) {
|
|
26524
|
-
return elementRef.current && !(elementRef.current.isSameNode(event.target) || elementRef.current.contains(event.target));
|
|
26735
|
+
return elementRef.current && !(elementRef.current.isSameNode(event.target) || elementRef.current.contains(event.target) || menuButtonRef.current && menuButtonRef.current.contains(event.target));
|
|
26525
26736
|
};
|
|
26526
26737
|
var getColumnClassName = function getColumnClassName(category) {
|
|
26527
26738
|
var length = category.items ? category.items.length : 0;
|
|
@@ -26554,13 +26765,23 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26554
26765
|
};
|
|
26555
26766
|
});
|
|
26556
26767
|
useMountEffect(function () {
|
|
26768
|
+
if (props.breakpoint) {
|
|
26769
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
26770
|
+
}
|
|
26557
26771
|
bindDocumentClickListener();
|
|
26772
|
+
bindDocumentResizeListener();
|
|
26558
26773
|
});
|
|
26559
26774
|
useUpdateEffect(function () {
|
|
26560
26775
|
var currentPanel = DomHandler.findSingle(elementRef.current, '.p-menuitem-active > .p-megamenu-panel');
|
|
26561
|
-
if (activeItemState) {
|
|
26776
|
+
if (activeItemState && !isMobileMode) {
|
|
26562
26777
|
ZIndexUtils.set('menu', currentPanel, PrimeReact.autoZIndex, PrimeReact.zIndex['menu']);
|
|
26563
26778
|
}
|
|
26779
|
+
if (isMobileMode) {
|
|
26780
|
+
currentPanel && currentPanel.previousElementSibling.scrollIntoView({
|
|
26781
|
+
block: 'nearest',
|
|
26782
|
+
inline: 'nearest'
|
|
26783
|
+
});
|
|
26784
|
+
}
|
|
26564
26785
|
return function () {
|
|
26565
26786
|
ZIndexUtils.clear(currentPanel);
|
|
26566
26787
|
};
|
|
@@ -26639,6 +26860,9 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26639
26860
|
}
|
|
26640
26861
|
};
|
|
26641
26862
|
var createSubmenu = function createSubmenu(submenu) {
|
|
26863
|
+
if (submenu.visible === false) {
|
|
26864
|
+
return null;
|
|
26865
|
+
}
|
|
26642
26866
|
var className = classNames('p-megamenu-submenu-header', {
|
|
26643
26867
|
'p-disabled': submenu.disabled
|
|
26644
26868
|
}, submenu.className);
|
|
@@ -26686,6 +26910,26 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26686
26910
|
}
|
|
26687
26911
|
return null;
|
|
26688
26912
|
};
|
|
26913
|
+
var createStyle = function createStyle() {
|
|
26914
|
+
if (!styleElementRef.current) {
|
|
26915
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
26916
|
+
var selector = "".concat(attributeSelectorState);
|
|
26917
|
+
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");
|
|
26918
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
26919
|
+
}
|
|
26920
|
+
};
|
|
26921
|
+
var destroyStyle = function destroyStyle() {
|
|
26922
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
26923
|
+
};
|
|
26924
|
+
useUpdateEffect(function () {
|
|
26925
|
+
if (attributeSelectorState && elementRef.current) {
|
|
26926
|
+
elementRef.current.setAttribute(attributeSelectorState, '');
|
|
26927
|
+
createStyle();
|
|
26928
|
+
}
|
|
26929
|
+
return function () {
|
|
26930
|
+
destroyStyle();
|
|
26931
|
+
};
|
|
26932
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
26689
26933
|
var createCategory = function createCategory(category, index) {
|
|
26690
26934
|
var className = classNames('p-menuitem', {
|
|
26691
26935
|
'p-menuitem-active': category === activeItemState
|
|
@@ -26756,20 +27000,41 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26756
27000
|
}
|
|
26757
27001
|
return null;
|
|
26758
27002
|
};
|
|
27003
|
+
var createMenuButton = function createMenuButton() {
|
|
27004
|
+
if (props.orientation === 'vertical' || props.model && props.model.length < 1) {
|
|
27005
|
+
return null;
|
|
27006
|
+
}
|
|
27007
|
+
/* eslint-disable */
|
|
27008
|
+
var button = /*#__PURE__*/React__namespace.createElement("a", {
|
|
27009
|
+
ref: menuButtonRef,
|
|
27010
|
+
href: '#',
|
|
27011
|
+
role: "button",
|
|
27012
|
+
tabIndex: 0,
|
|
27013
|
+
className: "p-megamenu-button",
|
|
27014
|
+
onClick: toggle
|
|
27015
|
+
}, /*#__PURE__*/React__namespace.createElement("i", {
|
|
27016
|
+
className: "pi pi-bars"
|
|
27017
|
+
}));
|
|
27018
|
+
/* eslint-enable */
|
|
27019
|
+
|
|
27020
|
+
return button;
|
|
27021
|
+
};
|
|
26759
27022
|
var otherProps = MegaMenuBase.getOtherProps(props);
|
|
26760
27023
|
var className = classNames('p-megamenu p-component', {
|
|
26761
27024
|
'p-megamenu-horizontal': props.orientation === 'horizontal',
|
|
26762
|
-
'p-megamenu-vertical': props.orientation === 'vertical'
|
|
27025
|
+
'p-megamenu-vertical': props.orientation === 'vertical',
|
|
27026
|
+
'p-megamenu-mobile-active': mobileActiveState
|
|
26763
27027
|
}, props.className);
|
|
26764
27028
|
var menu = createMenu();
|
|
26765
27029
|
var start = createStartContent();
|
|
26766
27030
|
var end = createEndContent();
|
|
27031
|
+
var menuButton = createMenuButton();
|
|
26767
27032
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
26768
27033
|
ref: elementRef,
|
|
26769
27034
|
id: props.id,
|
|
26770
27035
|
className: className,
|
|
26771
27036
|
style: props.style
|
|
26772
|
-
}, otherProps), start, menu, end);
|
|
27037
|
+
}, otherProps), start, menuButton, menu, end);
|
|
26773
27038
|
}));
|
|
26774
27039
|
MegaMenu.displayName = 'MegaMenu';
|
|
26775
27040
|
|
|
@@ -28198,7 +28463,8 @@ var MultiSelectPanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__n
|
|
|
28198
28463
|
showSelectAll: props.showSelectAll,
|
|
28199
28464
|
selectAll: props.isAllSelected(),
|
|
28200
28465
|
onSelectAll: props.onSelectAll,
|
|
28201
|
-
template: props.panelHeaderTemplate
|
|
28466
|
+
template: props.panelHeaderTemplate,
|
|
28467
|
+
resetFilter: props.resetFilter
|
|
28202
28468
|
});
|
|
28203
28469
|
};
|
|
28204
28470
|
var createFooter = function createFooter() {
|
|
@@ -28305,6 +28571,7 @@ var MultiSelectPanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__n
|
|
|
28305
28571
|
var content = isEmptyFilter() ? createEmptyFilter() : options.children;
|
|
28306
28572
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
28307
28573
|
ref: options.contentRef,
|
|
28574
|
+
style: options.style,
|
|
28308
28575
|
className: className,
|
|
28309
28576
|
role: "listbox",
|
|
28310
28577
|
"aria-multiselectable": true
|
|
@@ -34044,6 +34311,12 @@ var SplitButtonBase = {
|
|
|
34044
34311
|
buttonProps: null,
|
|
34045
34312
|
menuButtonProps: null,
|
|
34046
34313
|
tabIndex: null,
|
|
34314
|
+
severity: null,
|
|
34315
|
+
rounded: false,
|
|
34316
|
+
raised: false,
|
|
34317
|
+
outlined: false,
|
|
34318
|
+
text: false,
|
|
34319
|
+
size: null,
|
|
34047
34320
|
appendTo: null,
|
|
34048
34321
|
tooltip: null,
|
|
34049
34322
|
tooltipOptions: null,
|
|
@@ -34175,6 +34448,7 @@ var SplitButtonPanel = /*#__PURE__*/React__namespace.forwardRef(function (props,
|
|
|
34175
34448
|
SplitButtonPanel.displayName = 'SplitButtonPanel';
|
|
34176
34449
|
|
|
34177
34450
|
var SplitButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
34451
|
+
var _classNames;
|
|
34178
34452
|
var props = SplitButtonBase.getProps(inProps);
|
|
34179
34453
|
var _React$useState = React__namespace.useState(props.id),
|
|
34180
34454
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -34271,9 +34545,15 @@ var SplitButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
34271
34545
|
}
|
|
34272
34546
|
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
34273
34547
|
var otherProps = SplitButtonBase.getOtherProps(props);
|
|
34274
|
-
var
|
|
34275
|
-
'
|
|
34276
|
-
|
|
34548
|
+
var sizeMapping = {
|
|
34549
|
+
large: 'lg',
|
|
34550
|
+
small: 'sm'
|
|
34551
|
+
};
|
|
34552
|
+
var size = sizeMapping[props.size];
|
|
34553
|
+
var className = classNames('p-splitbutton p-component', props.className, (_classNames = {
|
|
34554
|
+
'p-disabled': props.disabled,
|
|
34555
|
+
'p-button-loading-label-only': props.loading && !props.icon && props.label
|
|
34556
|
+
}, _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));
|
|
34277
34557
|
var buttonClassName = classNames('p-splitbutton-defaultbutton', props.buttonClassName);
|
|
34278
34558
|
var menuButtonClassName = classNames('p-splitbutton-menubutton', props.menuButtonClassName);
|
|
34279
34559
|
var buttonContent = props.buttonTemplate ? ObjectUtils.getJSXElement(props.buttonTemplate, props) : null;
|
|
@@ -35754,6 +36034,8 @@ var TieredMenuBase = {
|
|
|
35754
36034
|
className: null,
|
|
35755
36035
|
autoZIndex: true,
|
|
35756
36036
|
baseZIndex: 0,
|
|
36037
|
+
breakpoint: undefined,
|
|
36038
|
+
scrollHeight: '400px',
|
|
35757
36039
|
appendTo: null,
|
|
35758
36040
|
transitionOptions: null,
|
|
35759
36041
|
onShow: null,
|
|
@@ -35777,13 +36059,20 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35777
36059
|
var _useEventListener = useEventListener({
|
|
35778
36060
|
type: 'click',
|
|
35779
36061
|
listener: function listener(event) {
|
|
35780
|
-
if (elementRef.current && !elementRef.current.contains(event.target)) {
|
|
36062
|
+
if (!props.isMobileMode && elementRef.current && !elementRef.current.contains(event.target)) {
|
|
35781
36063
|
setActiveItemState(null);
|
|
35782
36064
|
}
|
|
35783
36065
|
}
|
|
35784
36066
|
}),
|
|
35785
36067
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
35786
36068
|
bindDocumentClickListener = _useEventListener2[0];
|
|
36069
|
+
var _useResizeListener = useResizeListener({
|
|
36070
|
+
listener: function listener() {
|
|
36071
|
+
!props.isMobileMode && setActiveItemState(null);
|
|
36072
|
+
}
|
|
36073
|
+
}),
|
|
36074
|
+
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
36075
|
+
bindDocumentResizeListener = _useResizeListener2[0];
|
|
35787
36076
|
var position = function position() {
|
|
35788
36077
|
if (elementRef.current) {
|
|
35789
36078
|
var parentItem = elementRef.current.parentElement;
|
|
@@ -35803,7 +36092,7 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35803
36092
|
}
|
|
35804
36093
|
};
|
|
35805
36094
|
var onItemMouseEnter = function onItemMouseEnter(event, item) {
|
|
35806
|
-
if (item.disabled) {
|
|
36095
|
+
if (item.disabled || props.isMobileMode) {
|
|
35807
36096
|
event.preventDefault();
|
|
35808
36097
|
return;
|
|
35809
36098
|
}
|
|
@@ -35829,7 +36118,7 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35829
36118
|
item: item
|
|
35830
36119
|
});
|
|
35831
36120
|
}
|
|
35832
|
-
if (props.root) {
|
|
36121
|
+
if (props.root || props.isMobileMode) {
|
|
35833
36122
|
if (item.items) {
|
|
35834
36123
|
if (activeItemState && item === activeItemState) setActiveItemState(null);else setActiveItemState(item);
|
|
35835
36124
|
}
|
|
@@ -35884,21 +36173,27 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35884
36173
|
return prevItem ? DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? findPrevItem(prevItem) : prevItem : null;
|
|
35885
36174
|
};
|
|
35886
36175
|
var onLeafClick = function onLeafClick(event) {
|
|
35887
|
-
|
|
35888
|
-
|
|
35889
|
-
|
|
36176
|
+
if (!props.isMobileMode || props.popup) {
|
|
36177
|
+
setActiveItemState(null);
|
|
36178
|
+
props.onLeafClick && props.onLeafClick(event);
|
|
36179
|
+
props.onHide && props.onHide(event);
|
|
36180
|
+
}
|
|
35890
36181
|
};
|
|
35891
36182
|
useMountEffect(function () {
|
|
35892
36183
|
bindDocumentClickListener();
|
|
36184
|
+
bindDocumentResizeListener();
|
|
35893
36185
|
});
|
|
35894
36186
|
useUpdateEffect(function () {
|
|
35895
36187
|
if (!props.parentActive) {
|
|
35896
36188
|
setActiveItemState(null);
|
|
35897
36189
|
}
|
|
35898
|
-
if (!props.root && props.parentActive) {
|
|
36190
|
+
if (!props.root && props.parentActive && !props.isMobileMode) {
|
|
35899
36191
|
position();
|
|
35900
36192
|
}
|
|
35901
36193
|
}, [props.parentActive]);
|
|
36194
|
+
useUpdateEffect(function () {
|
|
36195
|
+
props.onItemToggle && props.onItemToggle();
|
|
36196
|
+
}, [activeItemState]);
|
|
35902
36197
|
var createSeparator = function createSeparator(index) {
|
|
35903
36198
|
var key = 'separator_' + index;
|
|
35904
36199
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
@@ -35915,7 +36210,9 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35915
36210
|
onLeafClick: onLeafClick,
|
|
35916
36211
|
popup: props.popup,
|
|
35917
36212
|
onKeyDown: onChildItemKeyDown,
|
|
35918
|
-
parentActive: item === activeItemState
|
|
36213
|
+
parentActive: item === activeItemState,
|
|
36214
|
+
isMobileMode: props.isMobileMode,
|
|
36215
|
+
onItemToggle: props.onItemToggle
|
|
35919
36216
|
});
|
|
35920
36217
|
}
|
|
35921
36218
|
return null;
|
|
@@ -36025,8 +36322,14 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36025
36322
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
36026
36323
|
visibleState = _React$useState2[0],
|
|
36027
36324
|
setVisibleState = _React$useState2[1];
|
|
36325
|
+
var _React$useState3 = React__namespace.useState(null),
|
|
36326
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
36327
|
+
attributeSelectorState = _React$useState4[0],
|
|
36328
|
+
setAttributeSelectorState = _React$useState4[1];
|
|
36028
36329
|
var menuRef = React__namespace.useRef(null);
|
|
36029
36330
|
var targetRef = React__namespace.useRef(null);
|
|
36331
|
+
var styleElementRef = React__namespace.useRef(null);
|
|
36332
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
36030
36333
|
var _useOverlayListener = useOverlayListener({
|
|
36031
36334
|
target: targetRef,
|
|
36032
36335
|
overlay: menuRef,
|
|
@@ -36064,11 +36367,31 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36064
36367
|
props.onHide && props.onHide(event);
|
|
36065
36368
|
}
|
|
36066
36369
|
};
|
|
36370
|
+
var onItemToggle = function onItemToggle() {
|
|
36371
|
+
if (props.popup && isMobileMode) {
|
|
36372
|
+
DomHandler.absolutePosition(menuRef.current, targetRef.current);
|
|
36373
|
+
}
|
|
36374
|
+
};
|
|
36375
|
+
var createStyle = function createStyle() {
|
|
36376
|
+
if (!styleElementRef.current) {
|
|
36377
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
36378
|
+
var selector = "".concat(attributeSelectorState);
|
|
36379
|
+
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");
|
|
36380
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
36381
|
+
}
|
|
36382
|
+
};
|
|
36383
|
+
var destroyStyle = function destroyStyle() {
|
|
36384
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
36385
|
+
};
|
|
36067
36386
|
var onEnter = function onEnter() {
|
|
36068
36387
|
if (props.autoZIndex) {
|
|
36069
36388
|
ZIndexUtils.set('menu', menuRef.current, PrimeReact.autoZIndex, props.baseZIndex || PrimeReact.zIndex['menu']);
|
|
36070
36389
|
}
|
|
36071
36390
|
DomHandler.absolutePosition(menuRef.current, targetRef.current);
|
|
36391
|
+
if (attributeSelectorState && props.breakpoint) {
|
|
36392
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
36393
|
+
createStyle();
|
|
36394
|
+
}
|
|
36072
36395
|
};
|
|
36073
36396
|
var onEntered = function onEntered() {
|
|
36074
36397
|
bindOverlayListener();
|
|
@@ -36079,7 +36402,22 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36079
36402
|
};
|
|
36080
36403
|
var onExited = function onExited() {
|
|
36081
36404
|
ZIndexUtils.clear(menuRef.current);
|
|
36405
|
+
destroyStyle();
|
|
36082
36406
|
};
|
|
36407
|
+
useMountEffect(function () {
|
|
36408
|
+
if (props.breakpoint) {
|
|
36409
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
36410
|
+
}
|
|
36411
|
+
});
|
|
36412
|
+
useUpdateEffect(function () {
|
|
36413
|
+
if (attributeSelectorState && menuRef.current) {
|
|
36414
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
36415
|
+
createStyle();
|
|
36416
|
+
}
|
|
36417
|
+
return function () {
|
|
36418
|
+
destroyStyle();
|
|
36419
|
+
};
|
|
36420
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
36083
36421
|
useUnmountEffect(function () {
|
|
36084
36422
|
ZIndexUtils.clear(menuRef.current);
|
|
36085
36423
|
});
|
|
@@ -36127,7 +36465,9 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36127
36465
|
model: props.model,
|
|
36128
36466
|
root: true,
|
|
36129
36467
|
popup: props.popup,
|
|
36130
|
-
onHide: hide
|
|
36468
|
+
onHide: hide,
|
|
36469
|
+
isMobileMode: isMobileMode,
|
|
36470
|
+
onItemToggle: onItemToggle
|
|
36131
36471
|
})));
|
|
36132
36472
|
};
|
|
36133
36473
|
var element = createElement();
|
|
@@ -38419,7 +38759,6 @@ var TreeTableBase = {
|
|
|
38419
38759
|
defaultProps: {
|
|
38420
38760
|
__TYPE: 'TreeTable',
|
|
38421
38761
|
alwaysShowPaginator: true,
|
|
38422
|
-
autoLayout: false,
|
|
38423
38762
|
className: null,
|
|
38424
38763
|
columnResizeMode: 'fit',
|
|
38425
38764
|
contextMenuSelectionKey: null,
|
|
@@ -38934,14 +39273,14 @@ var TreeTableRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
38934
39273
|
return null;
|
|
38935
39274
|
}
|
|
38936
39275
|
};
|
|
38937
|
-
var createCell = function createCell(column) {
|
|
39276
|
+
var createCell = function createCell(column, index) {
|
|
38938
39277
|
var toggler, checkbox;
|
|
38939
39278
|
if (getColumnProp(column, 'expander')) {
|
|
38940
39279
|
toggler = createToggler();
|
|
38941
39280
|
checkbox = createCheckbox();
|
|
38942
39281
|
}
|
|
38943
39282
|
return /*#__PURE__*/React__namespace.createElement(TreeTableBodyCell, _extends({
|
|
38944
|
-
key: getColumnProp(column, 'columnKey') || getColumnProp(column, 'field')
|
|
39283
|
+
key: "".concat(getColumnProp(column, 'columnKey') || getColumnProp(column, 'field'), "_").concat(index)
|
|
38945
39284
|
}, ColumnBase.getCProps(column), {
|
|
38946
39285
|
column: column,
|
|
38947
39286
|
selectOnEdit: props.selectOnEdit,
|
|
@@ -38954,7 +39293,7 @@ var TreeTableRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
38954
39293
|
if (expanded && props.node.children) {
|
|
38955
39294
|
return props.node.children.map(function (childNode, index) {
|
|
38956
39295
|
return /*#__PURE__*/React__namespace.createElement(TreeTableRow, {
|
|
38957
|
-
key: childNode.key || JSON.stringify(childNode.data),
|
|
39296
|
+
key: "".concat(childNode.key || JSON.stringify(childNode.data), "_").concat(index),
|
|
38958
39297
|
level: props.level + 1,
|
|
38959
39298
|
rowIndex: props.rowIndex + '_' + index,
|
|
38960
39299
|
node: childNode,
|
|
@@ -39159,7 +39498,7 @@ var TreeTableBody = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
39159
39498
|
};
|
|
39160
39499
|
var createRow = function createRow(node, index) {
|
|
39161
39500
|
return /*#__PURE__*/React__namespace.createElement(TreeTableRow, {
|
|
39162
|
-
key: node.key || JSON.stringify(node.data),
|
|
39501
|
+
key: "".concat(node.key || JSON.stringify(node.data), "_").concat(index),
|
|
39163
39502
|
level: 0,
|
|
39164
39503
|
rowIndex: index,
|
|
39165
39504
|
selectOnEdit: props.selectOnEdit,
|
|
@@ -40559,7 +40898,7 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40559
40898
|
}
|
|
40560
40899
|
scrollableView = createScrollableView(value, scrollableColumns, false, props.headerColumnGroup, props.footerColumnGroup);
|
|
40561
40900
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
40562
|
-
className: "p-treetable-scrollable-wrapper"
|
|
40901
|
+
className: "p-treetable-wrapper p-treetable-scrollable-wrapper"
|
|
40563
40902
|
}, frozenView, scrollableView);
|
|
40564
40903
|
};
|
|
40565
40904
|
var createRegularTable = function createRegularTable(value) {
|
|
@@ -40567,12 +40906,17 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40567
40906
|
var header = createTableHeader(columns, props.headerColumnGroup);
|
|
40568
40907
|
var footer = createTableFooter(columns, props.footerColumnGroup);
|
|
40569
40908
|
var body = createTableBody(value, columns);
|
|
40909
|
+
var tableClassName = classNames('p-treetable-table', {
|
|
40910
|
+
'p-treetable-scrollable-table': props.scrollable,
|
|
40911
|
+
'p-treetable-resizable-table': props.resizableColumns,
|
|
40912
|
+
'p-treetable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
40913
|
+
}, props.tableClassName);
|
|
40570
40914
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
40571
40915
|
className: "p-treetable-wrapper"
|
|
40572
40916
|
}, /*#__PURE__*/React__namespace.createElement("table", {
|
|
40573
40917
|
ref: tableRef,
|
|
40574
40918
|
style: props.tableStyle,
|
|
40575
|
-
className:
|
|
40919
|
+
className: tableClassName
|
|
40576
40920
|
}, header, footer, body));
|
|
40577
40921
|
};
|
|
40578
40922
|
var createTable = function createTable(value) {
|
|
@@ -40598,7 +40942,6 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40598
40942
|
'p-treetable-selectable': isRowSelectionMode(),
|
|
40599
40943
|
'p-treetable-resizable': props.resizableColumns,
|
|
40600
40944
|
'p-treetable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
40601
|
-
'p-treetable-auto-layout': props.autoLayout,
|
|
40602
40945
|
'p-treetable-striped': props.stripedRows,
|
|
40603
40946
|
'p-treetable-gridlines': props.showGridlines
|
|
40604
40947
|
}, props.className);
|
|
@@ -40641,7 +40984,7 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40641
40984
|
id: props.id,
|
|
40642
40985
|
className: className,
|
|
40643
40986
|
style: props.style,
|
|
40644
|
-
"data-scrollselectors": ".p-treetable-
|
|
40987
|
+
"data-scrollselectors": ".p-treetable-wrapper"
|
|
40645
40988
|
}, otherProps), loader, headerFacet, paginatorTop, table, paginatorBottom, footerFacet, resizeHelper, reorderIndicatorUp, reorderIndicatorDown);
|
|
40646
40989
|
});
|
|
40647
40990
|
TreeTable.displayName = 'TreeTable';
|
|
@@ -40902,6 +41245,7 @@ exports.useFavicon = useFavicon;
|
|
|
40902
41245
|
exports.useIntersectionObserver = useIntersectionObserver;
|
|
40903
41246
|
exports.useInterval = useInterval;
|
|
40904
41247
|
exports.useLocalStorage = useLocalStorage;
|
|
41248
|
+
exports.useMatchMedia = useMatchMedia;
|
|
40905
41249
|
exports.useMountEffect = useMountEffect;
|
|
40906
41250
|
exports.useMouse = useMouse;
|
|
40907
41251
|
exports.useMove = useMove;
|