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
package/treetable/treetable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.treetable = (function (exports, React, PrimeReact, componentbase, utils, hooks, arrowdown, arrowup, spinner, paginator, check, chevrondown, chevronright, minus, ripple, overlayservice,
|
|
2
|
+
this.primereact.treetable = (function (exports, React, PrimeReact, componentbase, utils, hooks, arrowdown, arrowup, spinner, paginator, check, tooltip, chevrondown, chevronright, minus, ripple, overlayservice, sortalt, sortamountdown, sortamountupalt, inputtext) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -333,7 +333,7 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
333
333
|
return {
|
|
334
334
|
'p-highlight': isSelected(),
|
|
335
335
|
'p-highlight-contextmenu': props.contextMenuSelectionKey && props.contextMenuSelectionKey === props.node.key,
|
|
336
|
-
'p-row-odd': props.rowIndex % 2 !== 0
|
|
336
|
+
'p-row-odd': parseInt(String(props.rowIndex).split('_').pop(), 10) % 2 !== 0
|
|
337
337
|
};
|
|
338
338
|
},
|
|
339
339
|
rowCheckbox: function rowCheckbox(_ref6) {
|
|
@@ -461,8 +461,228 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
461
461
|
}
|
|
462
462
|
});
|
|
463
463
|
|
|
464
|
+
var classes = {
|
|
465
|
+
box: 'p-checkbox-box',
|
|
466
|
+
input: 'p-checkbox-input',
|
|
467
|
+
icon: 'p-checkbox-icon',
|
|
468
|
+
root: function root(_ref) {
|
|
469
|
+
var props = _ref.props,
|
|
470
|
+
checked = _ref.checked,
|
|
471
|
+
context = _ref.context;
|
|
472
|
+
return utils.classNames('p-checkbox p-component', {
|
|
473
|
+
'p-highlight': checked,
|
|
474
|
+
'p-disabled': props.disabled,
|
|
475
|
+
'p-invalid': props.invalid,
|
|
476
|
+
'p-variant-filled': props.variant ? props.variant === 'filled' : context && context.inputStyle === 'filled'
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
var CheckboxBase = componentbase.ComponentBase.extend({
|
|
481
|
+
defaultProps: {
|
|
482
|
+
__TYPE: 'Checkbox',
|
|
483
|
+
autoFocus: false,
|
|
484
|
+
checked: false,
|
|
485
|
+
className: null,
|
|
486
|
+
disabled: false,
|
|
487
|
+
falseValue: false,
|
|
488
|
+
icon: null,
|
|
489
|
+
id: null,
|
|
490
|
+
inputId: null,
|
|
491
|
+
inputRef: null,
|
|
492
|
+
invalid: false,
|
|
493
|
+
variant: null,
|
|
494
|
+
name: null,
|
|
495
|
+
onChange: null,
|
|
496
|
+
onContextMenu: null,
|
|
497
|
+
onMouseDown: null,
|
|
498
|
+
readOnly: false,
|
|
499
|
+
required: false,
|
|
500
|
+
style: null,
|
|
501
|
+
tabIndex: null,
|
|
502
|
+
tooltip: null,
|
|
503
|
+
tooltipOptions: null,
|
|
504
|
+
trueValue: true,
|
|
505
|
+
value: null,
|
|
506
|
+
children: undefined
|
|
507
|
+
},
|
|
508
|
+
css: {
|
|
509
|
+
classes: classes
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
|
|
464
513
|
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; }
|
|
465
514
|
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; }
|
|
515
|
+
var Checkbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
516
|
+
var mergeProps = hooks.useMergeProps();
|
|
517
|
+
var context = React__namespace.useContext(PrimeReact.PrimeReactContext);
|
|
518
|
+
var props = CheckboxBase.getProps(inProps, context);
|
|
519
|
+
var _React$useState = React__namespace.useState(false),
|
|
520
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
521
|
+
focusedState = _React$useState2[0],
|
|
522
|
+
setFocusedState = _React$useState2[1];
|
|
523
|
+
var _CheckboxBase$setMeta = CheckboxBase.setMetaData({
|
|
524
|
+
props: props,
|
|
525
|
+
state: {
|
|
526
|
+
focused: focusedState
|
|
527
|
+
},
|
|
528
|
+
context: {
|
|
529
|
+
checked: props.checked === props.trueValue,
|
|
530
|
+
disabled: props.disabled
|
|
531
|
+
}
|
|
532
|
+
}),
|
|
533
|
+
ptm = _CheckboxBase$setMeta.ptm,
|
|
534
|
+
cx = _CheckboxBase$setMeta.cx,
|
|
535
|
+
isUnstyled = _CheckboxBase$setMeta.isUnstyled;
|
|
536
|
+
componentbase.useHandleStyle(CheckboxBase.css.styles, isUnstyled, {
|
|
537
|
+
name: 'checkbox'
|
|
538
|
+
});
|
|
539
|
+
var elementRef = React__namespace.useRef(null);
|
|
540
|
+
var inputRef = React__namespace.useRef(props.inputRef);
|
|
541
|
+
var isChecked = function isChecked() {
|
|
542
|
+
return props.checked === props.trueValue;
|
|
543
|
+
};
|
|
544
|
+
var _onChange = function onChange(event) {
|
|
545
|
+
if (props.disabled || props.readonly) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (props.onChange) {
|
|
549
|
+
var _props$onChange;
|
|
550
|
+
var _checked = isChecked();
|
|
551
|
+
var value = _checked ? props.falseValue : props.trueValue;
|
|
552
|
+
var eventData = {
|
|
553
|
+
originalEvent: event,
|
|
554
|
+
value: props.value,
|
|
555
|
+
checked: value,
|
|
556
|
+
stopPropagation: function stopPropagation() {
|
|
557
|
+
event === null || event === void 0 || event.stopPropagation();
|
|
558
|
+
},
|
|
559
|
+
preventDefault: function preventDefault() {
|
|
560
|
+
event === null || event === void 0 || event.preventDefault();
|
|
561
|
+
},
|
|
562
|
+
target: {
|
|
563
|
+
type: 'checkbox',
|
|
564
|
+
name: props.name,
|
|
565
|
+
id: props.id,
|
|
566
|
+
value: props.value,
|
|
567
|
+
checked: value
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
|
|
571
|
+
|
|
572
|
+
// do not continue if the user defined click wants to prevent
|
|
573
|
+
if (event.defaultPrevented) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
utils.DomHandler.focus(inputRef.current);
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
var _onFocus = function onFocus(event) {
|
|
580
|
+
var _props$onFocus;
|
|
581
|
+
setFocusedState(true);
|
|
582
|
+
props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
583
|
+
};
|
|
584
|
+
var _onBlur = function onBlur(event) {
|
|
585
|
+
var _props$onBlur;
|
|
586
|
+
setFocusedState(false);
|
|
587
|
+
props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
|
|
588
|
+
};
|
|
589
|
+
React__namespace.useImperativeHandle(ref, function () {
|
|
590
|
+
return {
|
|
591
|
+
props: props,
|
|
592
|
+
focus: function focus() {
|
|
593
|
+
return utils.DomHandler.focus(inputRef.current);
|
|
594
|
+
},
|
|
595
|
+
getElement: function getElement() {
|
|
596
|
+
return elementRef.current;
|
|
597
|
+
},
|
|
598
|
+
getInput: function getInput() {
|
|
599
|
+
return inputRef.current;
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
});
|
|
603
|
+
React__namespace.useEffect(function () {
|
|
604
|
+
utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
605
|
+
}, [inputRef, props.inputRef]);
|
|
606
|
+
hooks.useUpdateEffect(function () {
|
|
607
|
+
inputRef.current.checked = isChecked();
|
|
608
|
+
}, [props.checked, props.trueValue]);
|
|
609
|
+
hooks.useMountEffect(function () {
|
|
610
|
+
if (props.autoFocus) {
|
|
611
|
+
utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
var checked = isChecked();
|
|
615
|
+
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
616
|
+
var otherProps = CheckboxBase.getOtherProps(props);
|
|
617
|
+
var rootProps = mergeProps({
|
|
618
|
+
id: props.id,
|
|
619
|
+
className: utils.classNames(props.className, cx('root', {
|
|
620
|
+
checked: checked,
|
|
621
|
+
context: context
|
|
622
|
+
})),
|
|
623
|
+
style: props.style,
|
|
624
|
+
'data-p-highlight': checked,
|
|
625
|
+
'data-p-disabled': props.disabled,
|
|
626
|
+
onContextMenu: props.onContextMenu,
|
|
627
|
+
onMouseDown: props.onMouseDown
|
|
628
|
+
}, otherProps, ptm('root'));
|
|
629
|
+
var createInputElement = function createInputElement() {
|
|
630
|
+
var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
|
|
631
|
+
var inputProps = mergeProps(_objectSpread$6({
|
|
632
|
+
id: props.inputId,
|
|
633
|
+
type: 'checkbox',
|
|
634
|
+
className: cx('input'),
|
|
635
|
+
name: props.name,
|
|
636
|
+
tabIndex: props.tabIndex,
|
|
637
|
+
onFocus: function onFocus(e) {
|
|
638
|
+
return _onFocus(e);
|
|
639
|
+
},
|
|
640
|
+
onBlur: function onBlur(e) {
|
|
641
|
+
return _onBlur(e);
|
|
642
|
+
},
|
|
643
|
+
onChange: function onChange(e) {
|
|
644
|
+
return _onChange(e);
|
|
645
|
+
},
|
|
646
|
+
disabled: props.disabled,
|
|
647
|
+
readOnly: props.readOnly,
|
|
648
|
+
required: props.required,
|
|
649
|
+
'aria-invalid': props.invalid,
|
|
650
|
+
checked: checked
|
|
651
|
+
}, ariaProps), ptm('input'));
|
|
652
|
+
return /*#__PURE__*/React__namespace.createElement("input", _extends({
|
|
653
|
+
ref: inputRef
|
|
654
|
+
}, inputProps));
|
|
655
|
+
};
|
|
656
|
+
var createBoxElement = function createBoxElement() {
|
|
657
|
+
var iconProps = mergeProps({
|
|
658
|
+
className: cx('icon')
|
|
659
|
+
}, ptm('icon'));
|
|
660
|
+
var boxProps = mergeProps({
|
|
661
|
+
className: cx('box', {
|
|
662
|
+
checked: checked
|
|
663
|
+
}),
|
|
664
|
+
'data-p-highlight': checked,
|
|
665
|
+
'data-p-disabled': props.disabled
|
|
666
|
+
}, ptm('box'));
|
|
667
|
+
var icon = checked ? props.icon || /*#__PURE__*/React__namespace.createElement(check.CheckIcon, iconProps) : null;
|
|
668
|
+
var checkboxIcon = utils.IconUtils.getJSXIcon(icon, _objectSpread$6({}, iconProps), {
|
|
669
|
+
props: props,
|
|
670
|
+
checked: checked
|
|
671
|
+
});
|
|
672
|
+
return /*#__PURE__*/React__namespace.createElement("div", boxProps, checkboxIcon);
|
|
673
|
+
};
|
|
674
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
675
|
+
ref: elementRef
|
|
676
|
+
}, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
|
|
677
|
+
target: elementRef,
|
|
678
|
+
content: props.tooltip,
|
|
679
|
+
pt: ptm('tooltip')
|
|
680
|
+
}, props.tooltipOptions)));
|
|
681
|
+
}));
|
|
682
|
+
Checkbox.displayName = 'Checkbox';
|
|
683
|
+
|
|
684
|
+
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; }
|
|
685
|
+
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; }
|
|
466
686
|
var TreeTableBodyCell = function TreeTableBodyCell(props) {
|
|
467
687
|
var _React$useState = React__namespace.useState(false),
|
|
468
688
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -523,7 +743,7 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
523
743
|
};
|
|
524
744
|
var getCellCallbackParams = function getCellCallbackParams(event) {
|
|
525
745
|
var params = getCellParams();
|
|
526
|
-
return _objectSpread$
|
|
746
|
+
return _objectSpread$5({
|
|
527
747
|
originalEvent: event
|
|
528
748
|
}, params);
|
|
529
749
|
};
|
|
@@ -705,226 +925,6 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
705
925
|
};
|
|
706
926
|
TreeTableBodyCell.displayName = 'TreeTableBodyCell';
|
|
707
927
|
|
|
708
|
-
var classes = {
|
|
709
|
-
box: 'p-checkbox-box',
|
|
710
|
-
input: 'p-checkbox-input',
|
|
711
|
-
icon: 'p-checkbox-icon',
|
|
712
|
-
root: function root(_ref) {
|
|
713
|
-
var props = _ref.props,
|
|
714
|
-
checked = _ref.checked,
|
|
715
|
-
context = _ref.context;
|
|
716
|
-
return utils.classNames('p-checkbox p-component', {
|
|
717
|
-
'p-highlight': checked,
|
|
718
|
-
'p-disabled': props.disabled,
|
|
719
|
-
'p-invalid': props.invalid,
|
|
720
|
-
'p-variant-filled': props.variant ? props.variant === 'filled' : context && context.inputStyle === 'filled'
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
|
-
var CheckboxBase = componentbase.ComponentBase.extend({
|
|
725
|
-
defaultProps: {
|
|
726
|
-
__TYPE: 'Checkbox',
|
|
727
|
-
autoFocus: false,
|
|
728
|
-
checked: false,
|
|
729
|
-
className: null,
|
|
730
|
-
disabled: false,
|
|
731
|
-
falseValue: false,
|
|
732
|
-
icon: null,
|
|
733
|
-
id: null,
|
|
734
|
-
inputId: null,
|
|
735
|
-
inputRef: null,
|
|
736
|
-
invalid: false,
|
|
737
|
-
variant: null,
|
|
738
|
-
name: null,
|
|
739
|
-
onChange: null,
|
|
740
|
-
onContextMenu: null,
|
|
741
|
-
onMouseDown: null,
|
|
742
|
-
readOnly: false,
|
|
743
|
-
required: false,
|
|
744
|
-
style: null,
|
|
745
|
-
tabIndex: null,
|
|
746
|
-
tooltip: null,
|
|
747
|
-
tooltipOptions: null,
|
|
748
|
-
trueValue: true,
|
|
749
|
-
value: null,
|
|
750
|
-
children: undefined
|
|
751
|
-
},
|
|
752
|
-
css: {
|
|
753
|
-
classes: classes
|
|
754
|
-
}
|
|
755
|
-
});
|
|
756
|
-
|
|
757
|
-
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; }
|
|
758
|
-
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; }
|
|
759
|
-
var Checkbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
760
|
-
var mergeProps = hooks.useMergeProps();
|
|
761
|
-
var context = React__namespace.useContext(PrimeReact.PrimeReactContext);
|
|
762
|
-
var props = CheckboxBase.getProps(inProps, context);
|
|
763
|
-
var _React$useState = React__namespace.useState(false),
|
|
764
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
765
|
-
focusedState = _React$useState2[0],
|
|
766
|
-
setFocusedState = _React$useState2[1];
|
|
767
|
-
var _CheckboxBase$setMeta = CheckboxBase.setMetaData({
|
|
768
|
-
props: props,
|
|
769
|
-
state: {
|
|
770
|
-
focused: focusedState
|
|
771
|
-
},
|
|
772
|
-
context: {
|
|
773
|
-
checked: props.checked === props.trueValue,
|
|
774
|
-
disabled: props.disabled
|
|
775
|
-
}
|
|
776
|
-
}),
|
|
777
|
-
ptm = _CheckboxBase$setMeta.ptm,
|
|
778
|
-
cx = _CheckboxBase$setMeta.cx,
|
|
779
|
-
isUnstyled = _CheckboxBase$setMeta.isUnstyled;
|
|
780
|
-
componentbase.useHandleStyle(CheckboxBase.css.styles, isUnstyled, {
|
|
781
|
-
name: 'checkbox'
|
|
782
|
-
});
|
|
783
|
-
var elementRef = React__namespace.useRef(null);
|
|
784
|
-
var inputRef = React__namespace.useRef(props.inputRef);
|
|
785
|
-
var isChecked = function isChecked() {
|
|
786
|
-
return props.checked === props.trueValue;
|
|
787
|
-
};
|
|
788
|
-
var _onChange = function onChange(event) {
|
|
789
|
-
if (props.disabled || props.readonly) {
|
|
790
|
-
return;
|
|
791
|
-
}
|
|
792
|
-
if (props.onChange) {
|
|
793
|
-
var _props$onChange;
|
|
794
|
-
var _checked = isChecked();
|
|
795
|
-
var value = _checked ? props.falseValue : props.trueValue;
|
|
796
|
-
var eventData = {
|
|
797
|
-
originalEvent: event,
|
|
798
|
-
value: props.value,
|
|
799
|
-
checked: value,
|
|
800
|
-
stopPropagation: function stopPropagation() {
|
|
801
|
-
event === null || event === void 0 || event.stopPropagation();
|
|
802
|
-
},
|
|
803
|
-
preventDefault: function preventDefault() {
|
|
804
|
-
event === null || event === void 0 || event.preventDefault();
|
|
805
|
-
},
|
|
806
|
-
target: {
|
|
807
|
-
type: 'checkbox',
|
|
808
|
-
name: props.name,
|
|
809
|
-
id: props.id,
|
|
810
|
-
value: props.value,
|
|
811
|
-
checked: value
|
|
812
|
-
}
|
|
813
|
-
};
|
|
814
|
-
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
|
|
815
|
-
|
|
816
|
-
// do not continue if the user defined click wants to prevent
|
|
817
|
-
if (event.defaultPrevented) {
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
utils.DomHandler.focus(inputRef.current);
|
|
821
|
-
}
|
|
822
|
-
};
|
|
823
|
-
var _onFocus = function onFocus(event) {
|
|
824
|
-
var _props$onFocus;
|
|
825
|
-
setFocusedState(true);
|
|
826
|
-
props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
827
|
-
};
|
|
828
|
-
var _onBlur = function onBlur(event) {
|
|
829
|
-
var _props$onBlur;
|
|
830
|
-
setFocusedState(false);
|
|
831
|
-
props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
|
|
832
|
-
};
|
|
833
|
-
React__namespace.useImperativeHandle(ref, function () {
|
|
834
|
-
return {
|
|
835
|
-
props: props,
|
|
836
|
-
focus: function focus() {
|
|
837
|
-
return utils.DomHandler.focus(inputRef.current);
|
|
838
|
-
},
|
|
839
|
-
getElement: function getElement() {
|
|
840
|
-
return elementRef.current;
|
|
841
|
-
},
|
|
842
|
-
getInput: function getInput() {
|
|
843
|
-
return inputRef.current;
|
|
844
|
-
}
|
|
845
|
-
};
|
|
846
|
-
});
|
|
847
|
-
React__namespace.useEffect(function () {
|
|
848
|
-
utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
849
|
-
}, [inputRef, props.inputRef]);
|
|
850
|
-
hooks.useUpdateEffect(function () {
|
|
851
|
-
inputRef.current.checked = isChecked();
|
|
852
|
-
}, [props.checked, props.trueValue]);
|
|
853
|
-
hooks.useMountEffect(function () {
|
|
854
|
-
if (props.autoFocus) {
|
|
855
|
-
utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
856
|
-
}
|
|
857
|
-
});
|
|
858
|
-
var checked = isChecked();
|
|
859
|
-
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
860
|
-
var otherProps = CheckboxBase.getOtherProps(props);
|
|
861
|
-
var rootProps = mergeProps({
|
|
862
|
-
id: props.id,
|
|
863
|
-
className: utils.classNames(props.className, cx('root', {
|
|
864
|
-
checked: checked,
|
|
865
|
-
context: context
|
|
866
|
-
})),
|
|
867
|
-
style: props.style,
|
|
868
|
-
'data-p-highlight': checked,
|
|
869
|
-
'data-p-disabled': props.disabled,
|
|
870
|
-
onContextMenu: props.onContextMenu,
|
|
871
|
-
onMouseDown: props.onMouseDown
|
|
872
|
-
}, otherProps, ptm('root'));
|
|
873
|
-
var createInputElement = function createInputElement() {
|
|
874
|
-
var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
|
|
875
|
-
var inputProps = mergeProps(_objectSpread$5({
|
|
876
|
-
id: props.inputId,
|
|
877
|
-
type: 'checkbox',
|
|
878
|
-
className: cx('input'),
|
|
879
|
-
name: props.name,
|
|
880
|
-
tabIndex: props.tabIndex,
|
|
881
|
-
onFocus: function onFocus(e) {
|
|
882
|
-
return _onFocus(e);
|
|
883
|
-
},
|
|
884
|
-
onBlur: function onBlur(e) {
|
|
885
|
-
return _onBlur(e);
|
|
886
|
-
},
|
|
887
|
-
onChange: function onChange(e) {
|
|
888
|
-
return _onChange(e);
|
|
889
|
-
},
|
|
890
|
-
disabled: props.disabled,
|
|
891
|
-
readOnly: props.readOnly,
|
|
892
|
-
required: props.required,
|
|
893
|
-
'aria-invalid': props.invalid,
|
|
894
|
-
checked: checked
|
|
895
|
-
}, ariaProps), ptm('input'));
|
|
896
|
-
return /*#__PURE__*/React__namespace.createElement("input", _extends({
|
|
897
|
-
ref: inputRef
|
|
898
|
-
}, inputProps));
|
|
899
|
-
};
|
|
900
|
-
var createBoxElement = function createBoxElement() {
|
|
901
|
-
var iconProps = mergeProps({
|
|
902
|
-
className: cx('icon')
|
|
903
|
-
}, ptm('icon'));
|
|
904
|
-
var boxProps = mergeProps({
|
|
905
|
-
className: cx('box', {
|
|
906
|
-
checked: checked
|
|
907
|
-
}),
|
|
908
|
-
'data-p-highlight': checked,
|
|
909
|
-
'data-p-disabled': props.disabled
|
|
910
|
-
}, ptm('box'));
|
|
911
|
-
var icon = checked ? props.icon || /*#__PURE__*/React__namespace.createElement(check.CheckIcon, iconProps) : null;
|
|
912
|
-
var checkboxIcon = utils.IconUtils.getJSXIcon(icon, _objectSpread$5({}, iconProps), {
|
|
913
|
-
props: props,
|
|
914
|
-
checked: checked
|
|
915
|
-
});
|
|
916
|
-
return /*#__PURE__*/React__namespace.createElement("div", boxProps, checkboxIcon);
|
|
917
|
-
};
|
|
918
|
-
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
919
|
-
ref: elementRef
|
|
920
|
-
}, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
|
|
921
|
-
target: elementRef,
|
|
922
|
-
content: props.tooltip,
|
|
923
|
-
pt: ptm('tooltip')
|
|
924
|
-
}, props.tooltipOptions)));
|
|
925
|
-
}));
|
|
926
|
-
Checkbox.displayName = 'Checkbox';
|
|
927
|
-
|
|
928
928
|
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; } } }; }
|
|
929
929
|
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); }
|
|
930
930
|
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; }
|
|
@@ -2779,28 +2779,27 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
2779
2779
|
}
|
|
2780
2780
|
multiSortMeta = multiSortMeta.length > 0 ? multiSortMeta : null;
|
|
2781
2781
|
};
|
|
2782
|
-
var
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2782
|
+
var _sortSingle = function sortSingle(_ref) {
|
|
2783
|
+
var data = _ref.data,
|
|
2784
|
+
field = _ref.field,
|
|
2785
|
+
order = _ref.order;
|
|
2786
2786
|
var value = _toConsumableArray(data);
|
|
2787
2787
|
if (columnSortable.current && columnSortFunction.current) {
|
|
2788
2788
|
value = columnSortFunction.current({
|
|
2789
2789
|
data: data,
|
|
2790
|
-
field:
|
|
2791
|
-
order:
|
|
2790
|
+
field: field,
|
|
2791
|
+
order: order
|
|
2792
2792
|
});
|
|
2793
2793
|
} else {
|
|
2794
2794
|
// performance optimization to prevent resolving field data in each loop
|
|
2795
2795
|
var lookupMap = new Map();
|
|
2796
|
-
var sortField = getSortField();
|
|
2797
2796
|
var comparator = utils.ObjectUtils.localeComparator(context && context.locale || PrimeReact__default["default"].locale);
|
|
2798
2797
|
var _iterator = _createForOfIteratorHelper(data),
|
|
2799
2798
|
_step;
|
|
2800
2799
|
try {
|
|
2801
2800
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2802
2801
|
var node = _step.value;
|
|
2803
|
-
lookupMap.set(node.data, utils.ObjectUtils.resolveFieldData(node.data,
|
|
2802
|
+
lookupMap.set(node.data, utils.ObjectUtils.resolveFieldData(node.data, field));
|
|
2804
2803
|
}
|
|
2805
2804
|
} catch (err) {
|
|
2806
2805
|
_iterator.e(err);
|
|
@@ -2810,24 +2809,24 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
2810
2809
|
value.sort(function (node1, node2) {
|
|
2811
2810
|
var value1 = lookupMap.get(node1.data);
|
|
2812
2811
|
var value2 = lookupMap.get(node2.data);
|
|
2813
|
-
return compareValuesOnSort(value1, value2, comparator,
|
|
2812
|
+
return compareValuesOnSort(value1, value2, comparator, order);
|
|
2814
2813
|
});
|
|
2815
2814
|
for (var i = 0; i < value.length; i++) {
|
|
2816
2815
|
if (value[i].children && value[i].children.length) {
|
|
2817
|
-
value[i].children =
|
|
2816
|
+
value[i].children = _sortSingle({
|
|
2817
|
+
data: value[i].children,
|
|
2818
|
+
field: field,
|
|
2819
|
+
order: order
|
|
2820
|
+
});
|
|
2818
2821
|
}
|
|
2819
2822
|
}
|
|
2820
2823
|
}
|
|
2821
2824
|
return value;
|
|
2822
2825
|
};
|
|
2823
|
-
var
|
|
2824
|
-
var
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
}
|
|
2828
|
-
return data;
|
|
2829
|
-
};
|
|
2830
|
-
var _sortMultipleNodes = function sortMultipleNodes(data, multiSortMeta) {
|
|
2826
|
+
var _sortMultiple = function sortMultiple(_ref2) {
|
|
2827
|
+
var data = _ref2.data,
|
|
2828
|
+
_ref2$multiSortMeta = _ref2.multiSortMeta,
|
|
2829
|
+
multiSortMeta = _ref2$multiSortMeta === void 0 ? [] : _ref2$multiSortMeta;
|
|
2831
2830
|
var value = _toConsumableArray(data);
|
|
2832
2831
|
var comparator = utils.ObjectUtils.localeComparator(context && context.locale || PrimeReact__default["default"].locale);
|
|
2833
2832
|
value.sort(function (node1, node2) {
|
|
@@ -2835,7 +2834,10 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
2835
2834
|
});
|
|
2836
2835
|
for (var i = 0; i < value.length; i++) {
|
|
2837
2836
|
if (value[i].children && value[i].children.length) {
|
|
2838
|
-
value[i].children =
|
|
2837
|
+
value[i].children = _sortMultiple({
|
|
2838
|
+
data: value[i].children,
|
|
2839
|
+
multiSortMeta: multiSortMeta
|
|
2840
|
+
});
|
|
2839
2841
|
}
|
|
2840
2842
|
}
|
|
2841
2843
|
return value;
|
|
@@ -2894,10 +2896,10 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
2894
2896
|
filters = filters || props.filters;
|
|
2895
2897
|
var cloned = {};
|
|
2896
2898
|
if (filters) {
|
|
2897
|
-
Object.entries(filters).forEach(function (
|
|
2898
|
-
var
|
|
2899
|
-
prop =
|
|
2900
|
-
value =
|
|
2899
|
+
Object.entries(filters).forEach(function (_ref3) {
|
|
2900
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
2901
|
+
prop = _ref4[0],
|
|
2902
|
+
value = _ref4[1];
|
|
2901
2903
|
cloned[prop] = value;
|
|
2902
2904
|
});
|
|
2903
2905
|
} else {
|
|
@@ -3396,12 +3398,12 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
3396
3398
|
}
|
|
3397
3399
|
}
|
|
3398
3400
|
};
|
|
3399
|
-
var isFilterMatched = function isFilterMatched(node,
|
|
3400
|
-
var filterField =
|
|
3401
|
-
filterValue =
|
|
3402
|
-
filterConstraint =
|
|
3403
|
-
isStrictMode =
|
|
3404
|
-
options =
|
|
3401
|
+
var isFilterMatched = function isFilterMatched(node, _ref5) {
|
|
3402
|
+
var filterField = _ref5.filterField,
|
|
3403
|
+
filterValue = _ref5.filterValue,
|
|
3404
|
+
filterConstraint = _ref5.filterConstraint,
|
|
3405
|
+
isStrictMode = _ref5.isStrictMode,
|
|
3406
|
+
options = _ref5.options;
|
|
3405
3407
|
var matched = false;
|
|
3406
3408
|
var dataFieldValue = utils.ObjectUtils.resolveFieldData(node.data, filterField);
|
|
3407
3409
|
if (filterConstraint(dataFieldValue, filterValue, props.filterLocale, options)) {
|
|
@@ -3426,6 +3428,7 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
3426
3428
|
if (data && data.length) {
|
|
3427
3429
|
var filters = localState && localState.filters || getFilters();
|
|
3428
3430
|
var sortField = localState && localState.sortField || getSortField();
|
|
3431
|
+
var sortOrder = localState && localState.sortOrder || getSortOrder();
|
|
3429
3432
|
var multiSortMeta = localState && localState.multiSortMeta || getMultiSortMeta();
|
|
3430
3433
|
var columns = getColumns();
|
|
3431
3434
|
var sortColumn = columns.find(function (col) {
|
|
@@ -3440,9 +3443,16 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
3440
3443
|
}
|
|
3441
3444
|
if (sortField || utils.ObjectUtils.isNotEmpty(multiSortMeta)) {
|
|
3442
3445
|
if (props.sortMode === 'single') {
|
|
3443
|
-
data =
|
|
3446
|
+
data = _sortSingle({
|
|
3447
|
+
data: data,
|
|
3448
|
+
field: sortField,
|
|
3449
|
+
order: sortOrder
|
|
3450
|
+
});
|
|
3444
3451
|
} else if (props.sortMode === 'multiple') {
|
|
3445
|
-
data =
|
|
3452
|
+
data = _sortMultiple({
|
|
3453
|
+
data: data,
|
|
3454
|
+
multiSortMeta: multiSortMeta
|
|
3455
|
+
});
|
|
3446
3456
|
}
|
|
3447
3457
|
}
|
|
3448
3458
|
}
|
|
@@ -3738,4 +3748,4 @@ this.primereact.treetable = (function (exports, React, PrimeReact, componentbase
|
|
|
3738
3748
|
|
|
3739
3749
|
return exports;
|
|
3740
3750
|
|
|
3741
|
-
})({}, React, primereact.api, primereact.componentbase, primereact.utils, primereact.hooks, primereact.icons.arrowdown, primereact.icons.arrowup, primereact.icons.spinner, primereact.paginator, primereact.icons.check, primereact.icons.chevrondown, primereact.icons.chevronright, primereact.icons.minus, primereact.ripple, primereact.overlayservice, primereact.
|
|
3751
|
+
})({}, React, primereact.api, primereact.componentbase, primereact.utils, primereact.hooks, primereact.icons.arrowdown, primereact.icons.arrowup, primereact.icons.spinner, primereact.paginator, primereact.icons.check, primereact.tooltip, primereact.icons.chevrondown, primereact.icons.chevronright, primereact.icons.minus, primereact.ripple, primereact.overlayservice, primereact.icons.sortalt, primereact.icons.sortamountdown, primereact.icons.sortamountupalt, primereact.inputtext);
|