primereact 9.1.0 → 9.2.0
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/accordion/package.json +7 -0
- package/api/api.d.ts +2 -2
- package/api/package.json +7 -0
- 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/autocomplete/package.json +7 -0
- 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/avatar/package.json +7 -0
- package/avatargroup/package.json +7 -0
- package/badge/package.json +7 -0
- package/blockui/package.json +7 -0
- package/breadcrumb/package.json +7 -0
- package/button/package.json +7 -0
- 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/calendar/package.json +7 -0
- package/card/package.json +7 -0
- package/carousel/package.json +7 -0
- package/cascadeselect/package.json +7 -0
- package/chart/package.json +7 -0
- package/checkbox/package.json +7 -0
- package/chip/package.json +7 -0
- package/chips/package.json +7 -0
- package/colorpicker/package.json +7 -0
- package/column/package.json +7 -0
- package/columngroup/package.json +7 -0
- package/confirmdialog/package.json +7 -0
- package/confirmpopup/package.json +7 -0
- 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/contextmenu/package.json +7 -0
- package/core/core.js +226 -115
- package/core/core.min.js +4 -4
- package/csstransition/package.json +7 -0
- package/datascroller/package.json +7 -0
- package/datatable/datatable.cjs.js +84 -79
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +2 -11
- package/datatable/datatable.esm.js +85 -80
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +84 -79
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/datatable/package.json +7 -0
- package/dataview/package.json +7 -0
- package/deferredcontent/package.json +7 -0
- package/dialog/package.json +7 -0
- package/divider/package.json +7 -0
- package/dock/package.json +7 -0
- 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/dropdown/package.json +7 -0
- package/editor/package.json +7 -0
- package/fieldset/package.json +7 -0
- package/fileupload/package.json +7 -0
- package/galleria/package.json +7 -0
- package/hooks/hooks.cjs.js +34 -2
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +13 -0
- 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/hooks/package.json +7 -0
- package/image/package.json +7 -0
- package/inplace/package.json +7 -0
- package/inputmask/package.json +7 -0
- package/inputnumber/package.json +7 -0
- package/inputswitch/package.json +7 -0
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/package.json +7 -0
- package/inputtextarea/package.json +7 -0
- package/keyfilter/package.json +7 -0
- package/knob/package.json +7 -0
- 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/listbox/package.json +7 -0
- package/megamenu/megamenu.cjs.js +91 -6
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +9 -0
- package/megamenu/megamenu.esm.js +93 -8
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +91 -6
- package/megamenu/megamenu.min.css +1 -1
- package/megamenu/megamenu.min.js +1 -1
- package/megamenu/package.json +7 -0
- package/mention/package.json +7 -0
- package/menu/package.json +7 -0
- package/menubar/package.json +7 -0
- package/menuitem/package.json +4 -0
- package/message/package.json +7 -0
- package/messages/package.json +7 -0
- package/multiselect/multiselect.cjs.js +1 -0
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +1 -0
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +1 -0
- package/multiselect/multiselect.min.js +1 -1
- package/multiselect/package.json +7 -0
- package/multistatecheckbox/package.json +7 -0
- package/orderlist/package.json +7 -0
- package/organizationchart/package.json +7 -0
- package/overlaypanel/package.json +7 -0
- package/overlayservice/package.json +7 -0
- package/package.json +1 -1
- package/paginator/package.json +7 -0
- package/panel/package.json +7 -0
- package/panelmenu/package.json +7 -0
- package/password/package.json +7 -0
- package/picklist/package.json +7 -0
- package/portal/package.json +6 -0
- package/primereact.all.cjs.js +554 -244
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +554 -245
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +554 -244
- package/primereact.all.min.js +1 -1
- package/progressbar/package.json +7 -0
- package/progressspinner/package.json +7 -0
- package/radiobutton/package.json +7 -0
- package/rating/package.json +7 -0
- package/resources/primereact.css +781 -832
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +130 -2
- package/resources/themes/arya-green/theme.css +130 -2
- package/resources/themes/arya-orange/theme.css +130 -2
- package/resources/themes/arya-purple/theme.css +130 -2
- package/resources/themes/bootstrap4-dark-blue/theme.css +131 -2
- package/resources/themes/bootstrap4-dark-purple/theme.css +131 -2
- package/resources/themes/bootstrap4-light-blue/theme.css +131 -2
- package/resources/themes/bootstrap4-light-purple/theme.css +131 -2
- package/resources/themes/fluent-light/theme.css +131 -2
- package/resources/themes/lara-dark-blue/theme.css +131 -2
- package/resources/themes/lara-dark-indigo/theme.css +131 -2
- package/resources/themes/lara-dark-purple/theme.css +131 -2
- package/resources/themes/lara-dark-teal/theme.css +131 -2
- package/resources/themes/lara-light-blue/theme.css +131 -2
- package/resources/themes/lara-light-indigo/theme.css +131 -2
- package/resources/themes/lara-light-purple/theme.css +131 -2
- package/resources/themes/lara-light-teal/theme.css +131 -2
- package/resources/themes/luna-amber/theme.css +131 -2
- package/resources/themes/luna-blue/theme.css +131 -2
- package/resources/themes/luna-green/theme.css +131 -2
- package/resources/themes/luna-pink/theme.css +131 -2
- package/resources/themes/md-dark-deeppurple/theme.css +131 -2
- package/resources/themes/md-dark-indigo/theme.css +131 -2
- package/resources/themes/md-light-deeppurple/theme.css +131 -2
- package/resources/themes/md-light-indigo/theme.css +131 -2
- package/resources/themes/mdc-dark-deeppurple/theme.css +131 -2
- package/resources/themes/mdc-dark-indigo/theme.css +131 -2
- package/resources/themes/mdc-light-deeppurple/theme.css +131 -2
- package/resources/themes/mdc-light-indigo/theme.css +131 -2
- package/resources/themes/mira/theme.css +131 -2
- package/resources/themes/nano/theme.css +131 -2
- package/resources/themes/nova/theme.css +131 -2
- package/resources/themes/nova-accent/theme.css +131 -2
- package/resources/themes/nova-alt/theme.css +131 -2
- package/resources/themes/rhea/theme.css +131 -2
- package/resources/themes/saga-blue/theme.css +131 -2
- package/resources/themes/saga-green/theme.css +131 -2
- package/resources/themes/saga-orange/theme.css +131 -2
- package/resources/themes/saga-purple/theme.css +131 -2
- package/resources/themes/soho-dark/theme.css +131 -2
- package/resources/themes/soho-light/theme.css +131 -2
- package/resources/themes/tailwind-light/theme.css +131 -2
- package/resources/themes/vela-blue/theme.css +131 -2
- package/resources/themes/vela-green/theme.css +131 -2
- package/resources/themes/vela-orange/theme.css +131 -2
- package/resources/themes/vela-purple/theme.css +131 -2
- package/resources/themes/viva-dark/theme.css +131 -2
- package/resources/themes/viva-light/theme.css +131 -2
- package/ripple/package.json +7 -0
- package/row/package.json +7 -0
- package/scrollpanel/package.json +7 -0
- package/scrolltop/package.json +7 -0
- package/selectbutton/package.json +7 -0
- package/selectitem/package.json +4 -0
- package/sidebar/package.json +7 -0
- package/skeleton/package.json +7 -0
- package/slidemenu/package.json +7 -0
- package/slider/package.json +7 -0
- package/speeddial/package.json +7 -0
- package/splitbutton/package.json +7 -0
- package/splitter/package.json +7 -0
- package/steps/package.json +7 -0
- package/styleclass/package.json +7 -0
- package/tabmenu/package.json +7 -0
- package/tabview/package.json +7 -0
- package/tag/package.json +7 -0
- package/terminal/package.json +7 -0
- package/terminalservice/package.json +7 -0
- package/tieredmenu/package.json +7 -0
- 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/timeline/package.json +7 -0
- package/toast/package.json +7 -0
- package/toast/toast.min.css +1 -1
- package/togglebutton/package.json +7 -0
- package/toolbar/package.json +7 -0
- package/tooltip/package.json +7 -0
- package/tree/package.json +7 -0
- package/treenode/package.json +4 -0
- package/treeselect/package.json +7 -0
- package/treetable/package.json +7 -0
- 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/tristatecheckbox/package.json +7 -0
- package/utils/package.json +7 -0
- package/utils/utils.cjs.js +14 -9
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +14 -9
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +14 -9
- package/utils/utils.min.js +1 -1
- package/virtualscroller/package.json +7 -0
- 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 +1 -1
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
|
|
@@ -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
|
}, {
|
|
@@ -2965,6 +2970,34 @@ var useInterval = function useInterval(fn) {
|
|
|
2965
2970
|
};
|
|
2966
2971
|
/* eslint-enable */
|
|
2967
2972
|
|
|
2973
|
+
var useMatchMedia = function useMatchMedia(query) {
|
|
2974
|
+
var when = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2975
|
+
var _React$useState = React__namespace.useState(false),
|
|
2976
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2977
|
+
matches = _React$useState2[0],
|
|
2978
|
+
setMatches = _React$useState2[1];
|
|
2979
|
+
var matchMedia = React__namespace.useRef(null);
|
|
2980
|
+
var handleChange = function handleChange(e) {
|
|
2981
|
+
return setMatches(e.matches);
|
|
2982
|
+
};
|
|
2983
|
+
var bind = function bind() {
|
|
2984
|
+
return matchMedia.current && matchMedia.current.addEventListener('change', handleChange);
|
|
2985
|
+
};
|
|
2986
|
+
var unbind = function unbind() {
|
|
2987
|
+
return matchMedia.current && matchMedia.current.removeEventListener('change', handleChange) && (matchMedia.current = null);
|
|
2988
|
+
};
|
|
2989
|
+
React__namespace.useEffect(function () {
|
|
2990
|
+
if (when) {
|
|
2991
|
+
matchMedia.current = window.matchMedia(query);
|
|
2992
|
+
setMatches(matchMedia.current.matches);
|
|
2993
|
+
bind();
|
|
2994
|
+
}
|
|
2995
|
+
return unbind;
|
|
2996
|
+
}, [query, when]);
|
|
2997
|
+
return matches;
|
|
2998
|
+
};
|
|
2999
|
+
/* eslint-enable */
|
|
3000
|
+
|
|
2968
3001
|
/* eslint-disable */
|
|
2969
3002
|
var useMountEffect = function useMountEffect(fn) {
|
|
2970
3003
|
return React__namespace.useEffect(fn, []);
|
|
@@ -3290,11 +3323,14 @@ var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
|
|
|
3290
3323
|
/* eslint-enable */
|
|
3291
3324
|
|
|
3292
3325
|
var useResizeListener = function useResizeListener(_ref) {
|
|
3293
|
-
var listener = _ref.listener
|
|
3326
|
+
var listener = _ref.listener,
|
|
3327
|
+
_ref$when = _ref.when,
|
|
3328
|
+
when = _ref$when === void 0 ? true : _ref$when;
|
|
3294
3329
|
return useEventListener({
|
|
3295
3330
|
target: 'window',
|
|
3296
3331
|
type: 'resize',
|
|
3297
|
-
listener: listener
|
|
3332
|
+
listener: listener,
|
|
3333
|
+
when: when
|
|
3298
3334
|
});
|
|
3299
3335
|
};
|
|
3300
3336
|
|
|
@@ -4743,14 +4779,18 @@ var VirtualScrollerBase = {
|
|
|
4743
4779
|
id: null,
|
|
4744
4780
|
style: null,
|
|
4745
4781
|
className: null,
|
|
4782
|
+
tabIndex: 0,
|
|
4746
4783
|
items: null,
|
|
4747
4784
|
itemSize: 0,
|
|
4748
4785
|
scrollHeight: null,
|
|
4749
4786
|
scrollWidth: null,
|
|
4750
4787
|
orientation: 'vertical',
|
|
4788
|
+
step: 0,
|
|
4751
4789
|
numToleratedItems: null,
|
|
4752
4790
|
delay: 0,
|
|
4753
4791
|
resizeDelay: 10,
|
|
4792
|
+
appendOnly: false,
|
|
4793
|
+
inline: false,
|
|
4754
4794
|
lazy: false,
|
|
4755
4795
|
disabled: false,
|
|
4756
4796
|
loaderDisabled: false,
|
|
@@ -4780,6 +4820,7 @@ function ownKeys$v(object, enumerableOnly) { var keys = Object.keys(object); if
|
|
|
4780
4820
|
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
4821
|
var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
4782
4822
|
var props = VirtualScrollerBase.getProps(inProps);
|
|
4823
|
+
var prevProps = usePrevious(inProps) || {};
|
|
4783
4824
|
var vertical = props.orientation === 'vertical';
|
|
4784
4825
|
var horizontal = props.orientation === 'horizontal';
|
|
4785
4826
|
var both = props.orientation === 'both';
|
|
@@ -4797,25 +4838,29 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4797
4838
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
4798
4839
|
lastState = _React$useState4[0],
|
|
4799
4840
|
setLastState = _React$useState4[1];
|
|
4800
|
-
var _React$useState5 = React__namespace.useState(
|
|
4841
|
+
var _React$useState5 = React__namespace.useState(0),
|
|
4842
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
4843
|
+
pageState = _React$useState6[0],
|
|
4844
|
+
setPageState = _React$useState6[1];
|
|
4845
|
+
var _React$useState7 = React__namespace.useState(both ? {
|
|
4801
4846
|
rows: 0,
|
|
4802
4847
|
cols: 0
|
|
4803
4848
|
} : 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
4849
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
var _React$useState9 = React__namespace.useState(props.
|
|
4850
|
+
numItemsInViewportState = _React$useState8[0],
|
|
4851
|
+
setNumItemsInViewportState = _React$useState8[1];
|
|
4852
|
+
var _React$useState9 = React__namespace.useState(props.numToleratedItems),
|
|
4812
4853
|
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
var _React$useState11 = React__namespace.useState(
|
|
4854
|
+
numToleratedItemsState = _React$useState10[0],
|
|
4855
|
+
setNumToleratedItemsState = _React$useState10[1];
|
|
4856
|
+
var _React$useState11 = React__namespace.useState(props.loading || false),
|
|
4816
4857
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
4817
|
-
|
|
4818
|
-
|
|
4858
|
+
loadingState = _React$useState12[0],
|
|
4859
|
+
setLoadingState = _React$useState12[1];
|
|
4860
|
+
var _React$useState13 = React__namespace.useState([]),
|
|
4861
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
4862
|
+
loaderArrState = _React$useState14[0],
|
|
4863
|
+
setLoaderArrState = _React$useState14[1];
|
|
4819
4864
|
var elementRef = React__namespace.useRef(null);
|
|
4820
4865
|
var _contentRef = React__namespace.useRef(null);
|
|
4821
4866
|
var _spacerRef = React__namespace.useRef(null);
|
|
@@ -4826,14 +4871,19 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4826
4871
|
} : 0);
|
|
4827
4872
|
var scrollTimeout = React__namespace.useRef(null);
|
|
4828
4873
|
var resizeTimeout = React__namespace.useRef(null);
|
|
4874
|
+
var contentStyle = React__namespace.useRef({});
|
|
4875
|
+
var spacerStyle = React__namespace.useRef({});
|
|
4829
4876
|
var defaultWidth = React__namespace.useRef(null);
|
|
4830
4877
|
var defaultHeight = React__namespace.useRef(null);
|
|
4831
|
-
var
|
|
4832
|
-
var
|
|
4878
|
+
var defaultContentWidth = React__namespace.useRef(null);
|
|
4879
|
+
var defaultContentHeight = React__namespace.useRef(null);
|
|
4880
|
+
var isItemRangeChanged = React__namespace.useRef(false);
|
|
4881
|
+
var lazyLoadState = React__namespace.useRef(null);
|
|
4833
4882
|
var _useResizeListener = useResizeListener({
|
|
4834
4883
|
listener: function listener(event) {
|
|
4835
4884
|
return onResize();
|
|
4836
|
-
}
|
|
4885
|
+
},
|
|
4886
|
+
when: !props.disabled
|
|
4837
4887
|
}),
|
|
4838
4888
|
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
4839
4889
|
bindWindowResizeListener = _useResizeListener2[0];
|
|
@@ -4842,13 +4892,23 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4842
4892
|
type: 'orientationchange',
|
|
4843
4893
|
listener: function listener(event) {
|
|
4844
4894
|
return onResize();
|
|
4845
|
-
}
|
|
4895
|
+
},
|
|
4896
|
+
when: !props.disabled
|
|
4846
4897
|
}),
|
|
4847
4898
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
4848
4899
|
bindOrientationChangeListener = _useEventListener2[0];
|
|
4849
4900
|
var getElementRef = function getElementRef() {
|
|
4850
4901
|
return elementRef;
|
|
4851
4902
|
};
|
|
4903
|
+
var getPageByFirst = function getPageByFirst(first) {
|
|
4904
|
+
return Math.floor((first + numToleratedItemsState * 4) / (props.step || 1));
|
|
4905
|
+
};
|
|
4906
|
+
var setContentElement = function setContentElement(element) {
|
|
4907
|
+
_contentRef.current = element || _contentRef.current || DomHandler.findSingle(elementRef.current, '.p-virtualscroller-content');
|
|
4908
|
+
};
|
|
4909
|
+
var isPageChanged = function isPageChanged(first) {
|
|
4910
|
+
return props.step ? pageState !== getPageByFirst(first) : true;
|
|
4911
|
+
};
|
|
4852
4912
|
var scrollTo = function scrollTo(options) {
|
|
4853
4913
|
lastScrollPos.current = both ? {
|
|
4854
4914
|
top: 0,
|
|
@@ -4860,13 +4920,14 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4860
4920
|
var behavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'auto';
|
|
4861
4921
|
var _calculateNumItems = calculateNumItems(),
|
|
4862
4922
|
numToleratedItems = _calculateNumItems.numToleratedItems;
|
|
4923
|
+
var contentPos = getContentPosition();
|
|
4863
4924
|
var calculateFirst = function calculateFirst() {
|
|
4864
4925
|
var _index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
4865
4926
|
var _numT = arguments.length > 1 ? arguments[1] : undefined;
|
|
4866
4927
|
return _index <= _numT ? 0 : _index;
|
|
4867
4928
|
};
|
|
4868
|
-
var calculateCoord = function calculateCoord(_first, _size) {
|
|
4869
|
-
return _first * _size;
|
|
4929
|
+
var calculateCoord = function calculateCoord(_first, _size, _cpos) {
|
|
4930
|
+
return _first * _size + _cpos;
|
|
4870
4931
|
};
|
|
4871
4932
|
var scrollToItem = function scrollToItem() {
|
|
4872
4933
|
var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -4877,20 +4938,25 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
4877
4938
|
behavior: behavior
|
|
4878
4939
|
});
|
|
4879
4940
|
};
|
|
4941
|
+
var newFirst = both ? {
|
|
4942
|
+
rows: 0,
|
|
4943
|
+
cols: 0
|
|
4944
|
+
} : 0;
|
|
4945
|
+
var isRangeChanged = false;
|
|
4880
4946
|
if (both) {
|
|
4881
|
-
|
|
4947
|
+
newFirst = {
|
|
4882
4948
|
rows: calculateFirst(index[0], numToleratedItems[0]),
|
|
4883
4949
|
cols: calculateFirst(index[1], numToleratedItems[1])
|
|
4884
4950
|
};
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
}
|
|
4951
|
+
scrollToItem(calculateCoord(newFirst.cols, props.itemSize[1], contentPos.left), calculateCoord(newFirst.rows, props.itemSize[0], contentPos.top));
|
|
4952
|
+
isRangeChanged = firstState.rows !== newFirst.rows || firstState.cols !== newFirst.cols;
|
|
4888
4953
|
} else {
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
}
|
|
4954
|
+
newFirst = calculateFirst(index, numToleratedItems);
|
|
4955
|
+
horizontal ? scrollToItem(calculateCoord(newFirst, props.itemSize, contentPos.left), 0) : scrollToItem(0, calculateCoord(newFirst, props.itemSize, contentPos.top));
|
|
4956
|
+
isRangeChanged = firstState !== newFirst;
|
|
4893
4957
|
}
|
|
4958
|
+
isItemRangeChanged.current = isRangeChanged;
|
|
4959
|
+
setFirstState(newFirst);
|
|
4894
4960
|
};
|
|
4895
4961
|
var scrollInView = function scrollInView(index, to) {
|
|
4896
4962
|
var behavior = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'auto';
|
|
@@ -5007,7 +5073,8 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5007
5073
|
var _calculateNumItems2 = calculateNumItems(),
|
|
5008
5074
|
numItemsInViewport = _calculateNumItems2.numItemsInViewport,
|
|
5009
5075
|
numToleratedItems = _calculateNumItems2.numToleratedItems;
|
|
5010
|
-
var calculateLast = function calculateLast(_first, _num, _numT
|
|
5076
|
+
var calculateLast = function calculateLast(_first, _num, _numT) {
|
|
5077
|
+
var _isCols = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
5011
5078
|
return getLast(_first + _num + (_first < _numT ? 2 : 3) * _numT, _isCols);
|
|
5012
5079
|
};
|
|
5013
5080
|
var last = both ? {
|
|
@@ -5029,9 +5096,15 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5029
5096
|
}));
|
|
5030
5097
|
}
|
|
5031
5098
|
if (props.lazy) {
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5099
|
+
Promise.resolve().then(function () {
|
|
5100
|
+
lazyLoadState.current = {
|
|
5101
|
+
first: props.step ? both ? {
|
|
5102
|
+
rows: 0,
|
|
5103
|
+
cols: firstState.cols
|
|
5104
|
+
} : 0 : firstState,
|
|
5105
|
+
last: Math.min(props.step ? props.step : last, props.items.length)
|
|
5106
|
+
};
|
|
5107
|
+
props.onLazyLoad && props.onLazyLoad(lazyLoadState.current);
|
|
5035
5108
|
});
|
|
5036
5109
|
}
|
|
5037
5110
|
};
|
|
@@ -5040,12 +5113,21 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5040
5113
|
Promise.resolve().then(function () {
|
|
5041
5114
|
if (_contentRef.current) {
|
|
5042
5115
|
_contentRef.current.style.minHeight = _contentRef.current.style.minWidth = 'auto';
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5116
|
+
_contentRef.current.style.position = 'relative';
|
|
5117
|
+
elementRef.current.style.contain = 'none';
|
|
5118
|
+
|
|
5119
|
+
/*const [contentWidth, contentHeight] = [DomHandler.getWidth(contentRef.current), DomHandler.getHeight(contentRef.current)];
|
|
5120
|
+
contentWidth !== defaultContentWidth.current && (elementRef.current.style.width = '');
|
|
5121
|
+
contentHeight !== defaultContentHeight.current && (elementRef.current.style.height = '');*/
|
|
5122
|
+
|
|
5123
|
+
var _ref = [DomHandler.getWidth(elementRef.current), DomHandler.getHeight(elementRef.current)],
|
|
5124
|
+
width = _ref[0],
|
|
5125
|
+
height = _ref[1];
|
|
5126
|
+
(both || horizontal) && (elementRef.current.style.width = (width < defaultWidth.current ? width : props.scrollWidth || defaultWidth.current) + 'px');
|
|
5127
|
+
(both || vertical) && (elementRef.current.style.height = (height < defaultHeight.current ? height : props.scrollHeight || defaultHeight.current) + 'px');
|
|
5048
5128
|
_contentRef.current.style.minHeight = _contentRef.current.style.minWidth = '';
|
|
5129
|
+
_contentRef.current.style.position = '';
|
|
5130
|
+
elementRef.current.style.contain = '';
|
|
5049
5131
|
}
|
|
5050
5132
|
});
|
|
5051
5133
|
}
|
|
@@ -5058,10 +5140,10 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5058
5140
|
var getContentPosition = function getContentPosition() {
|
|
5059
5141
|
if (_contentRef.current) {
|
|
5060
5142
|
var style = getComputedStyle(_contentRef.current);
|
|
5061
|
-
var left =
|
|
5062
|
-
var right =
|
|
5063
|
-
var top =
|
|
5064
|
-
var bottom =
|
|
5143
|
+
var left = parseFloat(style.paddingLeft) + Math.max(parseFloat(style.left) || 0, 0);
|
|
5144
|
+
var right = parseFloat(style.paddingRight) + Math.max(parseFloat(style.right) || 0, 0);
|
|
5145
|
+
var top = parseFloat(style.paddingTop) + Math.max(parseFloat(style.top) || 0, 0);
|
|
5146
|
+
var bottom = parseFloat(style.paddingBottom) + Math.max(parseFloat(style.bottom) || 0, 0);
|
|
5065
5147
|
return {
|
|
5066
5148
|
left: left,
|
|
5067
5149
|
right: right,
|
|
@@ -5098,11 +5180,11 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5098
5180
|
};
|
|
5099
5181
|
var setSpacerSize = function setSpacerSize() {
|
|
5100
5182
|
var items = props.items;
|
|
5101
|
-
if (
|
|
5183
|
+
if (items) {
|
|
5102
5184
|
var contentPos = getContentPosition();
|
|
5103
5185
|
var setProp = function setProp(_name, _value, _size) {
|
|
5104
5186
|
var _cpos = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5105
|
-
return
|
|
5187
|
+
return spacerStyle.current = _objectSpread$v(_objectSpread$v({}, spacerStyle.current), _defineProperty({}, "".concat(_name), (_value || []).length * _size + _cpos + 'px'));
|
|
5106
5188
|
};
|
|
5107
5189
|
if (both) {
|
|
5108
5190
|
setProp('height', items, props.itemSize[0], contentPos.y);
|
|
@@ -5113,7 +5195,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5113
5195
|
}
|
|
5114
5196
|
};
|
|
5115
5197
|
var setContentPosition = function setContentPosition(pos) {
|
|
5116
|
-
if (_contentRef.current) {
|
|
5198
|
+
if (_contentRef.current && !props.appendOnly) {
|
|
5117
5199
|
var first = pos ? pos.first : firstState;
|
|
5118
5200
|
var calculateTranslateVal = function calculateTranslateVal(_first, _size) {
|
|
5119
5201
|
return _first * _size;
|
|
@@ -5122,7 +5204,9 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5122
5204
|
var _x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
5123
5205
|
var _y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
5124
5206
|
_stickyRef.current && (_stickyRef.current.style.top = "-".concat(_y, "px"));
|
|
5125
|
-
|
|
5207
|
+
contentStyle.current = _objectSpread$v(_objectSpread$v({}, contentStyle.current), {
|
|
5208
|
+
transform: "translate3d(".concat(_x, "px, ").concat(_y, "px, 0)")
|
|
5209
|
+
});
|
|
5126
5210
|
};
|
|
5127
5211
|
if (both) {
|
|
5128
5212
|
setTransform(calculateTranslateVal(first.cols, props.itemSize[1]), calculateTranslateVal(first.rows, props.itemSize[0]));
|
|
@@ -5166,36 +5250,40 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5166
5250
|
if (both) {
|
|
5167
5251
|
var isScrollDown = lastScrollPos.current.top <= scrollTop;
|
|
5168
5252
|
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
|
-
|
|
5253
|
+
if (!props.appendOnly || props.appendOnly && (isScrollDown || isScrollRight)) {
|
|
5254
|
+
var currentIndex = {
|
|
5255
|
+
rows: calculateCurrentIndex(scrollTop, props.itemSize[0]),
|
|
5256
|
+
cols: calculateCurrentIndex(scrollLeft, props.itemSize[1])
|
|
5257
|
+
};
|
|
5258
|
+
var triggerIndex = {
|
|
5259
|
+
rows: calculateTriggerIndex(currentIndex.rows, firstState.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0], isScrollDown),
|
|
5260
|
+
cols: calculateTriggerIndex(currentIndex.cols, firstState.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], isScrollRight)
|
|
5261
|
+
};
|
|
5262
|
+
newFirst = {
|
|
5263
|
+
rows: calculateFirst(currentIndex.rows, triggerIndex.rows, firstState.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0], isScrollDown),
|
|
5264
|
+
cols: calculateFirst(currentIndex.cols, triggerIndex.cols, firstState.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], isScrollRight)
|
|
5265
|
+
};
|
|
5266
|
+
newLast = {
|
|
5267
|
+
rows: calculateLast(currentIndex.rows, newFirst.rows, lastState.rows, numItemsInViewportState.rows, numToleratedItemsState[0]),
|
|
5268
|
+
cols: calculateLast(currentIndex.cols, newFirst.cols, lastState.cols, numItemsInViewportState.cols, numToleratedItemsState[1], true)
|
|
5269
|
+
};
|
|
5270
|
+
isRangeChanged = newFirst.rows !== firstState.rows || newLast.rows !== lastState.rows || newFirst.cols !== firstState.cols || newLast.cols !== lastState.cols || isItemRangeChanged.current;
|
|
5271
|
+
newScrollPos = {
|
|
5272
|
+
top: scrollTop,
|
|
5273
|
+
left: scrollLeft
|
|
5274
|
+
};
|
|
5275
|
+
}
|
|
5190
5276
|
} else {
|
|
5191
5277
|
var scrollPos = horizontal ? scrollLeft : scrollTop;
|
|
5192
5278
|
var isScrollDownOrRight = lastScrollPos.current <= scrollPos;
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5279
|
+
if (!props.appendOnly || props.appendOnly && isScrollDownOrRight) {
|
|
5280
|
+
var _currentIndex2 = calculateCurrentIndex(scrollPos, props.itemSize);
|
|
5281
|
+
var _triggerIndex2 = calculateTriggerIndex(_currentIndex2, firstState, lastState, numItemsInViewportState, numToleratedItemsState, isScrollDownOrRight);
|
|
5282
|
+
newFirst = calculateFirst(_currentIndex2, _triggerIndex2, firstState, lastState, numItemsInViewportState, numToleratedItemsState, isScrollDownOrRight);
|
|
5283
|
+
newLast = calculateLast(_currentIndex2, newFirst, lastState, numItemsInViewportState, numToleratedItemsState);
|
|
5284
|
+
isRangeChanged = newFirst !== firstState || newLast !== lastState || isItemRangeChanged.current;
|
|
5285
|
+
newScrollPos = scrollPos;
|
|
5286
|
+
}
|
|
5199
5287
|
}
|
|
5200
5288
|
return {
|
|
5201
5289
|
first: newFirst,
|
|
@@ -5220,8 +5308,14 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5220
5308
|
setLastState(last);
|
|
5221
5309
|
lastScrollPos.current = scrollPos;
|
|
5222
5310
|
props.onScrollIndexChange && props.onScrollIndexChange(newState);
|
|
5223
|
-
if (props.lazy) {
|
|
5224
|
-
|
|
5311
|
+
if (props.lazy && isPageChanged(first)) {
|
|
5312
|
+
var newLazyLoadState = {
|
|
5313
|
+
first: props.step ? Math.min(getPageByFirst(first) * props.step, props.items.length - props.step) : first,
|
|
5314
|
+
last: Math.min(props.step ? (getPageByFirst(first) + 1) * props.step : last, props.items.length)
|
|
5315
|
+
};
|
|
5316
|
+
var isLazyStateChanged = !lazyLoadState.current || lazyLoadState.current.first !== newLazyLoadState.first || lazyLoadState.current.last !== newLazyLoadState.last;
|
|
5317
|
+
isLazyStateChanged && props.onLazyLoad && props.onLazyLoad(newLazyLoadState);
|
|
5318
|
+
lazyLoadState.current = newLazyLoadState;
|
|
5225
5319
|
}
|
|
5226
5320
|
}
|
|
5227
5321
|
};
|
|
@@ -5231,17 +5325,21 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5231
5325
|
if (scrollTimeout.current) {
|
|
5232
5326
|
clearTimeout(scrollTimeout.current);
|
|
5233
5327
|
}
|
|
5234
|
-
if (
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5328
|
+
if (isPageChanged(firstState)) {
|
|
5329
|
+
if (!loadingState && props.showLoader) {
|
|
5330
|
+
var _onScrollPositionChan2 = onScrollPositionChange(event),
|
|
5331
|
+
isRangeChanged = _onScrollPositionChan2.isRangeChanged;
|
|
5332
|
+
var changed = isRangeChanged || (props.step ? isPageChanged(firstState) : false);
|
|
5333
|
+
changed && setLoadingState(true);
|
|
5334
|
+
}
|
|
5335
|
+
scrollTimeout.current = setTimeout(function () {
|
|
5336
|
+
onScrollChange(event);
|
|
5337
|
+
if (loadingState && props.showLoader && (!props.lazy || props.loading === undefined)) {
|
|
5338
|
+
setLoadingState(false);
|
|
5339
|
+
setPageState(getPageByFirst(firstState));
|
|
5340
|
+
}
|
|
5341
|
+
}, props.delay);
|
|
5238
5342
|
}
|
|
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
5343
|
} else {
|
|
5246
5344
|
onScrollChange(event);
|
|
5247
5345
|
}
|
|
@@ -5252,9 +5350,9 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5252
5350
|
}
|
|
5253
5351
|
resizeTimeout.current = setTimeout(function () {
|
|
5254
5352
|
if (elementRef.current) {
|
|
5255
|
-
var
|
|
5256
|
-
width =
|
|
5257
|
-
height =
|
|
5353
|
+
var _ref2 = [DomHandler.getWidth(elementRef.current), DomHandler.getHeight(elementRef.current)],
|
|
5354
|
+
width = _ref2[0],
|
|
5355
|
+
height = _ref2[1];
|
|
5258
5356
|
var isDiffWidth = width !== defaultWidth.current,
|
|
5259
5357
|
isDiffHeight = height !== defaultHeight.current;
|
|
5260
5358
|
var reinit = both ? isDiffWidth || isDiffHeight : horizontal ? isDiffWidth : vertical ? isDiffHeight : false;
|
|
@@ -5262,6 +5360,8 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5262
5360
|
setNumToleratedItemsState(props.numToleratedItems);
|
|
5263
5361
|
defaultWidth.current = width;
|
|
5264
5362
|
defaultHeight.current = height;
|
|
5363
|
+
defaultContentWidth.current = DomHandler.getWidth(_contentRef.current);
|
|
5364
|
+
defaultContentHeight.current = DomHandler.getHeight(_contentRef.current);
|
|
5265
5365
|
}
|
|
5266
5366
|
}
|
|
5267
5367
|
}, props.resizeDelay);
|
|
@@ -5294,12 +5394,24 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5294
5394
|
var loadedItems = function loadedItems() {
|
|
5295
5395
|
var items = props.items;
|
|
5296
5396
|
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);
|
|
5397
|
+
if (both) return items.slice(props.appendOnly ? 0 : firstState.rows, lastState.rows).map(function (item) {
|
|
5398
|
+
return props.columns ? item : item.slice(props.appendOnly ? 0 : firstState.cols, lastState.cols);
|
|
5399
|
+
});else if (horizontal && props.columns) return items;else return items.slice(props.appendOnly ? 0 : firstState, lastState);
|
|
5300
5400
|
}
|
|
5301
5401
|
return [];
|
|
5302
5402
|
};
|
|
5403
|
+
var viewInit = function viewInit() {
|
|
5404
|
+
if (elementRef.current && DomHandler.isVisible(elementRef.current)) {
|
|
5405
|
+
setContentElement(_contentRef.current);
|
|
5406
|
+
init();
|
|
5407
|
+
bindWindowResizeListener();
|
|
5408
|
+
bindOrientationChangeListener();
|
|
5409
|
+
defaultWidth.current = DomHandler.getWidth(elementRef.current);
|
|
5410
|
+
defaultHeight.current = DomHandler.getHeight(elementRef.current);
|
|
5411
|
+
defaultContentWidth.current = DomHandler.getWidth(_contentRef.current);
|
|
5412
|
+
defaultContentHeight.current = DomHandler.getHeight(_contentRef.current);
|
|
5413
|
+
}
|
|
5414
|
+
};
|
|
5303
5415
|
var init = function init() {
|
|
5304
5416
|
if (!props.disabled) {
|
|
5305
5417
|
setSize();
|
|
@@ -5308,17 +5420,11 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5308
5420
|
}
|
|
5309
5421
|
};
|
|
5310
5422
|
useMountEffect(function () {
|
|
5311
|
-
|
|
5312
|
-
init();
|
|
5313
|
-
bindWindowResizeListener();
|
|
5314
|
-
bindOrientationChangeListener();
|
|
5315
|
-
defaultWidth.current = DomHandler.getWidth(elementRef.current);
|
|
5316
|
-
defaultHeight.current = DomHandler.getHeight(elementRef.current);
|
|
5317
|
-
}
|
|
5423
|
+
viewInit();
|
|
5318
5424
|
});
|
|
5319
5425
|
useUpdateEffect(function () {
|
|
5320
5426
|
init();
|
|
5321
|
-
}, [props.itemSize, props.scrollHeight]);
|
|
5427
|
+
}, [props.itemSize, props.scrollHeight, props.scrollWidth]);
|
|
5322
5428
|
useUpdateEffect(function () {
|
|
5323
5429
|
if (props.numToleratedItems !== numToleratedItemsState) {
|
|
5324
5430
|
setNumToleratedItemsState(props.numToleratedItems);
|
|
@@ -5330,11 +5436,11 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5330
5436
|
}
|
|
5331
5437
|
}, [numToleratedItemsState]);
|
|
5332
5438
|
useUpdateEffect(function () {
|
|
5333
|
-
if (!
|
|
5439
|
+
if (!prevProps.items || prevProps.items.length !== (props.items || []).length) {
|
|
5334
5440
|
init();
|
|
5335
5441
|
}
|
|
5336
5442
|
var loading = loadingState;
|
|
5337
|
-
if (props.lazy &&
|
|
5443
|
+
if (props.lazy && prevProps.loading !== props.loading && props.loading !== loadingState) {
|
|
5338
5444
|
setLoadingState(props.loading);
|
|
5339
5445
|
loading = props.loading;
|
|
5340
5446
|
}
|
|
@@ -5396,6 +5502,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5396
5502
|
if (props.showSpacer) {
|
|
5397
5503
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
5398
5504
|
ref: _spacerRef,
|
|
5505
|
+
style: spacerStyle.current,
|
|
5399
5506
|
className: "p-virtualscroller-spacer"
|
|
5400
5507
|
});
|
|
5401
5508
|
}
|
|
@@ -5419,11 +5526,14 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5419
5526
|
});
|
|
5420
5527
|
var content = /*#__PURE__*/React__namespace.createElement("div", {
|
|
5421
5528
|
ref: _contentRef,
|
|
5529
|
+
style: contentStyle.current,
|
|
5422
5530
|
className: className
|
|
5423
5531
|
}, items);
|
|
5424
5532
|
if (props.contentTemplate) {
|
|
5425
5533
|
var defaultOptions = {
|
|
5534
|
+
style: contentStyle.current,
|
|
5426
5535
|
className: className,
|
|
5536
|
+
spacerStyle: spacerStyle.current,
|
|
5427
5537
|
contentRef: function contentRef(el) {
|
|
5428
5538
|
return _contentRef.current = ObjectUtils.getRefElement(el);
|
|
5429
5539
|
},
|
|
@@ -5466,10 +5576,9 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5466
5576
|
} else {
|
|
5467
5577
|
var otherProps = VirtualScrollerBase.getOtherProps(props);
|
|
5468
5578
|
var className = classNames('p-virtualscroller', {
|
|
5469
|
-
'p-
|
|
5470
|
-
'p-virtualscroller-both': both,
|
|
5471
|
-
'p-virtualscroller-horizontal': horizontal
|
|
5472
|
-
'p-horizontal-scroll': horizontal
|
|
5579
|
+
'p-virtualscroller-inline': props.inline,
|
|
5580
|
+
'p-virtualscroller-both p-both-scroll': both,
|
|
5581
|
+
'p-virtualscroller-horizontal p-horizontal-scroll': horizontal
|
|
5473
5582
|
}, props.className);
|
|
5474
5583
|
var loader = createLoader();
|
|
5475
5584
|
var _content = createContent();
|
|
@@ -5477,7 +5586,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
5477
5586
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
5478
5587
|
ref: elementRef,
|
|
5479
5588
|
className: className,
|
|
5480
|
-
tabIndex:
|
|
5589
|
+
tabIndex: props.tabIndex,
|
|
5481
5590
|
style: props.style
|
|
5482
5591
|
}, otherProps, {
|
|
5483
5592
|
onScroll: onScroll
|
|
@@ -5573,6 +5682,7 @@ var AutoCompletePanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__
|
|
|
5573
5682
|
var className = classNames('p-autocomplete-items', options.className);
|
|
5574
5683
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
5575
5684
|
ref: options.contentRef,
|
|
5685
|
+
style: options.style,
|
|
5576
5686
|
className: className,
|
|
5577
5687
|
role: "listbox",
|
|
5578
5688
|
id: props.listId
|
|
@@ -6244,7 +6354,7 @@ var Avatar = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
|
6244
6354
|
imageFailed = _React$useState2[0],
|
|
6245
6355
|
setImageFailed = _React$useState2[1];
|
|
6246
6356
|
var createContent = function createContent() {
|
|
6247
|
-
if (props.image && !imageFailed) {
|
|
6357
|
+
if (ObjectUtils.isNotEmpty(props.image) && !imageFailed) {
|
|
6248
6358
|
return /*#__PURE__*/React__namespace.createElement("img", {
|
|
6249
6359
|
src: props.image,
|
|
6250
6360
|
alt: props.imageAlt,
|
|
@@ -6286,7 +6396,7 @@ var Avatar = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
|
6286
6396
|
});
|
|
6287
6397
|
var otherProps = AvatarBase.getOtherProps(props);
|
|
6288
6398
|
var containerClassName = classNames('p-avatar p-component', {
|
|
6289
|
-
'p-avatar-image': props.image
|
|
6399
|
+
'p-avatar-image': ObjectUtils.isNotEmpty(props.image) && !imageFailed,
|
|
6290
6400
|
'p-avatar-circle': props.shape === 'circle',
|
|
6291
6401
|
'p-avatar-lg': props.size === 'large',
|
|
6292
6402
|
'p-avatar-xl': props.size === 'xlarge',
|
|
@@ -8859,7 +8969,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
8859
8969
|
setValue(props.value);
|
|
8860
8970
|
}
|
|
8861
8971
|
return function () {
|
|
8862
|
-
props.mask && unbindMaskEvents();
|
|
8972
|
+
props.mask && unbindMaskEvents && unbindMaskEvents();
|
|
8863
8973
|
};
|
|
8864
8974
|
});
|
|
8865
8975
|
useUpdateEffect(function () {
|
|
@@ -9083,7 +9193,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
9083
9193
|
}
|
|
9084
9194
|
return _content2;
|
|
9085
9195
|
}
|
|
9086
|
-
var displayYear = props.
|
|
9196
|
+
var displayYear = props.numberOfMonths > 1 ? metaYear : currentYear;
|
|
9087
9197
|
return currentView !== 'year' && /*#__PURE__*/React__namespace.createElement("button", {
|
|
9088
9198
|
className: "p-datepicker-year p-link",
|
|
9089
9199
|
onClick: switchToYearView,
|
|
@@ -13167,6 +13277,8 @@ var ContextMenuBase = {
|
|
|
13167
13277
|
global: false,
|
|
13168
13278
|
autoZIndex: true,
|
|
13169
13279
|
baseZIndex: 0,
|
|
13280
|
+
breakpoint: undefined,
|
|
13281
|
+
scrollHeight: '400px',
|
|
13170
13282
|
appendTo: null,
|
|
13171
13283
|
transitionOptions: null,
|
|
13172
13284
|
onShow: null,
|
|
@@ -13192,7 +13304,7 @@ var ContextMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
13192
13304
|
setActiveItemState(null);
|
|
13193
13305
|
}
|
|
13194
13306
|
var onItemMouseEnter = function onItemMouseEnter(event, item) {
|
|
13195
|
-
if (item.disabled) {
|
|
13307
|
+
if (item.disabled || props.isMobileMode) {
|
|
13196
13308
|
event.preventDefault();
|
|
13197
13309
|
return;
|
|
13198
13310
|
}
|
|
@@ -13212,26 +13324,31 @@ var ContextMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
13212
13324
|
item: item
|
|
13213
13325
|
});
|
|
13214
13326
|
}
|
|
13327
|
+
if (props.isMobileMode && item.items) {
|
|
13328
|
+
if (activeItemState && item === activeItemState) setActiveItemState(null);else setActiveItemState(item);
|
|
13329
|
+
}
|
|
13215
13330
|
if (!item.items) {
|
|
13216
13331
|
props.onLeafClick(event);
|
|
13217
13332
|
}
|
|
13218
13333
|
};
|
|
13219
13334
|
var position = function position() {
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13335
|
+
if (!props.isMobileMode) {
|
|
13336
|
+
var parentItem = submenuRef.current.parentElement;
|
|
13337
|
+
var containerOffset = DomHandler.getOffset(parentItem);
|
|
13338
|
+
var viewport = DomHandler.getViewport();
|
|
13339
|
+
var sublistWidth = submenuRef.current.offsetParent ? submenuRef.current.offsetWidth : DomHandler.getHiddenElementOuterWidth(submenuRef.current);
|
|
13340
|
+
var itemOuterWidth = DomHandler.getOuterWidth(parentItem.children[0]);
|
|
13341
|
+
var top = parseInt(containerOffset.top, 10) + submenuRef.current.offsetHeight - DomHandler.getWindowScrollTop();
|
|
13342
|
+
if (top > viewport.height) {
|
|
13343
|
+
submenuRef.current.style.top = viewport.height - top + 'px';
|
|
13344
|
+
} else {
|
|
13345
|
+
submenuRef.current.style.top = '0px';
|
|
13346
|
+
}
|
|
13347
|
+
if (parseInt(containerOffset.left, 10) + itemOuterWidth + sublistWidth > viewport.width - DomHandler.calculateScrollbarWidth()) {
|
|
13348
|
+
submenuRef.current.style.left = -1 * sublistWidth + 'px';
|
|
13349
|
+
} else {
|
|
13350
|
+
submenuRef.current.style.left = itemOuterWidth + 'px';
|
|
13351
|
+
}
|
|
13235
13352
|
}
|
|
13236
13353
|
};
|
|
13237
13354
|
var onEnter = function onEnter() {
|
|
@@ -13253,7 +13370,8 @@ var ContextMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
13253
13370
|
menuProps: props.menuProps,
|
|
13254
13371
|
model: item.items,
|
|
13255
13372
|
resetMenu: item !== activeItemState,
|
|
13256
|
-
onLeafClick: props.onLeafClick
|
|
13373
|
+
onLeafClick: props.onLeafClick,
|
|
13374
|
+
isMobileMode: props.isMobileMode
|
|
13257
13375
|
});
|
|
13258
13376
|
}
|
|
13259
13377
|
return null;
|
|
@@ -13362,8 +13480,14 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13362
13480
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
13363
13481
|
resetMenuState = _React$useState6[0],
|
|
13364
13482
|
setResetMenuState = _React$useState6[1];
|
|
13483
|
+
var _React$useState7 = React__namespace.useState(null),
|
|
13484
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
13485
|
+
attributeSelectorState = _React$useState8[0],
|
|
13486
|
+
setAttributeSelectorState = _React$useState8[1];
|
|
13365
13487
|
var menuRef = React__namespace.useRef(null);
|
|
13366
13488
|
var currentEvent = React__namespace.useRef(null);
|
|
13489
|
+
var styleElementRef = React__namespace.useRef(null);
|
|
13490
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
13367
13491
|
var _useEventListener = useEventListener({
|
|
13368
13492
|
type: 'click',
|
|
13369
13493
|
listener: function listener(event) {
|
|
@@ -13394,6 +13518,17 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13394
13518
|
_useResizeListener2 = _slicedToArray(_useResizeListener, 2),
|
|
13395
13519
|
bindDocumentResizeListener = _useResizeListener2[0],
|
|
13396
13520
|
unbindDocumentResizeListener = _useResizeListener2[1];
|
|
13521
|
+
var createStyle = function createStyle() {
|
|
13522
|
+
if (!styleElementRef.current) {
|
|
13523
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
13524
|
+
var selector = "".concat(attributeSelectorState);
|
|
13525
|
+
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");
|
|
13526
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
13527
|
+
}
|
|
13528
|
+
};
|
|
13529
|
+
var destroyStyle = function destroyStyle() {
|
|
13530
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
13531
|
+
};
|
|
13397
13532
|
var onMenuClick = function onMenuClick() {
|
|
13398
13533
|
setResetMenuState(false);
|
|
13399
13534
|
};
|
|
@@ -13422,6 +13557,10 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13422
13557
|
ZIndexUtils.set('menu', menuRef.current, PrimeReact.autoZIndex, props.baseZIndex || PrimeReact.zIndex['menu']);
|
|
13423
13558
|
}
|
|
13424
13559
|
position(currentEvent.current);
|
|
13560
|
+
if (attributeSelectorState && props.breakpoint) {
|
|
13561
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
13562
|
+
createStyle();
|
|
13563
|
+
}
|
|
13425
13564
|
};
|
|
13426
13565
|
var onEntered = function onEntered() {
|
|
13427
13566
|
bindDocumentListeners();
|
|
@@ -13432,6 +13571,7 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13432
13571
|
};
|
|
13433
13572
|
var onExited = function onExited() {
|
|
13434
13573
|
ZIndexUtils.clear(menuRef.current);
|
|
13574
|
+
destroyStyle();
|
|
13435
13575
|
};
|
|
13436
13576
|
var position = function position(event) {
|
|
13437
13577
|
if (event) {
|
|
@@ -13484,7 +13624,19 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13484
13624
|
if (props.global) {
|
|
13485
13625
|
bindDocumentContextMenuListener();
|
|
13486
13626
|
}
|
|
13627
|
+
if (props.breakpoint) {
|
|
13628
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
13629
|
+
}
|
|
13487
13630
|
});
|
|
13631
|
+
useUpdateEffect(function () {
|
|
13632
|
+
if (attributeSelectorState && menuRef.current) {
|
|
13633
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
13634
|
+
createStyle();
|
|
13635
|
+
}
|
|
13636
|
+
return function () {
|
|
13637
|
+
destroyStyle();
|
|
13638
|
+
};
|
|
13639
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
13488
13640
|
useUpdateEffect(function () {
|
|
13489
13641
|
if (visibleState) {
|
|
13490
13642
|
setVisibleState(false);
|
|
@@ -13540,7 +13692,8 @@ var ContextMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
13540
13692
|
model: props.model,
|
|
13541
13693
|
root: true,
|
|
13542
13694
|
resetMenu: resetMenuState,
|
|
13543
|
-
onLeafClick: onLeafClick
|
|
13695
|
+
onLeafClick: onLeafClick,
|
|
13696
|
+
isMobileMode: isMobileMode
|
|
13544
13697
|
})));
|
|
13545
13698
|
};
|
|
13546
13699
|
var element = createContextMenu();
|
|
@@ -15501,6 +15654,7 @@ var DropdownPanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__name
|
|
|
15501
15654
|
var content = isEmptyFilter ? createEmptyMessage() : options.children;
|
|
15502
15655
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
15503
15656
|
ref: options.contentRef,
|
|
15657
|
+
style: options.style,
|
|
15504
15658
|
className: className,
|
|
15505
15659
|
role: "listbox"
|
|
15506
15660
|
}, content);
|
|
@@ -16541,7 +16695,6 @@ var DataTableBase = {
|
|
|
16541
16695
|
defaultProps: {
|
|
16542
16696
|
__TYPE: 'DataTable',
|
|
16543
16697
|
alwaysShowPaginator: true,
|
|
16544
|
-
autoLayout: false,
|
|
16545
16698
|
breakpoint: '960px',
|
|
16546
16699
|
cellClassName: null,
|
|
16547
16700
|
cellSelection: false,
|
|
@@ -16633,7 +16786,7 @@ var DataTableBase = {
|
|
|
16633
16786
|
reorderableColumns: false,
|
|
16634
16787
|
reorderableRows: false,
|
|
16635
16788
|
resizableColumns: false,
|
|
16636
|
-
responsiveLayout: '
|
|
16789
|
+
responsiveLayout: 'scroll',
|
|
16637
16790
|
rowClassName: null,
|
|
16638
16791
|
rowEditValidator: null,
|
|
16639
16792
|
rowExpansionTemplate: null,
|
|
@@ -16643,7 +16796,6 @@ var DataTableBase = {
|
|
|
16643
16796
|
rowHover: false,
|
|
16644
16797
|
rows: null,
|
|
16645
16798
|
rowsPerPageOptions: null,
|
|
16646
|
-
scrollDirection: 'vertical',
|
|
16647
16799
|
scrollHeight: null,
|
|
16648
16800
|
scrollable: false,
|
|
16649
16801
|
selectAll: false,
|
|
@@ -17497,7 +17649,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17497
17649
|
return props.compareSelectionBy === 'equals' ? data1 === data2 : ObjectUtils.equals(data1, data2, props.dataKey);
|
|
17498
17650
|
};
|
|
17499
17651
|
var getTabIndex = function getTabIndex() {
|
|
17500
|
-
return isFocusable() && !props.allowCellSelection ? props.
|
|
17652
|
+
return isFocusable() && !props.allowCellSelection ? props.rowIndex === 0 ? props.tabIndex : -1 : null;
|
|
17501
17653
|
};
|
|
17502
17654
|
var findIndex = function findIndex(collection, rowData) {
|
|
17503
17655
|
return (collection || []).findIndex(function (data) {
|
|
@@ -17554,35 +17706,35 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17554
17706
|
props.onRowClick({
|
|
17555
17707
|
originalEvent: event,
|
|
17556
17708
|
data: props.rowData,
|
|
17557
|
-
index: props.
|
|
17709
|
+
index: props.rowIndex
|
|
17558
17710
|
});
|
|
17559
17711
|
};
|
|
17560
17712
|
var onDoubleClick = function onDoubleClick(event) {
|
|
17561
17713
|
props.onRowDoubleClick({
|
|
17562
17714
|
originalEvent: event,
|
|
17563
17715
|
data: props.rowData,
|
|
17564
|
-
index: props.
|
|
17716
|
+
index: props.rowIndex
|
|
17565
17717
|
});
|
|
17566
17718
|
};
|
|
17567
17719
|
var onRightClick = function onRightClick(event) {
|
|
17568
17720
|
props.onRowRightClick({
|
|
17569
17721
|
originalEvent: event,
|
|
17570
17722
|
data: props.rowData,
|
|
17571
|
-
index: props.
|
|
17723
|
+
index: props.rowIndex
|
|
17572
17724
|
});
|
|
17573
17725
|
};
|
|
17574
17726
|
var onMouseEnter = function onMouseEnter(event) {
|
|
17575
17727
|
props.onRowMouseEnter({
|
|
17576
17728
|
originalEvent: event,
|
|
17577
17729
|
data: props.rowData,
|
|
17578
|
-
index: props.
|
|
17730
|
+
index: props.rowIndex
|
|
17579
17731
|
});
|
|
17580
17732
|
};
|
|
17581
17733
|
var onMouseLeave = function onMouseLeave(event) {
|
|
17582
17734
|
props.onRowMouseLeave({
|
|
17583
17735
|
originalEvent: event,
|
|
17584
17736
|
data: props.rowData,
|
|
17585
|
-
index: props.
|
|
17737
|
+
index: props.rowIndex
|
|
17586
17738
|
});
|
|
17587
17739
|
};
|
|
17588
17740
|
var onTouchEnd = function onTouchEnd(event) {
|
|
@@ -17636,49 +17788,49 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17636
17788
|
props.onRowMouseDown({
|
|
17637
17789
|
originalEvent: event,
|
|
17638
17790
|
data: props.rowData,
|
|
17639
|
-
index: props.
|
|
17791
|
+
index: props.rowIndex
|
|
17640
17792
|
});
|
|
17641
17793
|
};
|
|
17642
17794
|
var onMouseUp = function onMouseUp(event) {
|
|
17643
17795
|
props.onRowMouseUp({
|
|
17644
17796
|
originalEvent: event,
|
|
17645
17797
|
data: props.rowData,
|
|
17646
|
-
index: props.
|
|
17798
|
+
index: props.rowIndex
|
|
17647
17799
|
});
|
|
17648
17800
|
};
|
|
17649
17801
|
var onDragStart = function onDragStart(event) {
|
|
17650
17802
|
props.onRowDragStart({
|
|
17651
17803
|
originalEvent: event,
|
|
17652
17804
|
data: props.rowData,
|
|
17653
|
-
index: props.
|
|
17805
|
+
index: props.rowIndex
|
|
17654
17806
|
});
|
|
17655
17807
|
};
|
|
17656
17808
|
var onDragOver = function onDragOver(event) {
|
|
17657
17809
|
props.onRowDragOver({
|
|
17658
17810
|
originalEvent: event,
|
|
17659
17811
|
data: props.rowData,
|
|
17660
|
-
index: props.
|
|
17812
|
+
index: props.rowIndex
|
|
17661
17813
|
});
|
|
17662
17814
|
};
|
|
17663
17815
|
var onDragLeave = function onDragLeave(event) {
|
|
17664
17816
|
props.onRowDragLeave({
|
|
17665
17817
|
originalEvent: event,
|
|
17666
17818
|
data: props.rowData,
|
|
17667
|
-
index: props.
|
|
17819
|
+
index: props.rowIndex
|
|
17668
17820
|
});
|
|
17669
17821
|
};
|
|
17670
17822
|
var onDragEnd = function onDragEnd(event) {
|
|
17671
17823
|
props.onRowDragEnd({
|
|
17672
17824
|
originalEvent: event,
|
|
17673
17825
|
data: props.rowData,
|
|
17674
|
-
index: props.
|
|
17826
|
+
index: props.rowIndex
|
|
17675
17827
|
});
|
|
17676
17828
|
};
|
|
17677
17829
|
var onDrop = function onDrop(event) {
|
|
17678
17830
|
props.onRowDrop({
|
|
17679
17831
|
originalEvent: event,
|
|
17680
17832
|
data: props.rowData,
|
|
17681
|
-
index: props.
|
|
17833
|
+
index: props.rowIndex
|
|
17682
17834
|
});
|
|
17683
17835
|
};
|
|
17684
17836
|
var onEditChange = function onEditChange(e, isEditing) {
|
|
@@ -17722,7 +17874,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17722
17874
|
props.onRowEditInit({
|
|
17723
17875
|
originalEvent: event,
|
|
17724
17876
|
data: props.rowData,
|
|
17725
|
-
index: props.
|
|
17877
|
+
index: props.rowIndex
|
|
17726
17878
|
});
|
|
17727
17879
|
}
|
|
17728
17880
|
onEditChange(e, true);
|
|
@@ -17738,7 +17890,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17738
17890
|
props.onRowEditSave({
|
|
17739
17891
|
originalEvent: event,
|
|
17740
17892
|
data: props.rowData,
|
|
17741
|
-
index: props.
|
|
17893
|
+
index: props.rowIndex,
|
|
17742
17894
|
valid: valid
|
|
17743
17895
|
});
|
|
17744
17896
|
}
|
|
@@ -17756,7 +17908,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17756
17908
|
props.onRowEditCancel({
|
|
17757
17909
|
originalEvent: event,
|
|
17758
17910
|
data: props.rowData,
|
|
17759
|
-
index: props.
|
|
17911
|
+
index: props.rowIndex
|
|
17760
17912
|
});
|
|
17761
17913
|
}
|
|
17762
17914
|
onEditChange(e, false);
|
|
@@ -17774,7 +17926,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17774
17926
|
tableSelector: props.tableSelector,
|
|
17775
17927
|
column: col,
|
|
17776
17928
|
rowData: props.rowData,
|
|
17777
|
-
rowIndex: props.
|
|
17929
|
+
rowIndex: props.rowIndex,
|
|
17778
17930
|
index: i,
|
|
17779
17931
|
rowSpan: rowSpan,
|
|
17780
17932
|
dataKey: props.dataKey,
|
|
@@ -17821,9 +17973,9 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
17821
17973
|
'p-highlight-contextmenu': props.contextMenuSelected,
|
|
17822
17974
|
'p-selectable-row': props.allowRowSelection && props.isSelectable({
|
|
17823
17975
|
data: props.rowData,
|
|
17824
|
-
index: props.
|
|
17976
|
+
index: props.rowIndex
|
|
17825
17977
|
}),
|
|
17826
|
-
'p-row-odd': props.
|
|
17978
|
+
'p-row-odd': props.rowIndex % 2 !== 0
|
|
17827
17979
|
});
|
|
17828
17980
|
var style = {
|
|
17829
17981
|
height: props.virtualScrollerOptions ? props.virtualScrollerOptions.itemSize : undefined
|
|
@@ -17898,7 +18050,6 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
17898
18050
|
var rowDragging = React__namespace.useRef(false);
|
|
17899
18051
|
var draggedRowIndex = React__namespace.useRef(null);
|
|
17900
18052
|
var droppedRowIndex = React__namespace.useRef(null);
|
|
17901
|
-
var prevVirtualScrollerOptions = usePrevious(props.virtualScrollerOptions);
|
|
17902
18053
|
var isSubheaderGrouping = props.rowGroupMode && props.rowGroupMode === 'subheader';
|
|
17903
18054
|
var isRadioSelectionMode = props.selectionMode === 'radiobutton';
|
|
17904
18055
|
var isCheckboxSelectionMode = props.selectionMode === 'checkbox';
|
|
@@ -18048,10 +18199,6 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18048
18199
|
});
|
|
18049
18200
|
}
|
|
18050
18201
|
};
|
|
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
18202
|
var onSingleSelection = function onSingleSelection(_ref) {
|
|
18056
18203
|
var originalEvent = _ref.originalEvent,
|
|
18057
18204
|
data = _ref.data,
|
|
@@ -18605,16 +18752,6 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18605
18752
|
updateFrozenRowGroupHeaderStickyPosition();
|
|
18606
18753
|
}
|
|
18607
18754
|
});
|
|
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
18755
|
useUpdateEffect(function () {
|
|
18619
18756
|
if (props.paginator && isMultipleSelection()) {
|
|
18620
18757
|
anchorRowIndex.current = null;
|
|
@@ -18642,9 +18779,8 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18642
18779
|
}
|
|
18643
18780
|
return null;
|
|
18644
18781
|
};
|
|
18645
|
-
var createGroupHeader = function createGroupHeader(rowData,
|
|
18646
|
-
if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData,
|
|
18647
|
-
var _options;
|
|
18782
|
+
var createGroupHeader = function createGroupHeader(rowData, rowIndex, expanded, colSpan) {
|
|
18783
|
+
if (isSubheaderGrouping && shouldRenderRowGroupHeader(props.value, rowData, rowIndex - props.first)) {
|
|
18648
18784
|
var style = rowGroupHeaderStyle();
|
|
18649
18785
|
var toggler = props.expandableRowGroups && /*#__PURE__*/React__namespace.createElement(RowTogglerButton, {
|
|
18650
18786
|
onClick: onRowToggle,
|
|
@@ -18653,9 +18789,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18653
18789
|
expandedRowIcon: props.expandedRowIcon,
|
|
18654
18790
|
collapsedRowIcon: props.collapsedRowIcon
|
|
18655
18791
|
});
|
|
18656
|
-
var options =
|
|
18657
|
-
index:
|
|
18658
|
-
|
|
18792
|
+
var options = {
|
|
18793
|
+
index: rowIndex,
|
|
18794
|
+
props: props.tableProps,
|
|
18795
|
+
customRendering: false
|
|
18796
|
+
};
|
|
18659
18797
|
var _content2 = ObjectUtils.getJSXElement(props.rowGroupHeaderTemplate, rowData, options);
|
|
18660
18798
|
|
|
18661
18799
|
// check if the user wants complete control of the rendering
|
|
@@ -18674,7 +18812,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18674
18812
|
}
|
|
18675
18813
|
return null;
|
|
18676
18814
|
};
|
|
18677
|
-
var createRow = function createRow(rowData, index, expanded) {
|
|
18815
|
+
var createRow = function createRow(rowData, rowIndex, index, expanded) {
|
|
18678
18816
|
if (!props.expandableRowGroups || expanded) {
|
|
18679
18817
|
var selected = isSelectionEnabled() ? isSelected(rowData) : false;
|
|
18680
18818
|
var contextMenuSelected = isContextMenuSelected(rowData);
|
|
@@ -18687,6 +18825,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18687
18825
|
value: props.value,
|
|
18688
18826
|
columns: props.columns,
|
|
18689
18827
|
rowData: rowData,
|
|
18828
|
+
rowIndex: rowIndex,
|
|
18690
18829
|
index: index,
|
|
18691
18830
|
selected: selected,
|
|
18692
18831
|
contextMenuSelected: contextMenuSelected,
|
|
@@ -18745,11 +18884,11 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18745
18884
|
});
|
|
18746
18885
|
}
|
|
18747
18886
|
};
|
|
18748
|
-
var createExpansion = function createExpansion(rowData,
|
|
18887
|
+
var createExpansion = function createExpansion(rowData, rowIndex, expanded, colSpan) {
|
|
18749
18888
|
if (expanded && !(isSubheaderGrouping && props.expandableRowGroups)) {
|
|
18750
|
-
var id = "".concat(props.tableSelector, "_content_").concat(
|
|
18889
|
+
var id = "".concat(props.tableSelector, "_content_").concat(rowIndex, "_expanded");
|
|
18751
18890
|
var options = {
|
|
18752
|
-
index:
|
|
18891
|
+
index: rowIndex,
|
|
18753
18892
|
customRendering: false
|
|
18754
18893
|
};
|
|
18755
18894
|
var _content3 = ObjectUtils.getJSXElement(props.rowExpansionTemplate, rowData, options);
|
|
@@ -18769,10 +18908,10 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18769
18908
|
}
|
|
18770
18909
|
return null;
|
|
18771
18910
|
};
|
|
18772
|
-
var createGroupFooter = function createGroupFooter(rowData,
|
|
18773
|
-
if (isSubheaderGrouping && shouldRenderRowGroupFooter(props.value, rowData,
|
|
18911
|
+
var createGroupFooter = function createGroupFooter(rowData, rowIndex, expanded, colSpan) {
|
|
18912
|
+
if (isSubheaderGrouping && shouldRenderRowGroupFooter(props.value, rowData, rowIndex - props.first, expanded)) {
|
|
18774
18913
|
var _content4 = ObjectUtils.getJSXElement(props.rowGroupFooterTemplate, rowData, {
|
|
18775
|
-
index:
|
|
18914
|
+
index: rowIndex,
|
|
18776
18915
|
colSpan: colSpan,
|
|
18777
18916
|
props: props.tableProps
|
|
18778
18917
|
});
|
|
@@ -18784,25 +18923,25 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
18784
18923
|
return null;
|
|
18785
18924
|
};
|
|
18786
18925
|
var createContent = function createContent() {
|
|
18787
|
-
return props.value.map(function (rowData,
|
|
18788
|
-
var
|
|
18789
|
-
var key = getRowKey(rowData,
|
|
18926
|
+
return props.value && props.value.map(function (rowData, index) {
|
|
18927
|
+
var rowIndex = getVirtualScrollerOption('getItemOptions') ? getVirtualScrollerOption('getItemOptions')(index).index : props.first + index;
|
|
18928
|
+
var key = getRowKey(rowData, rowIndex);
|
|
18790
18929
|
var expanded = isRowExpanded(rowData);
|
|
18791
18930
|
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,
|
|
18931
|
+
var groupHeader = createGroupHeader(rowData, rowIndex, expanded, colSpan);
|
|
18932
|
+
var row = createRow(rowData, rowIndex, index, expanded);
|
|
18933
|
+
var expansion = createExpansion(rowData, rowIndex, expanded, colSpan);
|
|
18934
|
+
var groupFooter = createGroupFooter(rowData, rowIndex, expanded, colSpan);
|
|
18796
18935
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, {
|
|
18797
18936
|
key: key
|
|
18798
18937
|
}, groupHeader, row, expansion, groupFooter);
|
|
18799
18938
|
});
|
|
18800
18939
|
};
|
|
18801
|
-
var className = classNames('p-datatable-tbody', props.className);
|
|
18802
18940
|
var content = props.empty ? createEmptyContent() : createContent();
|
|
18803
18941
|
return /*#__PURE__*/React__namespace.createElement("tbody", {
|
|
18804
18942
|
ref: refCallback,
|
|
18805
|
-
|
|
18943
|
+
style: props.style,
|
|
18944
|
+
className: props.className
|
|
18806
18945
|
}, content);
|
|
18807
18946
|
}));
|
|
18808
18947
|
TableBody.displayName = 'TableBody';
|
|
@@ -20493,9 +20632,10 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
20493
20632
|
if (ObjectUtils.isNotEmpty(widths)) {
|
|
20494
20633
|
createStyleElement();
|
|
20495
20634
|
var innerHTML = '';
|
|
20635
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > .p-datatable-wrapper > .p-datatable-table");
|
|
20496
20636
|
widths.forEach(function (width, index) {
|
|
20497
|
-
var style =
|
|
20498
|
-
innerHTML += "\n
|
|
20637
|
+
var style = "width: ".concat(width, "px !important; max-width: ").concat(width, "px !important");
|
|
20638
|
+
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
20639
|
});
|
|
20500
20640
|
styleElement.current.innerHTML = innerHTML;
|
|
20501
20641
|
}
|
|
@@ -20663,10 +20803,11 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
20663
20803
|
destroyStyleElement();
|
|
20664
20804
|
createStyleElement();
|
|
20665
20805
|
var innerHTML = '';
|
|
20806
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > .p-datatable-wrapper > .p-datatable-table");
|
|
20666
20807
|
widths.forEach(function (width, index) {
|
|
20667
20808
|
var colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;
|
|
20668
|
-
var style =
|
|
20669
|
-
innerHTML += "\n
|
|
20809
|
+
var style = "width: ".concat(colWidth, "px !important; max-width: ").concat(colWidth, "px !important");
|
|
20810
|
+
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
20811
|
});
|
|
20671
20812
|
styleElement.current.innerHTML = innerHTML;
|
|
20672
20813
|
};
|
|
@@ -20829,7 +20970,9 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
20829
20970
|
var createResponsiveStyle = function createResponsiveStyle() {
|
|
20830
20971
|
if (!responsiveStyleElement.current) {
|
|
20831
20972
|
responsiveStyleElement.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
20832
|
-
var
|
|
20973
|
+
var selector = ".p-datatable[".concat(attributeSelectorState, "] > .p-datatable-wrapper > .p-datatable-table");
|
|
20974
|
+
var gridLinesSelector = ".p-datatable[".concat(attributeSelectorState, "].p-datatable-gridlines > .p-datatable-wrapper > .p-datatable-table");
|
|
20975
|
+
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
20976
|
responsiveStyleElement.current.innerHTML = innerHTML;
|
|
20834
20977
|
}
|
|
20835
20978
|
};
|
|
@@ -21306,7 +21449,7 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21306
21449
|
return data;
|
|
21307
21450
|
};
|
|
21308
21451
|
useMountEffect(function () {
|
|
21309
|
-
setAttributeSelectorState(UniqueComponentId());
|
|
21452
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
21310
21453
|
setFiltersState(cloneFilters(props.filters));
|
|
21311
21454
|
setD_filtersState(cloneFilters(props.filters));
|
|
21312
21455
|
if (isStateful()) {
|
|
@@ -21317,11 +21460,16 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21317
21460
|
}
|
|
21318
21461
|
});
|
|
21319
21462
|
useUpdateEffect(function () {
|
|
21320
|
-
|
|
21321
|
-
|
|
21322
|
-
|
|
21463
|
+
if (attributeSelectorState) {
|
|
21464
|
+
elementRef.current.setAttribute(attributeSelectorState, '');
|
|
21465
|
+
if (props.responsiveLayout === 'stack' && !props.scrollable) {
|
|
21466
|
+
createResponsiveStyle();
|
|
21467
|
+
}
|
|
21323
21468
|
}
|
|
21324
|
-
|
|
21469
|
+
return function () {
|
|
21470
|
+
destroyResponsiveStyle();
|
|
21471
|
+
};
|
|
21472
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
21325
21473
|
useUpdateEffect(function () {
|
|
21326
21474
|
var filters = cloneFilters(props.filters);
|
|
21327
21475
|
setFiltersState(filters);
|
|
@@ -21452,12 +21600,14 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21452
21600
|
var rows = options.rows,
|
|
21453
21601
|
columns = options.columns,
|
|
21454
21602
|
contentRef = options.contentRef,
|
|
21455
|
-
|
|
21456
|
-
options.
|
|
21603
|
+
style = options.style,
|
|
21604
|
+
className = options.className,
|
|
21605
|
+
spacerStyle = options.spacerStyle,
|
|
21606
|
+
itemSize = options.itemSize;
|
|
21457
21607
|
var frozenBody = ObjectUtils.isNotEmpty(props.frozenValue) && /*#__PURE__*/React__namespace.createElement(TableBody, {
|
|
21458
21608
|
ref: frozenBodyRef,
|
|
21459
21609
|
value: props.frozenValue,
|
|
21460
|
-
className: "p-datatable-frozen-tbody",
|
|
21610
|
+
className: "p-datatable-tbody p-datatable-frozen-tbody",
|
|
21461
21611
|
frozenRow: true,
|
|
21462
21612
|
tableProps: props,
|
|
21463
21613
|
tableSelector: attributeSelectorState,
|
|
@@ -21528,7 +21678,8 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21528
21678
|
var body = /*#__PURE__*/React__namespace.createElement(TableBody, {
|
|
21529
21679
|
ref: bodyRef,
|
|
21530
21680
|
value: dataToRender(rows),
|
|
21531
|
-
|
|
21681
|
+
style: style,
|
|
21682
|
+
className: classNames('p-datatable-tbody', className),
|
|
21532
21683
|
empty: empty,
|
|
21533
21684
|
frozenRow: false,
|
|
21534
21685
|
tableProps: props,
|
|
@@ -21598,7 +21749,13 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21598
21749
|
virtualScrollerOptions: options,
|
|
21599
21750
|
isVirtualScrollerDisabled: isVirtualScrollerDisabled
|
|
21600
21751
|
});
|
|
21601
|
-
|
|
21752
|
+
var spacerBody = ObjectUtils.isNotEmpty(spacerStyle) ? /*#__PURE__*/React__namespace.createElement(TableBody, {
|
|
21753
|
+
style: {
|
|
21754
|
+
height: "calc(".concat(spacerStyle.height, " - ").concat(rows.length * itemSize, "px)")
|
|
21755
|
+
},
|
|
21756
|
+
className: "p-datatable-virtualscroller-spacer"
|
|
21757
|
+
}) : null;
|
|
21758
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, frozenBody, body, spacerBody);
|
|
21602
21759
|
};
|
|
21603
21760
|
var createTableFooter = function createTableFooter(options) {
|
|
21604
21761
|
var columns = options.columns;
|
|
@@ -21629,13 +21786,19 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21629
21786
|
scrollHeight: props.scrollHeight !== 'flex' ? undefined : '100%',
|
|
21630
21787
|
disabled: _isVirtualScrollerDisabled,
|
|
21631
21788
|
loaderDisabled: true,
|
|
21789
|
+
inline: true,
|
|
21790
|
+
autoSize: true,
|
|
21632
21791
|
showSpacer: false,
|
|
21633
21792
|
contentTemplate: function contentTemplate(options) {
|
|
21634
21793
|
var ref = function ref(el) {
|
|
21635
21794
|
tableRef.current = el;
|
|
21636
21795
|
options.spacerRef && options.spacerRef(el);
|
|
21637
21796
|
};
|
|
21638
|
-
var tableClassName = classNames('p-datatable-table',
|
|
21797
|
+
var tableClassName = classNames('p-datatable-table', {
|
|
21798
|
+
'p-datatable-scrollable-table': props.scrollable,
|
|
21799
|
+
'p-datatable-resizable-table': props.resizableColumns,
|
|
21800
|
+
'p-datatable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
21801
|
+
}, props.tableClassName);
|
|
21639
21802
|
var tableHeader = createTableHeader(options, empty);
|
|
21640
21803
|
var tableBody = createTableBody(options, selectionModeInColumn, empty, _isVirtualScrollerDisabled);
|
|
21641
21804
|
var tableFooter = createTableFooter(options);
|
|
@@ -21730,13 +21893,9 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
21730
21893
|
'p-datatable-hoverable-rows': props.rowHover,
|
|
21731
21894
|
'p-datatable-selectable': selectable && !props.cellSelection,
|
|
21732
21895
|
'p-datatable-selectable-cell': selectable && props.cellSelection,
|
|
21733
|
-
'p-datatable-auto-layout': props.autoLayout,
|
|
21734
21896
|
'p-datatable-resizable': props.resizableColumns,
|
|
21735
21897
|
'p-datatable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
21736
21898
|
'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
21899
|
'p-datatable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',
|
|
21741
21900
|
'p-datatable-responsive-stack': props.responsiveLayout === 'stack',
|
|
21742
21901
|
'p-datatable-responsive-scroll': props.responsiveLayout === 'scroll',
|
|
@@ -26340,14 +26499,15 @@ var ListBox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
26340
26499
|
itemTemplate: function itemTemplate(item, options) {
|
|
26341
26500
|
return item && createItem(item, options.index, options);
|
|
26342
26501
|
},
|
|
26343
|
-
contentTemplate: function contentTemplate(
|
|
26344
|
-
var className = classNames('p-listbox-list',
|
|
26502
|
+
contentTemplate: function contentTemplate(options) {
|
|
26503
|
+
var className = classNames('p-listbox-list', options.className);
|
|
26345
26504
|
return /*#__PURE__*/React__namespace.createElement("ul", _extends({
|
|
26346
|
-
ref:
|
|
26505
|
+
ref: options.contentRef,
|
|
26506
|
+
style: options.style,
|
|
26347
26507
|
className: className,
|
|
26348
26508
|
role: "listbox",
|
|
26349
26509
|
"aria-multiselectable": props.multiple
|
|
26350
|
-
}, ariaProps),
|
|
26510
|
+
}, ariaProps), options.children);
|
|
26351
26511
|
}
|
|
26352
26512
|
});
|
|
26353
26513
|
return /*#__PURE__*/React__namespace.createElement(VirtualScroller, _extends({
|
|
@@ -26395,6 +26555,8 @@ var MegaMenuBase = {
|
|
|
26395
26555
|
style: null,
|
|
26396
26556
|
className: null,
|
|
26397
26557
|
orientation: 'horizontal',
|
|
26558
|
+
breakpoint: undefined,
|
|
26559
|
+
scrollHeight: '400px',
|
|
26398
26560
|
start: null,
|
|
26399
26561
|
end: null,
|
|
26400
26562
|
children: undefined
|
|
@@ -26413,17 +26575,41 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26413
26575
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26414
26576
|
activeItemState = _React$useState2[0],
|
|
26415
26577
|
setActiveItemState = _React$useState2[1];
|
|
26578
|
+
var _React$useState3 = React__namespace.useState(null),
|
|
26579
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
26580
|
+
attributeSelectorState = _React$useState4[0],
|
|
26581
|
+
setAttributeSelectorState = _React$useState4[1];
|
|
26582
|
+
var _React$useState5 = React__namespace.useState(false),
|
|
26583
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
26584
|
+
mobileActiveState = _React$useState6[0],
|
|
26585
|
+
setMobileActiveState = _React$useState6[1];
|
|
26416
26586
|
var elementRef = React__namespace.useRef(null);
|
|
26587
|
+
var styleElementRef = React__namespace.useRef(null);
|
|
26588
|
+
var menuButtonRef = React__namespace.useRef(null);
|
|
26417
26589
|
var horizontal = props.orientation === 'horizontal';
|
|
26418
26590
|
var vertical = props.orientation === 'vertical';
|
|
26591
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
26419
26592
|
var _useEventListener = useEventListener({
|
|
26420
26593
|
type: 'click',
|
|
26421
26594
|
listener: function listener(event) {
|
|
26422
|
-
|
|
26595
|
+
if ((!isMobileMode || mobileActiveState) && isOutsideClicked(event)) {
|
|
26596
|
+
setActiveItemState(null);
|
|
26597
|
+
setMobileActiveState(false);
|
|
26598
|
+
}
|
|
26423
26599
|
}
|
|
26424
26600
|
}),
|
|
26425
26601
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
26426
26602
|
bindDocumentClickListener = _useEventListener2[0];
|
|
26603
|
+
var _useResizeListener = useResizeListener({
|
|
26604
|
+
listener: function listener() {
|
|
26605
|
+
if (!isMobileMode || mobileActiveState) {
|
|
26606
|
+
setActiveItemState(null);
|
|
26607
|
+
setMobileActiveState(false);
|
|
26608
|
+
}
|
|
26609
|
+
}
|
|
26610
|
+
}),
|
|
26611
|
+
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
26612
|
+
bindDocumentResizeListener = _useResizeListener2[0];
|
|
26427
26613
|
var onLeafClick = function onLeafClick(event, item) {
|
|
26428
26614
|
if (item.disabled) {
|
|
26429
26615
|
event.preventDefault();
|
|
@@ -26439,9 +26625,10 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26439
26625
|
});
|
|
26440
26626
|
}
|
|
26441
26627
|
setActiveItemState(null);
|
|
26628
|
+
setMobileActiveState(false);
|
|
26442
26629
|
};
|
|
26443
26630
|
var onCategoryMouseEnter = function onCategoryMouseEnter(event, item) {
|
|
26444
|
-
if (item.disabled) {
|
|
26631
|
+
if (item.disabled || isMobileMode) {
|
|
26445
26632
|
event.preventDefault();
|
|
26446
26633
|
return;
|
|
26447
26634
|
}
|
|
@@ -26504,6 +26691,13 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26504
26691
|
var collapseMenu = function collapseMenu(item) {
|
|
26505
26692
|
setActiveItemState(null);
|
|
26506
26693
|
};
|
|
26694
|
+
var toggle = function toggle(event) {
|
|
26695
|
+
event.preventDefault();
|
|
26696
|
+
setMobileActiveState(function (prevMobileActive) {
|
|
26697
|
+
return !prevMobileActive;
|
|
26698
|
+
});
|
|
26699
|
+
setActiveItemState(null);
|
|
26700
|
+
};
|
|
26507
26701
|
var findNextItem = function findNextItem(item) {
|
|
26508
26702
|
var nextItem = item.nextElementSibling;
|
|
26509
26703
|
return nextItem ? DomHandler.hasClass(nextItem, 'p-disabled') || !DomHandler.hasClass(nextItem, 'p-menuitem') ? findNextItem(nextItem) : nextItem : null;
|
|
@@ -26521,7 +26715,7 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26521
26715
|
prevItem && prevItem.children[0].focus();
|
|
26522
26716
|
};
|
|
26523
26717
|
var isOutsideClicked = function isOutsideClicked(event) {
|
|
26524
|
-
return elementRef.current && !(elementRef.current.isSameNode(event.target) || elementRef.current.contains(event.target));
|
|
26718
|
+
return elementRef.current && !(elementRef.current.isSameNode(event.target) || elementRef.current.contains(event.target) || menuButtonRef.current && menuButtonRef.current.contains(event.target));
|
|
26525
26719
|
};
|
|
26526
26720
|
var getColumnClassName = function getColumnClassName(category) {
|
|
26527
26721
|
var length = category.items ? category.items.length : 0;
|
|
@@ -26554,13 +26748,23 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26554
26748
|
};
|
|
26555
26749
|
});
|
|
26556
26750
|
useMountEffect(function () {
|
|
26751
|
+
if (props.breakpoint) {
|
|
26752
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
26753
|
+
}
|
|
26557
26754
|
bindDocumentClickListener();
|
|
26755
|
+
bindDocumentResizeListener();
|
|
26558
26756
|
});
|
|
26559
26757
|
useUpdateEffect(function () {
|
|
26560
26758
|
var currentPanel = DomHandler.findSingle(elementRef.current, '.p-menuitem-active > .p-megamenu-panel');
|
|
26561
|
-
if (activeItemState) {
|
|
26759
|
+
if (activeItemState && !isMobileMode) {
|
|
26562
26760
|
ZIndexUtils.set('menu', currentPanel, PrimeReact.autoZIndex, PrimeReact.zIndex['menu']);
|
|
26563
26761
|
}
|
|
26762
|
+
if (isMobileMode) {
|
|
26763
|
+
currentPanel && currentPanel.previousElementSibling.scrollIntoView({
|
|
26764
|
+
block: 'nearest',
|
|
26765
|
+
inline: 'nearest'
|
|
26766
|
+
});
|
|
26767
|
+
}
|
|
26564
26768
|
return function () {
|
|
26565
26769
|
ZIndexUtils.clear(currentPanel);
|
|
26566
26770
|
};
|
|
@@ -26686,6 +26890,26 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26686
26890
|
}
|
|
26687
26891
|
return null;
|
|
26688
26892
|
};
|
|
26893
|
+
var createStyle = function createStyle() {
|
|
26894
|
+
if (!styleElementRef.current) {
|
|
26895
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
26896
|
+
var selector = "".concat(attributeSelectorState);
|
|
26897
|
+
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");
|
|
26898
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
26899
|
+
}
|
|
26900
|
+
};
|
|
26901
|
+
var destroyStyle = function destroyStyle() {
|
|
26902
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
26903
|
+
};
|
|
26904
|
+
useUpdateEffect(function () {
|
|
26905
|
+
if (attributeSelectorState && elementRef.current) {
|
|
26906
|
+
elementRef.current.setAttribute(attributeSelectorState, '');
|
|
26907
|
+
createStyle();
|
|
26908
|
+
}
|
|
26909
|
+
return function () {
|
|
26910
|
+
destroyStyle();
|
|
26911
|
+
};
|
|
26912
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
26689
26913
|
var createCategory = function createCategory(category, index) {
|
|
26690
26914
|
var className = classNames('p-menuitem', {
|
|
26691
26915
|
'p-menuitem-active': category === activeItemState
|
|
@@ -26756,20 +26980,41 @@ var MegaMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
26756
26980
|
}
|
|
26757
26981
|
return null;
|
|
26758
26982
|
};
|
|
26983
|
+
var createMenuButton = function createMenuButton() {
|
|
26984
|
+
if (props.orientation === 'vertical' || props.model && props.model.length < 1) {
|
|
26985
|
+
return null;
|
|
26986
|
+
}
|
|
26987
|
+
/* eslint-disable */
|
|
26988
|
+
var button = /*#__PURE__*/React__namespace.createElement("a", {
|
|
26989
|
+
ref: menuButtonRef,
|
|
26990
|
+
href: '#',
|
|
26991
|
+
role: "button",
|
|
26992
|
+
tabIndex: 0,
|
|
26993
|
+
className: "p-megamenu-button",
|
|
26994
|
+
onClick: toggle
|
|
26995
|
+
}, /*#__PURE__*/React__namespace.createElement("i", {
|
|
26996
|
+
className: "pi pi-bars"
|
|
26997
|
+
}));
|
|
26998
|
+
/* eslint-enable */
|
|
26999
|
+
|
|
27000
|
+
return button;
|
|
27001
|
+
};
|
|
26759
27002
|
var otherProps = MegaMenuBase.getOtherProps(props);
|
|
26760
27003
|
var className = classNames('p-megamenu p-component', {
|
|
26761
27004
|
'p-megamenu-horizontal': props.orientation === 'horizontal',
|
|
26762
|
-
'p-megamenu-vertical': props.orientation === 'vertical'
|
|
27005
|
+
'p-megamenu-vertical': props.orientation === 'vertical',
|
|
27006
|
+
'p-megamenu-mobile-active': mobileActiveState
|
|
26763
27007
|
}, props.className);
|
|
26764
27008
|
var menu = createMenu();
|
|
26765
27009
|
var start = createStartContent();
|
|
26766
27010
|
var end = createEndContent();
|
|
27011
|
+
var menuButton = createMenuButton();
|
|
26767
27012
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
26768
27013
|
ref: elementRef,
|
|
26769
27014
|
id: props.id,
|
|
26770
27015
|
className: className,
|
|
26771
27016
|
style: props.style
|
|
26772
|
-
}, otherProps), start, menu, end);
|
|
27017
|
+
}, otherProps), start, menuButton, menu, end);
|
|
26773
27018
|
}));
|
|
26774
27019
|
MegaMenu.displayName = 'MegaMenu';
|
|
26775
27020
|
|
|
@@ -28305,6 +28550,7 @@ var MultiSelectPanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__n
|
|
|
28305
28550
|
var content = isEmptyFilter() ? createEmptyFilter() : options.children;
|
|
28306
28551
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
28307
28552
|
ref: options.contentRef,
|
|
28553
|
+
style: options.style,
|
|
28308
28554
|
className: className,
|
|
28309
28555
|
role: "listbox",
|
|
28310
28556
|
"aria-multiselectable": true
|
|
@@ -35754,6 +36000,8 @@ var TieredMenuBase = {
|
|
|
35754
36000
|
className: null,
|
|
35755
36001
|
autoZIndex: true,
|
|
35756
36002
|
baseZIndex: 0,
|
|
36003
|
+
breakpoint: undefined,
|
|
36004
|
+
scrollHeight: '400px',
|
|
35757
36005
|
appendTo: null,
|
|
35758
36006
|
transitionOptions: null,
|
|
35759
36007
|
onShow: null,
|
|
@@ -35777,13 +36025,20 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35777
36025
|
var _useEventListener = useEventListener({
|
|
35778
36026
|
type: 'click',
|
|
35779
36027
|
listener: function listener(event) {
|
|
35780
|
-
if (elementRef.current && !elementRef.current.contains(event.target)) {
|
|
36028
|
+
if (!props.isMobileMode && elementRef.current && !elementRef.current.contains(event.target)) {
|
|
35781
36029
|
setActiveItemState(null);
|
|
35782
36030
|
}
|
|
35783
36031
|
}
|
|
35784
36032
|
}),
|
|
35785
36033
|
_useEventListener2 = _slicedToArray(_useEventListener, 1),
|
|
35786
36034
|
bindDocumentClickListener = _useEventListener2[0];
|
|
36035
|
+
var _useResizeListener = useResizeListener({
|
|
36036
|
+
listener: function listener() {
|
|
36037
|
+
!props.isMobileMode && setActiveItemState(null);
|
|
36038
|
+
}
|
|
36039
|
+
}),
|
|
36040
|
+
_useResizeListener2 = _slicedToArray(_useResizeListener, 1),
|
|
36041
|
+
bindDocumentResizeListener = _useResizeListener2[0];
|
|
35787
36042
|
var position = function position() {
|
|
35788
36043
|
if (elementRef.current) {
|
|
35789
36044
|
var parentItem = elementRef.current.parentElement;
|
|
@@ -35803,7 +36058,7 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35803
36058
|
}
|
|
35804
36059
|
};
|
|
35805
36060
|
var onItemMouseEnter = function onItemMouseEnter(event, item) {
|
|
35806
|
-
if (item.disabled) {
|
|
36061
|
+
if (item.disabled || props.isMobileMode) {
|
|
35807
36062
|
event.preventDefault();
|
|
35808
36063
|
return;
|
|
35809
36064
|
}
|
|
@@ -35829,7 +36084,7 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35829
36084
|
item: item
|
|
35830
36085
|
});
|
|
35831
36086
|
}
|
|
35832
|
-
if (props.root) {
|
|
36087
|
+
if (props.root || props.isMobileMode) {
|
|
35833
36088
|
if (item.items) {
|
|
35834
36089
|
if (activeItemState && item === activeItemState) setActiveItemState(null);else setActiveItemState(item);
|
|
35835
36090
|
}
|
|
@@ -35884,21 +36139,27 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35884
36139
|
return prevItem ? DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? findPrevItem(prevItem) : prevItem : null;
|
|
35885
36140
|
};
|
|
35886
36141
|
var onLeafClick = function onLeafClick(event) {
|
|
35887
|
-
|
|
35888
|
-
|
|
35889
|
-
|
|
36142
|
+
if (!props.isMobileMode || props.popup) {
|
|
36143
|
+
setActiveItemState(null);
|
|
36144
|
+
props.onLeafClick && props.onLeafClick(event);
|
|
36145
|
+
props.onHide && props.onHide(event);
|
|
36146
|
+
}
|
|
35890
36147
|
};
|
|
35891
36148
|
useMountEffect(function () {
|
|
35892
36149
|
bindDocumentClickListener();
|
|
36150
|
+
bindDocumentResizeListener();
|
|
35893
36151
|
});
|
|
35894
36152
|
useUpdateEffect(function () {
|
|
35895
36153
|
if (!props.parentActive) {
|
|
35896
36154
|
setActiveItemState(null);
|
|
35897
36155
|
}
|
|
35898
|
-
if (!props.root && props.parentActive) {
|
|
36156
|
+
if (!props.root && props.parentActive && !props.isMobileMode) {
|
|
35899
36157
|
position();
|
|
35900
36158
|
}
|
|
35901
36159
|
}, [props.parentActive]);
|
|
36160
|
+
useUpdateEffect(function () {
|
|
36161
|
+
props.onItemToggle && props.onItemToggle();
|
|
36162
|
+
}, [activeItemState]);
|
|
35902
36163
|
var createSeparator = function createSeparator(index) {
|
|
35903
36164
|
var key = 'separator_' + index;
|
|
35904
36165
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
@@ -35915,7 +36176,9 @@ var TieredMenuSub = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
35915
36176
|
onLeafClick: onLeafClick,
|
|
35916
36177
|
popup: props.popup,
|
|
35917
36178
|
onKeyDown: onChildItemKeyDown,
|
|
35918
|
-
parentActive: item === activeItemState
|
|
36179
|
+
parentActive: item === activeItemState,
|
|
36180
|
+
isMobileMode: props.isMobileMode,
|
|
36181
|
+
onItemToggle: props.onItemToggle
|
|
35919
36182
|
});
|
|
35920
36183
|
}
|
|
35921
36184
|
return null;
|
|
@@ -36025,8 +36288,14 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36025
36288
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
36026
36289
|
visibleState = _React$useState2[0],
|
|
36027
36290
|
setVisibleState = _React$useState2[1];
|
|
36291
|
+
var _React$useState3 = React__namespace.useState(null),
|
|
36292
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
36293
|
+
attributeSelectorState = _React$useState4[0],
|
|
36294
|
+
setAttributeSelectorState = _React$useState4[1];
|
|
36028
36295
|
var menuRef = React__namespace.useRef(null);
|
|
36029
36296
|
var targetRef = React__namespace.useRef(null);
|
|
36297
|
+
var styleElementRef = React__namespace.useRef(null);
|
|
36298
|
+
var isMobileMode = useMatchMedia("screen and (max-width: ".concat(props.breakpoint, ")"), !!props.breakpoint);
|
|
36030
36299
|
var _useOverlayListener = useOverlayListener({
|
|
36031
36300
|
target: targetRef,
|
|
36032
36301
|
overlay: menuRef,
|
|
@@ -36064,11 +36333,31 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36064
36333
|
props.onHide && props.onHide(event);
|
|
36065
36334
|
}
|
|
36066
36335
|
};
|
|
36336
|
+
var onItemToggle = function onItemToggle() {
|
|
36337
|
+
if (props.popup && isMobileMode) {
|
|
36338
|
+
DomHandler.absolutePosition(menuRef.current, targetRef.current);
|
|
36339
|
+
}
|
|
36340
|
+
};
|
|
36341
|
+
var createStyle = function createStyle() {
|
|
36342
|
+
if (!styleElementRef.current) {
|
|
36343
|
+
styleElementRef.current = DomHandler.createInlineStyle(PrimeReact.nonce);
|
|
36344
|
+
var selector = "".concat(attributeSelectorState);
|
|
36345
|
+
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");
|
|
36346
|
+
styleElementRef.current.innerHTML = innerHTML;
|
|
36347
|
+
}
|
|
36348
|
+
};
|
|
36349
|
+
var destroyStyle = function destroyStyle() {
|
|
36350
|
+
styleElementRef.current = DomHandler.removeInlineStyle(styleElementRef.current);
|
|
36351
|
+
};
|
|
36067
36352
|
var onEnter = function onEnter() {
|
|
36068
36353
|
if (props.autoZIndex) {
|
|
36069
36354
|
ZIndexUtils.set('menu', menuRef.current, PrimeReact.autoZIndex, props.baseZIndex || PrimeReact.zIndex['menu']);
|
|
36070
36355
|
}
|
|
36071
36356
|
DomHandler.absolutePosition(menuRef.current, targetRef.current);
|
|
36357
|
+
if (attributeSelectorState && props.breakpoint) {
|
|
36358
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
36359
|
+
createStyle();
|
|
36360
|
+
}
|
|
36072
36361
|
};
|
|
36073
36362
|
var onEntered = function onEntered() {
|
|
36074
36363
|
bindOverlayListener();
|
|
@@ -36079,7 +36368,22 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36079
36368
|
};
|
|
36080
36369
|
var onExited = function onExited() {
|
|
36081
36370
|
ZIndexUtils.clear(menuRef.current);
|
|
36371
|
+
destroyStyle();
|
|
36082
36372
|
};
|
|
36373
|
+
useMountEffect(function () {
|
|
36374
|
+
if (props.breakpoint) {
|
|
36375
|
+
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
|
|
36376
|
+
}
|
|
36377
|
+
});
|
|
36378
|
+
useUpdateEffect(function () {
|
|
36379
|
+
if (attributeSelectorState && menuRef.current) {
|
|
36380
|
+
menuRef.current.setAttribute(attributeSelectorState, '');
|
|
36381
|
+
createStyle();
|
|
36382
|
+
}
|
|
36383
|
+
return function () {
|
|
36384
|
+
destroyStyle();
|
|
36385
|
+
};
|
|
36386
|
+
}, [attributeSelectorState, props.breakpoint]);
|
|
36083
36387
|
useUnmountEffect(function () {
|
|
36084
36388
|
ZIndexUtils.clear(menuRef.current);
|
|
36085
36389
|
});
|
|
@@ -36127,7 +36431,9 @@ var TieredMenu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespa
|
|
|
36127
36431
|
model: props.model,
|
|
36128
36432
|
root: true,
|
|
36129
36433
|
popup: props.popup,
|
|
36130
|
-
onHide: hide
|
|
36434
|
+
onHide: hide,
|
|
36435
|
+
isMobileMode: isMobileMode,
|
|
36436
|
+
onItemToggle: onItemToggle
|
|
36131
36437
|
})));
|
|
36132
36438
|
};
|
|
36133
36439
|
var element = createElement();
|
|
@@ -38419,7 +38725,6 @@ var TreeTableBase = {
|
|
|
38419
38725
|
defaultProps: {
|
|
38420
38726
|
__TYPE: 'TreeTable',
|
|
38421
38727
|
alwaysShowPaginator: true,
|
|
38422
|
-
autoLayout: false,
|
|
38423
38728
|
className: null,
|
|
38424
38729
|
columnResizeMode: 'fit',
|
|
38425
38730
|
contextMenuSelectionKey: null,
|
|
@@ -38934,14 +39239,14 @@ var TreeTableRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
38934
39239
|
return null;
|
|
38935
39240
|
}
|
|
38936
39241
|
};
|
|
38937
|
-
var createCell = function createCell(column) {
|
|
39242
|
+
var createCell = function createCell(column, index) {
|
|
38938
39243
|
var toggler, checkbox;
|
|
38939
39244
|
if (getColumnProp(column, 'expander')) {
|
|
38940
39245
|
toggler = createToggler();
|
|
38941
39246
|
checkbox = createCheckbox();
|
|
38942
39247
|
}
|
|
38943
39248
|
return /*#__PURE__*/React__namespace.createElement(TreeTableBodyCell, _extends({
|
|
38944
|
-
key: getColumnProp(column, 'columnKey') || getColumnProp(column, 'field')
|
|
39249
|
+
key: "".concat(getColumnProp(column, 'columnKey') || getColumnProp(column, 'field'), "_").concat(index)
|
|
38945
39250
|
}, ColumnBase.getCProps(column), {
|
|
38946
39251
|
column: column,
|
|
38947
39252
|
selectOnEdit: props.selectOnEdit,
|
|
@@ -38954,7 +39259,7 @@ var TreeTableRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
38954
39259
|
if (expanded && props.node.children) {
|
|
38955
39260
|
return props.node.children.map(function (childNode, index) {
|
|
38956
39261
|
return /*#__PURE__*/React__namespace.createElement(TreeTableRow, {
|
|
38957
|
-
key: childNode.key || JSON.stringify(childNode.data),
|
|
39262
|
+
key: "".concat(childNode.key || JSON.stringify(childNode.data), "_").concat(index),
|
|
38958
39263
|
level: props.level + 1,
|
|
38959
39264
|
rowIndex: props.rowIndex + '_' + index,
|
|
38960
39265
|
node: childNode,
|
|
@@ -39159,7 +39464,7 @@ var TreeTableBody = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
39159
39464
|
};
|
|
39160
39465
|
var createRow = function createRow(node, index) {
|
|
39161
39466
|
return /*#__PURE__*/React__namespace.createElement(TreeTableRow, {
|
|
39162
|
-
key: node.key || JSON.stringify(node.data),
|
|
39467
|
+
key: "".concat(node.key || JSON.stringify(node.data), "_").concat(index),
|
|
39163
39468
|
level: 0,
|
|
39164
39469
|
rowIndex: index,
|
|
39165
39470
|
selectOnEdit: props.selectOnEdit,
|
|
@@ -40559,7 +40864,7 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40559
40864
|
}
|
|
40560
40865
|
scrollableView = createScrollableView(value, scrollableColumns, false, props.headerColumnGroup, props.footerColumnGroup);
|
|
40561
40866
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
40562
|
-
className: "p-treetable-scrollable-wrapper"
|
|
40867
|
+
className: "p-treetable-wrapper p-treetable-scrollable-wrapper"
|
|
40563
40868
|
}, frozenView, scrollableView);
|
|
40564
40869
|
};
|
|
40565
40870
|
var createRegularTable = function createRegularTable(value) {
|
|
@@ -40567,12 +40872,17 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40567
40872
|
var header = createTableHeader(columns, props.headerColumnGroup);
|
|
40568
40873
|
var footer = createTableFooter(columns, props.footerColumnGroup);
|
|
40569
40874
|
var body = createTableBody(value, columns);
|
|
40875
|
+
var tableClassName = classNames('p-treetable-table', {
|
|
40876
|
+
'p-treetable-scrollable-table': props.scrollable,
|
|
40877
|
+
'p-treetable-resizable-table': props.resizableColumns,
|
|
40878
|
+
'p-treetable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
40879
|
+
}, props.tableClassName);
|
|
40570
40880
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
40571
40881
|
className: "p-treetable-wrapper"
|
|
40572
40882
|
}, /*#__PURE__*/React__namespace.createElement("table", {
|
|
40573
40883
|
ref: tableRef,
|
|
40574
40884
|
style: props.tableStyle,
|
|
40575
|
-
className:
|
|
40885
|
+
className: tableClassName
|
|
40576
40886
|
}, header, footer, body));
|
|
40577
40887
|
};
|
|
40578
40888
|
var createTable = function createTable(value) {
|
|
@@ -40598,7 +40908,6 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40598
40908
|
'p-treetable-selectable': isRowSelectionMode(),
|
|
40599
40909
|
'p-treetable-resizable': props.resizableColumns,
|
|
40600
40910
|
'p-treetable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
40601
|
-
'p-treetable-auto-layout': props.autoLayout,
|
|
40602
40911
|
'p-treetable-striped': props.stripedRows,
|
|
40603
40912
|
'p-treetable-gridlines': props.showGridlines
|
|
40604
40913
|
}, props.className);
|
|
@@ -40641,7 +40950,7 @@ var TreeTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
40641
40950
|
id: props.id,
|
|
40642
40951
|
className: className,
|
|
40643
40952
|
style: props.style,
|
|
40644
|
-
"data-scrollselectors": ".p-treetable-
|
|
40953
|
+
"data-scrollselectors": ".p-treetable-wrapper"
|
|
40645
40954
|
}, otherProps), loader, headerFacet, paginatorTop, table, paginatorBottom, footerFacet, resizeHelper, reorderIndicatorUp, reorderIndicatorDown);
|
|
40646
40955
|
});
|
|
40647
40956
|
TreeTable.displayName = 'TreeTable';
|
|
@@ -40902,6 +41211,7 @@ exports.useFavicon = useFavicon;
|
|
|
40902
41211
|
exports.useIntersectionObserver = useIntersectionObserver;
|
|
40903
41212
|
exports.useInterval = useInterval;
|
|
40904
41213
|
exports.useLocalStorage = useLocalStorage;
|
|
41214
|
+
exports.useMatchMedia = useMatchMedia;
|
|
40905
41215
|
exports.useMountEffect = useMountEffect;
|
|
40906
41216
|
exports.useMouse = useMouse;
|
|
40907
41217
|
exports.useMove = useMove;
|