primereact 10.9.1 → 10.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/api.cjs.js +2 -1
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +5 -1
- package/api/api.esm.js +2 -1
- package/api/api.esm.min.js +1 -1
- package/api/api.js +2 -1
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +25 -4
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +2 -2
- package/autocomplete/autocomplete.esm.js +25 -4
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +25 -4
- package/autocomplete/autocomplete.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +1 -1
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +1 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/buttongroup/buttongroup.cjs.js +4 -1
- package/buttongroup/buttongroup.cjs.min.js +1 -1
- package/buttongroup/buttongroup.esm.js +4 -1
- package/buttongroup/buttongroup.esm.min.js +1 -1
- package/buttongroup/buttongroup.js +4 -1
- package/buttongroup/buttongroup.min.js +1 -1
- package/calendar/calendar.cjs.js +41 -21
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +16 -62
- package/calendar/calendar.esm.js +41 -21
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +41 -21
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +1 -1
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +1 -1
- package/carousel/carousel.min.js +1 -1
- package/chip/chip.cjs.js +11 -2
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +13 -2
- package/chip/chip.esm.js +11 -2
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +11 -2
- package/chip/chip.min.js +1 -1
- package/componentbase/componentbase.cjs.js +15 -6
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +15 -6
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +15 -6
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +4 -3
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +4 -3
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +4 -3
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +0 -1
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +0 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +0 -1
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +167 -92
- package/core/core.min.js +10 -10
- package/datascroller/datascroller.cjs.js +2 -0
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +2 -0
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +2 -0
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +85 -58
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +85 -58
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +85 -58
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +7 -3
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +7 -3
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +8 -4
- package/dataview/dataview.min.js +1 -1
- package/dialog/dialog.cjs.js +0 -1
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +0 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +0 -1
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +2 -2
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +2 -2
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +2 -2
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +0 -1
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +0 -1
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +0 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +36 -30
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +5 -0
- package/dropdown/dropdown.esm.js +38 -32
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +36 -30
- package/dropdown/dropdown.min.js +1 -1
- package/fileupload/fileupload.cjs.js +2 -1
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +4 -0
- package/fileupload/fileupload.esm.js +2 -1
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +2 -1
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +1 -1
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +1 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +1 -1
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.d.ts +3 -2
- package/inputmask/inputmask.cjs.js +4 -2
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +4 -2
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +4 -2
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +7 -1
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +7 -1
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +7 -1
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtextarea/inputtextarea.cjs.js +1 -1
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +1 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +1 -1
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/megamenu/megamenu.cjs.js +5 -10
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +5 -10
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +5 -10
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +1 -1
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +1 -1
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +1 -1
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +6 -1
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +6 -1
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +6 -1
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +2 -3
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +2 -3
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +2 -3
- package/menubar/menubar.min.js +1 -1
- package/multiselect/multiselect.cjs.js +29 -29
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +6 -1
- package/multiselect/multiselect.esm.js +30 -30
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +29 -29
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/orderlist.cjs.js +24 -23
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +24 -23
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +24 -23
- package/orderlist/orderlist.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +3 -2
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +3 -2
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +3 -2
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +1 -2
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +1 -2
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +1 -2
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +1 -1
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +1 -1
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +1 -1
- package/passthrough/tailwind/index.min.js +1 -1
- package/picklist/picklist.cjs.js +22 -8
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +22 -8
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +22 -8
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +684 -489
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +684 -489
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +684 -489
- package/primereact.all.min.js +1 -1
- package/sidebar/sidebar.cjs.js +1 -1
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +1 -1
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/speeddial/speeddial.cjs.js +1 -1
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +1 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +1 -1
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +0 -1
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +0 -1
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +0 -1
- package/splitbutton/splitbutton.min.js +1 -1
- package/stepper/stepper.d.ts +27 -13
- package/tabview/tabview.cjs.js +1 -1
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +1 -1
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +0 -1
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +0 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +0 -1
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +2 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.cjs.js +7 -1
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +7 -1
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +7 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/tree.cjs.js +40 -38
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +11 -1
- package/tree/tree.esm.js +41 -39
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +41 -39
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +12 -13
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +6 -1
- package/treeselect/treeselect.esm.js +13 -14
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +12 -13
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +264 -254
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +265 -255
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +265 -255
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +53 -8
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +53 -8
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +53 -8
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +3 -3
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +3 -3
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +3 -3
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1001 -47
|
@@ -3,18 +3,18 @@ import * as React from 'react';
|
|
|
3
3
|
import PrimeReact, { FilterMatchMode, PrimeReactContext, ariaLabel, localeOption, FilterService } from 'primereact/api';
|
|
4
4
|
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
5
5
|
import { ObjectUtils, classNames, DomHandler, IconUtils } from 'primereact/utils';
|
|
6
|
-
import { useMergeProps,
|
|
6
|
+
import { useMergeProps, useUpdateEffect, useMountEffect, useEventListener, useUnmountEffect } from 'primereact/hooks';
|
|
7
7
|
import { ArrowDownIcon } from 'primereact/icons/arrowdown';
|
|
8
8
|
import { ArrowUpIcon } from 'primereact/icons/arrowup';
|
|
9
9
|
import { SpinnerIcon } from 'primereact/icons/spinner';
|
|
10
10
|
import { Paginator } from 'primereact/paginator';
|
|
11
11
|
import { CheckIcon } from 'primereact/icons/check';
|
|
12
|
+
import { Tooltip } from 'primereact/tooltip';
|
|
12
13
|
import { ChevronDownIcon } from 'primereact/icons/chevrondown';
|
|
13
14
|
import { ChevronRightIcon } from 'primereact/icons/chevronright';
|
|
14
15
|
import { MinusIcon } from 'primereact/icons/minus';
|
|
15
16
|
import { Ripple } from 'primereact/ripple';
|
|
16
17
|
import { OverlayService } from 'primereact/overlayservice';
|
|
17
|
-
import { Tooltip } from 'primereact/tooltip';
|
|
18
18
|
import { SortAltIcon } from 'primereact/icons/sortalt';
|
|
19
19
|
import { SortAmountDownIcon } from 'primereact/icons/sortamountdown';
|
|
20
20
|
import { SortAmountUpAltIcon } from 'primereact/icons/sortamountupalt';
|
|
@@ -328,7 +328,7 @@ var classes$1 = {
|
|
|
328
328
|
return {
|
|
329
329
|
'p-highlight': isSelected(),
|
|
330
330
|
'p-highlight-contextmenu': props.contextMenuSelectionKey && props.contextMenuSelectionKey === props.node.key,
|
|
331
|
-
'p-row-odd': props.rowIndex % 2 !== 0
|
|
331
|
+
'p-row-odd': parseInt(String(props.rowIndex).split('_').pop(), 10) % 2 !== 0
|
|
332
332
|
};
|
|
333
333
|
},
|
|
334
334
|
rowCheckbox: function rowCheckbox(_ref6) {
|
|
@@ -456,8 +456,228 @@ var TreeTableBase = ComponentBase.extend({
|
|
|
456
456
|
}
|
|
457
457
|
});
|
|
458
458
|
|
|
459
|
+
var classes = {
|
|
460
|
+
box: 'p-checkbox-box',
|
|
461
|
+
input: 'p-checkbox-input',
|
|
462
|
+
icon: 'p-checkbox-icon',
|
|
463
|
+
root: function root(_ref) {
|
|
464
|
+
var props = _ref.props,
|
|
465
|
+
checked = _ref.checked,
|
|
466
|
+
context = _ref.context;
|
|
467
|
+
return classNames('p-checkbox p-component', {
|
|
468
|
+
'p-highlight': checked,
|
|
469
|
+
'p-disabled': props.disabled,
|
|
470
|
+
'p-invalid': props.invalid,
|
|
471
|
+
'p-variant-filled': props.variant ? props.variant === 'filled' : context && context.inputStyle === 'filled'
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
var CheckboxBase = ComponentBase.extend({
|
|
476
|
+
defaultProps: {
|
|
477
|
+
__TYPE: 'Checkbox',
|
|
478
|
+
autoFocus: false,
|
|
479
|
+
checked: false,
|
|
480
|
+
className: null,
|
|
481
|
+
disabled: false,
|
|
482
|
+
falseValue: false,
|
|
483
|
+
icon: null,
|
|
484
|
+
id: null,
|
|
485
|
+
inputId: null,
|
|
486
|
+
inputRef: null,
|
|
487
|
+
invalid: false,
|
|
488
|
+
variant: null,
|
|
489
|
+
name: null,
|
|
490
|
+
onChange: null,
|
|
491
|
+
onContextMenu: null,
|
|
492
|
+
onMouseDown: null,
|
|
493
|
+
readOnly: false,
|
|
494
|
+
required: false,
|
|
495
|
+
style: null,
|
|
496
|
+
tabIndex: null,
|
|
497
|
+
tooltip: null,
|
|
498
|
+
tooltipOptions: null,
|
|
499
|
+
trueValue: true,
|
|
500
|
+
value: null,
|
|
501
|
+
children: undefined
|
|
502
|
+
},
|
|
503
|
+
css: {
|
|
504
|
+
classes: classes
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
|
|
459
508
|
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
460
509
|
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
510
|
+
var Checkbox = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
511
|
+
var mergeProps = useMergeProps();
|
|
512
|
+
var context = React.useContext(PrimeReactContext);
|
|
513
|
+
var props = CheckboxBase.getProps(inProps, context);
|
|
514
|
+
var _React$useState = React.useState(false),
|
|
515
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
516
|
+
focusedState = _React$useState2[0],
|
|
517
|
+
setFocusedState = _React$useState2[1];
|
|
518
|
+
var _CheckboxBase$setMeta = CheckboxBase.setMetaData({
|
|
519
|
+
props: props,
|
|
520
|
+
state: {
|
|
521
|
+
focused: focusedState
|
|
522
|
+
},
|
|
523
|
+
context: {
|
|
524
|
+
checked: props.checked === props.trueValue,
|
|
525
|
+
disabled: props.disabled
|
|
526
|
+
}
|
|
527
|
+
}),
|
|
528
|
+
ptm = _CheckboxBase$setMeta.ptm,
|
|
529
|
+
cx = _CheckboxBase$setMeta.cx,
|
|
530
|
+
isUnstyled = _CheckboxBase$setMeta.isUnstyled;
|
|
531
|
+
useHandleStyle(CheckboxBase.css.styles, isUnstyled, {
|
|
532
|
+
name: 'checkbox'
|
|
533
|
+
});
|
|
534
|
+
var elementRef = React.useRef(null);
|
|
535
|
+
var inputRef = React.useRef(props.inputRef);
|
|
536
|
+
var isChecked = function isChecked() {
|
|
537
|
+
return props.checked === props.trueValue;
|
|
538
|
+
};
|
|
539
|
+
var _onChange = function onChange(event) {
|
|
540
|
+
if (props.disabled || props.readonly) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
if (props.onChange) {
|
|
544
|
+
var _props$onChange;
|
|
545
|
+
var _checked = isChecked();
|
|
546
|
+
var value = _checked ? props.falseValue : props.trueValue;
|
|
547
|
+
var eventData = {
|
|
548
|
+
originalEvent: event,
|
|
549
|
+
value: props.value,
|
|
550
|
+
checked: value,
|
|
551
|
+
stopPropagation: function stopPropagation() {
|
|
552
|
+
event === null || event === void 0 || event.stopPropagation();
|
|
553
|
+
},
|
|
554
|
+
preventDefault: function preventDefault() {
|
|
555
|
+
event === null || event === void 0 || event.preventDefault();
|
|
556
|
+
},
|
|
557
|
+
target: {
|
|
558
|
+
type: 'checkbox',
|
|
559
|
+
name: props.name,
|
|
560
|
+
id: props.id,
|
|
561
|
+
value: props.value,
|
|
562
|
+
checked: value
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
|
|
566
|
+
|
|
567
|
+
// do not continue if the user defined click wants to prevent
|
|
568
|
+
if (event.defaultPrevented) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
DomHandler.focus(inputRef.current);
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
var _onFocus = function onFocus(event) {
|
|
575
|
+
var _props$onFocus;
|
|
576
|
+
setFocusedState(true);
|
|
577
|
+
props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
578
|
+
};
|
|
579
|
+
var _onBlur = function onBlur(event) {
|
|
580
|
+
var _props$onBlur;
|
|
581
|
+
setFocusedState(false);
|
|
582
|
+
props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
|
|
583
|
+
};
|
|
584
|
+
React.useImperativeHandle(ref, function () {
|
|
585
|
+
return {
|
|
586
|
+
props: props,
|
|
587
|
+
focus: function focus() {
|
|
588
|
+
return DomHandler.focus(inputRef.current);
|
|
589
|
+
},
|
|
590
|
+
getElement: function getElement() {
|
|
591
|
+
return elementRef.current;
|
|
592
|
+
},
|
|
593
|
+
getInput: function getInput() {
|
|
594
|
+
return inputRef.current;
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
});
|
|
598
|
+
React.useEffect(function () {
|
|
599
|
+
ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
600
|
+
}, [inputRef, props.inputRef]);
|
|
601
|
+
useUpdateEffect(function () {
|
|
602
|
+
inputRef.current.checked = isChecked();
|
|
603
|
+
}, [props.checked, props.trueValue]);
|
|
604
|
+
useMountEffect(function () {
|
|
605
|
+
if (props.autoFocus) {
|
|
606
|
+
DomHandler.focus(inputRef.current, props.autoFocus);
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
var checked = isChecked();
|
|
610
|
+
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
611
|
+
var otherProps = CheckboxBase.getOtherProps(props);
|
|
612
|
+
var rootProps = mergeProps({
|
|
613
|
+
id: props.id,
|
|
614
|
+
className: classNames(props.className, cx('root', {
|
|
615
|
+
checked: checked,
|
|
616
|
+
context: context
|
|
617
|
+
})),
|
|
618
|
+
style: props.style,
|
|
619
|
+
'data-p-highlight': checked,
|
|
620
|
+
'data-p-disabled': props.disabled,
|
|
621
|
+
onContextMenu: props.onContextMenu,
|
|
622
|
+
onMouseDown: props.onMouseDown
|
|
623
|
+
}, otherProps, ptm('root'));
|
|
624
|
+
var createInputElement = function createInputElement() {
|
|
625
|
+
var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
|
|
626
|
+
var inputProps = mergeProps(_objectSpread$6({
|
|
627
|
+
id: props.inputId,
|
|
628
|
+
type: 'checkbox',
|
|
629
|
+
className: cx('input'),
|
|
630
|
+
name: props.name,
|
|
631
|
+
tabIndex: props.tabIndex,
|
|
632
|
+
onFocus: function onFocus(e) {
|
|
633
|
+
return _onFocus(e);
|
|
634
|
+
},
|
|
635
|
+
onBlur: function onBlur(e) {
|
|
636
|
+
return _onBlur(e);
|
|
637
|
+
},
|
|
638
|
+
onChange: function onChange(e) {
|
|
639
|
+
return _onChange(e);
|
|
640
|
+
},
|
|
641
|
+
disabled: props.disabled,
|
|
642
|
+
readOnly: props.readOnly,
|
|
643
|
+
required: props.required,
|
|
644
|
+
'aria-invalid': props.invalid,
|
|
645
|
+
checked: checked
|
|
646
|
+
}, ariaProps), ptm('input'));
|
|
647
|
+
return /*#__PURE__*/React.createElement("input", _extends({
|
|
648
|
+
ref: inputRef
|
|
649
|
+
}, inputProps));
|
|
650
|
+
};
|
|
651
|
+
var createBoxElement = function createBoxElement() {
|
|
652
|
+
var iconProps = mergeProps({
|
|
653
|
+
className: cx('icon')
|
|
654
|
+
}, ptm('icon'));
|
|
655
|
+
var boxProps = mergeProps({
|
|
656
|
+
className: cx('box', {
|
|
657
|
+
checked: checked
|
|
658
|
+
}),
|
|
659
|
+
'data-p-highlight': checked,
|
|
660
|
+
'data-p-disabled': props.disabled
|
|
661
|
+
}, ptm('box'));
|
|
662
|
+
var icon = checked ? props.icon || /*#__PURE__*/React.createElement(CheckIcon, iconProps) : null;
|
|
663
|
+
var checkboxIcon = IconUtils.getJSXIcon(icon, _objectSpread$6({}, iconProps), {
|
|
664
|
+
props: props,
|
|
665
|
+
checked: checked
|
|
666
|
+
});
|
|
667
|
+
return /*#__PURE__*/React.createElement("div", boxProps, checkboxIcon);
|
|
668
|
+
};
|
|
669
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
670
|
+
ref: elementRef
|
|
671
|
+
}, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
672
|
+
target: elementRef,
|
|
673
|
+
content: props.tooltip,
|
|
674
|
+
pt: ptm('tooltip')
|
|
675
|
+
}, props.tooltipOptions)));
|
|
676
|
+
}));
|
|
677
|
+
Checkbox.displayName = 'Checkbox';
|
|
678
|
+
|
|
679
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
680
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
461
681
|
var TreeTableBodyCell = function TreeTableBodyCell(props) {
|
|
462
682
|
var _React$useState = React.useState(false),
|
|
463
683
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -518,7 +738,7 @@ var TreeTableBodyCell = function TreeTableBodyCell(props) {
|
|
|
518
738
|
};
|
|
519
739
|
var getCellCallbackParams = function getCellCallbackParams(event) {
|
|
520
740
|
var params = getCellParams();
|
|
521
|
-
return _objectSpread$
|
|
741
|
+
return _objectSpread$5({
|
|
522
742
|
originalEvent: event
|
|
523
743
|
}, params);
|
|
524
744
|
};
|
|
@@ -700,226 +920,6 @@ var TreeTableBodyCell = function TreeTableBodyCell(props) {
|
|
|
700
920
|
};
|
|
701
921
|
TreeTableBodyCell.displayName = 'TreeTableBodyCell';
|
|
702
922
|
|
|
703
|
-
var classes = {
|
|
704
|
-
box: 'p-checkbox-box',
|
|
705
|
-
input: 'p-checkbox-input',
|
|
706
|
-
icon: 'p-checkbox-icon',
|
|
707
|
-
root: function root(_ref) {
|
|
708
|
-
var props = _ref.props,
|
|
709
|
-
checked = _ref.checked,
|
|
710
|
-
context = _ref.context;
|
|
711
|
-
return classNames('p-checkbox p-component', {
|
|
712
|
-
'p-highlight': checked,
|
|
713
|
-
'p-disabled': props.disabled,
|
|
714
|
-
'p-invalid': props.invalid,
|
|
715
|
-
'p-variant-filled': props.variant ? props.variant === 'filled' : context && context.inputStyle === 'filled'
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
};
|
|
719
|
-
var CheckboxBase = ComponentBase.extend({
|
|
720
|
-
defaultProps: {
|
|
721
|
-
__TYPE: 'Checkbox',
|
|
722
|
-
autoFocus: false,
|
|
723
|
-
checked: false,
|
|
724
|
-
className: null,
|
|
725
|
-
disabled: false,
|
|
726
|
-
falseValue: false,
|
|
727
|
-
icon: null,
|
|
728
|
-
id: null,
|
|
729
|
-
inputId: null,
|
|
730
|
-
inputRef: null,
|
|
731
|
-
invalid: false,
|
|
732
|
-
variant: null,
|
|
733
|
-
name: null,
|
|
734
|
-
onChange: null,
|
|
735
|
-
onContextMenu: null,
|
|
736
|
-
onMouseDown: null,
|
|
737
|
-
readOnly: false,
|
|
738
|
-
required: false,
|
|
739
|
-
style: null,
|
|
740
|
-
tabIndex: null,
|
|
741
|
-
tooltip: null,
|
|
742
|
-
tooltipOptions: null,
|
|
743
|
-
trueValue: true,
|
|
744
|
-
value: null,
|
|
745
|
-
children: undefined
|
|
746
|
-
},
|
|
747
|
-
css: {
|
|
748
|
-
classes: classes
|
|
749
|
-
}
|
|
750
|
-
});
|
|
751
|
-
|
|
752
|
-
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
753
|
-
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
754
|
-
var Checkbox = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
755
|
-
var mergeProps = useMergeProps();
|
|
756
|
-
var context = React.useContext(PrimeReactContext);
|
|
757
|
-
var props = CheckboxBase.getProps(inProps, context);
|
|
758
|
-
var _React$useState = React.useState(false),
|
|
759
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
760
|
-
focusedState = _React$useState2[0],
|
|
761
|
-
setFocusedState = _React$useState2[1];
|
|
762
|
-
var _CheckboxBase$setMeta = CheckboxBase.setMetaData({
|
|
763
|
-
props: props,
|
|
764
|
-
state: {
|
|
765
|
-
focused: focusedState
|
|
766
|
-
},
|
|
767
|
-
context: {
|
|
768
|
-
checked: props.checked === props.trueValue,
|
|
769
|
-
disabled: props.disabled
|
|
770
|
-
}
|
|
771
|
-
}),
|
|
772
|
-
ptm = _CheckboxBase$setMeta.ptm,
|
|
773
|
-
cx = _CheckboxBase$setMeta.cx,
|
|
774
|
-
isUnstyled = _CheckboxBase$setMeta.isUnstyled;
|
|
775
|
-
useHandleStyle(CheckboxBase.css.styles, isUnstyled, {
|
|
776
|
-
name: 'checkbox'
|
|
777
|
-
});
|
|
778
|
-
var elementRef = React.useRef(null);
|
|
779
|
-
var inputRef = React.useRef(props.inputRef);
|
|
780
|
-
var isChecked = function isChecked() {
|
|
781
|
-
return props.checked === props.trueValue;
|
|
782
|
-
};
|
|
783
|
-
var _onChange = function onChange(event) {
|
|
784
|
-
if (props.disabled || props.readonly) {
|
|
785
|
-
return;
|
|
786
|
-
}
|
|
787
|
-
if (props.onChange) {
|
|
788
|
-
var _props$onChange;
|
|
789
|
-
var _checked = isChecked();
|
|
790
|
-
var value = _checked ? props.falseValue : props.trueValue;
|
|
791
|
-
var eventData = {
|
|
792
|
-
originalEvent: event,
|
|
793
|
-
value: props.value,
|
|
794
|
-
checked: value,
|
|
795
|
-
stopPropagation: function stopPropagation() {
|
|
796
|
-
event === null || event === void 0 || event.stopPropagation();
|
|
797
|
-
},
|
|
798
|
-
preventDefault: function preventDefault() {
|
|
799
|
-
event === null || event === void 0 || event.preventDefault();
|
|
800
|
-
},
|
|
801
|
-
target: {
|
|
802
|
-
type: 'checkbox',
|
|
803
|
-
name: props.name,
|
|
804
|
-
id: props.id,
|
|
805
|
-
value: props.value,
|
|
806
|
-
checked: value
|
|
807
|
-
}
|
|
808
|
-
};
|
|
809
|
-
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
|
|
810
|
-
|
|
811
|
-
// do not continue if the user defined click wants to prevent
|
|
812
|
-
if (event.defaultPrevented) {
|
|
813
|
-
return;
|
|
814
|
-
}
|
|
815
|
-
DomHandler.focus(inputRef.current);
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
var _onFocus = function onFocus(event) {
|
|
819
|
-
var _props$onFocus;
|
|
820
|
-
setFocusedState(true);
|
|
821
|
-
props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
822
|
-
};
|
|
823
|
-
var _onBlur = function onBlur(event) {
|
|
824
|
-
var _props$onBlur;
|
|
825
|
-
setFocusedState(false);
|
|
826
|
-
props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
|
|
827
|
-
};
|
|
828
|
-
React.useImperativeHandle(ref, function () {
|
|
829
|
-
return {
|
|
830
|
-
props: props,
|
|
831
|
-
focus: function focus() {
|
|
832
|
-
return DomHandler.focus(inputRef.current);
|
|
833
|
-
},
|
|
834
|
-
getElement: function getElement() {
|
|
835
|
-
return elementRef.current;
|
|
836
|
-
},
|
|
837
|
-
getInput: function getInput() {
|
|
838
|
-
return inputRef.current;
|
|
839
|
-
}
|
|
840
|
-
};
|
|
841
|
-
});
|
|
842
|
-
React.useEffect(function () {
|
|
843
|
-
ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
844
|
-
}, [inputRef, props.inputRef]);
|
|
845
|
-
useUpdateEffect(function () {
|
|
846
|
-
inputRef.current.checked = isChecked();
|
|
847
|
-
}, [props.checked, props.trueValue]);
|
|
848
|
-
useMountEffect(function () {
|
|
849
|
-
if (props.autoFocus) {
|
|
850
|
-
DomHandler.focus(inputRef.current, props.autoFocus);
|
|
851
|
-
}
|
|
852
|
-
});
|
|
853
|
-
var checked = isChecked();
|
|
854
|
-
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
855
|
-
var otherProps = CheckboxBase.getOtherProps(props);
|
|
856
|
-
var rootProps = mergeProps({
|
|
857
|
-
id: props.id,
|
|
858
|
-
className: classNames(props.className, cx('root', {
|
|
859
|
-
checked: checked,
|
|
860
|
-
context: context
|
|
861
|
-
})),
|
|
862
|
-
style: props.style,
|
|
863
|
-
'data-p-highlight': checked,
|
|
864
|
-
'data-p-disabled': props.disabled,
|
|
865
|
-
onContextMenu: props.onContextMenu,
|
|
866
|
-
onMouseDown: props.onMouseDown
|
|
867
|
-
}, otherProps, ptm('root'));
|
|
868
|
-
var createInputElement = function createInputElement() {
|
|
869
|
-
var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
|
|
870
|
-
var inputProps = mergeProps(_objectSpread$5({
|
|
871
|
-
id: props.inputId,
|
|
872
|
-
type: 'checkbox',
|
|
873
|
-
className: cx('input'),
|
|
874
|
-
name: props.name,
|
|
875
|
-
tabIndex: props.tabIndex,
|
|
876
|
-
onFocus: function onFocus(e) {
|
|
877
|
-
return _onFocus(e);
|
|
878
|
-
},
|
|
879
|
-
onBlur: function onBlur(e) {
|
|
880
|
-
return _onBlur(e);
|
|
881
|
-
},
|
|
882
|
-
onChange: function onChange(e) {
|
|
883
|
-
return _onChange(e);
|
|
884
|
-
},
|
|
885
|
-
disabled: props.disabled,
|
|
886
|
-
readOnly: props.readOnly,
|
|
887
|
-
required: props.required,
|
|
888
|
-
'aria-invalid': props.invalid,
|
|
889
|
-
checked: checked
|
|
890
|
-
}, ariaProps), ptm('input'));
|
|
891
|
-
return /*#__PURE__*/React.createElement("input", _extends({
|
|
892
|
-
ref: inputRef
|
|
893
|
-
}, inputProps));
|
|
894
|
-
};
|
|
895
|
-
var createBoxElement = function createBoxElement() {
|
|
896
|
-
var iconProps = mergeProps({
|
|
897
|
-
className: cx('icon')
|
|
898
|
-
}, ptm('icon'));
|
|
899
|
-
var boxProps = mergeProps({
|
|
900
|
-
className: cx('box', {
|
|
901
|
-
checked: checked
|
|
902
|
-
}),
|
|
903
|
-
'data-p-highlight': checked,
|
|
904
|
-
'data-p-disabled': props.disabled
|
|
905
|
-
}, ptm('box'));
|
|
906
|
-
var icon = checked ? props.icon || /*#__PURE__*/React.createElement(CheckIcon, iconProps) : null;
|
|
907
|
-
var checkboxIcon = IconUtils.getJSXIcon(icon, _objectSpread$5({}, iconProps), {
|
|
908
|
-
props: props,
|
|
909
|
-
checked: checked
|
|
910
|
-
});
|
|
911
|
-
return /*#__PURE__*/React.createElement("div", boxProps, checkboxIcon);
|
|
912
|
-
};
|
|
913
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
914
|
-
ref: elementRef
|
|
915
|
-
}, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
916
|
-
target: elementRef,
|
|
917
|
-
content: props.tooltip,
|
|
918
|
-
pt: ptm('tooltip')
|
|
919
|
-
}, props.tooltipOptions)));
|
|
920
|
-
}));
|
|
921
|
-
Checkbox.displayName = 'Checkbox';
|
|
922
|
-
|
|
923
923
|
function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
924
924
|
function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
|
|
925
925
|
function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -2774,28 +2774,27 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
2774
2774
|
}
|
|
2775
2775
|
multiSortMeta = multiSortMeta.length > 0 ? multiSortMeta : null;
|
|
2776
2776
|
};
|
|
2777
|
-
var
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2777
|
+
var _sortSingle = function sortSingle(_ref) {
|
|
2778
|
+
var data = _ref.data,
|
|
2779
|
+
field = _ref.field,
|
|
2780
|
+
order = _ref.order;
|
|
2781
2781
|
var value = _toConsumableArray(data);
|
|
2782
2782
|
if (columnSortable.current && columnSortFunction.current) {
|
|
2783
2783
|
value = columnSortFunction.current({
|
|
2784
2784
|
data: data,
|
|
2785
|
-
field:
|
|
2786
|
-
order:
|
|
2785
|
+
field: field,
|
|
2786
|
+
order: order
|
|
2787
2787
|
});
|
|
2788
2788
|
} else {
|
|
2789
2789
|
// performance optimization to prevent resolving field data in each loop
|
|
2790
2790
|
var lookupMap = new Map();
|
|
2791
|
-
var sortField = getSortField();
|
|
2792
2791
|
var comparator = ObjectUtils.localeComparator(context && context.locale || PrimeReact.locale);
|
|
2793
2792
|
var _iterator = _createForOfIteratorHelper(data),
|
|
2794
2793
|
_step;
|
|
2795
2794
|
try {
|
|
2796
2795
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2797
2796
|
var node = _step.value;
|
|
2798
|
-
lookupMap.set(node.data, ObjectUtils.resolveFieldData(node.data,
|
|
2797
|
+
lookupMap.set(node.data, ObjectUtils.resolveFieldData(node.data, field));
|
|
2799
2798
|
}
|
|
2800
2799
|
} catch (err) {
|
|
2801
2800
|
_iterator.e(err);
|
|
@@ -2805,24 +2804,24 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
2805
2804
|
value.sort(function (node1, node2) {
|
|
2806
2805
|
var value1 = lookupMap.get(node1.data);
|
|
2807
2806
|
var value2 = lookupMap.get(node2.data);
|
|
2808
|
-
return compareValuesOnSort(value1, value2, comparator,
|
|
2807
|
+
return compareValuesOnSort(value1, value2, comparator, order);
|
|
2809
2808
|
});
|
|
2810
2809
|
for (var i = 0; i < value.length; i++) {
|
|
2811
2810
|
if (value[i].children && value[i].children.length) {
|
|
2812
|
-
value[i].children =
|
|
2811
|
+
value[i].children = _sortSingle({
|
|
2812
|
+
data: value[i].children,
|
|
2813
|
+
field: field,
|
|
2814
|
+
order: order
|
|
2815
|
+
});
|
|
2813
2816
|
}
|
|
2814
2817
|
}
|
|
2815
2818
|
}
|
|
2816
2819
|
return value;
|
|
2817
2820
|
};
|
|
2818
|
-
var
|
|
2819
|
-
var
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
}
|
|
2823
|
-
return data;
|
|
2824
|
-
};
|
|
2825
|
-
var _sortMultipleNodes = function sortMultipleNodes(data, multiSortMeta) {
|
|
2821
|
+
var _sortMultiple = function sortMultiple(_ref2) {
|
|
2822
|
+
var data = _ref2.data,
|
|
2823
|
+
_ref2$multiSortMeta = _ref2.multiSortMeta,
|
|
2824
|
+
multiSortMeta = _ref2$multiSortMeta === void 0 ? [] : _ref2$multiSortMeta;
|
|
2826
2825
|
var value = _toConsumableArray(data);
|
|
2827
2826
|
var comparator = ObjectUtils.localeComparator(context && context.locale || PrimeReact.locale);
|
|
2828
2827
|
value.sort(function (node1, node2) {
|
|
@@ -2830,7 +2829,10 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
2830
2829
|
});
|
|
2831
2830
|
for (var i = 0; i < value.length; i++) {
|
|
2832
2831
|
if (value[i].children && value[i].children.length) {
|
|
2833
|
-
value[i].children =
|
|
2832
|
+
value[i].children = _sortMultiple({
|
|
2833
|
+
data: value[i].children,
|
|
2834
|
+
multiSortMeta: multiSortMeta
|
|
2835
|
+
});
|
|
2834
2836
|
}
|
|
2835
2837
|
}
|
|
2836
2838
|
return value;
|
|
@@ -2889,10 +2891,10 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
2889
2891
|
filters = filters || props.filters;
|
|
2890
2892
|
var cloned = {};
|
|
2891
2893
|
if (filters) {
|
|
2892
|
-
Object.entries(filters).forEach(function (
|
|
2893
|
-
var
|
|
2894
|
-
prop =
|
|
2895
|
-
value =
|
|
2894
|
+
Object.entries(filters).forEach(function (_ref3) {
|
|
2895
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
2896
|
+
prop = _ref4[0],
|
|
2897
|
+
value = _ref4[1];
|
|
2896
2898
|
cloned[prop] = value;
|
|
2897
2899
|
});
|
|
2898
2900
|
} else {
|
|
@@ -3391,12 +3393,12 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
3391
3393
|
}
|
|
3392
3394
|
}
|
|
3393
3395
|
};
|
|
3394
|
-
var isFilterMatched = function isFilterMatched(node,
|
|
3395
|
-
var filterField =
|
|
3396
|
-
filterValue =
|
|
3397
|
-
filterConstraint =
|
|
3398
|
-
isStrictMode =
|
|
3399
|
-
options =
|
|
3396
|
+
var isFilterMatched = function isFilterMatched(node, _ref5) {
|
|
3397
|
+
var filterField = _ref5.filterField,
|
|
3398
|
+
filterValue = _ref5.filterValue,
|
|
3399
|
+
filterConstraint = _ref5.filterConstraint,
|
|
3400
|
+
isStrictMode = _ref5.isStrictMode,
|
|
3401
|
+
options = _ref5.options;
|
|
3400
3402
|
var matched = false;
|
|
3401
3403
|
var dataFieldValue = ObjectUtils.resolveFieldData(node.data, filterField);
|
|
3402
3404
|
if (filterConstraint(dataFieldValue, filterValue, props.filterLocale, options)) {
|
|
@@ -3421,6 +3423,7 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
3421
3423
|
if (data && data.length) {
|
|
3422
3424
|
var filters = localState && localState.filters || getFilters();
|
|
3423
3425
|
var sortField = localState && localState.sortField || getSortField();
|
|
3426
|
+
var sortOrder = localState && localState.sortOrder || getSortOrder();
|
|
3424
3427
|
var multiSortMeta = localState && localState.multiSortMeta || getMultiSortMeta();
|
|
3425
3428
|
var columns = getColumns();
|
|
3426
3429
|
var sortColumn = columns.find(function (col) {
|
|
@@ -3435,9 +3438,16 @@ var TreeTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
3435
3438
|
}
|
|
3436
3439
|
if (sortField || ObjectUtils.isNotEmpty(multiSortMeta)) {
|
|
3437
3440
|
if (props.sortMode === 'single') {
|
|
3438
|
-
data =
|
|
3441
|
+
data = _sortSingle({
|
|
3442
|
+
data: data,
|
|
3443
|
+
field: sortField,
|
|
3444
|
+
order: sortOrder
|
|
3445
|
+
});
|
|
3439
3446
|
} else if (props.sortMode === 'multiple') {
|
|
3440
|
-
data =
|
|
3447
|
+
data = _sortMultiple({
|
|
3448
|
+
data: data,
|
|
3449
|
+
multiSortMeta: multiSortMeta
|
|
3450
|
+
});
|
|
3441
3451
|
}
|
|
3442
3452
|
}
|
|
3443
3453
|
}
|